PageSourceSearch

https://www.countdown-timer.app/_next/static/chunks/pages/_app-275486a2520696e7.js

js countdown-timer.app collected 2026-10-06 08:01:38 UTC 951,837 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{88036:function(e,t,n){"use strict";n.d(t,{hJ:function(){return _f},at:function(){return gf},oe:function(){return Tp},JU:function(){return wf},ad:function(){return Cf},LV:function(){return Tf},cf:function(){return Cp},Xo:function(){return dp},j5:function(){return Rp},n3:function(){return Pp},IO:function(){return ap},iE:function(){return Sf},r7:function(){return Ep},ar:function(){return up},qs:function(){return Fp}});var r,i=n(25816),s=n(8463),o=n(53333),a=n(74444),c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},u={},l=l||{},h=c||self;function d(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 g(e,t,n){return e.call.apply(e.bind,arguments)}function y(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function v(e,t,n){return(v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?g:y).apply(null,arguments)}function b(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function _(e,t){function n(){}n.prototype=t.prototype,e.$=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.ac=function(e,n,r){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return t.prototype[n].apply(e,i)}}function w(){this.s=this.s,this.o=this.o}w.prototype.s=!1,w.prototype.sa=function(){var e;!this.s&&(this.s=!0,this.N(),0)&&(e=this,Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++m))},w.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};const S=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"===typeof e)return"string"!==typeof t||1!=t.length?-1:e.indexOf(t,0);for(let n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1};function k(e){const t=e.length;if(0<t){const n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function I(e,t){for(let n=1;n<arguments.length;n++){const t=arguments[n];if(d(t)){const n=e.length||0,r=t.length||0;e.length=n+r;for(let i=0;i<r;i++)e[n+i]=t[i]}else e.push(t)}}function E(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}E.prototype.h=function(){this.defaultPrevented=!0};var T=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{h.addEventListener("test",(()=>{}),t),h.removeEventListener("test",(()=>{}),t)}catch(n){}return e}();function C(e){return/^[\s\xa0]*$/.test(e)}function x(){var e=h.navigator;return e&&(e=e.userAgent)?e:""}function O(e){return-1!=x().indexOf(e)}function A(e){return A[" "](e),e}A[" "]=function(){};var R,N,D=O("Opera"),P=O("Trident")||O("MSIE"),L=O("Edge"),M=L||P,F=O("Gecko")&&!(-1!=x().toLowerCase().indexOf("webkit")&&!O("Edge"))&&!(O("Trident")||O("MSIE"))&&!O("Edge"),j=-1!=x().toLowerCase().indexOf("webkit")&&!O("Edge");function U(){var e=h.document;return e?e.documentMode:void 0}e:{var $="",B=function(){var e=x();return F?/rv:([^\);]+)(\)|;)/.exec(e):L?/Edge\/([\d\.]+)/.exec(e):P?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(e):j?/WebKit\/(\S+)/.exec(e):D?/(?:Version)[ \/]?(\S+)/.exec(e):void 0}();if(B&&($=B?B[1]:""),P){var V=U();if(null!=V&&V>parseFloat($)){R=String(V);break e}}R=$}if(h.document&&P){var z=U();N=z||(parseInt(R,10)||void 0)}else N=void 0;var q=N;function H(e,t){if(E.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(F){e:{try{A(t.nodeName);var i=!0;break e}catch(s){}i=!1}i||(t=null)}}
vendor: 9,927 bytes, line 1
1else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"===typeof e.pointerType?e.pointerType:W[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&H.$.h.call(this)}}_(H,E);var W={2:"touch",3:"pen",4:"mouse"};H.prototype.h=function(){H.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var G="closure_listenable_"+(1e6*Math.random()|0),K=0;function X(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.la=i,this.key=++K,this.fa=this.ia=!1}function J(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function Y(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function Q(e){const t={};for(const n in e)t[n]=e[n];return t}const Z="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ee(e,t){let n,r;for(let i=1;i<arguments.length;i++){for(n in r=arguments[i],r)e[n]=r[n];for(let t=0;t<Z.length;t++)n=Z[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function te(e){this.src=e,this.g={},this.h=0}function ne(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],s=S(i,t);(r=0<=s)&&Array.prototype.splice.call(i,s,1),r&&(J(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function re(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i];if(!s.fa&&s.listener==t&&s.capture==!!n&&s.la==r)return i}return-1}te.prototype.add=function(e,t,n,r,i){var s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);var o=re(e,t,r,i);return-1<o?(t=e[o],n||(t.ia=!1)):((t=new X(t,this.src,s,!!r,i)).ia=n,e.push(t)),t};var ie="closure_lm_"+(1e6*Math.random()|0),se={};function oe(e,t,n,r,i){if(r&&r.once)return ce(e,t,n,r,i);if(Array.isArray(t)){for(var s=0;s<t.length;s++)oe(e,t[s],n,r,i);return null}return n=me(n),e&&e[G]?e.O(t,n,f(r)?!!r.capture:!!r,i):ae(e,t,n,!1,r,i)}function ae(e,t,n,r,i,s){if(!t)throw Error("Invalid event type");var o=f(i)?!!i.capture:!!i,a=fe(e);if(a||(e[ie]=a=new te(e)),(n=a.add(t,n,r,o,s)).proxy)return n;if(r=function(){function e(n){return t.call(e.src,e.listener,n)}const t=de;return e}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)T||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(he(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ce(e,t,n,r,i){if(Array.isArray(t)){for(var s=0;s<t.length;s++)ce(e,t[s],n,r,i);return null}return n=me(n),e&&e[G]?e.P(t,n,f(r)?!!r.capture:!!r,i):ae(e,t,n,!0,r,i)}function ue(e,t,n,r,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)ue(e,t[s],n,r,i);else r=f(r)?!!r.capture:!!r,n=me(n),e&&e[G]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=re(s=e.g[t],n,r,i))&&(J(s[n]),Array.prototype.splice.call(s,n,1),0==s.length&&(delete e.g[t],e.h--)))):e&&(e=fe(e))&&(t=e.g[t.toString()],e=-1,t&&(e=re(t,n,r,i)),(n=-1<e?t[e]:null)&&le(n))}function le(e){if("number"!==typeof e&&e&&!e.fa){var t=e.src;if(t&&t[G])ne(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(he(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=fe(t))?(ne(n,e),0==n.h&&(n.src=null,t[ie]=null)):J(e)}}}function he(e){return e in se?se[e]:se[e]="on"+e}function de(e,t){if(e.fa)e=!0;else{t=new H(t,this);var n=e.listener,r=e.la||e.src;e.ia&&le(e),e=n.call(r,t)}return e}function fe(e){return(e=e[ie])instanceof te?e:null}var pe="__closure_events_fn_"+(1e9*Math.random()>>>0);function me(e){return"function"===typeof e?e:(e[pe]||(e[pe]=function(t){return e.handleEvent(t)}),e[pe])}function ge(){w.call(this),this.i=new te(this),this.S=this,this.J=null}function ye(e,t){var n,r=e.J;if(r)for(n=[];r;r=r.J)n.push(r);if(e=e.S,r=t.type||t,"string"===typeof t)t=new E(t,e);else if(t instanceof E)t.target=t.target||e;else{var i=t;ee(t=new E(r,e),i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=t.g=n[s];i=ve(o,r,!0,t)&&i}if(i=ve(o=t.g=e,r,!0,t)&&i,i=ve(o,r,!1,t)&&i,n)for(s=0;s<n.length;s++)i=ve(o=t.g=n[s],r,!1,t)&&i}function ve(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,s=0;s<t.length;++s){var o=t[s];if(o&&!o.fa&&o.capture==n){var a=o.listener,c=o.la||o.src;o.ia&&ne(e.i,o),i=!1!==a.call(c,r)&&i}}return i&&!r.defaultPrevented}_(ge,w),ge.prototype[G]=!0,ge.prototype.removeEventListener=function(e,t,n,r){ue(this,e,t,n,r)},ge.prototype.N=function(){if(ge.$.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)J(n[r]);delete t.g[e],t.h--}}this.J=null},ge.prototype.O=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},ge.prototype.P=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};var be=h.JSON.stringify;function _e(){var e=Ce;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var we=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}((()=>new Se),(e=>e.reset()));class Se{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}function ke(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function Ie(e){h.setTimeout((()=>{throw e}),0)}let Ee,Te=!1,Ce=new class{constructor(){this.h=this.g=null}add(e,t){const n=we.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},xe=()=>{const e=h.Promise.resolve(void 0);Ee=()=>{e.then(Oe)}};var Oe=()=>{for(var e;e=_e();){try{e.h.call(e.g)}catch(n){Ie(n)}var t=we;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}Te=!1};function Ae(e,t){ge.call(this),this.h=e||1,this.g=t||h,this.j=v(this.qb,this),this.l=Date.now()}function Re(e){e.ga=!1,e.T&&(e.g.clearTimeout(e.T),e.T=null)}function Ne(e,t,n){if("function"===typeof e)n&&(e=v(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=v(e.handleEvent,e)}return 2147483647<Number(t)?-1:h.setTimeout(e,t||0)}function De(e){e.g=Ne((()=>{e.g=null,e.i&&(e.i=!1,De(e))}),e.j);const t=e.h;e.h=null,e.m.apply(null,t)}_(Ae,ge),(r=Ae.prototype).ga=!1,r.T=null,r.qb=function(){if(this.ga){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-e):(this.T&&(this.g.clearTimeout(this.T),this.T=null),ye(this,"tick"),this.ga&&(Re(this),this.start()))}},r.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())},r.N=function(){Ae.$.N.call(this),Re(this),delete this.g};class Pe extends w{constructor(e,t){super(),this.m=e,this.j=t,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:De(this)}N(){super.N(),this.g&&(h.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Le(e){w.call(this),this.h=e,this.g={}}_(Le,w);var Me=[];function Fe(e,t,n,r){Array.isArray(n)||(n&&(Me[0]=n.toString()),n=Me);for(var i=0;i<n.length;i++){var s=oe(t,n[i],r||e.handleEvent,!1,e.h||e);if(!s)break;e.g[s.key]=s}}function je(e){Y(e.g,(function(e,t){this.g.hasOwnProperty(t)&&le(e)}),e),e.g={}}function Ue(){this.g=!0}function $e(e,t,n,r){e.info((function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var o=1;o<i.length;o++)i[o]=""}}}return be(n)}catch(a){return t}}(e,n)+(r?" "+r:"")}))}Le.prototype.N=function(){Le.$.N.call(this),je(this)},Le.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Ue.prototype.Ea=function(){this.g=!1},Ue.prototype.info=function(){};var Be={},Ve=null;function ze(){return Ve=Ve||new ge}function qe(e){E.call(this,Be.Ta,e)}function He(e){const t=ze();ye(t,new qe(t))}function We(e,t){E.call(this,Be.STAT_EVENT,e),this.stat=t}function Ge(e){const t=ze();ye(t,new We(t,e))}function Ke(e,t){E.call(this,Be.Ua,e),this.size=t}function Xe(e,t){if("function"!==typeof e)throw Error("Fn must not be null and must be a function");return h.setTimeout((function(){e()}),t)}Be.Ta="serverreachability",_(qe,E),Be.STAT_EVENT="statevent",_(We,E),Be.Ua="timingevent",_(Ke,E);var Je={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},Ye={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function Qe(){}function Ze(e){return e.h||(e.h=e.i())}function et(){}Qe.prototype.h=null;var tt,nt={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function rt(){E.call(this,"d")}function it(){E.call(this,"c")}function st(){}function ot(e,t,n,r){this.l=e,this.j=t,this.m=n,this.W=r||1,this.U=new Le(this),this.P=ct,e=M?125:void 0,this.V=new Ae(e),this.I=null,this.i=!1,this.s=this.A=this.v=this.L=this.G=this.Y=this.B=null,this.F=[],this.g=null,this.C=0,this.o=this.u=null,this.ca=-1,this.J=!1,this.O=0,this.M=null,this.ba=this.K=this.aa=this.S=!1,this.h=new at}function at(){this.i=null,this.g="",this.h=!1}_(rt,E),_(it,E),_(st,Qe),st.prototype.g=function(){return new XMLHttpRequest},st.prototype.i=function(){return{}},tt=new st;var ct=45e3,ut={},lt={};function ht(e,t,n){e.L=1,e.v=At(Et(t)),e.s=n,e.S=!0,dt(e,null)}function dt(e,t){e.G=Date.now(),gt(e),e.A=Et(e.v);var n=e.A,r=e.W;Array.isArray(r)||(r=[String(r)]),zt(n.i,"t",r),e.C=0,n=e.l.J,e.h=new at,e.g
1=zn(e.l,n?t:null,!e.s),0<e.O&&(e.M=new Pe(v(e.Pa,e,e.g),e.O)),Fe(e.U,e.g,"readystatechange",e.nb),t=e.I?Q(e.I):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ha(e.A,e.u,e.s,t)):(e.u="GET",e.g.ha(e.A,e.u,null,t)),He(),function(e,t,n,r,i,s){e.info((function(){if(e.g)if(s)for(var o="",a=s.split("&"),c=0;c<a.length;c++){var u=a[c].split("=");if(1<u.length){var l=u[0];u=u[1];var h=l.split("_");o=2<=h.length&&"type"==h[1]?o+(l+"=")+u+"&":o+(l+"=redacted&")}}else o=null;else o=s;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o}))}(e.j,e.u,e.A,e.m,e.W,e.s)}function ft(e){return!!e.g&&("GET"==e.u&&2!=e.L&&e.l.Ha)}function pt(e,t,n){let r,i=!0;for(;!e.J&&e.C<n.length;){if(r=mt(e,n),r==lt){4==t&&(e.o=4,Ge(14),i=!1),$e(e.j,e.m,null,"[Incomplete Response]");break}if(r==ut){e.o=4,Ge(15),$e(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}$e(e.j,e.m,r,null),wt(e,r)}ft(e)&&r!=lt&&r!=ut&&(e.h.g="",e.C=0),4!=t||0!=n.length||e.h.h||(e.o=1,Ge(16),i=!1),e.i=e.i&&i,i?0<n.length&&!e.ba&&(e.ba=!0,(t=e.l).g==e&&t.ca&&!t.M&&(t.l.info("Great, no buffering proxy detected. Bytes received: "+n.length),Ln(t),t.M=!0,Ge(11))):($e(e.j,e.m,n,"[Invalid Chunked Response]"),_t(e),bt(e))}function mt(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?lt:(n=Number(t.substring(n,r)),isNaN(n)?ut:(r+=1)+n>t.length?lt:(t=t.slice(r,r+n),e.C=r+n,t))}function gt(e){e.Y=Date.now()+e.P,yt(e,e.P)}function yt(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Xe(v(e.lb,e),t)}function vt(e){e.B&&(h.clearTimeout(e.B),e.B=null)}function bt(e){0==e.l.H||e.J||jn(e.l,e)}function _t(e){vt(e);var t=e.M;t&&"function"==typeof t.sa&&t.sa(),e.M=null,Re(e.V),je(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function wt(e,t){try{var n=e.l;if(0!=n.H&&(n.g==e||Xt(n.i,e)))if(!e.K&&Xt(n.i,e)&&3==n.H){try{var r=n.Ja.g.parse(t)}catch(u){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.u){if(n.g){if(!(n.g.G+3e3<e.G))break e;Fn(n),Cn(n)}Pn(n),Ge(18)}}else n.Fa=i[1],0<n.Fa-n.V&&37500>i[2]&&n.G&&0==n.A&&!n.v&&(n.v=Xe(v(n.ib,n),6e3));if(1>=Kt(n.i)&&n.oa){try{n.oa()}catch(u){}n.oa=void 0}}else $n(n,11)}else if((e.K||n.g==e)&&Fn(n),!C(t))for(i=n.Ja.g.parse(t),t=0;t<i.length;t++){let u=i[t];if(n.V=u[0],u=u[1],2==n.H)if("c"==u[0]){n.K=u[1],n.pa=u[2];const t=u[3];null!=t&&(n.ra=t,n.l.info("VER="+n.ra));const i=u[4];null!=i&&(n.Ga=i,n.l.info("SVER="+n.Ga));const l=u[5];null!=l&&"number"===typeof l&&0<l&&(r=1.5*l,n.L=r,n.l.info("backChannelRequestTimeoutMs_="+r)),r=n;const h=e.g;if(h){const e=h.g?h.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=r.i;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(Jt(s,s.h),s.h=null))}if(r.F){const e=h.g?h.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.Da=e,Ot(r.I,r.F,e))}}n.H=3,n.h&&n.h.Ba(),n.ca&&(n.S=Date.now()-e.G,n.l.info("Handshake RTT: "+n.S+"ms"));var o=e;if((r=n).wa=Vn(r,r.J?r.pa:null,r.Y),o.K){Yt(r.i,o);var a=o,c=r.L;c&&a.setTimeout(c),a.B&&(vt(a),gt(a)),r.g=o}else Dn(r);0<n.j.length&&On(n)}else"stop"!=u[0]&&"close"!=u[0]||$n(n,7);else 3==n.H&&("stop"==u[0]||"close"==u[0]?"stop"==u[0]?$n(n,7):Tn(n):"noop"!=u[0]&&n.h&&n.h.Aa(u),n.A=0)}He()}catch(u){}}function St(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(d(e)||"string"===typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.ta&&"function"==typeof e.ta)return e.ta();if(!e.Z||"function"!=typeof e.Z){if("undefined"!==typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!==typeof Set&&e instanceof Set)){if(d(e)||"string"===typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const r in e)t[n++]=r;return t}}}(e),r=function(e){if(e.Z&&"function"==typeof e.Z)return e.Z();if("undefined"!==typeof Map&&e instanceof Map||"undefined"!==typeof Set&&e instanceof Set)return Array.from(e.values());if("string"===typeof e)return e.split("");if(d(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length,s=0;s<i;s++)t.call(void 0,r[s],n&&n[s],e)}(r=ot.prototype).setTimeout=function(e){this.P=e},r.nb=function(e){e=e.target;const t=this.M;t&&3==_n(e)?t.l():this.Pa(e)},r.Pa=function(e){try{if(e==this.g)e:{const l=_n(this.g);var t=this.g.Ia();this.g.da();if(!(3>l)&&(3!=l||M||this.g&&(this.h.h||this.g.ja()||wn(this.g)))){this.J||4!=l||7==t||He(),vt(this);var n=this.g.da();this.ca=n;t:if(ft(this)){var r=wn(this.g);e="";var i=r.length,s=4==_n(this.g);if(!this.h.i){if("undefined"===typeof TextDecoder){_t(this),bt(this);var o="";break t}this.h.i=new h.TextDecoder}for(t=0;t<i;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:s&&t==i-1});r.splice(0,i),this.h.g+=e,this.C=0,o=this.h.g}else o=this.g.ja();if(this.i=200==n,function(e,t,n,r,i,s,o){e.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+s+" "+o}))}
1(this.j,this.u,this.A,this.m,this.W,l,n),this.i){if(this.aa&&!this.K){t:{if(this.g){var a,c=this.g;if((a=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!C(a)){var u=a;break t}}u=null}if(!(n=u)){this.i=!1,this.o=3,Ge(12),_t(this),bt(this);break e}$e(this.j,this.m,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,wt(this,n)}this.S?(pt(this,l,o),M&&this.i&&3==l&&(Fe(this.U,this.V,"tick",this.mb),this.V.start())):($e(this.j,this.m,o,null),wt(this,o)),4==l&&_t(this),this.i&&!this.J&&(4==l?jn(this.l,this):(this.i=!1,gt(this)))}else(function(e){const t={};e=(e.g&&2<=_n(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let r=0;r<e.length;r++){if(C(e[r]))continue;var n=ke(e[r]);const i=n[0];if("string"!==typeof(n=n[1]))continue;n=n.trim();const s=t[i]||[];t[i]=s,s.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,(function(e){return e.join(", ")}))})(this.g),400==n&&0<o.indexOf("Unknown SID")?(this.o=3,Ge(12)):(this.o=0,Ge(13)),_t(this),bt(this)}}}catch(l){}},r.mb=function(){if(this.g){var e=_n(this.g),t=this.g.ja();this.C<t.length&&(vt(this),pt(this,e,t),this.i&&4!=e&&gt(this))}},r.cancel=function(){this.J=!0,_t(this)},r.lb=function(){this.B=null;const e=Date.now();0<=e-this.Y?(function(e,t){e.info((function(){return"TIMEOUT: "+t}))}(this.j,this.A),2!=this.L&&(He(),Ge(17)),_t(this),this.o=2,bt(this)):yt(this,this.Y-e)};var kt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function It(e){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,e instanceof It){this.h=e.h,Tt(this,e.j),this.s=e.s,this.g=e.g,Ct(this,e.m),this.l=e.l;var t=e.i,n=new Ut;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),xt(this,n),this.o=e.o}else e&&(t=String(e).match(kt))?(this.h=!1,Tt(this,t[1]||"",!0),this.s=Rt(t[2]||""),this.g=Rt(t[3]||"",!0),Ct(this,t[4]),this.l=Rt(t[5]||"",!0),xt(this,t[6]||"",!0),this.o=Rt(t[7]||"")):(this.h=!1,this.i=new Ut(null,this.h))}function Et(e){return new It(e)}function Tt(e,t,n){e.j=n?Rt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function Ct(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function xt(e,t,n){t instanceof Ut?(e.i=t,function(e,t){t&&!e.j&&($t(e),e.i=null,e.g.forEach((function(e,t){var n=t.toLowerCase();t!=n&&(Bt(this,t),zt(this,n,e))}),e)),e.j=t}(e.i,e.h)):(n||(t=Nt(t,Ft)),e.i=new Ut(t,e.h))}function Ot(e,t,n){e.i.set(t,n)}function At(e){return Ot(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function Rt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Nt(e,t,n){return"string"===typeof e?(e=encodeURI(e).replace(t,Dt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Dt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}It.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Nt(t,Pt,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(Nt(t,Pt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(Nt(n,"/"==n.charAt(0)?Mt:Lt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.o)&&e.push("#",Nt(n,jt)),e.join("")};var Pt=/[#\/\?@]/g,Lt=/[#\?:]/g,Mt=/[#\?]/g,Ft=/[#\?@]/g,jt=/#/g;function Ut(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function $t(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var s=e[n].substring(0,r);i=e[n].substring(r+1)}else s=e[n];t(s,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,(function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)})))}function Bt(e,t){$t(e),t=qt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Vt(e,t){return $t(e),t=qt(e,t),e.g.has(t)}function zt(e,t,n){Bt(e,t),0<n.length&&(e.i=null,e.g.set(qt(e,t),k(n)),e.h+=n.length)}function qt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(r=Ut.prototype).add=function(e,t){$t(this),this.i=null,e=qt(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},r.forEach=function(e,t){$t(this),this.g.forEach((function(n,r){n.forEac
1h((function(n){e.call(t,n,r,this)}),this)}),this)},r.ta=function(){$t(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){const i=e[r];for(let e=0;e<i.length;e++)n.push(t[r])}return n},r.Z=function(e){$t(this);let t=[];if("string"===typeof e)Vt(this,e)&&(t=t.concat(this.g.get(qt(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},r.set=function(e,t){return $t(this),this.i=null,Vt(this,e=qt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},r.get=function(e,t){return e&&0<(e=this.Z(e)).length?String(e[0]):t},r.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];const s=encodeURIComponent(String(r)),o=this.Z(r);for(r=0;r<o.length;r++){var i=s;""!==o[r]&&(i+="="+encodeURIComponent(String(o[r]))),e.push(i)}}return this.i=e.join("&")};function Ht(e){this.l=e||Wt,h.PerformanceNavigationTiming?e=0<(e=h.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(h.g&&h.g.Ka&&h.g.Ka()&&h.g.Ka().ec),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var Wt=10;function Gt(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Kt(e){return e.h?1:e.g?e.g.size:0}function Xt(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Jt(e,t){e.g?e.g.add(t):e.h=t}function Yt(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Qt(e){if(null!=e.h)return e.i.concat(e.h.F);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.F);return t}return k(e.i)}Ht.prototype.cancel=function(){if(this.i=Qt(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var Zt;function en(){this.g=new class{stringify(e){return h.JSON.stringify(e,void 0)}parse(e){return h.JSON.parse(e,void 0)}}}function tn(e,t,n){const r=n||"";try{St(e,(function(e,n){let i=e;f(e)&&(i=be(e)),t.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw t.push(r+"type="+encodeURIComponent("_badmap")),i}}function nn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(s){}}function rn(e){this.l=e.fc||null,this.j=e.ob||!1}function sn(e,t){ge.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=on,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}_(rn,Qe),rn.prototype.g=function(){return new sn(this.l,this.j)},rn.prototype.i=(Zt={},function(){return Zt}),_(sn,ge);var on=0;function an(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}function cn(e){e.readyState=4,e.l=null,e.j=null,e.A=null,un(e)}function un(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(r=sn.prototype).open=function(e,t){if(this.readyState!=on)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,un(this)},r.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||h).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))},r.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch((()=>{})),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,cn(this)),this.readyState=on},r.$a=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,un(this)),this.g&&(this.readyState=3,un(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if("undefined"!==typeof h.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;an(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))},r.Xa=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)}
1e.done?cn(this):un(this),3==this.readyState&&an(this)}},r.Za=function(e){this.g&&(this.response=this.responseText=e,cn(this))},r.Ya=function(e){this.g&&(this.response=e,cn(this))},r.ka=function(){this.g&&cn(this)},r.setRequestHeader=function(e,t){this.v.append(e,t)},r.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(sn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var ln=h.JSON.parse;function hn(e){ge.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=dn,this.L=this.M=!1}_(hn,ge);var dn="",fn=/^https?$/i,pn=["POST","PUT"];function mn(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,gn(e),vn(e)}function gn(e){e.F||(e.F=!0,ye(e,"complete"),ye(e,"error"))}function yn(e){if(e.h&&"undefined"!=typeof l&&(!e.C[1]||4!=_n(e)||2!=e.da()))if(e.v&&4==_n(e))Ne(e.La,0,e);else if(ye(e,"readystatechange"),4==_n(e)){e.h=!1;try{const a=e.da();e:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var r;if(r=0===a){var i=String(e.I).match(kt)[1]||null;!i&&h.self&&h.self.location&&(i=h.self.location.protocol.slice(0,-1)),r=!fn.test(i?i.toLowerCase():"")}n=r}if(n)ye(e,"complete"),ye(e,"success");else{e.m=6;try{var s=2<_n(e)?e.g.statusText:""}catch(o){s=""}e.j=s+" ["+e.da()+"]",gn(e)}}finally{vn(e)}}}function vn(e,t){if(e.g){bn(e);const r=e.g,i=e.C[0]?()=>{}:null;e.g=null,e.C=null,t||ye(e,"ready");try{r.onreadystatechange=i}catch(n){}}}function bn(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(h.clearTimeout(e.A),e.A=null)}function _n(e){return e.g?e.g.readyState:0}function wn(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.K){case dn:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(Cr){return null}}function Sn(e){let t="";return Y(e,(function(e,n){t+=n,t+=":",t+=e,t+="\r\n"})),t}function kn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=Sn(n),"string"===typeof e?null!=n&&encodeURIComponent(String(n)):Ot(e,t,n))}function In(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function En(e){this.Ga=0,this.j=[],this.l=new Ue,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=In("failFast",!1,e),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=In("baseRetryDelayMs",5e3,e),this.hb=In("retryDelaySeedMs",1e4,e),this.eb=In("forwardChannelMaxRetries",2,e),this.xa=In("forwardChannelRequestTimeoutMs",2e4,e),this.va=e&&e.xmlHttpFactory||void 0,this.Ha=e&&e.dc||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.i=new Ht(e&&e.concurrentRequestLimit),this.Ja=new en,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=e&&e.bc||!1,e&&e.Ea&&this.l.Ea(),e&&e.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&e&&e.detectBufferingProxy||!1,this.qa=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.qa=e.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}function Tn(e){if(xn(e),3==e.H){var t=e.W++,n=Et(e.I);if(Ot(n,"SID",e.K),Ot(n,"RID",t),Ot(n,"TYPE","terminate"),Rn(e,n),(t=new ot(e,e.l,t)).L=2,t.v=At(Et(n)),n=!1,h.navigator&&h.navigator.sendBeacon)try{n=h.navigator.sendBeacon(t.v.toString(),"")}catch(r){}!n&&h.Image&&((new Image).src=t.v,n=!0),n||(t.g=zn(t.l,null),t.g.ha(t.v)),t.G=Date.now(),gt(t)}Bn(e)}function Cn(e){e.g&&(Ln(e),e.g.cancel(),e.g=null)}function xn(e){Cn(e),e.u&&(h.clearTimeout(e.u),e.u=null),Fn(e),e.i.cancel(),e.m&&("number"===typeof e.m&&h.clearTimeout(e.m),e.m=null)}function On(e){if(!Gt(e.i)&&!e.m){e.m=!0;var t=e.Na;Ee||xe(),Te||(Ee(),Te=!0),Ce.add(t,e),e.C=0}}function An(e,t){var n;n=t?t.m:e.W++;const r=Et(e.I);Ot(r,"SID",e.K),Ot(r,"RID",n),Ot(r,"AID",e.V),Rn(e,r),e.o&&e.s&&kn(r,e.o,e.s),n=new ot(e,e.l,n,e.C+1),null===e.o&&(n.I=e.s),t&&(e.j=t.F.concat(e.j)),t=Nn(e,n,1e3),n.setTimeout(
1Math.round(.5*e.xa)+Math.round(.5*e.xa*Math.random())),Jt(e.i,n),ht(n,r,t)}function Rn(e,t){e.na&&Y(e.na,(function(e,n){Ot(t,n,e)})),e.h&&St({},(function(e,n){Ot(t,n,e)}))}function Nn(e,t,n){n=Math.min(e.j.length,n);var r=e.h?v(e.h.Va,e.h,e):null;e:{var i=e.j;let t=-1;for(;;){const e=["count="+n];-1==t?0<n?(t=i[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let s=!0;for(let o=0;o<n;o++){let n=i[o].g;const a=i[o].map;if(n-=t,0>n)t=Math.max(0,i[o].g-100),s=!1;else try{tn(a,e,"req"+n+"_")}catch(jr){r&&r(a)}}if(s){r=e.join("&");break e}}}return e=e.j.splice(0,n),t.F=e,r}function Dn(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;Ee||xe(),Te||(Ee(),Te=!0),Ce.add(t,e),e.A=0}}function Pn(e){return!(e.g||e.u||3<=e.A)&&(e.ba++,e.u=Xe(v(e.Ma,e),Un(e,e.A)),e.A++,!0)}function Ln(e){null!=e.B&&(h.clearTimeout(e.B),e.B=null)}function Mn(e){e.g=new ot(e,e.l,"rpc",e.ba),null===e.o&&(e.g.I=e.s),e.g.O=0;var t=Et(e.wa);Ot(t,"RID","rpc"),Ot(t,"SID",e.K),Ot(t,"AID",e.V),Ot(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&Ot(t,"TO",e.qa),Ot(t,"TYPE","xmlhttp"),Rn(e,t),e.o&&e.s&&kn(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.v=At(Et(t)),n.s=null,n.S=!0,dt(n,e)}function Fn(e){null!=e.v&&(h.clearTimeout(e.v),e.v=null)}function jn(e,t){var n=null;if(e.g==t){Fn(e),Ln(e),e.g=null;var r=2}else{if(!Xt(e.i,t))return;n=t.F,Yt(e.i,t),r=1}if(0!=e.H)if(t.i)if(1==r){n=t.s?t.s.length:0,t=Date.now()-t.G;var i=e.C;ye(r=ze(),new Ke(r,n)),On(e)}else Dn(e);else if(3==(i=t.o)||0==i&&0<t.ca||!(1==r&&function(e,t){return!(Kt(e.i)>=e.i.j-(e.m?1:0))&&(e.m?(e.j=t.F.concat(e.j),!0):!(1==e.H||2==e.H||e.C>=(e.cb?0:e.eb))&&(e.m=Xe(v(e.Na,e,t),Un(e,e.C)),e.C++,!0))}(e,t)||2==r&&Pn(e)))switch(n&&0<n.length&&(t=e.i,t.i=t.i.concat(n)),i){case 1:$n(e,5);break;case 4:$n(e,10);break;case 3:$n(e,6);break;default:$n(e,2)}}function Un(e,t){let n=e.ab+Math.floor(Math.random()*e.hb);return e.isActive()||(n*=2),n*t}function $n(e,t){if(e.l.info("Error code "+t),2==t){var n=null;e.h&&(n=null);var r=v(e.pb,e);n||(n=new It("//www.google.com/images/cleardot.gif"),h.location&&"http"==h.location.protocol||Tt(n,"https"),At(n)),function(e,t){const n=new Ue;if(h.Image){const r=new Image;r.onload=b(nn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=b(nn,n,r,"TestLoadImage: error",!1,t),r.onabort=b(nn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=b(nn,n,r,"TestLoadImage: timeout",!1,t),h.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=e}else t(!1)}(n.toString(),r)}else Ge(2);e.H=0,e.h&&e.h.za(t),Bn(e),xn(e)}function Bn(e){if(e.H=0,e.ma=[],e.h){const t=Qt(e.i);0==t.length&&0==e.j.length||(I(e.ma,t),I(e.ma,e.j),e.i.i.length=0,k(e.j),e.j.length=0),e.h.ya()}}function Vn(e,t,n){var r=n instanceof It?Et(n):new It(n);if(""!=r.g)t&&(r.g=t+"."+r.g),Ct(r,r.m);else{var i=h.location;r=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var s=new It(null);r&&Tt(s,r),t&&(s.g=t),i&&Ct(s,i),n&&(s.l=n),r=s}return n=e.F,t=e.Da,n&&t&&Ot(r,n,t),Ot(r,"VER",e.ra),Rn(e,r),r}function zn(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=n&&e.Ha&&!e.va?new hn(new rn({ob:!0})):new hn(e.va)).Oa(e.J),t}function qn(){}function Hn(){if(P&&!(10<=Number(q)))throw Error("Environmental error: no available transport.")}function Wn(e,t){ge.call(this),this.g=new En(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.Ca&&(e?e["X-WebChannel-Client-Profile"]=t.Ca:e={"X-WebChannel-Client-Profile":t.Ca}),this.g.U=e,(e=t&&t.cc)&&!C(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!C(t)&&(this.g.F=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new Xn(this)}function Gn(e){rt.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function Kn(){it.call(this),this.status=1}function Xn(e){this.g=e}function Jn(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}
1function Yn(e,t,n){n||(n=0);var r=Array(16);if("string"===typeof t)for(var i=0;16>i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var s=e.g[3],o=t+(s^n&(i^s))+r[0]+3614090360&4294967295;o=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=n+(o<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[1]+3905402710&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[2]+606105819&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[3]+3250441966&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[4]+4118548399&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[5]+1200080426&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[6]+2821735955&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[7]+4249261313&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[8]+1770035416&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[9]+2336552879&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[10]+4294925233&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[11]+2304563134&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[12]+1804603682&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[13]+4254626195&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[14]+2792965006&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[15]+1236535329&4294967295)<<22&4294967295|o>>>10))+((o=t+(i^s&(n^i))+r[1]+4129170786&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[6]+3225465664&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[11]+643717713&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[0]+3921069994&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[5]+3593408605&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[10]+38016083&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[15]+3634488961&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[4]+3889429448&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[9]+568446438&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[14]+3275163606&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[3]+4107603335&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[8]+1163531501&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[13]+2850285829&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[2]+4243563512&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[7]+1735328473&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[12]+2368359562&4294967295)<<20&4294967295|o>>>12))+((o=t+(n^i^s)+r[5]+4294588738&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[8]+2272392833&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[11]+1839030562&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[14]+4259657740&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[1]+2763975236&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[4]+1272893353&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[7]+4139469664&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[10]+3200236656&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[13]+681279174&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[0]+3936430074&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[3]+3572445317&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[6]+76029189&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[9]+3654602809&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[12]+3873151461&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[15]+530742520&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[2]+3299628645&4294967295)<<23&4294967295|o>>>9))+((o=t+(i^(n|~s))+r[0]+4096336452&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[7]+1126891415&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[14]+2878612391&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[5]+4237533241&4294967295)<<21&4294967295|o>>>11))+((o=t+(i^(n|~s))+r[12]+1700485571&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[3]+2399980690&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[10]+4293915773&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[1]+2240044497&4294967295)<<21&4294967295|o>>>11))+((o=t+(i^(n|~s))+r[8]+1873313359&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[15]+4264355552&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[6]+2734768916&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[13]+1309151649&4294967295)<<21&4294967295|o>>>11))+((s=(t=n+((o=t+(i^(n|~s))+r[4]+4149444226&4294967295)<<6&4294967295|o>>>
126))+((o=s+(n^(t|~i))+r[11]+3174756917&4294967295)<<10&4294967295|o>>>22))^((i=s+((o=i+(t^(s|~n))+r[2]+718787259&4294967295)<<15&4294967295|o>>>17))|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}function Qn(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var s=0|e[i];r&&s==t||(n[i]=s,r=!1)}this.g=n}(r=hn.prototype).Oa=function(e){this.M=e},r.ha=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():tt.g(),this.C=this.u?Ze(this.u):Ze(tt),this.g.onreadystatechange=v(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(s){return void mn(this,s)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else{if("function"!==typeof r.keys||"function"!==typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(const e of r.keys())n.set(e,r.get(e))}r=Array.from(n.keys()).find((e=>"content-type"==e.toLowerCase())),i=h.FormData&&e instanceof h.FormData,!(0<=S(pn,t))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[o,a]of n)this.g.setRequestHeader(o,a);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{bn(this),0<this.B&&((this.L=function(e){return P&&"number"===typeof e.timeout&&void 0!==e.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=v(this.ua,this)):this.A=Ne(this.ua,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(s){mn(this,s)}},r.ua=function(){"undefined"!=typeof l&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,ye(this,"timeout"),this.abort(8))},r.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,ye(this,"complete"),ye(this,"abort"),vn(this))},r.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),vn(this,!0)),hn.$.N.call(this)},r.La=function(){this.s||(this.G||this.v||this.l?yn(this):this.kb())},r.kb=function(){yn(this)},r.isActive=function(){return!!this.g},r.da=function(){try{return 2<_n(this)?this.g.status:-1}catch(Zt){return-1}},r.ja=function(){try{return this.g?this.g.responseText:""}catch(Zt){return""}},r.Wa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),ln(t)}},r.Ia=function(){return this.m},r.Sa=function(){return"string"===typeof this.j?this.j:String(this.j)},(r=En.prototype).ra=8,r.H=1,r.Na=function(e){if(this.m)if(this.m=null,1==this.H){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;const i=new ot(this,this.l,e);let s=this.s;if(this.U&&(s?(s=Q(s),ee(s,this.U)):s=this.U),null!==this.o||this.O||(i.I=s,s=null),this.P)e:{for(var t=0,n=0;n<this.j.length;n++){var r=this.j[n];if(void 0===(r="__data__"in r.map&&"string"===typeof(r=r.map.__data__)?r.length:void 0))break;if(4096<(t+=r)){t=n;break e}if(4096===t||n===this.j.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=Nn(this,i,t),Ot(n=Et(this.I),"RID",e),Ot(n,"CVER",22),this.F&&Ot(n,"X-HTTP-Session-Id",this.F),Rn(this,n),s&&(this.O?t="headers="+encodeURIComponent(String(Sn(s)))+"&"+t:this.o&&kn(n,this.o,s)),Jt(this.i,i),this.bb&&Ot(n,"TYPE","init"),this.P?(Ot(n,"$req",t),Ot(n,"SID","null"),i.aa=!0,ht(i,n,null)):ht(i,n,t),this.H=2}}else 3==this.H&&(e?An(this,e):0==this.j.length||Gt(this.i)||An(this))},r.Ma=function(){if(this.u=null,Mn(this),this.ca&&!(this.M||null==this.g||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=Xe(v(this.jb,this),e)}},r.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,Ge(10),Cn(this),Mn(this))},r.ib=function(){null!=this.v&&(this.v=null,Cn(this),Pn(this),Ge(19))},r.pb=function(e){e?(this.l.info("Successfully pinged google.com"),Ge(2)):(this.l.info("Failed to ping google.com"),Ge(1))},r.isActive=function(){return!!this.h&&this.h.isActive(this)},(r=qn.prototype).Ba=function(){},r.Aa=function(){},r.za=function(){},r.ya=function(){},r.isActive=function(){return!0},r.Va=function(){},Hn.prototype.g=function(e,t){return new Wn(e,t)},_(Wn,ge),Wn.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var e=this.g,t=this.l,n=this.h||void 0;Ge(0),e.Y=t,e.na=n||{},e.G=e.aa,e.I=Vn(e,null,e.Y),On(e)},Wn.prototype.close=function(){Tn(this.g)},Wn.prototype.u=function(e){var t=this.g;if("string"===typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=be(e),e=n);t.j.push(new class{constructor(e,t){this.g=e,this.map=t}}(t.fb++,e)),3==t.H&&On(t)},Wn.prototype.N=function(){this.g.h=null,delete this.j,Tn(this.g),delete this.g,Wn.$.N.call(this)},_(Gn,rt),_(Kn,it),_(Xn,qn),Xn.prototype.Ba=function(){ye(this.g,"a")},Xn.prototype.Aa=function(e){ye(this.g,new Gn(e))},Xn.prototype.za=function(e){ye(this.g,new Kn)},Xn.prototype.ya=function(){ye(this.g,"b")},_(Jn,(function(){this.blockSize=-1})),Jn.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0},Jn.prototype.j=function(e,t){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=this.m,i=this.h,s=0;s<t;){if(0==i)for(;s<=n;)Yn(this,e,s),s+=this.blockSize;if("string"===typeof e){for(;s<t;)if(r[i++]=e.charCodeAt(s++),i==this.blockSize){Yn(this,r),i=0;break}}else for(;s<t;)if(r[i++]=e[s++],i==this.blockSize){Yn(this,r),i=0;break}}this.h=i,this.i+=t},Jn.prototype.l=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.i;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.j(e),e=Array(16),t=n=0;4>t;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var Zn={};function er(e){return-128<=e&&128>e?function(e,t){var n=Zn;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,(function(e){return new Qn([0|e],0>e?-1:0)})):new Qn([0|e],0>e?-1:0)}function tr(e){if(isNaN(e)||!isFinite(e))return rr;if(0>e)return cr(tr(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=nr;return new Qn(t,0)}var nr=4294967296,rr=er(0),ir=er(1),sr=er(16777216);function or(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function ar(e){return-1==e.h}function cr(e){for(var t=e.g.length,n=[],r=0;r<t;r++)n[r]=~e.g[r];return new Qn(n,~e.h).add(ir)}function ur(e,t){return e.add(cr(t))}function lr(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function hr(e,t){this.g=e,this.h=t}function dr(e,t){if(or(t))throw Error("division by zero");if(or(e))return new hr(rr,rr);if(ar(e))return t=dr(cr(e),t),new hr(cr(t.g),cr(t.h));if(ar(t))return t=dr(e,cr(t)),new hr(cr(t.g),t.h);if(30<e.g.length){if(ar(e)||ar(t))throw Error("slowDivide_ only works with positive integers.");for(var n=ir,r=t;0>=r.X(e);)n=fr(n),r=fr(r);var i=pr(n,1),s=pr(r,1);for(r=pr(r,2),n=pr(n,2);!or(r);){var o=s.add(r);0>=o.X(e)&&(i=i.add(n),s=o),r=pr(r,1),n=pr(n,1)}return t=ur(e,i.R(t)),new hr(i,t)}for(i=rr;0<=e.X(t);){for(n=Math.max(1,Math.floor(e.ea()/t.ea())),r=48>=(r=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,r-48),o=(s=tr(n)).R(t);ar(o)||0<o.X(e);)o=(s=tr(n-=r)).R(t);or(s)&&(s=ir),i=i.add(s),e=ur(e,o)}return new hr(i,e)}function fr(e){for(var t=e.g.length+1,n=[],r=0;r<t;r++)n[r]=e.D(r)<<1|e.D(r-1)>>>31;return new Qn(n,e.h)}function pr(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s<r;s++)i[s]=0<t?e.D(s+n)>>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new Qn(i,e.h)}(r=Qn.prototype).ea=function(){if(ar(this))return-cr(this).ea();for(var e=0,t=1,n=0;n<this.g.length;n++){var r=this.D(n);e+=(0<=r?r:nr+r)*t,t*=nr}return e},r.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(or(this))return"0";if(ar(this))return"-"+cr(this).toString(e);for(var t=tr(Math.pow(e,6)),n=this,r="";;){var i=dr(n,t).g,s=((0<(n=ur(n,i.R(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(or(n=i))return s+r;for(;6>s.length;)s="0"+s;r=s+r}},r.D=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},r.X=function(e){return ar(e=ur(this,e))?-1:or(e)?0:1}
1,r.abs=function(){return ar(this)?cr(this):this},r.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0,i=0;i<=t;i++){var s=r+(65535&this.D(i))+(65535&e.D(i)),o=(s>>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);r=o>>>16,s&=65535,o&=65535,n[i]=o<<16|s}return new Qn(n,-2147483648&n[n.length-1]?-1:0)},r.R=function(e){if(or(this)||or(e))return rr;if(ar(this))return ar(e)?cr(this).R(cr(e)):cr(cr(this).R(e));if(ar(e))return cr(this.R(cr(e)));if(0>this.X(sr)&&0>e.X(sr))return tr(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(var i=0;i<e.g.length;i++){var s=this.D(r)>>>16,o=65535&this.D(r),a=e.D(i)>>>16,c=65535&e.D(i);n[2*r+2*i]+=o*c,lr(n,2*r+2*i),n[2*r+2*i+1]+=s*c,lr(n,2*r+2*i+1),n[2*r+2*i+1]+=o*a,lr(n,2*r+2*i+1),n[2*r+2*i+2]+=s*a,lr(n,2*r+2*i+2)}for(r=0;r<t;r++)n[r]=n[2*r+1]<<16|n[2*r];for(r=t;r<2*t;r++)n[r]=0;return new Qn(n,0)},r.gb=function(e){return dr(this,e).h},r.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)&e.D(r);return new Qn(n,this.h&e.h)},r.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)|e.D(r);return new Qn(n,this.h|e.h)},r.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)^e.D(r);return new Qn(n,this.h^e.h)},Hn.prototype.createWebChannel=Hn.prototype.g,Wn.prototype.send=Wn.prototype.u,Wn.prototype.open=Wn.prototype.m,Wn.prototype.close=Wn.prototype.close,Je.NO_ERROR=0,Je.TIMEOUT=8,Je.HTTP_ERROR=6,Ye.COMPLETE="complete",et.EventType=nt,nt.OPEN="a",nt.CLOSE="b",nt.ERROR="c",nt.MESSAGE="d",ge.prototype.listen=ge.prototype.O,hn.prototype.listenOnce=hn.prototype.P,hn.prototype.getLastError=hn.prototype.Sa,hn.prototype.getLastErrorCode=hn.prototype.Ia,hn.prototype.getStatus=hn.prototype.da,hn.prototype.getResponseJson=hn.prototype.Wa,hn.prototype.getResponseText=hn.prototype.ja,hn.prototype.send=hn.prototype.ha,hn.prototype.setWithCredentials=hn.prototype.Oa,Jn.prototype.digest=Jn.prototype.l,Jn.prototype.reset=Jn.prototype.reset,Jn.prototype.update=Jn.prototype.j,Qn.prototype.add=Qn.prototype.add,Qn.prototype.multiply=Qn.prototype.R,Qn.prototype.modulo=Qn.prototype.gb,Qn.prototype.compare=Qn.prototype.X,Qn.prototype.toNumber=Qn.prototype.ea,Qn.prototype.toString=Qn.prototype.toString,Qn.prototype.getBits=Qn.prototype.D,Qn.fromNumber=tr,Qn.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);if("-"==t.charAt(0))return cr(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=tr(Math.pow(n,8)),i=rr,s=0;s<t.length;s+=8){var o=Math.min(8,t.length-s),a=parseInt(t.substring(s,s+o),n);8>o?(o=tr(Math.pow(n,o)),i=i.R(o).add(tr(a))):i=(i=i.R(r)).add(tr(a))}return i};var mr=u.createWebChannelTransport=function(){return new Hn},gr=u.getStatEventTarget=function(){return ze()},yr=u.ErrorCode=Je,vr=u.EventType=Ye,br=u.Event=Be,_r=u.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},wr=u.FetchXmlHttpFactory=rn,Sr=u.WebChannel=et,kr=u.XhrIo=hn,Ir=u.Md5=Jn,Er=u.Integer=Qn,Tr=n(34155);const Cr="@firebase/firestore";class xr{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}xr.UNAUTHENTICATED=new xr(null),xr.GOOGLE_CREDENTIALS=new xr("google-credentials-uid"),xr.FIRST_PARTY=new xr("first-party-uid"),xr.MOCK_USER=new xr("mock-user");let Or="9.23.0";const Ar=new o.Yd("@firebase/firestore");function Rr(){return Ar.logLevel}function Nr(e,...t){if(Ar.logLevel<=o.in.DEBUG){const n=t.map(Lr);Ar.debug(`Firestore (${Or}): ${e}`,...n)}}function Dr(e,...t){if(Ar.logLevel<=o.in.ERROR){const n=t.map(Lr);Ar.error(`Firestore (${Or}): ${e}`,...n)}}function Pr(e,...t){if(Ar.logLevel<=o.in.WARN){const n=t.map(Lr);Ar.warn(`Firestore (${Or}): ${e}`,...n)}}function Lr(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}var t}function Mr(e="Unexpected state"){const t=`FIRESTORE (${Or}) INTERNAL ASSERTION FAILED: `+e;throw Dr(t),new Error(t)}function Fr(e,t){e||Mr()}function jr(e,t){return e}const Ur={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",UNIMPLEMENT
1ED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class $r extends a.ZR{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class Br{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}class Vr{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class zr{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable((()=>t(xr.UNAUTHENTICATED)))}shutdown(){}}class qr{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(this.token.user)))}shutdown(){this.changeListener=null}}class Hr{constructor(e){this.t=e,this.currentUser=xr.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let n=this.i;const r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let i=new Br;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new Br,e.enqueueRetryable((()=>r(this.currentUser)))};const s=()=>{const t=i;e.enqueueRetryable((async()=>{await t.promise,await r(this.currentUser)}))},o=e=>{Nr("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit((e=>o(e))),setTimeout((()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?o(e):(Nr("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new Br)}}),0),s()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then((t=>this.i!==e?(Nr("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(Fr("string"==typeof t.accessToken),new Vr(t.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return Fr(null===e||"string"==typeof e),new xr(e)}}class Wr{constructor(e,t,n){this.h=e,this.l=t,this.m=n,this.type="FirstParty",this.user=xr.FIRST_PARTY,this.g=new Map}p(){return this.m?this.m():null}get headers(){this.g.set("X-Goog-AuthUser",this.h);const e=this.p();return e&&this.g.set("Authorization",e),this.l&&this.g.set("X-Goog-Iam-Authorization-Token",this.l),this.g}}class Gr{constructor(e,t,n){this.h=e,this.l=t,this.m=n}getToken(){return Promise.resolve(new Wr(this.h,this.l,this.m))}start(e,t){e.enqueueRetryable((()=>t(xr.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class Kr{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Xr{constructor(e){this.I=e,this.forceRefresh=!1,this.appCheck=null,this.T=null}start(e,t){const n=e=>{null!=e.error&&Nr("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);const n=e.token!==this.T;return this.T=e.token,Nr("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable((()=>n(t)))};const r=e=>{Nr("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.I.onInit((e=>r(e))),setTimeout((()=>{if(!this.appCheck){const e=this.I.getImmediate({optional:!0});e?r(e):Nr("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((e=>e?(Fr("string"==typeof e.token),this.T=e.token,new Kr(e.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}function Jr(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let r=0;r<e;r++)n[r]=Math.floor(256*Math.random());return n}class Yr{static A(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length;let n="";for(;n.length<20;){const r=Jr(40);for(let i=0;i<r.length;++i)n.length<20&&r[i]<t&&(n+=e.charAt(r[i]%e.length))}return n}}function Qr(e,t){return e<t?-1:e>t?1:0}function Zr(e,t,n){return e.length===t.length&&e.every(((e,r)=>n(e,t[r])))}function ei(e){return e+"\0"}class ti{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new $r(Ur.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new $r(Ur.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new $r(Ur.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new $r(Ur.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return ti.fromMillis(Date.now())}static fromDate(e){return ti.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new ti(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?Qr(this.nanoseconds,e.nanoseconds):Qr(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
1}class ni{constructor(e){this.timestamp=e}static fromTimestamp(e){return new ni(e)}static min(){return new ni(new ti(0,0))}static max(){return new ni(new ti(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class ri{constructor(e,t,n){void 0===t?t=0:t>e.length&&Mr(),void 0===n?n=e.length-t:n>e.length-t&&Mr(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===ri.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof ri?e.forEach((e=>{t.push(e)})):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=e.get(r),i=t.get(r);if(n<i)return-1;if(n>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class ii extends ri{construct(e,t,n){return new ii(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new $r(Ur.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter((e=>e.length>0)))}return new ii(t)}static emptyPath(){return new ii([])}}const si=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class oi extends ri{construct(e,t,n){return new oi(e,t,n)}static isValidIdentifier(e){return si.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),oi.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new oi(["__name__"])}static fromServerFormat(e){const t=[];let n="",r=0;const i=()=>{if(0===n.length)throw new $r(Ur.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let s=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new $r(Ur.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new $r(Ur.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?(s=!s,r++):"."!==t||s?(n+=t,r++):(i(),r++)}if(i(),s)throw new $r(Ur.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new oi(t)}static emptyPath(){return new oi([])}}class ai{constructor(e){this.path=e}static fromPath(e){return new ai(ii.fromString(e))}static fromName(e){return new ai(ii.fromString(e).popFirst(5))}static empty(){return new ai(ii.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===ii.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return ii.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ai(new ii(e.slice()))}}class ci{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}function ui(e){return e.fields.find((e=>2===e.kind))}function li(e){return e.fields.filter((e=>2!==e.kind))}ci.UNKNOWN_ID=-1;class hi{constructor(e,t){this.fieldPath=e,this.kind=t}}class di{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new di(0,mi.min())}}function fi(e,t){const n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,i=ni.fromTimestamp(1e9===r?new ti(n+1,0):new ti(n,r));return new mi(i,ai.empty(),t)}function pi(e){return new mi(e.readTime,e.key,-1)}class mi{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new mi(ni.min(),ai.empty(),-1)}static max(){return new mi(ni.max(),ai.empty(),-1)}}function gi(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=ai.comparator(e.documentKey,t.documentKey),0!==n?n:Qr(e.largestBatchId,t.largestBatchId))}const yi="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class vi{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}
1raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}async function bi(e){if(e.code!==Ur.FAILED_PRECONDITION||e.message!==yi)throw e;Nr("LocalStore","Unexpectedly lost primary lease")}class _i{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)}),(e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Mr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new _i(((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof _i?t:_i.resolve(t)}catch(e){return _i.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):_i.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):_i.reject(t)}static resolve(e){return new _i(((t,n)=>{t(e)}))}static reject(e){return new _i(((t,n)=>{n(e)}))}static waitFor(e){return new _i(((t,n)=>{let r=0,i=0,s=!1;e.forEach((e=>{++r,e.next((()=>{++i,s&&i===r&&t()}),(e=>n(e)))})),s=!0,i===r&&t()}))}static or(e){let t=_i.resolve(!1);for(const n of e)t=t.next((e=>e?_i.resolve(e):n()));return t}static forEach(e,t){const n=[];return e.forEach(((e,r)=>{n.push(t.call(this,e,r))})),this.waitFor(n)}static mapArray(e,t){return new _i(((n,r)=>{const i=e.length,s=new Array(i);let o=0;for(let a=0;a<i;a++){const c=a;t(e[c]).next((e=>{s[c]=e,++o,o===i&&n(s)}),(e=>r(e)))}}))}static doWhile(e,t){return new _i(((n,r)=>{const i=()=>{!0===e()?t().next((()=>{i()}),r):n()};i()}))}}class wi{constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.v=new Br,this.transaction.oncomplete=()=>{this.v.resolve()},this.transaction.onabort=()=>{t.error?this.v.reject(new Ii(e,t.error)):this.v.resolve()},this.transaction.onerror=t=>{const n=Oi(t.target.error);this.v.reject(new Ii(e,n))}}static open(e,t,n,r){try{return new wi(t,e.transaction(r,n))}catch(e){throw new Ii(t,e)}}get R(){return this.v.promise}abort(e){e&&this.v.reject(e),this.aborted||(Nr("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}P(){const e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){const t=this.transaction.objectStore(e);return new Ti(t)}}class Si{constructor(e,t,n){this.name=e,this.version=t,this.V=n,12.2===Si.S((0,a.z$)())&&Dr("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(e){return Nr("SimpleDb","Removing database:",e),Ci(window.indexedDB.deleteDatabase(e)).toPromise()}static D(){if(!(0,a.hl)())return!1;if(Si.C())return!0;const e=(0,a.z$)(),t=Si.S(e),n=0<t&&t<10,r=Si.N(e),i=0<r&&r<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||n||i)}static C(){var e;return"undefined"!=typeof Tr&&"YES"===(null===(e=Tr.env)||void 0===e?void 0:e.k)}static M(e,t){return e.store(t)}static S(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static N(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async $(e){return this.db||(Nr("SimpleDb","Opening database:",this.name),this.db=await new Promise(((t,n)=>{const r=indexedDB.open(this.name,this.version);r.onsuccess=e=>{const n=e.target.result;t(n)},r.onblocked=()=>{n(new Ii(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=t=>{const r=t.target.error;"VersionError"===r.name?n(new $r(Ur.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.")):"InvalidStateError"===r.name?n(new $r(Ur.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+r)):n(new Ii(e,r))},r.onupgradeneeded=e=>{Nr("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',e.oldVersion);const t=e.target.result;this.V.O(t,r.transaction,e.oldVersion,this.version).next((()=>{Nr("SimpleDb","Database upgrade to version "+this.version+" complete")}
1))}}))),this.F&&(this.db.onversionchange=e=>this.F(e)),this.db}B(e){this.F=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,n,r){const i="readonly"===t;let s=0;for(;;){++s;try{this.db=await this.$(e);const t=wi.open(this.db,e,i?"readonly":"readwrite",n),s=r(t).next((e=>(t.P(),e))).catch((e=>(t.abort(e),_i.reject(e)))).toPromise();return s.catch((()=>{})),await t.R,s}catch(e){const t=e,n="FirebaseError"!==t.name&&s<3;if(Nr("SimpleDb","Transaction failed with error:",t.message,"Retrying:",n),this.close(),!n)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}class ki{constructor(e){this.L=e,this.q=!1,this.U=null}get isDone(){return this.q}get K(){return this.U}set cursor(e){this.L=e}done(){this.q=!0}G(e){this.U=e}delete(){return Ci(this.L.delete())}}class Ii extends $r{constructor(e,t){super(Ur.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function Ei(e){return"IndexedDbTransactionError"===e.name}class Ti{constructor(e){this.store=e}put(e,t){let n;return void 0!==t?(Nr("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(Nr("SimpleDb","PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),Ci(n)}add(e){return Nr("SimpleDb","ADD",this.store.name,e,e),Ci(this.store.add(e))}get(e){return Ci(this.store.get(e)).next((t=>(void 0===t&&(t=null),Nr("SimpleDb","GET",this.store.name,e,t),t)))}delete(e){return Nr("SimpleDb","DELETE",this.store.name,e),Ci(this.store.delete(e))}count(){return Nr("SimpleDb","COUNT",this.store.name),Ci(this.store.count())}j(e,t){const n=this.options(e,t);if(n.index||"function"!=typeof this.store.getAll){const e=this.cursor(n),t=[];return this.W(e,((e,n)=>{t.push(n)})).next((()=>t))}{const e=this.store.getAll(n.range);return new _i(((t,n)=>{e.onerror=e=>{n(e.target.error)},e.onsuccess=e=>{t(e.target.result)}}))}}H(e,t){const n=this.store.getAll(e,null===t?void 0:t);return new _i(((e,t)=>{n.onerror=e=>{t(e.target.error)},n.onsuccess=t=>{e(t.target.result)}}))}J(e,t){Nr("SimpleDb","DELETE ALL",this.store.name);const n=this.options(e,t);n.Y=!1;const r=this.cursor(n);return this.W(r,((e,t,n)=>n.delete()))}X(e,t){let n;t?n=e:(n={},t=e);const r=this.cursor(n);return this.W(r,t)}Z(e){const t=this.cursor({});return new _i(((n,r)=>{t.onerror=e=>{const t=Oi(e.target.error);r(t)},t.onsuccess=t=>{const r=t.target.result;r?e(r.primaryKey,r.value).next((e=>{e?r.continue():n()})):n()}}))}W(e,t){const n=[];return new _i(((r,i)=>{e.onerror=e=>{i(e.target.error)},e.onsuccess=e=>{const i=e.target.result;if(!i)return void r();const s=new ki(i),o=t(i.primaryKey,i.value,s);if(o instanceof _i){const e=o.catch((e=>(s.done(),_i.reject(e))));n.push(e)}s.isDone?r():null===s.K?i.continue():i.continue(s.K)}})).next((()=>_i.waitFor(n)))}options(e,t){let n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const n=this.store.index(e.index);return e.Y?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function Ci(e){return new _i(((t,n)=>{e.onsuccess=e=>{const n=e.target.result;t(n)},e.onerror=e=>{const t=Oi(e.target.error);n(t)}}))}let xi=!1;function Oi(e){const t=Si.S((0,a.z$)());if(t>=12.2&&t<13){const t="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(t)>=0){const e=new $r("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return xi||(xi=!0,setTimeout((()=>{throw e}),0)),e}}return e}class Ai{constructor(e,t){this.asyncQueue=e,this.tt=t,this.task=null}start(){this.et(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}et(e){Nr("IndexBackiller",`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,(async()=>{this.task=null;try{Nr("IndexBackiller",`Documents written: ${await this.tt.nt()}`)}catch(e){Ei(e)?Nr("IndexBackiller","Ignoring IndexedDB error during index backfill: ",e):await bi(e)}await this.et(6e4)}))}}class Ri{constructor(e,t){this.localStore=e,this.persistence=t}async nt(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",(t=>this.st(t,e)))}st(e,t){const n=new Set;let r=t,i=!0;
1return _i.doWhile((()=>!0===i&&r>0),(()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next((t=>{if(null!==t&&!n.has(t))return Nr("IndexBackiller",`Processing collection: ${t}`),this.it(e,t,r).next((e=>{r-=e,n.add(t)}));i=!1})))).next((()=>t-r))}it(e,t,n){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next((r=>this.localStore.localDocuments.getNextDocuments(e,t,r,n).next((n=>{const i=n.changes;return this.localStore.indexManager.updateIndexEntries(e,i).next((()=>this.rt(r,n))).next((n=>(Nr("IndexBackiller",`Updating offset: ${n}`),this.localStore.indexManager.updateCollectionGroup(e,t,n)))).next((()=>i.size))}))))}rt(e,t){let n=e;return t.changes.forEach(((e,t)=>{const r=pi(t);gi(r,n)>0&&(n=r)})),new mi(n.readTime,n.documentKey,Math.max(t.batchId,e.largestBatchId))}}class Ni{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ot(e),this.ut=e=>t.writeSequenceNumber(e))}ot(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ut&&this.ut(e),e}}function Di(e){return null==e}function Pi(e){return 0===e&&1/e==-1/0}function Li(e){return"number"==typeof e&&Number.isInteger(e)&&!Pi(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}function Mi(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=ji(t)),t=Fi(e.get(n),t);return ji(t)}function Fi(e,t){let n=t;const r=e.length;for(let i=0;i<r;i++){const t=e.charAt(i);switch(t){case"\0":n+="\x01\x10";break;case"\x01":n+="\x01\x11";break;default:n+=t}}return n}function ji(e){return e+"\x01\x01"}function Ui(e){const t=e.length;if(Fr(t>=2),2===t)return Fr("\x01"===e.charAt(0)&&"\x01"===e.charAt(1)),ii.emptyPath();const n=t-2,r=[];let i="";for(let s=0;s<t;){const t=e.indexOf("\x01",s);switch((t<0||t>n)&&Mr(),e.charAt(t+1)){case"\x01":const n=e.substring(s,t);let o;0===i.length?o=n:(i+=n,o=i,i=""),r.push(o);break;case"\x10":i+=e.substring(s,t),i+="\0";break;case"\x11":i+=e.substring(s,t+1);break;default:Mr()}s=t+2}return new ii(r)}Ni.ct=-1;const $i=["userId","batchId"];function Bi(e,t){return[e,Mi(t)]}function Vi(e,t,n){return[e,Mi(t),n]}const zi={},qi=["prefixPath","collectionGroup","readTime","documentId"],Hi=["prefixPath","collectionGroup","documentId"],Wi=["collectionGroup","readTime","prefixPath","documentId"],Gi=["canonicalId","targetId"],Ki=["targetId","path"],Xi=["path","targetId"],Ji=["collectionId","parent"],Yi=["indexId","uid"],Qi=["uid","sequenceNumber"],Zi=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],es=["indexId","uid","orderedDocumentKey"],ts=["userId","collectionPath","documentId"],ns=["userId","collectionPath","largestBatchId"],rs=["userId","collectionGroup","largestBatchId"],is=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],ss=[...is,"documentOverlays"],os=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],as=os,cs=[...as,"indexConfiguration","indexState","indexEntries"];class us extends vi{constructor(e,t){super(),this.ht=e,this.currentSequenceNumber=t}}function ls(e,t){const n=jr(e);return Si.M(n.ht,t)}function hs(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ds(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function fs(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class ps{constructor(e,t){this.comparator=e,this.root=t||gs.EMPTY}insert(e,t){return new ps(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,gs.BLACK,null,null))}remove(e){return new ps(this.comparator,this.root.remove(e,this.comparator).copy(null,null,gs.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((t,n)=>(e(t,n),!1)))}toString(){const e=[];return this.inorderTraversal(((t,n)=>(e.push(`${t}:${n}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new ms(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new ms(this.root,e,this.comparator,!1)}getReverseIterator(){return new ms(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new ms(this.root,e,this.comparator,!0)}}class ms{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&r&&(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}}getNext(){let e=this.nodeStack.pop();const 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}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class gs{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:gs.RED,this.left=null!=r?r:gs.EMPTY,this.right=null!=i?i:gs.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new gs(null!=e?e:this.key,null!=t?t:this.value,
vendor: 2,466 bytes, line 1
1null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return gs.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.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 gs.EMPTY;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()}isRed(){return this.color}fixUp(){let 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}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,gs.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,gs.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const 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)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Mr();if(this.right.isRed())throw Mr();const e=this.left.check();if(e!==this.right.check())throw Mr();return e+(this.isRed()?0:1)}}
vendor: 2,498 bytes, line 1
1gs.EMPTY=null,gs.RED=!0,gs.BLACK=!1,gs.EMPTY=new class{constructor(){this.size=0}get key(){throw Mr()}get value(){throw Mr()}get color(){throw Mr()}get left(){throw Mr()}get right(){throw Mr()}copy(e,t,n,r,i){return this}insert(e,t,n){return new gs(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class ys{constructor(e){this.comparator=e,this.data=new ps(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal(((t,n)=>(e(t),!1)))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new vs(this.data.getIterator())}getIteratorFrom(e){return new vs(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach((e=>{t=t.add(e)})),t}isEqual(e){if(!(e instanceof ys))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach((t=>{e.push(t)})),e}toString(){const e=[];return this.forEach((t=>e.push(t))),"SortedSet("+e.toString()+")"}copy(e){const t=new ys(this.comparator);return t.data=e,t}}class vs{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function bs(e){return e.hasNext()?e.getNext():void 0}class _s{constructor(e){this.fields=e,e.sort(oi.comparator)}static empty(){return new _s([])}unionWith(e){let t=new ys(oi.comparator);for(const n of this.fields)t=t.add(n);for(const n of e)t=t.add(n);return new _s(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Zr(this.fields,e.fields,((e,t)=>e.isEqual(t)))}}
1class ws extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Ss{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new ws("Invalid base64 string: "+e):e}}(e);return new Ss(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Ss(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Qr(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Ss.EMPTY_BYTE_STRING=new Ss("");const ks=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Is(e){if(Fr(!!e),"string"==typeof e){let t=0;const n=ks.exec(e);if(Fr(!!n),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const r=new Date(e);return{seconds:Math.floor(r.getTime()/1e3),nanos:t}}return{seconds:Es(e.seconds),nanos:Es(e.nanos)}}function Es(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function Ts(e){return"string"==typeof e?Ss.fromBase64String(e):Ss.fromUint8Array(e)}function Cs(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function xs(e){const t=e.mapValue.fields.__previous_value__;return Cs(t)?xs(t):t}function Os(e){const t=Is(e.mapValue.fields.__local_write_time__.timestampValue);return new ti(t.seconds,t.nanos)}class As{constructor(e,t,n,r,i,s,o,a,c){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=s,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=c}}class Rs{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new Rs("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof Rs&&e.projectId===this.projectId&&e.database===this.database}}const Ns={mapValue:{fields:{__type__:{stringValue:"__max__"}}}},Ds={nullValue:"NULL_VALUE"};function Ps(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?Cs(e)?4:Ks(e)?9007199254740991:10:Mr()}function Ls(e,t){if(e===t)return!0;const n=Ps(e);if(n!==Ps(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Os(e).isEqual(Os(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;const n=Is(e.timestampValue),r=Is(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return Ts(e.bytesValue).isEqual(Ts(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Es(e.geoPointValue.latitude)===Es(t.geoPointValue.latitude)&&Es(e.geoPointValue.longitude)===Es(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Es(e.integerValue)===Es(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=Es(e.doubleValue),r=Es(t.doubleValue);return n===r?Pi(n)===Pi(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return Zr(e.arrayValue.values||[],t.arrayValue.values||[],Ls);case 10:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(hs(n)!==hs(r))return!1;for(const i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!Ls(n[i],r[i])))return!1;return!0}(e,t);default:return Mr()}}function Ms(e,t){return void 0!==(e.values||[]).find((e=>Ls(e,t)))}function Fs(e,t){if(e===t)return 0;const n=Ps(e),r=Ps(t);if(n!==r)return Qr(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Qr(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Es(e.integerValue||e.doubleValue),r=Es(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return js(e.timestampValue,t.timestampValue);case 4:return js(Os(e),Os(t));case 5:return Qr(e.stringValue,t.stringValue);case 6:return function(e,t){const n=Ts(e),r=Ts(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let i=0;i<n.length&&i<r.length;i++){const e=Qr(n[i],r[i]);if(0!==e)return e}return Qr(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=Qr(Es(e.latitude),Es(t.latitude));return 0!==n?n:Qr(Es(e.longitude),Es(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){const n=e.values||[],r=t.values||[];for(let i=0;i<n.length&&i<r.length;++i){const e=Fs(n[i],r[i]);if(e)return e}return Qr(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){if(e===Ns.mapValue&&t===Ns.mapValue)return 0;if(e===Ns.mapValue)return 1;if(t===Ns.mapValue)return-1;const n=e.fields||{},r=Object.keys(n),i=t.fields||{},s=Object.keys(i);r.sort(),s.sort();for(let o=0;o<r.length&&o<s.length;++o){const e=Qr(r[o],s[o]);if(0!==e)return e;const t=Fs(n[r[o]],i[s[o]]);if(0!==t)return t}return Qr(r.length,s.length)}(e.mapValue,t.mapValue);default:throw Mr()}}function js(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return Qr(e,t);const n=Is(e),r=Is(t),i=Qr(n.seconds,r.seconds);return 0!==i?i:Qr(n.nanos,r.nanos)}function Us(e){return $s(e)}function $s(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=Is(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?Ts(e.bytesValue).toBase64():"referenceValue"in e?(n=e.referenceValue,ai.fromN
1ame(n).toString()):"geoPointValue"in e?`geo(${(t=e.geoPointValue).latitude},${t.longitude})`:"arrayValue"in e?function(e){let t="[",n=!0;for(const r of e.values||[])n?n=!1:t+=",",t+=$s(r);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",r=!0;for(const i of t)r?r=!1:n+=",",n+=`${i}:${$s(e.fields[i])}`;return n+"}"}(e.mapValue):Mr();var t,n}function Bs(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function Vs(e){return!!e&&"integerValue"in e}function zs(e){return!!e&&"arrayValue"in e}function qs(e){return!!e&&"nullValue"in e}function Hs(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Ws(e){return!!e&&"mapValue"in e}function Gs(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return ds(e.mapValue.fields,((e,n)=>t.mapValue.fields[e]=Gs(n))),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Gs(e.arrayValue.values[n]);return t}return Object.assign({},e)}function Ks(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}function Xs(e){return"nullValue"in e?Ds:"booleanValue"in e?{booleanValue:!1}:"integerValue"in e||"doubleValue"in e?{doubleValue:NaN}:"timestampValue"in e?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in e?{stringValue:""}:"bytesValue"in e?{bytesValue:""}:"referenceValue"in e?Bs(Rs.empty(),ai.empty()):"geoPointValue"in e?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in e?{arrayValue:{}}:"mapValue"in e?{mapValue:{}}:Mr()}function Js(e){return"nullValue"in e?{booleanValue:!1}:"booleanValue"in e?{doubleValue:NaN}:"integerValue"in e||"doubleValue"in e?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in e?{stringValue:""}:"stringValue"in e?{bytesValue:""}:"bytesValue"in e?Bs(Rs.empty(),ai.empty()):"referenceValue"in e?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in e?{arrayValue:{}}:"arrayValue"in e?{mapValue:{}}:"mapValue"in e?Ns:Mr()}function Ys(e,t){const n=Fs(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?-1:!e.inclusive&&t.inclusive?1:0}function Qs(e,t){const n=Fs(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?1:!e.inclusive&&t.inclusive?-1:0}class Zs{constructor(e){this.value=e}static empty(){return new Zs({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!Ws(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Gs(t)}setAll(e){let t=oi.emptyPath(),n={},r=[];e.forEach(((e,i)=>{if(!t.isImmediateParentOf(i)){const e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=i.popLast()}e?n[i.lastSegment()]=Gs(e):r.push(i.lastSegment())}));const i=this.getFieldsMap(t);this.applyChanges(i,n,r)}delete(e){const t=this.field(e.popLast());Ws(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Ls(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];Ws(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){ds(t,((t,n)=>e[t]=n));for(const r of n)delete e[r]}clone(){return new Zs(Gs(this.value))}}function eo(e){const t=[];return ds(e.fields,((e,n)=>{const r=new oi([e]);if(Ws(n)){const e=eo(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)})),new _s(t)}class to{constructor(e,t,n,r,i,s,o){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=i,this.data=s,this.documentState=o}static newInvalidDocument(e){return new to(e,0,ni.min(),ni.min(),ni.min(),Zs.empty(),0)}static newFoundDocument(e,t,n,r){return new to(e,1,t,ni.min(),n,r,0)}static newNoDocument(e,t){return new to(e,2,t,ni.min(),ni.min(),Zs.empty(),0)}static newUnknownDocument(e,t){return new to(e,3,t,ni.min(),ni.min(),Zs.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(ni.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Zs.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Zs.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ni.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof to&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new to(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
1class no{constructor(e,t){this.position=e,this.inclusive=t}}function ro(e,t,n){let r=0;for(let i=0;i<e.position.length;i++){const s=t[i],o=e.position[i];if(r=s.field.isKeyField()?ai.comparator(ai.fromName(o.referenceValue),n.key):Fs(o,n.data.field(s.field)),"desc"===s.dir&&(r*=-1),0!==r)break}return r}function io(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!Ls(e.position[n],t.position[n]))return!1;return!0}class so{constructor(e,t="asc"){this.field=e,this.dir=t}}function oo(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class ao{}class co extends ao{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new bo(e,t,n):"array-contains"===t?new ko(e,n):"in"===t?new Io(e,n):"not-in"===t?new Eo(e,n):"array-contains-any"===t?new To(e,n):new co(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new _o(e,n):new wo(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(Fs(t,this.value)):null!==t&&Ps(this.value)===Ps(t)&&this.matchesComparison(Fs(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return Mr()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}getFirstInequalityField(){return this.isInequality()?this.field:null}}class uo extends ao{constructor(e,t){super(),this.filters=e,this.op=t,this.lt=null}static create(e,t){return new uo(e,t)}matches(e){return lo(this)?void 0===this.filters.find((t=>!t.matches(e))):void 0!==this.filters.find((t=>t.matches(e)))}getFlattenedFilters(){return null!==this.lt||(this.lt=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.lt}getFilters(){return Object.assign([],this.filters)}getFirstInequalityField(){const e=this.ft((e=>e.isInequality()));return null!==e?e.field:null}ft(e){for(const t of this.getFlattenedFilters())if(e(t))return t;return null}}function lo(e){return"and"===e.op}function ho(e){return"or"===e.op}function fo(e){return po(e)&&lo(e)}function po(e){for(const t of e.filters)if(t instanceof uo)return!1;return!0}function mo(e){if(e instanceof co)return e.field.canonicalString()+e.op.toString()+Us(e.value);if(fo(e))return e.filters.map((e=>mo(e))).join(",");{const t=e.filters.map((e=>mo(e))).join(",");return`${e.op}(${t})`}}function go(e,t){return e instanceof co?function(e,t){return t instanceof co&&e.op===t.op&&e.field.isEqual(t.field)&&Ls(e.value,t.value)}(e,t):e instanceof uo?function(e,t){return t instanceof uo&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce(((e,n,r)=>e&&go(n,t.filters[r])),!0)}(e,t):void Mr()}function yo(e,t){const n=e.filters.concat(t);return uo.create(n,e.op)}function vo(e){return e instanceof co?function(e){return`${e.field.canonicalString()} ${e.op} ${Us(e.value)}`}(e):e instanceof uo?function(e){return e.op.toString()+" {"+e.getFilters().map(vo).join(" ,")+"}"}(e):"Filter"}class bo extends co{constructor(e,t,n){super(e,t,n),this.key=ai.fromName(n.referenceValue)}matches(e){const t=ai.comparator(e.key,this.key);return this.matchesComparison(t)}}class _o extends co{constructor(e,t){super(e,"in",t),this.keys=So("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class wo extends co{constructor(e,t){super(e,"not-in",t),this.keys=So("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function So(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map((e=>ai.fromName(e.referenceValue)))}class ko extends co{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return zs(t)&&Ms(t.arrayValue,this.value)}}class Io extends co{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Ms(this.value.arrayValue,t)}}class Eo extends co{constructor(e,t){super(e,"not-in",t)}matches(e){if(Ms(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!Ms(this.value.arrayValue,t)}}class To extends co{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!zs(t)||!t.arrayValue.values)&&t.arrayValue.values.some((e=>Ms(this.value.arrayValue,e)))}}class Co{constructor(e,t=null,n=[],r=[],i=null,s=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=s,this.endAt=o,this.dt=null}}function xo(e,t=null,n=[],r=[],i=null,s=null,o=null){return new Co(e,t,n,r,i,s,o)}function Oo(e){const t=jr(e);
1if(null===t.dt){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map((e=>mo(e))).join(","),e+="|ob:",e+=t.orderBy.map((e=>function(e){return e.field.canonicalString()+e.dir}(e))).join(","),Di(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map((e=>Us(e))).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map((e=>Us(e))).join(",")),t.dt=e}return t.dt}function Ao(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!oo(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!go(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!io(e.startAt,t.startAt)&&io(e.endAt,t.endAt)}function Ro(e){return ai.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function No(e,t){return e.filters.filter((e=>e instanceof co&&e.field.isEqual(t)))}function Do(e,t,n){let r=Ds,i=!0;for(const s of No(e,t)){let e=Ds,t=!0;switch(s.op){case"<":case"<=":e=Xs(s.value);break;case"==":case"in":case">=":e=s.value;break;case">":e=s.value,t=!1;break;case"!=":case"not-in":e=Ds}Ys({value:r,inclusive:i},{value:e,inclusive:t})<0&&(r=e,i=t)}if(null!==n)for(let s=0;s<e.orderBy.length;++s)if(e.orderBy[s].field.isEqual(t)){const e=n.position[s];Ys({value:r,inclusive:i},{value:e,inclusive:n.inclusive})<0&&(r=e,i=n.inclusive);break}return{value:r,inclusive:i}}function Po(e,t,n){let r=Ns,i=!0;for(const s of No(e,t)){let e=Ns,t=!0;switch(s.op){case">=":case">":e=Js(s.value),t=!1;break;case"==":case"in":case"<=":e=s.value;break;case"<":e=s.value,t=!1;break;case"!=":case"not-in":e=Ns}Qs({value:r,inclusive:i},{value:e,inclusive:t})>0&&(r=e,i=t)}if(null!==n)for(let s=0;s<e.orderBy.length;++s)if(e.orderBy[s].field.isEqual(t)){const e=n.position[s];Qs({value:r,inclusive:i},{value:e,inclusive:n.inclusive})>0&&(r=e,i=n.inclusive);break}return{value:r,inclusive:i}}class Lo{constructor(e,t=null,n=[],r=[],i=null,s="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=s,this.startAt=o,this.endAt=a,this.wt=null,this._t=null,this.startAt,this.endAt}}function Mo(e,t,n,r,i,s,o,a){return new Lo(e,t,n,r,i,s,o,a)}function Fo(e){return new Lo(e)}function jo(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Uo(e){return e.explicitOrderBy.length>0?e.explicitOrderBy[0].field:null}function $o(e){for(const t of e.filters){const e=t.getFirstInequalityField();if(null!==e)return e}return null}function Bo(e){return null!==e.collectionGroup}function Vo(e){const t=jr(e);if(null===t.wt){t.wt=[];const e=$o(t),n=Uo(t);if(null!==e&&null===n)e.isKeyField()||t.wt.push(new so(e)),t.wt.push(new so(oi.keyField(),"asc"));else{let e=!1;for(const n of t.explicitOrderBy)t.wt.push(n),n.field.isKeyField()&&(e=!0);if(!e){const e=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.wt.push(new so(oi.keyField(),e))}}}return t.wt}function zo(e){const t=jr(e);if(!t._t)if("F"===t.limitType)t._t=xo(t.path,t.collectionGroup,Vo(t),t.filters,t.limit,t.startAt,t.endAt);else{const e=[];for(const i of Vo(t)){const t="desc"===i.dir?"asc":"desc";e.push(new so(i.field,t))}const n=t.endAt?new no(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new no(t.startAt.position,t.startAt.inclusive):null;t._t=xo(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}return t._t}function qo(e,t){t.getFirstInequalityField(),$o(e);const n=e.filters.concat([t]);return new Lo(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function Ho(e,t,n){return new Lo(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Wo(e,t){return Ao(zo(e),zo(t))&&e.limitType===t.limitType}function Go(e){return`${Oo(zo(e))}|lt:${e.limitType}`}function Ko(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map((e=>vo(e))).join(", ")}]`),Di(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map((e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e))).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((e=>Us(e))).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((e=>Us(e))).join(",")),`Target(${t})`}(zo(e))}; limitType=${e.limitType})`}function Xo(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):ai.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Vo(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const r=ro(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,Vo(e),t))&&!(e.endAt&&!function(e,t,n){const r=ro(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,Vo(e),t))}(e,t)}function Jo(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function Yo(e){return(t,n)=>{let r=!1;for(const i of Vo(e)){const e=Qo(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}
1function Qo(e,t,n){const r=e.field.isKeyField()?ai.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?Fs(r,i):Mr()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return Mr()}}class Zo{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[r,i]of n)if(this.equalsFn(r,e))return i}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return void(r[i]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){ds(this.inner,((t,n)=>{for(const[r,i]of n)e(r,i)}))}isEmpty(){return fs(this.inner)}size(){return this.innerSize}}const ea=new ps(ai.comparator);function ta(){return ea}const na=new ps(ai.comparator);function ra(...e){let t=na;for(const n of e)t=t.insert(n.key,n);return t}function ia(e){let t=na;return e.forEach(((e,n)=>t=t.insert(e,n.overlayedDocument))),t}function sa(){return aa()}function oa(){return aa()}function aa(){return new Zo((e=>e.toString()),((e,t)=>e.isEqual(t)))}const ca=new ps(ai.comparator),ua=new ys(ai.comparator);function la(...e){let t=ua;for(const n of e)t=t.add(n);return t}const ha=new ys(Qr);function da(){return ha}function fa(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Pi(t)?"-0":t}}function pa(e){return{integerValue:""+e}}function ma(e,t){return Li(t)?pa(t):fa(e,t)}class ga{constructor(){this._=void 0}}function ya(e,t,n){return e instanceof _a?function(e,t){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&Cs(t)&&(t=xs(t)),t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof wa?Sa(e,t):e instanceof ka?Ia(e,t):function(e,t){const n=ba(e,t),r=Ta(n)+Ta(e.gt);return Vs(n)&&Vs(e.gt)?pa(r):fa(e.serializer,r)}(e,t)}function va(e,t,n){return e instanceof wa?Sa(e,t):e instanceof ka?Ia(e,t):n}function ba(e,t){return e instanceof Ea?Vs(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}class _a extends ga{}class wa extends ga{constructor(e){super(),this.elements=e}}function Sa(e,t){const n=Ca(t);for(const r of e.elements)n.some((e=>Ls(e,r)))||n.push(r);return{arrayValue:{values:n}}}class ka extends ga{constructor(e){super(),this.elements=e}}function Ia(e,t){let n=Ca(t);for(const r of e.elements)n=n.filter((e=>!Ls(e,r)));return{arrayValue:{values:n}}}class Ea extends ga{constructor(e,t){super(),this.serializer=e,this.gt=t}}function Ta(e){return Es(e.integerValue||e.doubleValue)}function Ca(e){return zs(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class xa{constructor(e,t){this.field=e,this.transform=t}}class Oa{constructor(e,t){this.version=e,this.transformResults=t}}class Aa{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Aa}static exists(e){return new Aa(void 0,e)}static updateTime(e){return new Aa(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Ra(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Na{}function Da(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new za(e.key,Aa.none()):new ja(e.key,e.data,Aa.none());{const n=e.data,r=Zs.empty();let i=new ys(oi.comparator);for(let e of t.fields)if(!i.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),i=i.add(e)}
1return new Ua(e.key,r,new _s(i.toArray()),Aa.none())}}function Pa(e,t,n){e instanceof ja?function(e,t,n){const r=e.value.clone(),i=Ba(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof Ua?function(e,t,n){if(!Ra(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=Ba(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll($a(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function La(e,t,n,r){return e instanceof ja?function(e,t,n,r){if(!Ra(e.precondition,t))return n;const i=e.value.clone(),s=Va(e.fieldTransforms,r,t);return i.setAll(s),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,n,r):e instanceof Ua?function(e,t,n,r){if(!Ra(e.precondition,t))return n;const i=Va(e.fieldTransforms,r,t),s=t.data;return s.setAll($a(e)),s.setAll(i),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map((e=>e.field)))}(e,t,n,r):function(e,t,n){return Ra(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Ma(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),i=ba(r.transform,e||null);null!=i&&(null===n&&(n=Zs.empty()),n.set(r.field,i))}return n||null}function Fa(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&Zr(e,t,((e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof wa&&t instanceof wa||e instanceof ka&&t instanceof ka?Zr(e.elements,t.elements,Ls):e instanceof Ea&&t instanceof Ea?Ls(e.gt,t.gt):e instanceof _a&&t instanceof _a}(e.transform,t.transform)}(e,t)))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class ja extends Na{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Ua extends Na{constructor(e,t,n,r,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function $a(e){const t=new Map;return e.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}})),t}function Ba(e,t,n){const r=new Map;Fr(e.length===n.length);for(let i=0;i<n.length;i++){const s=e[i],o=s.transform,a=t.data.field(s.field);r.set(s.field,va(o,a,n[i]))}return r}function Va(e,t,n){const r=new Map;for(const i of e){const e=i.transform,s=n.data.field(i.field);r.set(i.field,ya(e,s,t))}return r}class za extends Na{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class qa extends Na{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Ha{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let r=0;r<this.mutations.length;r++){const t=this.mutations[r];t.key.isEqual(e.key)&&Pa(t,e,n[r])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=La(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=La(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=oa();return this.mutations.forEach((r=>{const i=e.get(r.key),s=i.overlayedDocument;let o=this.applyToLocalView(s,i.mutatedFields);o=t.has(r.key)?null:o;const a=Da(s,o);null!==a&&n.set(r.key,a),s.isValidDocument()||s.convertToNoDocument(ni.min())})),n}keys(){return this.mutations.reduce(((e,t)=>e.add(t.key)),la())}isEqual(e){return this.batchId===e.batchId&&Zr(this.mutations,e.mutations,((e,t)=>Fa(e,t)))&&Zr(this.baseMutations,e.baseMutations,((e,t)=>Fa(e,t)))}}class Wa{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){Fr(e.mutations.length===n.length);let r=ca;const i=e.mutations;for(let s=0;s<i.length;s++)r=r.insert(i[s].key,n[s].version);return new Wa(e,t,n,r)}}class Ga{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n      largestBatchId: ${this.largestBatchId},\n      mutation: ${this.mutation.toString()}\n    }`}}class Ka{constructor(e,t){this.count=e,this.unchangedNames=t}}var Xa,Ja;function Ya(e){switch(e){default:return Mr();case Ur.CANCELLED:case Ur.UNKNOWN:case Ur.DEADLINE_EXCEEDED:case Ur.RESOURCE_EXHAUSTED:case Ur.INTERNAL:case Ur.UNAVAILABLE:case Ur.UNAUTHENTICATED:return!1;case Ur.INVALID_ARGUMENT:case Ur.NOT_FOUND:case Ur.ALREADY_EXISTS:case Ur.PERMISSION_DENIED:case Ur.FAILED_PRECONDITION:case Ur.ABORTED:case Ur.OUT_OF_RANGE:case Ur.UNIMPLEMENT
1ED:case Ur.DATA_LOSS:return!0}}function Qa(e){if(void 0===e)return Dr("GRPC error has no .code"),Ur.UNKNOWN;switch(e){case Xa.OK:return Ur.OK;case Xa.CANCELLED:return Ur.CANCELLED;case Xa.UNKNOWN:return Ur.UNKNOWN;case Xa.DEADLINE_EXCEEDED:return Ur.DEADLINE_EXCEEDED;case Xa.RESOURCE_EXHAUSTED:return Ur.RESOURCE_EXHAUSTED;case Xa.INTERNAL:return Ur.INTERNAL;case Xa.UNAVAILABLE:return Ur.UNAVAILABLE;case Xa.UNAUTHENTICATED:return Ur.UNAUTHENTICATED;case Xa.INVALID_ARGUMENT:return Ur.INVALID_ARGUMENT;case Xa.NOT_FOUND:return Ur.NOT_FOUND;case Xa.ALREADY_EXISTS:return Ur.ALREADY_EXISTS;case Xa.PERMISSION_DENIED:return Ur.PERMISSION_DENIED;case Xa.FAILED_PRECONDITION:return Ur.FAILED_PRECONDITION;case Xa.ABORTED:return Ur.ABORTED;case Xa.OUT_OF_RANGE:return Ur.OUT_OF_RANGE;case Xa.UNIMPLEMENTED:return Ur.UNIMPLEMENTED;case Xa.DATA_LOSS:return Ur.DATA_LOSS;default:return Mr()}}(Ja=Xa||(Xa={}))[Ja.OK=0]="OK",Ja[Ja.CANCELLED=1]="CANCELLED",Ja[Ja.UNKNOWN=2]="UNKNOWN",Ja[Ja.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Ja[Ja.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Ja[Ja.NOT_FOUND=5]="NOT_FOUND",Ja[Ja.ALREADY_EXISTS=6]="ALREADY_EXISTS",Ja[Ja.PERMISSION_DENIED=7]="PERMISSION_DENIED",Ja[Ja.UNAUTHENTICATED=16]="UNAUTHENTICATED",Ja[Ja.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Ja[Ja.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Ja[Ja.ABORTED=10]="ABORTED",Ja[Ja.OUT_OF_RANGE=11]="OUT_OF_RANGE",Ja[Ja.UNI
1MPLEMENTED=12]="UNIMPLEMENTED",Ja[Ja.INTERNAL=13]="INTERNAL",Ja[Ja.UNAVAILABLE=14]="UNAVAILABLE",Ja[Ja.DATA_LOSS=15]="DATA_LOSS";class Za{constructor(){this.onExistenceFilterMismatchCallbacks=new Map}static get instance(){return ec}static getOrCreateInstance(){return null===ec&&(ec=new Za),ec}onExistenceFilterMismatch(e){const t=Symbol();return this.onExistenceFilterMismatchCallbacks.set(t,e),()=>this.onExistenceFilterMismatchCallbacks.delete(t)}notifyOnExistenceFilterMismatch(e){this.onExistenceFilterMismatchCallbacks.forEach((t=>t(e)))}}let ec=null;function tc(){return new TextEncoder}const nc=new Er([4294967295,4294967295],0);function rc(e){const t=tc().encode(e),n=new Ir;return n.update(t),new Uint8Array(n.digest())}function ic(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),r=t.getUint32(4,!0),i=t.getUint32(8,!0),s=t.getUint32(12,!0);return[new Er([n,r],0),new Er([i,s],0)]}class sc{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new oc(`Invalid padding: ${t}`);if(n<0)throw new oc(`Invalid hash count: ${n}`);if(e.length>0&&0===this.hashCount)throw new oc(`Invalid hash count: ${n}`);if(0===e.length&&0!==t)throw new oc(`Invalid padding when bitmap length is 0: ${t}`);this.It=8*e.length-t,this.Tt=Er.fromNumber(this.It)}Et(e,t,n){let r=e.add(t.multiply(Er.fromNumber(n)));return 1===r.compare(nc)&&(r=new Er([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Tt).toNumber()}At(e){return 0!=(this.bitmap[Math.floor(e/8)]&1<<e%8)}vt(e){if(0===this.It)return!1;const t=rc(e),[n,r]=ic(t);for(let i=0;i<this.hashCount;i++){const e=this.Et(n,r,i);if(!this.At(e))return!1}return!0}static create(e,t,n){const r=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),s=new sc(i,r,t);return n.forEach((e=>s.insert(e))),s}insert(e){if(0===this.It)return;const t=rc(e),[n,r]=ic(t);for(let i=0;i<this.hashCount;i++){const e=this.Et(n,r,i);this.Rt(e)}}Rt(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class oc extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class ac{constructor(e,t,n,r,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const r=new Map;return r.set(e,cc.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new ac(ni.min(),r,new ps(Qr),ta(),la())}}class cc{constructor(e,t,n,r,i){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new cc(n,t,la(),la(),la())}}class uc{constructor(e,t,n,r){this.Pt=e,this.removedTargetIds=t,this.key=n,this.bt=r}}class lc{constructor(e,t){this.targetId=e,this.Vt=t}}class hc{constructor(e,t,n=Ss.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class dc{constructor(){this.St=0,this.Dt=mc(),this.Ct=Ss.EMPTY_BYTE_STRING,this.xt=!1,this.Nt=!0}get current(){return this.xt}get resumeToken(){return this.Ct}get kt(){return 0!==this.St}get Mt(){return this.Nt}$t(e){e.approximateByteSize()>0&&(this.Nt=!0,this.Ct=e)}Ot(){let e=la(),t=la(),n=la();return this.Dt.forEach(((r,i)=>{switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:Mr()}})),new cc(this.Ct,this.xt,e,t,n)}Ft(){this.Nt=!1,this.Dt=mc()}Bt(e,t){this.Nt=!0,this.Dt=this.Dt.insert(e,t)}Lt(e){this.Nt=!0,this.Dt=this.Dt.remove(e)}qt(){this.St+=1}Ut(){this.St-=1}Kt(){this.Nt=!0,this.xt=!0}}class fc{constructor(e){this.Gt=e,this.Qt=new Map,this.jt=ta(),this.zt=pc(),this.Wt=new ps(Qr)}Ht(e){for(const t of e.Pt)e.bt&&e.bt.isFoundDocument()?this.Jt(t,e.bt):this.Yt(t,e.key,e.bt);for(const t of e.removedTargetIds)this.Yt(t,e.key,e.bt)}Xt(e){this.forEachTarget(e,(t=>{const n=this.Zt(t);switch(e.state){case 0:this.te(t)&&n.$t(e.resumeToken);break;case 1:n.Ut(),n.kt||n.Ft(),n.$t(e.resumeToken);break;case 2:n.Ut(),n.kt||this.removeTarget(t);break;case 3:this.te(t)&&(n.Kt(),n.$t(e.resumeToken));break;case 4:this.te(t)&&(this.ee(t),n.$t(e.resumeToken));break;default:Mr()}}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Qt.forEach(((e,n)=>{this.te(n)&&t(n)}))}ne(e){var t;const n=e.targetId,r=e.Vt.count,i=this.se(n);if(i){const s=i.target;if(Ro(s))if(0===r){const e=new ai(s.path);this.Yt(n,e,to.newNoDocument(e,ni.min()))}else Fr(1===r);else{const i=this.ie(n);if(i!==r){const r=this.re(e,i);if(0!==r){this.ee(n);const e=2===r?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Wt=this.Wt.insert(n,e)}null===(t=Za.instance)||void 0===t||t.notifyOnExistenceFilterMismatch(function(e,t,n){var r,i,s,o,a,c;const u={localCacheCount:t,existenceFilterCount:n.count},l=n.unchangedNames;return l&&(u.bloomFilter={applied:0===e,hashCount:null!==(r=null==l?void 0:l.hashCount)&&void 0!==r?r:0,bitmapLength:null!==(o=null===(s=null===(i=null==l?void 0:l.bits)||void 0===i?void 0:i.bitmap)||void 0===s?void 0:s.length)&&void 0!==o?o:0,padding:null!==(c=null===(a=null==l?void 0:l.bits)||void 0===a?void 0:a.padding)&&void 0!==c?c:0}),u}(r,i,e.Vt))}}}}re(e,t){const{unchangedNames:n,count:r}=e.Vt;if(!n||!n.bits)return 1;const{bits:{bitmap:i="",padding:s=0},hashCount:o=0}=n;let a,c;try{a=Ts(i).toUint8Array()}catch(e){if(e instanceof ws)return Pr("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),1;throw e}try{c=new sc(a,s,o)}catch(e){return Pr(e instanceof oc?"BloomFilter error: ":"Applying bloom filter failed: ",e),1}return 0===c.It?1:r!==t-this.oe(e.targetId,c)?2:0}oe(e,t){const n=this.Gt.getRemoteKeysForTarget(e);let r=0;
1return n.forEach((n=>{const i=this.Gt.ue(),s=`projects/${i.projectId}/databases/${i.database}/documents/${n.path.canonicalString()}`;t.vt(s)||(this.Yt(e,n,null),r++)})),r}ce(e){const t=new Map;this.Qt.forEach(((n,r)=>{const i=this.se(r);if(i){if(n.current&&Ro(i.target)){const t=new ai(i.target.path);null!==this.jt.get(t)||this.ae(r,t)||this.Yt(r,t,to.newNoDocument(t,e))}n.Mt&&(t.set(r,n.Ot()),n.Ft())}}));let n=la();this.zt.forEach(((e,t)=>{let r=!0;t.forEachWhile((e=>{const t=this.se(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)})),r&&(n=n.add(e))})),this.jt.forEach(((t,n)=>n.setReadTime(e)));const r=new ac(e,t,this.Wt,this.jt,n);return this.jt=ta(),this.zt=pc(),this.Wt=new ps(Qr),r}Jt(e,t){if(!this.te(e))return;const n=this.ae(e,t.key)?2:0;this.Zt(e).Bt(t.key,n),this.jt=this.jt.insert(t.key,t),this.zt=this.zt.insert(t.key,this.he(t.key).add(e))}Yt(e,t,n){if(!this.te(e))return;const r=this.Zt(e);this.ae(e,t)?r.Bt(t,1):r.Lt(t),this.zt=this.zt.insert(t,this.he(t).delete(e)),n&&(this.jt=this.jt.insert(t,n))}removeTarget(e){this.Qt.delete(e)}ie(e){const t=this.Zt(e).Ot();return this.Gt.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}qt(e){this.Zt(e).qt()}Zt(e){let t=this.Qt.get(e);return t||(t=new dc,this.Qt.set(e,t)),t}he(e){let t=this.zt.get(e);return t||(t=new ys(Qr),this.zt=this.zt.insert(e,t)),t}te(e){const t=null!==this.se(e);return t||Nr("WatchChangeAggregator","Detected inactive target",e),t}se(e){const t=this.Qt.get(e);return t&&t.kt?null:this.Gt.le(e)}ee(e){this.Qt.set(e,new dc),this.Gt.getRemoteKeysForTarget(e).forEach((t=>{this.Yt(e,t,null)}))}ae(e,t){return this.Gt.getRemoteKeysForTarget(e).has(t)}}function pc(){return new ps(ai.comparator)}function mc(){return new ps(ai.comparator)}const gc={asc:"ASCENDING",desc:"DESCENDING"},yc={"<":"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"},vc={and:"AND",or:"OR"};class bc{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function _c(e,t){return e.useProto3Json||Di(t)?t:{value:t}}function wc(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function Sc(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function kc(e,t){return wc(e,t.toTimestamp())}function Ic(e){return Fr(!!e),ni.fromTimestamp(function(e){const t=Is(e);return new ti(t.seconds,t.nanos)}(e))}function Ec(e,t){return function(e){return new ii(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function Tc(e){const t=ii.fromString(e);return Fr(Kc(t)),t}function Cc(e,t){return Ec(e.databaseId,t.path)}function xc(e,t){const n=Tc(t);if(n.get(1)!==e.databaseId.projectId)throw new $r(Ur.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new $r(Ur.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new ai(Nc(n))}function Oc(e,t){return Ec(e.databaseId,t)}function Ac(e){const t=Tc(e);return 4===t.length?ii.emptyPath():Nc(t)}function Rc(e){return new ii(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Nc(e){return Fr(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function Dc(e,t,n){return{name:Cc(e,t),fields:n.value.mapValue.fields}}function Pc(e,t,n){const r=xc(e,t.name),i=Ic(t.updateTime),s=t.createTime?Ic(t.createTime):ni.min(),o=new Zs({mapValue:{fields:t.fields}}),a=to.newFoundDocument(r,i,s,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Lc(e,t){let n;if(t instanceof ja)n={update:Dc(e,t.key,t.value)};else if(t instanceof za)n={delete:Cc(e,t.key)};else if(t instanceof Ua)n={update:Dc(e,t.key,t.data),updateMask:Gc(t.fieldMask)};else{if(!(t instanceof qa))return Mr();n={verify:Cc(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map((e=>function(e,t){const n=t.transform;if(n instanceof _a)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof wa)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof ka)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Ea)return{fieldPath:t.field.canonicalString(),increment:n.gt};throw Mr()}(0,e)))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:kc(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:Mr()}(e,t.precondition)),n}function Mc(e,t){const n=t.currentDocument?function(e){return void 0!==e.updateTime?Aa.updateTime(Ic(e.updateTime)):void 0!==e.exists?Aa.exists(e.exists):Aa.none()}(t.currentDocument):Aa.none(),r=t.updateTransforms?t.updateTransforms.map((t=>function(e,t){let n=null;if("setToServerValue"in t)Fr("REQUEST_TIME"===t.setToServerValue),n=new _a;else if("appendMissingElements"in t){const e=t.appendMissingElements.values||[];n=new wa(e)}else if("removeAllFromArray"in t){const e=t.removeAllFromArray.values||[];n=new ka(e)}else"increment"in t?n=new Ea(e,t.increment):Mr();const r=oi.fromServerFormat(t.fieldPath);return new xa(r,n)}(e,t))):[];if(t.update){t.update.name;const i=xc(e,t.update.name),s=new Zs({mapValue:{fields:t.update.fields}});if(t.updateMask){const e=function(e){const t=e.fieldPaths||[];return new _s(t.map((e=>oi.fromServerFormat(e))))}(t.updateMask);return new Ua(i,s,e,n,r)}return new ja(i,s,n,r)}if(t.delete){const r=xc(e,t.delete);return new za(r,n)}if(t.verify){const r=xc(e,t.verify);return new qa(r,n)}return Mr()}function Fc(e,t){return{documents:[Oc(e,t.path)]}}function jc(e,t){const n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=Oc(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=Oc(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);const i=function(e){if(0!==e.length)return Wc(uo.create(e,"and"))}(t.filters);i&&(n.structuredQuery.where=i);const s=function(e){if(0!==e.length)return e.map((e=>function(e){return{field:qc(e.field),direction:Bc(e.dir)}}(e)))}(t.orderBy);s&&(n.structuredQuery.orderBy=s);const o=_c(e,t.limit);var a;return null!==o&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt={before:(a=t.startAt).inclusive,values:a.position}),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),n}function Uc(e){let t=Ac(e.parent);
1const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Fr(1===r);const e=n.from[0];e.allDescendants?i=e.collectionId:t=t.child(e.collectionId)}let s=[];n.where&&(s=function(e){const t=$c(e);return t instanceof uo&&fo(t)?t.getFilters():[t]}(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((e=>function(e){return new so(Hc(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))));let a=null;n.limit&&(a=function(e){let t;return t="object"==typeof e?e.value:e,Di(t)?null:t}(n.limit));let c=null;n.startAt&&(c=function(e){const t=!!e.before,n=e.values||[];return new no(n,t)}(n.startAt));let u=null;return n.endAt&&(u=function(e){const t=!e.before,n=e.values||[];return new no(n,t)}(n.endAt)),Mo(t,i,o,s,a,"F",c,u)}function $c(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=Hc(e.unaryFilter.field);return co.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=Hc(e.unaryFilter.field);return co.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=Hc(e.unaryFilter.field);return co.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=Hc(e.unaryFilter.field);return co.create(i,"!=",{nullValue:"NULL_VALUE"});default:return Mr()}}(e):void 0!==e.fieldFilter?function(e){return co.create(Hc(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 Mr()}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return uo.create(e.compositeFilter.filters.map((e=>$c(e))),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return Mr()}}(e.compositeFilter.op))}(e):Mr()}function Bc(e){return gc[e]}function Vc(e){return yc[e]}function zc(e){return vc[e]}function qc(e){return{fieldPath:e.canonicalString()}}function Hc(e){return oi.fromServerFormat(e.fieldPath)}function Wc(e){return e instanceof co?function(e){if("=="===e.op){if(Hs(e.value))return{unaryFilter:{field:qc(e.field),op:"IS_NAN"}};if(qs(e.value))return{unaryFilter:{field:qc(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(Hs(e.value))return{unaryFilter:{field:qc(e.field),op:"IS_NOT_NAN"}};if(qs(e.value))return{unaryFilter:{field:qc(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:qc(e.field),op:Vc(e.op),value:e.value}}}(e):e instanceof uo?function(e){const t=e.getFilters().map((e=>Wc(e)));return 1===t.length?t[0]:{compositeFilter:{op:zc(e.op),filters:t}}}(e):Mr()}function Gc(e){const t=[];return e.fields.forEach((e=>t.push(e.canonicalString()))),{fieldPaths:t}}function Kc(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class Xc{constructor(e,t,n,r,i=ni.min(),s=ni.min(),o=Ss.EMPTY_BYTE_STRING,a=null){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=o,this.expectedCount=a}withSequenceNumber(e){return new Xc(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Xc(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Xc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Xc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class Jc{constructor(e){this.fe=e}}function Yc(e,t){const n=t.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:Qc(t.readTime),hasCommittedMutations:t.hasCommittedMutations};if(t.isFoundDocument())r.document=function(e,t){return{name:Cc(e,t.key),fields:t.data.value.mapValue.fields,updateTime:wc(e,t.version.toTimestamp()),createTime:wc(e,t.createTime.toTimestamp())}}(e.fe,t);else if(t.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:Zc(t.ver
1sion)};else{if(!t.isUnknownDocument())return Mr();r.unknownDocument={path:n.path.toArray(),version:Zc(t.version)}}return r}function Qc(e){const t=e.toTimestamp();return[t.seconds,t.nanoseconds]}function Zc(e){const t=e.toTimestamp();return{seconds:t.seconds,nanoseconds:t.nanoseconds}}function eu(e){const t=new ti(e.seconds,e.nanoseconds);return ni.fromTimestamp(t)}function tu(e,t){const n=(t.baseMutations||[]).map((t=>Mc(e.fe,t)));for(let s=0;s<t.mutations.length-1;++s){const e=t.mutations[s];if(s+1<t.mutations.length&&void 0!==t.mutations[s+1].transform){const n=t.mutations[s+1];e.updateTransforms=n.transform.fieldTransforms,t.mutations.splice(s+1,1),++s}}const r=t.mutations.map((t=>Mc(e.fe,t))),i=ti.fromMillis(t.localWriteTimeMs);return new Ha(t.batchId,i,n,r)}function nu(e){const t=eu(e.readTime),n=void 0!==e.lastLimboFreeSnapshotVersion?eu(e.lastLimboFreeSnapshotVersion):ni.min();let r;var i;return void 0!==e.query.documents?(Fr(1===(i=e.query).documents.length),r=zo(Fo(Ac(i.documents[0])))):r=function(e){return zo(Uc(e))}(e.query),new Xc(r,e.targetId,"TargetPurposeListen",e.lastListenSequenceNumber,t,n,Ss.fromBase64String(e.resumeToken))}function ru(e,t){const n=Zc(t.snapshotVersion),r=Zc(t.lastLimboFreeSnapshotVersion);let i;i=Ro(t.target)?Fc(e.fe,t.target):jc(e.fe,t.target);const s=t.resumeToken.toBase64();return{targetId:t.targetId,canonicalId:Oo(t.target),readTime:n,resumeToken:s,lastListenSequenceNumber:t.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function iu(e){const t=Uc({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Ho(t,t.limit,"L"):t}function su(e,t){return new Ga(t.largestBatchId,Mc(e.fe,t.overlayMutation))}function ou(e,t){const n=t.path.lastSegment();return[e,Mi(t.path.popLast()),n]}function au(e,t,n,r){return{indexId:e,uid:t.uid||"",sequenceNumber:n,readTime:Zc(r.readTime),documentKey:Mi(r.documentKey.path),largestBatchId:r.largestBatchId}}class cu{getBundleMetadata(e,t){return uu(e).get(t).next((e=>{if(e)return{id:(t=e).bundleId,createTime:eu(t.createTime),version:t.version};var t}))}saveBundleMetadata(e,t){return uu(e).put({bundleId:(n=t).id,createTime:Zc(Ic(n.createTime)),version:n.version});var n}getNamedQuery(e,t){return lu(e).get(t).next((e=>{if(e)return{name:(t=e).name,query:iu(t.bundledQuery),readTime:eu(t.readTime)};var t}))}saveNamedQuery(e,t){return lu(e).put(function(e){return{name:e.name,readTime:Zc(Ic(e.readTime)),bundledQuery:e.bundledQuery}}(t))}}function uu(e){return ls(e,"bundles")}function lu(e){return ls(e,"namedQueries")}class hu{constructor(e,t){this.serializer=e,this.userId=t}static de(e,t){const n=t.uid||"";return new hu(e,n)}getOverlay(e,t){return du(e).get(ou(this.userId,t)).next((e=>e?su(this.serializer,e):null))}getOverlays(e,t){const n=sa();return _i.forEach(t,(t=>this.getOverlay(e,t).next((e=>{null!==e&&n.set(t,e)})))).next((()=>n))}saveOverlays(e,t,n){const r=[];return n.forEach(((n,i)=>{const s=new Ga(t,i);r.push(this.we(e,s))})),_i.waitFor(r)}removeOverlaysForBatchId(e,t,n){const r=new Set;t.forEach((e=>r.add(Mi(e.getCollectionPath()))));const i=[];return r.forEach((t=>{const r=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,n+1],!1,!0);i.push(du(e).J("collectionPathOverlayIndex",r))})),_i.waitFor(i)}getOverlaysForCollection(e,t,n){const r=sa(),i=Mi(t),s=IDBKeyRange.bound([this.userId,i,n],[this.userId,i,Number.POSITIVE_INFINITY],!0);return du(e).j("collectionPathOverlayIndex",s).next((e=>{for(const t of e){const e=su(this.serializer,t);r.set(e.getKey(),e)}return r}))}getOverlaysForCollectionGroup(e,t,n,r){const i=sa();let s;const o=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,Number.POSITIVE_INFINITY],!0);return du(e).X({index:"collectionGroupOverlayIndex",range:o},((e,t,n)=>{const o=su(this.serializer,t);i.size()<r||o.largestBatchId===s?(i.set(o.getKey(),o),s=o.largestBatchId):n.done()})).next((()=>i))}we(e,t){return du(e).put(function(e,t,n){const[r,i,s]=ou(t,n.mutation.key);return{userId:t,collectionPath:i,documentId:s,collectionGroup:n.mutation.key.getCollectionGroup(),largestBatchId:n.largestBatchId,overlayMutation:Lc(e.fe,n.mutation)}}(this.serializer,this.userId,t))}}function du(e){return ls(e,"documentOverlays")}class fu{constructor(){}_e(e,t){this.me(e,t),t.ge()}me(e,t){if("nullValue"in e)this.ye(t,5);else if("booleanValue"in e)this.ye(t,10),t.pe(e.booleanValue?1:0);else if("integerValue"in e)this.ye(t,15),t.pe(Es(e.integerValue));else if("doubleValue"in e){const n=Es(e.doubleValue);isNaN(n)?this.ye(t,13):(this.ye(t,15),Pi(n)?t.pe(0):t.pe(n))}else if("timestampValue"in e){const n=e.timestampValue;this.ye(t,20),"string"==typeof n?t.Ie(n):(t.Ie(`${n.seconds||""}`),t.pe(n.nanos||0))}else if("stringValue"in e)this.Te(e.stringValue,t),this.Ee(t);else if("bytesValue"in e)this.ye(t,30),t.Ae(Ts(e.bytesValue)),this.Ee(t);else if("referenceValue"in e)this.ve(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.ye(t,45),t.pe(n.latitude||0),t.pe(n.longitude||0)}else"mapValue"in e?Ks(e)?this.ye(t,Number.MAX_SAFE_INTEGER):(this.Re(e.mapValue,t),this.Ee(t)):"arrayValue"in e?(this.Pe(e.arrayValue,t),this.Ee(t)):Mr()}Te(e,t){this.ye(t,25),this.be(e,t)}be(e,t){t.Ie(e)}Re(e,t){const n=e.fields||{};this.ye(t,55);for(const r of Object.keys(n))this.Te(r,t),this.me(n[r],t)}Pe(e,t){const n=e.values||[];this.ye(t,50);for(const r of n)this.me(r,t)}
1ve(e,t){this.ye(t,37),ai.fromName(e).path.forEach((e=>{this.ye(t,60),this.be(e,t)}))}ye(e,t){e.pe(t)}Ee(e){e.pe(2)}}function pu(e){if(0===e)return 8;let t=0;return e>>4==0&&(t+=4,e<<=4),e>>6==0&&(t+=2,e<<=2),e>>7==0&&(t+=1),t}function mu(e){const t=64-function(e){let t=0;for(let n=0;n<8;++n){const r=pu(255&e[n]);if(t+=r,8!==r)break}return t}(e);return Math.ceil(t/8)}fu.Ve=new fu;class gu{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Se(e){const t=e[Symbol.iterator]();let n=t.next();for(;!n.done;)this.De(n.value),n=t.next();this.Ce()}xe(e){const t=e[Symbol.iterator]();let n=t.next();for(;!n.done;)this.Ne(n.value),n=t.next();this.ke()}Me(e){for(const t of e){const e=t.charCodeAt(0);if(e<128)this.De(e);else if(e<2048)this.De(960|e>>>6),this.De(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.De(480|e>>>12),this.De(128|63&e>>>6),this.De(128|63&e);else{const e=t.codePointAt(0);this.De(240|e>>>18),this.De(128|63&e>>>12),this.De(128|63&e>>>6),this.De(128|63&e)}}this.Ce()}$e(e){for(const t of e){const e=t.charCodeAt(0);if(e<128)this.Ne(e);else if(e<2048)this.Ne(960|e>>>6),this.Ne(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.Ne(480|e>>>12),this.Ne(128|63&e>>>6),this.Ne(128|63&e);else{const e=t.codePointAt(0);this.Ne(240|e>>>18),this.Ne(128|63&e>>>12),this.Ne(128|63&e>>>6),this.Ne(128|63&e)}}this.ke()}Oe(e){const t=this.Fe(e),n=mu(t);this.Be(1+n),this.buffer[this.position++]=255&n;for(let r=t.length-n;r<t.length;++r)this.buffer[this.position++]=255&t[r]}Le(e){const t=this.Fe(e),n=mu(t);this.Be(1+n),this.buffer[this.position++]=~(255&n);for(let r=t.length-n;r<t.length;++r)this.buffer[this.position++]=~(255&t[r])}qe(){this.Ue(255),this.Ue(255)}Ke(){this.Ge(255),this.Ge(255)}reset(){this.position=0}seed(e){this.Be(e.length),this.buffer.set(e,this.position),this.position+=e.length}Qe(){return this.buffer.slice(0,this.position)}Fe(e){const t=function(e){const t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e,!1),new Uint8Array(t.buffer)}(e),n=0!=(128&t[0]);t[0]^=n?255:128;for(let r=1;r<t.length;++r)t[r]^=n?255:0;return t}De(e){const t=255&e;0===t?(this.Ue(0),this.Ue(255)):255===t?(this.Ue(255),this.Ue(0)):this.Ue(t)}Ne(e){const t=255&e;0===t?(this.Ge(0),this.Ge(255)):255===t?(this.Ge(255),this.Ge(0)):this.Ge(e)}Ce(){this.Ue(0),this.Ue(1)}ke(){this.Ge(0),this.Ge(1)}Ue(e){this.Be(1),this.buffer[this.position++]=e}Ge(e){this.Be(1),this.buffer[this.position++]=~e}Be(e){const t=e+this.position;if(t<=this.buffer.length)return;let n=2*this.buffer.length;n<t&&(n=t);const r=new Uint8Array(n);r.set(this.buffer),this.buffer=r}}class yu{constructor(e){this.je=e}Ae(e){this.je.Se(e)}Ie(e){this.je.Me(e)}pe(e){this.je.Oe(e)}ge(){this.je.qe()}}class vu{constructor(e){this.je=e}Ae(e){this.je.xe(e)}Ie(e){this.je.$e(e)}pe(e){this.je.Le(e)}ge(){this.je.Ke()}}class bu{constructor(){this.je=new gu,this.ze=new yu(this.je),this.We=new vu(this.je)}seed(e){this.je.seed(e)}He(e){return 0===e?this.ze:this.We}Qe(){return this.je.Qe()}reset(){this.je.reset()}}class _u{constructor(e,t,n,r){this.indexId=e,this.documentKey=t,this.arrayValue=n,this.directionalValue=r}Je(){const e=this.directionalValue.length,t=0===e||255===this.directionalValue[e-1]?e+1:e,n=new Uint8Array(t);return n.set(this.directionalValue,0),t!==e?n.set([0],this.directionalValue.length):++n[n.length-1],new _u(this.indexId,this.documentKey,this.arrayValue,n)}}function wu(e,t){let n=e.indexId-t.indexId;return 0!==n?n:(n=Su(e.arrayValue,t.arrayValue),0!==n?n:(n=Su(e.directionalValue,t.directionalValue),0!==n?n:ai.comparator(e.documentKey,t.documentKey)))}function Su(e,t){for(let n=0;n<e.length&&n<t.length;++n){const r=e[n]-t[n];if(0!==r)return r}return e.length-t.length}class ku{constructor(e){this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.Ye=e.orderBy,this.Xe=[];for(const t of e.filters){const e=t;e.isInequality()?this.Ze=e:this.Xe.push(e)}}tn(e){Fr(e.collectionGroup===this.collectionId);const t=ui(e);if(void 0!==t&&!this.en(t))return!1;const n=li(e);let r=new Set,i=0,s=0;for(;i<n.length&&this.en(n[i]);++i)r=r.add(n[i].fieldPath.canonicalString());if(i===n.length)return!0;
1if(void 0!==this.Ze){if(!r.has(this.Ze.field.canonicalString())){const e=n[i];if(!this.nn(this.Ze,e)||!this.sn(this.Ye[s++],e))return!1}++i}for(;i<n.length;++i){const e=n[i];if(s>=this.Ye.length||!this.sn(this.Ye[s++],e))return!1}return!0}en(e){for(const t of this.Xe)if(this.nn(t,e))return!0;return!1}nn(e,t){if(void 0===e||!e.field.isEqual(t.fieldPath))return!1;const n="array-contains"===e.op||"array-contains-any"===e.op;return 2===t.kind===n}sn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function Iu(e){var t,n;if(Fr(e instanceof co||e instanceof uo),e instanceof co){if(e instanceof Io){const r=(null===(n=null===(t=e.value.arrayValue)||void 0===t?void 0:t.values)||void 0===n?void 0:n.map((t=>co.create(e.field,"==",t))))||[];return uo.create(r,"or")}return e}const r=e.filters.map((e=>Iu(e)));return uo.create(r,e.op)}function Eu(e){if(0===e.getFilters().length)return[];const t=Ou(Iu(e));return Fr(xu(t)),Tu(t)||Cu(t)?[t]:t.getFilters()}function Tu(e){return e instanceof co}function Cu(e){return e instanceof uo&&fo(e)}function xu(e){return Tu(e)||Cu(e)||function(e){if(e instanceof uo&&ho(e)){for(const t of e.getFilters())if(!Tu(t)&&!Cu(t))return!1;return!0}return!1}(e)}function Ou(e){if(Fr(e instanceof co||e instanceof uo),e instanceof co)return e;if(1===e.filters.length)return Ou(e.filters[0]);const t=e.filters.map((e=>Ou(e)));let n=uo.create(t,e.op);return n=Nu(n),xu(n)?n:(Fr(n instanceof uo),Fr(lo(n)),Fr(n.filters.length>1),n.filters.reduce(((e,t)=>Au(e,t))))}function Au(e,t){let n;return Fr(e instanceof co||e instanceof uo),Fr(t instanceof co||t instanceof uo),n=e instanceof co?t instanceof co?function(e,t){return uo.create([e,t],"and")}(e,t):Ru(e,t):t instanceof co?Ru(t,e):function(e,t){if(Fr(e.filters.length>0&&t.filters.length>0),lo(e)&&lo(t))return yo(e,t.getFilters());const n=ho(e)?e:t,r=ho(e)?t:e,i=n.filters.map((e=>Au(e,r)));return uo.create(i,"or")}(e,t),Nu(n)}function Ru(e,t){if(lo(t))return yo(t,e.getFilters());{const n=t.filters.map((t=>Au(e,t)));return uo.create(n,"or")}}function Nu(e){if(Fr(e instanceof co||e instanceof uo),e instanceof co)return e;const t=e.getFilters();if(1===t.length)return Nu(t[0]);if(po(e))return e;const n=t.map((e=>Nu(e))),r=[];return n.forEach((t=>{t instanceof co?r.push(t):t instanceof uo&&(t.op===e.op?r.push(...t.filters):r.push(t))})),1===r.length?r[0]:uo.create(r,e.op)}class Du{constructor(){this.rn=new Pu}addToCollectionParentIndex(e,t){return this.rn.add(t),_i.resolve()}getCollectionParents(e,t){return _i.resolve(this.rn.getEntries(t))}addFieldIndex(e,t){return _i.resolve()}deleteFieldIndex(e,t){return _i.resolve()}getDocumentsMatchingTarget(e,t){return _i.resolve(null)}getIndexType(e,t){return _i.resolve(0)}getFieldIndexes(e,t){return _i.resolve([])}getNextCollectionGroupToUpdate(e){return _i.resolve(null)}getMinOffset(e,t){return _i.resolve(mi.min())}getMinOffsetFromCollectionGroup(e,t){return _i.resolve(mi.min())}updateCollectionGroup(e,t,n){return _i.resolve()}updateIndexEntries(e,t){return _i.resolve()}}class Pu{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new ys(ii.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new ys(ii.comparator)).toArray()}}const Lu=new Uint8Array(0);class Mu{constructor(e,t){this.user=e,this.databaseId=t,this.on=new Pu,this.un=new Zo((e=>Oo(e)),((e,t)=>Ao(e,t))),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.on.has(t)){const n=t.lastSegment(),r=t.popLast();e.addOnCommittedListener((()=>{this.on.add(t)}));const i={collectionId:n,parent:Mi(r)};return Fu(e).put(i)}return _i.resolve()}getCollectionParents(e,t){const n=[],r=IDBKeyRange.bound([t,""],[ei(t),""],!1,!0);return Fu(e).j(r).next((e=>{for(const r of e){if(r.collectionId!==t)break;n.push(Ui(r.parent))}return n}))}addFieldIndex(e,t){const n=Uu(e),r=function(e){return{indexId:e.indexId,collectionGroup:e.collectionGroup,fields:e.fields.map((e=>[e.fieldPath.canonicalString(),e.kind]))}}(t);delete r.indexId;const i=n.add(r);if(t.indexState){const n=$u(e);return i.next((e=>{n.put(au(e,this.user,t.indexState.sequenceNumber,t.indexState.offset))}))}return i.next()}deleteFieldIndex(e,t){const n=Uu(e),r=$u(e),i=ju(e);return n.delete(t.indexId).next((()=>r.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))).next((()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))))}getDocumentsMatchingTarget(e,t){const n=ju(e);let r=!0;const i=new Map;
vendor: 4,664 bytes, line 1
1return _i.forEach(this.cn(t),(t=>this.an(e,t).next((e=>{r&&(r=!!e),i.set(t,e)})))).next((()=>{if(r){let e=la();const r=[];return _i.forEach(i,((i,s)=>{var o;Nr("IndexedDbIndexManager",`Using index ${o=i,`id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map((e=>`${e.fieldPath}:${e.kind}`)).join(",")}`} to execute ${Oo(t)}`);const a=function(e,t){const n=ui(t);if(void 0===n)return null;for(const r of No(e,n.fieldPath))switch(r.op){case"array-contains-any":return r.value.arrayValue.values||[];case"array-contains":return[r.value]}return null}(s,i),c=function(e,t){const n=new Map;for(const r of li(t))for(const t of No(e,r.fieldPath))switch(t.op){case"==":case"in":n.set(r.fieldPath.canonicalString(),t.value);break;case"not-in":case"!=":return n.set(r.fieldPath.canonicalString(),t.value),Array.from(n.values())}return null}(s,i),u=function(e,t){const n=[];let r=!0;for(const i of li(t)){const t=0===i.kind?Do(e,i.fieldPath,e.startAt):Po(e,i.fieldPath,e.startAt);n.push(t.value),r&&(r=t.inclusive)}return new no(n,r)}(s,i),l=function(e,t){const n=[];let r=!0;for(const i of li(t)){const t=0===i.kind?Po(e,i.fieldPath,e.endAt):Do(e,i.fieldPath,e.endAt);n.push(t.value),r&&(r=t.inclusive)}return new no(n,r)}(s,i),h=this.hn(i,s,u),d=this.hn(i,s,l),f=this.ln(i,s,c),p=this.fn(i.indexId,a,h,u.inclusive,d,l.inclusive,f);return _i.forEach(p,(i=>n.H(i,t.limit).next((t=>{t.forEach((t=>{const n=ai.fromSegments(t.documentKey);e.has(n)||(e=e.add(n),r.push(n))}))}))))})).next((()=>r))}return _i.resolve(null)}))}cn(e){let t=this.un.get(e);return t||(t=0===e.filters.length?[e]:Eu(uo.create(e.filters,"and")).map((t=>xo(e.path,e.collectionGroup,e.orderBy,t.getFilters(),e.limit,e.startAt,e.endAt))),this.un.set(e,t),t)}fn(e,t,n,r,i,s,o){const a=(null!=t?t.length:1)*Math.max(n.length,i.length),c=a/(null!=t?t.length:1),u=[];for(let l=0;l<a;++l){const a=t?this.dn(t[l/c]):Lu,h=this.wn(e,a,n[l%c],r),d=this._n(e,a,i[l%c],s),f=o.map((t=>this.wn(e,a,t,!0)));u.push(...this.createRange(h,d,f))}return u}wn(e,t,n,r){const i=new _u(e,ai.empty(),t,n);return r?i:i.Je()}_n(e,t,n,r){const i=new _u(e,ai.empty(),t,n);return r?i.Je():i}an(e,t){const n=new ku(t),r=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,r).next((e=>{let t=null;for(const r of e)n.tn(r)&&(!t||r.fields.length>t.fields.length)&&(t=r);return t}))}getIndexType(e,t){let n=2;const r=this.cn(t);return _i.forEach(r,(t=>this.an(e,t).next((e=>{e?0!==n&&e.fields.length<function(e){let t=new ys(oi.comparator),n=!1;for(const r of e.filters)for(const e of r.getFlattenedFilters())e.field.isKeyField()||("array-contains"===e.op||"array-contains-any"===e.op?n=!0:t=t.add(e.field));for(const r of e.orderBy)r.field.isKeyField()||(t=t.add(r.field));return t.size+(n?1:0)}(t)&&(n=1):n=0})))).next((()=>function(e){return null!==e.limit}(t)&&r.length>1&&2===n?1:n))}mn(e,t){const n=new bu;for(const r of li(e)){const e=t.data.field(r.fieldPath);if(null==e)return null;const i=n.He(r.kind);fu.Ve._e(e,i)}return n.Qe()}dn(e){const t=new bu;return fu.Ve._e(e,t.He(0)),t.Qe()}gn(e,t){const n=new bu;return fu.Ve._e(Bs(this.databaseId,t),n.He(function(e){const t=li(e);return 0===t.length?0:t[t.length-1].kind}(e))),n.Qe()}ln(e,t,n){if(null===n)return[];let r=[];r.push(new bu);let i=0;for(const s of li(e)){const e=n[i++];for(const n of r)if(this.yn(t,s.fieldPath)&&zs(e))r=this.pn(r,s,e);else{const t=n.He(s.kind);fu.Ve._e(e,t)}}return this.In(r)}hn(e,t,n){return this.ln(e,t,n.position)}In(e){const t=[];for(let n=0;n<e.length;++n)t[n]=e[n].Qe();return t}pn(e,t,n){const r=[...e],i=[];for(const s of n.arrayValue.values||[])for(const e of r){const n=new bu;n.seed(e.Qe()),fu.Ve._e(s,n.He(t.kind)),i.push(n)}return i}yn(e,t){return!!e.filters.find((e=>e instanceof co&&e.field.isEqual(t)&&("in"===e.op||"not-in"===e.op)))}getFieldIndexes(e,t){const n=Uu(e),r=$u(e);return(t?n.j("collectionGroupIndex",IDBKeyRange.bound(t,t)):n.j()).next((e=>{const t=[];return _i.forEach(e,(e=>r.get([e.indexId,this.uid]).next((n=>{t.push(function(e,t){const n=t?new di(t.sequenceNumber,new mi(eu(t.readTime),new ai(Ui(t.documentKey)),t.largestBatchId)):di.empty(),r=e.fields.map((([e,t])=>new hi(oi.fromServerFormat(e),t)));return new ci(e.indexId,e.collectionGroup,r,n)}(e,n))})))).next((()=>t))}))}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next((e=>0===e.length?null:(e.sort(((e,t)=>{const n=e.indexState.sequenceNumber-t.indexState.sequenceNumber;return 0!==n?n:Qr(e.collectionGroup,t.collectionGroup)})),e[0].collectionGroup)))}updateCollectionGroup(e,t,n){const r=Uu(e),i=$u(e);return this.Tn(e).next((e=>r.j("collectionGroupIndex",IDBKeyRange.bound(t,t)).next((t=>
1_i.forEach(t,(t=>i.put(au(t.indexId,this.user,e,n))))))))}updateIndexEntries(e,t){const n=new Map;return _i.forEach(t,((t,r)=>{const i=n.get(t.collectionGroup);return(i?_i.resolve(i):this.getFieldIndexes(e,t.collectionGroup)).next((i=>(n.set(t.collectionGroup,i),_i.forEach(i,(n=>this.En(e,t,n).next((t=>{const i=this.An(r,n);return t.isEqual(i)?_i.resolve():this.vn(e,r,n,t,i)})))))))}))}Rn(e,t,n,r){return ju(e).put({indexId:r.indexId,uid:this.uid,arrayValue:r.arrayValue,directionalValue:r.directionalValue,orderedDocumentKey:this.gn(n,t.key),documentKey:t.key.path.toArray()})}Pn(e,t,n,r){return ju(e).delete([r.indexId,this.uid,r.arrayValue,r.directionalValue,this.gn(n,t.key),t.key.path.toArray()])}En(e,t,n){const r=ju(e);let i=new ys(wu);return r.X({index:"documentKeyIndex",range:IDBKeyRange.only([n.indexId,this.uid,this.gn(n,t)])},((e,r)=>{i=i.add(new _u(n.indexId,t,r.arrayValue,r.directionalValue))})).next((()=>i))}An(e,t){let n=new ys(wu);const r=this.mn(t,e);if(null==r)return n;const i=ui(t);if(null!=i){const s=e.data.field(i.fieldPath);if(zs(s))for(const i of s.arrayValue.values||[])n=n.add(new _u(t.indexId,e.key,this.dn(i),r))}else n=n.add(new _u(t.indexId,e.key,Lu,r));return n}vn(e,t,n,r,i){Nr("IndexedDbIndexManager","Updating index entries for document '%s'",t.key);const s=[];return function(e,t,n,r,i){const s=e.getIterator(),o=t.getIterator();let a=bs(s),c=bs(o);for(;a||c;){let e=!1,t=!1;if(a&&c){const r=n(a,c);r<0?t=!0:r>0&&(e=!0)}else null!=a?t=!0:e=!0;e?(r(c),c=bs(o)):t?(i(a),a=bs(s)):(a=bs(s),c=bs(o))}}(r,i,wu,(r=>{s.push(this.Rn(e,t,n,r))}),(r=>{s.push(this.Pn(e,t,n,r))})),_i.waitFor(s)}Tn(e){let t=1;return $u(e).X({index:"sequenceNumberIndex",reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},((e,n,r)=>{r.done(),t=n.sequenceNumber+1})).next((()=>t))}createRange(e,t,n){n=n.sort(((e,t)=>wu(e,t))).filter(((e,t,n)=>!t||0!==wu(e,n[t-1])));const r=[];r.push(e);for(const s of n){const n=wu(s,e),i=wu(s,t);if(0===n)r[0]=e.Je();else if(n>0&&i<0)r.push(s),r.push(s.Je());else if(i>0)break}r.push(t);const i=[];for(let s=0;s<r.length;s+=2){if(this.bn(r[s],r[s+1]))return[];const e=[r[s].indexId,this.uid,r[s].arrayValue,r[s].directionalValue,Lu,[]],t=[r[s+1].indexId,this.uid,r[s+1].arrayValue,r[s+1].directionalValue,Lu,[]];i.push(IDBKeyRange.bound(e,t))}return i}bn(e,t){return wu(e,t)>0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(Bu)}getMinOffset(e,t){return _i.mapArray(this.cn(t),(t=>this.an(e,t).next((e=>e||Mr())))).next(Bu)}}function Fu(e){return ls(e,"collectionParents")}function ju(e){return ls(e,"indexEntries")}function Uu(e){return ls(e,"indexConfiguration")}function $u(e){return ls(e,"indexState")}function Bu(e){Fr(0!==e.length);let t=e[0].indexState.offset,n=t.largestBatchId;for(let r=1;r<e.length;r++){const i=e[r].indexState.offset;gi(i,t)<0&&(t=i),n<i.largestBatchId&&(n=i.largestBatchId)}return new mi(t.readTime,t.documentKey,n)}const Vu={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class zu{constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}static withCacheSize(e){return new zu(e,zu.DEFAULT_COLLECTION_PERCENTILE,zu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}function qu(e,t,n){const r=e.store("mutations"),i=e.store("documentMutations"),s=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=r.X({range:o},((e,t,n)=>(a++,n.delete())));s.push(c.next((()=>{Fr(1===a)})));const u=[];for(const l of n.mutations){const e=Vi(t,l.key.path,n.batchId);s.push(i.delete(e)),u.push(l.key)}return _i.waitFor(s).next((()=>u))}function Hu(e){if(!e)return 0;let t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw Mr();t=e.noDocument}return JSON.stringify(t).length}zu.DEFAULT_COLLECTION_PERCENTILE=10,zu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,zu.DEFAULT=new zu(41943040,zu.DEFAULT_COLLECTION_PERCENTILE,zu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),zu.DISABLED=new zu(-1,0,0);class Wu{constructor(e,t,n,r){this.userId=e,this.serializer=t,this.indexManager=n,this.referenceDelegate=r,this.Vn={}}static de(e,t,n,r){Fr(""!==e.uid);const i=e.isAuthenticated()?e.uid:"";return new Wu(i,t,n,r)}checkEmpty(e){let t=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Ku(e).X({index:"userMutationsIndex",range:n},((e,n,r)=>{t=!1,r.done()})).next((()=>t))}addMutationBatch(e,t,n,r){const i=Xu(e),s=Ku(e);return s.add({}).next((o=>{Fr("number"==typeof o);const a=new Ha(o,t,n,r),c=function(e,t,n){const r=n.baseMutations.map((t=>Lc(e.fe,t))),i=n.mutations.map((t=>Lc(e.fe,t)));return{userId:t,batchId:n.batchId,localWriteTimeMs:n.localWriteTime.toMillis(),baseMutations:r,mutations:i}}(this.serializer,this.userId,a),u=[];let l=new ys(((e,t)=>Qr(e.canonicalString(),t.canonicalString())));for(const e of r){const t=Vi(this.userId,e.key.path,o);l=l.add(e.key.path.popLast()),u.push(s.put(c)),u.push(i.put(t,zi))}return l.forEach((t=>{u.push(this.indexManager.addToCollectionParentIndex(e,t))})),e.addOnCommittedListener((()=>{this.Vn[o]=a.keys()})),_i.waitFor(u).next((()=>a))}
1))}lookupMutationBatch(e,t){return Ku(e).get(t).next((e=>e?(Fr(e.userId===this.userId),tu(this.serializer,e)):null))}Sn(e,t){return this.Vn[t]?_i.resolve(this.Vn[t]):this.lookupMutationBatch(e,t).next((e=>{if(e){const n=e.keys();return this.Vn[t]=n,n}return null}))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=IDBKeyRange.lowerBound([this.userId,n]);let i=null;return Ku(e).X({index:"userMutationsIndex",range:r},((e,t,r)=>{t.userId===this.userId&&(Fr(t.batchId>=n),i=tu(this.serializer,t)),r.done()})).next((()=>i))}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return Ku(e).X({index:"userMutationsIndex",range:t,reverse:!0},((e,t,r)=>{n=t.batchId,r.done()})).next((()=>n))}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Ku(e).j("userMutationsIndex",t).next((e=>e.map((e=>tu(this.serializer,e)))))}getAllMutationBatchesAffectingDocumentKey(e,t){const n=Bi(this.userId,t.path),r=IDBKeyRange.lowerBound(n),i=[];return Xu(e).X({range:r},((n,r,s)=>{const[o,a,c]=n,u=Ui(a);if(o===this.userId&&t.path.isEqual(u))return Ku(e).get(c).next((e=>{if(!e)throw Mr();Fr(e.userId===this.userId),i.push(tu(this.serializer,e))}));s.done()})).next((()=>i))}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ys(Qr);const r=[];return t.forEach((t=>{const i=Bi(this.userId,t.path),s=IDBKeyRange.lowerBound(i),o=Xu(e).X({range:s},((e,r,i)=>{const[s,o,a]=e,c=Ui(o);s===this.userId&&t.path.isEqual(c)?n=n.add(a):i.done()}));r.push(o)})),_i.waitFor(r).next((()=>this.Dn(e,n)))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1,i=Bi(this.userId,n),s=IDBKeyRange.lowerBound(i);let o=new ys(Qr);return Xu(e).X({range:s},((e,t,i)=>{const[s,a,c]=e,u=Ui(a);s===this.userId&&n.isPrefixOf(u)?u.length===r&&(o=o.add(c)):i.done()})).next((()=>this.Dn(e,o)))}Dn(e,t){const n=[],r=[];return t.forEach((t=>{r.push(Ku(e).get(t).next((e=>{if(null===e)throw Mr();Fr(e.userId===this.userId),n.push(tu(this.serializer,e))})))})),_i.waitFor(r).next((()=>n))}removeMutationBatch(e,t){return qu(e.ht,this.userId,t).next((n=>(e.addOnCommittedListener((()=>{this.Cn(t.batchId)})),_i.forEach(n,(t=>this.referenceDelegate.markPotentiallyOrphaned(e,t))))))}Cn(e){delete this.Vn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next((t=>{if(!t)return _i.resolve();const n=IDBKeyRange.lowerBound([this.userId]),r=[];return Xu(e).X({range:n},((e,t,n)=>{if(e[0]===this.userId){const t=Ui(e[1]);r.push(t)}else n.done()})).next((()=>{Fr(0===r.length)}))}))}containsKey(e,t){return Gu(e,this.userId,t)}xn(e){return Ju(e).get(this.userId).next((e=>e||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""}))}}function Gu(e,t,n){const r=Bi(t,n.path),i=r[1],s=IDBKeyRange.lowerBound(r);let o=!1;return Xu(e).X({range:s,Y:!0},((e,n,r)=>{const[s,a,c]=e;s===t&&a===i&&(o=!0),r.done()})).next((()=>o))}function Ku(e){return ls(e,"mutations")}function Xu(e){return ls(e,"documentMutations")}function Ju(e){return ls(e,"mutationQueues")}class Yu{constructor(e){this.Nn=e}next(){return this.Nn+=2,this.Nn}static kn(){return new Yu(0)}static Mn(){return new Yu(-1)}}class Qu{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.$n(e).next((t=>{const n=new Yu(t.highestTargetId);return t.highestTargetId=n.next(),this.On(e,t).next((()=>t.highestTargetId))}))}getLastRemoteSnapshotVersion(e){return this.$n(e).next((e=>ni.fromTimestamp(new ti(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(e){return this.$n(e).next((e=>e.highestListenSequenceNumber))}setTargetsMetadata(e,t,n){return this.$n(e).next((r=>(r.highestListenSequenceNumber=t,n&&(r.lastRemoteSnapshotVersion=n.toTimestamp()),t>r.highestListenSequenceNumber&&(r.highestListenSequenceNumber=t),this.On(e,r))))}addTargetData(e,t){return this.Fn(e,t).next((()=>this.$n(e).next((n=>(n.targetCount+=1,this.Bn(t,n),this.On(e,n))))))}updateTargetData(e,t){return this.Fn(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next((()=>Zu(e).delete(t.targetId))).next((()=>this.$n(e))).next((t=>(Fr(t.targetCount>0),t.targetCount-=1,this.On(e,t))))}removeTargets(e,t,n){let r=0;const i=[];return Zu(e).X(((s,o)=>{const a=nu(o);a.sequenceNumber<=t&&null===n.get(a.targetId)&&(r++,i.push(this.removeTargetData(e,a)))})).next((()=>_i.waitFor(i))).next((()=>r))}forEachTarget(e,t){return Zu(e).X(((e,n)=>{const r=nu(n);t(r)}))}$n(e){return el(e).get("targetGlobalKey").next((e=>(Fr(null!==e),e)))}On(e,t){return el(e).put("targetGlobalKey",t)}Fn(e,t){return Zu(e).put(ru(this.serializer,t))}Bn(e,t){let n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n}getTargetCount(e){return this.$n(e).next((e=>e.targetCount))}getTargetData(e,t){const n=Oo(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let i=null;return Zu(e).X({range:r,index:"queryTargetsIndex"},((e,n,r)=>{const s=nu(n);Ao(t,s.target)&&(i=s,r.done())})).next((()=>i))}addMatchingKeys(e,t,n){const r=[],i=tl(e);return t.forEach((t=>{const s=Mi(t.path);r.push(i.put({targetId:n,path:s})),r.push(this.referenceDelegate.addReference(e,n,t))})),_i.waitFor(r)}removeMatchingKeys(e,t,n){const r=tl(e);
vendor: 4,418 bytes, line 1
1return _i.forEach(t,(t=>{const i=Mi(t.path);return _i.waitFor([r.delete([n,i]),this.referenceDelegate.removeReference(e,n,t)])}))}removeMatchingKeysForTargetId(e,t){const n=tl(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)}getMatchingKeysForTargetId(e,t){const n=IDBKeyRange.bound([t],[t+1],!1,!0),r=tl(e);let i=la();return r.X({range:n,Y:!0},((e,t,n)=>{const r=Ui(e[1]),s=new ai(r);i=i.add(s)})).next((()=>i))}containsKey(e,t){const n=Mi(t.path),r=IDBKeyRange.bound([n],[ei(n)],!1,!0);let i=0;return tl(e).X({index:"documentTargetsIndex",Y:!0,range:r},(([e,t],n,r)=>{0!==e&&(i++,r.done())})).next((()=>i>0))}le(e,t){return Zu(e).get(t).next((e=>e?nu(e):null))}}function Zu(e){return ls(e,"targets")}function el(e){return ls(e,"targetGlobal")}function tl(e){return ls(e,"targetDocuments")}function nl([e,t],[n,r]){const i=Qr(e,n);return 0===i?Qr(t,r):i}class rl{constructor(e){this.Ln=e,this.buffer=new ys(nl),this.qn=0}Un(){return++this.qn}Kn(e){const t=[e,this.Un()];if(this.buffer.size<this.Ln)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();nl(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class il{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Gn=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Qn(6e4)}stop(){this.Gn&&(this.Gn.cancel(),this.Gn=null)}get started(){return null!==this.Gn}Qn(e){Nr("LruGarbageCollector",`Garbage collection scheduled in ${e}ms`),this.Gn=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.Gn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){Ei(e)?Nr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e):await bi(e)}await this.Qn(3e5)}))}}class sl{constructor(e,t){this.jn=e,this.params=t}calculateTargetCount(e,t){return this.jn.zn(e).next((e=>Math.floor(t/100*e)))}nthSequenceNumber(e,t){if(0===t)return _i.resolve(Ni.ct);const n=new rl(t);return this.jn.forEachTarget(e,(e=>n.Kn(e.sequenceNumber))).next((()=>this.jn.Wn(e,(e=>n.Kn(e))))).next((()=>n.maxValue))}removeTargets(e,t,n){return this.jn.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.jn.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Nr("LruGarbageCollector","Garbage collection skipped; disabled"),_i.resolve(Vu)):this.getCacheSize(e).next((n=>n<this.params.cacheSizeCollectionThreshold?(Nr("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),Vu):this.Hn(e,t)))}getCacheSize(e){return this.jn.getCacheSize(e)}Hn(e,t){let n,r,i,s,a,c,u;const l=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((t=>(t>this.params.maximumSequenceNumbersToCollect?(Nr("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),r=this.params.maximumSequenceNumbersToCollect):r=t,s=Date.now(),this.nthSequenceNumber(e,r)))).next((r=>(n=r,a=Date.now(),this.removeTargets(e,n,t)))).next((t=>(i=t,c=Date.now(),this.removeOrphanedDocuments(e,n)))).next((e=>(u=Date.now(),Rr()<=o.in.DEBUG&&Nr("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${s-l}ms\n\tDetermined least recently used ${r} in `+(a-s)+"ms\n"+`\tRemoved ${i} targets in `+(c-a)+"ms\n"+`\tRemoved ${e} documents in `+(u-c)+"ms\n"+`Total Duration: ${u-l}ms`),_i.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:e}))))}}function ol(e,t){return new sl(e,t)}class al{constructor(e,t){this.db=e,this.garbageCollector=ol(this,t)}zn(e){const t=this.Jn(e);return this.db.getTargetCache().getTargetCount(e).next((e=>t.next((t=>e+t))))}Jn(e){let t=0;return this.Wn(e,(e=>{t++})).next((()=>t))}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}Wn(e,t){return this.Yn(e,((e,n)=>t(n)))}addReference(e,t,n){return cl(e,n)}removeReference(e,t,n){return cl(e,n)}removeTargets(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)}markPotentiallyOrphaned(e,t){return cl(e,t)}Xn(e,t){return function(e,t){let n=!1;return Ju(e).Z((r=>Gu(e,r,t).next((e=>(e&&(n=!0),_i.resolve(!e)))))).next((()=>n))}(e,t)}removeOrphanedDocuments(e,t){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),r=[];let i=0;return this.Yn(e,((s,o)=>
1{if(o<=t){const t=this.Xn(e,s).next((t=>{if(!t)return i++,n.getEntry(e,s).next((()=>(n.removeEntry(s,ni.min()),tl(e).delete([0,Mi(s.path)]))))}));r.push(t)}})).next((()=>_i.waitFor(r))).next((()=>n.apply(e))).next((()=>i))}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)}updateLimboDocument(e,t){return cl(e,t)}Yn(e,t){const n=tl(e);let r,i=Ni.ct;return n.X({index:"documentTargetsIndex"},(([e,n],{path:s,sequenceNumber:o})=>{0===e?(i!==Ni.ct&&t(new ai(Ui(r)),i),i=o,r=s):i=Ni.ct})).next((()=>{i!==Ni.ct&&t(new ai(Ui(r)),i)}))}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function cl(e,t){return tl(e).put(function(e,t){return{targetId:0,path:Mi(e.path),sequenceNumber:t}}(t,e.currentSequenceNumber))}class ul{constructor(){this.changes=new Zo((e=>e.toString()),((e,t)=>e.isEqual(t))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,to.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?_i.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class ll{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,n){return pl(e).put(n)}removeEntry(e,t,n){return pl(e).delete(function(e,t){const n=e.path.toArray();return[n.slice(0,n.length-2),n[n.length-2],Qc(t),n[n.length-1]]}(t,n))}updateMetadata(e,t){return this.getMetadata(e).next((n=>(n.byteSize+=t,this.Zn(e,n))))}getEntry(e,t){let n=to.newInvalidDocument(t);return pl(e).X({index:"documentKeyIndex",range:IDBKeyRange.only(ml(t))},((e,r)=>{n=this.ts(t,r)})).next((()=>n))}es(e,t){let n={size:0,document:to.newInvalidDocument(t)};return pl(e).X({index:"documentKeyIndex",range:IDBKeyRange.only(ml(t))},((e,r)=>{n={document:this.ts(t,r),size:Hu(r)}})).next((()=>n))}getEntries(e,t){let n=ta();return this.ns(e,t,((e,t)=>{const r=this.ts(e,t);n=n.insert(e,r)})).next((()=>n))}ss(e,t){let n=ta(),r=new ps(ai.comparator);return this.ns(e,t,((e,t)=>{const i=this.ts(e,t);n=n.insert(e,i),r=r.insert(e,Hu(t))})).next((()=>({documents:n,rs:r})))}ns(e,t,n){if(t.isEmpty())return _i.resolve();let r=new ys(yl);t.forEach((e=>r=r.add(e)));const i=IDBKeyRange.bound(ml(r.first()),ml(r.last())),s=r.getIterator();let o=s.getNext();return pl(e).X({index:"documentKeyIndex",range:i},((e,t,r)=>{const i=ai.fromSegments([...t.prefixPath,t.collectionGroup,t.documentId]);for(;o&&yl(o,i)<0;)n(o,null),o=s.getNext();o&&o.isEqual(i)&&(n(o,t),o=s.hasNext()?s.getNext():null),o?r.G(ml(o)):r.done()})).next((()=>{for(;o;)n(o,null),o=s.hasNext()?s.getNext():null}))}getDocumentsMatchingQuery(e,t,n,r){const i=t.path,s=[i.popLast().toArray(),i.lastSegment(),Qc(n.readTime),n.documentKey.path.isEmpty()?"":n.documentKey.path.lastSegment()],o=[i.popLast().toArray(),i.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return pl(e).j(IDBKeyRange.bound(s,o,!0)).next((e=>{let n=ta();for(const i of e){const e=this.ts(ai.fromSegments(i.prefixPath.concat(i.collectionGroup,i.documentId)),i);e.isFoundDocument()&&(Xo(t,e)||r.has(e.key))&&(n=n.insert(e.key,e))}return n}))}getAllFromCollectionGroup(e,t,n,r){let i=ta();const s=gl(t,n),o=gl(t,mi.max());return pl(e).X({index:"collectionGroupIndex",range:IDBKeyRange.bound(s,o,!0)},((e,t,n)=>{const s=this.ts(ai.fromSegments(t.prefixPath.concat(t.collectionGroup,t.documentId)),t);i=i.insert(s.key,s),i.size===r&&n.done()})).next((()=>i))}newChangeBuffer(e){return new dl(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next((e=>e.byteSize))}getMetadata(e){return fl(e).get("remoteDocumentGlobalKey").next((e=>(Fr(!!e),e)))}Zn(e,t){return fl(e).put("remoteDocumentGlobalKey",t)}ts(e,t){if(t){const e=function(e,t){let n;if(t.document)n=Pc(e.fe,t.document,!!t.hasCommittedMutations);else if(t.noDocument){const e=ai.fromSegments(t.noDocument.path),r=eu(t.noDocument.readTime);n=to.newNoDocument(e,r),t.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!t.unknownDocument)return Mr();{const e=ai.fromSegments(t.unknownDocument.path),r=eu(t.unknownDocument.version);n=to.newUnknownDocument(e,r)}}return t.readTime&&n.setReadTime(function(e){const t=new ti(e[0],e[1]);return ni.fromTimestamp(t)}(t.readTime)),n}(this.serializer,t);if(!e.isNoDocument()||!e.version.isEqual(ni.min()))return e}return to.newInvalidDocument(e)}}function hl(e){return new ll(e)}class dl extends ul{constructor(e,t){super(),this.os=e,this.trackRemovals=t,this.us=new Zo((e=>e.toString()),((e,t)=>e.isEqual(t)))}applyChanges(e){const t=[];let n=0,r=new ys(((e,t)=>Qr(e.canonicalString(),t.canonicalString())));
vendor: 4,226 bytes, line 1
1return this.changes.forEach(((i,s)=>{const o=this.us.get(i);if(t.push(this.os.removeEntry(e,i,o.readTime)),s.isValidDocument()){const a=Yc(this.os.serializer,s);r=r.add(i.path.popLast());const c=Hu(a);n+=c-o.size,t.push(this.os.addEntry(e,i,a))}else if(n-=o.size,this.trackRemovals){const n=Yc(this.os.serializer,s.convertToNoDocument(ni.min()));t.push(this.os.addEntry(e,i,n))}})),r.forEach((n=>{t.push(this.os.indexManager.addToCollectionParentIndex(e,n))})),t.push(this.os.updateMetadata(e,n)),_i.waitFor(t)}getFromCache(e,t){return this.os.es(e,t).next((e=>(this.us.set(t,{size:e.size,readTime:e.document.readTime}),e.document)))}getAllFromCache(e,t){return this.os.ss(e,t).next((({documents:e,rs:t})=>(t.forEach(((t,n)=>{this.us.set(t,{size:n,readTime:e.get(t).readTime})})),e)))}}function fl(e){return ls(e,"remoteDocumentGlobal")}function pl(e){return ls(e,"remoteDocumentsV14")}function ml(e){const t=e.path.toArray();return[t.slice(0,t.length-2),t[t.length-2],t[t.length-1]]}function gl(e,t){const n=t.documentKey.path.toArray();return[e,Qc(t.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function yl(e,t){const n=e.path.toArray(),r=t.path.toArray();let i=0;for(let s=0;s<n.length-2&&s<r.length-2;++s)if(i=Qr(n[s],r[s]),i)return i;return i=Qr(n.length,r.length),i||(i=Qr(n[n.length-2],r[r.length-2]),i||Qr(n[n.length-1],r[r.length-1]))}class vl{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class bl{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next((r=>(n=r,this.remoteDocumentCache.getEntry(e,t)))).next((e=>(null!==n&&La(n.mutation,e,_s.empty(),ti.now()),e)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((t=>this.getLocalViewOfDocuments(e,t,la()).next((()=>t))))}getLocalViewOfDocuments(e,t,n=la()){const r=sa();return this.populateOverlays(e,r,t).next((()=>this.computeViews(e,t,r,n).next((e=>{let t=ra();return e.forEach(((e,n)=>{t=t.insert(e,n.overlayedDocument)})),t}))))}getOverlayedDocuments(e,t){const n=sa();return this.populateOverlays(e,n,t).next((()=>this.computeViews(e,t,n,la())))}populateOverlays(e,t,n){const r=[];return n.forEach((e=>{t.has(e)||r.push(e)})),this.documentOverlayCache.getOverlays(e,r).next((e=>{e.forEach(((e,n)=>{t.set(e,n)}))}))}computeViews(e,t,n,r){let i=ta();const s=aa(),o=aa();return t.forEach(((e,t)=>{const o=n.get(t.key);r.has(t.key)&&(void 0===o||o.mutation instanceof Ua)?i=i.insert(t.key,t):void 0!==o?(s.set(t.key,o.mutation.getFieldMask()),La(o.mutation,t,o.mutation.getFieldMask(),ti.now())):s.set(t.key,_s.empty())})),this.recalculateAndSaveOverlays(e,i).next((e=>(e.forEach(((e,t)=>s.set(e,t))),t.forEach(((e,t)=>{var n;return o.set(e,new vl(t,null!==(n=s.get(e))&&void 0!==n?n:null))})),o)))}recalculateAndSaveOverlays(e,t){const n=aa();let r=new ps(((e,t)=>e-t)),i=la();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((e=>{for(const i of e)i.keys().forEach((e=>{const s=t.get(e);if(null===s)return;let o=n.get(e)||_s.empty();o=i.applyToLocalView(s,o),n.set(e,o);const a=(r.get(i.batchId)||la()).add(e);r=r.insert(i.batchId,a)}))})).next((()=>{const s=[],o=r.getReverseIterator();for(;o.hasNext();){const r=o.getNext(),a=r.key,c=r.value,u=oa();c.forEach((e=>{if(!i.has(e)){const r=Da(t.get(e),n.get(e));null!==r&&u.set(e,r),i=i.add(e)}})),s.push(this.documentOverlayCache.saveOverlays(e,a,u))}return _i.waitFor(s)})).next((()=>n))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((t=>this.recalculateAndSaveOverlays(e,t)))}getDocumentsMatchingQuery(e,t,n){return function(e){return ai.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):Bo(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n):this.getDocumentsMatchingCollectionQuery(e,t,n)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next((i=>{const s=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-i.size):_i.resolve(sa());let o=-1,a=i;return s.next((t=>
vendor: 12,381 bytes, line 1
1_i.forEach(t,((t,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),i.get(t)?_i.resolve():this.remoteDocumentCache.getEntry(e,t).next((e=>{a=a.insert(t,e)}))))).next((()=>this.populateOverlays(e,t,i))).next((()=>this.computeViews(e,a,t,la()))).next((e=>({batchId:o,changes:ia(e)})))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ai(t)).next((e=>{let t=ra();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t}))}getDocumentsMatchingCollectionGroupQuery(e,t,n){const r=t.collectionGroup;let i=ra();return this.indexManager.getCollectionParents(e,r).next((s=>_i.forEach(s,(s=>{const o=function(e,t){return new Lo(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,s.child(r));return this.getDocumentsMatchingCollectionQuery(e,o,n).next((e=>{e.forEach(((e,t)=>{i=i.insert(e,t)}))}))})).next((()=>i))))}getDocumentsMatchingCollectionQuery(e,t,n){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next((i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r)))).next((e=>{r.forEach(((t,n)=>{const r=n.getKey();null===e.get(r)&&(e=e.insert(r,to.newInvalidDocument(r)))}));let n=ra();return e.forEach(((e,i)=>{const s=r.get(e);void 0!==s&&La(s.mutation,i,_s.empty(),ti.now()),Xo(t,i)&&(n=n.insert(e,i))})),n}))}}class _l{constructor(e){this.serializer=e,this.cs=new Map,this.hs=new Map}getBundleMetadata(e,t){return _i.resolve(this.cs.get(t))}saveBundleMetadata(e,t){var n;return this.cs.set(t.id,{id:(n=t).id,version:n.version,createTime:Ic(n.createTime)}),_i.resolve()}getNamedQuery(e,t){return _i.resolve(this.hs.get(t))}saveNamedQuery(e,t){return this.hs.set(t.name,function(e){return{name:e.name,query:iu(e.bundledQuery),readTime:Ic(e.readTime)}}(t)),_i.resolve()}}class wl{constructor(){this.overlays=new ps(ai.comparator),this.ls=new Map}getOverlay(e,t){return _i.resolve(this.overlays.get(t))}getOverlays(e,t){const n=sa();return _i.forEach(t,(t=>this.getOverlay(e,t).next((e=>{null!==e&&n.set(t,e)})))).next((()=>n))}saveOverlays(e,t,n){return n.forEach(((n,r)=>{this.we(e,t,r)})),_i.resolve()}removeOverlaysForBatchId(e,t,n){const r=this.ls.get(n);return void 0!==r&&(r.forEach((e=>this.overlays=this.overlays.remove(e))),this.ls.delete(n)),_i.resolve()}getOverlaysForCollection(e,t,n){const r=sa(),i=t.length+1,s=new ai(t.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){const e=o.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&e.largestBatchId>n&&r.set(e.getKey(),e)}return _i.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let i=new ps(((e,t)=>e-t));const s=this.overlays.getIterator();for(;s.hasNext();){const e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=i.get(e.largestBatchId);null===t&&(t=sa(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const o=sa(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach(((e,t)=>o.set(e,t))),!(o.size()>=r)););return _i.resolve(o)}we(e,t,n){const r=this.overlays.get(n.key);if(null!==r){const e=this.ls.get(r.largestBatchId).delete(n.key);this.ls.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Ga(t,n));let i=this.ls.get(t);void 0===i&&(i=la(),this.ls.set(t,i)),this.ls.set(t,i.add(n.key))}}class Sl{constructor(){this.fs=new ys(kl.ds),this.ws=new ys(kl._s)}isEmpty(){return this.fs.isEmpty()}addReference(e,t){const n=new kl(e,t);this.fs=this.fs.add(n),this.ws=this.ws.add(n)}gs(e,t){e.forEach((e=>this.addReference(e,t)))}removeReference(e,t){this.ys(new kl(e,t))}ps(e,t){e.forEach((e=>this.removeReference(e,t)))}Is(e){const t=new ai(new ii([])),n=new kl(t,e),r=new kl(t,e+1),i=[];return this.ws.forEachInRange([n,r],(e=>{this.ys(e),i.push(e.key)})),i}Ts(){this.fs.forEach((e=>this.ys(e)))}ys(e){this.fs=this.fs.delete(e),this.ws=this.ws.delete(e)}Es(e){const t=new ai(new ii([])),n=new kl(t,e),r=new kl(t,e+1);let i=la();return this.ws.forEachInRange([n,r],(e=>{i=i.add(e.key)})),i}containsKey(e){const t=new kl(e,0),n=this.fs.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class kl{constructor(e,t){this.key=e,this.As=t}static ds(e,t){return ai.comparator(e.key,t.key)||Qr(e.As,t.As)}static _s(e,t){return Qr(e.As,t.As)||ai.comparator(e.key,t.key)}}class Il{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.vs=1,this.Rs=new ys(kl.ds)}checkEmpty(e){return _i.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){const i=this.vs;this.vs++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new Ha(i,t,n,r);this.mutationQueue.push(s);for(const o of r)this.Rs=this.Rs.add(new kl(o.key,i)),this.indexManager.addToCollectionParentIndex(e,o.key.path.popLast());return _i.resolve(s)}lookupMutationBatch(e,t){return _i.resolve(this.Ps(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.bs(n),i=r<0?0:r;return _i.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return _i.resolve(0===this.mutationQueue.length?-1:this.vs-1)}getAllMutationBatches(e){return _i.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new kl(t,0),r=new kl(t,Number.POSITIVE_INFINITY),i=[];return this.Rs.forEachInRange([n,r],(e=>{const t=this.Ps(e.As);i.push(t)})),_i.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ys(Qr);return t.forEach((e=>{const t=new kl(e,0),r=new kl(e,Number.POSITIVE_INFINITY);this.Rs.forEachInRange([t,r],(e=>{n=n.add(e.As)}))})),_i.resolve(this.Vs(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let i=n;ai.isDocumentKey(i)||(i=i.child(""));const s=new kl(new ai(i),0);let o=new ys(Qr);return this.Rs.forEachWhile((e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(o=o.add(e.As)),!0)}),s),_i.resolve(this.Vs(o))}Vs(e){const t=[];return e.forEach((e=>{const n=this.Ps(e);null!==n&&t.push(n)})),t}removeMutationBatch(e,t){Fr(0===this.Ss(t.batchId,"removed")),this.mutationQueue.shift();let n=this.Rs;return _i.forEach(t.mutations,(r=>{const i=new kl(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)})).next((()=>{this.Rs=n}))}Cn(e){}containsKey(e,t){const n=new kl(t,0),r=this.Rs.firstAfterOrEqual(n);return _i.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,_i.resolve()}Ss(e,t){return this.bs(e)}bs(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Ps(e){const t=this.bs(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class El{constructor(e){this.Ds=e,this.docs=new ps(ai.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,r=this.docs.get(n),i=r?r.size:0,s=this.Ds(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:s}),this.size+=s-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return _i.resolve(n?n.document.mutableCopy():to.newInvalidDocument(t))}getEntries(e,t){let n=ta();return t.forEach((e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():to.newInvalidDocument(e))})),_i.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let i=ta();const s=t.path,o=new ai(s.child("")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){const{key:e,value:{document:o}}=a.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||gi(pi(o),n)<=0||(r.has(o.key)||Xo(t,o))&&(i=i.insert(o.key,o.mutableCopy()))}return _i.resolve(i)}getAllFromCollectionGroup(e,t,n,r){Mr()}Cs(e,t){return _i.forEach(this.docs,(e=>t(e)))}newChangeBuffer(e){return new Tl(this)}getSize(e){return _i.resolve(this.size)}}class Tl extends ul{constructor(e){super(),this.os=e}applyChanges(e){const t=[];return this.changes.forEach(((n,r)=>{r.isValidDocument()?t.push(this.os.addEntry(e,r)):this.os.removeEntry(n)})),_i.waitFor(t)}getFromCache(e,t){return this.os.getEntry(e,t)}getAllFromCache(e,t){return this.os.getEntries(e,t)}}class Cl{constructor(e){this.persistence=e,this.xs=new Zo((e=>Oo(e)),Ao),this.lastRemoteSnapshotVersion=ni.min(),this.highestTargetId=0,this.Ns=0,this.ks=new Sl,this.targetCount=0,this.Ms=Yu.kn()}forEachTarget(e,t){return this.xs.forEach(((e,n)=>t(n))),_i.resolve()}getLastRemoteSnapshotVersion(e){return _i.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return _i.resolve(this.Ns)}allocateTargetId(e){return this.highestTargetId=this.Ms.next(),_i.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Ns&&(this.Ns=t),_i.resolve()}Fn(e){this.xs.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Ms=new Yu(t),this.highestTargetId=t),e.sequenceNumber>this.Ns&&(this.Ns=e.sequenceNumber)}addTargetData(e,t){return this.Fn(t),this.targetCount+=1,_i.resolve()}updateTargetData(e,t){return this.Fn(t),_i.resolve()}removeTargetData(e,t){return this.xs.delete(t.target),this.ks.Is(t.targetId),this.targetCount-=1,_i.resolve()}removeTargets(e,t,n){let r=0;const i=[];return this.xs.forEach(((s,o)=>{o.sequenceNumber<=t&&null===n.get(o.targetId)&&(this.xs.delete(s),i.push(this.removeMatchingKeysForTargetId(e,o.targetId)),r++)})),_i.waitFor(i).next((()=>r))}getTargetCount(e){return _i.resolve(this.targetCount)}getTargetData(e,t){const n=this.xs.get(t)||null;return _i.resolve(n)}addMatchingKeys(e,t,n){return this.ks.gs(t,n),_i.resolve()}removeMatchingKeys(e,t,n){this.ks.ps(t,n);const r=this.persistence.referenceDelegate,i=[];return r&&t.forEach((t=>{i.push(r.markPotentiallyOrphaned(e,t))})),_i.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.ks.Is(t),_i.resolve()}getMatchingKeysForTargetId(e,t){const n=this.ks.Es(t);return _i.resolve(n)}containsKey(e,t){return _i.resolve(this.ks.containsKey(t))}}class xl{constructor(e,t){this.$s={},this.overlays={},this.Os=new Ni(0),this.Fs=!1,this.Fs=!0,this.referenceDelegate=e(this),this.Bs=new Cl(this),this.indexManager=new Du,this.remoteDocumentCache=function(e){return new El(e)}((e=>this.referenceDelegate.Ls(e))),this.serializer=new Jc(t),this.qs=new _l(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Fs=!1,Promise.resolve()}get started(){return this.Fs}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new wl,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.$s[e.toKey()];return n||(n=new Il(t,this.referenceDelegate),this.$s[e.toKey()]=n),n}getTargetCache(){return this.Bs}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.qs}runTransaction(e,t,n){Nr("MemoryPersistence","Starting transaction:",e);const r=new Ol(this.Os.next());return this.referenceDelegate.Us(),n(r).next((e=>this.referenceDelegate.Ks(r).next((()=>e)))).toPromise().then((e=>(r.raiseOnCommittedEvent(),e)))}Gs(e,t){return _i.or(Object.values(this.$s).map((n=>()=>n.containsKey(e,t))))}}class Ol extends vi{constructor(e){super(),this.currentSequenceNumber=e}}class Al{constructor(e){this.persistence=e,this.Qs=new Sl,this.js=null}static zs(e){return new Al(e)}get Ws(){if(this.js)return this.js;throw Mr()}addReference(e,t,n){return this.Qs.addReference(n,t),this.Ws.delete(n.toString()),_i.resolve()}removeReference(e,t,n){return this.Qs.removeReference(n,t),this.Ws.add(n.toString()),_i.resolve()}markPotentiallyOrphaned(e,t){return this.Ws.add(t.toString()),_i.resolve()}removeTarget(e,t){this.Qs.Is(t.targetId).forEach((e=>this.Ws.add(e.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next((e=>{e.forEach((e=>this.Ws.add(e.toString())))})).next((()=>n.removeTargetData(e,t)))}Us(){this.js=new Set}Ks(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return _i.forEach(this.Ws,(n=>{const r=ai.fromPath(n);return this.Hs(e,r).next((e=>{e||t.removeEntry(r,ni.min())}))})).next((()=>(this.js=null,t.apply(e))))}updateLimboDocument(e,t){return this.Hs(e,t).next((e=>{e?this.Ws.delete(t.toString()):this.Ws.add(t.toString())}))}Ls(e){return 0}Hs(e,t){return _i.or([()=>_i.resolve(this.Qs.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Gs(e,t)])}}
1class Rl{constructor(e){this.serializer=e}O(e,t,n,r){const i=new wi("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore("owner")}(e),function(e){e.createObjectStore("mutationQueues",{keyPath:"userId"}),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",$i,{unique:!0}),e.createObjectStore("documentMutations")}(e),Nl(e),function(e){e.createObjectStore("remoteDocuments")}(e));let s=_i.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore("targetDocuments"),e.deleteObjectStore("targets"),e.deleteObjectStore("targetGlobal")}(e),Nl(e)),s=s.next((()=>function(e){const t=e.store("targetGlobal"),n={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:ni.min().toTimestamp(),targetCount:0};return t.put("targetGlobalKey",n)}(i)))),n<4&&r>=4&&(0!==n&&(s=s.next((()=>function(e,t){return t.store("mutations").j().next((n=>{e.deleteObjectStore("mutations"),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",$i,{unique:!0});const r=t.store("mutations"),i=n.map((e=>r.put(e)));return _i.waitFor(i)}))}(e,i)))),s=s.next((()=>{!function(e){e.createObjectStore("clientMetadata",{keyPath:"clientId"})}(e)}))),n<5&&r>=5&&(s=s.next((()=>this.Ys(i)))),n<6&&r>=6&&(s=s.next((()=>(function(e){e.createObjectStore("remoteDocumentGlobal")}(e),this.Xs(i))))),n<7&&r>=7&&(s=s.next((()=>this.Zs(i)))),n<8&&r>=8&&(s=s.next((()=>this.ti(e,i)))),n<9&&r>=9&&(s=s.next((()=>{!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e)}))),n<10&&r>=10&&(s=s.next((()=>this.ei(i)))),n<11&&r>=11&&(s=s.next((()=>{!function(e){e.createObjectStore("bundles",{keyPath:"bundleId"})}(e),function(e){e.createObjectStore("namedQueries",{keyPath:"name"})}(e)}))),n<12&&r>=12&&(s=s.next((()=>{!function(e){const t=e.createObjectStore("documentOverlays",{keyPath:ts});t.createIndex("collectionPathOverlayIndex",ns,{unique:!1}),t.createIndex("collectionGroupOverlayIndex",rs,{unique:!1})}(e)}))),n<13&&r>=13&&(s=s.next((()=>function(e){const t=e.createObjectStore("remoteDocumentsV14",{keyPath:qi});t.createIndex("documentKeyIndex",Hi),t.createIndex("collectionGroupIndex",Wi)}(e))).next((()=>this.ni(e,i))).next((()=>e.deleteObjectStore("remoteDocuments")))),n<14&&r>=14&&(s=s.next((()=>this.si(e,i)))),n<15&&r>=15&&(s=s.next((()=>function(e){e.createObjectStore("indexConfiguration",{keyPath:"indexId",autoIncrement:!0}).createIndex("collectionGroupIndex","collectionGroup",{unique:!1}),e.createObjectStore("indexState",{keyPath:Yi}).createIndex("sequenceNumberIndex",Qi,{unique:!1}),e.createObjectStore("indexEntries",{keyPath:Zi}).createIndex("documentKeyIndex",es,{unique:!1})}(e)))),s}Xs(e){let t=0;return e.store("remoteDocuments").X(((e,n)=>{t+=Hu(n)})).next((()=>{const n={byteSize:t};return e.store("remoteDocumentGlobal").put("remoteDocumentGlobalKey",n)}))}Ys(e){const t=e.store("mutationQueues"),n=e.store("mutations");return t.j().next((t=>_i.forEach(t,(t=>{const r=IDBKeyRange.bound([t.userId,-1],[t.userId,t.lastAcknowledgedBatchId]);return n.j("userMutationsIndex",r).next((n=>_i.forEach(n,(n=>{Fr(n.userId===t.userId);const r=tu(this.serializer,n);return qu(e,t.userId,r).next((()=>{}))}))))}))))}Zs(e){const t=e.store("targetDocuments"),n=e.store("remoteDocuments");return e.store("targetGlobal").get("targetGlobalKey").next((e=>{const r=[];return n.X(((n,i)=>{const s=new ii(n),o=function(e){return[0,Mi(e)]}(s);r.push(t.get(o).next((n=>n?_i.resolve():(n=>t.put({targetId:0,path:Mi(n),sequenceNumber:e.highestListenSequenceNumber}))(s))))})).next((()=>_i.waitFor(r)))}))}ti(e,t){e.createObjectStore("collectionParents",{keyPath:Ji});const n=t.store("collectionParents"),r=new Pu,i=e=>{if(r.add(e)){const t=e.lastSegment(),r=e.popLast();return n.put({collectionId:t,parent:Mi(r)})}};return t.store("remoteDocuments").X({Y:!0},((e,t)=>{const n=new ii(e);return i(n.popLast())})).next((()=>t.store("documentMutations").X({Y:!0},(([e,t,n],r)=>{const s=Ui(t);return i(s.popLast())}))))}ei(e){const t=e.store("targets");return t.X(((e,n)=>{const r=nu(n),i=ru(this.serializer,r);return t.put(i)}))}ni(e,t){const n=t.store("remoteDocuments"),r=[];return n.X(((e,n)=>{const i=t.store("remoteDocumentsV14"),s=(o=n,o.document?new ai(ii.fromString(o.document.name).popFirst(5)):o.noDocument?ai.fromSegments(o.noDocument.path):o.unknownDocument?ai.fromSegments(o.unknownDocument.path):Mr()).path.toArray();var o;const a={prefixPath:s.slice(0,s.length-2),collectionGroup:s[s.length-2],documentId:s[s.length-1],readTime:n.readTime||[0,0],unknownDocument:n.unknownDocument,noDocument:n.noDocument,document:n.document,hasCommittedMutations:!!n.hasCommittedMutations};r.push(i.put(a))})).next((()=>_i.waitFor(r)))}si(e,t){const n=t.store("mutations"),r=hl(this.serializer),i=new xl(Al.zs,this.serializer.fe);return n.j().next((e=>{const n=new Map;return e.forEach((e=>{var t;
1let r=null!==(t=n.get(e.userId))&&void 0!==t?t:la();tu(this.serializer,e).keys().forEach((e=>r=r.add(e))),n.set(e.userId,r)})),_i.forEach(n,((e,n)=>{const s=new xr(n),o=hu.de(this.serializer,s),a=i.getIndexManager(s),c=Wu.de(s,this.serializer,a,i.referenceDelegate);return new bl(r,c,o,a).recalculateAndSaveOverlaysForDocumentKeys(new us(t,Ni.ct),e).next()}))}))}}function Nl(e){e.createObjectStore("targetDocuments",{keyPath:Ki}).createIndex("documentTargetsIndex",Xi,{unique:!0}),e.createObjectStore("targets",{keyPath:"targetId"}).createIndex("queryTargetsIndex",Gi,{unique:!0}),e.createObjectStore("targetGlobal")}const Dl="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.";class Pl{constructor(e,t,n,r,i,s,o,a,c,u,l=15){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=n,this.ii=i,this.window=s,this.document=o,this.ri=c,this.oi=u,this.ui=l,this.Os=null,this.Fs=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ci=null,this.inForeground=!1,this.ai=null,this.hi=null,this.li=Number.NEGATIVE_INFINITY,this.fi=e=>Promise.resolve(),!Pl.D())throw new $r(Ur.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new al(this,r),this.di=t+"main",this.serializer=new Jc(a),this.wi=new Si(this.di,this.ui,new Rl(this.serializer)),this.Bs=new Qu(this.referenceDelegate,this.serializer),this.remoteDocumentCache=hl(this.serializer),this.qs=new cu,this.window&&this.window.localStorage?this._i=this.window.localStorage:(this._i=null,!1===u&&Dr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.mi().then((()=>
1{if(!this.isPrimary&&!this.allowTabSynchronization)throw new $r(Ur.FAILED_PRECONDITION,Dl);return this.gi(),this.yi(),this.pi(),this.runTransaction("getHighestListenSequenceNumber","readonly",(e=>this.Bs.getHighestSequenceNumber(e)))})).then((e=>{this.Os=new Ni(e,this.ri)})).then((()=>{this.Fs=!0})).catch((e=>(this.wi&&this.wi.close(),Promise.reject(e))))}Ii(e){return this.fi=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.wi.B((async t=>{null===t.newVersion&&await e()}))}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.ii.enqueueAndForget((async()=>{this.started&&await this.mi()})))}mi(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(e=>Ml(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next((()=>{if(this.isPrimary)return this.Ti(e).next((e=>{e||(this.isPrimary=!1,this.ii.enqueueRetryable((()=>this.fi(!1))))}))})).next((()=>this.Ei(e))).next((t=>this.isPrimary&&!t?this.Ai(e).next((()=>!1)):!!t&&this.vi(e).next((()=>!0)))))).catch((e=>{if(Ei(e))return Nr("IndexedDbPersistence","Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return Nr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((e=>{this.isPrimary!==e&&this.ii.enqueueRetryable((()=>this.fi(e))),this.isPrimary=e}))}Ti(e){return Ll(e).get("owner").next((e=>_i.resolve(this.Ri(e))))}Pi(e){return Ml(e).delete(this.clientId)}async bi(){if(this.isPrimary&&!this.Vi(this.li,18e5)){this.li=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(e=>{const t=ls(e,"clientMetadata");return t.j().next((e=>{const n=this.Si(e,18e5),r=e.filter((e=>-1===n.indexOf(e)));return _i.forEach(r,(e=>t.delete(e.clientId))).next((()=>r))}))})).catch((()=>[]));if(this._i)for(const t of e)this._i.removeItem(this.Di(t.clientId))}}pi(){this.hi=this.ii.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.mi().then((()=>this.bi())).then((()=>this.pi()))))}Ri(e){return!!e&&e.ownerId===this.clientId}Ei(e){return this.oi?_i.resolve(!0):Ll(e).get("owner").next((t=>{if(null!==t&&this.Vi(t.leaseTimestampMs,5e3)&&!this.Ci(t.ownerId)){if(this.Ri(t)&&this.networkEnabled)return!0;if(!this.Ri(t)){if(!t.allowTabSynchronization)throw new $r(Ur.FAILED_PRECONDITION,Dl);return!1}}return!(!this.networkEnabled||!this.inForeground)||Ml(e).j().next((e=>void 0===this.Si(e,5e3).find((e=>{if(this.clientId!==e.clientId){const t=!this.networkEnabled&&e.networkEnabled,n=!this.inForeground&&e.inForeground,r=this.networkEnabled===e.networkEnabled;if(t||n&&r)return!0}return!1}))))})).next((e=>(this.isPrimary!==e&&Nr("IndexedDbPersistence",`Client ${e?"is":"is not"} eligible for a primary lease.`),e)))}async shutdown(){this.Fs=!1,this.xi(),this.hi&&(this.hi.cancel(),this.hi=null),this.Ni(),this.ki(),await this.wi.runTransaction("shutdown","readwrite",["owner","clientMetadata"],(e=>{const t=new us(e,Ni.ct);return this.Ai(t).next((()=>this.Pi(t)))})),this.wi.close(),this.Mi()}Si(e,t){return e.filter((e=>this.Vi(e.updateTimeMs,t)&&!this.Ci(e.clientId)))}$i(){return this.runTransaction("getActiveClients","readonly",(e=>Ml(e).j().next((e=>this.Si(e,18e5).map((e=>e.clientId))))))}get started(){return this.Fs}getMutationQueue(e,t){return Wu.de(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.Bs}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new Mu(e,this.serializer.fe.databaseId)}getDocumentOverlayCache(e){return hu.de(this.serializer,e)}getBundleCache(){return this.qs}runTransaction(e,t,n){Nr("IndexedDbPersistence","Starting transaction:",e);const r="readonly"===t?"readonly":"readwrite",i=15===(s=this.ui)?cs:14===s?as:13===s?os:12===s?ss:11===s?is:void Mr();var s;let o;return this.wi.runTransaction(e,r,i,(r=>(o=new us(r,this.Os?this.Os.next():Ni.ct),"readwrite-primary"===t?this.Ti(o).next((e=>!!e||this.Ei(o))).next((t=>{if(!t)throw Dr(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.ii.enqueueRetryable((()=>this.fi(!1))),new $r(Ur.FAILED_PRECONDITION,yi);return n(o)})).next((e=>this.vi(o).next((()=>e)))):this.Oi(o).next((()=>n(o)))))).then((e=>(o.raiseOnCommittedEvent(),e)))}Oi(e){return Ll(e).get("owner").next((e=>{if(null!==e&&this.Vi(e.leaseTimestampMs,5e3)&&!this.Ci(e.ownerId)&&!this.Ri(e)&&!(this.oi||this.allowTabSynchronization&&e.allowTabSynchronization))throw new $r(Ur.FAILED_PRECONDITION,Dl)}))}vi(e){const t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return Ll(e).put("owner",t)}static D(){return Si.D()}Ai(e){const t=Ll(e);return t.get("owner").next((e=>this.Ri(e)?(Nr("IndexedDbPersistence","Releasing primary lease."),t.delete("owner")):_i.resolve()))}Vi(e,t){const n=Date.now();return!(e<n-t)&&(!(e>n)||(Dr(`Detected an update time that is in the future: ${e} > ${n}`),!1))}gi(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ai=()=>{this.ii.enqueueAndForget((()=>(this.inForeground="visible"===this.document.visibilityState,this.mi())
1))},this.document.addEventListener("visibilitychange",this.ai),this.inForeground="visible"===this.document.visibilityState)}Ni(){this.ai&&(this.document.removeEventListener("visibilitychange",this.ai),this.ai=null)}yi(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.ci=()=>{this.xi();const e=/(?:Version|Mobile)\/1[456]/;(0,a.G6)()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.ii.enterRestrictedMode(!0),this.ii.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.ci))}ki(){this.ci&&(this.window.removeEventListener("pagehide",this.ci),this.ci=null)}Ci(e){var t;try{const n=null!==(null===(t=this._i)||void 0===t?void 0:t.getItem(this.Di(e)));return Nr("IndexedDbPersistence",`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(e){return Dr("IndexedDbPersistence","Failed to get zombied client id.",e),!1}}xi(){if(this._i)try{this._i.setItem(this.Di(this.clientId),String(Date.now()))}catch(e){Dr("Failed to set zombie client id.",e)}}Mi(){if(this._i)try{this._i.removeItem(this.Di(this.clientId))}catch(e){}}Di(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function Ll(e){return ls(e,"owner")}function Ml(e){return ls(e,"clientMetadata")}function Fl(e,t){let n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}class jl{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.Fi=n,this.Bi=r}static Li(e,t){let n=la(),r=la();for(const i of t.docChanges)switch(i.type){case 0:n=n.add(i.doc.key);break;case 1:r=r.add(i.doc.key)}return new jl(e,t.fromCache,n,r)}}class Ul{constructor(){this.qi=!1}initialize(e,t){this.Ui=e,this.indexManager=t,this.qi=!0}getDocumentsMatchingQuery(e,t,n,r){return this.Ki(e,t).next((i=>i||this.Gi(e,t,r,n))).next((n=>n||this.Qi(e,t)))}Ki(e,t){if(jo(t))return _i.resolve(null);let n=zo(t);return this.indexManager.getIndexType(e,n).next((r=>0===r?null:(null!==t.limit&&1===r&&(t=Ho(t,null,"F"),n=zo(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next((r=>{const i=la(...r);return this.Ui.getDocuments(e,i).next((r=>this.indexManager.getMinOffset(e,n).next((n=>{const s=this.ji(t,r);return this.zi(t,s,i,n.readTime)?this.Ki(e,Ho(t,null,"F")):this.Wi(e,s,t,n)}))))})))))}Gi(e,t,n,r){return jo(t)||r.isEqual(ni.min())?this.Qi(e,t):this.Ui.getDocuments(e,n).next((i=>{const s=this.ji(t,i);return this.zi(t,s,n,r)?this.Qi(e,t):(Rr()<=o.in.DEBUG&&Nr("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),Ko(t)),this.Wi(e,s,t,fi(r,-1)))}))}ji(e,t){let n=new ys(Yo(e));return t.forEach(((t,r)=>{Xo(e,r)&&(n=n.add(r))})),n}zi(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Qi(e,t){return Rr()<=o.in.DEBUG&&Nr("QueryEngine","Using full collection scan to execute query:",Ko(t)),this.Ui.getDocumentsMatchingQuery(e,t,mi.min())}Wi(e,t,n,r){return this.Ui.getDocumentsMatchingQuery(e,n,r).next((e=>(t.forEach((t=>{e=e.insert(t.key,t)})),e)))}}class $l{constructor(e,t,n,r){this.persistence=e,this.Hi=t,this.serializer=r,this.Ji=new ps(Qr),this.Yi=new Zo((e=>Oo(e)),Ao),this.Xi=new Map,this.Zi=e.getRemoteDocumentCache(),this.Bs=e.getTargetCache(),this.qs=e.getBundleCache(),this.tr(n)}tr(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new bl(this.Zi,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Zi.setIndexManager(this.indexManager),this.Hi.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.Ji)))}}function Bl(e,t,n,r){return new $l(e,t,n,r)}async function Vl(e,t){const n=jr(e);return await n.persistence.runTransaction("Handle user change","readonly",(e=>{let r;
1return n.mutationQueue.getAllMutationBatches(e).next((i=>(r=i,n.tr(t),n.mutationQueue.getAllMutationBatches(e)))).next((t=>{const i=[],s=[];let o=la();for(const e of r){i.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}for(const e of t){s.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}return n.localDocuments.getDocuments(e,o).next((e=>({er:e,removedBatchIds:i,addedBatchIds:s})))}))}))}function zl(e){const t=jr(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",(e=>t.Bs.getLastRemoteSnapshotVersion(e)))}function ql(e,t,n){let r=la(),i=la();return n.forEach((e=>r=r.add(e))),t.getEntries(e,r).next((e=>{let r=ta();return n.forEach(((n,s)=>{const o=e.get(n);s.isFoundDocument()!==o.isFoundDocument()&&(i=i.add(n)),s.isNoDocument()&&s.version.isEqual(ni.min())?(t.removeEntry(n,s.readTime),r=r.insert(n,s)):!o.isValidDocument()||s.version.compareTo(o.version)>0||0===s.version.compareTo(o.version)&&o.hasPendingWrites?(t.addEntry(s),r=r.insert(n,s)):Nr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",o.version," Watch version:",s.version)})),{nr:r,sr:i}}))}function Hl(e,t){const n=jr(e);return n.persistence.runTransaction("Get next mutation batch","readonly",(e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t))))}function Wl(e,t){const n=jr(e);return n.persistence.runTransaction("Allocate target","readwrite",(e=>{let r;return n.Bs.getTargetData(e,t).next((i=>i?(r=i,_i.resolve(r)):n.Bs.allocateTargetId(e).next((i=>(r=new Xc(t,i,"TargetPurposeListen",e.currentSequenceNumber),n.Bs.addTargetData(e,r).next((()=>r)))))))})).then((e=>{const r=n.Ji.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Ji=n.Ji.insert(e.targetId,e),n.Yi.set(t,e.targetId)),e}))}async function Gl(e,t,n){const r=jr(e),i=r.Ji.get(t),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,(e=>r.persistence.referenceDelegate.removeTarget(e,i)))}catch(e){if(!Ei(e))throw e;Nr("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}r.Ji=r.Ji.remove(t),r.Yi.delete(i.target)}function Kl(e,t,n){const r=jr(e);let i=ni.min(),s=la();return r.persistence.runTransaction("Execute query","readonly",(e=>function(e,t,n){const r=jr(e),i=r.Yi.get(n);return void 0!==i?_i.resolve(r.Ji.get(i)):r.Bs.getTargetData(t,n)}(r,e,zo(t)).next((t=>{if(t)return i=t.lastLimboFreeSnapshotVersion,r.Bs.getMatchingKeysForTargetId(e,t.targetId).next((e=>{s=e}))})).next((()=>r.Hi.getDocumentsMatchingQuery(e,t,n?i:ni.min(),n?s:la()))).next((e=>(Yl(r,Jo(t),e),{documents:e,ir:s})))))}function Xl(e,t){const n=jr(e),r=jr(n.Bs),i=n.Ji.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(e=>r.le(e,t).next((e=>e?e.target:null))))}function Jl(e,t){const n=jr(e),r=n.Xi.get(t)||ni.min();return n.persistence.runTransaction("Get new document changes","readonly",(e=>n.Zi.getAllFromCollectionGroup(e,t,fi(r,-1),Number.MAX_SAFE_INTEGER))).then((e=>(Yl(n,t,e),e)))}function Yl(e,t,n){let r=e.Xi.get(t)||ni.min();n.forEach(((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)})),e.Xi.set(t,r)}function Ql(e,t){return`firestore_clients_${e}_${t}`}function Zl(e,t,n){let r=`firestore_mutations_${e}_${n}`;return t.isAuthenticated()&&(r+=`_${t.uid}`),r}function eh(e,t){return`firestore_targets_${e}_${t}`}class th{constructor(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}static ar(e,t,n){const r=JSON.parse(n);let i,s="object"==typeof r&&-1!==["pending","acknowledged","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return s&&r.error&&(s="string"==typeof r.error.message&&"string"==typeof r.error.code,s&&(i=new $r(r.error.code,r.error.message))),s?new th(e,t,r.state,i):(Dr("SharedClientState",`Failed to parse mutation state for ID '${t}': ${n}`),null)}hr(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class nh{constructor(e,t,n){this.targetId=e,this.state=t,this.error=n}static ar(e,t){const n=JSON.parse(t);let r,i="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return i&&n.error&&(i="string"==typeof n.error.message&&"string"==typeof n.error.code,i&&(r=new $r(n.error.code,n.error.message))),i?new nh(e,n.state,r):(Dr("SharedCl
1ientState",`Failed to parse target state for ID '${e}': ${t}`),null)}hr(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class rh{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static ar(e,t){const n=JSON.parse(t);let r="object"==typeof n&&n.activeTargetIds instanceof Array,i=da();for(let s=0;r&&s<n.activeTargetIds.length;++s)r=Li(n.activeTargetIds[s]),i=i.add(n.activeTargetIds[s]);return r?new rh(e,i):(Dr("SharedClientState",`Failed to parse client data for instance '${e}': ${t}`),null)}}class ih{constructor(e,t){this.clientId=e,this.onlineState=t}static ar(e){const t=JSON.parse(e);return"object"==typeof t&&-1!==["Unknown","Online","Offline"].indexOf(t.onlineState)&&"string"==typeof t.clientId?new ih(t.clientId,t.onlineState):(Dr("SharedClientState",`Failed to parse online state: ${e}`),null)}}class sh{constructor(){this.activeTargetIds=da()}lr(e){this.activeTargetIds=this.activeTargetIds.add(e)}dr(e){this.activeTargetIds=this.activeTargetIds.delete(e)}hr(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class oh{constructor(e,t,n,r,i){this.window=e,this.ii=t,this.persistenceKey=n,this.wr=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this._r=this.mr.bind(this),this.gr=new ps(Qr),this.started=!1,this.yr=[];const s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.pr=Ql(this.persistenceKey,this.wr),this.Ir=function(e){return`firestore_sequence_number_${e}`}(this.persistenceKey),this.gr=this.gr.insert(this.wr,new sh),this.Tr=new RegExp(`^firestore_clients_${s}_([^_]*)$`),this.Er=new RegExp(`^firestore_mutations_${s}_(\\d+)(?:_(.*))?$`),this.Ar=new RegExp(`^firestore_targets_${s}_(\\d+)$`),this.vr=function(e){return`firestore_online_state_${e}`}(this.persistenceKey),this.Rr=function(e){return`firestore_bundle_loaded_v2_${e}`}(this.persistenceKey),this.window.addEventListener("storage",this._r)}static D(e){return!(!e||!e.localStorage)}async start(){const e=await this.syncEngine.$i();for(const n of e){if(n===this.wr)continue;const e=this.getItem(Ql(this.persistenceKey,n));if(e){const t=rh.ar(n,e);t&&(this.gr=this.gr.insert(t.clientId,t))}}this.Pr();const t=this.storage.getItem(this.vr);if(t){const e=this.br(t);e&&this.Vr(e)}for(const n of this.yr)this.mr(n);this.yr=[],this.window.addEventListener("pagehide",(()=>this.shutdown())),this.started=!0}writeSequenceNumber(e){this.setItem(this.Ir,JSON.stringify(e))}getAllActiveQueryTargets(){return this.Sr(this.gr)}isActiveQueryTarget(e){let t=!1;return this.gr.forEach(((n,r)=>{r.activeTargetIds.has(e)&&(t=!0)})),t}addPendingMutation(e){this.Dr(e,"pending")}updateMutationState(e,t,n){this.Dr(e,t,n),this.Cr(e)}addLocalQueryTarget(e){let t="not-current";if(this.isActiveQueryTarget(e)){const n=this.storage.getItem(eh(this.persistenceKey,e));if(n){const r=nh.ar(e,n);r&&(t=r.state)}}return this.Nr.lr(e),this.Pr(),t}removeLocalQueryTarget(e){this.Nr.dr(e),this.Pr()}isLocalQueryTarget(e){return this.Nr.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(eh(this.persistenceKey,e))}updateQueryState(e,t,n){this.kr(e,t,n)}handleUserChange(e,t,n){t.forEach((e=>{this.Cr(e)})),this.currentUser=e,n.forEach((e=>{this.addPendingMutation(e)}))}setOnlineState(e){this.Mr(e)}notifyBundleLoaded(e){this.$r(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this._r),this.removeItem(this.pr),this.started=!1)}getItem(e){const t=this.storage.getItem(e);return Nr("SharedClientState","READ",e,t),t}setItem(e,t){Nr("SharedClientState","SET",e,t),this.storage.setItem(e,t)}removeItem(e){Nr("SharedClientState","REMOVE",e),this.storage.removeItem(e)}mr(e){const t=e;if(t.storageArea===this.storage){if(Nr("SharedClientState","EVENT",t.key,t.newValue),t.key===this.pr)return void Dr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.ii.enqueueRetryable((async()=>{if(this.started){if(null!==t.key)if(this.Tr.test(t.key)){if(null==t.newValue){const e=this.Or(t.key);return this.Fr(e,null)}{const e=this.Br(t.key,t.newValue);if(e)return this.Fr(e.clientId,e)}}else if(this.Er.test(t.key)){if(null!==t.newValue){const e=this.Lr(t.key,t.newValue);if(e)return this.qr(e)}}else if(this.Ar.test(t.key)){if(null!==t.newValue){const e=this.Ur(t.key,t.newValue);if(e)return this.Kr(e)}}else if(t.key===this.vr){if(null!==t.newValue){const e=this.br(t.newValue);if(e)return this.Vr(e)}}else if(t.key===this.Ir){const e=function(e){let t=Ni.ct;if(null!=e)try{const n=JSON.parse(e);Fr("number"==typeof n),t=n}
1catch(e){Dr("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(t.newValue);e!==Ni.ct&&this.sequenceNumberHandler(e)}else if(t.key===this.Rr){const e=this.Gr(t.newValue);await Promise.all(e.map((e=>this.syncEngine.Qr(e))))}}else this.yr.push(t)}))}}get Nr(){return this.gr.get(this.wr)}Pr(){this.setItem(this.pr,this.Nr.hr())}Dr(e,t,n){const r=new th(this.currentUser,e,t,n),i=Zl(this.persistenceKey,this.currentUser,e);this.setItem(i,r.hr())}Cr(e){const t=Zl(this.persistenceKey,this.currentUser,e);this.removeItem(t)}Mr(e){const t={clientId:this.wr,onlineState:e};this.storage.setItem(this.vr,JSON.stringify(t))}kr(e,t,n){const r=eh(this.persistenceKey,e),i=new nh(e,t,n);this.setItem(r,i.hr())}$r(e){const t=JSON.stringify(Array.from(e));this.setItem(this.Rr,t)}Or(e){const t=this.Tr.exec(e);return t?t[1]:null}Br(e,t){const n=this.Or(e);return rh.ar(n,t)}Lr(e,t){const n=this.Er.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return th.ar(new xr(i),r,t)}Ur(e,t){const n=this.Ar.exec(e),r=Number(n[1]);return nh.ar(r,t)}br(e){return ih.ar(e)}Gr(e){return JSON.parse(e)}async qr(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.jr(e.batchId,e.state,e.error);Nr("SharedClientState",`Ignoring mutation for non-active user ${e.user.uid}`)}Kr(e){return this.syncEngine.zr(e.targetId,e.state,e.error)}Fr(e,t){const n=t?this.gr.insert(e,t):this.gr.remove(e),r=this.Sr(this.gr),i=this.Sr(n),s=[],o=[];return i.forEach((e=>{r.has(e)||s.push(e)})),r.forEach((e=>{i.has(e)||o.push(e)})),this.syncEngine.Wr(s,o).then((()=>{this.gr=n}))}Vr(e){this.gr.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}Sr(e){let t=da();return e.forEach(((e,n)=>{t=t.unionWith(n.activeTargetIds)})),t}}class ah{constructor(){this.Hr=new sh,this.Jr={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.Hr.lr(e),this.Jr[e]||"not-current"}updateQueryState(e,t,n){this.Jr[e]=t}removeLocalQueryTarget(e){this.Hr.dr(e)}isLocalQueryTarget(e){return this.Hr.activeTargetIds.has(e)}clearQueryState(e){delete this.Jr[e]}getAllActiveQueryTargets(){return this.Hr.activeTargetIds}isActiveQueryTarget(e){return this.Hr.activeTargetIds.has(e)}start(){return this.Hr=new sh,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class ch{Yr(e){}shutdown(){}}class uh{constructor(){this.Xr=()=>this.Zr(),this.eo=()=>this.no(),this.so=[],this.io()}Yr(e){this.so.push(e)}shutdown(){window.removeEventListener("online",this.Xr),window.removeEventListener("offline",this.eo)}io(){window.addEventListener("online",this.Xr),window.addEventListener("offline",this.eo)}Zr(){Nr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.so)e(0)}no(){Nr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.so)e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let lh=null;function hh(){return null===lh?lh=268435456+Math.round(2147483648*Math.random()):lh++,"0x"+lh.toString(16)}const dh={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class fh{constructor(e){this.ro=e.ro,this.oo=e.oo}uo(e){this.co=e}ao(e){this.ho=e}onMessage(e){this.lo=e}close(){this.oo()}send(e){this.ro(e)}fo(){this.co()}wo(e){this.ho(e)}_o(e){this.lo(e)}}const ph="WebChannelConnection";class mh extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http";this.mo=t+"://"+e.host,this.yo="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}get po(){return!1}Io(e,t,n,r,i){const s=hh(),o=this.To(e,t);Nr("RestConnection",`Sending RPC '${e}' ${s}:`,o,n);const a={};return this.Eo(a,r,i),this.Ao(e,o,a,n).then((t=>(Nr("RestConnection",`Received RPC '${e}' ${s}: `,t),t)),(t=>{throw Pr("RestConnection",`RPC '${e}' ${s} failed with error: `,t,"url: ",o,"request:",n),t}))}vo(e,t,n,r,i,s){return this.Io(e,t,n,r,i)}
1Eo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+Or,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((t,n)=>e[n]=t)),n&&n.headers.forEach(((t,n)=>e[n]=t))}To(e,t){const n=dh[e];return`${this.mo}/v1/${t}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Ao(e,t,n,r){const i=hh();return new Promise(((s,o)=>{const a=new kr;a.setWithCredentials(!0),a.listenOnce(vr.COMPLETE,(()=>{try{switch(a.getLastErrorCode()){case yr.NO_ERROR:const t=a.getResponseJson();Nr(ph,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),s(t);break;case yr.TIMEOUT:Nr(ph,`RPC '${e}' ${i} timed out`),o(new $r(Ur.DEADLINE_EXCEEDED,"Request time out"));break;case yr.HTTP_ERROR:const n=a.getStatus();if(Nr(ph,`RPC '${e}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(Ur).indexOf(t)>=0?t:Ur.UNKNOWN}(t.status);o(new $r(e,t.message))}else o(new $r(Ur.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new $r(Ur.UNAVAILABLE,"Connection failed."));break;default:Mr()}}finally{Nr(ph,`RPC '${e}' ${i} completed.`)}}));const c=JSON.stringify(r);Nr(ph,`RPC '${e}' ${i} sending request:`,r),a.send(t,"POST",c,n,15)}))}Ro(e,t,n){const r=hh(),i=[this.mo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=mr(),o=gr(),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},c=this.longPollingOptions.timeoutSeconds;void 0!==c&&(a.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(a.xmlHttpFactory=new wr({})),this.Eo(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const u=i.join("");Nr(ph,`Creating RPC '${e}' stream ${r}: ${u}`,a);const l=s.createWebChannel(u,a);let h=!1,d=!1;const f=new fh({ro:t=>{d?Nr(ph,`Not sending because RPC '${e}' stream ${r} is closed:`,t):(h||(Nr(ph,`Opening RPC '${e}' stream ${r} transport.`),l.open(),h=!0),Nr(ph,`RPC '${e}' stream ${r} sending:`,t),l.send(t))},oo:()=>l.close()}),p=(e,t,n)=>{e.listen(t,(e=>{try{n(e)}catch(e){setTimeout((()=>{throw e}),0)}}))};return p(l,Sr.EventType.OPEN,(()=>{d||Nr(ph,`RPC '${e}' stream ${r} transport opened.`)})),p(l,Sr.EventType.CLOSE,(()=>{d||(d=!0,Nr(ph,`RPC '${e}' stream ${r} transport closed`),f.wo())})),p(l,Sr.EventType.ERROR,(t=>{d||(d=!0,Pr(ph,`RPC '${e}' stream ${r} transport errored:`,t),f.wo(new $r(Ur.UNAVAILABLE,"The operation could not be completed")))})),p(l,Sr.EventType.MESSAGE,(t=>{var n;if(!d){const i=t.data[0];Fr(!!i);const s=i,o=s.error||(null===(n=s[0])||void 0===n?void 0:n.error);if(o){Nr(ph,`RPC '${e}' stream ${r} received error:`,o);const t=o.status;let n=function(e){const t=Xa[e];if(void 0!==t)return Qa(t)}(t),i=o.message;void 0===n&&(n=Ur.INTERNAL,i="Unknown error status: "+t+" with message "+o.message),d=!0,f.wo(new $r(n,i)),l.close()}else Nr(ph,`RPC '${e}' stream ${r} received:`,i),f._o(i)}})),p(o,br.STAT_EVENT,(t=>{t.stat===_r.PROXY?Nr(ph,`RPC '${e}' stream ${r} detected buffering proxy`):t.stat===_r.NOPROXY&&Nr(ph,`RPC '${e}' stream ${r} detected no buffering proxy`)})),setTimeout((()=>{f.fo()}),0),f}}function gh(){return"undefined"!=typeof window?window:null}function yh(){return"undefined"!=typeof document?document:null}function vh(e){return new bc(e,!0)}class bh{constructor(e,t,n=1e3,r=1.5,i=6e4){this.ii=e,this.timerId=t,this.Po=n,this.bo=r,this.Vo=i,this.So=0,this.Do=null,this.Co=Date.now(),this.reset()}reset(){this.So=0}xo(){this.So=this.Vo}No(e){this.cancel();const t=Math.floor(this.So+this.ko()),n=Math.max(0,Date.now()-this.Co),r=Math.max(0,t-n);r>0&&Nr("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.So}
1 ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.Do=this.ii.enqueueAfterDelay(this.timerId,r,(()=>(this.Co=Date.now(),e()))),this.So*=this.bo,this.So<this.Po&&(this.So=this.Po),this.So>this.Vo&&(this.So=this.Vo)}Mo(){null!==this.Do&&(this.Do.skipDelay(),this.Do=null)}cancel(){null!==this.Do&&(this.Do.cancel(),this.Do=null)}ko(){return(Math.random()-.5)*this.So}}class _h{constructor(e,t,n,r,i,s,o,a){this.ii=e,this.$o=n,this.Oo=r,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.Fo=0,this.Bo=null,this.Lo=null,this.stream=null,this.qo=new bh(e,t)}Uo(){return 1===this.state||5===this.state||this.Ko()}Ko(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Go()}async stop(){this.Uo()&&await this.close(0)}Qo(){this.state=0,this.qo.reset()}jo(){this.Ko()&&null===this.Bo&&(this.Bo=this.ii.enqueueAfterDelay(this.$o,6e4,(()=>this.zo())))}Wo(e){this.Ho(),this.stream.send(e)}async zo(){if(this.Ko())return this.close(0)}Ho(){this.Bo&&(this.Bo.cancel(),this.Bo=null)}Jo(){this.Lo&&(this.Lo.cancel(),this.Lo=null)}async close(e,t){this.Ho(),this.Jo(),this.qo.cancel(),this.Fo++,4!==e?this.qo.reset():t&&t.code===Ur.RESOURCE_EXHAUSTED?(Dr(t.toString()),Dr("Using maximum backoff delay to prevent overloading the backend."),this.qo.xo()):t&&t.code===Ur.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.Yo(),this.stream.close(),this.stream=null),this.state=e,await this.listener.ao(t)}Yo(){}auth(){this.state=1;const e=this.Xo(this.Fo),t=this.Fo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([e,n])=>{this.Fo===t&&this.Zo(e,n)}),(t=>{e((()=>{const e=new $r(Ur.UNKNOWN,"Fetching auth token failed: "+t.message);return this.tu(e)}))}))}Zo(e,t){const n=this.Xo(this.Fo);this.stream=this.eu(e,t),this.stream.uo((()=>{n((()=>(this.state=2,this.Lo=this.ii.enqueueAfterDelay(this.Oo,1e4,(()=>(this.Ko()&&(this.state=3),Promise.resolve()))),this.listener.uo())))})),this.stream.ao((e=>{n((()=>this.tu(e)))})),this.stream.onMessage((e=>{n((()=>this.onMessage(e)))}))}Go(){this.state=5,this.qo.No((async()=>{this.state=0,this.start()}))}tu(e){return Nr("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}Xo(e){return t=>{this.ii.enqueueAndForget((()=>this.Fo===e?t():(Nr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class wh extends _h{constructor(e,t,n,r,i,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,s),this.serializer=i}eu(e,t){return this.connection.Ro("Listen",e,t)}onMessage(e){this.qo.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:Mr()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],s=function(e,t){return e.useProto3Json?(Fr(void 0===t||"string"==typeof t),Ss.fromBase64String(t||"")):(Fr(void 0===t||t instanceof Uint8Array),Ss.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,a=o&&function(e){const t=void 0===e.code?Ur.UNKNOWN:Qa(e.code);return new $r(t,e.message||"")}(o);n=new hc(r,i,s,a||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=xc(e,r.document.name),s=Ic(r.document.updateTime),o=r.document.createTime?Ic(r.document.createTime):ni.min(),a=new Zs({mapValue:{fields:r.document.fields}}),c=to.newFoundDocument(i,s,o,a),u=r.targetIds||[],l=r.removedTargetIds||[];n=new uc(u,l,c.key,c)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=xc(e,r.document),s=r.readTime?Ic(r.readTime):ni.min(),o=to.newNoDocument(i,s),a=r.removedTargetIds||[];n=new uc([],a,o.key,o)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=xc(e,r.document),s=r.removedTargetIds||[];n=new uc([],s,i,null)}else{if(!("filter"in t))return Mr();{t.filter;const e=t.filter;e.targetId;const{count:r=0,unchangedNames:i}=e,s=new Ka(r,i),o=e.targetId;n=new lc(o,s)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return ni.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?ni.min():t.readTime?Ic(t.readTime):ni.min()}(e);return this.listener.nu(t,n)}su(e){const t={};t.database=Rc(this.serializer),t.addTarget=function(e,t){let n;const r=t.target;if(n=Ro(r)?{documents:Fc(e,r)}:{query:jc(e,r)},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=Sc(e,t.resumeToken);const r=_c(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(ni.min())>0){n.readTime=wc(e,t.snapshotVersion.toTimestamp());const r=_c(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Mr()}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.Wo(t)}iu(e){const t={};t.database=Rc(this.serializer),t.removeTarget=e,this.Wo(t)}}class Sh extends _h{constructor(e,t,n,r,i,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,s
1),this.serializer=i,this.ru=!1}get ou(){return this.ru}start(){this.ru=!1,this.lastStreamToken=void 0,super.start()}Yo(){this.ru&&this.uu([])}eu(e,t){return this.connection.Ro("Write",e,t)}onMessage(e){if(Fr(!!e.streamToken),this.lastStreamToken=e.streamToken,this.ru){this.qo.reset();const t=function(e,t){return e&&e.length>0?(Fr(void 0!==t),e.map((e=>function(e,t){let n=e.updateTime?Ic(e.updateTime):Ic(t);return n.isEqual(ni.min())&&(n=Ic(t)),new Oa(n,e.transformResults||[])}(e,t)))):[]}(e.writeResults,e.commitTime),n=Ic(e.commitTime);return this.listener.cu(n,t)}return Fr(!e.writeResults||0===e.writeResults.length),this.ru=!0,this.listener.au()}hu(){const e={};e.database=Rc(this.serializer),this.Wo(e)}uu(e){const t={streamToken:this.lastStreamToken,writes:e.map((e=>Lc(this.serializer,e)))};this.Wo(t)}}class kh extends class{}{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.lu=!1}fu(){if(this.lu)throw new $r(Ur.FAILED_PRECONDITION,"The client has already been terminated.")}Io(e,t,n){return this.fu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([r,i])=>this.connection.Io(e,t,n,r,i))).catch((e=>{throw"FirebaseError"===e.name?(e.code===Ur.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new $r(Ur.UNKNOWN,e.toString())}))}vo(e,t,n,r){return this.fu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([i,s])=>this.connection.vo(e,t,n,i,s,r))).catch((e=>{throw"FirebaseError"===e.name?(e.code===Ur.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new $r(Ur.UNKNOWN,e.toString())}))}terminate(){this.lu=!0}}class Ih{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.wu=0,this._u=null,this.mu=!0}gu(){0===this.wu&&(this.yu("Unknown"),this._u=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this._u=null,this.pu("Backend didn't respond within 10 seconds."),this.yu("Offline"),Promise.resolve()))))}Iu(e){"Online"===this.state?this.yu("Unknown"):(this.wu++,this.wu>=1&&(this.Tu(),this.pu(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.yu("Offline")))}set(e){this.Tu(),this.wu=0,"Online"===e&&(this.mu=!1),this.yu(e)}yu(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}pu(e){const 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.mu?(Dr(t),this.mu=!1):Nr("OnlineStateTracker",t)}Tu(){null!==this._u&&(this._u.cancel(),this._u=null)}}class Eh{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Eu=[],this.Au=new Map,this.vu=new Set,this.Ru=[],this.Pu=i,this.Pu.Yr((e=>{n.enqueueAndForget((async()=>{Ph(this)&&(Nr("RemoteStore","Restarting streams for network reachability change."),await async function(e){const t=jr(e);t.vu.add(4),await Ch(t),t.bu.set("Unknown"),t.vu.delete(4),await Th(t)}(this))}))})),this.bu=new Ih(n,r)}}async function Th(e){if(Ph(e))for(const t of e.Ru)await t(!0)}async function Ch(e){for(const t of e.Ru)await t(!1)}function xh(e,t){const n=jr(e);n.Au.has(t.targetId)||(n.Au.set(t.targetId,t),Dh(n)?Nh(n):Qh(n).Ko()&&Ah(n,t))}function Oh(e,t){const n=jr(e),r=Qh(n);n.Au.delete(t),r.Ko()&&Rh(n,t),0===n.Au.size&&(r.Ko()?r.jo():Ph(n)&&n.bu.set("Unknown"))}function Ah(e,t){if(e.Vu.qt(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(ni.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}Qh(e).su(t)}function Rh(e,t){e.Vu.qt(t),Qh(e).iu(t)}function Nh(e){e.Vu=new fc({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),le:t=>e.Au.get(t)||null,ue:()=>e.datastore.serializer.databaseId}),Qh(e).start(),e.bu.gu()}function Dh(e){return Ph(e)&&!Qh(e).Uo()&&e.Au.size>0}function Ph(e){return 0===jr(e).vu.size}function Lh(e){e.Vu=void 0}async function Mh(e){e.Au.forEach(((t,n)=>{Ah(e,t)}))}async function Fh(e,t){Lh(e),Dh(e)?(e.bu.Iu(t),Nh(e)):e.bu.set("Unknown")}
1async function jh(e,t,n){if(e.bu.set("Online"),t instanceof hc&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e.Au.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.Au.delete(r),e.Vu.removeTarget(r))}(e,t)}catch(n){Nr("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await Uh(e,n)}else if(t instanceof uc?e.Vu.Ht(t):t instanceof lc?e.Vu.ne(t):e.Vu.Xt(t),!n.isEqual(ni.min()))try{const t=await zl(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.Vu.ce(t);return n.targetChanges.forEach(((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const i=e.Au.get(r);i&&e.Au.set(r,i.withResumeToken(n.resumeToken,t))}})),n.targetMismatches.forEach(((t,n)=>{const r=e.Au.get(t);if(!r)return;e.Au.set(t,r.withResumeToken(Ss.EMPTY_BYTE_STRING,r.snapshotVersion)),Rh(e,t);const i=new Xc(r.target,t,n,r.sequenceNumber);Ah(e,i)})),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){Nr("RemoteStore","Failed to raise snapshot:",t),await Uh(e,t)}}async function Uh(e,t,n){if(!Ei(t))throw t;e.vu.add(1),await Ch(e),e.bu.set("Offline"),n||(n=()=>zl(e.localStore)),e.asyncQueue.enqueueRetryable((async()=>{Nr("RemoteStore","Retrying IndexedDB access"),await n(),e.vu.delete(1),await Th(e)}))}function $h(e,t){return t().catch((n=>Uh(e,n,t)))}async function Bh(e){const t=jr(e),n=Zh(t);let r=t.Eu.length>0?t.Eu[t.Eu.length-1].batchId:-1;for(;Vh(t);)try{const e=await Hl(t.localStore,r);if(null===e){0===t.Eu.length&&n.jo();break}r=e.batchId,zh(t,e)}catch(e){await Uh(t,e)}qh(t)&&Hh(t)}function Vh(e){return Ph(e)&&e.Eu.length<10}function zh(e,t){e.Eu.push(t);const n=Zh(e);n.Ko()&&n.ou&&n.uu(t.mutations)}function qh(e){return Ph(e)&&!Zh(e).Uo()&&e.Eu.length>0}function Hh(e){Zh(e).start()}async function Wh(e){Zh(e).hu()}async function Gh(e){const t=Zh(e);for(const n of e.Eu)t.uu(n.mutations)}async function Kh(e,t,n){const r=e.Eu.shift(),i=Wa.from(r,t,n);await $h(e,(()=>e.remoteSyncer.applySuccessfulWrite(i))),await Bh(e)}async function Xh(e,t){t&&Zh(e).ou&&await async function(e,t){if(Ya(n=t.code)&&n!==Ur.ABORTED){const n=e.Eu.shift();Zh(e).Qo(),await $h(e,(()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t))),await Bh(e)}var n}(e,t),qh(e)&&Hh(e)}async function Jh(e,t){const n=jr(e);n.asyncQueue.verifyOperationInProgress(),Nr("RemoteStore","RemoteStore received new credentials");const r=Ph(n);n.vu.add(3),await Ch(n),r&&n.bu.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.vu.delete(3),await Th(n)}async function Yh(e,t){const n=jr(e);t?(n.vu.delete(2),await Th(n)):t||(n.vu.add(2),await Ch(n),n.bu.set("Unknown"))}function Qh(e){return e.Su||(e.Su=function(e,t,n){const r=jr(e);return r.fu(),new wh(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{uo:Mh.bind(null,e),ao:Fh.bind(null,e),nu:jh.bind(null,e)}),e.Ru.push((async t=>{t?(e.Su.Qo(),Dh(e)?Nh(e):e.bu.set("Unknown")):(await e.Su.stop(),Lh(e))}))),e.Su}function Zh(e){return e.Du||(e.Du=function(e,t,n){const r=jr(e);return r.fu(),new Sh(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{uo:Wh.bind(null,e),ao:Xh.bind(null,e),au:Gh.bind(null,e),cu:Kh.bind(null,e)}),e.Ru.push((async t=>{t?(e.Du.Qo(),await Bh(e)):(await e.Du.stop(),e.Eu.length>0&&(Nr("RemoteStore",`Stopping write stream with ${e.Eu.length} pending writes`),e.Eu=[]))}))),e.Du}class ed{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new Br,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((e=>{}))}static createAndSchedule(e,t,n,r,i){const s=Date.now()+n,o=new ed(e,t,s,r,i);return o.start(n),o}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new $r(Ur.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((e=>
vendor: 6,177 bytes, line 1
1this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function td(e,t){if(Dr("AsyncQueue",`${t}: ${e}`),Ei(e))return new $r(Ur.UNAVAILABLE,`${t}: ${e}`);throw e}class nd{constructor(e){this.comparator=e?(t,n)=>e(t,n)||ai.comparator(t.key,n.key):(e,t)=>ai.comparator(e.key,t.key),this.keyedMap=ra(),this.sortedSet=new ps(this.comparator)}static emptySet(e){return new nd(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((t,n)=>(e(t),!1)))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof nd))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach((t=>{e.push(t.toString())})),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){const n=new nd;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class rd{constructor(){this.Cu=new ps(ai.comparator)}track(e){const t=e.doc.key,n=this.Cu.get(t);n?0!==e.type&&3===n.type?this.Cu=this.Cu.insert(t,e):3===e.type&&1!==n.type?this.Cu=this.Cu.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Cu=this.Cu.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Cu=this.Cu.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Cu=this.Cu.remove(t):1===e.type&&2===n.type?this.Cu=this.Cu.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Cu=this.Cu.insert(t,{type:2,doc:e.doc}):Mr():this.Cu=this.Cu.insert(t,e)}xu(){const e=[];return this.Cu.inorderTraversal(((t,n)=>{e.push(n)})),e}}class id{constructor(e,t,n,r,i,s,o,a,c){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=c}static fromInitialDocuments(e,t,n,r,i){const s=[];return t.forEach((e=>{s.push({type:0,doc:e})})),new id(e,t,nd.emptySet(t),s,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Wo(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r].type!==n[r].type||!t[r].doc.isEqual(n[r].doc))return!1;return!0}}class sd{constructor(){this.Nu=void 0,this.listeners=[]}}class od{constructor(){this.queries=new Zo((e=>Go(e)),Wo),this.onlineState="Unknown",this.ku=new Set}}async function ad(e,t){const n=jr(e),r=t.query;let i=!1,s=n.queries.get(r);if(s||(i=!0,s=new sd),i)try{s.Nu=await n.onListen(r)}catch(e){const n=td(e,`Initialization of query '${Ko(t.query)}' failed`);return void t.onError(n)}n.queries.set(r,s),s.listeners.push(t),t.Mu(n.onlineState),s.Nu&&t.$u(s.Nu)&&hd(n)}async function cd(e,t){const n=jr(e),r=t.query;let i=!1;const s=n.queries.get(r);if(s){const e=s.listeners.indexOf(t);e>=0&&(s.listeners.splice(e,1),i=0===s.listeners.length)}if(i)return n.queries.delete(r),n.onUnlisten(r)}function ud(e,t){const n=jr(e);let r=!1;for(const i of t){const e=i.query,t=n.queries.get(e);if(t){for(const e of t.listeners)e.$u(i)&&(r=!0);t.Nu=i}}r&&hd(n)}function ld(e,t,n){const r=jr(e),i=r.queries.get(t);if(i)for(const s of i.listeners)s.onError(n);r.queries.delete(t)}function hd(e){e.ku.forEach((e=>{e.next()}))}class dd{constructor(e,t,n){this.query=e,this.Ou=t,this.Fu=!1,this.Bu=null,this.onlineState="Unknown",this.options=n||{}}$u(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new id(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Fu?this.Lu(e)&&(this.Ou.next(e),t=!0):this.qu(e,this.onlineState)&&(this.Uu(e),t=!0),this.Bu=e,t}onError(e){this.Ou.error(e)}Mu(e){this.onlineState=e;let t=!1;return this.Bu&&!this.Fu&&this.qu(this.Bu,e)&&(this.Uu(this.Bu),t=!0),t}qu(e,t){if(!e.fromCache)return!0;const n="Offline"!==t;return(!this.options.Ku||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}Lu(e){if(e.docChanges.length>0)return!0;const t=this.Bu&&this.Bu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}Uu(e){e=id.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Fu=!0,this.Ou.next(e)}}class fd{constructor(e){this.key=e}}class pd{constructor(e){this.key=e}}class md{constructor(e,t){this.query=e,this.Yu=t,this.Xu=null,this.hasCachedResults=!1,this.current=!1,this.Zu=la(),this.mutatedKeys=la(),this.tc=Yo(e),this.ec=new nd(this.tc)}get nc(){return this.Yu}sc(e,t){const n=t?t.ic:new rd,r=t?t.ec:this.ec;let i=t?t.mutatedKeys:this.mutatedKeys,s=r,o=!1;const a="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,c="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal(((e,t)=>{const u=r.get(e),l=Xo(this.query,t)?t:null,h=!!u&&this.mutatedKeys.has(u.key),d=!!l&&(l.hasLocalMutations||this.mutatedKeys.has(l.key)&&l.hasCommittedMutations);let f=!1;u&&l?u.data.isEqual(l.data)?h!==d&&(n.track({type:3,doc:l}),f=!0):this.rc(u,l)||(n.track({type:2,doc:l}),f=!0,(a&&this.tc(l,a)>0||c&&this.tc(l,c)<0)&&(o=!0)):!u&&l?(n.track({type:0,doc:l}),f=!0):u&&!l&&(n.track({type:1,doc:u}),f=!0,(a||c)&&(o=!0)),f&&(l?(s=s.add(l),i=d?i.add(e):i.delete(e)):(s=s.delete(e),i=i.delete(e)))})),null!==this.query.limit)for(;s.size>this.query.limit;
1){const e="F"===this.query.limitType?s.last():s.first();s=s.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{ec:s,ic:n,zi:o,mutatedKeys:i}}rc(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n){const r=this.ec;this.ec=e.ec,this.mutatedKeys=e.mutatedKeys;const i=e.ic.xu();i.sort(((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Mr()}};return n(e)-n(t)}(e.type,t.type)||this.tc(e.doc,t.doc))),this.oc(n);const s=t?this.uc():[],o=0===this.Zu.size&&this.current?1:0,a=o!==this.Xu;return this.Xu=o,0!==i.length||a?{snapshot:new id(this.query,e.ec,r,i,e.mutatedKeys,0===o,a,!1,!!n&&n.resumeToken.approximateByteSize()>0),cc:s}:{cc:s}}Mu(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({ec:this.ec,ic:new rd,mutatedKeys:this.mutatedKeys,zi:!1},!1)):{cc:[]}}ac(e){return!this.Yu.has(e)&&!!this.ec.has(e)&&!this.ec.get(e).hasLocalMutations}oc(e){e&&(e.addedDocuments.forEach((e=>this.Yu=this.Yu.add(e))),e.modifiedDocuments.forEach((e=>{})),e.removedDocuments.forEach((e=>this.Yu=this.Yu.delete(e))),this.current=e.current)}uc(){if(!this.current)return[];const e=this.Zu;this.Zu=la(),this.ec.forEach((e=>{this.ac(e.key)&&(this.Zu=this.Zu.add(e.key))}));const t=[];return e.forEach((e=>{this.Zu.has(e)||t.push(new pd(e))})),this.Zu.forEach((n=>{e.has(n)||t.push(new fd(n))})),t}hc(e){this.Yu=e.ir,this.Zu=la();const t=this.sc(e.documents);return this.applyChanges(t,!0)}lc(){return id.fromInitialDocuments(this.query,this.ec,this.mutatedKeys,0===this.Xu,this.hasCachedResults)}}class gd{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class yd{constructor(e){this.key=e,this.fc=!1}}class vd{constructor(e,t,n,r,i,s){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.dc={},this.wc=new Zo((e=>Go(e)),Wo),this._c=new Map,this.mc=new Set,this.gc=new ps(ai.comparator),this.yc=new Map,this.Ic=new Sl,this.Tc={},this.Ec=new Map,this.Ac=Yu.Mn(),this.onlineState="Unknown",this.vc=void 0}get isPrimaryClient(){return!0===this.vc}}async function bd(e,t){const n=Hd(e);let r,i;const s=n.wc.get(t);if(s)r=s.targetId,n.sharedClientState.addLocalQueryTarget(r),i=s.view.lc();else{const e=await Wl(n.localStore,zo(t)),s=n.sharedClientState.addLocalQueryTarget(e.targetId);r=e.targetId,i=await _d(n,t,r,"current"===s,e.resumeToken),n.isPrimaryClient&&xh(n.remoteStore,e)}return i}async function _d(e,t,n,r,i){e.Rc=(t,n,r)=>async function(e,t,n,r){let i=t.view.sc(n);i.zi&&(i=await Kl(e.localStore,t.query,!1).then((({documents:e})=>t.view.sc(e,i))));const s=r&&r.targetChanges.get(t.targetId),o=t.view.applyChanges(i,e.isPrimaryClient,s);return Rd(e,t.targetId,o.cc),o.snapshot}(e,t,n,r);const s=await Kl(e.localStore,t,!0),o=new md(t,s.ir),a=o.sc(s.documents),c=cc.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,i),u=o.applyChanges(a,e.isPrimaryClient,c);Rd(e,n,u.cc);const l=new gd(t,n,o);return e.wc.set(t,l),e._c.has(n)?e._c.get(n).push(t):e._c.set(n,[t]),u.snapshot}async function wd(e,t){const n=jr(e),r=n.wc.get(t),i=n._c.get(r.targetId);if(i.length>1)return n._c.set(r.targetId,i.filter((e=>!Wo(e,t)))),void n.wc.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await Gl(n.localStore,r.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(r.targetId),Oh(n.remoteStore,r.targetId),Od(n,r.targetId)})).catch(bi)):(Od(n,r.targetId),await Gl(n.localStore,r.targetId,!0))}async function Sd(e,t){const n=jr(e);try{const e=await function(e,t){const n=jr(e),r=t.snapshotVersion;let i=n.Ji;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(e=>{const s=n.Zi.newChangeBuffer({trackRemovals:!0});i=n.Ji;const o=[];
1t.targetChanges.forEach(((s,a)=>{const c=i.get(a);if(!c)return;o.push(n.Bs.removeMatchingKeys(e,s.removedDocuments,a).next((()=>n.Bs.addMatchingKeys(e,s.addedDocuments,a))));let u=c.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(a)?u=u.withResumeToken(Ss.EMPTY_BYTE_STRING,ni.min()).withLastLimboFreeSnapshotVersion(ni.min()):s.resumeToken.approximateByteSize()>0&&(u=u.withResumeToken(s.resumeToken,r)),i=i.insert(a,u),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(c,u,s)&&o.push(n.Bs.updateTargetData(e,u))}));let a=ta(),c=la();if(t.documentUpdates.forEach((r=>{t.resolvedLimboDocuments.has(r)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))})),o.push(ql(e,s,t.documentUpdates).next((e=>{a=e.nr,c=e.sr}))),!r.isEqual(ni.min())){const t=n.Bs.getLastRemoteSnapshotVersion(e).next((t=>n.Bs.setTargetsMetadata(e,e.currentSequenceNumber,r)));o.push(t)}return _i.waitFor(o).next((()=>s.apply(e))).next((()=>n.localDocuments.getLocalViewOfDocuments(e,a,c))).next((()=>a))})).then((e=>(n.Ji=i,e)))}(n.localStore,t);
1t.targetChanges.forEach(((e,t)=>{const r=n.yc.get(t);r&&(Fr(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?r.fc=!0:e.modifiedDocuments.size>0?Fr(r.fc):e.removedDocuments.size>0&&(Fr(r.fc),r.fc=!1))})),await Pd(n,e,t)}catch(e){await bi(e)}}function kd(e,t,n){const r=jr(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.wc.forEach(((n,r)=>{const i=r.view.Mu(t);i.snapshot&&e.push(i.snapshot)})),function(e,t){const n=jr(e);n.onlineState=t;let r=!1;n.queries.forEach(((e,n)=>{for(const i of n.listeners)i.Mu(t)&&(r=!0)})),r&&hd(n)}(r.eventManager,t),e.length&&r.dc.nu(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function Id(e,t,n){const r=jr(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.yc.get(t),s=i&&i.key;if(s){let e=new ps(ai.comparator);e=e.insert(s,to.newNoDocument(s,ni.min()));const n=la().add(s),i=new ac(ni.min(),new Map,new ps(Qr),e,n);await Sd(r,i),r.gc=r.gc.remove(s),r.yc.delete(t),Dd(r)}else await Gl(r.localStore,t,!1).then((()=>Od(r,t,n))).catch(bi)}async function Ed(e,t){const n=jr(e),r=t.batch.batchId;try{const e=await function(e,t){const n=jr(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(e=>{const r=t.batch.keys(),i=n.Zi.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const i=n.batch,s=i.keys();let o=_i.resolve();return s.forEach((e=>{o=o.next((()=>r.getEntry(t,e))).next((t=>{const s=n.docVersions.get(e);Fr(null!==s),t.version.compareTo(s)<0&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))}))})),o.next((()=>e.mutationQueue.removeMutationBatch(t,i)))}(n,e,t,i).next((()=>i.apply(e))).next((()=>n.mutationQueue.performConsistencyCheck(e))).next((()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId))).next((()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=la();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t)))).next((()=>n.localDocuments.getDocuments(e,r)))}))}(n.localStore,t);xd(n,r,null),Cd(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Pd(n,e)}catch(e){await bi(e)}}async function Td(e,t,n){const r=jr(e);try{const e=await function(e,t){const n=jr(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",(e=>{let r;
vendor: 1,914 bytes, line 1
1return n.mutationQueue.lookupMutationBatch(e,t).next((t=>(Fr(null!==t),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t)))).next((()=>n.mutationQueue.performConsistencyCheck(e))).next((()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t))).next((()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r))).next((()=>n.localDocuments.getDocuments(e,r)))}))}(r.localStore,t);xd(r,t,n),Cd(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await Pd(r,e)}catch(n){await bi(n)}}function Cd(e,t){(e.Ec.get(t)||[]).forEach((e=>{e.resolve()})),e.Ec.delete(t)}function xd(e,t,n){const r=jr(e);let i=r.Tc[r.currentUser.toKey()];if(i){const e=i.get(t);e&&(n?e.reject(n):e.resolve(),i=i.remove(t)),r.Tc[r.currentUser.toKey()]=i}}function Od(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e._c.get(t))e.wc.delete(r),n&&e.dc.Pc(r,n);e._c.delete(t),e.isPrimaryClient&&e.Ic.Is(t).forEach((t=>{e.Ic.containsKey(t)||Ad(e,t)}))}function Ad(e,t){e.mc.delete(t.path.canonicalString());const n=e.gc.get(t);null!==n&&(Oh(e.remoteStore,n),e.gc=e.gc.remove(t),e.yc.delete(n),Dd(e))}function Rd(e,t,n){for(const r of n)r instanceof fd?(e.Ic.addReference(r.key,t),Nd(e,r)):r instanceof pd?(Nr("SyncEngine","Document no longer in limbo: "+r.key),e.Ic.removeReference(r.key,t),e.Ic.containsKey(r.key)||Ad(e,r.key)):Mr()}function Nd(e,t){const n=t.key,r=n.path.canonicalString();e.gc.get(n)||e.mc.has(r)||(Nr("SyncEngine","New document in limbo: "+n),e.mc.add(r),Dd(e))}function Dd(e){for(;e.mc.size>0&&e.gc.size<e.maxConcurrentLimboResolutions;){const t=e.mc.values().next().value;e.mc.delete(t);const n=new ai(ii.fromString(t)),r=e.Ac.next();e.yc.set(r,new yd(n)),e.gc=e.gc.insert(n,r),xh(e.remoteStore,new Xc(zo(Fo(n.path)),r,"TargetPurposeLimboResolution",Ni.ct))}}async function Pd(e,t,n){const r=jr(e),i=[],s=[],o=[];r.wc.isEmpty()||(r.wc.forEach(((e,a)=>{o.push(r.Rc(a,t,n).then((e=>
1{if((e||n)&&r.isPrimaryClient&&r.sharedClientState.updateQueryState(a.targetId,(null==e?void 0:e.fromCache)?"not-current":"current"),e){i.push(e);const t=jl.Li(a.targetId,e);s.push(t)}})))})),await Promise.all(o),r.dc.nu(i),await async function(e,t){const n=jr(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(e=>_i.forEach(t,(t=>_i.forEach(t.Fi,(r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r))).next((()=>_i.forEach(t.Bi,(r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))))))}catch(e){if(!Ei(e))throw e;Nr("LocalStore","Failed to update sequence numbers: "+e)}for(const r of t){const e=r.targetId;if(!r.fromCache){const t=n.Ji.get(e),r=t.snapshotVersion,i=t.withLastLimboFreeSnapshotVersion(r);n.Ji=n.Ji.insert(e,i)}}}(r.localStore,s))}async function Ld(e,t){const n=jr(e);if(!n.currentUser.isEqual(t)){Nr("SyncEngine","User change. New user:",t.toKey());const e=await Vl(n.localStore,t);n.currentUser=t,function(e,t){e.Ec.forEach((e=>{e.forEach((e=>{e.reject(new $r(Ur.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),e.Ec.clear()}(n),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await Pd(n,e.er)}}function Md(e,t){const n=jr(e),r=n.yc.get(t);if(r&&r.fc)return la().add(r.key);{let e=la();const r=n._c.get(t);if(!r)return e;for(const t of r){const r=n.wc.get(t);e=e.unionWith(r.view.nc)}return e}}async function Fd(e,t){const n=jr(e),r=await Kl(n.localStore,t.query,!0),i=t.view.hc(r);return n.isPrimaryClient&&Rd(n,t.targetId,i.cc),i}async function jd(e,t){const n=jr(e);return Jl(n.localStore,t).then((e=>Pd(n,e)))}async function Ud(e,t,n,r){const i=jr(e),s=await function(e,t){const n=jr(e),r=jr(n.mutationQueue);return n.persistence.runTransaction("Lookup mutation documents","readonly",(e=>r.Sn(e,t).next((t=>t?n.localDocuments.getDocuments(e,t):_i.resolve(null)))))}(i.localStore,t);null!==s?("pending"===n?await Bh(i.remoteStore):"acknowledged"===n||"rejected"===n?(xd(i,t,r||null),Cd(i,t),function(e,t){jr(jr(e).mutationQueue).Cn(t)}(i.localStore,t)):Mr(),await Pd(i,s)):Nr("SyncEngine","Cannot apply mutation batch with id: "+t)}async function $d(e,t,n){const r=jr(e),i=[],s=[];for(const o of t){let e;const t=r._c.get(o);if(t&&0!==t.length){e=await Wl(r.localStore,zo(t[0]));for(const e of t){const t=r.wc.get(e),n=await Fd(r,t);n.snapshot&&s.push(n.snapshot)}}else{const t=await Xl(r.localStore,o);e=await Wl(r.localStore,t),await _d(r,Bd(t),o,!1,e.resumeToken)}i.push(e)}return r.dc.nu(s),i}function Bd(e){return Mo(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function Vd(e){const t=jr(e);return jr(jr(t.localStore).persistence).$i()}async function zd(e,t,n,r){const i=jr(e);if(i.vc)return void Nr("SyncEngine","Ignoring unexpected query state notification.");const s=i._c.get(t);if(s&&s.length>0)switch(n){case"current":case"not-current":{const e=await Jl(i.localStore,Jo(s[0])),r=ac.createSynthesizedRemoteEventForCurrentChange(t,"current"===n,Ss.EMPTY_BYTE_STRING);await Pd(i,e,r);break}case"rejected":await Gl(i.localStore,t,!0),Od(i,t,r);break;default:Mr()}}async function qd(e,t,n){const r=Hd(e);if(r.vc){for(const e of t){if(r._c.has(e)){Nr("SyncEngine","Adding an already active target "+e);continue}const t=await Xl(r.localStore,e),n=await Wl(r.localStore,t);await _d(r,Bd(t),n.targetId,!1,n.resumeToken),xh(r.remoteStore,n)}for(const e of n)r._c.has(e)&&await Gl(r.localStore,e,!1).then((()=>{Oh(r.remoteStore,e),Od(r,e)})).catch(bi)}}function Hd(e){const t=jr(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=Sd.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=Md.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=Id.bind(null,t),t.dc.nu=ud.bind(null,t.eventManager),t.dc.Pc=ld.bind(null,t.eventManager),t}function Wd(e){const t=jr(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Ed.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=Td.bind(null,t),t}class Gd{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=vh(e.databaseInfo.databaseId),this.sharedCl
1ientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){return Bl(this.persistence,new Ul,e.initialUser,this.serializer)}createPersistence(e){return new xl(Al.zs,this.serializer)}createSharedClientState(e){return new ah}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class Kd extends Gd{constructor(e,t,n){super(),this.Vc=e,this.cacheSizeBytes=t,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Vc.initialize(this,e),await Wd(this.Vc.syncEngine),await Bh(this.Vc.remoteStore),await this.persistence.Ii((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve())))}createLocalStore(e){return Bl(this.persistence,new Ul,e.initialUser,this.serializer)}createGarbageCollectionScheduler(e,t){const n=this.persistence.referenceDelegate.garbageCollector;return new il(n,e.asyncQueue,t)}createIndexBackfillerScheduler(e,t){const n=new Ri(t,this.persistence);return new Ai(e.asyncQueue,n)}createPersistence(e){const t=Fl(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?zu.withCacheSize(this.cacheSizeBytes):zu.DEFAULT;return new Pl(this.synchronizeTabs,t,e.clientId,n,e.asyncQueue,gh(),yh(),this.serializer,this.sharedClientState,!!this.forceOwnership)}createSharedClientState(e){return new ah}}class Xd extends Kd{constructor(e,t){super(e,t,!1),this.Vc=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const t=this.Vc.syncEngine;this.sharedClientState instanceof oh&&(this.sharedClientState.syncEngine={jr:Ud.bind(null,t),zr:zd.bind(null,t),Wr:qd.bind(null,t),$i:Vd.bind(null,t),Qr:jd.bind(null,t)},await this.sharedClientState.start()),await this.persistence.Ii((async e=>{await async function(e,t){const n=jr(e);if(Hd(n),Wd(n),!0===t&&!0!==n.vc){const e=n.sharedClientState.getAllActiveQueryTargets(),t=await $d(n,e.toArray());n.vc=!0,await Yh(n.remoteStore,!0);for(const r of t)xh(n.remoteStore,r)}else if(!1===t&&!1!==n.vc){const e=[];let t=Promise.resolve();n._c.forEach(((r,i)=>{n.sharedClientState.isLocalQueryTarget(i)?e.push(i):t=t.then((()=>(Od(n,i),Gl(n.localStore,i,!0)))),Oh(n.remoteStore,i)})),await t,await $d(n,e),function(e){const t=jr(e);t.yc.forEach(((e,n)=>{Oh(t.remoteStore,n)})),t.Ic.Ts(),t.yc=new Map,t.gc=new ps(ai.comparator)}(n),n.vc=!1,await Yh(n.remoteStore,!1)}}(this.Vc.syncEngine,e),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start():e||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(e&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():e||this.indexBackfillerScheduler.stop())}))}createSharedClientState(e){const t=gh();if(!oh.D(t))throw new $r(Ur.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Fl(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new oh(t,e.asyncQueue,n,e.clientId,e.initialUser)}}class Jd{async initialize(e,t){this.localStore||(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=e=>kd(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=Ld.bind(null,this.syncEngine),await Yh(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new od}createDatastore(e){const t=vh(e.databaseInfo.databaseId),n=(r=e.databaseInfo,new mh(r));var r;return function(e,t,n,r){return new kh(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return t=this.localStore,n=this.datastore,r=e.asyncQueue,i=e=>kd(this.syncEngine,e,0),s=uh.D()?new uh:new ch,new Eh(t,n,r,i,s);var t,n,r,i,s}createSyncEngine(e,t){return function(e,t,n,r,i,s,o){const a=new vd(e,t,n,r,i,s);return o&&(a.vc=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedCl
1ientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}terminate(){return async function(e){const t=jr(e);Nr("RemoteStore","RemoteStore shutting down."),t.vu.add(5),await Ch(t),t.Pu.shutdown(),t.bu.set("Unknown")}(this.remoteStore)}}class Yd{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Sc(this.observer.next,e)}error(e){this.observer.error?this.Sc(this.observer.error,e):Dr("Uncaught Error in snapshot listener:",e.toString())}Dc(){this.muted=!0}Sc(e,t){this.muted||setTimeout((()=>{this.muted||e(t)}),0)}}class Qd{constructor(e,t,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=xr.UNAUTHENTICATED,this.clientId=Yr.A(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,(async e=>{Nr("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e})),this.appCheckCredentials.start(n,(e=>(Nr("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user))))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new $r(Ur.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Br;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=td(t,"Failed to shutdown persistence");e.reject(n)}})),e.promise}}async function Zd(e,t){e.asyncQueue.verifyOperationInProgress(),Nr("FirestoreClient","Initializing OfflineComponentProvider");const n=await e.getConfiguration();await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener((async e=>{r.isEqual(e)||(await Vl(t.localStore,e),r=e)})),t.persistence.setDatabaseDeletedListener((()=>e.terminate())),e._offlineComponents=t}async function ef(e,t){e.asyncQueue.verifyOperationInProgress();const n=await nf(e);Nr("FirestoreClient","Initializing OnlineComponentProvider");const r=await e.getConfiguration();await t.initialize(n,r),e.setCredentialChangeListener((e=>Jh(t.remoteStore,e))),e.setAppCheckTokenChangeListener(((e,n)=>Jh(t.remoteStore,n))),e._onlineComponents=t}function tf(e){return"FirebaseError"===e.name?e.code===Ur.FAILED_PRECONDITION||e.code===Ur.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}async function nf(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Nr("FirestoreClient","Using user provided OfflineComponentProvider");try{await Zd(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!tf(n))throw n;Pr("Error using user provided cache. Falling back to memory cache: "+n),await Zd(e,new Gd)}}else Nr("FirestoreClient","Using default OfflineComponentProvider"),await Zd(e,new Gd);return e._offlineComponents}async function rf(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Nr("FirestoreClient","Using user provided OnlineComponentProvider"),await ef(e,e._uninitializedComponentsProvider._online)):(Nr("FirestoreClient","Using default OnlineComponentProvider"),await ef(e,new Jd))),e._onlineComponents}function sf(e){return rf(e).then((e=>e.syncEngine))}async function of(e){const t=await rf(e),n=t.eventManager;return n.onListen=bd.bind(null,t.syncEngine),n.onUnlisten=wd.bind(null,t.syncEngine),n}function af(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const cf=new Map;function uf(e,t,n){if(!n)throw new $r(Ur.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function lf(e){if(!ai.isDocumentKey(e))throw new $r(Ur.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function hf(e){if(ai.isDocumentKey(e))throw new $r(Ur.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function df(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"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":Mr()}function ff(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new $r(Ur.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=df(e);throw new $r(Ur.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}class pf{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new $r(Ur.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,this.cache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new $r(Ur.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,n,r){if(!0===t&&!0===r)throw new $r(Ur.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=af(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new $r(Ur.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new $r(Ur.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new $r(Ur.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(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&&(t=this.experimentalLongPollingOptions,n=e.experimentalLongPollingOptions,t.timeoutSeconds===n.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams;var t,n}}class mf{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new pf({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new $r(Ur.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new $r(Ur.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 pf(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new zr;switch(e.type){case"firstParty":return new Gr(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new $r(Ur.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
1d credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=cf.get(e);t&&(Nr("ComponentProvider","Removing Datastore"),cf.delete(e),t.terminate())}(this),Promise.resolve()}}function gf(e,t,n,r={}){var i;const s=(e=ff(e,mf))._getSettings(),o=`${t}:${n}`;if("firestore.googleapis.com"!==s.host&&s.host!==o&&Pr("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),r.mockUserToken){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=xr.MOCK_USER;else{t=(0,a.Sg)(r.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);const s=r.mockUserToken.sub||r.mockUserToken.user_id;if(!s)throw new $r(Ur.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new xr(s)}e._authCredentials=new qr(new Vr(t,n))}}class yf{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new bf(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new yf(this.firestore,e,this._key)}}class vf{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new vf(this.firestore,e,this._query)}}class bf extends vf{constructor(e,t,n){super(e,t,Fo(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new yf(this.firestore,null,new ai(e))}withConverter(e){return new bf(this.firestore,e,this._path)}}function _f(e,t,...n){if(e=(0,a.m9)(e),uf("collection","path",t),e instanceof mf){const r=ii.fromString(t,...n);return hf(r),new bf(e,null,r)}{if(!(e instanceof yf||e instanceof bf))throw new $r(Ur.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ii.fromString(t,...n));return hf(r),new bf(e.firestore,null,r)}}function wf(e,t,...n){if(e=(0,a.m9)(e),1===arguments.length&&(t=Yr.A()),uf("doc","path",t),e instanceof mf){const r=ii.fromString(t,...n);return lf(r),new yf(e,null,new ai(r))}{if(!(e instanceof yf||e instanceof bf))throw new $r(Ur.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(ii.fromString(t,...n));return lf(r),new yf(e.firestore,e instanceof bf?e.converter:null,new ai(r))}}function Sf(e,t){return e=(0,a.m9)(e),t=(0,a.m9)(t),e instanceof vf&&t instanceof vf&&e.firestore===t.firestore&&Wo(e._query,t._query)&&e.converter===t.converter}class kf{constructor(){this.Gc=Promise.resolve(),this.Qc=[],this.jc=!1,this.zc=[],this.Wc=null,this.Hc=!1,this.Jc=!1,this.Yc=[],this.qo=new bh(this,"async_queue_retry"),this.Xc=()=>{const e=yh();e&&Nr("AsyncQueue","Visibility state changed to "+e.visibilityState),this.qo.Mo()};const e=yh();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Xc)}get isShuttingDown(){return this.jc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Zc(),this.ta(e)}enterRestrictedMode(e){if(!this.jc){this.jc=!0,this.Jc=e||!1;const t=yh();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Xc)}}enqueue(e){if(this.Zc(),this.jc)return new Promise((()=>{}));const t=new Br;return this.ta((()=>this.jc&&this.Jc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise))).then((()=>t.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.Qc.push(e),this.ea())))}async ea(){if(0!==this.Qc.length){try{await this.Qc[0](),this.Qc.shift(),this.qo.reset()}catch(e){if(!Ei(e))throw e;Nr("AsyncQueue","Operation failed with retryable error: "+e)}this.Qc.length>0&&this.qo.No((()=>this.ea()))}}ta(e){const t=this.Gc.then((()=>(this.Hc=!0,e().catch((e=>{this.Wc=e,this.Hc=!1;const t=function(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e);
1throw Dr("INTERNAL UNHANDLED ERROR: ",t),e})).then((e=>(this.Hc=!1,e))))));return this.Gc=t,t}enqueueAfterDelay(e,t,n){this.Zc(),this.Yc.indexOf(e)>-1&&(t=0);const r=ed.createAndSchedule(this,e,t,n,(e=>this.na(e)));return this.zc.push(r),r}Zc(){this.Wc&&Mr()}verifyOperationInProgress(){}async sa(){let e;do{e=this.Gc,await e}while(e!==this.Gc)}ia(e){for(const t of this.zc)if(t.timerId===e)return!0;return!1}ra(e){return this.sa().then((()=>{this.zc.sort(((e,t)=>e.targetTimeMs-t.targetTimeMs));for(const t of this.zc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.sa()}))}oa(e){this.Yc.push(e)}na(e){const t=this.zc.indexOf(e);this.zc.splice(t,1)}}function If(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const n=e;for(const r of["next","error","complete"])if(r in n&&"function"==typeof n[r])return!0;return!1}(e)}class Ef extends mf{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new kf,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Of(this),this._firestoreClient.terminate()}}function Tf(e,t,n){n||(n="(default)");const r=(0,i.qX)(e,"firestore");if(r.isInitialized(n)){const e=r.getImmediate({identifier:n}),i=r.getOptions(n);if((0,a.vZ)(i,t))return e;throw new $r(Ur.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==t.cacheSizeBytes&&void 0!==t.localCache)throw new $r(Ur.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(void 0!==t.cacheSizeBytes&&-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new $r(Ur.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return r.initialize({options:t,instanceIdentifier:n})}function Cf(e,t){const n="object"==typeof e?e:(0,i.Mq)(),r="string"==typeof e?e:t||"(default)",s=(0,i.qX)(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const e=(0,a.P0)("firestore");e&&gf(s,...e)}return s}function xf(e){return e._firestoreClient||Of(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Of(e){var t,n,r;const i=e._freezeSettings(),s=function(e,t,n,r){return new As(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,af(r.experimentalLongPollingOptions),r.useFetchStreams)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new Qd(e._authCredentials,e._appCheckCredentials,e._queue,s),(null===(n=i.cache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=i.cache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.cache.kind,_offline:i.cache._offlineComponentProvider,_online:i.cache._onlineComponentProvider})}class Af{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Af(Ss.fromBase64String(e))}catch(e){throw new $r(Ur.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new Af(Ss.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class Rf{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new $r(Ur.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new oi(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class Nf{constructor(e){this._methodName=e}}class Df{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new $r(Ur.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new $r(Ur.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Qr(this._lat,e._lat)||Qr(this._long,e._long)}}const Pf=/^__.*__$/;class Lf{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Ua(e,this.data,this.fieldMask,t,this.fieldTransforms):new ja(e,this.data,t,this.fieldTransforms)}}class Mf{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new Ua(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Ff(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Mr()}}class jf{constructor(e,t,n,r,i,s){this.settings=e,this.databaseId=t,this.serializer
1=n,this.ignoreUndefinedProperties=r,void 0===i&&this.ua(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get ca(){return this.settings.ca}aa(e){return new jf(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}ha(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.aa({path:n,la:!1});return r.fa(e),r}da(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.aa({path:n,la:!1});return r.ua(),r}wa(e){return this.aa({path:void 0,la:!0})}_a(e){return Zf(e,this.settings.methodName,this.settings.ma||!1,this.path,this.settings.ga)}contains(e){return void 0!==this.fieldMask.find((t=>e.isPrefixOf(t)))||void 0!==this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))}ua(){if(this.path)for(let e=0;e<this.path.length;e++)this.fa(this.path.get(e))}fa(e){if(0===e.length)throw this._a("Document fields must not be empty");if(Ff(this.ca)&&Pf.test(e))throw this._a('Document fields cannot begin and end with "__"')}}class Uf{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||vh(e)}ya(e,t,n,r=!1){return new jf({ca:e,methodName:t,ga:n,path:oi.emptyPath(),la:!1,ma:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function $f(e){const t=e._freezeSettings(),n=vh(e._databaseId);return new Uf(e._databaseId,!!t.ignoreUndefinedProperties,n)}function Bf(e,t,n,r,i,s={}){const o=e.ya(s.merge||s.mergeFields?2:0,t,n,i);Xf("Data must be an object, but it was:",o,r);const a=Gf(r,o);let c,u;if(s.merge)c=new _s(o.fieldMask),u=o.fieldTransforms;else if(s.mergeFields){const e=[];for(const r of s.mergeFields){const i=Jf(t,r,n);if(!o.contains(i))throw new $r(Ur.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);ep(e,i)||e.push(i)}c=new _s(e),u=o.fieldTransforms.filter((e=>c.covers(e.field)))}else c=null,u=o.fieldTransforms;return new Lf(new Zs(a),c,u)}class Vf extends Nf{_toFieldTransform(e){if(2!==e.ca)throw 1===e.ca?e._a(`${this._methodName}() can only appear at the top level of your update data`):e._a(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Vf}}function zf(e,t,n,r){const i=e.ya(1,t,n);Xf("Data must be an object, but it was:",i,r);const s=[],o=Zs.empty();ds(r,((e,r)=>{const c=Qf(t,e,n);r=(0,a.m9)(r);const u=i.da(c);if(r instanceof Vf)s.push(c);else{const e=Wf(r,u);null!=e&&(s.push(c),o.set(c,e))}}));const c=new _s(s);return new Mf(o,c,i.fieldTransforms)}function qf(e,t,n,r,i,s){const o=e.ya(1,t,n),c=[Jf(t,r,n)],u=[i];if(s.length%2!=0)throw new $r(Ur.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let a=0;a<s.length;a+=2)c.push(Jf(t,s[a])),u.push(s[a+1]);const l=[],h=Zs.empty();for(let f=c.length-1;f>=0;--f)if(!ep(l,c[f])){const e=c[f];let t=u[f];t=(0,a.m9)(t);const n=o.da(e);if(t instanceof Vf)l.push(e);else{const r=Wf(t,n);null!=r&&(l.push(e),h.set(e,r))}}const d=new _s(l);return new Mf(h,d,o.fieldTransforms)}function Hf(e,t,n,r=!1){return Wf(n,e.ya(r?4:3,t))}function Wf(e,t){if(Kf(e=(0,a.m9)(e)))return Xf("Unsupported field value:",t,e),Gf(e,t);if(e instanceof Nf)return function(e,t){if(!Ff(t.ca))throw t._a(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t._a(`${e._methodName}() is not currently supported inside arrays`);const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.la&&4!==t.ca)throw t._a("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const i of e){let e=Wf(i,t.wa(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=(0,a.m9)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return ma(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=ti.fromDate(e);return{timestampValue:wc(t.serializer,n)}}if(e instanceof ti){const n=new ti(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:wc(t.serializer,n)}}if(e instanceof Df)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof Af)return{bytesValue:Sc(t.serializer,e._byteString)};if(e instanceof yf){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t._a(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Ec(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t._a(`Unsupported field value: ${df(e)}`)}(e,t)}function Gf(e,t){const n={};return fs(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ds(e,((e,r)=>{const i=Wf(r,t.ha(e));null!=i&&(n[e]=i)})),{mapValue:{fields:n}}}function Kf(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof ti||e instanceof Df||e instanceof Af||e instanceof yf||e instanceof Nf)}function Xf(e,t,n){if(!Kf(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){const r=df(n);throw"an object"===r?t._a(e+" a custom object"):t._a(e+" "+r)}}function Jf(e,t,n){if((t=(0,a.m9)(t))instanceof Rf)return t._internalPath;if("string"==typeof t)return Qf(e,t);throw Zf("Field path arguments must be of type string or ",e,!1,void 0,n)}const Yf=new RegExp("[~\\*/\\[\\]]");function Qf(e,t,n){if(t.search(Yf)>=0)throw Zf(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new Rf(...t.split("."))._internalPath}catch(r){throw Zf(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function Zf(e,t,n,r,i){const s=r&&!r.isEmpty(),o=void 0!==i;let a=`Function ${t}
1() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(s||o)&&(c+=" (found",s&&(c+=` in field ${r}`),o&&(c+=` in document ${i}`),c+=")"),new $r(Ur.INVALID_ARGUMENT,a+e+c)}function ep(e,t){return e.some((e=>e.isEqual(t)))}class tp{constructor(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new yf(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new np(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(rp("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class np extends tp{data(){return super.data()}}function rp(e,t){return"string"==typeof t?Qf(e,t):t instanceof Rf?t._internalPath:t._delegate._internalPath}function ip(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new $r(Ur.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class sp{}class op extends sp{}function ap(e,t,...n){let r=[];t instanceof sp&&r.push(t),r=r.concat(n),function(e){const t=e.filter((e=>e instanceof lp)).length,n=e.filter((e=>e instanceof cp)).length;if(t>1||t>0&&n>0)throw new $r(Ur.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)e=i._apply(e);return e}class cp extends op{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new cp(e,t,n)}_apply(e){const t=this._parse(e);return mp(e._query,t),new vf(e.firestore,e.converter,qo(e._query,t))}_parse(e){const t=$f(e.firestore),n=function(e,t,n,r,i,s,o){let a;if(i.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new $r(Ur.INVALID_ARGUMENT,`Invalid Query. You can't perform '${s}' queries on documentId().`);if("in"===s||"not-in"===s){pp(o,s);const t=[];for(const n of o)t.push(fp(r,e,n));a={arrayValue:{values:t}}}else a=fp(r,e,o)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||pp(o,s),a=Hf(n,"where",o,"in"===s||"not-in"===s);return co.create(i,s,a)}(e._query,0,t,e.firestore._databaseId,this._field,this._op,this._value);return n}}function up(e,t,n){const r=t,i=rp("where",e);return cp._create(i,r,n)}class lp extends sp{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new lp(e,t)}_parse(e){const t=this._queryConstraints.map((t=>t._parse(e))).filter((e=>e.getFilters().length>0));return 1===t.length?t[0]:uo.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const r=t.getFlattenedFilters();for(const i of r)mp(n,i),n=qo(n,i)}(e._query,t),new vf(e.firestore,e.converter,qo(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class hp extends op{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new hp(e,t)}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new $r(Ur.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new $r(Ur.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const r=new so(t,n);return function(e,t){if(null===Uo(e)){const n=$o(e);null!==n&&gp(e,n,t.field)}}(e,r),r}(e._query,this._field,this._direction);return new vf(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new Lo(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function dp(e,t="asc"){const n=t,r=rp("orderBy",e);return hp._create(r,n)}function fp(e,t,n){if("string"==typeof(n=(0,a.m9)(n))){if(""===n)throw new $r(Ur.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Bo(t)&&-1!==n.indexOf("/"))throw new $r(Ur.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=t.path.child(ii.fromString(n));if(!ai.isDocumentKey(r))throw new $r(Ur.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Bs(e,new ai(r))}if(n instanceof yf)return Bs(e,n._key);throw new $r(Ur.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${df(n)}.`)}function pp(e,t){if(!Array.isArray(e)||0===e.length)throw new $r(Ur.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function mp(e,t){if(t.isInequality()){const n=$o(e),r=t.field;if(null!==n&&!n.isEqual(r))throw new $r(Ur.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${r.toString()}'`);const i=Uo(e);null!==i&&gp(e,r,i)}const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new $r(Ur.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new $r(Ur.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}function gp(e,t,n){if(!n.isEqual(t))throw new $r(Ur.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 '${n.toString()}' instead.`)}class yp{convertValue(e,t="none"){switch(Ps(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Es(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(Ts(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 Mr()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return ds(e,((e,r)=>{n[e]=this.convertValue(r,t)})),n}convertGeoPoint(e){return new Df(Es(e.latitude),Es(e.longitude))}convertArray(e,t){return(e.values||[]).map((e=>this.convertValue(e,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const n=xs(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(Os(e));default:return null}}convertTimestamp(e){const t=Is(e);return new ti(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=ii.fromString(e);Fr(Kc(n));const r=new Rs(n.get(1),n.get(3)),i=new ai(n.popFirst(5));return r.isEqual(t)||Dr(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}function vp(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class bp{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}
1class _p extends tp{constructor(e,t,n,r,i,s){super(e,t,n,r,s),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new wp(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)}}get(e,t={}){if(this._document){const n=this._document.data.field(rp("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class wp extends _p{data(e={}){return super.data(e)}}class Sp{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new bp(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach((n=>{e.call(t,new wp(this._firestore,this._userDataWriter,n.key,n,new bp(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new $r(Ur.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()){let t=0;return e._snapshot.docChanges.map((n=>{const r=new wp(e._firestore,e._userDataWriter,n.doc.key,n.doc,new bp(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}}))}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter((e=>t||3!==e.type)).map((t=>{const r=new wp(e._firestore,e._userDataWriter,t.doc.key,t.doc,new bp(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let i=-1,s=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),s=n.indexOf(t.doc.key)),{type:kp(t.type),doc:r,oldIndex:i,newIndex:s}}))}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function kp(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Mr()}}class Ip extends yp{constructor(e){super(),this.firestore=e}convertBytes(e){return new Af(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new yf(this.firestore,null,t)}}function Ep(e,t,n,...r){e=ff(e,yf);const i=ff(e.firestore,Ef),s=$f(i);let o;return o="string"==typeof(t=(0,a.m9)(t))||t instanceof Rf?qf(s,"updateDoc",e._key,t,n,r):zf(s,"updateDoc",e._key,t),xp(i,[o.toMutation(e._key,Aa.exists(!0))])}function Tp(e){return xp(ff(e.firestore,Ef),[new za(e._key,Aa.none())])}function Cp(e,...t){var n,r,i;e=(0,a.m9)(e);let s={includeMetadataChanges:!1},o=0;"object"!=typeof t[o]||If(t[o])||(s=t[o],o++);const c={includeMetadataChanges:s.includeMetadataChanges};if(If(t[o])){const e=t[o];t[o]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[o+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[o+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let u,l,h;if(e instanceof yf)l=ff(e.firestore,Ef),h=Fo(e._key.path),u={next:n=>{t[o]&&t[o](Op(l,e,n))},error:t[o+1],complete:t[o+2]};else{const n=ff(e,vf);l=ff(n.firestore,Ef),h=n._query;const r=new Ip(l);u={next:e=>{t[o]&&t[o](new Sp(l,r,n,e))},error:t[o+1],complete:t[o+2]},ip(e._query)}return function(e,t,n,r){const i=new Yd(r),s=new dd(t,i,n);return e.asyncQueue.enqueueAndForget((async()=>ad(await of(e),s))),()=>{i.Dc(),e.asyncQueue.enqueueAndForget((async()=>cd(await of(e),s)))}}(xf(l),h,c,u)}function xp(e,t){return function(e,t){const n=new Br;return e.asyncQueue.enqueueAndForget((async()=>async function(e,t,n){const r=Wd(e);try{const e=await function(e,t){const n=jr(e),r=ti.now(),i=t.reduce(((e,t)=>e.add(t.key)),la());let s,o;return n.persistence.runTransaction("Locally write mutations","readwrite",(e=>{let a=ta(),c=la();return n.Zi.getEntries(e,i).next((e=>{a=e,a.forEach(((e,t)=>{t.isValidDocument()||(c=c.add(e))}))})).next((()=>
1n.localDocuments.getOverlayedDocuments(e,a))).next((i=>{s=i;const o=[];for(const e of t){const t=Ma(e,s.get(e.key).overlayedDocument);null!=t&&o.push(new Ua(e.key,t,eo(t.value.mapValue),Aa.exists(!0)))}return n.mutationQueue.addMutationBatch(e,r,o,t)})).next((t=>{o=t;const r=t.applyToLocalDocumentSet(s,c);return n.documentOverlayCache.saveOverlays(e,t.batchId,r)}))})).then((()=>({batchId:o.batchId,changes:ia(s)})))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.Tc[e.currentUser.toKey()];r||(r=new ps(Qr)),r=r.insert(t,n),e.Tc[e.currentUser.toKey()]=r}(r,e.batchId,n),await Pd(r,e.changes),await Bh(r.remoteStore)}catch(e){const t=td(e,"Failed to persist write");n.reject(t)}}(await sf(e),t,n))),n.promise}(xf(e),t)}function Op(e,t,n){const r=n.docs.get(t._key),i=new Ip(e);return new _p(e,i,t._key,r,new bp(n.hasPendingWrites,n.fromCache),t.converter)}class Ap{constructor(e){let t;this.kind="persistent",(null==e?void 0:e.tabManager)?(e.tabManager._initialize(e),t=e.tabManager):(t=function(e){return new Np(null==e?void 0:e.forceOwnership)}(void 0),t._initialize(e)),this._onlineComponentProvider=t._onlineComponentProvider,this._offlineComponentProvider=t._offlineComponentProvider}toJSON(){return{kind:this.kind}}}function Rp(e){return new Ap(e)}class Np{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=new Jd,this._offlineComponentProvider=new Kd(this._onlineComponentProvider,null==e?void 0:e.cacheSizeBytes,this.forceOwnership)}}class Dp{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=new Jd,this._offlineComponentProvider=new Xd(this._onlineComponentProvider,null==e?void 0:e.cacheSizeBytes)}}function Pp(){return new Dp}class Lp{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=$f(e)}set(e,t,n){this._verifyNotCommitted();const r=Mp(e,this._firestore),i=vp(r.converter,t,n),s=Bf(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(s.toMutation(r._key,Aa.none())),this}update(e,t,n,...r){this._verifyNotCommitted();const i=Mp(e,this._firestore);let s;return s="string"==typeof(t=(0,a.m9)(t))||t instanceof Rf?qf(this._dataReader,"WriteBatch.update",i._key,t,n,r):zf(this._dataReader,"WriteBatch.update",i._key,t),this._mutations.push(s.toMutation(i._key,Aa.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=Mp(e,this._firestore);return this._mutations=this._mutations.concat(new za(t._key,Aa.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new $r(Ur.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Mp(e,t){if((e=(0,a.m9)(e)).firestore!==t)throw new $r(Ur.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}function Fp(e){return xf(e=ff(e,Ef)),new Lp(e,(t=>xp(e,t)))}!function(e,t=!0){!function(e){Or=e}(i.Jn),(0,i.Xd)(new s.wA("firestore",((e,{instanceIdentifier:n,options:r})=>{const i=e.getProvider("app").getImmediate(),s=new Ef(new Hr(e.getProvider("auth-internal")),new Xr(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new $r(Ur.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Rs(e.options.projectId,t)}(i,n),i);return r=Object.assign({useFetchStreams:t},r),s._setSettings(r),s}),"PUBLIC").setMultipleInstances(!0)),(0,i.KN)(Cr,"3.13.0",e),(0,i.KN)(Cr,"3.13.0","esm2017")}()},74444:function(e,t,n){"use strict";n.d(t,{$s:function(){return U},BH:function(){return p},G6:function(){return S},L:function(){return a},LL:function(){return C},P0:function(){return h},Pz:function(){return f},Rd:function(){return u},Sg:function(){return m},UG:function(){return v},US:function(){return s},ZR:function(){return T},aH:function(){return d},b$:function(){return _},eu:function(){return I},hl:function(){return k},k$:function(){return j},m9:function(){return $},ne:function(){return L},pd:function(){return P},ru:function(){return b},tV:function(){return c},uI:function(){return y},vZ:function(){return A},w1:function(){return w},xO:function(){return N},xb:function(){return O},z$:function(){return g},zI:function(){return E},zd:function(){return D}});var r=n(34155);const i=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296===(64512&i)&&r+1<e.length&&56320===(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},s={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<e.length;i+=3){const t=e[i],s=i+1<e.length,o=s?e[i+1]:0,a=i+2<e.length,c=a?e[i+2]:0,u=t>>2,l=(3&t)<<4|o>>4;let h=(15&o)<<2|c>>6,d=63&c;a||(d=64,s||(h=64)),r.push(n[u],n[l],n[h],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(i(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];
1t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<e.length;){const t=n[e.charAt(i++)],s=i<e.length?n[e.charAt(i)]:0;++i;const a=i<e.length?n[e.charAt(i)]:64;++i;const c=i<e.length?n[e.charAt(i)]:64;if(++i,null==t||null==s||null==a||null==c)throw new o;const u=t<<2|s>>4;if(r.push(u),64!==a){const e=s<<4&240|a>>2;if(r.push(e),64!==c){const e=a<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class o extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const a=function(e){return function(e){const t=i(e);return s.encodeByteArray(t,!0)}(e).replace(/\./g,"")},c=function(e){try{return s.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function u(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("Unable to locate global object.")}const l=()=>{try{return u().__FIREBASE_DEFAULTS__||(()=>{if("undefined"===typeof r||"undefined"===typeof r.env)return;const e=r.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"===typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(n){return}const t=e&&c(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},h=e=>{const t=(e=>{var t,n;return null===(n=null===(t=l())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]})(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},d=()=>{var e;return null===(e=l())||void 0===e?void 0:e.config},f=e=>{var t;return null===(t=l())||void 0===t?void 0:t[`_${e}`]};class p{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"===typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}}function m(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[a(JSON.stringify({alg:"none",type:"JWT"})),a(JSON.stringify(s)),""].join(".")}function g(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function y(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(g())}function v(){var e;const t=null===(e=l())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(r){return!1}}function b(){const e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function _(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function w(){const e=g();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function S(){return!v()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function k(){try{return"object"===typeof indexedDB}catch(e){return!1}}function I(){return new Promise(((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(n){t(n)}}))}function E(){return!("undefined"===typeof navigator||!navigator.cookieEnabled)}
1class T extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,T.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,C.prototype.create)}}class C{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){return e.replace(x,((e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`}))}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new T(r,o,n)}}const x=/\{\$([^}]+)}/g;function O(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function A(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],s=t[i];if(R(n)&&R(s)){if(!A(n,s))return!1}else if(n!==s)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function R(e){return null!==e&&"object"===typeof e}function N(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach((e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function D(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");
1t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function P(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function L(e,t){const n=new M(e,t);return n.subscribe.bind(n)}class M{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!==typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"===typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=F),void 0===r.error&&(r.error=F),void 0===r.complete&&(r.complete=F);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}})),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>
1{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(n){"undefined"!==typeof console&&console.error&&console.error(n)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function F(){}const j=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))};function U(e,t=1e3,n=2){const r=t*Math.pow(n,e),i=Math.round(.5*r*(Math.random()-.5)*2);return Math.min(144e5,r+i)}function $(e){return e&&e._delegate?e._delegate:e}},76489:function(e,t){"use strict";t.parse=function(e,t){if("string"!==typeof e)throw new TypeError("argument str must be a string");for(var r={},i=t||{},o=e.split(";"),a=i.decode||n,c=0;c<o.length;c++){var u=o[c],l=u.indexOf("=");if(!(l<0)){var h=u.substring(0,l).trim();if(void 0==r[h]){var d=u.substring(l+1,u.length).trim();'"'===d[0]&&(d=d.slice(1,-1)),r[h]=s(d,a)}}}return r},t.serialize=function(e,t,n){var s=n||{},o=s.encode||r;if("function"!==typeof o)throw new TypeError("option encode is invalid");if(!i.test(e))throw new TypeError("argument name is invalid");var a=o(t);if(a&&!i.test(a))throw new TypeError("argument val is invalid");var c=e+"="+a;if(null!=s.maxAge){var u=s.maxAge-0;if(isNaN(u)||!isFinite(u))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(u)}if(s.domain){if(!i.test(s.domain))throw new TypeError("option domain is invalid");c+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw new TypeError("option path is invalid");c+="; Path="+s.path}if(s.expires){if("function"!==typeof s.expires.toUTCString)throw new TypeError("option expires is invali
1d");c+="; Expires="+s.expires.toUTCString()}s.httpOnly&&(c+="; HttpOnly");s.secure&&(c+="; Secure");if(s.sameSite){switch("string"===typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return c};var n=decodeURIComponent,r=encodeURIComponent,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e,t){try{return t(e)}catch(n){return e}}},8679:function(e,t,n){"use strict";var r=n(59864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var u=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var o=l(n);h&&(o=o.concat(h(n)));for(var a=c(t),m=c(n),g=0;g<o.length;++g){var y=o[g];if(!s[y]&&(!r||!r[y])&&(!m||!m[y])&&(!a||!a[y])){var v=d(n,y);try{u(t,y,v)}catch(b){}}}}return t}},6311:function(e,t,n){"use strict";n.d(t,{cC:function(){return r.cC},Jc:function(){return de},$G:function(){return r.$G}});var r=n(67421),i=n(87462);function s(e){return s="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},s(e)}function o(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===s(t)?t:String(t)}function a(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=n(67294),u=n(8679),l=n.n(u);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){if(e){if("string"===typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function f(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(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 p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,o,a=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}(e,t)||d(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 m(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var g={defaultNS:"common",errorStackTraceLimit:0,i18n:{defaultLocale:"en",locales:["en"]},get initImmediate(){return"undefined"!==typeof window},interpolation:{escapeValue:!1},load:"currentOnly",localeExtension:"json",localePath:"./public/locales",localeStructure:"{{lng}}/{{ns}}",react:{useSuspense:!1},reloadOnPrerender:!1,serializeConfig:!0,use:[]},y=["i18n"],v=["i18n"];function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?b(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=["backend","detection"],S=function(e){var t,n,r;if("string"!==typeof(null===e||void 0===e?void 0:e.lng))throw new Error("config.lng was not passed into createConfig");var i=e.i18n,o=m(e,y),a=g.i18n,c=_(_(_(_({},m(g,v)),o),a),i),u=c.defaultNS,l=c.lng,h=c.localeExtension,d=c.localePath,b=c.nonExplicitSupportedLngs,S=c.locales.filter((function(e){return"default"!==e}));if("cimode"===l)return c;if("undefined"===typeof c.fallbackLng&&(c.fallbackLng=c.defaultLocale,"default"===c.fallbackLng)){var k=p(S,1);c.fallbackLng=k[0]}var I=null===e||void 0===e||null===(t=e.interpolation)||void 0===t?void 0:t.prefix,E=null===e||void 0===e||null===(n=e.interpolation)||void 0===n?void 0:n.suffix,T=null!==I&&void 0!==I?I:"{{",C=null!==E&&void 0!==E?E:"}}";"string"!==typeof(null===e||void 0===e?void 0:e.localeStructure)&&(I||E)&&(c.localeStructure="".concat(T,"lng").concat(C,"/").concat(T,"ns").concat(C));var x=c.fallbackLng,O=c.localeStructure;if(b){var A=function(e,t){var n=p(t.split("-"),1)[0];return e[t]=[n],e};if("string"===typeof x)c.fallbackLng=c.locales.filter((function(e){return e.includes("-")})).reduce(A,{default:[x]});else if(Array.isArray(x))c.fallbackLng=c.locales.filter((function(e){return e.includes("-")})).reduce(A,{default:x});else if("object"===s(x))c.fallbackLng=Object.entries(c.fallbackLng).reduce((function(e,t){var n,r=p(t,2),i=r[0],s=r[1];return e[i]=i.includes("-")?(n=[i.split("-")[0]].concat(f(s)),Array.from(new Set(n))):s,e}),x);else if("function"===typeof x)throw new Error("If nonExplicitSupportedLngs is true, no functions are allowed for fallbackLng")}return(null===e||void 0===e||null===(r=e.use)||void 0===r?void 0:r.some((function(e){return"backend"===e.type})))||("string"===typeof d?c.backend={addPath:"".concat(d,"/").concat(O,".missing.").concat(h),loadPath:"".concat(d,"/").concat(O,".").concat(h)}:"function"===typeof d&&(c.backend={addPath:function(e,t){return d(e,t,!0)},loadPath:function(e,t){return d(e,t,!1)}})),"string"===typeof c.ns||Array.isArray(c.ns)||(c.ns=[u]),w.forEach((function(t){e[t]&&(c[t]=_(_({},c[t]),e[t]))})),c};const k={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class I{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||k,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:("string"===typeof e[0]&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new I(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new I(this.logger,e)}}var E=new I;class T{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)})),this}off(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((e=>e!==t)):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){[].concat(this.observers[e]).forEach((e=>{e(...n)}))}if(this.observers["*"]){[].concat(this.observers["*"]).forEach((t=>{t.apply(t,[e,...n])}))}}}function C(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n}function x(e){return null==e?"":""+e}function O(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"===typeof e}const s="string"!==typeof t?[].concat(t):t.split(".");for(;s.length>1;){if(i())return{};const t=r(s.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return i()?{}:{obj:e,k:r(s.shift())}}function A(e,t,n){const{obj:r,k:i}=O(e,t,Object);r[i]=n}function R(e,t){const{obj:n,k:r}=O(e,t);if(n)return n[r]}function N(e,t,n){const r=R(e,n);return void 0!==r?r:R(t,n)}function D(e,t,n){for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"===typeof e[r]||e[r]instanceof String||"string"===typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):D(e[r],t[r],n):e[r]=t[r]);return e}function P(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function M(e){return"string"===typeof e?e.replace(/[&<>
1"'\/]/g,(e=>L[e])):e}const F=[" ",",","?","!",";"];function j(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let s=0;s<r.length;++s){if(!i)return;if("string"===typeof i[r[s]]&&s+1<r.length)return;if(void 0===i[r[s]]){let e=2,o=r.slice(s,s+e).join(n),a=i[o];for(;void 0===a&&r.length>s+e;)e++,o=r.slice(s,s+e).join(n),a=i[o];if(void 0===a)return;if(null===a)return null;if(t.endsWith(o)){if("string"===typeof a)return a;if(o&&"string"===typeof a[o])return a[o]}const c=r.slice(s+e).join(n);return c?j(a,c,n):void 0}i=i[r[s]]}return i}function U(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class $ extends T{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let o=[e,t];n&&"string"!==typeof n&&(o=o.concat(n)),n&&"string"===typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."));const a=R(this.data,o);return a||!s||"string"!==typeof n?a:j(this.data&&this.data[e]&&this.data[e][t],n,i)}addResource(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=e.split("."),r=t,t=o[1]),this.addNamespaces(t),A(this.data,o,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const i in n)"string"!==typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),r=n,n=t,t=o[1]),this.addNamespaces(t);let a=R(this.data,o)||{};r?D(a,n,i):a={...a,...n},A(this.data,o,a),s.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var B={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))})),t}};const V={};class z extends T{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach((e=>{t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
1i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=E.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(void 0===e||null===e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const s=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!function(e,t,n){t=t||"",n=n||"";const r=F.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const i=new RegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let s=!i.test(e);if(!s){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(s=!0)}return s}(e,n,r);if(s&&!o){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:i};const s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return"string"===typeof i&&(i=[i]),{key:e,namespaces:i}}translate(e,t,n){if("object"!==typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"===typeof t&&(t={...t}),t||(t={}),void 0===e||null===e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:s,namespaces:o}=this.extractFromKey(e[e.length-1],t),a=o[o.length-1],c=t.lng||this.language,u=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(u){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${a}${e}${s}`,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${s}`}return r?{res:s,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:s}const l=this.resolve(e,t);let h=l&&l.res;const d=l&&l.usedKey||s,f=l&&l.exactUsedKey||s,p=Object.prototype.toString.apply(h),m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject;if(g&&h&&("string"!==typeof h&&"boolean"!==typeof h&&"number"!==typeof h)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0&&("string"!==typeof m||"[object Array]"!==p)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,h,{...t,ns:o}):`key '${s} (${this.language})' returned an object instead of string.`;return r?(l.res=e,l.usedParams=this.getUsedParamsDetails(t),l):e}if(i){const e="[object Array]"===p,n=e?[]:{},r=e?f:d;for(const s in h)if(Object.prototype.hasOwnProperty.call(h,s)){const e=`${r}${i}${s}`;n[s]=this.translate(e,{...t,joinArrays:!1,ns:o}),n[s]===e&&(n[s]=h[s])}h=n}}else if(g&&"string"===typeof m&&"[object Array]"===p)h=h.join(m),h&&(h=this.extendTranslation(h,e,t,n));else{let r=!1,o=!1;const u=void 0!==t.count&&"string"!==typeof t.count,d=z.hasDefaultValue(t),f=u?this.pluralResolver.getSuffix(c,t.count,t):"",p=t.ordinal&&u?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",m=t[`defaultValue${f}`]||t[`defaultValue${p}`]||t.defaultValue;!this.isValidLookup(h)&&d&&(r=!0,h=m),this.isValidLookup(h)||(o=!0,h=s);const g=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:h,y=d&&m!==h&&this.options.updateMissing;if(o||r||y){if(this.logger.log(y?"updateKey":"missingKey",c,a,s,y?m:h),i){const e=this.resolve(s,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const i=d&&r!==h?r:g;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,n,i,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,a,n,i,y,t),this.emit
1("missingKey",e,a,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach((e=>{this.pluralResolver.getSuffixes(e,t).forEach((n=>{r([e],s+n,t[`defaultValue${n}`]||m)}))})):r(e,s,m))}h=this.extendTranslation(h,e,t,l,n),o&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${a}:${s}`),(o||r)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${s}`:s,r?h:void 0):this.options.parseMissingKeyHandler(h))}return r?(l.res=h,l.usedParams=this.getUsedParamsDetails(t),l):h}extendTranslation(e,t,n,r,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o="string"===typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let c=n.replace&&"string"!==typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(s.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):s.translate(...r,t)}),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,a="string"===typeof o?[o]:o;return void 0!==e&&null!==e&&a&&a.length&&!1!==n.applyPostProcessor&&(e=B.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:r,...n}:n,this)),e}resolve(e){let t,n,r,i,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"===typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const a=this.extractFromKey(e,o),c=a.key;n=c;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const l=void 0!==o.count&&"string"!==typeof o.count,h=l&&!o.ordinal&&0===o.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==o.context&&("string"===typeof o.context||"number"===typeof o.context)&&""!==o.context,f=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);u.forEach((e=>{this.isValidLookup(t)||(s=e,!V[`${f[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(V[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((n=>{if(this.isValidLookup(t))return;i=n;const s=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(s,c,n,e,o);else{let e;l&&(e=this.pluralResolver.getSuffix(n,o.count,o));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(s.push(c+e),o.ordinal&&0===e.indexOf(r)&&s.push(c+e.replace(r,this.options.pluralSeparator)),h&&s.push(c+t)),d){const n=`${c}${this.options.contextSeparator}${o.context}`;s.push(n),l&&(s.push(n+e),o.ordinal&&0===e.indexOf(r)&&s.push(n+e.replace(r,this.options.pluralSeparator)),h&&s.push(n+t))}}let a;for(;a=s.pop();)this.isValidLookup(t)||(r=a,t=this.getResource(n,e,a,o))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&"string"!==typeof e.replace;let r=n?e.replace:e;if(n&&"undefined"!==typeof e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}function q(e){return e.charAt(0).toUpperCase()+e.slice(1)}class H{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=E.create("languageUtils")}getScriptPartFromCode(e){if(!(e=U(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=U(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"===typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map((e=>e.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=q(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=q(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=q(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:0===e.indexOf(n)?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"===typeof e&&(e=e(t)),"string"===typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];
1return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"===typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"===typeof e&&i(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))})),r}}let W=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],G={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};const K=["v1","v2","v3"],X=["v4"],J={zero:0,one:1,two:2,few:3,many:4,other:5};class Y{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=E.create("pluralResolver"),this.options.compatibilityJSON&&!X.includes(this.options.compatibilityJSON)||"undefined"!==typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const e={};return W.forEach((t=>{t.lngs.forEach((n=>{e[n]={numbers:t.nr,plurals:G[t.fc]}}))})),e}()}
1addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(U(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((e,t)=>J[e]-J[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):n.numbers.map((n=>this.getSuffix(e,n,t))):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"===typeof r?`_plural_${r.toString()}`:i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}
vendor: 4,105 bytes, line 1
1shouldUseIntlApi(){return!K.includes(this.options.compatibilityJSON)}}function Q(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=N(e,t,n);return!s&&i&&"string"===typeof n&&(s=j(e,n,r),void 0===s&&(s=j(t,n,r))),s}class Z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=E.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=void 0!==t.escape?t.escape:M,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?P(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?P(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?P(t.nestingPrefix):t.nestingPrefixEscaped||P("$t("),this.nestingSuffix=t.nestingSuffix?P(t.nestingSuffix):t.nestingSuffixEscaped||P(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(e,t,n,r){let i,s,o;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}const u=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Q(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),s=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Q(t,a,s,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:s})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>c(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?c(this.escape(e)):c(e)}].forEach((t=>{for(o=0;i=t.regex.exec(e);){const n=i[1].trim();if(s=u(n),void 0===s)if("function"===typeof l){const t=l(e,i,r);s="string"===typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))s="";else{if(h){s=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),s=""}else"string"===typeof s||this.useRawValueToEscape||(s=x(s));const a=t.safeValue(s);if(e=e.replace(i[0],a),h?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}})),e}nest(e,t){let n,r,i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function o(e,t){const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let s=`{${r[1]}`;e=r[0],s=this.interpolate(s,i);const o=s.match(/'/g),a=s.match(/"/g);(o&&o.length%2===0&&!a||a.length%2!==0)&&(s=s.replace(/'/g,'"'));try{i=JSON.parse(s),t&&(i={...t,...i})}catch(c){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,c),`${e}${n}${s}`}return delete i.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let a=[];i={...s},i=i.replace&&"string"!==typeof i.replace?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;
1let c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),a=e,c=!0}if(r=t(o.call(this,n[1].trim(),i),i),r&&n[0]===e&&"string"!==typeof r)return r;"string"!==typeof r&&(r=x(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),c&&(r=a.reduce(((e,t)=>this.format(e,t,s.lng,{...s,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function ee(e){const t={};return function(n,r,i){const s=r+JSON.stringify(i);let o=t[s];return o||(o=e(U(r),i),t[s]=o),o(n)}}class te{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=E.create("formatter"),this.options=e,this.formats={number:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:ee(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:ee(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:ee(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:ee(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ee(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce(((e,t)=>{const{formatName:i,formatOptions:s}=function(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((e=>{if(!e)return;const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=i),"false"===i&&(n[t.trim()]=!1),"true"===i&&(n[t.trim()]=!0),isNaN(i)||(n[t.trim()]=parseInt(i,10))}))}return{formatName:t,formatOptions:n}}(t);if(this.formats[i]){let t=e;try{const o=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},a=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,a,{...s,...r,...o})}catch(o){this.logger.warn(o)}return t}return this.logger.warn(`there was no format function for ${i}`),e}),e)}}class ne extends T{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=E.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const i={},s={},o={},a={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===s[o]&&(s[o]=!0):(this.state[o]=1,r=!1,void 0===s[o]&&(s[o]=!0),void 0===i[o]&&(i[o]=!0),void 0===a[t]&&(a[t]=!0)))})),r||(o[e]=!0)})),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(e,t,n){const r=e.split("|"),i=r[0],s=r[1];t&&this.emit("failedLoading",i,s,t),n&&this.store.addResourceBundle(i,s,n),this.state[e]=t?-1:2;const o={};this.queue.forEach((n=>{!function(e,t,n,r){const{obj:i,k:s}=O(e,t,Object);i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}(n.loaded,[i],s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEac
1h((e=>{o[e]||(o[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===o[e][t]&&(o[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:s});this.readingCalls++;const o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}o&&a&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,r+1,2*i,s)}),i):s(o,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,o);try{const n=a(e,t);n&&"function"===typeof n.then?n.then((e=>o(null,e))).catch(o):o(null,n)}catch(c){o(c)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"===typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"===typeof t&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,((n,s)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&s&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,s),this.loaded(e,n,s)}))}saveMissing(e,t,n,r,i){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(void 0!==n&&null!==n&&""!==n){if(this.backend&&this.backend.create){const c={...s,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let i;i=5===u.length?u(e,t,n,r,c):u(e,t,n,r),i&&"function"===typeof i.then?i.then((e=>o(null,e))).catch(o):o(null,i)}catch(a){o(a)}else u(e,t,n,r,o,c)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function re(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"===typeof e[1]&&(t=e[1]),"string"===typeof e[1]&&(t.defaultValue=e[1]),"string"===typeof e[2]&&(t.tDescription=e[2]),"object"===typeof e[2]||"object"===typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ie(e){return"string"===typeof e.ns&&(e.ns=[e.ns]),"string"===typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"===typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function se(){}class oe extends T{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=ie(e),this.services={},this.logger=E,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEac
1h((e=>{"function"===typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"===typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"===typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=re();function i(e){return e?"function"===typeof e?new e:e:null}if(this.options={...r,...this.options,...ie(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?E.init(i(this.modules.logger),this.options):E.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!==typeof Intl&&(t=te);const n=new H(this.options);this.store=new $(this.options.resources,this.options);const s=this.services;s.logger=E,s.resourceStore=this.store,s.languageUtils=n,s.pluralResolver=new Y(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=i(t),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Z(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new ne(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new z(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=se),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const s=C(),o=()=>{const e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?o():setTimeout(o,0),s}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se;const n="string"===typeof e?e:this.language;if("function"===typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>r(e)))}
vendor: 3,508 bytes, line 1
1this.options.preload&&this.options.preload.forEach((e=>r(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const r=C();return e||(e=this.languages),t||(t=this.options.ns),n||(n=se),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&B.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=C();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},s=(e,s)=>{s?(i(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n="string"===typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(e=>{s(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const i=function(e,t){let s;if("object"!==typeof t){for(var o=arguments.length,a=new Array(o>2?o-2:0),c=2;c<o;c++)a[c-2]=arguments[c];s=r.options.overloadTranslationOptionHandler([e,t].concat(a))}else s={...t};s.lng=s.lng||i.lng,s.lngs=s.lngs||i.lngs,s.ns=s.ns||i.ns,s.keyPrefix=s.keyPrefix||n||i.keyPrefix;const u=r.options.keySeparator||".";let l;return l=s.keyPrefix&&Array.isArray(e)?e.map((e=>`${s.keyPrefix}${u}${e}`)):s.keyPrefix?`${s.keyPrefix}${u}${e}`:e,r.t(l,s)};return"string"===typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
1if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const s=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||2===n};if(t.precheck){const e=t.precheck(this,s);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!s(n,e)||r&&!s(i,e)))}loadNamespaces(e,t){const n=C();return this.options.ns?("string"===typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=C();"string"===typeof e&&(e=[e]);const r=this.options.preload||[],i=e.filter((e=>r.indexOf(e)<0));return i.length?(this.options.preload=r.concat(i),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new H(re());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new oe(r);void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e));return["store","services","language"].forEach((e=>{i[e]=this[e]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new $(this.store.data,r),i.services.resourceStore=i.store),i.translator=new z(i.services,r),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit(e,...n)})),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=oe.createInstance();ae.createInstance=oe.createInstance;ae.createInstance,ae.dir,ae.init,ae.loadResources,ae.reloadResources,ae.use,ae.changeLanguage,ae.getFixedT,ae.t,ae.exists,ae.setDefaultNamespace,ae.hasLoadedNamespace,ae.loadNamespaces,ae.loadLanguages;var ce=function(e){void 0===e.ns&&(e.ns=[]);var t,n,r=ae.createInstance(e);r.isInitialized?t=Promise.resolve(ae.t):(null===e||void 0===e||null===(n=e.use)||void 0===n||n.forEach((function(e){return r.use(e)})),"function"===typeof e.onPreInitI18next&&e.onPreInitI18next(r),t=r.init(e));return{i18n:r,initPromise:t}},ue=c.createElement;function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=function(n){var s,o,a=(n.pageProps||{})._nextI18Next,u=null!==(s=null===a||void 0===a?void 0:a.initialLocale)&&void 0!==s?s:null===n||void 0===n||null===(o=n.router)||void 0===o?void 0:o.locale,l=null===a||void 0===a?void 0:a.ns,h=(0,c.useMemo)((function(){var e;if(!a&&!t)return null;var n=null!==t&&void 0!==t?t:null===a||void 0===a?void 0:a.userConfig;if(!n)throw new Error("appWithTranslation was called without a next-i18next config");if(null===n||void 0===n||!n.i18n)throw new Error("appWithTranslation was called without config.i18n");if(null===n||void 0===n||null===(e=n.i18n)||void 0===e||!e.defaultLocale)throw new Error("config.i18n does not include a defaultLocale property");var r=(a||{}).initialI18nStore,i=null!==t&&void 0!==t&&t.resources?t.resources:r;u||(u=n.i18n.defaultLocale);var s=ce(he(he({},S(he(he({},n),{},{lng:u}))),{},{lng:u,ns:l,resources:i})).i18n;return s,s}),[a,u,t,l]);return null!==h?ue(r.a3,{i18n:h},ue(e,n)):ue(e,(0,i.Z)({key:u},n))};return l()(n,e)}},6840:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(69138)}])},87527:function(e,t,n){"use strict";n.d(t,{j:function(){return c}});var r=n(70977),i=n(90255),s=n(47744),o=n(24207),a=n(18675);function c(){a.WINDOW&&a.WINDOW.document?a.WINDOW.document.addEventListener("visibilitychange",(()=>{const e=(0,r.x1)();if(a.WINDOW.document.hidden&&e){const t="cancelled",{op:n,status:r}=(0,i.XU)(e);o.X&&s.kg.log(`[Tracing] Transaction: ${t} -> since tab moved to the background, op: ${n}`),r||e.setStatus(t),e.setTag("visibilitychange","document.hidden"),e.end()}})):o.X&&s.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")}},31459:function(e,t,n){"use strict";n.d(t,{E8:function(){return I},Wo:function(){return E},og:function(){return T}});var r=n(89105),i=n(5369),s=n(24385),o=n(90255),a=n(54145),c=n(87637),u=n(70977),l=n(37862),h=n(78161),d=n(47744),f=n(48129),p=n(36366),m=n(92353),g=n(24207),y=n(87527),v=n(90654),b=n(26601),_=n(88323),w=n(18675);const S="BrowserTracing",k={...r.AT,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroun
1dSpan:!0,enableLongTask:!0,enableInp:!1,_experiments:{},..._.k3},I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!!g.X&&!(!e.tracePropagationTargets&&!e.tracingOrigins);(0,i.T)(),!e.tracePropagationTargets&&e.tracingOrigins&&(e.tracePropagationTargets=e.tracingOrigins);const n={...k,...e},r=(0,b.PR)(),c={};n.enableInp&&(0,b.NR)(c),n.enableLongTask&&(0,b.Fv)(),n._experiments.enableInteractions&&(0,b.sn)();const u={name:void 0,context:void 0};function l(e){const t=(0,s.Gd)(),{beforeStartSpan:o,idleTimeout:a,finalTimeout:c,heartbeatInterval:l}=n,f="pageload"===e.op;let p;if(f){const t=f?C("sentry-trace"):"",n=f?C("baggage"):void 0,{traceId:r,dsc:i,parentSpanId:s,sampled:o}=(0,h.pT)(t,n);p={traceId:r,parentSpanId:s,parentSampled:o,...e,metadata:{...e.metadata,dynamicSamplingContext:i},trimEnd:!0}}else p={trimEnd:!0,...e};const m=o?o(p):p;m.metadata=m.name!==p.name?{...m.metadata,source:"custom"}:m.metadata,u.name=m.name,u.context=m,!1===m.sampled&&g.X&&d.kg.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),g.X&&d.kg.log(`[Tracing] Starting ${m.op} transaction on scope`);const{location:y}=w.WINDOW,v=(0,i.l)(t,m,a,c,!0,{location:y},l,f);return f&&w.WINDOW.document&&(w.WINDOW.document.addEventListener("readystatechange",(()=>{["interactive","complete"].includes(w.WINDOW.document.readyState)&&v.sendAutoFinishSignal()})),["interactive","complete"].includes(w.WINDOW.document.readyState)&&v.sendAutoFinishSignal()),v.registerBeforeFinishCallback((e=>{r(),(0,b.f7)(e)})),v}return{name:S,setupOnce:()=>{},afterAllSetup(e){const r=e.getOptions(),{markBackgroundSpan:i,traceFetch:s,traceXHR:h,shouldCreateSpanForRequest:m,enableHTTPTimings:v,_experiments:b}=n,S=r&&r.tracePropagationTargets,k=S||n.tracePropagationTargets;let I;g.X&&t&&S&&d.kg.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used.");let C=w.WINDOW.location&&w.WINDOW.location.href;if(e.on&&(e.on("startNavigationSpan",(e=>{I&&(g.X&&d.kg.log(`[Tracing] Finishing current transaction with op: ${(0,o.XU)(I).op}`),I.end()),I=l({op:"navigation",...e})})),e.on("startPageLoadSpan",(e=>{I&&(g.X&&d.kg.log(`[Tracing] Finishing current transaction with op: ${(0,o.XU)(I).op}`),I.end()),I=l({op:"pageload",...e})}))),n.instrumentPageLoad&&e.emit&&w.WINDOW.location){const t={name:w.WINDOW.location.pathname,startTimestamp:f.Z1?f.Z1/1e3:void 0,origin:"auto.pageload.browser",attributes:{[a.Zj]:"url"}};E(e,t)}n.instrumentNavigation&&e.emit&&w.WINDOW.location&&(0,p.a)((t=>{let{to:n,from:r}=t;if(void 0===r&&C&&-1!==C.indexOf(n))C=void 0;else if(r!==n){C=void 0;const t={name:w.WINDOW.location.pathname,origin:"auto.navigation.browser",attributes:{[a.Zj]:"url"}};T(e,t)}})),i&&(0,y.j)(),b.enableInteractions&&x(n,u),n.enableInp&&O(c,u),(0,_.L7)({traceFetch:s,traceXHR:h,tracePropagationTargets:k,shouldCreateSpanForRequest:m,enableHTTPTimings:v})},options:n}};function E(e,t){if(!e.emit)return;e.emit("startPageLoadSpan",t);const n=(0,c.HN)();return"pageload"===(n&&(0,o.XU)(n).op)?n:void 0}function T(e,t){if(!e.emit)return;e.emit("startNavigationSpan",t);const n=(0,c.HN)();return"navigation"===(n&&(0,o.XU)(n).op)?n:void 0}function C(e){const t=(0,m.qT)(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}function x(e,t){let n;const r=()=>{const{idleTimeout:r,finalTimeout:o,heartbeatInterval:c}=e,l="ui.action.click",h=(0,u.x1)();if(h&&h.op&&["navigation","pageload"].includes(h.op))return void(g.X&&d.kg.warn(`[Tracing] Did not create ${l} transaction because a pageload or navigation transaction is in progress.`));if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!t.name)return void(g.X&&d.kg.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`));const{location:f}=w.WINDOW,p={name:t.name,op:l,trimEnd:!0,data:{[a.Zj]:t.context?A(t.context):"url"}};n=(0,i.l)((0,s.Gd)(),p,r,o,!0,{location:f},c)};["click"].forEach((e=>{addEventListener(e,r,{once:!1,capture:!0})}))}function O(e,t){const n=n=>{let{entries:r}=n;const i=(0,l.s3)(),s=void 0!==i&&void 0!==i.getIntegrationByName?i.getIntegrationByName("Replay"):void 0,o=void 0!==s?s.getReplayId():void 0,a=(0,u.x1)(),c=(0,l.nZ)(),h=void 0!==c?c.getUser():void 0;r.forEach((n=>{if(function(e){return"duration"in e}(n)){const r=n.interactionId;if(void 0===r)return;const i=e[r],s=n.duration,c=n.startTime,u=Object.keys(e),l=u.length>0?u.reduce(((t,n)=>e[t].duration<e[n].duration?t:n)):void 0;if("first-input"===n.entryType){if(u.map((t=>e[t])).some((e=>e.duration===s&&e.startTime===c)))return}if(!r)return;if(i)i.duration=Math.max(i.duration,s);else if(u.length<10||void 0===l||s>e[l].duration){const n=t.name,i=t.context;n&&i&&(l&&Object.keys(e).length>=10&&delete e[l],e[r]={routeName:n,duration:s,parentContext:i,user:h,activeTransaction:a,replayId:o,startTime:c})}}}))};(0,v._j)("event",n),(0,v._j)("first-input",n)}function A(e){const t=e.attributes&&e.attributes[a.Zj],n=e.data&&e.data[a.Zj],r=e.metadata&&e.metadata.source;return t||n||r}},31302:function(e,t,n){"use strict";n.d(t,{gE:function(){return _}});var r=n(89105),i=n(5369),s=n(70977),o=n(54145),a=n(37862),c=n(47744),u=n(78161),l=n(92353),h=n(24207),d=n(87527),f=n(90654),p=n(26601),m=n(88323),g=n(48129),y=n(36366),v=n(18675);
1const b={...r.AT,markBackgroundTransactions:!0,routingInstrumentation:function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!v.WINDOW||!v.WINDOW.location)return void(h.X&&c.kg.warn("Could not initialize routing instrumentation due to invalid location"));let r,i=v.WINDOW.location.href;t&&(r=e({name:v.WINDOW.location.pathname,startTimestamp:g.Z1?g.Z1/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&(0,y.a)((t=>{let{to:n,from:s}=t;void 0===s&&i&&-1!==i.indexOf(n)?i=void 0:s!==n&&(i=void 0,r&&(h.X&&c.kg.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.end()),r=e({name:v.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))}))},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,_experiments:{},...m.k3};class _{constructor(e){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,(0,i.T)(),h.X&&(this._hasSetTracePropagationTargets=!(!e||!e.tracePropagationTargets&&!e.tracingOrigins)),this.options={...b,...e},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=(0,p.PR)(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&(0,p.NR)(this._interactionIdToRouteNameMapping),this.options.enableLongTask&&(0,p.Fv)(),this.options._experiments.enableInteractions&&(0,p.sn)(),this._latestRoute={name:void 0,context:void 0}}setupOnce(e,t){this._getCurrentHub=t;const n=t().getClient(),r=n&&n.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:s,startTransactionOnPageLoad:o,markBackgroundTransactions:a,traceFetch:u,traceXHR:l,shouldCreateSpanForRequest:f,enableHTTPTimings:p,_experiments:g}=this.options,y=r&&r.tracePropagationTargets,v=y||this.options.tracePropagationTargets;h.X&&this._hasSetTracePropagationTargets&&y&&c.kg.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),i((e=>{const n=this._createRouteTransaction(e);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(n,e,t),n}),o,s),a&&(0,d.j)(),g.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),(0,m.L7)({traceFetch:u,traceXHR:l,tracePropagationTargets:v,shouldCreateSpanForRequest:f,enableHTTPTimings:p})}_createRouteTransaction(e){if(!this._getCurrentHub)return void(h.X&&c.kg.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`));const t=this._getCurrentHub(),{beforeNavigate:n,idleTimeout:r,finalTimeout:s,heartbeatInterval:o}=this.options,a="pageload"===e.op;let l;if(a){const t=a?w("sentry-trace"):"",n=a?w("baggage"):void 0,{traceId:r,dsc:i,parentSpanId:s,sampled:o}=(0,u.pT)(t,n);l={traceId:r,parentSpanId:s,parentSampled:o,...e,metadata:{...e.metadata,dynamicSamplingContext:i},trimEnd:!0}}else l={trimEnd:!0,...e};const d="function"===typeof n?n(l):l,f=void 0===d?{...l,sampled:!1}:d;f.metadata=f.name!==l.name?{...f.metadata,source:"custom"}:f.metadata,this._latestRoute.name=f.name,this._latestRoute.context=f,!1===f.sampled&&h.X&&c.kg.log(`[Tracing] Will not send ${f.op} transaction because of beforeNavigate.`),h.X&&c.kg.log(`[Tracing] Starting ${f.op} transaction on scope`);const{location:m}=v.WINDOW,g=(0,i.l)(t,f,r,s,!0,{location:m},o,a);return a&&(v.WINDOW.document.addEventListener("readystatechange",(()=>{["interactive","complete"].includes(v.WINDOW.document.readyState)&&g.sendAutoFinishSignal()})),["interactive","complete"].includes(v.WINDOW.document.readyState)&&g.sendAutoFinishSignal()),g.registerBeforeFinishCallback((e=>{this._collectWebVitals(),(0,p.f7)(e)})),g}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:t,finalTimeout:n,heartbeatInterval:r}=this.options,a="ui.action.click",u=(0,s.x1)();if(u&&u.op&&["navigation","pageload"].includes(u.op))return void(h.X&&c.kg.warn(`[Tracing] Did not create ${a} transaction because a pageload or navigation transaction is in progress.`));if(e&&(e.setFinishReason("interactionInterrupted"),e.end(),e=void 0),!this._getCurrentHub)return void(h.X&&c.kg.warn(`[Tracing] Did not create ${a}
1 transaction because _getCurrentHub is invalid.`));if(!this._latestRoute.name)return void(h.X&&c.kg.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`));const l=this._getCurrentHub(),{location:d}=v.WINDOW,f={name:this._latestRoute.name,op:a,trimEnd:!0,data:{[o.Zj]:this._latestRoute.context?S(this._latestRoute.context):"url"}};e=(0,i.l)(l,f,t,n,!0,{location:d},r)};["click"].forEach((e=>{addEventListener(e,t,{once:!1,capture:!0})}))}_registerInpInteractionListener(){const e=e=>{let{entries:t}=e;const n=(0,a.s3)(),r=void 0!==n&&void 0!==n.getIntegrationByName?n.getIntegrationByName("Replay"):void 0,i=void 0!==r?r.getReplayId():void 0,o=(0,s.x1)(),c=(0,a.nZ)(),u=void 0!==c?c.getUser():void 0;t.forEach((e=>{if(function(e){return"duration"in e}(e)){const t=e.interactionId;if(void 0===t)return;const n=this._interactionIdToRouteNameMapping[t],r=e.duration,s=e.startTime,a=Object.keys(this._interactionIdToRouteNameMapping),c=a.length>0?a.reduce(((e,t)=>this._interactionIdToRouteNameMapping[e].duration<this._interactionIdToRouteNameMapping[t].duration?e:t)):void 0;if("first-input"===e.entryType){if(a.map((e=>this._interactionIdToRouteNameMapping[e])).some((e=>e.duration===r&&e.startTime===s)))return}if(!t)return;if(n)n.duration=Math.max(n.duration,r);else if(a.length<10||void 0===c||r>this._interactionIdToRouteNameMapping[c].duration){const e=this._latestRoute.name,n=this._latestRoute.context;e&&n&&(c&&Object.keys(this._interactionIdToRouteNameMapping).length>=10&&delete this._interactionIdToRouteNameMapping[c],this._interactionIdToRouteNameMapping[t]={routeName:e,duration:r,parentContext:n,user:u,activeTransaction:o,replayId:i,startTime:s})}}}))};(0,f._j)("event",e),(0,f._j)("first-input",e)}}function w(e){const t=(0,l.qT)(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}function S(e){const t=e.attributes&&e.attributes[o.Zj],n=e.data&&e.data[o.Zj],r=e.metadata&&e.metadata.source;return t||n||r}},90654:function(e,t,n){"use strict";n.d(t,{PR:function(){return P},to:function(){return F},YF:function(){return j},$A:function(){return L},_j:function(){return U},_4:function(){return M}});var r=n(47744),i=n(88745),s=n(24207);const o=(e,t,n)=>{let r,i;return s=>{t.value>=0&&(s||n)&&(i=t.value-(r||0),(i||void 0===r)&&(r=t.value,t.delta=i,e(t)))}};var a=n(18675);var c=n(78657);const u=()=>{const e=(0,c.W)();return e&&e.activationStart||0},l=(e,t)=>{const n=(0,c.W)();let r="navigate";return n&&(r=a.WINDOW.document.prerendering||u()>0?"prerender":n.type.replace(/_/g,"-")),{name:e,value:"undefined"===typeof t?-1:t,rating:"good",delta:0,entries:[],id:`v3-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},h=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{t(e.getEntries())}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(r){}};var d=n(35150);var f=n(5131);let p=0,m=1/0,g=0;const y=e=>{e.forEach((e=>{e.interactionId&&(m=Math.min(m,e.interactionId),g=Math.max(g,e.interactionId),p=g?(g-m)/7+1:0)}))};let v;const b=()=>{"interactionCount"in performance||v||(v=h("event",y,{type:"event",buffered:!0,durationThreshold:0}))},_=()=>v?p:performance.interactionCount||0,w=[],S={},k=e=>{const t=w[w.length-1],n=S[e.interactionId];if(n||w.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{const t={id:e.interactionId,latency:e.duration,entries:[e]};S[t.id]=t,w.push(t)}w.sort(((e,t)=>t.latency-e.latency)),w.splice(10).forEach((e=>{delete S[e.id]}))}},I=(e,t)=>{t=t||{},b();const n=l("INP");let r;const i=e=>{e.forEach((e=>{if(e.interactionId&&k(e),"first-input"===e.entryType){!w.some((t=>t.entries.some((t=>e.duration===t.duration&&e.startTime===t.startTime))))&&k(e)}}));const t=(()=>{const e=Math.min(w.length-1,Math.floor(_()/50));return w[e]})();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,r())},s=h("event",i,{durationThreshold:t.durationThreshold||40});r=o(e,n,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),(0,d.u)((()=>{i(s.takeRecords()),n.value<0&&_()>0&&(n.value=0,n.entries=[]),r(!0)})))},E={},T=e=>{a.WINDOW.document&&(a.WINDOW.document.prerendering?addEventListener("prerenderingchange",(()=>T(e)),!0):"complete"!==a.WINDOW.document.readyState?addEventListener("load",(()=>T(e)),!0):setTimeout(e,0))},C={},x={};let O,A,R,N,D;function P(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return W("cls",e,B,O,t)}function L(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return W("lcp",e,z,R,t)}function M(e){return W("ttfb",e,q,N)}function F(e){return W("fid",e,V,A)}function j(e){return W("inp",e,H,D)}function U(e,t){return G(e,t),x[e]||(!function(e){const t={};"event"===e&&(t.durationThreshold=0);h(e,(t=>{$(e,{entries:t})}),t)}(e),x[e]=!0),K(e,t)}function $(e,t){const n=C[e];if(n&&n.length)for(const a of n)try{a(t)}catch(o){s.X&&r.kg.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${(0,i.$P)(a)}\nError:`,o)}}function B(){return(e=>{const t=l("CLS",0);let n,r=0,i=[];const s=e=>{e.forEach((e=>{if(!e.hadRecentInput){const s=i[0],o=i[i.length-1];r&&0!==i.length&&e.startTime-o.startTime<1e3&&e.startTime-s.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]),r>t.value&&(t.value=r,t.entries=i,n&&n())}}))},a=h("layout-shift",s);if(a){n=o(e,t);const r=()=>{s(a.takeRecords()),n(!0)};return(0,d.u)(r),r}})((e=>{$("cls",{metric:e}),O=e}))}function V(){return(e=>{const t=(0,f.Y)(),n=l("FID");let r;const i=e=>{e.startTime<t.firstHiddenTime&&(n.value=e.processingStart-e.startTime,n.entr
1ies.push(e),r(!0))},s=e=>{e.forEach(i)},a=h("first-input",s);r=o(e,n),a&&(0,d.u)((()=>{s(a.takeRecords()),a.disconnect()}),!0)})((e=>{$("fid",{metric:e}),A=e}))}function z(){return(e=>{const t=(0,f.Y)(),n=l("LCP");let r;const i=e=>{const i=e[e.length-1];if(i){const e=Math.max(i.startTime-u(),0);e<t.firstHiddenTime&&(n.value=e,n.entries=[i],r())}},s=h("largest-contentful-paint",i);if(s){r=o(e,n);const t=()=>{E[n.id]||(i(s.takeRecords()),s.disconnect(),E[n.id]=!0,r(!0))};return["keydown","click"].forEach((e=>{addEventListener(e,t,{once:!0,capture:!0})})),(0,d.u)(t,!0),t}})((e=>{$("lcp",{metric:e}),R=e}))}function q(){return((e,t)=>{t=t||{};const n=l("TTFB"),r=o(e,n,t.reportAllChanges);T((()=>{const e=(0,c.W)();if(e){if(n.value=Math.max(e.responseStart-u(),0),n.value<0||n.value>performance.now())return;n.entries=[e],r(!0)}}))})((e=>{$("ttfb",{metric:e}),N=e}))}function H(){return I((e=>{$("inp",{metric:e}),D=e}))}function W(e,t,n,r){let i,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return G(e,t),x[e]||(i=n(),x[e]=!0),r&&t({metric:r}),K(e,t,s?i:void 0)}function G(e,t){C[e]=C[e]||[],C[e].push(t)}function K(e,t,n){return()=>{n&&n();const r=C[e];if(!r)return;const i=r.indexOf(t);-1!==i&&r.splice(i,1)}}},26601:function(e,t,n){"use strict";n.d(t,{f7:function(){return L},NR:function(){return D},sn:function(){return N},Fv:function(){return R},PR:function(){return A}});var r=n(70977),i=n(37862),s=n(54578),o=n(95625),a=n(33002);function c(e){return[{type:"span"},e]}var u=n(90255),l=n(34906),h=n(18030),d=n(80656),f=n(48129),p=n(92353),m=n(47744),g=n(32932),y=n(24207),v=n(90654),b=n(18675),_=n(5131);function w(e){return"number"===typeof e&&isFinite(e)}function S(e,t){let{startTimestamp:n,...r}=t;return n&&e.startTimestamp>n&&(e.startTimestamp=n),e.startChild({startTimestamp:n,...r})}var k=n(78657);function I(e){return e/1e3}function E(){return b.WINDOW&&b.WINDOW.addEventListener&&b.WINDOW.performance}let T,C,x=0,O={};function A(){const e=E();if(e&&f.Z1){e.mark&&b.WINDOW.performance.mark("sentry-tracing-init");const t=(0,v.to)((e=>{let{metric:t}=e;const n=t.entries[t.entries.length-1];if(!n)return;const r=I(f.Z1),i=I(n.startTime);y.X&&m.kg.log("[Measurements] Adding FID"),O.fid={value:t.value,unit:"millisecond"},O["mark.fid"]={value:r+i,unit:"second"}})),n=(0,v.PR)((e=>{let{metric:t}=e;const n=t.entries[t.entries.length-1];n&&(y.X&&m.kg.log("[Measurements] Adding CLS"),O.cls={value:t.value,unit:""},C=n)}),!0),r=(0,v.$A)((e=>{let{metric:t}=e;const n=t.entries[t.entries.length-1];n&&(y.X&&m.kg.log("[Measurements] Adding LCP"),O.lcp={value:t.value,unit:"millisecond"},T=n)}),!0),i=(0,v._4)((e=>{let{metric:t}=e;t.entries[t.entries.length-1]&&(y.X&&m.kg.log("[Measurements] Adding TTFB"),O.ttfb={value:t.value,unit:"millisecond"})}));return()=>{t(),n(),r(),i()}}return()=>{}}function R(){(0,v._j)("longtask",(e=>{let{entries:t}=e;for(const n of t){const e=(0,r.x1)();if(!e)return;const t=I(f.Z1+n.startTime),i=I(n.duration);e.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:t,endTimestamp:t+i})}}))}function N(){(0,v._j)("event",(e=>{let{entries:t}=e;for(const n of t){const e=(0,r.x1)();if(!e)return;if("click"===n.name){const t=I(f.Z1+n.startTime),r=I(n.duration),i={description:(0,p.Rt)(n.target),op:`ui.interaction.${n.name}`,origin:"auto.ui.browser.metrics",startTimestamp:t,endTimestamp:t+r},s=(0,p.iY)(n.target);s&&(i.attributes={"ui.component_name":s}),e.startChild(i)}}}))}function D(e){if(E()&&f.Z1){const n=(t=e,(0,v.YF)((e=>{let{metric:n}=e;if(void 0===n.value)return;const r=n.entries.find((e=>e.duration===n.value&&void 0!==P[e.name])),a=(0,i.s3)();if(!r||!a)return;const u=P[r.name],l=a.getOptions(),g=I(f.Z1+r.startTime),v=I(n.value),_=void 0!==r.interactionId?t[r.interactionId]:void 0;if(void 0===_)return;const{routeName:w,parentContext:S,activeTransaction:k,user:E,replayId:T}=_,C=void 0!==E?E.email||E.id||E.ip_address:void 0,x=void 0!==k?k.getProfileId():void 0,O=new s.D({startTimestamp:g,endTimestamp:g+v,op:`ui.interaction.${u}
1`,name:(0,p.Rt)(r.target),attributes:{release:l.release,environment:l.environment,transaction:w,...void 0!==C&&""!==C?{user:C}:{},...void 0!==x?{profile_id:x}:{},...void 0!==T?{replay_id:T}:{}},exclusiveTime:n.value,measurements:{inp:{value:n.value,unit:"millisecond"}}}),A=function(e,t){if(!(0,h.z)(t))return!1;let n;return n=void 0!==e&&"function"===typeof t.tracesSampler?t.tracesSampler({transactionContext:e,name:e.name,parentSampled:e.parentSampled,attributes:{...e.data,...e.attributes},location:b.WINDOW.location}):void 0!==e&&void 0!==e.sampled?e.sampled:"undefined"!==typeof t.tracesSampleRate?t.tracesSampleRate:1,(0,d.X)(n)?n:(y.X&&m.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),!1)}(S,l);if(A&&Math.random()<A){const e=O?function(t,n){const r={sent_at:(new Date).toISOString()};n&&(r.dsn=(0,o.RA)(n));const i=t.map(c);return(0,e.Jd)(r,i)}([O],a.getDsn()):void 0,t=a&&a.getTransport();t&&e&&t.send(e).then(null,(e=>{y.X&&m.kg.error("Error while sending interaction:",e)}))}})));return()=>{n()}}var t;return()=>{}}const P={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function L(e){const t=E();if(!t||!b.WINDOW.performance.getEntries||!f.Z1)return;y.X&&m.kg.log("[Tracing] Adding & adjusting spans using Performance API");const n=I(f.Z1),r=t.getEntries(),{op:i,start_timestamp:s}=(0,u.XU)(e);if(r.slice(x).forEach((t=>{const r=I(t.startTime),i=I(t.duration);if(!("navigation"===e.op&&s&&n+r<s))switch(t.entryType){case"navigation":!function(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach((r=>{M(e,t,r,n)})),M(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),M(e,t,"fetch",n,"cache","domainLookupStart"),M(e,t,"domainLookup",n,"DNS"),function(e,t,n){t.responseEnd&&(S(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+I(t.requestStart),endTimestamp:n+I(t.responseEnd)}),S(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+I(t.responseStart),endTimestamp:n+I(t.responseEnd)}))}(e,t,n)}(e,t,n);break;case"mark":case"paint":case"measure":{!function(e,t,n,r,i){const s=i+n,o=s+r;S(e,{description:t.name,endTimestamp:o,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:s})}(e,t,r,i,n);const s=(0,_.Y)(),o=t.startTime<s.firstHiddenTime;"first-paint"===t.name&&o&&(y.X&&m.kg.log("[Measurements] Adding FP"),O.fp={value:t.startTime,unit:"millisecond"}),"first-contentful-paint"===t.name&&o&&(y.X&&m.kg.log("[Measurements] Adding FCP"),O.fcp={value:t.startTime,unit:"millisecond"});break}case"resource":!function(e,t,n,r,i,s){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;const o=(0,g.en)(n),a={};F(a,t,"transferSize","http.response_transfer_size"),F(a,t,"encodedBodySize","http.response_content_length"),F(a,t,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in t&&(a["resource.render_blocking_status"]=t.renderBlockingStatus);o.protocol&&(a["url.scheme"]=o.protocol.split(":").pop());o.host&&(a["server.address"]=o.host);a["url.same_origin"]=n.includes(b.WINDOW.location.origin);const c=s+r,u=c+i;S(e,{description:n.replace(b.WINDOW.location.origin,""),endTimestamp:u,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:c,data:a})}(e,t,t.name,r,i,n)}})),x=Math.max(r.length-1,0),function(e){const t=b.WINDOW.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),w(n.rtt)&&(O["connection.rtt"]={value:n.rtt,unit:"millisecond"}));w(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`);w(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}(e),"pageload"===i){!function(e){const t=(0,k.W)();if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(y.X&&m.kg.log("[Measurements] Adding TTFB Request Time"),e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}(O),["fcp","fp","lcp"].forEach((e=>{if(!O[e]||!s||n>=s)return;const t=O[e].value,r=n+I(t),i=Math.abs(1e3*(r-s)),o=i-t;y.X&&m.kg.log(`[Measurements] Normalized ${e} from ${t} to ${i} (${o})`),O[e].value=i}));const t=O["mark.fid"];t&&O.fid&&(S(e,{description:"first input delay",endTimestamp:t.value+I(O.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:t.value}),delete O["mark.fid"]),"fcp"in O||delete O.cls,Object.keys(O).forEach((e=>{(0,l.o)(e,O[e].value,O[e].unit)})),function(e){T&&(y.X&&m.kg.log("[Measurements] Adding LCP Data"),T.element&&e.setTag("lcp.element",(0,p.Rt)(T.element)),T.id&&e.setTag("lcp.id",T.id),T.url&&e.setTag("lcp.url",T.url.trim().slice(0,200)),e.setTag("lcp.size",T.size));C&&C.sources&&(y.X&&m.kg.log("[Measurements] Adding CLS Data"),C.sources.forEac
1h(((t,n)=>e.setTag(`cls.source.${n+1}`,(0,p.Rt)(t.node)))))}(e)}T=void 0,C=void 0,O={}}function M(e,t,n,r,i,s){const o=s?t[s]:t[`${n}End`],a=t[`${n}Start`];a&&o&&S(e,{op:"browser",origin:"auto.browser.browser.metrics",description:i||n,startTimestamp:r+I(a),endTimestamp:r+I(o)})}function F(e,t,n,r){const i=t[n];null!=i&&i<2147483647&&(e[r]=i)}},88323:function(e,t,n){"use strict";n.d(t,{k3:function(){return w},L7:function(){return S}});var r=n(90255),i=n(18030),s=n(23828),o=n(37862),a=n(24385),c=n(87637),u=n(54145),l=n(68448),h=n(86122),d=n(38481),f=n(48129),p=n(92217),m=n(78161),g=n(72151),y=n(13444);function v(e,t,n,i,s){const o=s||n.getSpan(),c=(0,a.aF)(),{traceId:u,spanId:h,sampled:d,dsc:f}={...c.getPropagationContext(),...n.getPropagationContext()},p=o?(0,r.Hb)(o):(0,m.$p)(u,h,d),v=(0,g.IQ)(f||(o?(0,l.j)(o):(0,l._)(u,t,n))),b=i.headers||("undefined"!==typeof Request&&(0,y.V9)(e,Request)?e.headers:void 0);if(b){if("undefined"!==typeof Headers&&(0,y.V9)(b,Headers)){const e=new Headers(b);return e.append("sentry-trace",p),v&&e.append(g.bU,v),e}if(Array.isArray(b)){const e=[...b,["sentry-trace",p]];return v&&e.push([g.bU,v]),e}{const e="baggage"in b?b.baggage:void 0,t=[];return Array.isArray(e)?t.push(...e):e&&t.push(e),v&&t.push(v),{...b,"sentry-trace":p,baggage:t.length>0?t.join(","):void 0}}}return{"sentry-trace":p,baggage:v}}var b=n(90654);const _=["localhost",/^\/(?!\/)/],w={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:_,tracePropagationTargets:_};function S(e){const{traceFetch:t,traceXHR:n,tracePropagationTargets:f,tracingOrigins:y,shouldCreateSpanForRequest:b,enableHTTPTimings:S}={traceFetch:w.traceFetch,traceXHR:w.traceXHR,...e},I="function"===typeof b?b:e=>!0,E=e=>function(e,t){return(0,p.U0)(e,t||_)}(e,f||y),T={};t&&(0,h.U)((e=>{const t=function(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"auto.http.browser";if(!(0,i.z)()||!e.fetchData)return;const l=t(e.fetchData.url);if(e.endTimestamp&&l){const t=e.fetchData.__span;if(!t)return;const n=r[t];if(n){if(e.response){(0,s.Q0)(n,e.response.status);const t=e.response&&e.response.headers&&e.response.headers.get("content-length");if(t){const e=parseInt(t);e>0&&n.setAttribute("http.response_content_length",e)}}else e.error&&n.setStatus("internal_error");n.end(),delete r[t]}return}const h=(0,o.nZ)(),d=(0,o.s3)(),{method:f,url:p}=e.fetchData,m=l?(0,c.qp)({name:`${f} ${p}`,onlyIfParent:!0,attributes:{url:p,type:"fetch","http.method":f,[u.S3]:a},op:"http.client"}):void 0;if(m&&(e.fetchData.__span=m.spanContext().spanId,r[m.spanContext().spanId]=m),n(e.fetchData.url)&&d){const t=e.args[0];e.args[1]=e.args[1]||{};const n=e.args[1];n.headers=v(t,d,h,n,m)}return m}(e,I,E,T);S&&t&&k(t)})),n&&(0,d.UK)((e=>{const t=function(e,t,n,h){const f=e.xhr,p=f&&f[d.xU];if(!(0,i.z)()||!f||f.__sentry_own_request__||!p)return;const y=t(p.url);if(e.endTimestamp&&y){const e=f.__sentry_xhr_span_id__;if(!e)return;const t=h[e];return void(t&&void 0!==p.status_code&&((0,s.Q0)(t,p.status_code),t.end(),delete h[e]))}const v=(0,o.nZ)(),b=(0,a.aF)(),_=y?(0,c.qp)({name:`${p.method} ${p.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":p.method,url:p.url,[u.S3]:"auto.http.browser"},op:"http.client"}):void 0;_&&(f.__sentry_xhr_span_id__=_.spanContext().spanId,h[f.__sentry_xhr_span_id__]=_);const w=(0,o.s3)();if(f.setRequestHeader&&n(p.url)&&w){const{traceId:e,spanId:t,sampled:n,dsc:i}={...b.getPropagationContext(),...v.getPropagationContext()};!function(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(g.bU,n)}catch(r){}}(f,_?(0,r.Hb)(_):(0,m.$p)(e,t,n),(0,g.IQ)(i||(_?(0,l.j)(_):(0,l._)(e,w,v))))}return _}(e,I,E,T);S&&t&&k(t)}))}function k(e){const{url:t}=(0,r.XU)(e).data||{};if(!t||"string"!==typeof t)return;const n=(0,b._j)("resource",(r=>{let{entries:i}=r;i.forEach((r=>{if(function(e){return"resource"===e.entryType&&"initiatorType"in e&&"string"===typeof e.nextHopProtocol&&("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)}(r)&&r.name.endsWith(t)){(function(e){const{name:t,version:n}=function(e){let t="unknown",n="unknown",r="";for(const i of e){if("/"===i){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=i}r===e&&(t=r);
1return{name:t,version:n}}(e.nextHopProtocol),r=[];if(r.push(["network.protocol.version",n],["network.protocol.name",t]),!f.Z1)return r;return[...r,["http.request.redirect_start",I(e.redirectStart)],["http.request.fetch_start",I(e.fetchStart)],["http.request.domain_lookup_start",I(e.domainLookupStart)],["http.request.domain_lookup_end",I(e.domainLookupEnd)],["http.request.connect_start",I(e.connectStart)],["http.request.secure_connection_start",I(e.secureConnectionStart)],["http.request.connection_end",I(e.connectEnd)],["http.request.request_start",I(e.requestStart)],["http.request.response_start",I(e.responseStart)],["http.request.response_end",I(e.responseEnd)]]})(r).forEach((t=>e.setAttribute(...t))),setTimeout(n)}}))}))}function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return((f.Z1||performance.timeOrigin)+e)/1e3}},18675:function(e,t,n){"use strict";n.d(t,{WINDOW:function(){return r}});const r=n(71671).GLOBAL_OBJ},78657:function(e,t,n){"use strict";n.d(t,{W:function(){return i}});var r=n(18675);const i=()=>r.WINDOW.__WEB_VITALS_POLYFILL__?r.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||(()=>{const e=r.WINDOW.performance.timing,t=r.WINDOW.performance.navigation.type,n={entryType:"navigation",startTime:0,type:2==t?"back_forward":1===t?"reload":"navigate"};for(const r in e)"navigationStart"!==r&&"toJSON"!==r&&(n[r]=Math.max(e[r]-e.navigationStart,0));return n})()):r.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},5131:function(e,t,n){"use strict";n.d(t,{Y:function(){return o}});var r=n(18675),i=n(35150);let s=-1;const o=()=>(s<0&&(s="hidden"!==r.WINDOW.document.visibilityState||r.WINDOW.document.prerendering?1/0:0,(0,i.u)((e=>{let{timeStamp:t}=e;s=t}),!0)),{get firstHiddenTime(){return s}})},35150:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(18675);const i=(e,t)=>{const n=i=>{"pagehide"!==i.type&&"hidden"!==r.WINDOW.document.visibilityState||(e(i),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)}},24207:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});const r=!1},84209:function(e,t,n){"use strict";n.d(t,{R:function(){return m}});var r=n(16827),i=n(50492),s=n(79260),o=n(47744),a=n(33002),c=n(48129);function u(e,t,n){const r=[{type:"client_report"},{timestamp:n||(0,c.yW)(),discarded_events:e}];return(0,a.Jd)(t?{dsn:t}:{},[r])}var l=n(95625),h=n(8497),d=n(1883),f=n(12563),p=n(91052);class m extends r.W{constructor(e){const t=f.m9.SENTRY_SDK_SOURCE||(0,s.S)();(0,i.V)(e,"browser",["browser"],t),super(e),e.sendClientReports&&f.m9.document&&f.m9.document.addEventListener("visibilitychange",(()=>{"hidden"===f.m9.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return(0,d.dr)(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2?arguments[2]:void 0;return(0,d.aB)(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(h.X&&o.kg.warn("SDK not enabled, will not capture user feedback."));const t=(0,p.r)(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(h.X&&o.kg.log("No outcomes to send"));if(!this._dsn)return void(h.X&&o.kg.log("No dsn provided, will not send outcomes"));h.X&&o.kg.log("Sending outcomes:",e);const t=u(e,this._options.tunnel&&(0,l.RA)(this._dsn));this._sendEnvelope(t)}}},8497:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});const r=!1},1883:function(e,t,n){"use strict";n.d(t,{GJ:function(){return u},ME:function(){return g},aB:function(){return m},dr:function(){return p}});var r=n(37862),i=n(13444),s=n(93968),o=n(25439),a=n(91782),c=n(59769);function u(e,t){const n=h(e,t),r={type:t&&t.name,value:f(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function l(e,t){return{exception:{values:[u(e,t)]}}}function h(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"===typeof e.framesToPop)return e.framesToPop;if(d.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(i){}return[]}const d=/Minified React error #\d+;/i;function f(e){const t=e&&e.message;return t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}function p(e,t,n,r){const i=g(e,t,n&&n.syntheticException||void 0,r);return(0,o.EG)(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),(0,a.WD)(i)}function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const s=r&&r.syntheticException||void 0,o=y(e,t,s,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),(0,a.WD)(o)}function g(e,t,n,a,c){let u;if((0,i.VW)(t)&&t.error){return l(e,t.error)}if((0,i.TX)(t)||(0,i.fm)(t)){const r=t;if("stack"in t)u=l(e,t);else{const t=r.name||((0,i.TX)(r)?"DOMError":"DOMException"),s=r.message?`${t}: ${r.message}`:t;u=y(e,s,n,a),(0,o.Db)(u,s)}return"code"in r&&(u.tags={...u.tags,"DOMException.code":`${r.code}`}),u}if((0,i.VZ)(t))return l(e,t);if((0,i.PO)(t)||(0,i.cO)(t)){return u=function(e,t,n,o){const a=(0,r.s3)(),c=a&&a.getOptions().normalizeDepth,u={exception:{values:[{type:(0,i.cO)(t)?t.constructor.name:o?"UnhandledRejection":"Error",value:v(t,{isUnhandledRejection:o})}]},extra:{__serialized__:(0,s.Qy)(t,c)}};if(n){const t=h(e,n);t.length&&(u.exception.values[0].stacktrace={frames:t})}return u}(e,t,n,c),(0,o.EG)(u,{synthetic:!0}),u}return u=y(e,t,n,a),(0,o.Db)(u,`${t}`,void 0),(0,o.EG)(u,{synthetic:!0}),u}function y(e,t,n,r){const s={};if(r&&n){const r=h(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]})}
1if((0,i.Le)(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function v(e,t){let{isUnhandledRejection:n}=t;const r=(0,c.zf)(e),s=n?"promise rejection":"exception";if((0,i.VW)(e))return`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``;if((0,i.cO)(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(t){}}(e)}\` (type=${e.type}) captured as ${s}`}return`Object captured as ${s} with keys: ${r}`}},12563:function(e,t,n){"use strict";n.d(t,{Wz:function(){return u},m9:function(){return a},re:function(){return h}});var r=n(37862),i=n(71671),s=n(59769),o=n(25439);const a=i.GLOBAL_OBJ;let c=0;function u(){return c>0}function l(){c++,setTimeout((()=>{c--}))}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("function"!==typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if((0,s.HK)(e))return e}catch(a){return e}const i=function(){const i=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);const r=i.map((e=>h(e,t)));return e.apply(this,r)}catch(s){throw l(),(0,r.$e)((e=>{e.addEventProcessor((e=>(t.mechanism&&((0,o.Db)(e,void 0,void 0),(0,o.EG)(e,t.mechanism)),e.extra={...e.extra,arguments:i},e))),(0,r.Tb)(s)})),s}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=e[t])}catch(c){}(0,s.$Q)(i,e),(0,s.xp)(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get:()=>e.name})}catch(c){}return i}},44755:function(e,t,n){"use strict";n.d(t,{Oo:function(){return he.O},RE:function(){return ie.R},_p:function(){return dn},gE:function(){return Ct.gE},Iq:function(){return de.I},x2:function(){return Tt},cq:function(){return s.c},dJ:function(){return fe.d},qT:function(){return pe.q},Xb:function(){return q.Xb},QD:function(){return o.Q},jK:function(){return pn},iP:function(){return me.i},_e:function(){return k},UH:function(){return ye.Le},$r:function(){return Ke},Jn:function(){return H.J},$J:function(){return W.$J},S3:function(){return W.S3},TE:function(){return W.TE},Zj:function(){return W.Zj},sX:function(){return G.sX},pT:function(){return ge.p},m9:function(){return re.m9},n_:function(){return A.n_},Qy:function(){return K.Q},cc:function(){return X.cc},M5:function(){return l.M5},Ts:function(){return J.T},fQ:function(){return he.f},tP:function(){return ge.t},xF:function(){return hn},E8:function(){return xt.E8},eN:function(){return A.eN},Tb:function(){return A.Tb},uT:function(){return A.uT},cg:function(){return A.cg},Jd:function(){return le.Jd},$3:function(){return ae.$3},xv:function(){return A.xv},e:function(){return A.e},yn:function(){return Y.yn},qv:function(){return Q.q},rQ:function(){return ue.r},RH:function(){return de.R},SS:function(){return le.SS},k3:function(){return Ot.k3},d8:function(){return ae.d8},Dt:function(){return ae.Dt},TM:function(){return A.TM},dr:function(){return ce.dr},aB:function(){return ce.aB},GJ:function(){return ce.GJ},qG:function(){return Z.qG},Xc:function(){return Et},yl:function(){return A.yl},Eg:function(){return le.Eg},CP:function(){return s.C},$Q:function(){return ae.$Q},HN:function(){return Y.HN},x1:function(){return Z.x1},s3:function(){return A.s3},Gd:function(){return q.Gd},nZ:function(){return A.nZ},nV:function(){return le.nV},vi:function(){return q.vi},TF:function(){return ye.Bl},ix:function(){return ee.ix},ks:function(){return fe.k},sA:function(){return pe.s},SG:function(){return o.S},L7:function(){return Ot.L7},dk:function(){return A.dk},eW:function(){return A.eW},OB:function(){return me.O},O1:function(){return Mt},fD:function(){return se.f},pj:function(){return q.pj},Wq:function(){return C},KC:function(){return oe.K},qI:function(){return B},wo:function(){return S},lA:function(){return le.lA},Uv:function(){return cn},NP:function(){return ae.NP},HH:function(){return ae.HH},XB:function(){return V},mz:function(){return Ge},Gs:function(){return ye.Li},fA:function(){return lt},v:function(){return A.v},KW:function(){return te.K}
1,sU:function(){return A.sU},rJ:function(){return A.rJ},Q0:function(){return ee.Q0},oi:function(){return ne.o},YA:function(){return A.YA},mG:function(){return A.mG},av:function(){return A.av},jp:function(){return le.jp},Zd:function(){return ee.Zd},og:function(){return xt.og},Wo:function(){return xt.Wo},qp:function(){return Y.qp},yj:function(){return A.yj},GK:function(){return Y.GK},V0:function(){return Y.V0},Yr:function(){return A.Yr},g4:function(){return Y.g4},R2:function(){return ae.R2},_d:function(){return A._d},wi:function(){return A.wi},$e:function(){return A.$e},re:function(){return le.re}});var r={};n.r(r),n.d(r,{FunctionToString:function(){return s.c},InboundFilters:function(){return o.Q},LinkedErrors:function(){return p}});var i={};n.r(i),n.d(i,{Breadcrumbs:function(){return he.O},Dedupe:function(){return de.I},GlobalHandlers:function(){return fe.d},HttpContext:function(){return pe.q},LinkedErrors:function(){return me.i},TryCatch:function(){return ge.p}});var s=n(56272),o=n(45578),a=n(58696);function c(e,t){return e(t.stack||"",1)}function u(e,t){const n={type:t.name||t.constructor.name,value:t.message},r=c(e,t);return r.length&&(n.stacktrace={frames:r}),n}var l=n(53872);const h="cause",d="LinkedErrors",f=(0,l._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.limit||5,n=e.key||h;return{name:d,setupOnce(){},preprocessEvent(e,r,i){const s=i.getOptions();(0,a.Z)(u,s.stackParser,s.maxValueLength,n,t,e,r)}}})),p=(0,l.RN)(d,f),m=r;var g=n(33002),y=n(71671);const v=new Map,b=new Set;function _(e,t){return function(e){if(y.GLOBAL_OBJ._sentryModuleMetadata)for(const t of Object.keys(y.GLOBAL_OBJ._sentryModuleMetadata)){const n=y.GLOBAL_OBJ._sentryModuleMetadata[t];if(b.has(t))continue;b.add(t);const r=e(t);for(const e of r.reverse())if(e.filename){v.set(e.filename,n);break}}}(e),v.get(t)}const w="ModuleMetadata",S=(0,l._I)((()=>({name:w,setupOnce(){},setup(e){"function"===typeof e.on&&e.on("beforeEnvelope",(e=>{(0,g.gv)(e,((e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&(!function(e){try{e.exception.values.forEach((e=>{if(e.stacktrace)for(const t of e.stacktrace.frames||[])delete t.module_metadata}))}catch(t){}}(t),e[1]=t)}}))}))}
1,processEvent:(e,t,n)=>(function(e,t){try{t.exception.values.forEach((t=>{if(t.stacktrace)for(const n of t.stacktrace.frames||[]){if(!n.filename)continue;const t=_(e,n.filename);t&&(n.module_metadata=t)}}))}catch(n){}}(n.getOptions().stackParser,e),e)}))),k=(0,l.RN)(w,S);var I=n(95625),E=n(6077);function T(e,t){let n;return(0,g.gv)(e,((e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n))),n}function C(e,t){return n=>{const r=e(n),i={};function s(t,r){const s=r?`${t}:${r}`:t;if(!i[s]){const o=(0,I.U4)(t);if(!o)return;const a=(0,E.U)(o);i[s]=r?function(e,t){return n=>{const r=e(n);return{send:async e=>{const n=T(e,["event","transaction","profile","replay_event"]);return n&&(n.release=t),r.send(e)},flush:e=>r.flush(e)}}}(e,r)({...n,url:a}):e({...n,url:a})}return i[s]}return{send:async function(e){const n=t({envelope:e,getEvent:function(t){const n=t&&t.length?t:["event"];return T(e,n)}}).map((e=>"string"===typeof e?s(e,void 0):s(e.dsn,e.release))).filter((e=>!!e));return 0===n.length&&n.push(r),(await Promise.all(n.map((t=>t.send(e)))))[0]},flush:async function(e){const t=[...Object.keys(i).map((e=>i[e])),r];return(await Promise.all(t.map((t=>t.flush(e))))).every((e=>e))}}}}var x=n(47744),O=n(61145),A=n(37862),R=n(90255),N=n(38801),D=n(48129),P=n(47866);const L={[N.JM]:class{constructor(e){this._value=e}get weight(){return 1}add(e){this._value+=e}toString(){return`${this._value}`}},[N.uG]:class{constructor(e){this._last=e,this._min=e,this._max=e,this._sum=e,this._count=1}get weight(){return 5}add(e){this._last=e,e<this._min&&(this._min=e),e>this._max&&(this._max=e),this._sum+=e,this._count++}toString(){return`${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`}},[N.g_]:class{constructor(e){this._value=[e]}get weight(){return this._value.length}add(e){this._value.push(e)}toString(){return this._value.join(":")}},[N.is]:class{constructor(e){this.first=e,this._value=new Set([e])}get weight(){return this._value.size}add(e){this._value.add(e)}toString(){return Array.from(this._value).map((e=>"string"===typeof e?(0,P.M)(e):e)).join(":")}}};var M=n(2356);class F{constructor(e){this._client=e,this._buckets=new Map,this._interval=setInterval((()=>this.flush()),N.RF)}add(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:(0,D.ph)();const o=Math.floor(s),a=t.replace(N.X7,"_"),c=(0,P.Bg)(i),u=(0,P.Ic)(e,a,r,c);let l=this._buckets.get(u);const h=l&&e===N.is?l.metric.weight:0;l?(l.metric.add(n),l.timestamp<o&&(l.timestamp=o)):(l={metric:new L[e](n),timestamp:o,metricType:e,name:a,unit:r,tags:c},this._buckets.set(u,l));const d="string"===typeof n?l.metric.weight-h:n;(0,M.v)(e,a,d,r,i,u)}flush(){if(0!==this._buckets.size){if(this._client.captureAggregateMetrics){const e=Array.from(this._buckets).map((e=>{let[,t]=e;return t}));this._client.captureAggregateMetrics(e)}this._buckets.clear()}}close(){clearInterval(this._interval),this.flush()}}const j="MetricsAggregator",U=(0,l._I)((()=>({name:j,setupOnce(){},setup(e){e.metricsAggregator=new F(e)}})));function $(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,A.s3)(),s=(0,A.nZ)();if(i){if(!i.metricsAggregator)return void(O.X&&x.kg.warn("No metrics aggregator enabled. Please add the MetricsAggregator integration to use metrics APIs"));const{unit:o,tags:a,timestamp:c}=r,{release:u,environment:l}=i.getOptions(),h=s.getTransaction(),d={};u&&(d.release=u),l&&(d.environment=l),h&&(d.transaction=(0,R.XU)(h).description||""),O.X&&x.kg.log(`Adding value of ${n} to ${e} metric ${t}`),i.metricsAggregator.add(e,t,n,o,{...d,...a},c)}}const B={increment:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;$(N.JM,e,t,n)},distribution:function(e,t,n){$(N.g_,e,t,n)},set:function(e,t,n){$(N.is,e,t,n)},gauge:function(e,t,n){$(N.uG,e,t,n)},MetricsAggregator:(0,l.RN)(j,U),metricsAggregatorIntegration:U};function V(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=new String(String.raw(e,...n));
1return i.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),i.__sentry_template_values__=n,i}var z,q=n(24385),H=n(73702),W=n(54145),G=n(54694),K=n(16827),X=n(5690),J=n(5369),Y=n(87637),Q=n(15031),Z=n(70977),ee=n(23828),te=n(60281),ne=n(34906),re=n(12563),ie=n(84209),se=n(99812),oe=n(51624),ae=n(29691),ce=n(1883),ue=n(91052),le=n(10274),he=n(84947),de=n(57034),fe=n(81252),pe=n(37323),me=n(6905),ge=n(72979),ye=n(25368),ve=n(16893);function be(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:be(e.parentNode,t,n,r+1):-1}function _e(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"===typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch(i){return!1}}}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(z||(z={}));const we="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Se,ke={map:{},getId:()=>(console.error(we),-1),getNode:()=>(console.error(we),null),removeNodeFromMap(){console.error(we)},has:()=>(console.error(we),!1),reset(){console.error(we)}};function Ie(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>Ie(e,t,s||{},!0)}function Ee(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"===typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(r){return()=>{}}}function Te(e,t,n,r,i){if(!e)return!1;const s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!s)return!1;const o=_e(t,n);if(!i){const e=r&&s.matches(r);return o(s)&&!e}const a=be(s,o);let c=-1;return!(a<0)&&(r&&(c=be(s,_e(null,r))),a>-1&&c<0||a<c)}function Ce(){if(Se)return Se;const e=window.document;let t=window.requestAnimationFrame;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.requestAnimationFrame&&(t=r.requestAnimationFrame),e.head.removeChild(n)}catch(n){}return Se=t.bind(window)}function xe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ce()(...t)}window.Proxy&&window.Reflect&&(ke=new Proxy(ke,{get:(e,t,n)=>("map"===t&&console.error(we),Reflect.get(e,t,n))})),/[1-9][0-9]{12}/.test(Date.now().toString());var Oe=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Oe||{});let Ae;function Re(e){Ae=e}const Ne=e=>{if(!Ae)return e;return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e(...n)}catch(i){if(Ae&&!0===Ae(i))return()=>{};throw i}}};for(var De="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pe="undefined"===typeof Uint8Array?[]:new Uint8Array(256),Le=0;Le<De.length;Le++)Pe[De.charCodeAt(Le)]=Le;const Me=new Map;const Fe=(e,t,n)=>{if(!e||!$e(e,t)&&"object"!==typeof e)return;const r=function(e,t){let n=Me.get(e);return n||(n=new Map,Me.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i};function je(e,t,n){if(e instanceof Array)return e.map((e=>je(e,t,n)));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=De[n[t]>>2],i+=De[(3&n[t])<<4|n[t+1]>>4],i+=De[(15&n[t+1])<<2|n[t+2]>>
16],i+=De[63&n[t+2]];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[je(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[je(e.data,t,n),e.width,e.height]}}if($e(e,t)||"object"===typeof e){return{rr_type:e.constructor.name,index:Fe(e,t,n)}}return e}const Ue=(e,t,n)=>e.map((e=>je(e,t,n))),$e=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"===typeof t[e]));return Boolean(n.find((n=>e instanceof t[n])))};function Be(e){return"experimental-webgl"===e?"webgl":e}function Ve(e,t,n,r,i){const s=[];try{const o=Ee(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];if(!Te(this,t,n,r,!0)){const e=Be(s);if("__context"in this||(this.__context=e),i&&["webgl","webgl2"].includes(e))if(a[0]&&"object"===typeof a[0]){const e=a[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[s,...a])}}));s.push(o)}catch(o){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach((e=>e()))}}function ze(e,t,n,r,i,s,o,a){const c=[],u=Object.getOwnPropertyNames(e);for(const h of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(h))try{if("function"!==typeof e[h])continue;const o=Ee(e,h,(function(e){return function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];const l=e.apply(this,c);if(Fe(l,a,this),"tagName"in this.canvas&&!Te(this.canvas,r,i,s,!0)){const e=Ue(c,a,this),r={type:t,property:h,args:e};n(this.canvas,r)}return l}}));c.push(o)}catch(l){const r=Ie(e,h,{set(e){n(this.canvas,{type:t,property:h,args:[e],setter:!0})}});c.push(r)}return c}class qe{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:r,blockSelector:i,unblockSelector:s,recordCanvas:o,dataURLOptions:a,errorHandler:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,c&&Re(c),e.enableManualSnapshot||Ne((()=>{o&&"all"===t&&this.initCanvasMutationObserver(n,r,i,s),o&&"number"===typeof t&&this.initCanvasFPSObserver(t,n,r,i,s,{dataURLOptions:a})}))()}initCanvasFPSObserver(e,t,n,r,i,s){const o=Ve(t,n,r,i,!0),a=this.takeSnapshot(!1,e,t,n,r,i,s.dataURLOptions);this.resetObservers=()=>{o(),cancelAnimationFrame(a)}}initCanvasMutationObserver(e,t,n,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Ve(e,t,n,r,!1),s=function(e,t,n,r,i){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const c of o)try{if("function"!==typeof t.CanvasRenderingContext2D.prototype[c])continue;const o=Ee(t.CanvasRenderingContext2D.prototype,c,(function(s){return function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return Te(this.canvas,n,r,i,!0)||setTimeout((()=>{const n=Ue(a,t,this);e(this.canvas,{type:Oe["2D"],property:c,args:n})}),0),s.apply(this,a)}}));s.push(o)}catch(a){const n=Ie(t.CanvasRenderingContext2D.prototype,c,{set(t){e(this.canvas,{type:Oe["2D"],property:c,args:[t],setter:!0})}});s.push(n)}return()=>
1{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,r),o=function(e,t,n,r,i,s){const o=[];return o.push(...ze(t.WebGLRenderingContext.prototype,Oe.WebGL,e,n,r,i,0,t)),"undefined"!==typeof t.WebGL2RenderingContext&&o.push(...ze(t.WebGL2RenderingContext.prototype,Oe.WebGL2,e,n,r,i,0,t)),()=>{o.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,r,this.mirror);this.resetObservers=()=>{i(),s(),o()}}snapshot(e){const{options:t}=this,n=this.takeSnapshot(!0,"all"===t.sampling?2:t.sampling||2,t.win,t.blockClass,t.blockSelector,t.unblockSelector,t.dataURLOptions,e);this.resetObservers=()=>{cancelAnimationFrame(n)}}takeSnapshot(e,t,n,r,i,s,o,a){const c=new Map,u=new Worker(function(){const e=new Blob(['for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)e[t.charCodeAt(n)]=n;var a=function(e){var n,a=new Uint8Array(e),s=a.length,r="";for(n=0;n<s;n+=3)r+=t[a[n]>>2],r+=t[(3&a[n])<<4|a[n+1]>>4],r+=t[(15&a[n+1])<<2|a[n+2]>>6],r+=t[63&a[n+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r};const s=new Map,r=new Map;const i=self;i.onmessage=async function(t){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:t.data.id});{const{id:e,bitmap:n,width:o,height:f,dataURLOptions:c}=t.data,g=async function(t,e,n){const s=t+"-"+e;if("OffscreenCanvas"in globalThis){if(r.has(s))return r.get(s);const i=new OffscreenCanvas(t,e);i.getContext("2d");const o=await i.convertToBlob(n),f=await o.arrayBuffer(),c=a(f);return r.set(s,c),c}return""}(o,f,c),d=new OffscreenCanvas(o,f);d.getContext("2d").drawImage(n,0,0),n.close();const u=await d.convertToBlob(c),h=u.type,w=await u.arrayBuffer(),l=a(w);if(!s.has(e)&&await g===l)return s.set(e,l),i.postMessage({id:e});if(s.get(e)===l)return i.postMessage({id:e});i.postMessage({id:e,type:h,base64:l,width:o,height:f}),s.set(e,l)}};']);return URL.createObjectURL(e)}());u.onmessage=e=>{const t=e.data,{id:n}=t;if(c.set(n,!1),!("base64"in t))return;const{base64:r,type:i,width:s,height:o}=t;this.mutationCb({id:n,type:Oe["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})};const l=1e3/t;let h,d=0;const f=t=>{d&&t-d<l||(d=t,(e=>{if(e)return[e];const t=[];return n.document.querySelectorAll("canvas").forEach((e=>{Te(e,r,i,s,!0)||t.push(e)})),t})(a).forEach((t=>{const n=this.mirror.getId(t);if(!c.get(n)&&t.width&&t.height){if(c.set(n,!0),!e&&["webgl","webgl2"].includes(t.__context)){const e=t.getContext(t.__context);!1===(0,ve.x)([e,"optionalAccess",e=>e.getContextAttributes,"call",e=>e(),"optionalAccess",e=>e.preserveDrawingBuffer])&&e.clear(e.COLOR_BUFFER_BIT)}createImageBitmap(t).then((e=>{u.postMessage({id:n,bitmap:e,width:t.width,height:t.height,dataURLOptions:o},[e])})).catch((e=>{Ne((()=>{throw e}))()}))}}))),h=xe(f)};return h=xe(f),h}startPendingCanvasMutationFlusher(){xe((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,xe(e)};xe(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),xe((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map((e=>{const{type:t,...n}=e;return n})),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}const He={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},We="ReplayCanvas",Ge=(0,l._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot};let n;const r=new Promise((e=>n=e));return{name:We,setupOnce(){},getOptions(){const{quality:e,enableManualSnapshot:r}=t;return{enableManualSnapshot:r,recordCanvas:!0,getCanvasManager:e=>{const t=new qe({...e,enableManualSnapshot:r,errorHandler:e=>{try{"object"===typeof e&&(e.__rrweb__=!0)}catch(t){}}});return n(t),t},...He[e||"medium"]||He.medium}},async snapshot(e){(await r).snapshot(e)}}})),Ke=(0,l.RN)(We,Ge);var Xe=n(92353),Je=n(4458),Ye=n(50101),Qe=n(40793);const Ze=y.GLOBAL_OBJ,et="#ffffff",tt="inherit",nt="rgba(108, 95, 199, 1)",rt={fontFamily:"system-ui, 'Helvetica Neue', Arial, sans-serif",fontSize:"14px",background:et,backgroundHover:"#f6f6f7",foreground:"#2b2233",border:"1.5px solid rgba(41, 35, 47, 0.13)",borderRadius:"12px",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",success:"#268d75",error:"#df3338",submitBackgroun
1d:"rgba(88, 74, 192, 1)",submitBackgroundHover:nt,submitBorder:nt,submitOutlineFocus:"#29232f",submitForeground:et,submitForegroundHover:et,cancelBackground:"transparent",cancelBackgroundHover:"var(--background-hover)",cancelBorder:"var(--border)",cancelOutlineFocus:"var(--input-outline-focus)",cancelForeground:"var(--foreground)",cancelForegroundHover:"var(--foreground)",inputBackground:tt,inputForeground:tt,inputBorder:"var(--border)",inputOutlineFocus:nt,formBorderRadius:"20px",formContentBorderRadius:"6px"},it=rt,st={...rt,background:"#29232f",backgroundHover:"#352f3b",foreground:"#ebe6ef",border:"1.5px solid rgba(235, 230, 239, 0.15)",success:"#2da98c",error:"#f55459"},ot="widget",at="api";async function ct(e){let{client:t,scope:n,event:r}=e;const i={};t.emit&&t.emit("preprocessEvent",r,i);const s=await(0,Ye.R)(t.getOptions(),r,i,n,t,(0,q.aF)());return null===s?(t.recordDroppedEvent("event_processor","feedback",r),null):(s.platform=s.platform||"javascript",s)}async function ut(e){let{feedback:{message:t,email:n,name:r,source:i,url:s}}=e,{includeReplay:o=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=(0,A.s3)(),c=a&&a.getTransport(),u=a&&a.getDsn();if(!a||!c||!u)return;const l={contexts:{feedback:{contact_email:n,name:r,message:t,url:s,source:i}},type:"feedback"};return(0,A.$e)((async e=>{e.clearBreadcrumbs(),[at,ot].includes(String(i))&&e.setLevel("info");const t=await ct({scope:e,client:a,event:l});if(!t)return;a.emit&&a.emit("beforeSendFeedback",t,{includeReplay:Boolean(o)});const n=(0,Qe.M)(t,u,a.getOptions()._metadata,a.getOptions().tunnel);let r;try{r=await c.send(n)}catch(s){const e=new Error("Unable to send Feedback");try{e.cause=s}catch(h){}throw e}if(r){if("number"===typeof r.statusCode&&(r.statusCode<200||r.statusCode>=300))throw new Error("Unable to send Feedback");return r}}))}function lt(e){let{name:t,email:n,message:r,source:i=at,url:s=(0,Xe.l4)()}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r)throw new Error("Unable to submit feedback with empty message");return ut({feedback:{name:t,email:n,message:r,url:s,source:i}},o)}function ht(e,t){return{...e,...t,themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function dt(e){return`\n  --background: ${e.background};\n  --background-hover: ${e.backgroundHover};\n  --foreground: ${e.foreground};\n  --error: ${e.error};\n  --success: ${e.success};\n  --border: ${e.border};\n  --border-radius: ${e.borderRadius};\n  --box-shadow: ${e.boxShadow};\n\n  --submit-background: ${e.submitBackground};\n  --submit-background-hover: ${e.submitBackgroundHover};\n  --submit-border: ${e.submitBorder};\n  --submit-outline-focus: ${e.submitOutlineFocus};\n  --submit-foreground: ${e.submitForeground};\n  --submit-foreground-hover: ${e.submitForegroundHover};\n\n  --cancel-background: ${e.cancelBackground};\n  --cancel-background-hover: ${e.cancelBackgroundHover};\n  --cancel-border: ${e.cancelBorder};\n  --cancel-outline-focus: ${e.cancelOutlineFocus};\n  --cancel-foreground: ${e.cancelForeground};\n  --cancel-foreground-hover: ${e.cancelForegroundHover};\n\n  --input-background: ${e.inputBackground};\n  --input-foreground: ${e.inputForeground};\n  --input-border: ${e.inputBorder};\n  --input-outline-focus: ${e.inputOutlineFocus};\n\n  --form-border-radius: ${e.formBorderRadius};\n  --form-content-border-radius: ${e.formContentBorderRadius};\n  `}function ft(e){let{id:t,colorScheme:n,themeDark:r,themeLight:i}=e;try{const e=Ze.document,s=e.createElement("div");s.id=t;const o=s.attachShadow({mode:"open"});return o.appendChild(function(e,t,n){const r=e.createElement("style");return r.textContent=`\n:host {\n  --bottom: 1rem;\n  --right: 1rem;\n  --top: auto;\n  --left: auto;\n  --z-index: 100000;\n  --font-family: ${n.light.fontFamily};\n  --font-size: ${n.light.fontSize};\n\n  position: fixed;\n  left: var(--left);\n  right: var(--right);\n  bottom: var(--bottom);\n  top: var(--top);\n  z-index: var(--z-index);\n\n  font-family: var(--font-family);\n  font-size: var(--font-size);\n\n  ${dt("dark"===t?n.dark:n.light)}\n}\n\n${"system"===t?`\n@media (prefers-color-scheme: dark) {\n  :host {\n    ${dt(n.dark)}\n  }\n}`:""}\n}`,r}(e,n,{dark:r,light:i})),o.appendChild(function(e){const t=e.createElement("style");return t.textContent="\n.dialog {\n  line-height: 25px;\n  background-color: rgba(0, 0, 0, 0.05);\n  border: none;\n  position: fixed;\n  inset: 0;\n  z-index: 10000;\n  width: 100vw;\n  height: 100vh;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  opacity: 1;\n  transition: opacity 0.2s ease-in-out;\n}\n\n.dialog:not([open]) {\n  opacity: 0;\n  pointer-events: none;\n  visibility: hidden;\n}\n.dialog:not([open]) .dialog__content {\n  transform: translate(0, -16px) scale(0.98);\n}\n\n.dialog__content {\n  position: fixed;\n  left: var(--left);\n  right: var(--right);\n  bottom: var(--bottom);\n  top: var(--top);\n\n  border: var(--border);\n  border-radius: var(--form-border-radius);\n  background-color: var(--background);\n  color: var(--foreground);\n\n  width: 320px;\n  max-width: 100%;\n  max-height: calc(100% - 2rem);\n  display: flex;\n  flex-direction: column;
1\n  box-shadow: var(--box-shadow);\n  transition: transform 0.2s ease-in-out;\n  transform: translate(0, 0) scale(1);\n}\n\n.dialog__header {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  font-size: 20px;\n  font-weight: 600;\n  padding: 24px 24px 0 24px;\n  margin: 0;\n  margin-bottom: 16px;\n}\n\n.brand-link {\n  display: inline-flex;\n}\n\n.error {\n  color: var(--error);\n  margin-bottom: 16px;\n}\n\n.form {\n  display: grid;\n  overflow: auto;\n  flex-direction: column;\n  gap: 16px;\n  padding: 0 24px 24px;\n}\n\n.form__error-container {\n  color: var(--error);\n}\n\n.form__error-container--hidden {\n  display: none;\n}\n\n.form__label {\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n  margin: 0px;\n}\n\n.form__label__text {\n  display: grid;\n  gap: 4px;\n  align-items: center;\n  grid-auto-flow: column;\n  grid-auto-columns: max-content;\n}\n\n.form__label__text--required {\n  font-size: 0.85em;\n}\n\n.form__input {\n  font-family: inherit;\n  line-height: inherit;\n  background-color: var(--input-background);\n  box-sizing: border-box;\n  border: var(--input-border);\n  border-radius: var(--form-content-border-radius);\n  color: var(--input-foreground);\n  font-size: 14px;\n  font-weight: 500;\n  padding: 6px 12px;\n}\n\n.form__input:focus-visible {\n  outline: 1px auto var(--input-outline-focus);\n}\n\n.form__input--textarea {\n  font-family: inherit;\n  resize: vertical;\n}\n\n.btn-group {\n  display: grid;\n  gap: 8px;\n  margin-top: 8px;\n}\n\n.btn {\n  line-height: inherit;\n  border: var(--cancel-border);\n  border-radius: var(--form-content-border-radius);\n  cursor: pointer;\n  font-size: 14px;\n  font-weight: 600;\n  padding: 6px 16px;\n}\n.btn[disabled] {\n  opacity: 0.6;\n  pointer-events: none;\n}\n\n.btn--primary {\n  background-color: var(--submit-background);\n  border-color: var(--submit-border);\n  color: var(--submit-foreground);\n}\n.btn--primary:hover {\n  background-color: var(--submit-background-hover);\n  color: var(--submit-foreground-hover);\n}\n.btn--primary:focus-visible {\n  outline: 1px auto var(--submit-outline-focus);\n}\n\n.btn--default {\n  background-color: var(--cancel-background);\n  color: var(--cancel-foreground);\n  font-weight: 500;\n}\n.btn--default:hover {\n  background-color: var(--cancel-background-hover);\n  color: var(--cancel-foreground-hover);\n}\n.btn--default:focus-visible {\n  outline: 1px auto var(--cancel-outline-focus);\n}\n\n.success-message {\n  background-color: var(--background);\n  border: var(--border);\n  border-radius: var(--border-radius);
1\n  box-shadow: var(--box-shadow);\n  font-weight: 600;\n  color: var(--success);\n  padding: 12px 24px;\n  line-height: 25px;\n  display: grid;\n  align-items: center;\n  grid-auto-flow: column;\n  gap: 6px;\n  cursor: default;\n}\n\n.success-icon path {\n  fill: var(--success);\n}\n",t}(e)),{shadow:o,host:s}}catch(s){throw x.kg.warn("[Feedback] Browser does not support shadow DOM API"),new Error("Browser does not support shadow DOM API.")}}async function pt(e,t,n){if(!e)return;e.hideError();try{return await lt({...t,source:ot},n)}catch(r){e&&e.showError("There was a problem submitting feedback, please wait and try again.")}}function mt(e,t){return Object.entries(t).forEach((t=>{let[n,r]=t;e.setAttributeNS(null,n,r)})),e}function gt(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];const s=Ze.document,o=s.createElement(e);t&&Object.entries(t).forEach((e=>{let[t,n]=e;"className"===t&&"string"===typeof n?o.setAttribute("class",n):"boolean"===typeof n&&n?o.setAttribute(t,""):"string"===typeof n?o.setAttribute(t,n):t.startsWith("on")&&"function"===typeof n&&o.addEventListener(t.substring(2).toLowerCase(),n)}));for(const a of r)yt(o,a);return o}function yt(e,t){const n=Ze.document;if("undefined"!==typeof t&&null!==t)if(Array.isArray(t))for(const r of t)yt(e,r);else!1===t||("string"===typeof t?e.appendChild(n.createTextNode(t)):t instanceof Node?e.appendChild(t):e.appendChild(n.createTextNode(String(t))))}function vt(e){let{buttonLabel:t,onClick:n}=e;const r=gt("button",{type:"button",className:"widget__actor","aria-label":t,"aria-hidden":"false"},function(){const e=e=>Ze.document.createElementNS("http://www.w3.org/2000/svg",e),t=mt(e("svg"),{class:"feedback-icon",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"}),n=mt(e("g"),{clipPath:"url(#clip0_57_80)"}),r=mt(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const i=e("defs"),s=mt(e("clipPath"),{id:"clip0_57_80"}),o=mt(e("rect"),{width:"20",height:"20",fill:"white"});return s.appendChild(o),i.appendChild(s),t.appendChild(i).appendChild(s).appendChild(o),{get el(){return t}}}().el,t?gt("span",{className:"widget__actor__text"},t):null);return r.addEventListener("click",(function(e){n&&n(e)})),{get el(){return r},show:()=>{r.classList.remove("widget__actor--hidden"),r.setAttribute("aria-hidden","false")},hide:()=>{r.classList.add("widget__actor--hidden"),r.setAttribute("aria-hidden","true")}}}function bt(e,t){const n=e.get(t);return"string"===typeof n?n.trim():""}function _t(e){let{nameLabel:t,namePlaceholder:n,emailLabel:r,emailPlaceholder:i,messageLabel:s,messagePlaceholder:o,isRequiredLabel:a,cancelButtonLabel:c,submitButtonLabel:u,showName:l,showEmail
1:h,isNameRequired:d,isEmailRequired:f,defaultName:p,defaultEmail:m,onCancel:g,onSubmit:y}=e;const{el:v}=function(e){let{label:t}=e;return{el:gt("button",{type:"submit",className:"btn btn--primary","aria-label":t},t)}}({label:u});const b=gt("div",{className:"form__error-container form__error-container--hidden","aria-hidden":"true"});const _=gt("input",{id:"name",type:l?"text":"hidden","aria-hidden":l?"false":"true",name:"name",required:d,className:"form__input",placeholder:n,value:p}),w=gt("input",{id:"email",type:h?"text":"hidden","aria-hidden":h?"false":"true",name:"email",required:f,className:"form__input",placeholder:i,value:m}),S=gt("textarea",{id:"message",autoFocus:"true",rows:"5",name:"message",required:!0,className:"form__input form__input--textarea",placeholder:o}),k=gt("button",{type:"button",className:"btn btn--default","aria-label":c,onClick:e=>{g&&g(e)}},c),I=gt("form",{className:"form",onSubmit:function(e){if(e.preventDefault(),e.target instanceof HTMLFormElement)try{if(y){const t=new FormData(e.target),n={name:bt(t,"name"),email:bt(t,"email"),message:bt(t,"message")};y(n)}}catch(t){}}},[b,l&&gt("label",{htmlFor:"name",className:"form__label"},[gt("span",{className:"form__label__text"},t,d&&gt("span",{className:"form__label__text--required"},` ${a}`)),_]),!l&&_,h&&gt("label",{htmlFor:"email",className:"form__label"},[gt("span",{className:"form__label__text"},r,f&&gt("span",{className:"form__label__text--required"},` ${a}`)),w]),!h&&w,gt("label",{htmlFor:"message",className:"form__label"},[gt("span",{className:"form__label__text"},s,gt("span",{className:"form__label__text--required"},` ${a}`)),S]),gt("div",{className:"btn-group"},[v,k])]);return{get el(){return I},showError:function(e){b.textContent=e,b.classList.remove("form__error-container--hidden"),b.setAttribute("aria-hidden","false")},hideError:function(){b.textContent="",b.classList.add("form__error-container--hidden"),b.setAttribute("aria-hidden","true")}}}function wt(e){let{formTitle:t,showBranding:n,showName:r,showEmail:i,isNameRequired:s,isEmailRequired:o,colorScheme:a,defaultName:c,defaultEmail:u,onClosed:l,onCancel:h,onSubmit:d,...f}=e,p=null;function m(){p&&(p.open=!1)}const{el:g,showError:y,hideError:v}=_t({showEmail:i,showName:r,isEmailRequired:o,isNameRequired:s,defaultName:c,defaultEmail:u,onSubmit:d,onCancel:h,...f});return p=gt("dialog",{className:"dialog",open:!0,onClick:function(){m(),l&&l()}},gt("div",{className:"dialog__content",onClick:e=>{e.stopPropagation()}},gt("h2",{className:"dialog__header"},t,n&&gt("a",{className:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer"},function(e){let{colorScheme:t}=e;const n=e=>Ze.document.createElementNS("http://www.w3.org/2000/svg",e),r=mt(n("svg"),{class:"sentry-logo",width:"32",height:"30",viewBox:"0 0 72 66",fill:"none"}),i=mt(n("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});r.append(i);const s=n("defs"),o=n("style");return o.textContent=`\n    path {\n      fill: ${"dark"===t?"#fff":"#362d59"};\n    }`,"system"===t&&(o.textContent+="\n    @media (prefers-color-scheme: dark) {\n      path: {\n        fill: '#fff';\n      }\n    }\n    "),s.append(o),r.append(s),{get el(){return r}}}({colorScheme:a}).el)),g)),{get el(){return p},showError:y,hideError:v,open:function(){p&&(p.open=!0)},close:m,checkIsOpen:function(){return p&&!0===p.open||!1}}}function St(e){let{message:t,onRemove:n}=e;function r(){i&&(i.remove(),n&&n())}const i=gt("div",{className:"success-message",onClick:r},function(){const e=e=>Ze.document.createElementNS("http://www.w3.org/2000/svg",e),t=mt(e("svg"),{class:"success-icon",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none"}),n=mt(e("g"),{clipPath:"url(#clip0_57_156)"}),r=mt(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),i=mt(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 
110.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(i,r);const s=e("defs"),o=mt(e("clipPath"),{id:"clip0_57_156"}),a=mt(e("rect"),{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"});return o.appendChild(a),s.appendChild(o),t.appendChild(s).appendChild(o).appendChild(a),{get el(){return t}}}().el,t);return{el:i,remove:r}}function kt(e){let t,n,{shadow:r,options:{shouldCreateActor:i=!0,...s},attachTo:o}=e,a=!1;async function c(e){if(!n)return;const t=[];if(s.isNameRequired&&!e.name&&t.push(s.nameLabel),s.isEmailRequired&&!e.email&&t.push(s.emailLabel),e.message||t.push(s.messageLabel),t.length>0)return void n.showError(`Please enter in the following required fields: ${t.join(", ")}`);await pt(n,e)?(p(),function(){if(r)try{const e=St({message:s.successMessageText,onRemove:()=>{t&&clearTimeout(t),l()}});if(!e.el)throw new Error("Unable to show success message");r.appendChild(e.el);const t=setTimeout((()=>{e&&e.remove()}),5e3)}catch(e){x.kg.error(e)}}(),s.onSubmitSuccess&&s.onSubmitSuccess()):s.onSubmitError&&s.onSubmitError()}function u(){const e=(0,A.s3)(),t=e&&e.getIntegrationByName&&e.getIntegrationByName("Replay");t&&t.flush().catch((e=>{}))}function l(){t&&t.show()}function h(){t&&t.hide()}function d(){try{if(n)return n.open(),a=!0,s.onFormOpen&&s.onFormOpen(),void u();const e=s.useSentryUser,t=(0,A.nZ)(),i=t&&t.getUser();if(n=wt({colorScheme:s.colorScheme,showBranding:s.showBranding,showName:s.showName||s.isNameRequired,showEmail:s.showEmail||s.isEmailRequired,isNameRequired:s.isNameRequired,isEmailRequired:s.isEmailRequired,formTitle:s.formTitle,cancelButtonLabel:s.cancelButtonLabel,submitButtonLabel:s.submitButtonLabel,emailLabel:s.emailLabel,emailPlaceholder:s.emailPlaceholder,messageLabel:s.messageLabel,messagePlaceholder:s.messagePlaceholder,nameLabel:s.nameLabel,namePlaceholder:s.namePlaceholder,isRequiredLabel:s.isRequiredLabel,defaultName:e&&i&&i[e.name]||"",defaultEmail:e&&i&&i[e.email]||"",onClosed:()=>{l(),a=!1,s.onFormClose&&s.onFormClose()},onCancel:()=>{f(),l()},onSubmit:c}),!n.el)throw new Error("Unable to open Feedback dialog");r.appendChild(n.el),h(),s.onFormOpen&&s.onFormOpen(),u()}catch(e){x.kg.error(e)}}function f(){n&&(n.close(),a=!1,s.onFormClose&&s.onFormClose())}function p(){if(n){f();const e=n.el;e&&e.remove(),n=void 0}}function m(){a||d(),h()}return o?o.addEventListener("click",m):i&&(t=vt({buttonLabel:s.buttonLabel,onClick:m}),t.el&&r.appendChild(t.el)),{get actor(){return t},get dialog(){return n},showActor:l,hideActor:h,removeActor:function(){t&&t.el&&t.el.remove()},openDialog:d,closeDialog:f,removeDialog:p}}const It=Ze.document,Et=e=>new Tt(e);class Tt{static __initStatic(){this.id="Feedback"}constructor({autoInject:e=!0,id:t="sentry-feedback",isEmailRequired:n=!1,isNameRequired:r=!1,showBranding:i=!0,showEmail:s=!0,showName:o=!0,useSentryUser:a={email:"email",name:"username"},themeDark:c,themeLight:u,colorScheme:l="system",buttonLabel:h="Report a Bug",cancelButtonLabel:d="Cancel",submitButtonLabel:f="Send Bug Report",formTitle:p="Report a Bug",emailPlaceholder:m="[email protected]",emailLabel:g="Email",messagePlaceholder:y="What's the bug? What did you expect?",messageLabel:v="Description",namePlaceholder:b="Your Name",nameLabel:_="Name",isRequiredLabel:w="(required)",successMessageText:S="Thank you for your report!",onFormClose:k,onFormOpen:I,onSubmitError:E,onSubmitSuccess:T}={}){this.name=Tt.id,this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1,this.options={autoInject:e,showBranding:i,id:t,isEmailRequired:n,isNameRequired:r,showEmail:s,showName:o,useSentryUser:a,colorScheme:l,themeDark:{...st,...c},themeLight:{...it,...u},buttonLabel:h,cancelButtonLabel:d,submitButtonLabel:f,formTitle:p,emailLabel:g,emailPlaceholder:m,messageLabel:v,messagePlaceholder:y,nameLabel:_,namePlaceholder:b,isRequiredLabel:w,successMessageText:S,onFormClose:k,onFormOpen:I,onSubmitError:E,onSubmitSuccess:T}}setupOnce(){if((0,Je.j)())try{this._cleanupWidgetIfExists();const{autoInject:e}=this.options;if(!e)return;this._createWidget(this.options)}catch(e){}}openDialog(){this._widget||this._createWidget({...this.options,shouldCreateActor:!1}),this._widget&&this._widget.openDialog()}closeDialog(){this._widget&&this._widget.closeDialog()}attachTo(e,t){try{const n=ht(this.options,t||{});return this._ensureShadowHost(n,(t=>{let{shadow:r}=t;const i="string"===typeof e?It.querySelector(e):"function"===typeof e.addEventListener?e:null;if(!i)return null;const s=kt({shadow:r,options:n,attachTo:i});return this._widgets.add(s),this._widget||(this._widget=s),s}))}catch(n){return null}}createWidget(e){try{return this._createWidget(ht(this.options,e||{}))}catch(t){return null}}removeWidget(e){if(!e)return!1;try{if(this._widgets.has(e))return e.removeActor(),e.removeDialog(),this._widgets.delete(e),this._widget===e&&(this._widget=null),!0}catch(t){}return!1}getWidget(){return this._widget}remove(){this._host&&this._host.remove(),this._initialize()}_initialize(){this._host=null,this._shadow=null,this._widget=null,this._widgets=new Set,this._hasInsertedActorStyles=!1}_cleanupWidgetIfExists(){this._host&&this.remove();const e=It.querySelector(`#${this.options.id}`);e&&e.remove()}_createWidget(e){return this._ensureShadowHost(e,(t=>{let{shadow:n}=t;const r=kt({shadow:n,options:e});return!this._hasInsertedActorStyles&&r.actor&&(n.appendChild(function(e){const t=e.createElement("style");return t.textContent="\n.widget__actor {\n  line-height: 25px;\n\n  display: flex;\n  align-items: center;\n  gap: 8px;\n\n  border-radius: var(--border-radius);\n  cursor: pointer;\n  font-size: 14px;\n  font-weight: 600;\n  padding: 12px 16px;\n  text-decoration: none;\n  z-index: 9000;\n\n  color: var(--foreground);\n  background-color: var(--background);\n  border: var(--border);
1\n  box-shadow: var(--box-shadow);\n  opacity: 1;\n  transition: opacity 0.1s ease-in-out;\n}\n\n.widget__actor:hover {\n  background-color: var(--background-hover);\n}\n\n.widget__actor svg {\n  width: 16px;\n  height: 16px;\n}\n\n.widget__actor--hidden {\n  opacity: 0;\n  pointer-events: none;\n  visibility: hidden;\n}\n\n.widget__actor__text {\n}\n\n.feedback-icon path {\n  fill: var(--foreground);\n}\n",t}(It)),this._hasInsertedActorStyles=!0),this._widgets.add(r),this._widget||(this._widget=r),r}))}_ensureShadowHost(e,t){let n=!1;if(!this._shadow||!this._host){const{id:t,colorScheme:r,themeLight:i,themeDark:s}=e,{shadow:o,host:a}=ft({id:t,colorScheme:r,themeLight:i,themeDark:s});this._shadow=o,this._host=a,n=!0}this._host.dataset.sentryFeedbackColorscheme=e.colorScheme;const r=t({shadow:this._shadow,host:this._host});return n&&It.body.appendChild(this._host),r}}Tt.__initStatic();var Ct=n(31302),xt=n(31459),Ot=n(88323),At=n(96139);function Rt(e,t){O.X&&x.kg.info(`[Offline]: ${e}`,t)}function Nt(e){return t=>{const n=e(t),r=t.createStore?t.createStore(t):void 0;let i,s=5e3;function o(e){r&&(i&&clearTimeout(i),i=setTimeout((async()=>{i=void 0;const e=await r.pop();e&&(Rt("Attempting to send previously queued event"),c(e).catch((e=>{Rt("Failed to retry sending",e)})))}),e),"number"!==typeof i&&i.unref&&i.unref())}function a(){i||(o(s),s=Math.min(2*s,36e5))}async function c(e){try{const t=await n.send(e);let r=100;if(t)if(t.headers&&t.headers["retry-after"])r=(0,At.JY)(t.headers["retry-after"]);else if((t.statusCode||0)>=400)return t;return o(r),s=5e3,t}catch(i){if(r&&await function(e,n,r){return!(0,g.R)(e,["replay_event","replay_recording","client_report"])&&(!t.shouldStore||t.shouldStore(e,n,r))}(e,i,s))return await r.insert(e),a(),Rt("Error sending. Event queued",i),{};throw i}}return t.flushAtStartup&&a(),{send:c,flush:e=>n.flush(e)}}}function Dt(e){return new Promise(((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)}))}function Pt(e){return Dt(e.getAllKeys())}function Lt(e){let t;function n(){return void 0==t&&(t=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=Dt(n);return e=>r.then((n=>e(n.transaction(t,"readwrite").objectStore(t))))}(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{insert:async t=>{try{const r=await(0,g.V$)(t,e.textEncoder);await function(e,t,n){return e((e=>Pt(e).then((r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),Dt(e.transaction)}))))}(n(),r,e.maxQueueSize||30)}catch(r){}},pop:async()=>{try{const t=await function(e){return e((e=>Pt(e).then((t=>{if(0!==t.length)return Dt(e.get(t[0])).then((n=>(e.delete(t[0]),Dt(e.transaction).then((()=>n)))))}))))}(n());if(t)return(0,g.f4)(t,e.textEncoder||new TextEncoder,e.textDecoder||new TextDecoder)}catch(t){}}}}function Mt(e){return function(e){return t=>e({...t,createStore:Lt})}(Nt(e))}var Ft=n(25439),jt=n(8497),Ut=n(54349);const $t=1e6,Bt=String(0),Vt="main";let zt="",qt="",Ht="",Wt=re.m9.navigator&&re.m9.navigator.userAgent||"",Gt="";const Kt=re.m9.navigator&&re.m9.navigator.language||re.m9.navigator&&re.m9.navigator.languages&&re.m9.navigator.languages[0]||"";const Xt=re.m9.navigator&&re.m9.navigator.userAgentData;var Jt;function Yt(e){return function(e){return!("thread_metadata"in e)}(e)?function(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[Bt]:{name:Vt}}};if(!e.samples.length)return r;const i=e.samples[0].timestamp,s="number"===typeof performance.timeOrigin?performance.timeOrigin:D.Z1||0,o=s-(D.Z1||s);for(let a=0;a<e.samples.length;a++){const s=e.samples[a];if(void 0===s.stackId){void 0===t&&(t=n,r.stacks[t]=[],n++),r.samples[a]={elapsed_since_start_ns:((s.timestamp+o-i)*$t).toFixed(0),stack_id:t,thread_id:Bt};continue}let c=e.stacks[s.stackId];const u=[];for(;c;){u.push(c.frameId);const t=e.frames[c.frameId];void 0===r.frames[c.frameId]&&(r.frames[c.frameId]={function:t.name,abs_path:"number"===typeof t.resourceId?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),c=void 0===c.parentId?void 0:e.stacks[c.parentId]}const l={elapsed_since_start_ns:((s.timestamp+o-i)*$t).toFixed(0),stack_id:n,thread_id:Bt};r.stacks[n]=u,r.samples[a]=l,n++}return r}(e):e}function Qt(e,t,n,r){if("transaction"!==r.type)throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(void 0===n||null===n)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const i=function(e){const t=e&&e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id;return"string"===typeof t&&32!==t.length&&jt.X&&x.kg.log(`[Profiling] Invalid traceId: ${t} on profiled event`),"string"!==typeof t?"":t}(r),s=Yt(n),o=t||("number"===typeof r.start_timestamp?1e3*r.start_timestamp:Date.now()),a="number"===typeof r.timestamp?1e3*r.timestamp:Date.now();return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Ut.J,runtime:{name:"javascript",version:re.m9.navigator.userAgent},os:{name:zt,version:qt,build_number:Wt},device:{locale:Kt,model:Gt,manufacturer:Wt,architecture:Ht,is_emulator:!1},debug_meta:{images:tn(n.resources)},profile:s,transactions:[{name:r.transaction||"",id:r.event_id||
1(0,Ft.DM)(),trace_id:i,active_thread_id:Bt,relative_start_ns:"0",relative_end_ns:(1e6*(a-o)).toFixed(0)}]}}function Zt(e){return"pageload"===e.op}"object"===typeof(Jt=Xt)&&null!==Jt&&"getHighEntropyValues"in Jt&&Xt.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then((e=>{if(zt=e.platform||"",Ht=e.architecture||"",Gt=e.model||"",qt=e.platformVersion||"",e.fullVersionList&&e.fullVersionList.length>0){const t=e.fullVersionList[e.fullVersionList.length-1];Wt=`${t.brand} ${t.version}`}})).catch((e=>{}));const en=new WeakMap;function tn(e){const t=y.GLOBAL_OBJ._sentryDebugIds;if(!t)return[];const n=(0,A.s3)(),r=n&&n.getOptions(),i=r&&r.stackParser;if(!i)return[];let s;const o=en.get(i);o?s=o:(s=new Map,en.set(i,s));const a=Object.keys(t).reduce(((e,n)=>{let r;const o=s.get(n);o?r=o:(r=i(n),s.set(n,r));for(let i=r.length-1;i>=0;i--){const s=r[i],o=s&&s.filename;if(s&&o){e[o]=t[n];break}}return e}),{}),c=[];for(const u of e)u&&a[u]&&c.push({type:"sourcemap",code_file:u,debug_id:a[u]});return c}let nn=!1;function rn(e){if(nn)return jt.X&&x.kg.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return jt.X&&x.kg.log("[Profiling] Discarding profile because transaction was not sampled."),!1;const t=(0,A.s3)(),n=t&&t.getOptions();if(!n)return jt.X&&x.kg.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;if(!("number"!==typeof(i=r)&&"boolean"!==typeof i||"number"===typeof i&&isNaN(i)?(jt.X&&x.kg.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),0):!0===i||!1===i||!(i<0||i>1)||(jt.X&&x.kg.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${i}.`),0)))return jt.X&&x.kg.warn("[Profiling] Discarding profile because of invalid sample rate."),!1;var i;if(!r)return jt.X&&x.kg.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1;return!!(!0===r||Math.random()<r)||(jt.X&&x.kg.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1)}function sn(e,t,n,r){return function(e){return e.samples.length<2?(jt.X&&x.kg.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):!!e.frames.length||(jt.X&&x.kg.log("[Profiling] Discarding profile because it contains no frames"),!1)}(n)?Qt(e,t,n,r):null}const on=new Map;function an(e){const t=on.get(e);return t&&on.delete(e),t}function cn(e){return e?rn(e)?un(e):e:(jt.X&&x.kg.log("[Profiling] Transaction is undefined, skipping profiling"),e)}function un(e){let t;Zt(e)&&(t=1e3*(0,D.ph)());const n=function(){const e=re.m9.Profiler;if("function"!==typeof e)return void(jt.X&&x.kg.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object."));const t=Math.floor(3e3);try{return new e({sampleInterval:10,maxBufferSize:t})}catch(n){jt.X&&(x.kg.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),x.kg.log("[Profiling] Disabling profiling for current user session.")),nn=!0}}();if(!n)return e;jt.X&&x.kg.log(`[Profiling] started profiling transaction: ${(0,R.XU)(e).description}`);const r=(0,Ft.DM)();async function i(){return e&&n?n.stop().then((t=>(s&&(re.m9.clearTimeout(s),s=void 0),jt.X&&x.kg.log(`[Profiling] stopped profiling of transaction: ${(0,R.XU)(e).description}`),t?(function(e,t){if(on.set(e,t),on.size>30){const e=on.keys().next().value;on.delete(e)}}(r,t),null):(jt.X&&x.kg.log(`[Profiling] profiler returned null profile for: ${(0,R.XU)(e).description}`,"this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started"),null)))).catch((e=>(jt.X&&x.kg.log("[Profiling] error while stopping profiler:",e),null))):null}let s=re.m9.setTimeout((()=>{jt.X&&x.kg.log("[Profiling] max profile duration elapsed, stopping profiling for:",(0,R.XU)(e).description),i()}),3e4);const o=e.end.bind(e);return e.end=function(){return e?(i().then((()=>{e.setContext("profile",{profile_id:r,start_timestamp:t}),o()}),(()=>{o()})),e):o()},e}const ln="BrowserProfiling",hn=(0,l._I)((()=>({name:ln,setupOnce(){},setup(e){const t=(0,A.nZ)().getTransaction();t&&Zt(t)&&rn(t)&&un(t),"function"===typeof e.on?(e.on("startTransaction",(e=>{rn(e)&&un(e)})),e.on("beforeEnvelope",(e=>{if(!on.size)return;const t=function(e){const t=[];return(0,g.gv)(e,((e,n)=>{if("transaction"===n)for(let r=1;r<e.length;r++){const n=e[r];n&&n.contexts&&n.contexts.profile&&n.contexts.profile.profile_id&&t.pu
1sh(e[r])}})),t}(e);if(!t.length)return;const n=[];for(const r of t){const e=r&&r.contexts,t=e&&e.profile&&e.profile.profile_id,i=e&&e.profile&&e.profile.start_timestamp;if("string"!==typeof t){jt.X&&x.kg.log("[Profiling] cannot find profile for a transaction without a profile context");continue}if(!t){jt.X&&x.kg.log("[Profiling] cannot find profile for a transaction without a profile context");continue}e&&e.profile&&delete e.profile;const s=an(t);if(!s){jt.X&&x.kg.log(`[Profiling] Could not retrieve profile for transaction: ${t}`);continue}const o=sn(t,i,s,r);o&&n.push(o)}!function(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n])}(e,n)}))):x.kg.warn("[Profiling] Client does not support hooks, profiling will be disabled")}}))),dn=(0,l.RN)(ln,hn);let fn={};re.m9.Sentry&&re.m9.Sentry.Integrations&&(fn=re.m9.Sentry.Integrations);const pn={...fn,...m,...i}},84947:function(e,t,n){"use strict";n.d(t,{O:function(){return T},f:function(){return E}});var r=n(53872),i=n(37862),s=n(47744),o=n(59769),a=n(71671),c=n(86272);function u(e){const t="console";(0,c.Hj)(t,e),(0,c.D2)(t,l)}function l(){"console"in a.GLOBAL_OBJ&&s.RU.forEach((function(e){e in a.GLOBAL_OBJ.console&&(0,o.hl)(a.GLOBAL_OBJ.console,e,(function(t){return s.LD[e]=t,function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i={args:n,level:e};(0,c.rK)("console",i);const o=s.LD[e];o&&o.apply(a.GLOBAL_OBJ.console,n)}}))}))}var h=n(63527),d=n(38481),f=n(86122),p=n(36366),m=n(25439),g=n(92353);const y=["fatal","error","warning","log","info","debug"];function v(e){return"warn"===e?"warning":y.includes(e)?e:"log"}var b=n(92217),_=n(32932),w=n(8497),S=n(12563);const k=1024,I="Breadcrumbs",E=(0,r._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:I,setupOnce(){},setup(e){t.console&&u(O(e)),t.dom&&(0,h.O)(x(e,t.dom)),t.xhr&&(0,d.UK)(A(e)),t.fetch&&(0,f.U)(R(e)),t.history&&(0,p.a)(N(e)),t.sentry&&e.on&&e.on("beforeSendEvent",C(e))}}})),T=(0,r.RN)(I,E);function C(e){return function(t){(0,i.s3)()===e&&(0,i.n_)({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:(0,m.jH)(t)},{event:t})}}function x(e,t){return function(n){if((0,i.s3)()!==e)return;let r,o,a="object"===typeof t?t.serializeAttribute:void 0,c="object"===typeof t&&"number"===typeof t.maxStringLength?t.maxStringLength:void 0;c&&c>k&&(w.X&&s.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${c} was configured. Sentry will use 1024 instead.`),c=k),"string"===typeof a&&(a=[a]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=(0,g.Rt)(t,{keyAttrs:a,maxStringLength:c}),o=(0,g.iY)(t)}catch(l){r="<unknown>"}if(0===r.length)return;const u={category:`ui.${n.name}`,message:r};o&&(u.data={"ui.component_name":o}),(0,i.n_)(u,{event:n.event,name:n.name,global:n.global})}}function O(e){return function(t){if((0,i.s3)()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:v(t.level),message:(0,b.nK)(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${(0,b.nK)(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}(0,i.n_)(n,{input:t.args,level:t.level})}}function A(e){return function(t){if((0,i.s3)()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[d.xU];if(!n||!r||!s)return;const{method:o,url:a,status_code:c,body:u}=s,l={method:o,url:a,status_code:c},h={xhr:t.xhr,input:u,startTimestamp:n,endTimestamp:r};(0,i.n_)({category:"xhr",data:l,type:"http"},h)}}function R(e){return function(t){if((0,i.s3)()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const e=t.fetchData,s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r};(0,i.n_)({category:"fetch",data:e,level:"error",type:"http"},s)}else{const e=t.response,s={...t.fetchData,status_code:e&&e.status},o={input:t.args,response:e,startTimestamp:n,endTimestamp:r};(0,i.n_)({category:"fetch",data:s,type:"http"},o)}}}function N(e){return function(t){if((0,i.s3)()!==e)return;let n=t.from,r=t.to;const s=(0,_.en)(S.m9.location.href);let o=n?(0,_.en)(n):void 0;const a=(0,_.en)(r);o&&o.path||(o=s),s.protocol===a.protocol&&s.host===a.host&&(r=a.relative),s.protocol===o.protocol&&s.host===o.host&&(n=o.relative),(0,i.n_)({category:"navigation",data:{from:n,to:r}})}}},57034:function(e,t,n){"use strict";n.d(t,{I:function(){return c},R:function(){return a}});var r=n(53872),i=n(47744),s=n(8497);const o="Dedupe",a=(0,r._I)((()=>{let e;return{name:o,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!l(e,t))return!1;if(!u(e,t))return!1;return!0}(e,t))return!0;
1if(function(e,t){const n=h(t),r=h(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!l(e,t))return!1;if(!u(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return s.X&&i.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return e=t}}})),c=(0,r.RN)(o,a);function u(e,t){let n=d(e),r=d(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const e=r[i],t=n[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function l(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(i){return!1}}function h(e){return e.exception&&e.exception.values&&e.exception.values[0]}function d(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(n){return}}},81252:function(e,t,n){"use strict";n.d(t,{d:function(){return m},k:function(){return p}});var r=n(53872),i=n(37862),s=n(91746),o=n(13444),a=n(79878),c=n(92353),u=n(47744),l=n(8497),h=n(1883),d=n(12563);const f="GlobalHandlers",p=(0,r._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={onerror:!0,onunhandledrejection:!0,...e};return{name:f,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(g(e),b("onerror")),t.onunhandledrejection&&(y(e),b("onunhandledrejection"))}}})),m=(0,r.RN)(f,p);function g(e){(0,s.V)((t=>{const{stackParser:n,attachStacktrace:r}=_();if((0,i.s3)()!==e||(0,d.Wz)())return;const{msg:s,url:a,line:c,column:u,error:l}=t,f=void 0===l&&(0,o.HD)(s)?function(e,t,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=(0,o.VW)(e)?e.message:e,a="Error";const c=s.match(i);c&&(a=c[1],s=c[2]);return v({exception:{values:[{type:a,value:s}]}},t,n,r)}(s,a,c,u):v((0,h.ME)(n,l||s,void 0,r,!1),a,c,u);f.level="error",(0,i.eN)(f,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}))}function y(e){(0,a.h)((t=>{const{stackParser:n,attachStacktrace:r}=_();if((0,i.s3)()!==e||(0,d.Wz)())return;const s=function(e){if((0,o.pt)(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch(n){}return e}(t),a=(0,o.pt)(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:(0,h.ME)(n,s,void 0,r,!0);a.level="error",(0,i.eN)(a,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}function v(e,t,n,r){const i=e.exception=e.exception||{},s=i.values=i.values||[],a=s[0]=s[0]||{},u=a.stacktrace=a.stacktrace||{},l=u.frames=u.frames||[],h=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,f=(0,o.HD)(t)&&t.length>0?t:(0,c.l4)();return 0===l.length&&l.push({colno:h,filename:f,function:"?",in_app:!0,lineno:d}),e}function b(e){l.X&&u.kg.log(`Global Handler attached: ${e}`)}function _(){const e=(0,i.s3)();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}},37323:function(e,t,n){"use strict";n.d(t,{q:function(){return a},s:function(){return o}});var r=n(53872),i=n(12563);const s="HttpContext",o=(0,r._I)((()=>({name:s,setupOnce(){},preprocessEvent(e){if(!i.m9.navigator&&!i.m9.location&&!i.m9.document)return;const t=e.request&&e.request.url||i.m9.location&&i.m9.location.href,{referrer:n}=i.m9.document||{},{userAgent:r}=i.m9.navigator||{},s={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:s};e.request=o}}))),a=(0,r.RN)(s,o)},6905:function(e,t,n){"use strict";n.d(t,{O:function(){return c},i:function(){return u}});var r=n(53872),i=n(58696),s=n(1883);const o="cause",a="LinkedErrors",c=(0,r._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.limit||5,n=e.key||o;return{name:a,setupOnce(){},preprocessEvent(e,r,o){const a=o.getOptions();(0,i.Z)(s.GJ,a.stackParser,a.maxValueLength,n,t,e,r)}}})),u=(0,r.RN)(a,c)},72979:function(e,t,n){"use strict";n.d(t,{p:function(){return l},t:function(){return u}});var r=n(53872),i=n(59769),s=n(88745),o=n(12563);const a=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],c="TryCatch",u=(0,r._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:c,setupOnce(){t.setTimeout&&(0,i.hl)(o.m9,"setTimeout",h),t.setInterval&&(0,i.hl)(o.m9,"setInterval",h),t.requestAnimationFrame&&(0,i.hl)(o.m9,"requestAnimationFrame",d),t.XMLHttpRequest&&"XMLHttpRequest"in o.m9&&(0,i.hl)(XMLHttpRequest.prototype,"send",f);const e=t.eventTarget;
1if(e){(Array.isArray(e)?e:a).forEach(p)}}}})),l=(0,r.RN)(c,u);function h(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i=n[0];return n[0]=(0,o.re)(i,{mechanism:{data:{function:(0,s.$P)(e)},handled:!1,type:"instrument"}}),e.apply(this,n)}}function d(e){return function(t){return e.apply(this,[(0,o.re)(t,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,s.$P)(e)},handled:!1,type:"instrument"}})])}}function f(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a=this,c=["onload","onerror","onprogress","onreadystatechange"];return c.forEach((e=>{e in a&&"function"===typeof a[e]&&(0,i.hl)(a,e,(function(t){const n={mechanism:{data:{function:e,handler:(0,s.$P)(t)},handled:!1,type:"instrument"}},r=(0,i.HK)(t);return r&&(n.mechanism.data.handler=(0,s.$P)(r)),(0,o.re)(t,n)}))})),e.apply(this,n)}}function p(e){const t=o.m9,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,i.hl)(n,"addEventListener",(function(t){return function(n,r,i){try{"function"===typeof r.handleEvent&&(r.handleEvent=(0,o.re)(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,s.$P)(r),target:e},handled:!1,type:"instrument"}}))}catch(a){}return t.apply(this,[n,(0,o.re)(r,{mechanism:{data:{function:"addEventListener",handler:(0,s.$P)(r),target:e},handled:!1,type:"instrument"}}),i])}})),(0,i.hl)(n,"removeEventListener",(function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(s){}return e.call(this,t,i,r)}})))}},10274:function(e,t,n){"use strict";n.d(t,{Eg:function(){return A},Jd:function(){return P},S1:function(){return x},SS:function(){return T},jp:function(){return O},lA:function(){return R},nV:function(){return C},re:function(){return N}});var r=n(45578),i=n(56272),s=n(53872),o=n(60281),a=n(24385),c=n(6077),u=n(37862),l=n(88745),h=n(3401),d=n(47744),f=n(36366),p=n(84209),m=n(8497),g=n(12563),y=n(84947),v=n(57034),b=n(81252),_=n(37323),w=n(6905),S=n(72979),k=n(29691),I=n(99812),E=n(51624);const T=[(0,r.S)(),(0,i.C)(),(0,S.t)(),(0,y.f)(),(0,b.k)(),(0,w.O)(),(0,v.R)(),(0,_.s)()];function C(e){return[...T]}function x(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0===e.defaultIntegrations&&(e.defaultIntegrations=C()),void 0===e.release&&("string"===typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),g.m9.SENTRY_RELEASE&&g.m9.SENTRY_RELEASE.id&&(e.release=g.m9.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(0,l.Sq)(e.stackParser||k.Dt),integrations:(0,s.m8)(e),transport:e.transport||((0,h.Ak)()?I.f:E.K)};(0,o.M)(p.R,t),e.autoSessionTracking&&D()}const O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.Gd)();if(!g.m9.document)return void(m.X&&d.kg.error("Global document not defined in showReportDialog call"));const{client:n,scope:r}=t.getStackTop(),i=e.dsn||n&&n.getDsn();if(!i)return void(m.X&&d.kg.error("DSN not configured for showReportDialog call"));r&&(e.user={...r.getUser(),...e.user}),e.eventId||(e.eventId=t.lastEventId());const s=g.m9.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=(0,c.h)(i,e),e.onLoad&&(s.onload=e.onLoad);const{onClose:o}=e;if(o){const e=t=>{if("__sentry_reportdialog_closed__"===t.data)try{o()}finally{g.m9.removeEventListener("message",e)}};g.m9.addEventListener("message",e)}const u=g.m9.document.head||g.m9.document.body;u?u.appendChild(s):m.X&&d.kg.error("Not injecting report dialog. No injection point found in HTML")};function A(){}function R(e){e()}function N(e){return(0,g.re)(e)()}function D(){"undefined"!==typeof g.m9.document?((0,u.yj)({ignoreDuration:!0}),(0,u.cg)(),(0,f.a)((e=>{let{from:t,to:n}=e;void 0!==t&&t!==n&&((0,u.yj)({ignoreDuration:!0}),(0,u.cg)())}))):m.X&&d.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported.")}function P(e){const t=(0,u.s3)();t&&t.captureUserFeedback(e)}},29691:function(e,t,n){"use strict";n.d(t,{$3:function(){return c},$Q:function(){return h},Dt:function(){return b},HH:function(){return y},NP:function(){return m},R2:function(){return f},d8:function(){return v}});var r=n(88745);const i="?";
1function s(e,t,n,r){const i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const o=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/\((\S*)(?::(\d+))(?::(\d+))\)/,c=[30,e=>{const t=o.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=a.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=_(t[1]||i,t[2]);return s(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,l=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,h=[50,e=>{const t=u.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=l.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||i;return[n,e]=_(n,e),s(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],d=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,f=[40,e=>{const t=d.exec(e);return t?s(t[2],t[1]||i,+t[3],t[4]?+t[4]:void 0):void 0}],p=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,m=[10,e=>{const t=p.exec(e);return t?s(t[2],t[3]||i,+t[1]):void 0}],g=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,y=[20,e=>{const t=g.exec(e);return t?s(t[5],t[3]||t[4]||i,+t[1],+t[2]):void 0}],v=[c,h,f],b=(0,r.pE)(...v),_=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:i,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]}},99812:function(e,t,n){"use strict";n.d(t,{f:function(){return d}});var r=n(15031),i=n(91782),s=n(3401),o=n(47744),a=n(8497),c=n(12563);let u;function l(){if(u)return u;if((0,s.Du)(c.m9.fetch))return u=c.m9.fetch.bind(c.m9);const e=c.m9.document;let t=c.m9.fetch;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(n){a.X&&o.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return u=t.bind(c.m9)}function h(){u=void 0}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l(),n=0,s=0;function o(r){const o=r.body.length;n+=o,s++;const a={body:r.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&s<15,...e.fetchOptions};try{return t(e.url,a).then((e=>(n-=o,s--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(c){return h(),n-=o,s--,(0,i.$2)(c)}}return(0,r.q)(e,o)}},51624:function(e,t,n){"use strict";n.d(t,{K:function(){return s}});var r=n(15031),i=n(91782);function s(e){return(0,r.q)(e,(function(t){return new i.cW(((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)}))}))}},91052:function(e,t,n){"use strict";n.d(t,{r:function(){return s}});var r=n(95625),i=n(33002);function s(e,t){let{metadata:n,tunnel:s,dsn:o}=t;const a={event_id:e.event_id,sent_at:(new Date).toISOString(),...n&&n.sdk&&{sdk:{name:n.sdk.name,version:n.sdk.version}},...!!s&&!!o&&{dsn:(0,r.RA)(o)}},c=function(e){return[{type:"user_report"},e]}(e);return(0,i.Jd)(a,[c])}},6077:function(e,t,n){"use strict";n.d(t,{U:function(){return c},h:function(){return u}});var r=n(59769),i=n(95625);function s(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function o(e){return`${s(e)}${e.projectId}/envelope/`}function a(e,t){return(0,r._j)({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n="string"===typeof t?t:t.tunnel,r="string"!==typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${o(e)}?${a(e,r)}`}function u(e,t){const n=(0,i.vK)(e);if(!n)return"";const r=`${s(n)}embed/error-page/`;let o=`dsn=${(0,i.RA)(n)}`;for(const i in t)if("dsn"!==i&&"onClose"!==i)if("user"===i){const e=t.user;if(!e)continue;e.name&&(o+=`&name=${encodeURIComponent(e.name)}
1`),e.email&&(o+=`&email=${encodeURIComponent(e.email)}`)}else o+=`&${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`;return`${r}?${o}`}},16827:function(e,t,n){"use strict";n.d(t,{W:function(){return S},Q:function(){return E}});var r=n(95625),i=n(47744),s=n(25439),o=n(13444),a=n(91782),c=n(33002),u=n(23158),l=n(6077),h=n(61145),d=n(40793),f=n(37862),p=n(24385),m=n(53872),g=n(47866);function y(e,t,n,i){const s={sent_at:(new Date).toISOString()};n&&n.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),i&&t&&(s.dsn=(0,r.RA)(t));const o=function(e){const t=(0,g.uv)(e);return[{type:"statsd",length:t.length},t]}(e);return(0,c.Jd)(s,[o])}var v=n(77503),b=n(68448),_=n(50101);const w="Not capturing exception because it's already been captured.";class S{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=(0,r.vK)(e.dsn):h.X&&i.kg.warn("No DSN provided, client will not send events."),this._dsn){const t=(0,l.U)(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if((0,s.YO)(e))return void(h.X&&i.kg.log(w));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const s=(0,o.Le)(e)?e:String(e),a=(0,o.pt)(e)?this.eventFromMessage(s,t,n):this.eventFromException(e,n);return this._process(a.then((e=>this._captureEvent(e,n,r))).then((e=>{i=e}))),i}captureEvent(e,t,n){if(t&&t.originalException&&(0,s.YO)(t.originalException))return void(h.X&&i.kg.log(w));let r=t&&t.event_id;const o=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,o||n).then((e=>{r=e}))),r}captureSession(e){"string"!==typeof e.release?h.X&&i.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),(0,v.CT)(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e))))):(0,a.WD)(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e)))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){return h.X&&i.kg.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];(0,m.m7)(this,e,this._integrations),t||(0,m.uf)(this,[e])}sendEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.emit("beforeSendEvent",e,t);let n=(0,d.M)(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])n=(0,c.BO)(n,(0,c.zQ)(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then((t=>this.emit("afterSendEvent",e,t)),null)}sendSession(e){const t=(0,d.Q)(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;h.X&&i.kg.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){h.X&&i.kg.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=y(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this._hooks[e]&&this._hooks[e].forEach((e=>e(...n)))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=(0,m.q4)(this,e),(0,m.uf)(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const s="ok"===e.status;(s&&0===e.errors||s&&n)&&((0,v.CT)(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new a.cW((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,p.aF)();const i=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s.length>
10&&(t.integrations=s),this.emit("preprocessEvent",e,t),(0,_.R)(i,e,t,n,this,r).then((e=>{if(null===e)return e;const t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if(!(e.contexts&&e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:s,dsc:o}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:s},...e.contexts};const a=o||(0,b._)(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:a,...e.sdkProcessingMetadata}}return e}))}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if(h.X){const t=e;"log"===t.logLevel?i.kg.log(t.message):i.kg.warn(t)}}))}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,s=I(e),c=k(e),l=e.type||"error",h=`before send for type \`${l}\``;if(c&&"number"===typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),(0,a.$2)(new u.b(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const d="replay_event"===l?"replay":l,f=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,f).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",d,e),new u.b("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;if(k(t)&&r)return r(t,n);if(I(t)&&i)return i(t,n);return t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if((0,o.J8)(e))return e.then((e=>{if(!(0,o.PO)(e)&&null!==e)throw new u.b(n);return e}),(e=>{throw new u.b(`${t} rejected with ${e}`)}));if(!(0,o.PO)(e)&&null!==e)throw new u.b(n);return e}(i,h)})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",d,e),new u.b(`${h} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!s&&i&&this._updateSessionFromEvent(i,r);const o=r.transaction_info;if(s&&o&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...o,source:e}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof u.b)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new u.b(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing++,e.then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e)))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,(e=>{h.X&&i.kg.error("Error while sending event:",e)}));h.X&&i.kg.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function k(e){return void 0===e.type}function I(e){return"transaction"===e.type}function E(e){const t=(0,f.s3)();t&&t.addEventProcessor&&t.addEventProcessor(e)}},54349:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});const r="production"},61145:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});const r=!1},40793:function(e,t,n){"use strict";n.d(t,{M:function(){return o},Q:function(){return s}});var r=n(33002),i=n(95625);function s(e,t,n,s){const o=(0,r.HY)(n),a={sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!s&&t&&{dsn:(0,i.RA)(t)}},c="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return(0,r.Jd)(a,[c])}function o(e,t,n,i){const s=(0,r.HY)(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=(0,r.Cd)(e,s,i,t);delete e.sdkProcessingMetadata;const c=[{type:o},e];return(0,r.Jd)(a,[c])}},5690:function(e,t,n){"use strict";n.d(t,{RP:function(){return l},cc:function(){return u},fH:function(){return c}});var r=n(71671),i=n(91782),s=n(47744),o=n(13444),a=n(61145);function c(){return(0,r.Y)("globalEventProcessors",(()=>[]))}function u(e){c().push(e)}function l(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return new i.cW(((i,c)=>{const u=e[r];if(null===t||"function"!==typeof u)i(t);else{const h=u({...t},n);a.X&&u.id&&null===h&&s.kg.log(`Event processor "${u.id}" dropped event`),(0,o.J8)(h)?h.then((t=>l(e,t,n,r+1).then(i))).then(null,c):l(e,h,n,r+1).then(i).then(null,c)}}))}},37862:function(e,t,n){"use strict";n.d(t,{$e:function(){return w},TM:function(){return N},Tb:function(){return l},YA:function(){return b},Yr:function(){return I},_d:function(){return k},av:function(){return _},cg:function(){return P},dk:function(){return O},e:function(){return f},eN:function(){return d},eW:function(){return C},mG:function(){return v},nZ:function(){return A},n_:function(){return p},rJ:function(){return g},s3:function(){return x},sU:function(){return y},uT:function(){return h},v:function(){return m},wi:function(){return S},xv:function(){return T},yj:function(){return R},yl:function(){return E}});var r=n(47744),i=n(71671),s=n(54349),o=n(61145),a=n(24385),c=n(77503),u=n(50101);function l(e,t){return(0,a.Gd)().captureException(e,(0,u.U0)(t))}function h(e,t){const n="string"===typeof t?t:void 0,r="string"!==typeof t?{captureContext:t}:void 0;return(0,a.Gd)().captureMessage(e,n,r)}function d(e,t){return(0,a.Gd)().captureEvent(e,t)}function f(e){(0,a.Gd)().configureScope(e)}function p(e,t){(0,a.Gd)().addBreadcrumb(e,t)}function m(e,t){(0,a.Gd)().setContext(e,t)}function g(e){(0,a.Gd)().setExtras(e)}function y(e,t){(0,a.Gd)().setExtra(e,t)}function v(e){(0,a.Gd)().setTags(e)}function b(e,t){(0,a.Gd)().setTag(e,t)}function _(e){(0,a.Gd)().setUser(e)}function w(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=(0,a.Gd)();if(2===t.length){const[e,n]=t;return e?r.withScope((()=>(r.getStackTop().scope=e,n(e)))):r.withScope(n)}return r.withScope(t[0])}function S(e){return(0,a.Ok)((()=>e((0,a.aF)())))}function k(e,t){return w((n=>(n.setSpan(e),t(n))))}function I(e,t){return(0,a.Gd)().startTransaction({...e},t)}async function E(e){const t=x();return t?t.flush(e):(o.X&&r.kg.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function T(e){const t=x();return t?t.close(e):(o.X&&r.kg.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function C(){return(0,a.Gd)().lastEventId()}function x(){return(0,a.Gd)().getClient()}function O(){return!!x()}function A(){return(0,a.Gd)().getScope()}function R(e){const t=x(),n=(0,a.aF)(),r=A(),{release:o,environment:u=s.J}=t&&t.getOptions()||{},{userAgent:l}=i.GLOBAL_OBJ.navigator||{},h=(0,c.Hv)({release:o,environment:u,user:r.getUser()||n.getUser(),...l&&{userAgent:l},...e}
1),d=n.getSession();return d&&"ok"===d.status&&(0,c.CT)(d,{status:"exited"}),N(),n.setSession(h),r.setSession(h),h}function N(){const e=(0,a.aF)(),t=A(),n=t.getSession()||e.getSession();n&&(0,c.RJ)(n),D(),e.setSession(),t.setSession()}function D(){const e=(0,a.aF)(),t=A(),n=x(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function P(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?N():D()}},24385:function(e,t,n){"use strict";n.d(t,{Gd:function(){return v},Ok:function(){return w},Xb:function(){return m},aF:function(){return b},cu:function(){return g},pj:function(){return y},vi:function(){return k}});var r=n(13444),i=n(25439),s=n(48129),o=n(47744),a=n(71671),c=n(54349),u=n(61145),l=n(54694),h=n(77503),d=n(73702);const f=parseFloat(d.J),p=100;class m{constructor(e,t,n,r=f){let i,s;this._version=r,t?i=t:(i=new l.sX,i.setClient(e)),n?s=n:(s=new l.sX,s.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=s}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(i){throw this.popScope(),i}return(0,r.J8)(n)?n.then((e=>(this.popScope(),e)),(e=>{throw this.popScope(),e})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:(0,i.DM)(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:(0,i.DM)(),s=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:(0,i.DM)();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=p}=r.getOptions&&r.getOptions()||{};if(a<=0)return;const c={timestamp:(0,s.yW)(),...e},u=i?(0,o.Cf)((()=>i(c,t))):c;null!==u&&(r.emit&&r.emit("beforeAddBreadcrumb",u,t),n.addBreadcrumb(u,a))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=y(this);try{e(this)}finally{y(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(n){return u.X&&o.kg.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(u.X&&!n){this.getClient()?o.kg.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):o.kg.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0])return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&(0,h.RJ)(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=c.J}=n&&n.getOptions()||{},{userAgent:s}=a.GLOBAL_OBJ.navigator||{},o=(0,h.Hv)({release:r,environment:i,user:t.getUser(),...s&&{userAgent:s},...e}),u=t.getSession&&t.getSession();return u&&"ok"===u.status&&(0,h.CT)(u,{status:"exited"}),this.endSession(),t.setSession(o),o}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const i=g().__SENTRY__;if(i&&i.extensions&&"function"===typeof i.extensions[e])return i.extensions[e].apply(this,n);u.X&&o.kg.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function g(){return a.GLOBAL_OBJ.__SENTRY__=a.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},a.GLOBAL_OBJ}function y(e){const t=g(),n=k(t);return I(t,e),n}function v(){const e=g();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return _(e)}function b(){return v().getIsolationScope()}function _(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g();return S(e)&&!k(e).isOlderThan(f)||I(e,new m),k(e)}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
1const n=g();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(e,t):e()}function S(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function k(e){return(0,a.Y)("hub",(()=>new m),e)}function I(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}},53872:function(e,t,n){"use strict";n.d(t,{M5:function(){return p},RN:function(){return m},_I:function(){return g},m7:function(){return f},m8:function(){return l},q4:function(){return h},uf:function(){return d}});var r=n(25439),i=n(47744),s=n(61145),o=n(5690),a=n(37862),c=n(24385);const u=[];function l(e){const t=e.defaultIntegrations||[],n=e.integrations;let i;t.forEach((e=>{e.isDefaultInstance=!0})),i=Array.isArray(n)?[...t,...n]:"function"===typeof n?(0,r.lE)(n(t)):t;const s=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.keys(t).map((e=>t[e]))}(i),o=function(e,t){for(let n=0;n<e.length;n++)if(!0===t(e[n]))return n;return-1}(s,(e=>"Debug"===e.name));if(-1!==o){const[e]=s.splice(o,1);s.push(e)}return s}function h(e,t){const n={};return t.forEach((t=>{t&&f(e,t,n)})),n}function d(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function f(e,t,n){if(n[t.name])s.X&&i.kg.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===u.indexOf(t.name)&&(t.setupOnce(o.cc,c.Gd),u.push(t.name)),t.setup&&"function"===typeof t.setup&&t.setup(e),e.on&&"function"===typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,r)=>n(t,r,e)))}if(e.addEventProcessor&&"function"===typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign(((t,r)=>n(t,r,e)),{id:t.name});e.addEventProcessor(r)}s.X&&i.kg.log(`Integration installed: ${t.name}`)}}function p(e){const t=(0,a.s3)();t&&t.addIntegration?t.addIntegration(e):s.X&&i.kg.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`)}function m(e,t){return Object.assign((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t(...n)}),{id:e})}function g(e){return e}},56272:function(e,t,n){"use strict";n.d(t,{C:function(){return u},c:function(){return l}});var r=n(59769),i=n(37862),s=n(53872);let o;const a="FunctionToString",c=new WeakMap,u=(0,s._I)((()=>({name:a,setupOnce(){o=Function.prototype.toString;try{Function.prototype.toString=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const s=(0,r.HK)(this),a=c.has((0,i.s3)())&&void 0!==s?s:this;return o.apply(a,t)}}catch(e){}},setup(e){c.set(e,!0)}}))),l=(0,s.RN)(a,u)},45578:function(e,t,n){"use strict";n.d(t,{Q:function(){return d},S:function(){return h}});var r=n(47744),i=n(25439),s=n(92217),o=n(61145),a=n(53872);const c=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],u=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],l="InboundFilters",h=(0,a._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{name:l,setupOnce(){},processEvent(t,n,r){const i=r.getOptions();return p(t,f(e,i))?null:t}}})),d=(0,a.RN)(l,h);function f(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:c],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:u],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}function p(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(t){}return!1}(e)?(o.X&&r.kg.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${(0,i.jH)(e)}`),!0):function(e,t){if(e.type||!t||!t.length)return!1;return function(e){const t=[];e.message&&t.push(e.message);let n;try{n=e.exception.values[e.exception.values.length-1]}catch(s){}n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`));o.X&&0===t.length&&r.kg.error(`Could not extract message for event ${(0,i.jH)(e)}`);return t}(e).some((e=>(0,s.U0)(e,t)))}(e,t.ignoreErrors)?(o.X&&r.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${(0,i.jH)(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&(0,s.U0)(n,t)}(e,t.ignoreTransactions)?(o.X&&r.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${(0,i.jH)(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const n=m(e);return!!n&&(0,s.U0)(n,t)}(e,t.denyUrls)?(o.X&&r.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${(0,i.jH)(e)}.\nUrl: ${m(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const n=m(e);return!n||(0,s.U0)(n,t)}(e,t.allowUrls)&&(o.X&&r.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${(0,i.jH)(e)}.\nUrl: ${m(e)}`),!0)}function m(e){try{let n;try{n=e.exception.values[0].stacktrace.frames}catch(t){}return n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(n){return o.X&&r.kg.error(`Cannot extract url for event ${(0,i.jH)(e)}`),null}}},38801:function(e,t,n){"use strict";n.d(t,{JM:function(){return r},RF:function(){return u},X7:function(){return a},gK:function(){return c},g_:function(){return o},is:function(){return s},uG:function(){return i}});const r="c",i="g",s="s",o="d",a=/[^a-zA-Z0-9_/.-]+/g,c=/[^\w\d\s_:/@.{}[\]$-]+/g,u=5e3},2356:function(e,t,n){"use strict";n.d(t,{v:function(){return c},y:function(){return a}});var r=n(59769),i=n(87637);let s;function o(e){return s?s.get(e):void 0}function a(e){const t=o(e);if(!t)return;const n={};for(const[,[i,s]]of t)n[i]||(n[i]=[]),n[i].push((0,r.Jr)(s));return n}function c(e,t,n,r,a,c){const u=(0,i.HN)();if(u){const i=o(u)||new Map,l=`${e}:${t}@${r}`,h=i.get(c);if(h){const[,e]=h;
1i.set(c,[l,{min:Math.min(e.min,n),max:Math.max(e.max,n),count:e.count+=1,sum:e.sum+=n,tags:e.tags}])}else i.set(c,[l,{min:n,max:n,count:1,sum:n,tags:a}]);s||(s=new WeakMap),s.set(u,i)}}},47866:function(e,t,n){"use strict";n.d(t,{Bg:function(){return c},Ic:function(){return s},M:function(){return o},uv:function(){return a}});var r=n(59769),i=n(38801);function s(e,t,n,i){return`${e}${t}${n}${Object.entries((0,r.Jr)(i)).sort(((e,t)=>e[0].localeCompare(t[0])))}`}function o(e){let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t>>>0}function a(e){let t="";for(const n of e){const e=Object.entries(n.tags),r=e.length>0?`|#${e.map((e=>{let[t,n]=e;return`${t}:${n}`})).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}function c(e){const t={};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){t[n.replace(i.X7,"_")]=String(e[n]).replace(i.gK,"")}return t}},54694:function(e,t,n){"use strict";n.d(t,{lW:function(){return d},sX:function(){return h}});var r=n(13444),i=n(48129),s=n(25439),o=n(47744),a=n(5690),c=n(77503),u=n(107);let l;class h{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=f()}static clone(e){return e?e.clone():new h}clone(){const e=new h;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&(0,c.CT)(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"===typeof e?e(this):e;if(t instanceof h){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if((0,r.PO)(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=f(),this}addBreadcrumb(e,t){const n="number"===typeof t?t:100;if(n<=0)return this;const r={timestamp:(0,i.yW)(),...e},s=this._breadcrumbs;return s.push(r),this._breadcrumbs=s.length>n?s.slice(-n):s,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}
1getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:s,_level:o,_fingerprint:a,_eventProcessors:c,_propagationContext:u,_sdkProcessingMetadata:l,_transactionName:h,_span:d}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:s,level:o,fingerprint:a||[],eventProcessors:c,propagationContext:u,sdkProcessingMetadata:l,transactionName:h,span:d}}applyToEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];(0,u.gi)(e,this.getScopeData());const r=[...n,...(0,a.fH)(),...this._eventProcessors];return(0,a.RP)(r,e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:(0,s.DM)();if(!this._client)return o.kg.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:(0,s.DM)();if(!this._client)return o.kg.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:(0,s.DM)();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(o.kg.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function d(){return l||(l=new h),l}function f(){return{traceId:(0,s.DM)(),spanId:(0,s.DM)().substring(16)}}},60281:function(e,t,n){"use strict";n.d(t,{K:function(){return c},M:function(){return a}});var r=n(47744),i=n(61145),s=n(37862),o=n(24385);function a(e,t){!0===t.debug&&(i.X?r.kg.enable():(0,r.Cf)((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));(0,s.nZ)().update(t.initialScope);const n=new e(t);c(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)}function c(e){const t=(0,o.Gd)().getStackTop();t.client=e,t.scope.setClient(e)}},54145:function(e,t,n){"use strict";n.d(t,{$J:function(){return s},S3:function(){return o},TE:function(){return i},Zj:function(){return r},p6:function(){return a}});const r="sentry.source",i="sentry.sample_rate",s="sentry.op",o="sentry.origin",a="profile_id"},77503:function(e,t,n){"use strict";n.d(t,{CT:function(){return a},Hv:function(){return o},RJ:function(){return c}});var r=n(48129),i=n(25439),s=n(59769);function o(e){const t=(0,r.ph)(),n={sid:(0,i.DM)(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return(0,s.Jr)({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"===typeof e.did||"string"===typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&a(n,e),n}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||(0,r.ph)(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:(0,i.DM)()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"===typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"===typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"===typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function c(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),a(e,n)}},68448:function(e,t,n){"use strict";n.d(t,{_:function(){return c},j:function(){return u}});var r=n(59769),i=n(54349),s=n(37862),o=n(96447),a=n(90255);
1function c(e,t,n){const s=t.getOptions(),{publicKey:o}=t.getDsn()||{},{segment:a}=n&&n.getUser()||{},c=(0,r.Jr)({environment:s.environment||i.J,release:s.release,user_segment:a,public_key:o,trace_id:e});return t.emit&&t.emit("createDsc",c),c}function u(e){const t=(0,s.s3)();if(!t)return{};const n=c((0,a.XU)(e).trace_id||"",t,(0,s.nZ)()),r=(0,o.G)(e);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:u,source:l}=r.metadata;null!=u&&(n.sample_rate=`${u}`);const h=(0,a.XU)(r);return l&&"url"!==l&&(n.transaction=h.description),n.sampled=String((0,a.Tt)(r)),t.emit&&t.emit("createDsc",n),n}},5369:function(e,t,n){"use strict";n.d(t,{T:function(){return v},l:function(){return y}});var r=n(47744),i=n(61145),s=n(24385),o=n(90255),a=n(91746),c=n(79878),u=n(70977);let l=!1;function h(){const e=(0,u.x1)();if(e){const t="internal_error";i.X&&r.kg.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}h.tag="sentry_tracingErrorCallback";var d=n(89105),f=n(80656),p=n(90258);function m(){const e=this.getScope().getSpan();return e?{"sentry-trace":(0,o.Hb)(e)}:{}}function g(e,t){const n=this.getClient(),s=n&&n.getOptions()||{},o=s.instrumenter||"sentry",a=e.instrumenter||"sentry";o!==a&&(i.X&&r.kg.error(`A transaction was started with instrumenter=\`${a}\`, but the SDK is configured with the \`${o}\` instrumenter.\nThe transaction will not be sampled. Please use the ${o} instrumentation to start transactions.`),e.sampled=!1);let c=new p.Y(e,this);return c=(0,f.f)(c,s,{name:e.name,parentSampled:e.parentSampled,transactionContext:e,attributes:{...e.data,...e.attributes},...t}),c.isRecording()&&c.initSpanRecorder(s._experiments&&s._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",c),c}function y(e,t,n,r,i,s,o){let a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const c=e.getClient(),u=c&&c.getOptions()||{};let l=new d.io(t,e,n,r,o,i,a);return l=(0,f.f)(l,u,{name:t.name,parentSampled:t.parentSampled,transactionContext:t,attributes:{...t.data,...t.attributes},...s}),l.isRecording()&&l.initSpanRecorder(u._experiments&&u._experiments.maxSpans),c&&c.emit&&c.emit("startTransaction",l),l}function v(){const e=(0,s.cu)();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=g),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=m),l||(l=!0,(0,a.V)(h),(0,c.h)(h)))}},89105:function(e,t,n){"use strict";n.d(t,{AT:function(){return u},io:function(){return d}});var r=n(47744),i=n(48129),s=n(61145),o=n(90255),a=n(54578),c=n(90258);const u={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},l=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class h extends a.g{constructor(e,t,n,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=n}add(e){if(e.spanContext().spanId!==this.transactionSpanId){var t=this;const n=e.end;e.end=function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return t._popActivity(e.spanContext().spanId),n.apply(e,i)},void 0===(0,o.XU)(e).timestamp&&this._pushActivity(e.spanContext().spanId)}super.add(e)}}class d extends c.Y{constructor(e,t,n=u.idleTimeout,i=u.finalTimeout,o=u.heartbeatInterval,a=!1,c=!1){super(e,t),this._idleHub=t,this._idleTimeout=n,this._finalTimeout=i,this._heartbeatInterval=o,this._onScope=a,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=l[4],this._autoFinishAllowed=!c,a&&(s.X&&r.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),t.getScope().setSpan(this)),c||this._restartIdleTimeout(),setTimeout((()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=l[3],this.end())}),this._finalTimeout)}end(e){const t=(0,o.$k)(e);if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setAttribute("finishReason",this._finishReason),this.spanRecorder){s.X&&r.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);for(const e of this._beforeFinishCallbacks)e(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter((e=>{if(e.spanContext().spanId===this.spanContext().spanId)return!0;(0,o.XU)(e).timestamp||(e.setStatus("cancelled"),e.end(t),s.X&&r.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));const{start_timestamp:n,timestamp:i}=(0,o.XU)(e),a=n&&n<t,c=(this._finalTimeout+this._idleTimeout)/1e3,u=i&&n&&i-n<c;if(s.X){const t=JSON.stringify(e,void 0,2);a?u||r.kg.log("[Tracing] discarding Span since it finished after Transaction final timeout",t):r.kg.log("[Tracing] discarding Span since it happened after Transaction was finished",t)}return a&&u})),s.X&&r.kg.log("[Tracing] flushing IdleTransaction")}else s.X&&r.kg.log("[Tracing] No active IdleTransaction");if(this._onScope){const e=this._idleHub.getScope();e.getTransaction()===this&&e.setSpan(void 0)}return super.end(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const t=e=>{this._finished||this._pushActivity(e)},n=e=>{this._finished||this._popActivity(e)};this.spanRecorder=new h(t,n,this.spanContext().spanId,e),s.X&&r.kg.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e){let{restartOnChildSpanChange:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{restartOnChildSpanChange:!0};this._idleTimeoutCanceledPermanently=!1===t,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason=l[5],this.end(e)))}setFinishReason(e){this._finishReason=e}sendAutoFinishSignal(){this._autoFinishAllowed||(s.X&&r.kg.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout((()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason=l[1],this.end(e))}),this._idleTimeout)}
1_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),s.X&&r.kg.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,s.X&&r.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&(s.X&&r.kg.log(`[Tracing] popActivity ${e}`),delete this.activities[e],s.X&&r.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){const e=(0,i.ph)();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason=l[5],this.end(e)):this._restartIdleTimeout(e+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?this._autoFinishAllowed&&(s.X&&r.kg.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=l[0],this.end()):this._pingHeartbeat()}_pingHeartbeat(){s.X&&r.kg.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout((()=>{this._beat()}),this._heartbeatInterval)}}},34906:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var r=n(70977);function i(e,t,n){const i=(0,r.x1)();i&&i.setMeasurement(e,t,n)}},80656:function(e,t,n){"use strict";n.d(t,{X:function(){return l},f:function(){return u}});var r=n(47744),i=n(13444),s=n(61145),o=n(54145),a=n(18030),c=n(90255);function u(e,t,n){if(!(0,a.z)(t))return e.sampled=!1,e;if(void 0!==e.sampled)return e.setAttribute(o.TE,Number(e.sampled)),e;let i;return"function"===typeof t.tracesSampler?(i=t.tracesSampler(n),e.setAttribute(o.TE,Number(i))):void 0!==n.parentSampled?i=n.parentSampled:"undefined"!==typeof t.tracesSampleRate?(i=t.tracesSampleRate,e.setAttribute(o.TE,Number(i))):(i=1,e.setAttribute(o.TE,i)),l(i)?i?(e.sampled=Math.random()<i,e.sampled?(s.X&&r.kg.log(`[Tracing] starting ${e.op} transaction - ${(0,c.XU)(e).description}`),e):(s.X&&r.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),e)):(s.X&&r.kg.log("[Tracing] Discarding transaction because "+("function"===typeof t.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),e.sampled=!1,e):(s.X&&r.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function l(e){return(0,i.i2)(e)||"number"!==typeof e&&"boolean"!==typeof e?(s.X&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):!(e<0||e>1)||(s.X&&r.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1)}},54578:function(e,t,n){"use strict";n.d(t,{D:function(){return p},g:function(){return f}});var r=n(25439),i=n(48129),s=n(47744),o=n(59769),a=n(61145),c=n(2356),u=n(54145),l=n(96447),h=n(90255),d=n(23828);class f{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class p{constructor(e={}){this._traceId=e.traceId||(0,r.DM)(),this._spanId=e.spanId||(0,r.DM)().substring(16),this._startTime=e.startTimestamp||(0,i.ph)(),this.tags=e.tags?{...e.tags}:{},this.data=e.data?{...e.data}:{},this.instrumenter=e.instrumenter||"sentry",this._attributes={},this.setAttributes({[u.S3]:e.origin||"manual",[u.$J]:e.op,...e.attributes}),this._name=e.name||e.description,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.status&&(this._status=e.status),e.endTimestamp&&(this._endTime=e.endTimestamp),e.exclusiveTime&&(this._exclusiveTime=e.exclusiveTime),this._measurements=e.measurements?{...e.measurements}:{}}get name(){return this._name||""}set name(e){this.updateName(e)}get description(){return this._name}set description(e){this._name=e}get traceId(){return this._traceId}set traceId(e){this._traceId=e}get spanId(){return this._spanId}set spanId(e){this._spanId=e}set parentSpanId(e){this._parentSpanId=e}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(e){this._sampled=e}get attributes(){return this._attributes}set attributes(e){this._attributes=e}get startTimestamp(){return this._startTime}set startTimestamp(e){this._startTime=e}get endTimestamp(){return this._endTime}set endTimestamp(e){this._endTime=e}get status(){return this._status}set status(e){this._status=e}get op(){return this._attributes[u.$J]}set op(e){this.setAttribute(u.$J,e)}get origin(){return this._attributes[u.S3]}set origin(e){this.setAttribute(u.S3,e)}spanContext(){const{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?h.i0:h.ve}}startChild(e){const t=new p({...e,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t);const n=(0,l.G)(this);if(t.transaction=n,a.X&&n){const r=`[Tracing] Starting '${e&&e.op||"< unknown op >"}' span on transaction '${(0,h.XU)(t).description||"< unknown name >"}' (${n.spanContext().spanId}).`;s.kg.log(r),this._logMessage=r}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setAttribute(e,t){void 0===t?delete this._attributes[e]:this._attributes[e]=t}setAttributes(e){Object.keys(e).forEach((t=>this.setAttribute(t,e[t])))}setStatus(e){return this._status=e,this}setHttpStatus(e){return(0,d.Q0)(this,e),this}setName(e){this.updateName(e)}updateName(e){return this._name=e,this}isSuccess(){return"ok"===this._status}finish(e){return this.end(e)}end(e){if(this._endTime)return;const t=(0,l.G)(this);if(a.X&&t&&t.spanContext().spanId!==this._spanId){const e=this._logMessage;e&&s.kg.log(e.replace("Starting","Finishing"))}this._endTime=(0,h.$k)(e)}toTraceparent(){return(0,h.Hb)(this)}toContext(){return(0,o.Jr)({data:this._getData(),description:this._name,endTimestamp:this._endTime,op:this.op,parentSpanId:this._parentSpanId,sampled:this._sampled,spanId:this._spanId,startTimestamp:this._startTime,status:this._status,tags:this.tags,traceId:this._traceId})}updateWithContext(e){return this.data=e.data||{},this._name=e.name||e.description,this._endTime=e.endTimestamp,this.op=e.op,this._parentSpanId=e.parentSpanId,this._sampled=e.sampled,this._spanId=e.spanId||this._spanId,this._startTime=e.startTimestamp||this._startTime,this._status=e.status,this.tags=e.tags||{},this._traceId=e.traceId||this._traceId,this}getTraceContext(){return(0,h.wy)(this)}getSpanJSON(){return(0,o.Jr)({data:this._getData(),description:this._name,op:this._attributes[u.$J],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:this._status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[u.S3],_metrics_summary:(0,c.y)(this),profile_id:this._attributes[u.p6],exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}
1toJSON(){return this.getSpanJSON()}_getData(){const{data:e,_attributes:t}=this,n=Object.keys(e).length>0,r=Object.keys(t).length>0;if(n||r)return n&&r?{...e,...t}:n?e:t}}},23828:function(e,t,n){"use strict";var r;function i(e){if(e<400&&e>=100)return"ok";if(e>=400&&e<500)switch(e){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(e>=500&&e<600)switch(e){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}n.d(t,{Q0:function(){return o},Zd:function(){return s},ix:function(){return i}}),function(e){e.Ok="ok";e.DeadlineExceeded="deadline_exceeded";e.Unauthenticated="unauthenticated";e.PermissionDenied="permission_denied";e.NotFound="not_found";e.ResourceExhausted="resource_exhausted";e.InvalidArgument="invalid_argument";e.Unimplemented="unimplemented";e.Unavailable="unavailable";e.InternalError="internal_error";e.UnknownError="unknown_error";e.Cancelled="cancelled";e.AlreadyExists="already_exists";e.FailedPrecondition="failed_precondition";e.Aborted="aborted";e.OutOfRange="out_of_range";e.DataLoss="data_loss"}(r||(r={}));const s=i;function o(e,t){e.setTag("http.status_code",String(t)),e.setData("http.response.status_code",t);const n=i(t);"unknown_error"!==n&&e.setStatus(n)}},87637:function(e,t,n){"use strict";n.d(t,{yn:function(){return _},HN:function(){return b},I1:function(){return E},qp:function(){return v},GK:function(){return g},V0:function(){return y},g4:function(){return m}});var r=n(78161),i=n(47744),s=n(59769),o=n(61145),a=n(24385),c=n(90255),u=n(68448),l=n(37862),h=n(13444);function d(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};try{n=e()}catch(i){throw t(i),r(),i}return f(n,t,r)}function f(e,t,n){return(0,h.J8)(e)?e.then((e=>(n(),e)),(e=>{throw t(e),n(),e})):(n(),e)}var p=n(18030);function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{};const i=(0,a.Gd)(),s=(0,l.nZ)(),o=s.getSpan(),c=S(e),u=w(i,{parentSpan:o,spanContext:c,forceTransaction:!1,scope:s});return s.setSpan(u),d((()=>t(u)),(e=>{u&&u.setStatus("internal_error"),n(e,u)}),(()=>{u&&u.end(),s.setSpan(o),r()}))}function g(e,t){const n=S(e);return(0,a.Ok)((()=>(0,l.$e)(e.scope,(r=>{const i=(0,a.Gd)(),s=r.getSpan(),o=e.onlyIfParent&&!s?void 0:w(i,{parentSpan:s,spanContext:n,forceTransaction:e.forceTransaction,scope:r});return d((()=>t(o)),(()=>{if(o){const{status:e}=(0,c.XU)(o);e&&"ok"!==e||o.setStatus("internal_error")}}),(()=>o&&o.end()))}))))}function y(e,t){const n=S(e);return(0,a.Ok)((()=>(0,l.$e)(e.scope,(r=>{const i=(0,a.Gd)(),s=r.getSpan(),o=e.onlyIfParent&&!s?void 0:w(i,{parentSpan:s,spanContext:n,forceTransaction:e.forceTransaction,scope:r});function u(){o&&o.end()}return d((()=>t(o,u)),(()=>{if(o&&o.isRecording()){const{status:e}=(0,c.XU)(o);e&&"ok"!==e||o.setStatus("internal_error")}}))}))))}function v(e){if(!(0,p.z)())return;const t=S(e),n=(0,a.Gd)(),r=e.scope?e.scope.getSpan():b();if(e.onlyIfParent&&!r)return;const i=(e.scope||(0,l.nZ)()).clone();return w(n,{parentSpan:r,spanContext:t,forceTransaction:e.forceTransaction,scope:i})}function b(){return(0,l.nZ)().getSpan()}const _=(e,t)=>{let{sentryTrace:n,baggage:c}=e;const u=(0,l.nZ)(),{traceparentData:h,dynamicSamplingContext:d,propagationContext:f}=(0,r.KA)(n,c);u.setPropagationContext(f),o.X&&h&&i.kg.log(`[Tracing] Continuing trace ${h.traceId}.`);const p={...h,metadata:(0,s.Jr)({dynamicSamplingContext:d})};return t?(0,a.Ok)((()=>t(p))):p};function w(e,t){let{parentSpan:n,spanContext:r,forceTransaction:i,scope:o}=t;if(!(0,p.z)())return;const l=(0,a.aF)();let h;if(n&&!i)h=n.startChild(r);else if(n){const t=(0,u.j)(n),{traceId:i,spanId:s}=n.spanContext(),o=(0,c.Tt)(n);h=e.startTransaction({traceId:i,parentSpanId:s,parentSampled:o,...r,metadata:{dynamicSamplingContext:t,...r.metadata}})}else{const{traceId:t,dsc:n,parentSpanId:i,sampled:s}={...l.getPropagationContext(),...o.getPropagationContext()};h=e.startTransaction({traceId:t,parentSpanId:i,parentSampled:s,...r,metadata:{dynamicSamplingContext:n,...r.metadata}})}return o.setSpan(h),function(e,t,n){e&&((0,s.xp)(e,I,n),(0,s.xp)(e,k,t))}(h,o,l),h}function S(e){if(e.startTime){const t={...e};return t.startTimestamp=(0,c.$k)(e.startTime),delete t.startTime,t}return e}const k="_sentryScope",I="_sentryIsolationScope";function E(e){return{scope:e._sentryScope,isolationScope:e._sentryIsolationScope}}},90258:function(e,t,n){"use strict";n.d(t,{Y:function(){return f}});var r=n(59769),i=n(47744),s=n(61145),o=n(24385),a=n(2356),c=n(54145),u=n(90255),l=n(68448),h=n(54578),d=n(87637);class f extends h.D{constructor(e,t){super(e),this._contexts={},this._hub=t||(0,o.Gd)(),this._name=e.name||"",this._metadata={...e.metadata},this._trimEnd=e.trimEnd,this.transaction=this;const n=this._metadata.dynamicSamplingContext;n&&(this._frozenDynamicSamplingContext={...n})}get name(){return this._name}set name(e){this.setName(e)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[c.Zj]&&{source:this._attributes[c.Zj]},...this._attributes[c.TE]&&{sampleRate:this._attributes[c.TE]}}}set metadata(e){this._metadata=e}setName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"custom";this._name=e,this.setAttribute(c.Zj,t)}updateName(e){return this._name=e,this}initSpanRecorder(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;this.spanRecorder||(this.spanRecorder=new h.g(e)),this.spanRecorder.add(this)}setContext(e,t){null===t?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this._measurements[e]={value:t,unit:n}}setMetadata(e){this._metadata={...this._metadata,...e}}end(e){const t=(0,u.$k)(e),n=this._finishTransaction(t);
1if(n)return this._hub.captureEvent(n)}toContext(){const e=super.toContext();return(0,r.Jr)({...e,name:this._name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this._name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){return(0,l.j)(this)}setHub(e){this._hub=e}getProfileId(){if(void 0!==this._contexts&&void 0!==this._contexts.profile)return this._contexts.profile.profile_id}_finishTransaction(e){if(void 0!==this._endTime)return;this._name||(s.X&&i.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(e);const t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),!0!==this._sampled)return s.X&&i.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(t&&t.recordDroppedEvent("sample_rate","transaction"));const n=this.spanRecorder?this.spanRecorder.spans.filter((e=>e!==this&&(0,u.XU)(e).timestamp)):[];if(this._trimEnd&&n.length>0){const e=n.map((e=>(0,u.XU)(e).timestamp)).filter(Boolean);this._endTime=e.reduce(((e,t)=>e>t?e:t))}const{scope:o,isolationScope:c}=(0,d.I1)(this),{metadata:h}=this,{source:f}=h,p={contexts:{...this._contexts,trace:(0,u.wy)(this)},spans:n,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...h,capturedSpanScope:o,capturedSpanIsolationScope:c,...(0,r.Jr)({dynamicSamplingContext:(0,l.j)(this)})},_metrics_summary:(0,a.y)(this),...f&&{transaction_info:{source:f}}};return Object.keys(this._measurements).length>0&&(s.X&&i.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),p.measurements=this._measurements),s.X&&i.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),p}}},70977:function(e,t,n){"use strict";n.d(t,{qG:function(){return o},x1:function(){return s}});var r=n(78161),i=n(24385);function s(e){return(e||(0,i.Gd)()).getScope().getTransaction()}const o=r.qG},15031:function(e,t,n){"use strict";n.d(t,{q:function(){return l}});var r=n(23158),i=n(91782);function s(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(s){if(!(void 0===e||t.length<e))return(0,i.$2)(new r.b("Not adding Promise because buffer limit was reached."));const o=s();return-1===t.indexOf(o)&&t.push(o),o.then((()=>n(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new i.cW(((n,r)=>{let s=t.length;if(!s)return n(!0);const o=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{(0,i.WD)(e).then((()=>{--s||(clearTimeout(o),n(!0))}),r)}))}))}}}var o=n(33002),a=n(96139),c=n(47744),u=n(61145);function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s(e.bufferSize||30),l={};const d=e=>n.drain(e);function f(s){const d=[];if((0,o.gv)(s,((t,n)=>{const r=(0,o.mL)(n);if((0,a.Q)(l,r)){const i=h(t,n);e.recordDroppedEvent("ratelimit_backoff",r,i)}else d.push(t)})),0===d.length)return(0,i.WD)();const f=(0,o.Jd)(s[0],d),p=t=>{(0,o.gv)(f,((n,r)=>{const i=h(n,r);e.recordDroppedEvent(t,(0,o.mL)(r),i)}))};return n.add((()=>t({body:(0,o.V$)(f,e.textEncoder)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&u.X&&c.kg.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),l=(0,a.WG)(l,e),e)),(e=>{throw p("network_error"),e})))).then((e=>e),(e=>{if(e instanceof r.b)return u.X&&c.kg.error("Skipped sending event because buffer is full."),p("queue_overflow"),(0,i.WD)();throw e}))}return f.__sentry__baseTransport__=!0,{send:f,flush:d}}function h(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}},107:function(e,t,n){"use strict";n.d(t,{gi:function(){return c},yo:function(){return u}});var r=n(59769),i=n(25439),s=n(68448),o=n(96447),a=n(90255);function c(e,t){const{fingerprint:n,span:c,breadcrumbs:u,sdkProcessingMetadata:l}=t;!function(e,t){const{extra:n,tags:i,user:s,contexts:o,level:a,transactionName:c}=t,u=(0,r.Jr)(n);u&&Object.keys(u).length&&(e.extra={...u,...e.extra});const l=(0,r.Jr)(i);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});const h=(0,r.Jr)(s);h&&Object.keys(h).length&&(e.user={...h,...e.user});const d=(0,r.Jr)(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts});a&&(e.level=a);c&&(e.transaction=c)}(e,t),c&&function(e,t){e.contexts={trace:(0,a.wy)(t),...e.contexts};const n=(0,o.G)(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:(0,s.j)(t),...e.sdkProcessingMetadata};const r=(0,a.XU)(n).description;r&&(e.tags={transaction:r,...e.tags})}}(e,c),function(e,t){e.fingerprint=e.fingerprint?(0,i.lE)(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t));e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,u),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,l)}function u(e,t){const{extra:n,tags:r,user:i,contexts:s,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:h,attachments:d,propagationContext:f,transactionName:p,span:m}=t;l(e,"extra",n),l(e,"tags",r),l(e,"user",i),l(e,"contexts",s),l(e,"sdkProcessingMetadata",a),o&&(e.level=o),p&&(e.transactionName=p),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),h.length&&(e.eventProcessors=[...e.eventProcessors,...h]
1),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...f}}function l(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}},96447:function(e,t,n){"use strict";function r(e){return e.transaction}n.d(t,{G:function(){return r}})},18030:function(e,t,n){"use strict";n.d(t,{z:function(){return i}});var r=n(37862);function i(e){if("boolean"===typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=(0,r.s3)(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}},50101:function(e,t,n){"use strict";n.d(t,{R:function(){return f},U0:function(){return m}});var r=n(25439),i=n(48129),s=n(92217),o=n(71671),a=n(93968),c=n(54349),u=n(5690),l=n(54694),h=n(107),d=n(90255);function f(e,t,n,f,m,g){const{normalizeDepth:y=3,normalizeMaxBreadth:v=1e3}=e,b={...t,event_id:t.event_id||n.event_id||(0,r.DM)(),timestamp:t.timestamp||(0,i.yW)()},_=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:c.J);void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==i&&(e.dist=i);e.message&&(e.message=(0,s.$G)(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=(0,s.$G)(a.value,o));const u=e.request;u&&u.url&&(u.url=(0,s.$G)(u.url,o))}(b,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(b,_),void 0===t.type&&function(e,t){const n=o.GLOBAL_OBJ._sentryDebugIds;if(!n)return;let r;const i=p.get(t);i?r=i:(r=new Map,p.set(t,r));const s=Object.keys(n).reduce(((e,i)=>{let s;const o=r.get(i);o?s=o:(s=t(i),r.set(i,s));for(let t=s.length-1;t>=0;t--){const r=s[t];if(r.filename){e[r.filename]=n[i];break}}return e}),{});try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.filename&&(e.debug_id=s[e.filename])}))}))}catch(a){}}(b,e.stackParser);const w=function(e,t){if(!t)return e;const n=e?e.clone():new l.sX;return n.update(t),n}(f,n.captureContext);n.mechanism&&(0,r.EG)(b,n.mechanism);const S=m&&m.getEventProcessors?m.getEventProcessors():[],k=(0,l.lW)().getScopeData();if(g){const e=g.getScopeData();(0,h.yo)(k,e)}if(w){const e=w.getScopeData();(0,h.yo)(k,e)}const I=[...n.attachments||[],...k.attachments];I.length&&(n.attachments=I),(0,h.gi)(b,k);const E=[...S,...(0,u.fH)(),...k.eventProcessors];return(0,u.RP)(E,b,n).then((e=>(e&&function(e){const t={};try{e.exception.values.forEach((e=>{e.stacktrace.frames.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))}))}catch(r){}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach((e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})}))}(e),"number"===typeof y&&y>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:(0,a.Fv)(e.data,t,n)}})))},...e.user&&{user:(0,a.Fv)(e.user,t,n)},...e.contexts&&{contexts:(0,a.Fv)(e.contexts,t,n)},...e.extra&&{extra:(0,a.Fv)(e.extra,t,n)}};e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=(0,a.Fv)(e.contexts.trace.data,t,n)));e.spans&&(r.spans=e.spans.map((e=>{const r=(0,d.XU)(e).data;return r&&(e.data=(0,a.Fv)(r,t,n)),e})));return r}(e,y,v):e)))}const p=new WeakMap;function m(e){if(e)return function(e){return e instanceof l.sX||"function"===typeof e}(e)||function(e){return Object.keys(e).some((e=>g.includes(e)))}(e)?{captureContext:e}:e}const g=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},50492:function(e,t,n){"use strict";n.d(t,{V:function(){return i}});var r=n(73702);function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[t],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"npm";const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${i}:@sentry/${e}`,version:r.J}))),version:r.J}),e._metadata=s}},90255:function(e,t,n){"use strict";n.d(t,{$k:function(){return l},Hb:function(){return u},Tt:function(){return f},XU:function(){return d},i0:function(){return a},ve:function(){return o},wy:function(){return c}});var r=n(59769),i=n(78161),s=n(48129);const o=0,a=1;function c(e){const{spanId:t,traceId:n}=e.spanContext(),{data:i,op:s,parent_span_id:o,status:a,tags:c,origin:u}=d(e);return(0,r.Jr)({data:i,op:s,parent_span_id:o,span_id:t,status:a,tags:c,trace_id:n,origin:u})}function u(e){const{traceId:t,spanId:n}=e.spanContext(),r=f(e);return(0,i.$p)(t,n,r)}function l(e){return"number"===typeof e?h(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?h(e.getTime()):(0,s.ph)()}function h(e){return e>9999999999?e/1e3:e}function d(e){return function(e){return"function"===typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"===typeof e.toJSON?e.toJSON():{}}function f(e){const{traceFlags:t}=e.spanContext();return Boolean(t&a)}},73702:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});const r="7.109.0"},42110:function(e,t,n){"use strict";var r=n(50492),i=n(18030),s=n(44755),o=n(47758),a=n(37862),c=n(10274),u=n(34155);function l(e){const t=e?"production":u.env.VERCEL_ENV;return t?`vercel-${t}`:void 0}var h=n(16893),d=n(31302),f=n(88323),p=n(31459),m=n(12563),g=n(48129),y=n(86122);const v={"routing.instrumentation":"next-app-router"};function b(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,o=m.m9.location.pathname;if(n){const n={name:o,op:"pageload",origin:"auto.pageload.nextjs.app_router_instrumentation",tags:v,startTimestamp:g.Z1?g.Z1/1e3:void 0,metadata:{source:"url"}};t=e(n),i(n)}r&&(0,y.U)((n=>{if(void 0!==n.endTimestamp)return;if("GET"!==n.fetchData.method)return;const r=_(n.args);if(null===r)return;const i=r.targetPathname,a={...v,from:o};o=i,t&&t.end();const c={name:i,op:"navigation",origin:"auto.navigation.nextjs.app_router_instrumentation",tags:a,metadata:{source:"url"}};e(c),s(c)}))}function _(e){if(!e[0]||"object"!==typeof e[0]||void 0===e[0].searchParams)return null;
1if(!e[1]||"object"!==typeof e[1]||!("headers"in e[1]))return null;try{const t=e[0],n=e[1].headers;return"1"!==n.RSC||"1"===n["Next-Router-Prefetch"]?null:{targetPathname:t.pathname}}catch(t){return null}}n(47744);var w=n(78161),S=n(32932),k=n(11163),I=n.n(k);const E=m.m9;function T(){let e;const t=E.document.getElementById("__NEXT_DATA__");if(t&&t.innerHTML)try{e=JSON.parse(t.innerHTML)}catch(o){}if(!e)return{};const n={},{page:r,query:i,props:s}=e;return n.route=r,n.params=i,s&&s.pageProps&&(n.sentryTrace=s.pageProps._sentryTraceData,n.baggage=s.pageProps._sentryBaggage),n}const C={"routing.instrumentation":"next-pages-router"};let x,O;const A=(0,a.s3)();function R(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const{route:s,params:o,sentryTrace:c,baggage:u}=T(),{traceparentData:l,dynamicSamplingContext:h,propagationContext:d}=(0,w.KA)(c,u);if((0,a.nZ)().setPropagationContext(d),O=s||E.location.pathname,t){const t=s?"route":"url",n={name:O,op:"pageload",origin:"auto.pageload.nextjs.pages_router_instrumentation",tags:C,startTimestamp:g.Z1?g.Z1/1e3:void 0,...o&&A&&A.getOptions().sendDefaultPii&&{data:o},...l,metadata:{source:t,dynamicSamplingContext:l&&!h?{}:h}};x=e(n),r(n)}n&&I().events.on("routeChangeStart",(t=>{const n=(0,S.rt)(t),r=N(n);let s,o;r?(s=r,o="route"):(s=n,o="url");const a={...C,from:O};O=s,x&&x.end();const c={name:s,op:"navigation",origin:"auto.navigation.nextjs.pages_router_instrumentation",tags:a,metadata:{source:o}},u=e(c);if(i(c),u){const e=u.startChild({op:"ui.nextjs.route-change",origin:"auto.ui.nextjs.pages_router_instrumentation",description:"Next.js Route Change"}),t=()=>{e.end(),I().events.off("routeChangeComplete",t)};I().events.on("routeChangeComplete",t)}}))}function N(e){const t=(E.__BUILD_MANIFEST||{}).sortedPages;if(t)return t.find((t=>{const n=function(e){const t=e.split("/");let n="";t[t.length-1].match(/^\[\[\.\.\..+\]\]$/)&&(t.pop(),n="(?:/(.+?))?");const r=t.map((e=>e.replace(/^\[\.\.\..+\]$/,"(.+?)").replace(/^\[.*\]$/,"([^/]+?)"))).join("/");return new RegExp(`^${r}${n}(?:/)?$`)}(t);return e.match(n)}))}function D(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const s=!m.m9.document.getElementById("__NEXT_DATA__");s?b(e,t,n,r||(()=>{}),i||(()=>{})):R(e,t,n,r||(()=>{}),i||(()=>{}))}class P extends d.gE{constructor(e){super({tracingOrigins:[...f.k3.tracingOrigins,/^(api\/)/],routingInstrumentation:D,...e})}}var L=n(53872);function M(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const t=e[r];"."===t?e.splice(r,1):".."===t?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const F=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function j(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=F.exec(t);return n?n.slice(1):[]}function U(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r="",i=!1;for(let s=t.length-1;s>=-1&&!i;s--){const e=s>=0?t[s]:"/";e&&(r=`${e}/${r}`,i="/"===e.charAt(0))}return r=M(r.split("/").filter((e=>!!e)),!i).join("/"),(i?"/":"")+r||"."}function $(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}function B(e,t){e=U(e).slice(1),t=U(t).slice(1);const n=$(e.split("/")),r=$(t.split("/")),i=Math.min(n.length,r.length);let s=i;for(let a=0;a<i;a++)if(n[a]!==r[a]){s=a;break}let o=[];for(let a=s;a<n.length;a++)o.push("..");return o=o.concat(r.slice(s)),o.join("/")}function V(e,t){let n=j(e)[2];return t&&n.slice(-1*t.length)===t&&(n=n.slice(0,n.length-t.length)),n}const z="RewriteFrames",q=(0,L._I)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.root,n=e.prefix||"app:///",r=e.iteratee||(e=>{if(!e.filename)return e;const r=/^[a-zA-Z]:\\/.test(e.filename)||e.filename.includes("\\")&&!e.filename.includes("/"),i=/^\//.test(e.filename);if(r||i){const i=r?e.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):e.filename,s=t?B(t,i):V(i);e.filename=`${n}${s}`}return e});function i(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map((e=>({...e,...e.stacktrace&&{stacktrace:s(e.stacktrace)}})))}}}catch(t){return e}}function s(e){return{...e,frames:e&&e.frames&&e.frames.map((e=>r(e)))}}return{name:z,setupOnce(){},processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=i(t)),t}}}));(0,L.RN)(z,q);var H=n(71671);const W=H.GLOBAL_OBJ,G=(0,L._I)((e=>{const t=W.__rewriteFramesAssetPrefixPath__||"";return q({iteratee:e=>{try{const{origin:n}=new URL(e.filename);e.filename=(0,h.x)([e,"access",e=>e.filename,"optionalAccess",e=>e.replace,"call",e=>e(n,"app://"),"access",e=>e.replace,"call",e=>e(t,"")])}catch(n){}return e.filename&&e.filename.startsWith("app:///_next")&&(e.filename=decodeURI(e.filename)),e.filename&&e.filename.match(/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/)&&(e.in_app=!1),e},...e})}));var K=n(95625);const X=H.GLOBAL_OBJ;s.jK;function J(e){const t=e.find((e=>"BrowserTracing"===e.name));if(!t)return e;if(function(e){return!!e.afterAllSetup&&!!e.options}(t)){const{options:n}=t;e[e.indexOf(t)]=new P(n)}
1if(!(t instanceof P)){const n=t.options;delete n.routingInstrumentation,delete n.tracingOrigins,e[e.indexOf(t)]=new P(n)}return e}function Y(e){const t=[...(0,c.nV)(e),G()];return("undefined"===typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&(0,i.z)(e)&&t.push(function(e){const t=(0,p.E8)({tracingOrigins:[...f.k3.tracingOrigins,/^(api\/)/],...e,instrumentNavigation:!1,instrumentPageLoad:!1});return{...t,afterAllSetup(n){const r=e=>{(0,p.Wo)(n,e)},i=e=>{(0,p.og)(n,e)};D((()=>{}),!1,(0,h.x)([e,"optionalAccess",e=>e.instrumentNavigation]),r,i),t.afterAllSetup(n),D((()=>{}),(0,h.x)([e,"optionalAccess",e=>e.instrumentPageLoad]),!1,r,i)}}}()),t}var Q=n(25368),Z=window;Z.__sentryRewritesTunnelPath__="/monitoring",Z.SENTRY_RELEASE={id:"83f17ff9e72e1e52e52218cec3ef947dd33c24b3"},Z.__sentryBasePath=void 0,Z.__rewriteFramesAssetPrefixPath__="",function(e){const t={environment:l(!0)||"production",defaultIntegrations:Y(e),...e};!function(e){const{integrations:t}=e;if(!t)return;Array.isArray(t)?e.integrations=J(t):e.integrations=e=>J(t(e))}(t),function(e){const t=X.__sentryRewritesTunnelPath__;if(t&&e.dsn){const n=(0,K.U4)(e.dsn);if(!n)return;const r=n.host.match(/^o(\d+)\.ingest(?:\.([a-z]{2}))?\.sentry\.io$/);if(r){const i=r[1],s=r[2];let o=`${t}?o=${i}&p=${n.projectId}`;s&&(o+=`&r=${s}`),e.tunnel=o}}}(t),(0,r.V)(t,"nextjs",["nextjs","react"]),(0,o.S)(t);const n=(0,a.nZ)();n.setTag("runtime","browser");const i=e=>"transaction"===e.type&&"/404"===e.transaction?null:e;i.id="NextClient404Filter",n.addEventProcessor(i)}({dsn:"https://[email protected]/4506173355589632",tracesSampleRate:1,debug:!1,replaysOnErrorSampleRate:1,replaysSessionSampleRate:.1,integrations:[Q.Li({maskAllText:!1,blockAllMedia:!1})]})},47758:function(e,t,n){"use strict";n.d(t,{S:function(){return s}});var r=n(10274),i=n(50492);function s(e){const t={...e};(0,i.V)(t,"react"),(0,r.S1)(t)}},25368:function(e,t,n){"use strict";n.d(t,{Le:function(){return Rr},Bl:function(){return Dr},Li:function(){return Ar}});var r=n(16893),i=n(37862);function s(e,t){const n=t&&function(e){return void 0!==e.getClient}(t)?t.getClient():t,r=n&&n.getDsn(),i=n&&n.getOptions().tunnel;return function(e,t){return!!t&&e.includes(t.host)}(e,r)||function(e,t){if(!t)return!1;return o(e)===o(t)}(e,i)}function o(e){return"/"===e[e.length-1]?e.slice(0,-1):e}var a=n(16827),c=n(50101),u=n(24385),l=n(90255),h=n(54145),d=n(71671),f=n(93968),p=n(59769),m=n(92353),g=n(48129),y=n(47744),v=n(25439),b=n(38481),_=n(92217),w=n(86122),S=n(63527),k=n(36366),I=n(33002),E=n(96139),T=n(4458),C=n(90654);const x=d.GLOBAL_OBJ,O="sentryReplaySession",A="Unable to send Replay",R=15e4,N=5e3,D=2e7,P=36e5;function L(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.call(t,...r)})),t=void 0)}return n}var M;function F(e){const t=L([e,"optionalAccess",e=>e.host]);return Boolean(L([t,"optionalAccess",e=>e.shadowRoot])===e)}function j(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function U(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,$).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),t):null}catch(n){return null}var t}function $(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=U(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(e.cssText);return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(M||(M={}));class B{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){if(!e)return-1;const t=L([this,"access",e=>e.getMeta,"call",t=>t(e),"optionalAccess",e=>e.id]);return r=()=>-1,null!=(n=t)?n:r();var n,r}
1getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach((e=>this.removeNodeFromMap(e)))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function V(e){let{maskInputOptions:t,tagName:n,type:r}=e;return"OPTION"===n&&(n="SELECT"),Boolean(t[n.toLowerCase()]||r&&t[r]||"password"===r||"INPUT"===n&&!r&&t.text)}function z(e){let{isMasked:t,element:n,value:r,maskInputFn:i}=e,s=r||"";return t?(i&&(s=i(s,n)),"*".repeat(s.length)):s}function q(e){return e.toLowerCase()}function H(e){return e.toUpperCase()}const W="__rrweb_original__";function G(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?q(t):null}function K(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}let X=1;const J=new RegExp("[^a-z0-9-_:]");function Y(){return X++}let Q,Z;const ee=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,te=/^(?:[a-z+]+:)?\/\//i,ne=/^www\..*/i,re=/^(data:)([^,]*),(.*)/i;function ie(e,t){return(e||"").replace(ee,((e,n,r,i,s,o)=>{const a=r||s||o,c=n||i||"";if(!a)return e;if(te.test(a)||ne.test(a))return`url(${c}${a}${c})`;if(re.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const u=t.split("/"),l=a.split("/");u.pop();for(const t of l)"."!==t&&(".."===t?u.pop():u.push(t));return`url(${c}${u.join("/")}${c})`}))}const se=/^[^ \t\n\r\u000c]+/,oe=/^[, \t\n\r\u000c]+/;function ae(e,t){if(!t||""===t.trim())return t;const n=e.createElement("a");return n.href=t,n.href}function ce(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ue(){const e=document.createElement("a");return e.href="",e.href}function le(e,t,n,r,i,s){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?ae(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}const i=[];for(;r(oe),!(n>=t.length);){let s=r(se);if(","===s.slice(-1))s=ae(e,s.substring(0,s.length-1)),i.push(s);else{let r="";s=ae(e,s);let o=!1;for(;;){const e=t.charAt(n);if(""===e){i.push((s+r).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){n+=1,i.push((s+r).trim());break}"("===e&&(o=!0)}r+=e,n+=1}}}return i.join(", ")}(e,r):"style"===n?ie(r,ue()):"object"===t&&"data"===n?ae(e,r):"function"===typeof s?s(n,r,i):r:ae(e,r):r}function he(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function de(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:de(e.parentNode,t,n,r+1):-1}function fe(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"===typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch(i){return!1}}}function pe(e,t,n,r,i,s){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("INPUT"===o.tagName){const e=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let a=-1,c=-1;if(s){if(c=de(o,fe(r,i)),c<0)return!0;a=de(o,fe(t,n),c>=0?c:1/0)}else{if(a=de(o,fe(t,n)),a<0)return!1;c=de(o,fe(r,i),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0)&&!!s}catch(o){}return!!s}function me(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:u,unmaskTextClass:l,maskTextSelector:h,unmaskTextSelector:d,inlineStylesheet:f,maskInputOptions:p={},maskTextFn:m,maskInputFn:g,dataURLOptions:y={}
1,inlineImages:v,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:w=!1}=t,S=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:M.Document,childNodes:[],compatMode:e.compatMode}:{type:M.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:M.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:i,unblockSelector:s,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:u,dataURLOptions:l={},inlineImages:h,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:m,maskAllText:g,maskTextClass:y,unmaskTextClass:v,maskTextSelector:b,unmaskTextSelector:_}=t,w=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"===typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(i){}return!1}(e,r,i,s),S=function(e){if(e instanceof HTMLFormElement)return"form";const t=q(e.tagName);return J.test(t)?"div":t}(e);let k={};const I=e.attributes.length;for(let C=0;C<I;C++){const t=e.attributes[C];t.name&&!he(S,t.name,t.value)&&(k[t.name]=le(n,S,q(t.name),t.value,e,c))}if("link"===S&&o){const t=Array.from(n.styleSheets).find((t=>t.href===e.href));let r=null;t&&(r=U(t)),r&&(delete k.rel,delete k.href,k._cssText=ie(r,t.href))}if("style"===S&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=U(e.sheet);t&&(k._cssText=ie(t,ue()))}if("input"===S||"textarea"===S||"select"===S||"option"===S){const t=e,n=G(t),r=K(t,H(S),n),i=t.checked;if("submit"!==n&&"button"!==n&&r){const e=pe(t,y,b,v,_,V({type:n,tagName:H(S),maskInputOptions:a}));k.value=z({isMasked:e,element:t,value:r,maskInputFn:u})}i&&(k.checked=i)}"option"===S&&(e.selected&&!a.select?k.selected=!0:delete k.selected);if("canvas"===S&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const i=t.getImageData,s=W in i?i.__rrweb_original__:i;if(new Uint32Array(s.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(k.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),n=document.createElement("canvas");n.width=e.width,n.height=e.height;t!==n.toDataURL(l.type,l.quality)&&(k.rr_dataURL=t)}if("img"===S&&h){Q||(Q=n.createElement("canvas"),Z=Q.getContext("2d"));const t=e,r=t.crossOrigin;t.crossOrigin="anonymous";const i=()=>{t.removeEventListener("load",i);try{Q.width=t.naturalWidth,Q.height=t.naturalHeight,Z.drawImage(t,0,0),k.rr_dataURL=Q.toDataURL(l.type,l.quality)}catch(e){console.warn(`Cannot inline img src=${t.currentSrc}! Error: ${e}`)}r?k.crossOrigin=r:t.removeAttribute("crossorigin")};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}"audio"!==S&&"video"!==S||(k.rr_mediaState=e.paused?"paused":"played",k.rr_mediaCurrentTime=e.currentTime);p||(e.scrollLeft&&(k.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(k.rr_scrollTop=e.scrollTop));if(w){const{width:t,height:n}=e.getBoundingClientRect();k={class:k.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==S||f(k.src)||(e.contentDocument||(k.rr_src=k.src),delete k.src);let E;try{customElements.get(S)&&(E=!0)}catch(T){}return{type:M.Element,tagName:S,attributes:k,childNodes:[],isSVG:ce(e)||void 0,needBlock:w,rootId:m,isCustom:E}}(e,{doc:n,blockClass:i,blockSelector:s,unblockSelector:o,inlineStylesheet:f,maskAttributeFn:c,maskInputOptions:p,maskInputFn:g,dataURLOptions:y,inlineImages:v,recordCanvas:b,keepIframeSrcFn:_,newlyAddedElement:w,rootId:S,maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:h,unmaskTextSelector:d});case e.TEXT_NODE:return function(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:i,maskTextSelector:s,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:c,maskInputFn:u,rootId:l}=t,h=e.parentNode&&e.parentNode.tagName;let d=e.textContent;const f="STYLE"===h||void 0,p="SCRIPT"===h||void 0,m="TEXTAREA"===h||void 0;if(f&&d){try{e.nextSibling||e.previousSibling||L([e,"access",e=>e.parentNode,"access",e=>e.sheet,"optionalAccess",e=>e.cssRules])&&(d=U(e.parentNode.sheet))}catch(y){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${y}`,e)}d=ie(d,ue())}p&&(d="SCRIPT_PLACEHOLDER");const g=pe(e,r,s,i,o,n);f||p||m||!d||!g||(d=a?a(d):d.replace(/[\S]/g,"*"));m&&d&&(c.textarea||g)&&(d=u?u(d,e.parentNode):d.replace(/[\S]/g,"*"));if("OPTION"===h&&d){d=z({isMasked:pe(e,r,s,i,o,V({type:null,tagName:h,maskInputOptions:c})),element:e,value:d,maskInputFn:u})}return{type:M.Text,textContent:d||"",isStyle:f,rootId:l}}(e,{maskAllText:a,maskTextClass:u,unmaskTextClass:l,maskTextSelector:h,unmaskTextSelector:d,maskTextFn:m,maskInputOptions:p,maskInputFn:g,rootId:S});case e.CDATA_SECTION_NODE:return{type:M.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:M.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function ge(e){return void 0===e||null===e?"":e.toLowerCase()}function ye(e,t){const{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:d=!1,inl
1ineStylesheet:f=!0,maskInputOptions:p={},maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b={},inlineImages:_=!1,recordCanvas:w=!1,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:I=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:T=5e3,keepIframeSrcFn:C=(()=>!1),newlyAddedElement:x=!1}=t;let{preserveWhiteSpace:O=!0}=t;const A=me(e,{doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,dataURLOptions:b,inlineImages:_,recordCanvas:w,keepIframeSrcFn:C,newlyAddedElement:x});if(!A)return console.warn(e,"not serialized"),null;let R;R=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===M.Comment)return!0;if(e.type===M.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"===typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ge(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ge(e.attributes.name)||"icon"===ge(e.attributes.rel)||"apple-touch-icon"===ge(e.attributes.rel)||"shortcut icon"===ge(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ge(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ge(e.attributes.property).match(/^(og|twitter|fb):/)||ge(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ge(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ge(e.attributes.name)||"googlebot"===ge(e.attributes.name)||"bingbot"===ge(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ge(e.attributes.name)||"generator"===ge(e.attributes.name)||"framework"===ge(e.attributes.name)||"publisher"===ge(e.attributes.name)||"progid"===ge(e.attributes.name)||ge(e.attributes.property).match(/^article:/)||ge(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ge(e.attributes.name)||"yandex-verification"===ge(e.attributes.name)||"csrf-token"===ge(e.attributes.name)||"p:domain_verify"===ge(e.attributes.name)||"verify-v1"===ge(e.attributes.name)||"verification"===ge(e.attributes.name)||"shopify-checkout-api-token"===ge(e.attributes.name)))return!0}}return!1}(A,v)&&(O||A.type!==M.Text||A.isStyle||A.textContent.replace(/^\s+|\s+$/gm,"").length)?Y():-2;const N=Object.assign(A,{id:R});if(r.add(e,N),-2===R)return null;S&&S(e);let D=!d;if(N.type===M.Element){D=D&&!N.needBlock,delete N.needBlock;const t=e.shadowRoot;t&&j(t)&&(N.isShadowHost=!0)}if((N.type===M.Document||N.type===M.Element)&&D){v.headWhitespace&&N.type===M.Element&&"head"===N.tagName&&(O=!1);const t={doc:n,mirror:r,blockClass:i,blockSelector:s,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:d,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:_,recordCanvas:w,preserveWhiteSpace:O,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:C};for(const n of Array.from(e.childNodes)){const e=ye(n,t);e&&N.childNodes.push(e)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=ye(n,t);r&&(j(e.shadowRoot)&&(r.isShadow=!0),N.childNodes.push(r))}}return e.parentNode&&F(e.parentNode)&&j(e.parentNode)&&(N.isShadow=!0),N.type===M.Element&&"iframe"===N.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let i,s=!1;try{i=r.document.readyState}catch(a){return}if("complete"!==i){const r=setTimeout((()=>{s||(t(),s=!0)}),n);return void e.addEventListener("load",(()=>{clearTimeout(r),s=!0,t()}))}const o="about:blank";if(r.location.href!==o||e.src===o||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,(()=>{const t=e.contentDocument;if(t&&k){const n=ye(t,{doc:t,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:_,recordCanvas:w,preserveWhiteSpace:O,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:C});n&&k(e,n)}}),I),N.type===M.Element&&"link"===N.tagName&&"stylesheet"===N.attributes.rel&&function(e,t,n){let r,i=!1;try{r=e.sheet}catch(o){return}if(r)return;const s=setTimeout((()=>{i||(t(),i=!0)}),n);e.addEventListener("load",(()=>{clearTimeout(s),i=!0,t()}))}(e,(()=>{if(E){const t=ye(e,{doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:u,maskTextSelector:l,unmaskTextSelector:h,skipChild:!1,inlineStylesheet:f,maskInputOptions:p,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:b,inlineImages:_,recordCanvas:w,preserveWhiteSpace:O,onSerialize:S,onIframeLoad:k,iframeLoadTimeout:I,onStylesheetLoad:E,stylesheetLoadTimeout:T,keepIframeSrcFn:C});t&&E(e,t)}}),T),N}function ve(e,t){const{mirror:n=new B,blockClass:r="rr-block",blockSelector:i=null,unblockSelector:s=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:u=null,unmaskTextSelector:l=null,inlineStylesheet:h=!0,inl
1ineImages:d=!1,recordCanvas:f=!1,maskAllInputs:p=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOM:v=!1,dataURLOptions:b,preserveWhiteSpace:_,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:I,stylesheetLoadTimeout:E,keepIframeSrcFn:T=(()=>!1)}=t||{};return ye(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:u,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===p?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===p?{}:p,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===v?{}:v,dataURLOptions:b,inlineImages:d,recordCanvas:f,preserveWhiteSpace:_,onSerialize:w,onIframeLoad:S,iframeLoadTimeout:k,onStylesheetLoad:I,stylesheetLoadTimeout:E,keepIframeSrcFn:T,newlyAddedElement:!1})}function be(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.call(t,...r)})),t=void 0)}return n}function _e(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const we="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Se={map:{},getId:()=>(console.error(we),-1),getNode:()=>(console.error(we),null),removeNodeFromMap(){console.error(we)},has:()=>(console.error(we),!1),reset(){console.error(we)}};function ke(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,i=0;return function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];const c=Date.now();i||!1!==n.leading||(i=c);const u=t-(c-i),l=this;u<=0||u>t?(r&&(clearTimeout(r),r=null),i=c,e.apply(l,o)):r||!1===n.trailing||(r=setTimeout((()=>{i=!1===n.leading?0:Date.now(),r=null,e.apply(l,o)}),u))}}function Ie(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;const s=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout((()=>{n.set.call(this,e)}),0),s&&s.set&&s.set.call(this,e)}}),()=>Ie(e,t,s||{},!0)}function Ee(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return"function"===typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch(r){return()=>{}}}window.Proxy&&window.Reflect&&(Se=new Proxy(Se,{get:(e,t,n)=>("map"===t&&console.error(we),Reflect.get(e,t,n))}));let Te,Ce=Date.now;function xe(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:be([t,"optionalAccess",e=>e.documentElement,"access",e=>e.scrollLeft])||be([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.parentElement,"optionalAccess",e=>e.scrollLeft])||be([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.scrollLeft])||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:be([t,"optionalAccess",e=>e.documentElement,"access",e=>e.scrollTop])||be([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.parentElement,"optionalAccess",e=>e.scrollTop])||be([t,"optionalAccess",e=>e.body,"optionalAccess",e=>e.scrollTop])||0}}function Oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ae(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Re(e,t,n,r,i){if(!e)return!1;const s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!s)return!1;const o=fe(t,n);if(!i){const e=r&&s.matches(r);return o(s)&&!e}const a=de(s,o);let c=-1;return!(a<0)&&(r&&(c=de(s,fe(null,r))),a>-1&&c<0||a<c)}function Ne(e,t){return-2===t.getId(e)}function De(e,t){if(F(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||De(e.parentNode,t))}function Pe(e){return Boolean(e.changedTouches)}function Le(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;if("NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),!Node.prototype.contains){var t=this;Node.prototype.contains=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];let i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(t===i)return!0}while(i=i&&i.parentNode);return!1}}}
1function Me(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Fe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function je(e){return Boolean(be([e,"optionalAccess",e=>e.shadowRoot]))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ce=()=>(new Date).getTime());class Ue{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return t=this.styleIDMap.get(e),n=()=>-1,null!=t?t:n();var t,n}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function $e(e){let t=null;return be([e,"access",e=>e.getRootNode,"optionalCall",e=>e(),"optionalAccess",e=>e.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function Be(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=$e(n);)n=t;return n}(e);return t.contains(n)}function Ve(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||Be(e))}function ze(){if(Te)return Te;const e=window.document;let t=window.requestAnimationFrame;if(e&&"function"===typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.requestAnimationFrame&&(t=r.requestAnimationFrame),e.head.removeChild(n)}catch(n){}return Te=t.bind(window)}var qe=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(qe||{}),He=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(He||{}),We=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(We||{}),Ge=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ge||{});function Ke(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.call(t,...r)})),t=void 0)}return n}function Xe(e){return"__ln"in e}class Je{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=Ke([t,"optionalAccess",e=>e.next])||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Xe(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Xe(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Ye=(e,t)=>
1`${e}@${t}`;class Qe{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Je,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{if(!i.parentNode||!Ve(i))return;const s=F(i.parentNode)?this.mirror.getId($e(i)):this.mirror.getId(i.parentNode),o=r(i);if(-1===s||-1===o)return n.addNode(i);const a=ye(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Me(e,this.mirror)&&this.iframeManager.addIframe(e),Fe(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),je(i)&&this.shadowDomManager.addShadowRoot(i.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});a&&(e.push({parentId:s,nextId:o,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)et(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)nt(this.droppedSet,a)||et(this.removes,a,this.mirror)?nt(this.movedSet,a)?i(a):this.droppedSet.add(a):i(a);let s=null;for(;n.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),n=r(s.value);-1!==t&&-1!==n&&(e=s)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}s=e.previous,n.removeNode(e.value),i(e.value)}const o={texts:this.texts.map((e=>({id:this.mirror.getId(e.node),value:e.value}))).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:t}=e;if("string"===typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}})).filter((e=>!t.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(Ne(e.target,this.mirror))return;let t;try{t=document.implementation.createHTMLDocument()}catch(n){t=this.doc}switch(e.type){case"characterData":{const t=e.target.textContent;Re(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:pe(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if("value"===r){const t=G(n),r=n.tagName;i=K(n,r,t);const s=V({maskInputOptions:this.maskInputOptions,tagName:r,type:t});i=z({isMasked:pe(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,s),element:n,value:i,maskInputFn:this.maskInputFn})}if(Re(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||i===e.oldValue)return;let s=this.attributes.find((t=>t.node===e.target));if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(i)){if(n.contentDocument)return;r="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!he(n.tagName,r)&&(s.attributes[r]=le(this.doc,q
1(n.tagName),q(r),i,n,this.maskAttributeFn),"style"===r)){const r=t.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),i=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||i!==r.style.getPropertyPriority(e)?s.styleDiff[e]=""===i?t:[t,i]:s._unchangedStyles[e]=[t,i]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}break}case"childList":if(Re(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach((t=>this.genAdds(t,e.target))),e.removedNodes.forEach((t=>{const n=this.mirror.getId(t),r=F(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Re(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||Ne(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ze(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||De(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ye(n,r)]?Ze(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!F(e.target)||!j(e.target))||void 0})),this.mapRemoves.push(t))}))}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ne(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ye(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Re(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),je(e)&&e.shadowRoot.childNodes.forEach((t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)})))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((t=>{this[t]=e[t]}))}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ze(e,t){e.delete(t),t.childNodes.forEach((t=>Ze(e,t)))}function et(e,t,n){return 0!==e.length&&tt(e,t,n)}function tt(e,t,n){const{parentNode:r}=t;if(!r)return!1;const i=n.getId(r);return!!e.some((e=>e.id===i))||tt(e,r,n)}function nt(e,t){return 0!==e.size&&rt(e,t)}function rt(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||rt(e,n))}let it;function st(e){it=e}function ot(){it=void 0}const at=e=>{if(!it)return e;return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e(...n)}catch(i){if(it&&!0===it(i))return()=>{};throw i}}};function ct(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.call(t,...r)})),t=void 0)}return n}const ut=[];function lt(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(t){}return e&&e.target}function ht(e,t){const n=new Qe;ut.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const i=ct([window,"optionalAccess",e=>e.Zone,"optionalAccess",e=>e.__symbol__,"optionalCall",e=>e("MutationObserver")]);i&&window[i]&&(r=window[i]);const s=new r(at((t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)})));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function dt(e){let{mousemoveCb:t,sampling:n,doc:r,mirror:i}=e;if(!1===n.mousemove)return()=>{};const s="number"===typeof n.mousemove?n.mousemove:50,o="number"===typeof n.mousemoveCallback?n.mousemoveCallback:500;let a,c=[];const u=ke(at((e=>{const n=Date.now()-a;t(c.map((e=>(e.timeOffset-=n,e))),e),c=[],a=null})),o),l=at(ke(at((e=>{const t=lt(e),{clientX:n,clientY:r}=Pe(e)?e.changedTouches[0]:e;a||(a=Ce()),c.push({x:n,y:r,id:i.getId(t),timeOffset:Ce()-a}),u("undefined"!==typeof DragEvent&&e instanceof DragEvent?He.Drag:e instanceof MouseEvent?He.MouseMove:He.TouchMove)})),s,{trailing:!1})),h=[_e("mousemove",l,r),_e("touchmove",l,r),_e("drag",l,r)];return at((()=>{h.forEach((e=>e()))}))}function ft(e){let{mouseInteractionCb:t,doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,sampling:a}=e;if(!1===a.mouseInteraction)return()=>{};const c=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,u=[];let l=null;return Object.keys(We).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==c[e])).forEac
1h((e=>{let a=q(e);const c=(e=>n=>{const a=lt(n);if(Re(a,i,s,o,!0))return;let c=null,u=e;if("pointerType"in n){switch(n.pointerType){case"mouse":c=Ge.Mouse;break;case"touch":c=Ge.Touch;break;case"pen":c=Ge.Pen}c===Ge.Touch?We[e]===We.MouseDown?u="TouchStart":We[e]===We.MouseUp&&(u="TouchEnd"):Ge.Pen}else Pe(n)&&(c=Ge.Touch);null!==c?(l=c,(u.startsWith("Touch")&&c===Ge.Touch||u.startsWith("Mouse")&&c===Ge.Mouse)&&(c=null)):We[e]===We.Click&&(c=l,l=null);const h=Pe(n)?n.changedTouches[0]:n;if(!h)return;const d=r.getId(a),{clientX:f,clientY:p}=h;at(t)({type:We[u],id:d,x:f,y:p,...null!==c&&{pointerType:c}})})(e);if(window.PointerEvent)switch(We[e]){case We.MouseDown:case We.MouseUp:a=a.replace("mouse","pointer");break;case We.TouchStart:case We.TouchEnd:return}u.push(_e(a,c,n))})),at((()=>{u.forEach((e=>e()))}))}function pt(e){let{scrollCb:t,doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,sampling:a}=e;return _e("scroll",at(ke(at((e=>{const a=lt(e);if(!a||Re(a,i,s,o,!0))return;const c=r.getId(a);if(a===n&&n.defaultView){const e=xe(n.defaultView);t({id:c,x:e.left,y:e.top})}else t({id:c,x:a.scrollLeft,y:a.scrollTop})})),a.scroll||100)),n)}function mt(e,t){let{viewportResizeCb:n}=e,{win:r}=t,i=-1,s=-1;return _e("resize",at(ke(at((()=>{const e=Oe(),t=Ae();i===e&&s===t||(n({width:Number(t),height:Number(e)}),i=e,s=t)})),200)),r)}const gt=["INPUT","TEXTAREA","SELECT"],yt=new WeakMap;function vt(e){let{inputCb:t,doc:n,mirror:r,blockClass:i,blockSelector:s,unblockSelector:o,ignoreClass:a,ignoreSelector:c,maskInputOptions:u,maskInputFn:l,sampling:h,userTriggeredOnInput:d,maskTextClass:f,unmaskTextClass:p,maskTextSelector:m,unmaskTextSelector:g}=e;function y(e){let t=lt(e);const r=e.isTrusted,h=t&&H(t.tagName);if("OPTION"===h&&(t=t.parentElement),!t||!h||gt.indexOf(h)<0||Re(t,i,s,o,!0))return;const y=t;if(y.classList.contains(a)||c&&y.matches(c))return;const b=G(t);let _=K(y,h,b),w=!1;const S=V({maskInputOptions:u,tagName:h,type:b}),k=pe(t,f,m,p,g,S);"radio"!==b&&"checkbox"!==b||(w=t.checked),_=z({isMasked:k,element:t,value:_,maskInputFn:l}),v(t,d?{text:_,isChecked:w,userTriggered:r}:{text:_,isChecked:w});const I=t.name;"radio"===b&&I&&w&&n.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach((e=>{if(e!==t){const t=z({isMasked:k,element:e,value:K(e,h,b),maskInputFn:l});v(e,d?{text:t,isChecked:!w,userTriggered:!1}:{text:t,isChecked:!w})}}))}function v(e,n){const i=yt.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){yt.set(e,n);const i=r.getId(e);at(t)({...n,id:i})}}const b=("last"===h.input?["change"]:["input","change"]).map((e=>_e(e,at(y),n))),_=n.defaultView;if(!_)return()=>{b.forEach((e=>e()))};const w=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),S=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return w&&w.set&&b.push(...S.map((e=>Ie(e[0],e[1],{set(){at(y)({target:this,isTrusted:!1})}},!1,_)))),at((()=>{b.forEach((e=>e()))}))}function bt(e){return function(e,t){if(Ot("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ot("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ot("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ot("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function _t(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function wt(e,t){let{styleSheetRuleCb:n,mirror:r,stylesheetManager:i}=e,{win:s}=t;if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const o=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:at(((e,t,s)=>{const[o,a]=s,{id:c,styleId:u}=_t(t,r,i.styleMirror);return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,adds:[{rule:o,index:a}]}),e.apply(t,s)}))});const a=s.CSSStyleSheet.prototype.deleteRule;
1let c,u;s.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:at(((e,t,s)=>{const[o]=s,{id:a,styleId:c}=_t(t,r,i.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,removes:[{index:o}]}),e.apply(t,s)}))}),s.CSSStyleSheet.prototype.replace&&(c=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(c,{apply:at(((e,t,s)=>{const[o]=s,{id:a,styleId:c}=_t(t,r,i.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,replace:o}),e.apply(t,s)}))})),s.CSSStyleSheet.prototype.replaceSync&&(u=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:at(((e,t,s)=>{const[o]=s,{id:a,styleId:c}=_t(t,r,i.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,replaceSync:o}),e.apply(t,s)}))}));const l={};At("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(At("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),At("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),At("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const h={};return Object.entries(l).forEach((e=>{let[t,s]=e;h[t]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(h[t].insertRule,{apply:at(((e,t,s)=>{const[o,a]=s,{id:c,styleId:u}=_t(t.parentStyleSheet,r,i.styleMirror);return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,adds:[{rule:o,index:[...bt(t),a||0]}]}),e.apply(t,s)}))}),s.prototype.deleteRule=new Proxy(h[t].deleteRule,{apply:at(((e,t,s)=>{const[o]=s,{id:a,styleId:c}=_t(t.parentStyleSheet,r,i.styleMirror);return(a&&-1!==a||c&&-1!==c)&&n({id:a,styleId:c,removes:[{index:[...bt(t),o]}]}),e.apply(t,s)}))})})),at((()=>{s.CSSStyleSheet.prototype.insertRule=o,s.CSSStyleSheet.prototype.deleteRule=a,c&&(s.CSSStyleSheet.prototype.replace=c),u&&(s.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach((e=>{let[t,n]=e;n.prototype.insertRule=h[t].insertRule,n.prototype.deleteRule=h[t].deleteRule}))}))}function St(e,t){let{mirror:n,stylesheetManager:r}=e,i=null;i="#document"===t.nodeName?n.getId(t):n.getId(t.host);const s="#document"===t.nodeName?ct([t,"access",e=>e.defaultView,"optionalAccess",e=>e.Document]):ct([t,"access",e=>e.ownerDocument,"optionalAccess",e=>e.defaultView,"optionalAccess",e=>e.ShadowRoot]),o=ct([s,"optionalAccess",e=>e.prototype])?Object.getOwnPropertyDescriptor(ct([s,"optionalAccess",e=>e.prototype]),"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&s&&o?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get(){return ct([o,"access",e=>e.get,"optionalAccess",e=>e.call,"call",e=>e(this)])},set(e){const t=ct([o,"access",e=>e.set,"optionalAccess",e=>e.call,"call",t=>t(this,e)]);if(null!==i&&-1!==i)try{r.adoptStyleSheets(e,i)}catch(n){}return t}}),at((()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})}))):()=>{}}function kt(e,t){let{styleDeclarationCb:n,mirror:r,ignoreCSSAttributes:i,stylesheetManager:s}=e,{win:o}=t;const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:at(((e,t,o)=>{const[c,u,l]=o;if(i.has(c))return a.apply(t,[c,u,l]);const{id:h,styleId:d}=_t(ct([t,"access",e=>e.parentRule,"optionalAccess",e=>e.parentStyleSheet]),r,s.styleMirror);return(h&&-1!==h||d&&-1!==d)&&n({id:h,styleId:d,set:{property:c,value:u,priority:l},index:bt(t.parentRule)}),e.apply(t,o)}))});const c=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:at(((e,t,o)=>{const[a]=o;if(i.has(a))return c.apply(t,[a]);const{id:u,styleId:l}=_t(ct([t,"access",e=>e.parentRule,"optionalAccess",e=>e.parentStyleSheet]),r,s.styleMirror);return(u&&-1!==u||l&&-1!==l)&&n({id:u,styleId:l,remove:{property:a},index:bt(t.parentRule)}),e.apply(t,o)}))}),at((()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=c}))}function It(e){let{mediaInteractionCb:t,blockClass:n,blockSelector:r,unblockSelector:i,mirror:s,sampling:o,doc:a}=e;const c=at((e=>ke(at((o=>{const a=lt(o);if(!a||Re(a,n,r,i,!0))return;const{currentTime:c,volume:u,muted:l,playbackRate:h}=a;t({type:e,id:s.getId(a),currentTime:c,volume:u,muted:l,playbackRate:h})})),o.media||500))),u=[_e("play",c(0),a),_e("pause",c(1),a),_e("seeked",c(2),a),_e("volumechange",c(3),a),_e("ratechange",c(4),a)];return at((()=>{u.forEach((e=>e()))}))}function Et(e){let{fontCb:t,doc:n}=e;const r=n.defaultView;if(!r)return()=>{};const i=[],s=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,n){const r=new o(e,t,n);return s.set(r,{family:e,buffer:"string"!==typeof t,descriptors:n,fontSource:"string"===typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const a=Ee(n.fonts,"add",(function(e){return function(n){return setTimeout(at((()=>{const e=s.get(n);e&&(t(e),s.delete(n))})),0),e.apply(this,[n])}}));return i.push((()=>{r.FontFace=o})),i.push(a),at((()=>
1{i.forEach((e=>e()))}))}function Tt(e){const{doc:t,mirror:n,blockClass:r,blockSelector:i,unblockSelector:s,selectionCb:o}=e;let a=!0;const c=at((()=>{const e=t.getSelection();if(!e||a&&ct([e,"optionalAccess",e=>e.isCollapsed]))return;a=e.isCollapsed||!1;const c=[],u=e.rangeCount||0;for(let t=0;t<u;t++){const o=e.getRangeAt(t),{startContainer:a,startOffset:u,endContainer:l,endOffset:h}=o;Re(a,r,i,s,!0)||Re(l,r,i,s,!0)||c.push({start:n.getId(a),startOffset:u,end:n.getId(l),endOffset:h})}o({ranges:c})}));return c(),_e("selectionchange",c)}function Ct(e){let{doc:t,customElementCb:n}=e;const r=t.defaultView;if(!r||!r.customElements)return()=>{};return Ee(r.customElements,"define",(function(e){return function(t,r,i){try{n({define:{name:t}})}catch(s){}return e.apply(this,[t,r,i])}}))}function xt(e){const t=e.doc.defaultView;if(!t)return()=>{};const n=ht(e,e.doc),r=dt(e),i=ft(e),s=pt(e),o=mt(e,{win:t}),a=vt(e),c=It(e),u=wt(e,{win:t}),l=St(e,e.doc),h=kt(e,{win:t}),d=e.collectFonts?Et(e):()=>{},f=Tt(e),p=Ct(e),m=[];for(const g of e.plugins)m.push(g.observer(g.callback,t,g.options));return at((()=>{ut.forEach((e=>e.reset())),n.disconnect(),r(),i(),s(),o(),a(),c(),u(),l(),h(),d(),f(),p(),m.forEach((e=>e()))}))}function Ot(e){return"undefined"!==typeof window[e]}function At(e){return Boolean("undefined"!==typeof window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Rt{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const i=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),s.set(o,t)),o}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map((t=>this.getId(e,t,n,r)))}
1getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!==typeof t)return t;const i=r.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map((t=>this.getRemoteId(e,t,n)))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}function Nt(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.call(t,...r)})),t=void 0)}return n}class Dt{constructor(){this.crossOriginIframeMirror=new Rt(Y),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Pt{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Rt(Y),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Rt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),Nt([this,"access",e=>e.loadListener,"optionalCall",t=>t(e)]),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case qe.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:qe.IncrementalSnapshot,data:{source:He.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case qe.Meta:case qe.Load:case qe.DomContentLoaded:return!1;case qe.Plugin:return t;case qe.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case qe.IncrementalSnapshot:switch(t.data.source){case He.Mutation:return t.data.adds.forEach((t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((t=>{this.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((t=>{this.replaceIds(t,e,["id"])})),t.data.texts.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case He.Drag:case He.TouchMove:case He.MouseMove:return t.data.positions.forEach((t=>{this.replaceIds(t,e,["id"])})),t;case He.ViewportResize:return!1;case He.MediaInteraction:case He.MouseInteraction:case He.Scroll:case He.CanvasMutation:case He.Input:return this.replaceIds(t.data,e,["id"]),t;case He.StyleSheetRule:case He.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case He.Font:return t;
1case He.Selection:return t.data.ranges.forEach((t=>{this.replaceIds(t,e,["start","end"])})),t;case He.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),Nt([t,"access",e=>e.data,"access",e=>e.styles,"optionalAccess",e=>e.forEach,"call",t=>t((t=>{this.replaceStyleIds(t,e,["styleId"])}))]),t}}return!1}replace(e,t,n,r){for(const i of r)(Array.isArray(t[i])||"number"===typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,t)}))}patchRootIdOnNode(e,t){e.type===M.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,t)}))}}class Lt{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Mt{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!j(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=ht({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>n.disconnect())),this.restoreHandlers.push(pt({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(St({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Ee(e.prototype,"attachShadow",(function(e){return function(r){const i=e.call(this,r);return this.shadowRoot&&Ve(this)&&n.addShadowRoot(this.shadowRoot,t),i}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch(t){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class Ft{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}}class jt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ue,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const i of e){let e;this.styleMirror.has(i)?e=this.styleMirror.getId(i):(e=this.styleMirror.add(i),r.push({styleId:e,rules:Array.from(i.rules||CSSRule,((e,t)=>({rule:$(e),index:t})))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ut{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ze()(...t)}((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function $t(e){const t=e;return t.timestamp=Ce(),t}let Bt;const Vt=new B;function zt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:o=null,unblockSelector:a=null,ignoreClass:c="rr-ignore",ignoreSelector:u=null,maskAllText:l=!1,maskTextClass:h="rr-mask",unmaskTextClass:d=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:m=!0,maskAllInputs:g,maskInputOptions:y,slimDOMOptions:v,maskAttributeFn:b,maskInputFn:_,maskTextFn:w,packFn:S,sampling:k={},dataURLOptions:I={},mousemoveWait:E,recordCanvas:T=!1,recordCrossOriginIframes:C=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:A=!1,inlineImages:R=!1,plugins:N,keepIframeSrcFn:D=(()=>!1),ignoreCSSAttributes:P=new Set([]),errorHandler:L,onMutation:M,getCanvasManager:F}=e;st(L);const j=!C||window.parent===window;let U=!1;if(!j)try{window.parent.document&&(U=!1)}catch(ne){U=!0}if(j&&!t)throw new Error("emit function is required");
1void 0!==E&&void 0===k.mousemove&&(k.mousemove=E),Vt.reset();const $=!0===g?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==y?y:{},B=!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===v,headMetaDescKeywords:"all"===v}:v||{};let V;Le();let z=0;const q=e=>{for(const t of N||[])t.eventProcessor&&(e=t.eventProcessor(e));return S&&!U&&(e=S(e)),e},H=(e,s)=>{if(!(0,r.x)([ut,"access",e=>e[0],"optionalAccess",e=>e.isFrozen,"call",e=>e()])||e.type===qe.FullSnapshot||e.type===qe.IncrementalSnapshot&&e.data.source===He.Mutation||ut.forEach((e=>e.unfreeze())),j)(0,r.x)([t,"optionalCall",t=>t(q(e),s)]);else if(U){const t={type:"rrweb",event:q(e),origin:window.location.origin,isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===qe.FullSnapshot)V=e,z=0;else if(e.type===qe.IncrementalSnapshot){if(e.data.source===He.Mutation&&e.data.isAttachIframe)return;z++;const t=i&&z>=i,r=n&&V&&e.timestamp-V.timestamp>n;(t||r)&&te(!0)}},W=e=>{H($t({type:qe.IncrementalSnapshot,data:{source:He.Mutation,...e}}))},G=e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.Scroll,...e}})),K=e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.CanvasMutation,...e}})),X=e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.AdoptedStyleSheet,...e}})),J=new jt({mutationCb:W,adoptedStyleSheetCb:X}),Y="boolean"===typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new Dt:new Pt({mirror:Vt,mutationCb:W,stylesheetManager:J,recordCrossOriginIframes:C,wrappedEmit:H});for(const r of N||[])r.getMirror&&r.getMirror({nodeMirror:Vt,crossOriginIframeMirror:Y.crossOriginIframeMirror,crossOriginIframeStyleMirror:Y.crossOriginIframeStyleMirror});const Q=new Ut,Z=qt(F,{mirror:Vt,win:window,mutationCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.CanvasMutation,...e}})),recordCanvas:T,blockClass:s,blockSelector:o,unblockSelector:a,sampling:k.canvas,dataURLOptions:I,errorHandler:L}),ee="boolean"===typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Lt:new Mt({mutationCb:W,scrollCb:G,bypassOptions:{onMutation:M,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:l,maskTextClass:h,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskInputOptions:$,dataURLOptions:I,maskAttributeFn:b,maskTextFn:w,maskInputFn:_,recordCanvas:T,inlineImages:R,sampling:k,slimDOMOptions:B,iframeManager:Y,stylesheetManager:J,canvasManager:Z,keepIframeSrcFn:D,processedNodeManager:Q},mirror:Vt}),te=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];H($t({type:qe.Meta,data:{href:window.location.href,width:Ae(),height:Oe()}}),e),J.reset(),ee.init(),ut.forEach((e=>e.lock()));const t=ve(document,{mirror:Vt,blockClass:s,blockSelector:o,unblockSelector:a,maskAllText:l,maskTextClass:h,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:m,maskAllInputs:$,maskAttributeFn:b,maskInputFn:_,maskTextFn:w,slimDOM:B,dataURLOptions:I,recordCanvas:T,inlineImages:R,onSerialize:e=>{Me(e,Vt)&&Y.addIframe(e),Fe(e,Vt)&&J.trackLinkElement(e),je(e)&&ee.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{Y.attachIframe(e,t),ee.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{J.attachLinkElement(e,t)},keepIframeSrcFn:D});if(!t)return console.warn("Failed to snapshot the document");H($t({type:qe.FullSnapshot,data:{node:t,initialOffset:xe(window)}})),ut.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&J.adoptStyleSheets(document.adoptedStyleSheets,Vt.getId(document))};Bt=te;try{const e=[],t=e=>at(xt)({onMutation:M,mutationCb:W,mousemoveCb:(e,t)=>H($t({type:qe.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.MouseInteraction,...e}})),scrollCb:G,viewportResizeCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.ViewportResize,...e}})),inputCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.Input,...e}})),mediaInteractionCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.MediaInteraction,...e}})),styleSheetRuleCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.StyleSheetRule,...e}})),styleDeclarationCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.StyleDeclaration,...e}})),canvasMutationCb:K,fontCb:e=>H($t({type:qe.IncrementalSnapshot,data:{source:He.Font,...e}})),selectionCb:e=>{H($t({type:qe.IncrementalSnapshot,data:{source:He.Selection,...e}}))},customElementCb:e=>{H($t({type:qe.IncrementalSnapshot,data:{source:He.CustomElement,...e}}))},blockClass:s,ignoreClass:c,ignoreSelector:u,maskAllText:l,maskTextClass:h,unmaskTextClass:d,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:$,inlineStylesheet:m,sampling:k,recordCanvas:T,inlineImages:R,userTr
1iggeredOnInput:O,collectFonts:A,doc:e,maskAttributeFn:b,maskInputFn:_,maskTextFn:w,keepIframeSrcFn:D,blockSelector:o,unblockSelector:a,slimDOMOptions:B,dataURLOptions:I,mirror:Vt,iframeManager:Y,stylesheetManager:J,shadowDomManager:ee,processedNodeManager:Q,canvasManager:Z,ignoreCSSAttributes:P,plugins:(0,r.x)([N,"optionalAccess",e=>e.filter,"call",e=>e((e=>e.observer)),"optionalAccess",e=>e.map,"call",e=>e((e=>({observer:e.observer,options:e.options,callback:t=>H($t({type:qe.Plugin,data:{plugin:e.name,payload:t}}))})))])||[]},{});Y.addLoadListener((n=>{try{e.push(t(n.contentDocument))}catch(r){console.warn(r)}}));const n=()=>{te(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(_e("DOMContentLoaded",(()=>{H($t({type:qe.DomContentLoaded,data:{}})),"DOMContentLoaded"===x&&n()}))),e.push(_e("load",(()=>{H($t({type:qe.Load,data:{}})),"load"===x&&n()}),window))),()=>{e.forEach((e=>e())),Q.destroy(),Bt=void 0,ot()}}catch(re){console.warn(re)}}function qt(e,t){try{return e?e(t):new Ft}catch(n){return console.warn("Unable to initialize CanvasManager"),new Ft}}zt.mirror=Vt,zt.takeFullSnapshot=function(e){if(!Bt)throw new Error("please take full snapshot after start recording");Bt(e)};function Ht(e){return e>9999999999?e:1e3*e}function Wt(e){return e>9999999999?e/1e3:e}function Gt(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate((()=>(e.throttledAddEvent({type:qe.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:(0,f.Fv)(t,10,1e3)}}),"console"===t.category))))}function Kt(e){return e.closest("button,a")||e}function Xt(e){const t=Jt(e);return t&&t instanceof Element?Kt(t):t}function Jt(e){return function(e){return"object"===typeof e&&!!e&&"target"in e}(e)?e.target:e}let Yt;function Qt(e){return Yt||(Yt=[],(0,p.hl)(x,"open",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(Yt)try{Yt.forEach((e=>e()))}catch(i){}return e.apply(x,n)}}))),Yt.push(e),()=>{const t=Yt?Yt.indexOf(e):-1;t>-1&&Yt.splice(t,1)}}class Zt{constructor(e,t,n=Gt){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=Qt((()=>{this._lastMutation=tn()}));this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){if(!en.includes(e.tagName))return!0;if("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||""))return!0;if("A"===e.tagName&&(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))return!0;if(t&&e.matches(t))return!0;return!1}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!==typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:Wt(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some((e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1))||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this._lastMutation=Wt(e)}registerScroll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this._lastScroll=Wt(e)}registerClick(e){const t=Kt(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach((e=>{e.clickCount++}))}_getClicks(e){return this._clicks.filter((t=>t.node===e))}_checkClicks(){const e=[],t=tn();this._clicks.forEach((n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)}));for(const n of e){const e=this._clicks.indexOf(n);e>-1&&(this._generateBreadcrumbs(n),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,i=!n&&!r,{clickCount:s,clickBreadcrumb:o}=e;if(i){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",i={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:x.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:s||1}};this._addBreadcrumbEvent(t,i)}else if(s>1){const e={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:x.location.href,route:t.getCurrentRoute(),clickCount:s,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout((()=>this._checkClicks()),1e3)}}const en=["A","BUTTON","INPUT"];function tn(){return Date.now()/1e3}function nn(e,t){try{if(!function(e){return 3===e.type}(t))return;const{source:n}=t.data;if(n===He.Mutation&&e.registerMutation(t.timestamp),n===He.Scroll&&e.registerScroll(t.timestamp),function(e){return e.data.source===He.MouseInteraction}(t)){const{type:n,id:r}=t.data,i=zt.mirror.getNode(r);i instanceof HTMLElement&&n===We.Click&&e.registerClick(i)}}catch(n){}}function rn(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var sn;!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(sn||(sn={}));const on=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function an(e){const t={};for(const n in e)if(on.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}const cn=e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,r=null;try{r=t?Xt(e.event):Jt(e.event),n=(0,m.Rt)(r,{maxStringLength:200})||"<unknown>"}catch(i){n="<unknown>"}return{target:r,message:n}}(e);return rn({category:`ui.${e.name}`,...un(t,n)})}(t);if(!n)return;const r="click"===t.name,i=r?t.event:void 0;!(r&&e.clickDetector&&i&&i.target)||i.altKey||i.metaKey||i.ctrlKey||i.shiftKey||function(e,t,n){e.handleClick(t,n)}(e.clickDetector,n,Xt(t.event)),Gt(e,n)};function un(e,t){const n=zt.mirror.getId(e),r=n&&zt.mirror.getNode(n),i=r&&zt.mirror.getMeta(r),s=i&&function(e){return e.type===sn.Element}(i)?i:null;return{message:t,data:s?{nodeId:n,node:{id:n,tagName:s.tagName,textContent:Array.from(s.childNodes).map((e=>
1e.type===sn.Text&&e.textContent)).filter(Boolean).map((e=>e.trim())).join(""),attributes:an(s.attributes)}}:{}}}function ln(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:s,target:o}=e;if(!o||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(o)||!s)return null;const a=t||r||i,c=1===s.length;if(!a&&c)return null;const u=(0,m.Rt)(o,{maxStringLength:200})||"<unknown>",l=un(o,u);return rn({category:"ui.keyDown",message:u,data:{...l.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:i,key:s}})}(t);n&&Gt(e,n)}const hn={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:i,startTime:s,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:u}=e;if(["fetch","xmlhttprequest"].includes(n))return null;return{type:`${t}.${n}`,start:fn(s),end:fn(i),name:r,data:{size:u,statusCode:c,decodedBodySize:o,encodedBodySize:a}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:i}=e,s=fn(i);return{type:n,name:r,start:s,end:s+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:i,domComplete:s,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:u,loadEventStart:l,loadEventEnd:h,redirectCount:d,startTime:f,transferSize:p,type:m}=e;if(0===i)return null;return{type:`${t}.${m}`,start:fn(f),end:fn(s),name:n,data:{size:p,decodedBodySize:r,encodedBodySize:o,duration:i,domInteractive:u,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:l,loadEventEnd:h,domComplete:s,redirectCount:d}}}};function dn(e){return hn[e.entryType]?hn[e.entryType](e):null}function fn(e){return((g.Z1||x.performance.timeOrigin)+e)/1e3}function pn(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n(e){let{entries:n}=e;n.forEach(t)}const r=[];return["navigation","paint","resource"].forEach((e=>{r.push((0,C._j)(e,n))})),r.push((0,C.$A)((t=>{let{metric:n}=t;e.replayPerformanceEntries.push(function(e){const t=e.entries,n=t[t.length-1],r=n?n.element:void 0,i=e.value,s=fn(i);return{type:"largest-contentful-paint",name:"largest-contentful-paint",start:s,end:s,data:{value:i,size:i,nodeId:r?zt.mirror.getId(r):void 0}}}(n))}))),()=>{r.forEach((e=>e()))}}const mn=!1;class gn extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class yn{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>D)throw new gn;this.events.push(e)}finish(){return new Promise((e=>{const t=this.events;this.clear(),e(JSON.stringify(t))}))}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){const e=this.events.map((e=>e.timestamp)).sort()[0];return e?Ht(e):null}}class vn{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise(((e,t)=>{this._worker.addEventListener("message",(n=>{let{data:r}=n;r.success?e():t()}),{once:!0}),this._worker.addEventListener("error",(e=>{t(e)}),{once:!0})}))),this._ensureReadyPromise}destroy(){this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise(((r,i)=>{const s=t=>{let{data:o}=t;const a=o;a.method===e&&a.id===n&&(this._worker.removeEventListener("message",s),a.success?r(a.response):i(new Error("Error in compression worker")))};this._worker.addEventListener("message",s),this._worker.postMessage({id:n,method:e,arg:t})}))}_getAndIncrementId(){return this._id++}}class bn{constructor(e){this._worker=new vn(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=Ht(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);const n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>D?Promise.reject(new gn):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,(e=>{}))}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class _n{constructor(e){this._fallback=new yn,this._compression=new bn(e),this._used=this._fallback,this._ensureWorkerIsLoadedProm
1ise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t}=this._fallback,n=[];for(const i of e)n.push(this._compression.addEvent(i));this._compression.hasCheckout=t,this._used=this._compression;try{await Promise.all(n)}catch(r){}}}function wn(e){let{useCompression:t,workerUrl:n}=e;if(t&&window.Worker){const e=function(e){try{const t=e||function(){if("undefined"===typeof __SENTRY_EXCLUDE_REPLAY_WORKER__||!__SENTRY_EXCLUDE_REPLAY_WORKER__)return function(){const e=new Blob(['var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<<t[a-1];var s=new r(i[30]);for(a=1;a<30;++a)for(var o=i[a];o<i[a+1];++o)s[o]=o-i[a]<<5|a;return{b:i,r:s}},o=s(e,2),f=o.b,h=o.r;f[28]=258,h[258]=28;for(var l=s(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a<i;++a)t[a]&&++s[t[a]-1];var o,f=new n(r);for(a=1;a<r;++a)f[a]=f[a-1]+s[a-1]<<1;if(e){o=new n(1<<r);var h=15-r;for(a=0;a<i;++a)if(t[a])for(var l=a<<4|t[a],c=r-t[a],v=f[t[a]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>h]=l}else for(o=new n(i),a=0;a<i;++a)t[a]&&(o[a]=u[f[t[a]-1]++]>>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))}
vendor: 4,465 bytes, line 1
1,M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;a<r.length;++a)r[a]&&i.push({s:a,f:r[a]});var s=i.length,o=i.slice();if(!s)return{t:F,l:0};if(1==s){var f=new t(i[0].s+1);return f[i[0].s]=1,{t:f,l:1}}i.sort((function(t,n){return t.f-n.f})),i.push({s:-1,f:25001});var h=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:h.f+l.f,l:h,r:l};c!=s-1;)h=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:h.f+l.f,l:h,r:l};var d=o[0].s;for(a=1;a<s;++a)o[a].s>d&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<<y;for(o.sort((function(t,n){return g[n.s]-g[t.s]||t.f-n.f}));a<s;++a){var b=o[a].s;if(!(g[b]>e))break;p+=m-(1<<w-g[b]),g[b]=e}for(p>>=y;p>0;){var M=o[a].s;g[M]<e?p-=1<<e-g[M]++-1:++a}for(;a>=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a<e;++a)t[i+a+4]=r[a];return 8*(i+4+e)},C=function(t,r,s,o,f,h,l,u,c,v,m){z(r,m++,s),++f[256];for(var b=_(f,15),M=b.t,E=b.l,x=_(h,15),C=x.t,U=x.l,F=D(M),I=F.c,S=F.n,L=D(C),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=_(q,7),H=G.t,J=G.l,K=19;K>4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(C,U,0),R=C;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[a[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B<u;++B){var rt=o[B];if(rt>255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)i+=e+=r[s];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<<o)-1,A=c.p||new n(32768),_=c.h||new n(z+1),x=Math.ceil(o/3),D=2*x,T=function(t){return(a[t]^a[t+1]<<x^a[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=_[H];if(A[J]=K,_[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$<Z&&a[j+$]==a[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;
1++P){var rt=j-W+P&32767,et=rt-A[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=a[j],++I[a[j]];p=C(a,g,w,F,I,S,O,q,G,j-G,p),w||(c.r=7&p|g[p/8|0]<<3,p-=7,c.h=_,c.p=A,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+w;j+=65535){var st=j+65535;st>=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i<n.length;++i)e[i]=n.charCodeAt(i);return e}if(G)return G.encode(n);var a=n.length,s=new t(n.length+(n.length>>1)),o=0,f=function(t){s[o++]=t};for(i=0;i<a;++i){if(o+5>s.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r<e;r++)n+=t[r].length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});']);return URL.createObjectURL(e)}();return""}();if(!t)return;const n=new Worker(t);return new _n(n)}catch(t){}}(n);if(e)return e}return new yn}function Sn(){try{return"sessionStorage"in x&&!!x.sessionStorage}catch(e){return!1}}function kn(e){!function(){if(!Sn())return;try{x.sessionStorage.removeItem(O)}catch(e){}}(),e.session=void 0}function In(e){return void 0!==e&&Math.random()<e}function En(e){const t=Date.now();return{id:e.id||(0,v.DM)(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId}}function Tn(e){if(Sn())try{x.sessionStorage.setItem(O,JSON.stringify(e))}catch(t){}}function Cn(e,t){return In(e)?"session":!!t&&"buffer"}function xn(e){let{sessionSampleRate:t,allowBuffering:n,stickySession:r=!1}=e,{previousSessionId:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=Cn(t,n),o=En({sampled:s,previousSessionId:i});return r&&Tn(o),o}function On(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:+new Date;return null===e||void 0===t||t<0||0!==t&&e+t<=n}function An(e,t){let{maxReplayDuration:n,sessionIdleExpire:r,targetTime:i=Date.now()}=t;return On(e.started,n,i)||On(e.lastActivity,r,i)}function Rn(e,t){let{sessionIdleExpire:n,maxReplayDuration:r}=t;return!!An(e,{sessionIdleExpire:n,maxReplayDuration:r})&&("buffer"!==e.sampled||0!==e.segmentId)}function Nn(e,t){let{traceInternals:n,sessionIdleExpire:r,maxReplayDuration:i,previousSessionId:s}=e;const o=t.stickySession&&function(e){if(!Sn())return null;try{const e=x.sessionStorage.getItem(O);return e?En(JSON.parse(e)):null}catch(t){return null}}();return o?Rn(o,{sessionIdleExpire:r,maxReplayDuration:i})?xn(t,{previousSessionId:o.id}):o:xn(t,{previousSessionId:s})}
1function Dn(e,t,n){return!!Ln(e,t)&&(Pn(e,t,n),!0)}async function Pn(e,t,n){if(!e.eventBuffer)return null;try{n&&"buffer"===e.recordingMode&&e.eventBuffer.clear(),n&&(e.eventBuffer.hasCheckout=!0);const r=function(e,t){try{if("function"===typeof t&&function(e){return e.type===qe.Custom}(e))return t(e)}catch(n){return null}return e}(t,e.getOptions().beforeAddRecordingEvent);if(!r)return;return await e.eventBuffer.addEvent(r)}catch(r){const t=r&&r instanceof gn?"addEventSizeExceeded":"addEvent";await e.stop({reason:t});const n=(0,i.s3)();n&&n.recordDroppedEvent("internal_sdk_error","replay")}}function Ln(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=Ht(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now())&&(!(n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration)||(e.getOptions()._experiments.traceInternals,!1))}function Mn(e){return!e.type}function Fn(e){return"transaction"===e.type}function jn(e){return"replay_event"===e.type}function Un(e){return"feedback"===e.type}function $n(e){const t=function(){const e=(0,i.s3)();if(!e)return!1;const t=e.getTransport();if(!t)return!1;return t.send.__sentry__baseTransport__||!1}();return(n,r)=>{if(!e.isEnabled()||!Mn(n)&&!Fn(n))return;const i=r&&r.statusCode;t&&(!i||i<200||i>=300)||(Fn(n)?function(e,t){const n=e.getContext();t.contexts&&t.contexts.trace&&t.contexts.trace.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}(e,n):function(e,t){const n=e.getContext();t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id);if("buffer"!==e.recordingMode||!t.tags||!t.tags.replayId)return;const{beforeErrorSampling:r}=e.getOptions();if("function"===typeof r&&!r(t))return;setTimeout((()=>{e.sendBufferedReplayOrFlush()}))}(e,n))}}function Bn(e){return t=>{e.isEnabled()&&Mn(t)&&function(e,t){const n=t.exception&&t.exception.values&&t.exception.values[0].value;if("string"!==typeof n)return;if(n.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i)){Gt(e,rn({category:"replay.hydrate-error"}))}}(e,t)}}function Vn(e,t){return!(e.type||!e.exception||!e.exception.values||!e.exception.values.length)&&!(!t.originalException||!t.originalException.__rrweb__)}function zn(e,t){e.triggerUserActivity(),e.addUpdate((()=>!t.timestamp||(e.throttledAddEvent({type:qe.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1)))}function qn(e,t){return"buffer"===e.recordingMode&&(t.message!==A&&(!(!t.exception||t.type)&&In(e.getOptions().errorSampleRate)))}function Hn(e,t){return t.map((t=>{let{type:n,start:r,end:i,name:s,data:o}=t;const a=e.throttledAddEvent({type:qe.Custom,timestamp:r,data:{tag:"performanceSpan",payload:{op:n,description:s,startTimestamp:r,endTimestamp:i,data:o}}});return"string"===typeof a?Promise.resolve(null):a}))}function Wn(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate((()=>(Hn(e,[n]),!1))))}}function Gn(e,t){e.isEnabled()&&(null!==t&&(s(t.name,(0,i.s3)())||e.addUpdate((()=>(Hn(e,[t]),!0)))))}function Kn(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,xhr:r}=e,i=r[b.xU];if(!t||!n||!i)return null;const{method:s,url:o,status_code:a}=i;return void 0===o?null:{type:"resource.xhr",name:o,start:t/1e3,end:n/1e3,data:{method:s,statusCode:a}}}(t);Gn(e,n)}}function Xn(e,t){if(e)try{if("string"===typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=rr(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch(n){}}function Jn(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Yn(e){try{if("string"===typeof e)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[rr(e)];if(!e)return[void 0]}catch(t){return[void 0,"BODY_PARSE_ERROR"]}return[void 0,"UNPARSEABLE_BODY_TYPE"]}function Qn(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function Zn(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:i,method:s,statusCode:o,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:i,data:(0,p.Jr)({method:s,statusCode:o,request:a,response:c})}}function er(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function tr(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:i,warnings:s}=function(e){if(!e||"string"!==typeof e)return{body:e};const t=e.length>R,n=function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){const t=e.slice(0,R);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}\u2026`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch(r){}return{body:e}}(n);return r.body=i,s&&s.length>0&&(r._meta={warnings:s}),r}function nr(e,t){return Object.keys(e).reduce(((n,r)=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=e[r]),n}),{})}function rr(e){return new URLSearchParams(e).toString()}function ir(e,t){const n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x.document.baseURI;if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(x.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;if(!e.endsWith("/")&&r.endsWith("/"))return r.slice(0,-1);return r}(e);return(0,_.U0)(n,t)}async function sr(e,t,n){try{const r=await async function(e,t,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r}=t,{url:o,method:a,status_code:c=0,request_body_size:u,response_body_size:l}=e.data,h=ir(o,n.networkDetailAllowUrls)&&!ir(o,n.networkDetailDenyUrls),d=h?function(e,t,n){let{networkCaptureBodies:r,networkRequestHeaders:i}=e;const s=t?function(e,t){if(1===e.length&&"string"!==typeof e[0])return cr(e[0],t);
1if(2===e.length)return cr(e[1],t);return{}}(t,i):{};if(!r)return tr(s,n,void 0);const o=or(t),[a,c]=Yn(o),u=tr(s,n,a);if(c)return Qn(u,c);return u}(n,t.input,u):er(u),f=await async function(e,t,n,r){let{networkCaptureBodies:i,textEncoder:s,networkResponseHeaders:o}=t;if(!e&&void 0!==r)return er(r);const a=n?ar(n.headers,o):{};if(!n||!i&&void 0!==r)return tr(a,r,void 0);const[c,u]=await async function(e){const t=function(e){try{return e.clone()}catch(t){}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{const e=await function(e){return new Promise(((t,n)=>{const r=setTimeout((()=>n(new Error("Timeout while trying to read response body"))),500);(async function(e){return await e.text()})(e).then((e=>t(e)),(e=>n(e))).finally((()=>clearTimeout(r)))}))}(t);return[e]}catch(n){return[void 0,"BODY_PARSE_ERROR"]}}(n),l=function(e,t){let{networkCaptureBodies:n,textEncoder:r,responseBodySize:i,captureDetails:s,headers:o}=t;try{const t=e&&e.length&&void 0===i?Xn(e,r):i;return s?tr(o,t,n?e:void 0):er(t)}catch(a){return tr(o,i,void 0)}}(c,{networkCaptureBodies:i,textEncoder:s,responseBodySize:r,captureDetails:e,headers:a});if(u)return Qn(l,u);return l}(h,n,t.response,l);return{startTimestamp:i,endTimestamp:s,url:o,method:a,statusCode:c,request:d,response:f}}(e,t,n),i=Zn("resource.fetch",r);Gn(n.replay,i)}catch(r){}}function or(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(2===e.length&&"object"===typeof e[1])return e[1].body}function ar(e,t){const n={};return t.forEach((t=>{e.get(t)&&(n[t]=e.get(t))})),n}function cr(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?ar(n,t):Array.isArray(n)?{}:nr(n,t):{}}async function ur(e,t,n){try{const r=function(e,t,n){const r=Date.now(),{startTimestamp:i=r,endTimestamp:s=r,input:o,xhr:a}=t,{url:c,method:u,status_code:l=0,request_body_size:h,response_body_size:d}=e.data;if(!c)return null;if(!a||!ir(c,n.networkDetailAllowUrls)||ir(c,n.networkDetailDenyUrls)){return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:er(h),response:er(d)}}const f=a[b.xU],p=f?nr(f.request_headers,n.networkRequestHeaders):{},m=nr(function(e){const t=e.getAllResponseHeaders();if(!t)return{};return t.split("\r\n").reduce(((e,t)=>{const[n,r]=t.split(": ");return e[n.toLowerCase()]=r,e}),{})}(a),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?Yn(o):[void 0],[v,_]=n.networkCaptureBodies?function(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return function(e,t){try{if("string"===typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&e&&"object"===typeof e)return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return[void 0,"BODY_PARSE_ERROR"]}return[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(n){t.push(n)}return[void 0]}(a):[void 0],w=tr(p,h,g),S=tr(m,d,v);return{startTimestamp:i,endTimestamp:s,url:c,method:u,statusCode:l,request:y?Qn(w,y):w,response:_?Qn(S,_):S}}(e,t,n),i=Zn("resource.xhr",r);Gn(n.replay,i)}catch(r){}}function lr(e,t,n){const{xhr:r,input:i}=t;if(!r)return;const s=Xn(i,n.textEncoder),o=r.getResponseHeader("content-length")?Jn(r.getResponseHeader("content-length")):function(e,t,n){try{return Xn("json"===t&&e&&"object"===typeof e?JSON.stringify(e):e,n)}catch(r){return}}(r.response,r.responseType,n.textEncoder);void 0!==s&&(e.data.request_body_size=s),void 0!==o&&(e.data.response_body_size=o)}function hr(e){const t=(0,i.s3)();try{const n=new TextEncoder,{networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a}=e.getOptions(),c={replay:e,textEncoder:n,networkDetailAllowUrls:r,networkDetailDenyUrls:i,networkCaptureBodies:s,networkRequestHeaders:o,networkResponseHeaders:a};t&&t.on?t.on("beforeAddBreadcrumb",((e,t)=>function(e,t,n){if(!t.data)return;try{(function(e){return"xhr"===e.category})(t)&&function(e){return e&&e.xhr}(n)&&(lr(t,n,e),ur(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return e&&e.response}(n)&&(!function(e,t,n){const{input:r,response:i}=t,s=Xn(r?or(r):void 0,n.textEncoder),o=i?Jn(i.headers.get("content-length")):void 0;void 0!==s&&(e.data.request_body_size=s),void 0!==o&&(e.data.response_body_size=o)}(t,n,e),sr(t,n,e))}catch(r){}}(c,e,t))):((0,w.U)(function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{startTimestamp:t,endTimestamp:n,fetchData:r,response:i}=e;if(!n)return null;const{method:s,url:o}=r;return{type:"resource.fetch",start:t/1e3,end:n/1e3,name:o,data:{method:s,statusCode:i?i.status:void 0}}}(t);Gn(e,n)}}(e)),(0,b.UK)(Kn(e)))}catch(n){}}let dr=null;const fr=e=>t=>{if(!e.isEnabled())return;const n=function(e){const t=e.getLastBreadcrumb&&e.getLastBreadcrumb();if(dr===t||!t)return null;if(dr=t,!function(e){return!!e.category}(t)||["fetch","xhr","sentry.event","sentry.transaction"].includes(t.category)||t.category.startsWith("ui."))return null;if("console"===t.category)return function(e){const t=e.data&&e.data.arguments;if(!Array.isArray(t)||0===t.length)return rn(e);let n=!1;const r=t.map((e=>{if(!e)return e;if("string"===typeof e)return e.length>N?(n=!0,`${e.slice(0,N)}\u2026`):e;if("object"===typeof e)try{const t=(0,f.Fv)(e,7);return JSON.stringify(t).length>N?(n=!0,`${JSON.stringify(t,null,2).slice(0,N)}\u2026`):t}catch(t){}return e}));return rn({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(t);return rn(t)}(t);n&&Gt(e,n)};function pr(e){const t=(0,i.nZ)(),n=(0,i.s3)();t.addScopeListener(fr(e)),(0,S.O)(cn(e)),(0,k.a)(Wn(e)),hr(e);const r=function(e){const t=arguments.length>
11&&void 0!==arguments[1]&&arguments[1]?$n(e):void 0;return Object.assign(((n,r)=>e.isEnabled()?jn(n)?(delete n.breadcrumbs,n):(Mn(n)||Fn(n)||Un(n))&&e.checkAndHandleExpiredSession()?Un(n)?(e.flush(),n.contexts.feedback.replay_id=e.getSessionId(),zn(e,n),n):Vn(n,r)&&!e.getOptions()._experiments.captureExceptions?null:((qn(e,n)||"session"===e.recordingMode)&&(n.tags={...n.tags,replayId:e.getSessionId()}),t&&t(n,{statusCode:200}),n):n:n),{id:"Replay"})}(e,!mr(n));n&&n.addEventProcessor?n.addEventProcessor(r):(0,a.Q)(r),mr(n)&&(n.on("beforeSendEvent",Bn(e)),n.on("afterSendEvent",$n(e)),n.on("createDsc",(t=>{const n=e.getSessionId();if(n&&e.isEnabled()&&"session"===e.recordingMode){e.checkAndHandleExpiredSession()&&(t.replay_id=n)}})),n.on("startTransaction",(t=>{e.lastTransaction=t})),n.on("finishTransaction",(t=>{e.lastTransaction=t})),n.on("beforeSendFeedback",((t,n)=>{const r=e.getSessionId();n&&n.includeReplay&&e.isEnabled()&&r&&t.contexts&&t.contexts.feedback&&(t.contexts.feedback.replay_id=r)})))}function mr(e){return!(!e||!e.on)}function gr(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,i=Date.now()/1e3;return{type:"memory",name:"memory",start:i,end:i,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function yr(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return;const i=r||!t;t=!0,e.clickDetector&&nn(e.clickDetector,n),e.addUpdate((()=>{if("buffer"===e.recordingMode&&i&&e.setInitialState(),!Dn(e,n,i))return!0;if(!i)return!1;if(function(e,t){if(!t||!e.session||0!==e.session.segmentId)return;Dn(e,function(e){const t=e.getOptions();return{type:qe.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,i),e.session&&e.session.previousSessionId)return!0;if("buffer"===e.recordingMode&&e.session&&e.eventBuffer){const t=e.eventBuffer.getEarliestTimestamp();t&&(new Date(t),e.getOptions()._experiments.traceInternals,e.session.started=t,e.getOptions().stickySession&&Tn(e.session))}return"session"===e.recordingMode&&e.flush(),!0}))}}function vr(e,t,n,r){return(0,I.Jd)((0,I.Cd)(e,(0,I.HY)(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"===typeof t?(new TextEncoder).encode(t).length:t.length},t]])}async function br(e){let{recordingData:t,replayId:n,segmentId:r,eventContext:s,timestamp:o,session:a}=e;const l=function(e){let t,{recordingData:n,headers:r}=e;const i=`${JSON.stringify(r)}\n`;if("string"===typeof n)t=`${i}${n}`;else{const e=(new TextEncoder).encode(i);t=new Uint8Array(e.length+n.length),t.set(e),t.set(n,e.length)}return t}({recordingData:t,headers:{segment_id:r}}),{urls:h,errorIds:d,traceIds:f,initialTimestamp:p}=s,m=(0,i.s3)(),g=(0,i.nZ)(),y=m&&m.getTransport(),v=m&&m.getDsn();if(!m||!y||!v||!a.sampled)return;const b={type:"replay_event",replay_start_timestamp:p/1e3,timestamp:o/1e3,error_ids:d,trace_ids:f,urls:h,replay_id:n,segment_id:r,replay_type:a.sampled},_=await async function(e){let{client:t,scope:n,replayId:r,event:i}=e;const s={event_id:r,integrations:"object"!==typeof t._integrations||null===t._integrations||Array.isArray(t._integrations)?void 0:Object.keys(t._integrations)};t.emit&&t.emit("preprocessEvent",i,s);const o=await(0,c.R)(t.getOptions(),i,s,n,t,(0,u.aF)());if(!o)return null;o.platform=o.platform||"javascript";const a=t.getSdkMetadata&&t.getSdkMetadata(),{name:l,version:h}=a&&a.sdk||{};return o.sdk={...o.sdk,name:l||"sentry.javascript.unknown",version:h||"0.0.0"},o}({scope:g,client:m,replayId:n,event:b});if(!_)return void m.recordDroppedEvent("event_processor","replay",b);delete _.sdkProcessingMetadata;const w=vr(_,l,v,m.getOptions().tunnel);let S;try{S=await y.send(w)}catch(I){const e=new Error(A);try{e.cause=I}catch(T){}throw e}if(!S)return S;if("number"===typeof S.statusCode&&(S.statusCode<200||S.statusCode>=300))throw new _r(S.statusCode);const k=(0,E.WG)({},S);if((0,E.Q)(k,"replay"))throw new wr(k);return S}
1class _r extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class wr extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}async function Sr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{count:0,interval:5e3};const{recordingData:n,options:r}=e;if(n.length)try{return await br(e),!0}catch(s){if(s instanceof _r||s instanceof wr)throw s;if((0,i.v)("Replays",{_retryCount:t.count}),t.count>=3){const e=new Error("Unable to send Replay - max retries exceeded");try{e.cause=s}catch(o){}throw e}return t.interval*=++t.count,new Promise(((n,r)=>{setTimeout((async()=>{try{await Sr(e,t),n(!0)}catch(s){r(s)}}),t.interval)}))}}const kr="__THROTTLED",Ir="__SKIPPED";class Er{constructor({options:e,recordingOptions:t}){Er.prototype.__init.call(this),Er.prototype.__init2.call(this),Er.prototype.__init3.call(this),Er.prototype.__init4.call(this),Er.prototype.__init5.call(this),Er.prototype.__init6.call(this),this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){let r,i,s;const o=n&&n.maxWait?Math.max(n.maxWait,t):0;function a(){return c(),r=e(),r}function c(){void 0!==i&&clearTimeout(i),void 0!==s&&clearTimeout(s),i=s=void 0}function u(){return i&&clearTimeout(i),i=setTimeout(a,t),o&&void 0===s&&(s=setTimeout(a,o)),r}return u.cancel=c,u.flush=function(){return void 0!==i||void 0!==s?a():r},u}((()=>this._flush()),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=function(e,t,n){const r=new Map,i=e=>{const t=e-n;r.forEach(((e,n)=>{n<t&&r.delete(n)}))},s=()=>[...r.values()].reduce(((e,t)=>e+t),0);let o=!1;return function(){for(var n=arguments.length,a=new Array(n),c=0;c<n;c++)a[c]=arguments[c];const u=Math.floor(Date.now()/1e3);if(i(u),s()>=t){const e=o;return o=!0,e?Ir:kr}o=!1;const l=r.get(u)||0;return r.set(u,l+1),e(...a)}}(((e,t)=>function(e,t,n){return Ln(e,t)?Pn(e,t,n):Promise.resolve(null)}(this,e,t)),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),i=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;i&&(this.clickDetector=new Zt(this,i))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this._options}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options;t<=0&&n<=0||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",this.recordingMode,this._options._experiments.traceInternals,this._initializeRecording()):this._handleException(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)throw new Error("Replay recording is already in progress");if(this._isEnabled&&"buffer"===this.recordingMode)throw new Error("Replay buffering is in progress, call `flush()` to save the replay");this._options._experiments.traceInternals;const e=Nn({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw new Error("Replay recording is already in progress");this._options._experiments.traceInternals;const e=Nn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=zt({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:yr(this),onMutation:this._onMutationHandler,...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this._handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this._handleException(e),!1}}async stop(){let{forceFlush:e=!1,reason:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._isEnabled){this._isEnabled=!1;try{this._options._experiments.traceInternals,this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,kn(this)}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),this._options._experiments.traceInternals)}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),this._options._experiments.traceInternals)}async sendBufferedReplayOrFlush(){let{continueRecording:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();this._options._experiments.traceInternals,await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(){return this.session&&this.session.id}
1checkAndHandleExpiredSession(){if(!(this._lastActivity&&On(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled))return!!this._checkSession();this.pause()}setInitialState(){const e=`${x.location.pathname}${x.location.hash}${x.location.search}`,t=`${x.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===kr){const e=rn({category:"replay.throttled"});this.addUpdate((()=>!Dn(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}})))}return n}getCurrentRoute(){const e=this.lastTransaction||(0,i.nZ)().getTransaction(),t=(e&&(0,l.XU)(e).data||{})[h.Zj];if(e&&t&&["route","custom"].includes(t))return(0,l.XU)(e).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=wn({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(e){mn}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Nn({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!Rn(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{x.document.addEventListener("visibilitychange",this._handleVisibilityChange),x.addEventListener("blur",this._handleWindowBlur),x.addEventListener("focus",this._handleWindowFocus),x.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(pr(this),this._hasInitializedCoreListeners=!0)}catch(e){this._handleException(e)}this._performanceCleanupCallback=pn(this)}_removeListeners(){try{x.document.removeEventListener("visibilitychange",this._handleVisibilityChange),x.removeEventListener("blur",this._handleWindowBlur),x.removeEventListener("focus",this._handleWindowFocus),x.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this._handleException(e)}}__init(){this._handleVisibilityChange=()=>{"visible"===x.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{const e=rn({category:"ui.blur"});this._doChangeToBackgroundTasks(e)}}__init3(){this._handleWindowFocus=()=>{const e=rn({category:"ui.focus"});this._doChangeToForegroundTasks(e)}}__init4(){this._handleKeyboardEvent=e=>{ln(this,e)}}_doChangeToBackgroundTasks(e){if(!this.session)return;An(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush())}_doChangeToForegroundTasks(e){if(!this.session)return;this.checkAndHandleExpiredSession()&&e&&this._createCustomBreadcrumb(e)}_updateUserActivity(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this._lastActivity=e}_updateSessionActivity(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate((()=>{this.throttledAddEvent({type:qe.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})}))}_addPerformanceEntries(){const e=(t=this.performanceEntries,t.map(dn).filter(
1Boolean)).concat(this.replayPerformanceEntries);var t;return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(Hn(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(this.session&&this.eventBuffer&&e&&(await this._addPerformanceEntries(),this.eventBuffer&&this.eventBuffer.hasEvents&&(await async function(e){try{return Promise.all(Hn(e,[gr(x.performance.memory)]))}catch(t){return[]}}(this),this.eventBuffer&&e===this.getSessionId())))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Error("Session is too long, not sending replay");const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const i=await this.eventBuffer.finish();await Sr({replayId:e,recordingData:i,segmentId:r,eventContext:n,session:this.session,options:this.getOptions(),timestamp:t})}catch(t){this._handleException(t),this.stop({reason:"sendReplay"});const e=(0,i.s3)();e&&e.recordDroppedEvent("send_error","replay")}}__init5(){var e=this;this._flush=async function(){let{force:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e._isEnabled&&!t)return;if(!e.checkAndHandleExpiredSession())return;if(!e.session)return;const n=e.session.started,r=Date.now(),i=r-n;e._debouncedFlush.cancel();const s=i<e._options.minReplayDuration,o=i>e._options.maxReplayDuration+5e3;if(s||o)return Math.floor(i/1e3),e._options._experiments.traceInternals,void(s&&e._debouncedFlush());const a=e.eventBuffer;if(a&&0===e.session.segmentId&&!a.hasCheckout&&e._options._experiments.traceInternals,!e._flushLock)return e._flushLock=e._runFlush(),await e._flushLock,void(e._flushLock=void 0);try{await e._flushLock}catch(c){}finally{e._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&Tn(this.session)}__init6(){this._onMutationHandler=e=>{const t=e.length,n=this._options.mutationLimit,r=n&&t>n;if(t>this._options.mutationBreadcrumbLimit||r){const e=rn({category:"replay.mutations",data:{count:t,limit:r}});this._createCustomBreadcrumb(e)}return!r||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}}function Tr(e,t,n,r){const i=[...e,..."string"===typeof r?r.split(","):[],...t];return"undefined"!==typeof n&&("string"===typeof n&&i.push(`.${n}`),(0,y.Cf)((()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")}))),i.join(",")}const Cr='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',xr=["content-length","content-type","accept"];let Or=!1;const Ar=e=>new Rr(e);class Rr{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:i=!0,useCompression:s=!0,workerUrl:o,_experiments:a={},sessionSampleRate:c,errorSampleRate:u,maskAllText:l=!0,maskAllInputs:h=!0,blockAllMedia:d=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:m=7e3,slowClickIgnoreSelectors:g=[],networkDetailAllowUrls:y=[],networkDetailDenyUrls:v=[],networkCaptureBodies:b=!0,networkRequestHeaders:_=[],networkResponseHeaders:w=[],mask:S=[],maskAttributes:k=["title","placeholder"],unmask:I=[],block:E=[],unblock:C=[],ignore:x=[],maskFn:O,beforeAddRecordingEvent:A,beforeErrorSampling:R,blockClass:N,blockSelector:D,maskInputOptions:L,maskTextClass:M,maskTextSelector:F,ignoreClass:j}={}){this.name=Rr.id;const U=function(e){let{mask:t,unmask:n,block:r,unblock:i,ignore:s,blockClass:o,blockSelector:a,maskTextClass:c,maskTextSelector:u,ignoreClass:l}=e;const h={maskTextSelector:Tr(t,[".sentry-mask","[data-sentry-mask]"],c,u),unmaskTextSelector:Tr(n,[".sentry-unmask","[data-sentry-unmask]"]),blockSelector:Tr(r,[".sentry-block","[data-sentry-block]",'base[href="/"]'],o,a),unblockSelector:Tr(i,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:Tr(s,[".sentry-ignore","[data-sentry-ignore]",'
1input[type="file"]'],l)};return o instanceof RegExp&&(h.blockClass=o),c instanceof RegExp&&(h.maskTextClass=c),h}({mask:S,unmask:I,block:E,unblock:C,ignore:x,blockClass:N,blockSelector:D,maskTextClass:M,maskTextSelector:F,ignoreClass:j});if(this._recordingOptions={maskAllInputs:h,maskAllText:l,maskInputOptions:{...L||{},password:!0},maskTextFn:O,maskInputFn:O,maskAttributeFn:(e,t,n)=>function(e){let{el:t,key:n,maskAttributes:r,maskAllText:i,privacyOptions:s,value:o}=e;return i?s.unmaskTextSelector&&t.matches(s.unmaskTextSelector)?o:r.includes(n)||"value"===n&&"INPUT"===t.tagName&&["submit","button"].includes(t.getAttribute("type")||"")?o.replace(/[\S]/g,"*"):o:o}({maskAttributes:k,maskAllText:l,privacyOptions:U,key:e,value:t,el:n}),...U,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch(t){}}},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,15e3),maxReplayDuration:Math.min(r,P),stickySession:i,sessionSampleRate:c,errorSampleRate:u,useCompression:s,workerUrl:o,blockAllMedia:d,maskAllInputs:h,maskAllText:l,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:m,slowClickIgnoreSelectors:g,networkDetailAllowUrls:y,networkDetailDenyUrls:v,networkCaptureBodies:b,networkRequestHeaders:Nr(_),networkResponseHeaders:Nr(w),beforeAddRecordingEvent:A,beforeErrorSampling:R,_experiments:a},"number"===typeof c&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${c} })`),this._initialOptions.sessionSampleRate=c),"number"===typeof u&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${u} })`),this._initialOptions.errorSampleRate=u),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Cr}`:Cr),this._isInitialized&&(0,T.j)())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Or}set _isInitialized(e){Or=e}setupOnce(){(0,T.j)()&&(this._setup(),setTimeout((()=>this._initialize())))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){const e=function(e){const t=(0,i.s3)(),n=t&&t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...(0,p.Jr)(e)};if(!n)return(0,y.Cf)((()=>{console.warn("SDK client is not available.")})),r;null==e.sessionSampleRate&&null==e.errorSampleRate&&null==n.replaysSessionSampleRate&&null==n.replaysOnErrorSampleRate&&(0,y.Cf)((()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}));"number"===typeof n.replaysSessionSampleRate&&(r.sessionSampleRate=n.replaysSessionSampleRate);"number"===typeof n.replaysOnErrorSampleRate&&(r.errorSampleRate=n.replaysOnErrorSampleRate);return r}(this._initialOptions);this._replay=new Er({options:e,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{const e=(0,i.s3)().getIntegrationByName("ReplayCanvas");if(!e)return;this._replay._canvas=e.getOptions()}catch(e){}}}function Nr(e){return[...xr,...e.map((e=>e.toLowerCase()))]}function Dr(){const e=(0,i.s3)();return e&&e.getIntegrationByName&&e.getIntegrationByName("Replay")}Rr.__initStatic()},58696:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(13444),i=n(92217);function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0;if(!a.exception||!a.exception.values||!c||!(0,r.V9)(c.originalException,Error))return;const l=a.exception.values.length>0?a.exception.values[a.exception.values.length-1]:void 0;l&&(a.exception.values=u(o(e,t,s,c.originalException,i,a.exception.values,l,0),n))}function o(e,t,n,i,s,u,l,h){if(u.length>=n+1)return u;let d=[...u];
1if((0,r.V9)(i[s],Error)){a(l,h);const r=e(t,i[s]),u=d.length;c(r,s,u,h),d=o(e,t,n,i[s],s,[r,...d],r,u)}return Array.isArray(i.errors)&&i.errors.forEach(((i,u)=>{if((0,r.V9)(i,Error)){a(l,h);const r=e(t,i),f=d.length;c(r,`errors[${u}]`,f,h),d=o(e,t,n,i,s,[r,...d],r,f)}})),d}function a(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function c(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function u(e,t){return e.map((e=>(e.value&&(e.value=(0,i.$G)(e.value,t)),e)))}},72151:function(e,t,n){"use strict";n.d(t,{EN:function(){return u},IQ:function(){return l},bU:function(){return o}});var r=n(99001),i=n(13444),s=n(47744);const o="baggage",a="sentry-",c=/^sentry-/;function u(e){if(!(0,i.HD)(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce(((e,t)=>{const n=h(t);for(const r of Object.keys(n))e[r]=n[r];return e}),{});else{if(!e)return;t=h(e)}const n=Object.entries(t).reduce(((e,t)=>{let[n,r]=t;if(n.match(c)){e[n.slice(a.length)]=r}return e}),{});return Object.keys(n).length>0?n:void 0}function l(e){if(!e)return;return function(e){if(0===Object.keys(e).length)return;return Object.entries(e).reduce(((e,t,n)=>{let[i,o]=t;const a=`${encodeURIComponent(i)}=${encodeURIComponent(o)}`,c=0===n?a:`${e},${a}`;return c.length>8192?(r.X&&s.kg.warn(`Not adding key: ${i} with val: ${o} to baggage header due to exceeding baggage size limits.`),e):c}),"")}(Object.entries(e).reduce(((e,t)=>{let[n,r]=t;return r&&(e[`sentry-${n}`]=r),e}),{}))}function h(e){return e.split(",").map((e=>e.split("=").map((e=>decodeURIComponent(e.trim()))))).reduce(((e,t)=>{let[n,r]=t;return e[n]=r,e}),{})}},92353:function(e,t,n){"use strict";n.d(t,{Rt:function(){return s},iY:function(){return u},l4:function(){return a},qT:function(){return c}});var r=n(13444);const i=(0,n(71671).R)();function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let s=0,a=0;const c=" > ",u=c.length;let l;const h=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&s++<r&&(l=o(n,h),!("html"===l||s>1&&a+i.length*u+l.length>=d));)i.push(l),a+=l.length,n=n.parentNode;return i.reverse().join(c)}catch(n){return"<unknown>"}}function o(e,t){const n=e,s=[];let o,a,c,u,l;if(!n||!n.tagName)return"";if(i.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;s.push(n.tagName.toLowerCase());const h=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(h&&h.length)h.forEach((e=>{s.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&s.push(`#${n.id}`),o=n.className,o&&(0,r.HD)(o))for(a=o.split(/\s+/),l=0;l<a.length;l++)s.push(`.${a[l]}`);const d=["aria-label","type","name","title","alt"];for(l=0;l<d.length;l++)c=d[l],u=n.getAttribute(c),u&&s.push(`[${c}="${u}"]`);return s.join("")}function a(){try{return i.document.location.href}catch(e){return""}}function c(e){return i.document&&i.document.querySelector?i.document.querySelector(e):null}function u(e){if(!i.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}},16893:function(e,t,n){"use strict";function r(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],s=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=s(n)):"call"!==i&&"optionalCall"!==i||(n=s((function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n.call(t,...r)})),t=void 0)}return n}n.d(t,{x:function(){return r}})},99001:function(e,t,n){"use strict";n.d(t,{X:function(){return r}});const r=!1},95625:function(e,t,n){"use strict";n.d(t,{RA:function(){return o},U4:function(){return a},vK:function(){return u}});var r=n(99001),i=n(47744);const s=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function o(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${o}
1`}function a(e){const t=s.exec(e);if(!t)return void(0,i.Cf)((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,r,o="",a,u="",l]=t.slice(1);let h="",d=l;const f=d.split("/");if(f.length>1&&(h=f.slice(0,-1).join("/"),d=f.pop()),d){const e=d.match(/^\d+/);e&&(d=e[0])}return c({host:a,pass:o,path:h,projectId:d,port:u,protocol:n,publicKey:r})}function c(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function u(e){const t="string"===typeof e?a(e):c(e);if(t&&function(e){if(!r.X)return!0;const{port:t,projectId:n,protocol:s}=e;return!["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(i.kg.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(s)?!t||!isNaN(parseInt(t,10))||(i.kg.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(i.kg.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),!1):(i.kg.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1))}(t))return t}},79260:function(e,t,n){"use strict";function r(){return"undefined"!==typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}function i(){return"npm"}n.d(t,{S:function(){return i},n:function(){return r}})},33002:function(e,t,n){"use strict";n.d(t,{BO:function(){return a},Cd:function(){return y},HY:function(){return g},Jd:function(){return o},R:function(){return u},V$:function(){return h},f4:function(){return d},gv:function(){return c},mL:function(){return m},zQ:function(){return f}});var r=n(95625),i=n(93968),s=n(59769);function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return[e,t]}function a(e,t){const[n,r]=e;return[n,[...r,t]]}function c(e,t){const n=e[1];for(const r of n){if(t(r,r[0].type))return!0}return!1}function u(e,t){return c(e,((e,n)=>t.includes(n)))}function l(e,t){return(t||new TextEncoder).encode(e)}function h(e,t){const[n,r]=e;let s=JSON.stringify(n);function o(e){"string"===typeof s?s="string"===typeof e?s+e:[l(s,t),e]:s.push("string"===typeof e?l(e,t):e)}for(const c of r){const[e,t]=c;if(o(`\n${JSON.stringify(e)}\n`),"string"===typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch(a){e=JSON.stringify((0,i.Fv)(t))}o(e)}}return"string"===typeof s?s:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(s)}function d(e,t,n){let r="string"===typeof e?t.encode(e):e;function i(e){const t=r.subarray(0,e);return r=r.subarray(e+1),t}function s(){let e=r.indexOf(10);return e<0&&(e=r.length),JSON.parse(n.decode(i(e)))}const o=s(),a=[];for(;r.length;){const e=s(),t="number"===typeof e.length?e.length:void 0;a.push([e,t?i(t):s()])}return[o,a]}function f(e,t){const n="string"===typeof e.data?l(e.data,t):e.data;return[(0,s.Jr)({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}const p={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"statsd"};function m(e){return p[e]}function g(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function y(e,t,n,i){const o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&i&&{dsn:(0,r.RA)(i)},...o&&{trace:(0,s.Jr)({...o})}}}},23158:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});class r extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}},86272:function(e,t,n){"use strict";n.d(t,{D2:function(){return u},Hj:function(){return c},rK:function(){return l}});var r=n(99001),i=n(47744),s=n(88745);const o={},a={};function c(e,t){o[e]=o[e]||[],o[e].push(t)}function u(e,t){a[e]||(t(),a[e]=!0)}function l(e,t){const n=e&&o[e];if(n)for(const o of n)try{o(t)}catch(a){r.X&&i.kg.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${(0,s.$P)(o)}\nError:`,a)}}},63527:function(e,t,n){"use strict";n.d(t,{O:function(){return h}});var r=n(25439),i=n(59769),s=n(71671),o=n(86272);const a=s.GLOBAL_OBJ;let c,u,l;function h(e){(0,o.Hj)("dom",e),(0,o.D2)("dom",d)}function d(){if(!a.document)return;const e=o.rK.bind(null,"dom"),t=m(e,!0);a.document.addEventListener("click",t,!1),a.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=a[t]&&a[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&((0,i.hl)(n,"addEventListener",(function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,s=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=s[n]=s[n]||{refCount:0};if(!o.handler){const r=m(e);o.handler=r,t.call(this,n,r,i)}o.refCount++}catch(s){}return t.call(this,n,r,i)}})),(0,i.hl)(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},s=i[t];
1s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(i){}return e.call(this,t,n,r)}})))}))}function f(e){if(e.type!==u)return!1;try{if(!e.target||e.target._sentryId!==l)return!1}catch(t){}return!0}function p(e,t){return"keypress"===e&&(!t||!t.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{if(!n||n._sentryCaptured)return;const s=g(n);if(p(n.type,s))return;(0,i.xp)(n,"_sentryCaptured",!0),s&&!s._sentryId&&(0,i.xp)(s,"_sentryId",(0,r.DM)());const o="keypress"===n.type?"input":n.type;if(!f(n)){e({event:n,name:o,global:t}),u=n.type,l=s?s._sentryId:void 0}clearTimeout(c),c=a.setTimeout((()=>{l=void 0,u=void 0}),1e3)}}function g(e){try{return e.target}catch(t){return null}}},86122:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(59769),i=n(3401),s=n(71671),o=n(86272);function a(e){const t="fetch";(0,o.Hj)(t,e),(0,o.D2)(t,c)}function c(){(0,i.t$)()&&(0,r.hl)(s.GLOBAL_OBJ,"fetch",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const{method:i,url:a}=h(n),c={args:n,fetchData:{method:i,url:a},startTimestamp:Date.now()};return(0,o.rK)("fetch",{...c}),e.apply(s.GLOBAL_OBJ,n).then((e=>{const t={...c,endTimestamp:Date.now(),response:e};return(0,o.rK)("fetch",t),e}),(e=>{const t={...c,endTimestamp:Date.now(),error:e};throw(0,o.rK)("fetch",t),e}))}}))}function u(e,t){return!!e&&"object"===typeof e&&!!e[t]}function l(e){return"string"===typeof e?e:e?u(e,"url")?e.url:e.toString?e.toString():"":""}function h(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:l(t),method:u(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:l(t),method:u(t,"method")?String(t.method).toUpperCase():"GET"}}},91746:function(e,t,n){"use strict";n.d(t,{V:function(){return o}});var r=n(71671),i=n(86272);let s=null;function o(e){const t="error";(0,i.Hj)(t,e),(0,i.D2)(t,a)}function a(){s=r.GLOBAL_OBJ.onerror,r.GLOBAL_OBJ.onerror=function(e,t,n,r,o){const a={column:r,error:o,line:n,msg:e,url:t};return(0,i.rK)("error",a),!(!s||s.__SENTRY_LOADER__)&&s.apply(this,arguments)},r.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}},79878:function(e,t,n){"use strict";n.d(t,{h:function(){return o}});var r=n(71671),i=n(86272);let s=null;function o(e){const t="unhandledrejection";(0,i.Hj)(t,e),(0,i.D2)(t,a)}function a(){s=r.GLOBAL_OBJ.onunhandledrejection,r.GLOBAL_OBJ.onunhandledrejection=function(e){const t=e;return(0,i.rK)("unhandledrejection",t),!(s&&!s.__SENTRY_LOADER__)||s.apply(this,arguments)},r.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}},36366:function(e,t,n){"use strict";n.d(t,{a:function(){return u}});var r=n(59769),i=n(71671);const s=(0,i.R)();var o=n(86272);const a=i.GLOBAL_OBJ;let c;function u(e){const t="history";(0,o.Hj)(t,e),(0,o.D2)(t,l)}function l(){if(!function(){const e=s.chrome,t=e&&e.app&&e.app.runtime,n="history"in s&&!!s.history.pushState&&!!s.history.replaceState;return!t&&n}())return;const e=a.onpopstate;function t(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i=n.length>2?n[2]:void 0;if(i){const e=c,t=String(i);c=t;const n={from:e,to:t};(0,o.rK)("history",n)}return e.apply(this,n)}}a.onpopstate=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i=a.location.href,s=c;c=i;const u={from:s,to:i};if((0,o.rK)("history",u),e)try{return e.apply(this,n)}catch(l){}},(0,r.hl)(a.history,"pushState",t),(0,r.hl)(a.history,"replaceState",t)}},38481:function(e,t,n){"use strict";n.d(t,{UK:function(){return u},xU:function(){return c}});var r=n(13444),i=n(59769),s=n(71671),o=n(86272);const a=s.GLOBAL_OBJ,c="__sentry_xhr_v3__";function u(e){(0,o.Hj)("xhr",e),(0,o.D2)("xhr",l)}function l(){if(!a.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;(0,i.hl)(e,"open",(function(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const a=Date.now(),u=(0,r.HD)(n[0])?n[0].toUpperCase():void 0,l=h(n[1]);if(!u||!l)return e.apply(this,n);this[c]={method:u,url:l,request_headers:{}}
1,"POST"===u&&l.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const d=()=>{const e=this[c];if(e&&4===this.readyState){try{e.status_code=this.status}catch(t){}const n={args:[u,l],endTimestamp:Date.now(),startTimestamp:a,xhr:this};(0,o.rK)("xhr",n)}};return"onreadystatechange"in this&&"function"===typeof this.onreadystatechange?(0,i.hl)(this,"onreadystatechange",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return d(),e.apply(this,n)}})):this.addEventListener("readystatechange",d),(0,i.hl)(this,"setRequestHeader",(function(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const[s,o]=n,a=this[c];return a&&(0,r.HD)(s)&&(0,r.HD)(o)&&(a.request_headers[s.toLowerCase()]=o),e.apply(this,n)}})),e.apply(this,n)}})),(0,i.hl)(e,"send",(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i=this[c];if(!i)return e.apply(this,n);void 0!==n[0]&&(i.body=n[0]);const s={args:[i.method,i.url],startTimestamp:Date.now(),xhr:this};return(0,o.rK)("xhr",s),e.apply(this,n)}}))}function h(e){if((0,r.HD)(e))return e;try{return e.toString()}catch(t){}}},13444:function(e,t,n){"use strict";n.d(t,{Cy:function(){return y},HD:function(){return u},J8:function(){return g},Kj:function(){return m},Le:function(){return l},PO:function(){return d},TX:function(){return a},V9:function(){return b},VW:function(){return o},VZ:function(){return i},cO:function(){return f},fm:function(){return c},i2:function(){return v},kK:function(){return p},pt:function(){return h},y1:function(){return _}});const r=Object.prototype.toString;function i(e){switch(r.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return b(e,Error)}}function s(e,t){return r.call(e)===`[object ${t}]`}function o(e){return s(e,"ErrorEvent")}function a(e){return s(e,"DOMError")}function c(e){return s(e,"DOMException")}function u(e){return s(e,"String")}function l(e){return"object"===typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function h(e){return null===e||l(e)||"object"!==typeof e&&"function"!==typeof e}function d(e){return s(e,"Object")}function f(e){return"undefined"!==typeof Event&&b(e,Event)}function p(e){return"undefined"!==typeof Element&&b(e,Element)}function m(e){return s(e,"RegExp")}function g(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function y(e){return d(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function v(e){return"number"===typeof e&&e!==e}function b(e,t){try{return e instanceof t}catch(n){return!1}}function _(e){return!("object"!==typeof e||null===e||!e.__isVue&&!e._isVue)}},4458:function(e,t,n){"use strict";n.d(t,{j:function(){return s}});var r=n(52166),i=n(71671);function s(){return!(0,r.KV)()||void 0!==i.GLOBAL_OBJ.process&&"renderer"===i.GLOBAL_OBJ.process.type}},47744:function(e,t,n){"use strict";n.d(t,{Cf:function(){return c},LD:function(){return a},RU:function(){return o},kg:function(){return u}});var r=n(99001),i=n(71671);const s="Sentry Logger ",o=["debug","info","warn","error","log","assert","trace"],a={};function c(e){if(!("console"in i.GLOBAL_OBJ))return e();const t=i.GLOBAL_OBJ.console,n={},r=Object.keys(a);r.forEach((e=>{const r=a[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const u=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return r.X?o.forEach((n=>{t[n]=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];e&&c((()=>{i.GLOBAL_OBJ.console[n](`${s}[${n}]:`,...r)}))}})):o.forEach((e=>{t[e]=()=>{}})),t}()},25439:function(e,t,n){"use strict";n.d(t,{DM:function(){return s},Db:function(){return c},EG:function(){return u},YO:function(){return l},jH:function(){return a},lE:function(){return h}});var r=n(59769),i=n(71671);function s(){const e=i.GLOBAL_OBJ,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(r){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function o(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function a(e){const{message:t,event_id:n}=e;if(t)return t;const r=o(e);return r?r.type&&r.value?`${r.type}: ${r.value}
1`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function c(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function u(e,t){const n=o(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function l(e){if(e&&e.__sentry_captured__)return!0;try{(0,r.xp)(e,"__sentry_captured__",!0)}catch(t){}return!1}function h(e){return Array.isArray(e)?e:[e]}},52166:function(e,t,n){"use strict";n.d(t,{$y:function(){return a},KV:function(){return s},l$:function(){return o}});var r=n(79260);e=n.hmd(e);var i=n(34155);function s(){return!(0,r.n)()&&"[object process]"===Object.prototype.toString.call("undefined"!==typeof i?i:0)}function o(e,t){return e.require(t)}function a(t){let n;try{n=o(e,t)}catch(r){}try{const{cwd:r}=o(e,"process");n=o(e,`${r()}/node_modules/${t}`)}catch(r){}return n}},93968:function(e,t,n){"use strict";n.d(t,{Fv:function(){return a},Qy:function(){return c}});var r=n(13444);function i(){const e="function"===typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++){if(t[e]===n)return!0}return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}var s=n(59769),o=n(88745);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;try{return u("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:102400;const r=a(e,t);return h(r)>n?c(e,t-1,n):r}function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i();const[c,h]=a;if(null==t||["number","boolean","string"].includes(typeof t)&&!(0,r.i2)(t))return t;const d=l(e,t);if(!d.startsWith("[object "))return d;if(t.__sentry_skip_normalization__)return t;const f="number"===typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===f)return d.replace("object ","");if(c(t))return"[Circular ~]";const p=t;if(p&&"function"===typeof p.toJSON)try{return u("",p.toJSON(),f-1,o,a)}catch(v){}const m=Array.isArray(t)?[]:{};let g=0;const y=(0,s.Sh)(t);for(const r in y){if(!Object.prototype.hasOwnProperty.call(y,r))continue;if(g>=o){m[r]="[MaxProperties ~]";break}const e=y[r];m[r]=u(r,e,f-1,o,a),g++}return h(t),m}function l(e,t){try{if("domain"===e&&t&&"object"===typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!==typeof n.g&&t===n.g)return"[Global]";if(t===window)return"[Window]";if("undefined"!==typeof document&&t===document)return"[Document]";if((0,r.y1)(t))return"[VueViewModel]";if((0,r.Cy)(t))return"[SyntheticEvent]";if("number"===typeof t&&t!==t)return"[NaN]";if("function"===typeof t)return`[Function: ${(0,o.$P)(t)}]`;if("symbol"===typeof t)return`[${String(t)}]`;if("bigint"===typeof t)return`[BigInt: ${String(t)}]`;const i=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(i)?`[HTMLElement: ${i}]`:`[object ${i}]`}catch(i){return`**non-serializable** (${i})`}}function h(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}},59769:function(e,t,n){"use strict";n.d(t,{$Q:function(){return l},HK:function(){return h},Jr:function(){return y},Sh:function(){return f},_j:function(){return d},hl:function(){return c},xp:function(){return u},zf:function(){return g}});var r=n(92353),i=n(99001),s=n(13444),o=n(47744),a=n(92217);function c(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"===typeof i&&l(i,r),e[t]=i}function u(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(r){i.X&&o.kg.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function l(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,u(e,"__sentry_original__",t)}catch(n){}}function h(e){return e.__sentry_original__}function d(e){return Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}function f(e){if((0,s.VZ)(e))return{message:e.message,name:e.name,stack:e.stack,...m(e)};if((0,s.cO)(e)){const t={type:e.type,target:p(e.target),currentTarget:p(e.currentTarget),...m
1(e)};return"undefined"!==typeof CustomEvent&&(0,s.V9)(e,CustomEvent)&&(t.detail=e.detail),t}return e}function p(e){try{return(0,s.kK)(e)?(0,r.Rt)(e):Object.prototype.toString.call(e)}catch(t){return"<unknown>"}}function m(e){if("object"===typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;const n=Object.keys(f(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,a.$G)(n[0],t);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:(0,a.$G)(e,t)}return""}function y(e){return v(e,new Map)}function v(e,t){if(function(e){if(!(0,s.PO)(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.keys(e))"undefined"!==typeof e[i]&&(r[i]=v(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push(v(e,t))})),r}return e}},96139:function(e,t,n){"use strict";n.d(t,{JY:function(){return r},Q:function(){return s},WG:function(){return o}});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function i(e,t){return e[t]||e.all||0}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();return i(e,t)>n}function o(e,t){let{statusCode:n,headers:i}=t,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();const o={...e},a=i&&i["x-sentry-rate-limits"],c=i&&i["retry-after"];if(a)for(const r of a.trim().split(",")){const[e,t]=r.split(":",2),n=parseInt(e,10),i=1e3*(isNaN(n)?60:n);if(t)for(const r of t.split(";"))o[r]=s+i;else o.all=s+i}else c?o.all=s+r(c,s):429===n&&(o.all=s+6e4);return o}},88745:function(e,t,n){"use strict";n.d(t,{$P:function(){return u},Sq:function(){return o},pE:function(){return s}});const r=/\(error: (.*)\)/,i=/captureMessage|captureException/;function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[],s=e.split("\n");for(let o=t;o<s.length;o++){const e=s[o];if(e.length>1024)continue;const t=r.test(e)?e.replace(r,"$1"):e;if(!t.match(/\S*Error: /)){for(const e of i){const r=e(t);if(r){n.push(r);break}}if(n.length>=50)break}}return a(n)}}function o(e){return Array.isArray(e)?s(...e):e}function a(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),i.test(t[t.length-1].function||"")&&(t.pop(),i.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,50).map((e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"})))}const c="<anonymous>";function u(e){try{return e&&"function"===typeof e&&e.name||c}catch(t){return c}}},92217:function(e,t,n){"use strict";n.d(t,{$G:function(){return i},U0:function(){return a},nK:function(){return s}});var r=n(13444);function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"string"!==typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function s(e,t){if(!Array.isArray(e))return"";const n=[];for(let s=0;s<e.length;s++){const t=e[s];try{(0,r.y1)(t)?n.push("[VueViewModel]"):n.push(String(t))}catch(i){n.push("[value cannot be serialized]")}}return n.join(t)}function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!(0,r.HD)(e)&&((0,r.Kj)(t)?t.test(e):!!(0,r.HD)(t)&&(n?e===t:e.includes(t)))}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.some((t=>o(e,t,n)))}},3401:function(e,t,n){"use strict";n.d(t,{Ak:function(){return o},Du:function(){return a},t$:function(){return c}});var r=n(99001),i=n(47744);const s=(0,n(71671).R)();function o(){if(!("fetch"in s))return!1;
1try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function a(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function c(){if("string"===typeof EdgeRuntime)return!0;if(!o())return!1;if(a(s.fetch))return!0;let e=!1;const t=s.document;if(t&&"function"===typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=a(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){r.X&&i.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}},91782:function(e,t,n){"use strict";n.d(t,{$2:function(){return o},WD:function(){return s},cW:function(){return a}});var r,i=n(13444);function s(e){return new a((t=>{t(e)}))}function o(e){return new a(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(r||(r={}));class a{constructor(e){a.prototype.__init.call(this),a.prototype.__init2.call(this),a.prototype.__init3.call(this),a.prototype.__init4.call(this),this._state=r.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new a(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(i){r(i)}else n(t)},e=>{if(t)try{n(t(e))}catch(i){r(i)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new a(((t,n)=>{let r,i;return this.then((t=>{i=!1,r=t,e&&e()}),(t=>{i=!0,r=t,e&&e()})).then((()=>{i?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(r.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(r.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===r.PENDING&&((0,i.J8)(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{if(this._state===r.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===r.RESOLVED&&e[1](this._value),this._state===r.REJECTED&&e[2](this._value),e[0]=!0)}))}}}},48129:function(e,t,n){"use strict";n.d(t,{Z1:function(){return a},ph:function(){return s},yW:function(){return i}});var r=n(71671);function i(){return Date.now()/1e3}const s=function(){const{performance:e}=r.GLOBAL_OBJ;if(!e||!e.now)return i;const t=Date.now()-e.now(),n=void 0==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();let o;const a=(()=>{const{performance:e}=r.GLOBAL_OBJ;if(!e||!e.now)return void(o="none");const t=36e5,n=e.now(),i=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,a=s<t,c=e.timing&&e.timing.navigationStart,u="number"===typeof c?Math.abs(c+n-i):t;return a||u<t?s<=u?(o="timeOrigin",e.timeOrigin):(o="navigationStart",c):(o="dateNow",i)})()},78161:function(e,t,n){"use strict";n.d(t,{$p:function(){return u},KA:function(){return a},pT:function(){return c},qG:function(){return o}});var r=n(72151),i=n(25439);const s=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(e){if(!e)return;const t=e.match(s);if(!t)return;let n;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function a(e,t){const n=o(e),s=(0,r.EN)(t),{traceId:a,parentSpanId:c,parentSampled:u}=n||{};return n?{traceparentData:n,dynamicSamplingContext:s||{},propagationContext:{traceId:a||(0,i.DM)(),parentSpanId:c||(0,i.DM)().substring(16),spanId:(0,i.DM)().substring(16),sampled:u,dsc:s||{}}}:{traceparentData:n,dynamicSamplingContext:void 0,propagationContext:{traceId:a||(0,i.DM)(),spanId:(0,i.DM)().substring(16)}}}function c(e,t){const n=o(e),s=(0,r.EN)(t),{traceId:a,parentSpanId:c,parentSampled:u}=n||{};return n?{traceId:a||(0,i.DM)(),parentSpanId:c||(0,i.DM)().substring(16),spanId:(0,i.DM)().substring(16),sampled:u,dsc:s||{}}:{traceId:a||(0,i.DM)(),spanId:(0,i.DM)().substring(16)}}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,i.DM)(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,i.DM)().substring(16),n=arguments.length>2?arguments[2]:void 0,r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}},32932:function(e,t,n){"use strict";function r(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}
1function i(e){return e.split(/[\?#]/,1)[0]}function s(e){return e.split(/\\?\//).filter((e=>e.length>0&&","!==e)).length}n.d(t,{$A:function(){return s},en:function(){return r},rt:function(){return i}})},71671:function(e,t,n){"use strict";function r(e){return e&&e.Math==Math?e:void 0}n.d(t,{GLOBAL_OBJ:function(){return i},R:function(){return s},Y:function(){return o}});const i="object"==typeof globalThis&&r(globalThis)||r(window)||"object"==typeof self&&r(self)||"object"==typeof n.g&&r(n.g)||function(){return this}()||{};function s(){return i}function o(e,t,n){const r=n||i,s=r.__SENTRY__=r.__SENTRY__||{};return s[e]||(s[e]=t())}},1342:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{noSSR:function(){return o},default:function(){return a}});const r=n(38754),i=(n(67294),r._(n(24304)));function s(e){return{default:(null==e?void 0:e.default)||e}}function o(e,t){return delete t.webpack,delete t.modules,e(t)}function a(e,t){let n=i.default,r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};e instanceof Promise?r.loader=()=>e:"function"===typeof e?r.loader=e:"object"===typeof e&&(r={...r,...e}),r={...r,...t};const a=r.loader;return r.loadableGenerated&&(r={...r,...r.loadableGenerated},delete r.loadableGenerated),"boolean"!==typeof r.ssr||r.ssr?n({...r,loader:()=>null!=a?a().then(s):Promise.resolve(s((()=>null)))}):(delete r.webpack,delete r.modules,o(n,r))}("function"===typeof t.default||"object"===typeof t.default&&null!==t.default)&&"undefined"===typeof t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30043:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return r}});const r=n(38754)._(n(67294)).default.createContext(null)},24304:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return f}});const r=n(38754)._(n(67294)),i=n(30043);const s=[],o=[];let a=!1;function c(e){let t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((e=>(n.loading=!1,n.loaded=e,e))).catch((e=>{throw n.loading=!1,n.error=e,e})),n}function u(e,t){let n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),s=null;function c(){if(!s){const t=new l(e,n);s={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return s.promise()}if(!a){const e=n.webpack?n.webpack():n.modules;e&&o.push((t=>{for(const n of e)if(t.includes(n))return c()}))}function u(e,t){!function(){c();const e=r.default.useContext(i.LoadableContext);e&&Array.isArray(n.modules)&&n.modules.forEach((t=>{e(t)}))}();const o=r.default.useSyncExternalStore(s.subscribe,s.getCurrentValue,s.getCurrentValue);return r.default.useImperativeHandle(t,(()=>({retry:s.retry})),[]),r.default.useMemo((()=>{return o.loading||o.error?r.default.createElement(n.loading,{isLoading:o.loading,pastDelay:o.pastDelay,timedOut:o.timedOut,error:o.error,retry:s.retry}):o.loaded?r.default.createElement((t=o.loaded)&&t.default?t.default:t,e):null;var t}),[e,o])}return u.preload=()=>c(),u.displayName="LoadableComponent",r.default.forwardRef(u)}class l{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};const{_res:e,_opts:t}=this;e.loading&&("number"===typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout((()=>{this._update({pastDelay:!0})}),t.delay)),"number"===typeof t.timeout&&(this._timeout=setTimeout((()=>{this._update({timedOut:!0})}),t.timeout))),this._res.promise.then((()=>{this._update({}),this._clearTimeouts()})).catch((e=>{this._update({}),this._clearTimeouts()})),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach((e=>e()))}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function h(e){return u(c,e)}function d(e,t){let n=[];for(;e.length;){let r=e.pop();
1n.push(r(t))}return Promise.all(n).then((()=>{if(e.length)return d(e,t)}))}h.preloadAll=()=>new Promise(((e,t)=>{d(s).then(e,t)})),h.preloadReady=e=>(void 0===e&&(e=[]),new Promise((t=>{const n=()=>(a=!0,t());d(o,e).then(n,n)}))),window.__NEXT_PRELOADREADY=h.preloadReady;const f=h},597:function(e,t,n){var r=n(34155);n(91479);var i=n(67294);function s(e){return e&&"object"===typeof e&&"default"in e?e:{default:e}}var o=s(i);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c="undefined"!==typeof r&&r.env&&!0,u=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,i=t.optimizeForSpeed,s=void 0===i?c:i;h(u(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",h("boolean"===typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,n,r,i=e.prototype;return i.setOptimizeForSpeed=function(e){h("boolean"===typeof e,"`setOptimizeForSpeed` accepts a boolean"),h(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},i.isOptimizeForSpeed=function(){return this._optimizeForSpeed},i.inject=function(){var e=this;if(h(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed)return this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),void(this._optimizeForSpeed||(c||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0));this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"===typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},i.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},i.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},i.insertRule=function(e,t){if(h(u(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!==typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(i){return c||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},i.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(i){c||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];h(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},i.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];h(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},i.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h((function(e){return e&&e.parentNode.removeChild(e)})),this._tags=[]},i.cssRules=function(){var e=this;return this._tags.reduce((function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,(function(t){return t.cssText===e._deletedRulePlaceholder?null:t}))):t.push(null),t}),[])},i.makeStyleTag=function(e,t,n){t&&h(u(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return n?i.insertBefore(r,n):i.appendChild(r),r},t=e,(n=[{key:"length",get:function(){return this._rulesCount}}])&&a(t.prototype,n),r&&a(t,r),e}();function h(e,t){if(!e)throw new Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},f={};function p(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return f[r]||(f[r]="jsx-"+d(e+"-"+n)),f[r]}function m(e,t){var n=e+t;return f[n]||(f[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),f[n]}var g=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,i=t.optimizeForSpeed,s=void 0!==i&&i;this._sheet=r||new l({name:"styled-jsx",optimizeForSpeed:s}),this._sheet.inject(),r&&"boolean"===typeof s&&(this._sheet.setOptimizeForSpeed(s),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce((function(e,t){return e[t]=0,e}),{}));var n=this.getIdAndRules(e),r=n.styleId,i=n.rules;if(r in this._instancesCounts)this._instancesCounts[r]+=1;else{var s=i.map((function(e){return t._sheet.insertRule(e)})).filter((function(e){return-1!==e}));this._indices[r]=s,this._instancesCounts[r]=1}},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw new Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach((function(e){return t._sheet.deleteRule(e)})),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map((function(t){return[t,e._fromServer[t]]})):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map((function(t){return[t,e._indices[t].map((function(e){return n[e].cssText})).join(e._optimizeForSpeed?"":"\n")]})).filter((function(e){return Boolean(e[1])})))},t.styles=function(e){return function(e,t){return void 0===t&&(t={}),e.map((function(e){var n=e[0],r=e[1];return o.default.createElement("style",{id:"__"+n,key:"__"+n,nonce:t.nonce?t.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})}))}(this.cssRules(),e)},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var i=p(r,n);return{styleId:i,rules:Array.isArray(t)?t.map((function(e){return m(i,e)})):[m(i,t)]}}return{styleId:p(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce((function(e,t){return e[t.id.slice(2)]=t,e}),{})},e}();var y=i.createContext(null);function v(){return new g}function b(){return i.useContext(y)}y.displayName="StyleSheetContext";var _=o.default.useInsertionEffect||o.default.useLayoutEffect,w=v();function S(e){var t=w||b();return t?(_((function(){return t.add(e),function(){t.remove(e)}}),[e.id,String(e.dynamic)]),null):null}S.dynamic=function(e){return e.map((function(e){return p(e[0],e[1])})).join(" ")},t.style=S},5379:function(e,t,n){"use strict";e.exports=n(597).style},11927:function(e,t,n){"use strict";var r,i=n(6823),s=n(24367),o=n(64537),a=n(34155);!function(e){e.Light="light",e.Dark="light"}(r||(r={}));const{COUNTDOWNS:c}=o.USAGE_FIELDS,u={site:{name:"Countdown Timer",description:"Publish Countdown Timer to Facebook",themeColor:"#ffffff",themeColorDark:"#0a0a0a",siteUrl:"https://www.countdown-timer.app/",siteName:"Countdown Timer",twitterHandle:"",githubHandle:"",convertKitFormId:"",locale:a.env.DEFAULT_LOCALE,ogImage:"/assets/images/ogImage.jpg"},firebase:{apiKey:"AIzaSyCgOTzjxacv0Qfdc3AaXbFTDxyjoM2QOZo",authDomain:"countdowntimer-7de22.firebaseapp.com",projectId:"countdowntimer-7de22",storageBucket:"countdowntimer-7de22.appspot.com",messagingSenderId:a.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,appId:"1:398978580630:web
1:f5a0b5de763a85cdcb42b7",measurementId:"G-Q7K6SC4MN2"},auth:{enableMultiFactorAuth:!1,requireEmailVerification:"true"===a.env.NEXT_PUBLIC_REQUIRE_EMAIL_VERIFICATION,providers:{emailPassword:!0,phoneNumber:!1,emailLink:!1,facebook:!0,oAuth:[s._O,s.hJ]}},environment:"production",emulatorHost:a.env.NEXT_PUBLIC_EMULATOR_HOST,emulator:"true"===a.env.NEXT_PUBLIC_EMULATOR,production:!0,enableThemeSwitcher:!1,theme:"light",paths:{signIn:"/auth/sign-in",signUp:"/auth/sign-up",emailLinkSignIn:"/auth/link",createCountdown:"/create-countdown",onboarding:"/onboarding",appHome:"/editor",posts:"/posts",settings:{profile:"/settings/profile",authentication:"/settings/profile/authentication",email:"/settings/profile/email",password:"/settings/profile/password"},api:{checkout:"/api/ls/checkout",customerPortal:"/api/ls/customer-portal"}},navigation:{style:i.$.Sidebar},appCheckSiteKey:a.env.NEXT_PUBLIC_APPCHECK_KEY,emailEtherealTestAccount:{email:a.env.ETHEREAL_EMAIL,password:a.env.ETHEREAL_PASSWORD},sentry:{dsn:a.env.SENTRY_DSN},subscriptions:{products:[{name:o.T.FREE,productId:1,description:"Completely free for basic usage",badge:"Includes our branding",features:["30 minutes Update Interval","Up to 7 days Countdown Duration","1 simultaneous countdown"],plans:[{name:"",price:"$0",variantId:1}],limits:{[c]:1}},{name:o.T.PRO,badge:"Most Popular",recommended:!0,productId:127164,description:"Essential for professionals",features:["10 minutes Update Interval","Unlimited Countdown Duration","5 simultaneous countdowns","Remove our branding"],plans:[{name:"7 Days Pass",days:7,price:"$9.99",variantId:147729},{name:"14 Days Pass",days:14,price:"$13.99",variantId:147731},{name:"30 Days Pass",days:30,price:"$19.99",variantId:147732},{name:"60 Days Pass",days:60,price:"$31.99",variantId:147733},{name:"90 Days Pass",days:90,price:"$39.99",variantId:147735},{name:"180 Days Pass",days:180,price:"$55.99",variantId:147737},{name:"365 Days Pass",days:365,price:"$99.99",variantId:147738}],limits:{[c]:5}},{name:o.T.CUSTOM,description:"For agencies and large teams",badge:"",features:["Custom design","Unlimited simultaneous countdowns","Custom update interval"],plans:[{name:"",price:"From $399",variantId:2,trialPeriodDays:0,label:"Contact us",href:"mailto:[email protected]"}],limits:{}}]},facebook:{api:"https://graph.facebook.com/v13.0"},screenshot:{api:"https://screenshot-th6qsws4wq-uc.a.run.app"},ORIENTATION_DIMENSIONS:{square:{width:1200,height:1200},portrait:{width:630,height:1200},landscape:{width:1200,height:630}}};t.default=u},23754:function(e,t,n){"use strict";n.d(t,{w:function(){return r}});const r=(0,n(67294).createContext)(void 0)},67181:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});const r=(0,n(67294).createContext)({collapsed:!1,setCollapsed:e=>e})},79918:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(67294),i=n(11927);const s=(0,r.createContext)({theme:i.default.theme,setTheme:e=>e})},10005:function(e,t,n){"use strict";n.d(t,{a:function(){return r}});const r=(0,n(67294).createContext)({userSession:void 0,setUserSession:e=>e})},60811:function(e,t,n){"use strict";n.d(t,{I:function(){return s}});var r=n(67294),i=n(23754);function s(){return(0,r.useContext)(i.w)}},36449:function(e,t,n){"use strict";function r(){return!0}n.d(t,{j:function(){return r}})},93528:function(e,t,n){"use strict";n.d(t,{G:function(){return o}});var r=n(67294),i=n(1762),s=n(60811);function o(){const e=(0,r.useRef)({}),t=function(){const e=(0,s.I)(),t=function(){const e=(0,r.useContext)(i.yf);return(0,r.useCallback)((async()=>{try{if(!e)return;const t=!1,{getToken:r}=await Promise.resolve().then(n.bind(n,33586)),{token:i}=await r(e,t);return i}catch(t){return}}),[e])}();return(0,r.useCallback)((async()=>{const n=await t();return{csrfToken:e,appCheckToken:n}}),[e,t])}();return(0,r.useCallback)((async n=>{const r=await t(),i=JSON.stringify(n.body);return e.current||(e.current=n.headers??{}),r.appCheckToken&&(e.current["X-Firebase-AppCheck"]=r.appCheckToken),r.csrfToken&&(e.current["x-csrf-token"]=r.csrfToken),async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST";const r={method:n,headers:{accept:"application/json","Content-Type":"application/json",...(arguments.length>3?arguments[3]:void 0)??{}}},i=["POST","PUT","DELETE"].includes(n);t&&i&&(r.body=t);try{const t=await fetch(e,r);return t.ok?await t.json():Promise.reject(await t.json())}catch(s){return Promise.reject(s)}}(n.path,i,n.method,e.current)}),[t])}},62430:function(e,t,n){"use strict";n.d(t,{E:function(){return s}});var r=n(67294),i=n(10005);function s(){const{userSession:e}=(0,r.useContext)(i.a);return e}},6823:function(e,t,n){"use strict";var r;n.d(t,{$:function(){return r}}),function(e){e.Sidebar="sidebar",e.TopHeader="topHeader",e.Custom="custom"}(r||(r={}))},97644:function(e){"use strict";const t=["/hours-from-now","/hours-ago","/minutes-from-now","/weeks-left-in-the-year","/days-left-in-the-year","/day-of-year","/days-from-today","/weeks-from-today","/months-from-today","/days-ago","/weeks-ago","/years-ago","/age-calculator"],n=[...t,"/convert"];e.exports={HUB_ROUTES:t,ENGLISH_ONLY_ROUTES:n,isEnglishOnlyRoute:function(e){if(!e)return!1;const n=function(e){return e.length>1?e.replace(/\/+$/,""):e}(e);return t.includes(n)||"/convert"===n||n.startsWith("/convert/")}}},12891:function(e,t,n){"use strict";n.d(t,{Dc:function(){return f},JN:function(){return l},hR:function(){return c},kl:function(){return u},ln:function(){return m},r9:function(){return d},rN:function(){return g}});var r=n(11927),i=n(62286);const s="theme",o=r.default.site.themeColor,a=r.default.site.themeColorDark,c="dark",u="light",l="system",h=r.default.theme;function d(){return(0,i.parseCookies)(null).theme??h}function f(e){const t=document.firstElementChild;switch(t.classList.remove(c),t.classList.remove(u),e){case l:return(0,i.setCookie)(null,s,l),void(m()&&t.classList.add(c));case c:return t.classList.add(c),p(a),void(0,i.setCookie)(null,s,c);case u:return p(o),void(0,i.setCookie)(null,s,u)}}function p(e){const t=()=>{let t=document.querySelector("meta[name='theme-color']");t?t.setAttribute("content",e):(t=document.createElement("meta"),t.setAttribute("name","theme-color"),t.setAttribute("content",e),document.head.appendChild(t))};"complete"===document.readyState?t():document.addEventListener("DOMContentLoaded",t)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function g(){f(d())}},95363:function(e,t,n){"use strict";n.d(t,{g:function(){return r}});const r=(0,n(67294).createContext)({organization:void 0,setOrganization:e=>e})},64537:function(e,t,n){"use strict";var r,i;n.d(t,{Q:function(){return s},T:function(){return i},USAGE_FIELDS:function(){return r}}),function(e){e.COUNTDOWNS="countdowns"}(r||(r={})),function(e){e.FREE="Free",e.CUSTOM="Custom",e.PRO="Pro"}(i||(i={}));const s=["active"]},69138:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Z}});var r=n(85893),i=n(82729),s=n.n(i),o=n(2832),a=n.n(o),c=n(5379),u=n.n(c),l=(n(3971),n(76762),n(67294)),h=n(5152),d=n.n(h),f=n(9008),p=n.n(f),m=n(4298),g=n.n(m),y=n(11163),v=n.n(y),b=n(6311),_=n(11927),w=n(1762);var S=function(e){let{children:t,config:n}=e;return(0,r.jsx)(w.RE,{firebaseConfig:n,children:t})},k=n(24367),I=n(36449),E=n(93528),T=n(44334);var C=n(34155);const x=e=>{let{children:t,onAuthStateChange:n}=e;const i=(0,w.aC)();return(0,l.useEffect)((()=>{const e=i.onIdTokenChanged(n);return()=>e()}),[i,n]),(0,r.jsx)(r.Fragment,{children:t})};function O(e){let{userSession:t,setUserSession:n,children:i,useEmulator:s,language:o}=e;const a=(0,w.$N)(),{trigger:c}=function(){const e=(0,E.G)();return(0,T.Z)("/api/session/sign-out",(t=>e({path:t})))}(),u=(0,l.useRef)(),h=(0,I.j)()?k.AP:k.BV,d=(0,k.uJ)(a,{persistence:h}),f=s&&!("emulator"in d.config);if(d.languageCode=o,f){const e=function(){const e=C.env.NEXT_PUBLIC_FIREBASE_EMULATOR_HOST,t=C.env.NEXT_PUBLIC_FIREBASE_AUTH_EMULATOR_PORT;return["http://",e,":",t].join("")}();(0,k.S$)(d,e)}const p=(0,l.useCallback)((async e=>{if(e){const r={auth:e,data:t?.data};return u.current=e,n(r)}if(u.current)try{await c()}finally{n(void 0),u.current=void 0}}),[n,c,t?.data]);return(0,r.jsx)(w.Ho,{sdk:d,children:(0,r.jsx)(x,{onAuthStateChange:p,children:i})})}var A=n(33586),R=n(34155);const N=_.default.appCheckSiteKey;var D=e=>{let{children:t}=e;const n=(0,w.$N)(),i=(0,l.useMemo)((()=>
1{if(!N||!(0,I.j)())return;const e=new A.z9(N);return(0,A.yu)(n,{provider:e,isTokenAutoRefreshEnabled:!0})}),[n]);return(0,l.useEffect)((()=>{_.default.production||function(){const e=R.env.NEXT_PUBLIC_APPCHECK_DEBUG_TOKEN;Object.assign(window,{FIREBASE_APPCHECK_DEBUG_TOKEN:e})}()}),[]),i?(0,r.jsx)(w.mG,{sdk:i,children:t}):(0,r.jsx)(r.Fragment,{children:t})};var P=n(62430);function L(){!function(){const e=(0,P.E)()?.auth?.uid;(0,l.useEffect)((()=>{(0,I.j)()&&(async()=>{const{getAnalytics:t,setUserId:r}=await n.e(8887).then(n.bind(n,98887));e&&r(t(),e)})()}),[e])}(),function(){const e=(0,l.useCallback)((async()=>{if(!(0,I.j)())return;const{getAnalytics:e,logEvent:t}=await n.e(8887).then(n.bind(n,98887)),r=document.title;t(e(),"screen_view",{firebase_screen:r,firebase_screen_class:r})}),[]);(0,l.useEffect)((()=>(v().events.on("routeChangeComplete",e),()=>{v().events.off("routeChangeComplete",e)})),[e])}()}function M(e){const{data:t,status:i}=(0,w.ZE)((async e=>{const{getAnalytics:t}=await n.e(8887).then(n.bind(n,98887));return t(e)}));return"success"!==i?(0,r.jsx)(r.Fragment,{children:e.children}):(0,r.jsx)(w.ng,{sdk:t,children:(0,r.jsx)(F,{children:e.children})})}function F(e){let{children:t}=e;return L(),(0,r.jsx)(r.Fragment,{children:t})}var j=e=>{let{children:t}=e;return _.default.emulator||!(0,I.j)()?(0,r.jsx)(r.Fragment,{children:t}):(0,r.jsx)(M,{children:t})},U=n(12891),$=n(97644),B=n(62286);const V="sidebarState";var z=function(e){const[t,n]=(0,l.useState)(e);return[t,(0,l.useCallback)((e=>{n(e),function(e){(0,B.setCookie)(null,V,e?"collapsed":"expanded")}(e)}),[])]},q=n(95363),H=n(10005),W=n(67181),G=n(79918),K=n(23754);const X=["/countdown-to","/days-until","/how-long-until","/time/","/date/","/convert","/sleepcalculator"],J=["/countdown-to/embed","/share/embed"],Y=(d()((()=>n.e(3271).then(n.bind(n,43271))),{loadableGenerated:{webpack:()=>[43271]},ssr:!1}),d()((()=>n.e(2650).then(n.bind(n,32650))),{loadableGenerated:{webpack:()=>[32650]},ssr:!1})),Q=a();var Z=(0,b.Jc)((function(e){const{Component:t}=e,n=e.pageProps,{emulator:i,firebase:s}=_.default,{i18n:o}=(0,b.$G)(),a=(0,y.useRouter)(),c=(0,I.j)()&&(!!(u=a.pathname)&&!J.some((e=>u.startsWith(e)))&&(!!$.HUB_ROUTES.includes(u)||X.some((e=>u.startsWith(e)))));var u;const h=a.asPath.split("?")[0].split("#")[0].replace(/\/+$/,"")||"/",d=`https://www.countdown-timer.app${a.locale!==a.defaultLocale?`/${a.locale}`:""}${h}`,f=!a.pathname.startsWith("/auth")&&!a.pathname.startsWith("/dashboard")&&!a.pathname.startsWith("/settings")&&!a.pathname.startsWith("/onboarding")&&!a.pathname.startsWith("/editor")&&!a.pathname.startsWith("/admin")&&!a.pathname.startsWith("/posts")&&!a.pathname.startsWith("/share")&&"/[...organization]"!==a.pathname,m="/404"===a.pathname||"/500"===a.pathname||"/_error"===a.pathname,v=(0,$.isEnglishOnlyRoute)(a.pathname)?[a.defaultLocale].filter(Boolean):a.locales??[],w=(0,l.useMemo)((()=>({auth:n.session,data:n.user})),[n]),[k,E]=(0,l.useState)(n.organization),[T,C]=(0,l.useState)(w),x=(0,l.useCallback)((()=>{E(n.organization)}),[n.organization]),A=(0,l.useCallback)((()=>{w.auth&&C(w)}),[w]);return(0,l.useEffect)(x,[x]),(0,l.useEffect)(A,[A]),(0,r.jsx)(S,{config:s,children:(0,r.jsx)(D,{children:(0,r.jsx)(O,{language:o.language,userSession:T,setUserSession:C,useEmulator:i,children:(0,r.jsx)(H.a.Provider,{value:{userSession:T,setUserSession:C},children:(0,r.jsx)(q.g.Provider,{value:{organization:k,setOrganization:E},children:(0,r.jsxs)(j,{children:[(0,r.jsxs)(p(),{children:[!m&&(0,r.jsx)("link",{rel:"canonical",href:d},"canonical"),f&&!m&&(0,r.jsxs)(r.Fragment,{children:[v.map((e=>(0,r.jsx)("link",{rel:"alternate",hrefLang:e,href:`https://www.countdown-timer.app${e!==a.defaultLocale?`/${e}`:""}${h}`},`hreflang-${e}`))),(0,r.jsx)("link",{rel:"alternate",hrefLang:"x-default",href:`https://www.countdown-timer.app${h}`},"hreflang-default")]})]}),c&&(0,r.jsx)(g(),{src:"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9722963772607446",strategy:"afterInteractive",crossOrigin:"anonymous","data-ad-client":"ca-pub-9722963772607446"}),(0,r.jsx)(Y,{}),(0,r.jsx)(ee,{state:n.ui,children:(0,r.jsxs)(K.w.Provider,{value:n.csrfToken,children:[(0,r.jsx)(te,{}),(0,r.jsx)(t,{...n})]})})]})})})})})})}));function ee(e){const t=e.state,n="collapsed"===t?.sidebarState,i=t?.theme??_.default.theme,[s,o]=z(n),[a,c]=(0,l.useState)(i);return(0,r.jsx)(W.l.Provider,{value:{collapsed:s,setCollapsed:o},children:(0,r.jsx)(G.N.Provider,{value:{theme:a,setTheme:c},children:e.children})})}function te(){return(0,r.jsx)(u(),{id:"d963ac33bc49eef4",dynamic:[s().style.fontFamily,Q.style.fontFamily],children:`html{--font-family-sans:${s().style.fontFamily}, '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Ubuntu',\n            's
1ans-serif';--font-family-heading:${Q.style.fontFamily}, '-apple-system', 'BlinkMacSystemFont'}`})}(0,I.j)()&&(0,U.rN)()},91479:function(){},76762:function(){},3971:function(){},2832:function(e){e.exports={style:{fontFamily:"'__Montserrat_cd9515', '__Montserrat_Fallback_cd9515', system-ui, Helvetica Neue, Helvetica, Arial",fontStyle:"normal"},className:"__className_cd9515",variable:"__variable_cd9515"}},82729:function(e){e.exports={style:{fontFamily:"'__Open_Sans_1824e1', '__Open_Sans_Fallback_1824e1', system-ui, Helvetica Neue, Helvetica, Arial",fontStyle:"normal"},className:"__className_1824e1",variable:"__variable_1824e1"}},5152:function(e,t,n){e.exports=n(1342)},9008:function(e,t,n){e.exports=n(79201)},11163:function(e,t,n){e.exports=n(59974)},4298:function(e,t,n){e.exports=n(85354)},62286:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.destroyCookie=t.setCookie=t.parseCookies=void 0;var i=n(76489),s=n(69328),o=n(51022);function a(e,t){var n,r;return(null===(r=null===(n=null===e||void 0===e?void 0:e.req)||void 0===n?void 0:n.headers)||void 0===r?void 0:r.cookie)?i.parse(e.req.headers.cookie,t):o.isBrowser()?i.parse(document.cookie,t):{}}function c(e,t,n,a){var c,u;if(void 0===a&&(a={}),(null===(c=null===e||void 0===e?void 0:e.res)||void 0===c?void 0:c.getHeader)&&e.res.setHeader){if(null===(u=null===e||void 0===e?void 0:e.res)||void 0===u?void 0:u.finished)return console.warn('Not setting "'+t+'" cookie. Response has finished.'),console.warn("You should set cookie before res.send()"),{};var l=e.res.getHeader("Set-Cookie")||[];"string"===typeof l&&(l=[l]),"number"===typeof l&&(l=[]);var h=s.parse(l,{decodeValues:!1}),d=o.createCookie(t,n,a),f=[];h.forEach((function(e){if(!o.areCookiesEqual(e,d)){var t=i.serialize(e.name,e.value,r({encode:function(e){return e}},e));f.push(t)}})),f.push(i.serialize(t,n,a)),e.res.setHeader("Set-Cookie",f)}if(o.isBrowser()){if(a&&a.httpOnly)throw new Error("Can not set a httpOnly cookie in the browser.");document.cookie=i.serialize(t,n,a)}return{}}function u(e,t,n){return c(e,t,"",r(r({},n||{}),{maxAge:-1}))}t.parseCookies=a,t.setCookie=c,t.destroyCookie=u,t.default={set:c,get:a,destroy:u}},51022:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t){var n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++){var s=n[i];if(e[s]!==t[s])return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.areCookiesEqual=t.hasSameProperties=t.createCookie=t.isBrowser=void 0,t.isBrowser=function(){return"undefined"!==typeof window},t.createCookie=function(e,t,r){var i=r.sameSite;!0===i&&(i="strict"),void 0!==i&&!1!==i||(i="lax");var s=n(n({},r),{sameSite:i});return delete s.encode,n({name:e,value:t},s)},t.hasSameProperties=r,t.areCookiesEqual=function(e,t){var i=e.sameSite===t.sameSite;return"string"===typeof e.sameSite&&"string"===typeof t.sameSite&&(i=e.sameSite.toLowerCase()===t.sameSite.toLowerCase()),r(n(n({},e),{sameSite:void 0}),n(n({},t),{sameSite:void 0}))&&i}},34155:function(e){var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"===typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"===typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&d())}function d(){if(!u){var e=o(h);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new f(e,t)),1!==c.length||u||o(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},69921:function(e,t){"use strict";var n="function"===typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function w(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case h:case s:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case u:case d:case g:case m:case c:return e;default:return t}}case i:return t}}}function S(e){return w(e)===h}t.AsyncMode=l,t.ConcurrentMode=h,t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=s,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||w(e)===l},t.isConcurrentMode=S,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===s},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===o},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===s||e===h||e===a||e===o||e===f||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===c||e.$$typeof===u||e.$$typeof===d||e.$$typeof===v||e.$$typeof===b||e.$$typeof===_||e.$$typeof===y)},t.typeOf=w},59864:function(e,t,n){"use strict";e.exports=n(69921)},69328:function(e){"use strict";var t={decodeValues:!0,map:!1,silent:!1};function n(e){return"string"===typeof e&&!!e.trim()}function r(e,r){var i=e.split(";").filter(n),s=function(e){var t="",n="",r=e.split("=");r.length>1?(t=r.shift(),n=r.join("=")):n=e;return{name:t,value:n}}(i.shift()),o=s.name,a=s.value;r=r?Object.assign({},t,r):t;try{a=r.decodeValues?decodeURIComponent(a):a}catch(u){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+a+"'. Set options.decodeValues to false to disable this feature.",u)}var c={name:o,value:a};
1return i.forEach((function(e){var t=e.split("="),n=t.shift().trimLeft().toLowerCase(),r=t.join("=");"expires"===n?c.expires=new Date(r):"max-age"===n?c.maxAge=parseInt(r,10):"secure"===n?c.secure=!0:"httponly"===n?c.httpOnly=!0:"samesite"===n?c.sameSite=r:c[n]=r})),c}function i(e,i){if(i=i?Object.assign({},t,i):t,!e)return i.map?{}:[];if(e.headers)if("function"===typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var s=e.headers[Object.keys(e.headers).find((function(e){return"set-cookie"===e.toLowerCase()}))];s||!e.headers.cookie||i.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=s}if(Array.isArray(e)||(e=[e]),(i=i?Object.assign({},t,i):t).map){return e.filter(n).reduce((function(e,t){var n=r(t,i);return e[n.name]=n,e}),{})}return e.filter(n).map((function(e){return r(e,i)}))}e.exports=i,e.exports.parse=i,e.exports.parseString=r,e.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!==typeof e)return[];var t,n,r,i,s,o=[],a=0;function c(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,s=!1;c();)if(","===(n=e.charAt(a))){for(r=a,a+=1,c(),i=a;a<e.length&&"="!==(n=e.charAt(a))&&";"!==n&&","!==n;)a+=1;a<e.length&&"="===e.charAt(a)?(s=!0,a=i,o.push(e.substring(t,r)),t=a):a=r+1}else a+=1;(!s||a>=e.length)&&o.push(e.substring(t,e.length))}return o}},53250:function(e,t,n){"use strict";var r=n(67294);var i="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var l="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return a((function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})}),[e,n,t]),o((function(){return u(i)&&l({inst:i}),e((function(){u(i)&&l({inst:i})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},61688:function(e,t,n){"use strict";e.exports=n(53250)},71739:function(e){e.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},87462:function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{Z:function(){return r}})},25816:function(e,t,n){"use strict";n.d(t,{ZR:function(){return s.ZR},Jn:function(){return M},qX:function(){return N},Xd:function(){return R},Mq:function(){return j},C6:function(){return U},ZF:function(){return F},KN:function(){return $}});var r=n(8463),i=n(53333),s=n(74444);let o,a;const c=new WeakMap,u=new WeakMap,l=new WeakMap,h=new WeakMap,d=new WeakMap;let f={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("objectStoreNames"===t)return e.objectStoreNames||l.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return g(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function p(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(a||(a=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(y(this),t),g(c.get(this))}:function(...t){return g(e.apply(y(this),t))}:function(t,...n){const r=e.call(y(this),t,...n);return l.set(r,t.sort?t.sort():[t]),g(r)}}function m(e){return"function"===typeof e?p(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)}));u.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e))?new Proxy(e,f):e);var t}function g(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(g(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)}));return t.then((t=>{t instanceof IDBCursor&&c.set(t,e)}
1)).catch((()=>{})),d.set(t,e),t}(e);if(h.has(e))return h.get(e);const t=m(e);return t!==e&&(h.set(e,t),d.set(t,e)),t}const y=e=>d.get(e);const v=["get","getKey","getAll","getAllKeys","count"],b=["put","add","delete","clear"],_=new Map;function w(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(_.get(t))return _.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=b.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!v.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,i?"readwrite":"readonly");let o=s.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]};return _.set(t,s),s}f=(e=>({...e,get:(t,n,r)=>w(t,n)||e.get(t,n,r),has:(t,n)=>!!w(t,n)||e.has(t,n)}))(f);class S{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null===t||void 0===t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const k="@firebase/app",I="0.9.13",E=new i.Yd("@firebase/app"),T="[DEFAULT]",C={[k]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},x=new Map,O=new Map;function A(e,t){try{e.container.addComponent(t)}catch(n){E.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function R(e){const t=e.name;if(O.has(t))return E.debug(`There were multiple attempts to register component ${t}.`),!1;O.set(t,e);for(const n of x.values())A(n,e);return!0}function N(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}const D={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
1d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},P=new s.LL("app","Firebase",D);class L{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.wA("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw P.create("app-deleted",{appName:this._name})}}const M="9.23.0";function F(e,t={}){let n=e;if("object"!==typeof t){t={name:t}}const i=Object.assign({name:T,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!==typeof o||!o)throw P.create("bad-app-name",{appName:String(o)});if(n||(n=(0,s.aH)()),!n)throw P.create("no-options");const a=x.get(o);if(a){if((0,s.vZ)(n,a.options)&&(0,s.vZ)(i,a.config))return a;throw P.create("duplicate-app",{appName:o})}const c=new r.H0(o);for(const r of O.values())c.addComponent(r);const u=new L(n,i,c);return x.set(o,u),u}function j(e="[DEFAULT]"){const t=x.get(e);if(!t&&e===T&&(0,s.aH)())return F();if(!t)throw P.create("no-app",{appName:e});return t}function U(){return Array.from(x.values())}function $(e,t,n){var i;let s=null!==(i=C[e])&&void 0!==i?i:e;n&&(s+=`-${n}`);const o=s.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${s}" with version "${t}":`];return o&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void E.warn(e.join(" "))}R(new r.wA(`${s}-version`,(()=>({library:s,version:t})),"VERSION"))}const B="firebase-heartbeat-store";let V=null;function z(){return V||(V=function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=g(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(g(o.result),e.oldVersion,e.newVersion,g(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),a.then((e=>{s&&e.addEventListener("close",(()=>s())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a}("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)e.createObjectStore(B)}}).catch((e=>{throw P.create("idb-open",{originalErrorMessage:e.message})}))),V}async function q(e,t){try{const n=(await z()).transaction(B,"readwrite"),r=n.objectStore(B);await r.put(t,H(e)),await n.done}catch(n){if(n instanceof s.ZR)E.warn(n.message);else{const e=P.create("idb-set",{originalErrorMessage:null===n||void 0===n?void 0:n.message});E.warn(e.message)}}}function H(e){return`${e.name}!${e.options.appId}`}class W{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new K(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=G();if(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate!==t&&!this._heartbeatsCache.heartbeats.some((e=>e.date===t)))return this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}
1async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";const e=G(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),X(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),X(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),r=(0,s.L)(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}}function G(){return(new Date).toISOString().substring(0,10)}class K{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,s.hl)()&&(0,s.eu)().then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){return await async function(e){try{const t=await z();return await t.transaction(B).objectStore(B).get(H(e))}catch(t){if(t instanceof s.ZR)E.warn(t.message);else{const e=P.create("idb-get",{originalErrorMessage:null===t||void 0===t?void 0:t.message});E.warn(e.message)}}}(this.app)||{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return q(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return q(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function X(e){return(0,s.L)(JSON.stringify({version:2,heartbeats:e})).length}var J;J="",R(new r.wA("platform-logger",(e=>new S(e)),"PRIVATE")),R(new r.wA("heartbeat",(e=>new W(e)),"PRIVATE")),$(k,I,J),$(k,I,"esm2017"),$("fire-js","")},8463:function(e,t,n){"use strict";n.d(t,{H0:function(){return a},wA:function(){return i}});var r=n(74444);class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const s="[DEFAULT]";class o{constructor(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}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new r.BH;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(n){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),r=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}}getComponent(){return this.component}setComponent(e){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:s})}catch(t){}for(const[e,n]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:r});n.resolve(e)}catch(t){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[i,s]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(i)&&s.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(r){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===s?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(i){}var r;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:s:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class a{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new o(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},53333:function(e,t,n){"use strict";n.d(t,{Yd:function(){return u},in:function(){return i}});const r=[];var i;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.E
1RROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(i||(i={}));const s={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,a={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},c=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=a[t];if(!i)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[i](`[${r}]  ${e.name}:`,...n)};class u{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"===typeof e?s[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!==typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}},33586:function(e,t,n){"use strict";n.d(t,{z9:function(){return Q},getToken:function(){return ne},yu:function(){return te}});var r=n(25816),i=n(8463),s=n(74444),o=n(53333);const a=new Map,c={activated:!1,tokenObservers:[]},u={initialized:!1,enabled:!1};function l(e){return a.get(e)||Object.assign({},c)}function h(){return u}const d="https://content-firebaseappcheck.googleapis.com/v1",f=3e4,p=96e4;class m{constructor(e,t,n,r,i){if(this.operation=e,this.retryPolicy=t,this.getWaitDuration=n,this.lowerBound=r,this.upperBound=i,this.pending=null,this.nextErrorWaitInterval=r,r>i)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch((()=>{}))}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new s.BH,await(t=this.getNextRun(e),new Promise((e=>{setTimeout(e,t)}))),this.pending.resolve(),await this.pending.promise,this.pending=new s.BH,await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch((()=>{}))}catch(n){this.retryPolicy(n)?this.process(!1).catch((()=>{})):this.stop()}var t}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const e=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),e}}}const g={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},y=new s.LL("appCheck","AppCheck",g);function v(e=!1){var t;return e?null===(t=self.grecaptcha)||void 0===t?void 0:t.enterprise:self.grecaptcha}function b(e){if(!l(e).activated)throw y.create("use-before-activation",{appName:e.n
1ame})}function _(e){const t=Math.round(e/1e3),n=Math.floor(t/86400),r=Math.floor((t-3600*n*24)/3600),i=Math.floor((t-3600*n*24-3600*r)/60),s=t-3600*n*24-3600*r-60*i;let o="";return n&&(o+=w(n)+"d:"),r&&(o+=w(r)+"h:"),o+=w(i)+"m:"+w(s)+"s",o}function w(e){return 0===e?"00":e>=10?e.toString():"0"+e}async function S({url:e,body:t},n){const r={"Content-Type":"application/json"},i=n.getImmediate({optional:!0});if(i){const e=await i.getHeartbeatsHeader();e&&(r["X-Firebase-Client"]=e)}const s={method:"POST",body:JSON.stringify(t),headers:r};let o,a;try{o=await fetch(e,s)}catch(h){throw y.create("fetch-network-error",{originalErrorMessage:null===h||void 0===h?void 0:h.message})}if(200!==o.status)throw y.create("fetch-status-error",{httpStatus:o.status});try{a=await o.json()}catch(h){throw y.create("fetch-parse-error",{originalErrorMessage:null===h||void 0===h?void 0:h.message})}const c=a.ttl.match(/^([\d.]+)(s)$/);if(!c||!c[2]||isNaN(Number(c[1])))throw y.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${a.ttl}`});const u=1e3*Number(c[1]),l=Date.now();return{token:a.token,expireTimeMillis:l+u,issuedAtTimeMillis:l}}function k(e,t){const{projectId:n,appId:r,apiKey:i}=e.options;return{url:`${d}/projects/${n}/apps/${r}:exchangeDebugToken?key=${i}`,body:{debug_token:t}}}const I="firebase-app-check-store",E="debug-token";let T=null;function C(){return T||(T=new Promise(((e,t)=>{try{const n=indexedDB.open("firebase-app-check-database",1);n.onsuccess=t=>{e(t.target.result)},n.onerror=e=>{var n;t(y.create("storage-open",{originalErrorMessage:null===(n=e.target.error)||void 0===n?void 0:n.message}))},n.onupgradeneeded=e=>{const t=e.target.result;if(0===e.oldVersion)t.createObjectStore(I,{keyPath:"compositeKey"})}}catch(n){t(y.create("storage-open",{originalErrorMessage:null===n||void 0===n?void 0:n.message}))}})),T)}async function x(e,t){const n=(await C()).transaction(I,"readwrite"),r=n.objectStore(I).put({compositeKey:e,value:t});return new Promise(((e,t)=>{r.onsuccess=t=>{e()},n.onerror=e=>{var n;t(y.create("storage-set",{originalErrorMessage:null===(n=e.target.error)||void 0===n?void 0:n.message}))}}))}async function O(e){const t=(await C()).transaction(I,"readonly"),n=t.objectStore(I).get(e);return new Promise(((e,r)=>{n.onsuccess=t=>{const n=t.target.result;e(n?n.value:void 0)},t.onerror=e=>{var t;r(y.create("storage-get",{originalErrorMessage:null===(t=e.target.error)||void 0===t?void 0:t.message}))}}))}function A(e){return`${e.options.appId}-${e.name}`}const R=new o.Yd("@firebase/app-check");async function N(e){if((0,s.hl)()){let n;try{n=await function(e){return O(A(e))}(e)}catch(t){R.warn(`Failed to read token from IndexedDB. Error: ${t}`)}return n}}function D(e,t){return(0,s.hl)()?function(e,t){return x(A(e),t)}(e,t).catch((e=>{R.warn(`Failed to write token to IndexedDB. Error: ${e}`)})):Promise.resolve()}async function P(){let e;try{e=await O(E)}catch(n){}if(e)return e;{const e=(0,s.k$)();return(t=e,x(E,t)).catch((e=>R.warn(`Failed to persist debug token to IndexedDB. Error: ${e}`))),e}var t}function L(){return h().enabled}async function M(){const e=h();if(e.enabled&&e.token)return e.token.promise;throw Error("\n            Can't get debug token in production mode.\n        ")}const F={error:"UNKNOWN_ERROR"};async function j(e,t=!1){const n=e.app;b(n);const r=l(n);let i,s=r.token;if(s&&!q(s)&&(r.token=void 0,s=void 0),!s){const e=await r.cachedTokenPromise;e&&(q(e)?s=e:await D(n,void 0))}if(!t&&s&&q(s))return{token:s.token};let o,a=!1;if(L()){r.exchangeTokenPromise||(r.exchangeTokenPromise=S(k(n,await M()),e.heartbeatServiceProvider).finally((()=>{r.exchangeTokenPromise=void 0})),a=!0);const t=await r.exchangeTokenPromise;return await D(n,t),r.token=t,{token:t.token}}try{r.exchangeTokenPromise||(r.exchangeTokenPromise=r.provider.getToken().finally((()=>{r.exchangeTokenPromise=void 0})),a=!0),s=await l(n).exchangeTokenPromise}catch(c){"appCheck/throttled"===c.code?R.warn(c.message):R.error(c),i=c}return s?i?o=q(s)?{token:s.token,internalError:i}:H(i):(o={token:s.token},r.token=s,await D(n,s)):o=H(i),a&&z(n,o),o}async function U(e){const t=e.app;b(t);const{provider:n}=l(t);if(L()){const n=await M(),{token:r}=await S(k(t,n),e.heartbeatServiceProvider);return{token:r}}{const{token:e}=await n.getToken();return{token:e}}}function $(e,t,n,r){const{app:i}=e,s=l(i),o={next:n,error:r,type:t};if(s.tokenObservers=[...s.tokenObservers,o],s.token&&q(s.token)){const t=s.token;Promise.resolve().then((()=>{n({token:t.token}),V(e)})).catch((()=>{}))}s.cachedTokenPromise.then((()=>V(e)))}function B(e,t){const n=l(e),r=n.tokenObservers.filter((e=>e.next!==t));0===r.length&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=r}function V(e){const{app:t}=e,n=l(t);
1let r=n.tokenRefresher;r||(r=function(e){const{app:t}=e;return new m((async()=>{let n;if(n=l(t).token?await j(e,!0):await j(e),n.error)throw n.error;if(n.internalError)throw n.internalError}),(()=>!0),(()=>{const e=l(t);if(e.token){let t=e.token.issuedAtTimeMillis+.5*(e.token.expireTimeMillis-e.token.issuedAtTimeMillis)+3e5;const n=e.token.expireTimeMillis-3e5;return t=Math.min(t,n),Math.max(0,t-Date.now())}return 0}),f,p)}(e),n.tokenRefresher=r),!r.isRunning()&&n.isTokenAutoRefreshEnabled&&r.start()}function z(e,t){const n=l(e).tokenObservers;for(const i of n)try{"EXTERNAL"===i.type&&null!=t.error?i.error(t.error):i.next(t)}catch(r){}}function q(e){return e.expireTimeMillis-Date.now()>0}function H(e){return{token:(t=F,s.US.encodeString(JSON.stringify(t),!1)),error:e};var t}class W{constructor(e,t){this.app=e,this.heartbeatServiceProvider=t}_delete(){const{tokenObservers:e}=l(this.app);for(const t of e)B(this.app,t.next);return Promise.resolve()}}const G="https://www.google.com/recaptcha/api.js";function K(e,t){const n=new s.BH;l(e).reCAPTCHAState={initialized:n};const r=J(e),i=v(!1);return i?X(e,t,i,r,n):function(e){const t=document.createElement("script");t.src=G,t.onload=e,document.head.appendChild(t)}((()=>{const i=v(!1);if(!i)throw new Error("no recaptcha");X(e,t,i,r,n)})),n.promise}function X(e,t,n,r,i){n.ready((()=>{!function(e,t,n,r){const i=n.render(r,{sitekey:t,size:"invisible",callback:()=>{l(e).reCAPTCHAState.succeeded=!0},"error-callback":()=>{l(e).reCAPTCHAState.succeeded=!1}}),s=l(e);s.reCAPTCHAState=Object.assign(Object.assign({},s.reCAPTCHAState),{widgetId:i})}(e,t,n,r),i.resolve(n)}))}function J(e){const t=`fire_app_check_${e.name}`,n=document.createElement("div");return n.id=t,n.style.display="none",document.body.appendChild(n),t}async function Y(e){b(e);const t=l(e).reCAPTCHAState,n=await t.initialized.promise;return new Promise(((t,r)=>{const i=l(e).reCAPTCHAState;n.ready((()=>{t(n.execute(i.widgetId,{action:"fire_app_check"}))}))}))}class Q{constructor(e){this._siteKey=e,this._throttleData=null}async getToken(){var e,t,n;ee(this._throttleData);const r=await Y(this._app).catch((e=>{throw y.create("recaptcha-error")}));if(!(null===(e=l(this._app).reCAPTCHAState)||void 0===e?void 0:e.succeeded))throw y.create("recaptcha-error");let i;try{i=await S(function(e,t){const{projectId:n,appId:r,apiKey:i}=e.options;return{url:`${d}/projects/${n}/apps/${r}:exchangeRecaptchaV3Token?key=${i}`,body:{recaptcha_v3_token:t}}}(this._app,r),this._heartbeatServiceProvider)}catch(s){throw(null===(t=s.code)||void 0===t?void 0:t.includes("fetch-status-error"))?(this._throttleData=Z(Number(null===(n=s.customData)||void 0===n?void 0:n.httpStatus),this._throttleData),y.create("throttled",{time:_(this._throttleData.allowRequestsAfter-Date.now()),httpStatus:this._throttleData.httpStatus})):s}return this._throttleData=null,i}initialize(e){this._app=e,this._heartbeatServiceProvider=(0,r.qX)(e,"heartbeat"),K(e,this._siteKey).catch((()=>{}))}isEqual(e){return e instanceof Q&&this._siteKey===e._siteKey}}function Z(e,t){if(404===e||403===e)return{backoffCount:1,allowRequestsAfter:Date.now()+864e5,httpStatus:e};{const n=t?t.backoffCount:0,r=(0,s.$s)(n,1e3,2);return{backoffCount:n+1,allowRequestsAfter:Date.now()+r,httpStatus:e}}}function ee(e){if(e&&Date.now()-e.allowRequestsAfter<=0)throw y.create("throttled",{time:_(e.allowRequestsAfter-Date.now()),httpStatus:e.httpStatus})}function te(e=(0,r.Mq)(),t){e=(0,s.m9)(e);const n=(0,r.qX)(e,"app-check");if(h().initialized||function(){const e=(0,s.Rd)(),t=h();if(t.initialized=!0,"string"!==typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN&&!0!==e.FIREBASE_APPCHECK_DEBUG_TOKEN)return;t.enabled=!0;const n=new s.BH;t.token=n,"string"===typeof e.FIREBASE_APPCHECK_DEBUG_TOKEN?n.resolve(e.FIREBASE_APPCHECK_DEBUG_TOKEN):n.resolve(P())}(),L()&&M().then((e=>console.log(`App Check debug token: ${e}. You will need to add it to your app's App Check settings in the Firebase console for it to work.`))),n.isInitialized()){const r=n.getImmediate(),i=n.getOptions();if(i.isTokenAutoRefreshEnabled===t.isTokenAutoRefreshEnabled&&i.provider.isEqual(t.provider))return r;
1throw y.create("already-initialized",{appName:e.name})}const i=n.initialize({options:t});return function(e,t,n){const r=function(e,t){return a.set(e,t),a.get(e)}(e,Object.assign({},c));r.activated=!0,r.provider=t,r.cachedTokenPromise=N(e).then((t=>(t&&q(t)&&(r.token=t,z(e,{token:t.token})),t))),r.isTokenAutoRefreshEnabled=void 0===n?e.automaticDataCollectionEnabled:n,r.provider.initialize(e)}(e,t.provider,t.isTokenAutoRefreshEnabled),l(e).isTokenAutoRefreshEnabled&&$(i,"INTERNAL",(()=>{})),i}async function ne(e,t){const n=await j(e,t);if(n.error)throw n.error;return{token:n.token}}const re="app-check-internal";(0,r.Xd)(new i.wA("app-check",(e=>function(e,t){return new W(e,t)}(e.getProvider("app").getImmediate(),e.getProvider("heartbeat"))),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider(re).initialize()}))),(0,r.Xd)(new i.wA(re,(e=>function(e){return{getToken:t=>j(e,t),getLimitedUseToken:()=>U(e),addTokenListener:t=>$(e,"INTERNAL",t),removeTokenListener:t=>B(e.app,t)}}(e.getProvider("app-check").getImmediate())),"PUBLIC").setInstantiationMode("EXPLICIT")),(0,r.KN)("@firebase/app-check","0.8.0")},83977:function(e,t,n){"use strict";n.d(t,{C6:function(){return r.C6},KN:function(){return r.KN},ZF:function(){return r.ZF},ZR:function(){return r.ZR}});var r=n(25816);(0,r.KN)("firebase","9.23.0","app")},24367:function(e,t,n){"use strict";n.d(t,{w9:function(){return Fe},_O:function(){return $e},hJ:function(){return Be},RO:function(){return cn},ww:function(){return Qn},RecaptchaVerifier:function(){return nn},browserPopupRedirectResolver:function(){return Xn},S$:function(){return Se},createUserWithEmailAndPassword:function(){return lt},p2:function(){return kt},BV:function(){return X},AP:function(){return Wt},uJ:function(){return we},JB:function(){return ft},ZJ:function(){return nt},linkWithPhoneNumber:function(){return on},k9:function(){return vn},JG:function(){return Tt},MX:function(){return _t},aF:function(){return rt},reauthenticateWithPopup:function(){return yn},w$:function(){return mt},LS:function(){return ut},oo:function(){return dt},sB:function(){return tt},_p:function(){return it},e5:function(){return ht},P6:function(){return pt},signInWithPhoneNumber:function(){return sn},signInWithPopup:function(){return gn},qB:function(){return Je},s:function(){return yt},gQ:function(){return vt},ck:function(){return gt}});var r=n(74444),i=n(25816),s=n(97582),o=n(53333),a=n(8463);function c(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const u=c,l=new r.LL("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),h=new o.Yd("@firebase/auth");function d(e,...t){h.logLevel<=o.in.ERROR&&h.error(`Auth (${i.Jn}): ${e}`,...t)}function f(e,...t){throw y(e,...t)}function p(e,...t){return y(e,...t)}function m(e,t,n){const i=Object.assign(Object.assign({},u()),{[t]:n});return new r.LL("auth","Firebase",i).create(t,{appName:e.name})}function g(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&f(e,"argument-error"),m(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function y(e,...t){if("string"!==typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return l.create(e,...t)}function v(e,t,...n){if(!e)throw y(t,...n)}function b(e){const t="INTERNAL ASSERTION FAILED: "+e;throw d(t),new Error(t)}function _(e,t){e||b(t)}function w(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function S(){return"http:"===k()||"https:"===k()}function k(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class I{constructor(e,t){this.shortDelay=e,this.longDelay=t,_(t>
1e,"Short delay should be less than long delay!"),this.isMobile=(0,r.uI)()||(0,r.b$)()}get(){return"undefined"!==typeof navigator&&navigator&&"onLine"in navigator&&"boolean"===typeof navigator.onLine&&(S()||(0,r.ru)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function E(e,t){_(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class T{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:void b("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:void b("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:void b("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const C={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},x=new I(3e4,6e4);function O(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function A(e,t,n,i,s={}){return R(e,s,(async()=>{let s={},o={};i&&("GET"===t?o=i:s={body:JSON.stringify(i)});const a=(0,r.xO)(Object.assign({key:e.config.apiKey},o)).slice(1),c=await e._getAdditionalHeaders();return c["Content-Type"]="application/json",e.languageCode&&(c["X-Firebase-Locale"]=e.languageCode),T.fetch()(D(e,e.config.apiHost,n,a),Object.assign({method:t,headers:c,referrerPolicy:"no-referrer"},s))}))}async function R(e,t,n){e._canInitEmulator=!1;const i=Object.assign(Object.assign({},C),t);try{const t=new P(e),r=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const s=await r.json();if("needConfirmation"in s)throw L(e,"account-exists-with-different-credential",s);if(r.ok&&!("errorMessage"in s))return s;{const t=r.ok?s.errorMessage:s.error.message,[n,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw L(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw L(e,"email-already-in-use",s);if("USER_DISABLED"===n)throw L(e,"user-disabled",s);const a=i[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw m(e,a,o);f(e,a)}}catch(s){if(s instanceof r.ZR)throw s;f(e,"network-request-failed",{message:String(s)})}}async function N(e,t,n,r,i={}){const s=await A(e,t,n,r,i);return"mfaPendingCredential"in s&&f(e,"multi-factor-auth-required",{_serverResponse:s}),s}function D(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?E(e.config,i):`${e.config.apiScheme}://${i}`}class P{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(p(this.auth,"network-request-failed"))),x.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}
1function L(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=p(e,t,r);return i.customData._tokenResponse=n,i}function M(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(t){}}function F(e){return 1e3*Number(e)}function j(e){const[t,n,i]=e.split(".");if(void 0===t||void 0===n||void 0===i)return d("JWT malformed, contained fewer than 3 sections"),null;try{const e=(0,r.tV)(n);return e?JSON.parse(e):(d("Failed to decode base64 JWT payload"),null)}catch(s){return d("Caught error parsing JWT payload as JSON",null===s||void 0===s?void 0:s.toString()),null}}async function U(e,t,n=!1){if(n)return t;try{return await t}catch(i){throw i instanceof r.ZR&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(i)&&e.auth.currentUser===e&&await e.auth.signOut(),i}}class ${constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout((async()=>{await this.iteration()}),t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null===e||void 0===e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}class B{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=M(this.lastLoginAt),this.creationTime=M(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function V(e){var t;const n=e.auth,r=await e.getIdToken(),i=await U(e,async function(e,t){return A(e,"POST","/v1/accounts:lookup",t)}(n,{idToken:r}));v(null===i||void 0===i?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const a=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map((e=>{var{providerId:t}=e,n=(0,s._T)(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[];const c=(u=e.providerData,l=a,[...u.filter((e=>!l.some((t=>t.providerId===e.providerId)))),...l]);var u,l;const h=e.isAnonymous,d=!(e.email&&o.passwordHash)&&!(null===c||void 0===c?void 0:c.length),f=!!h&&d,p={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new B(o.createdAt,o.lastLoginAt),isAnonymous:f};Object.assign(e,p)}class z{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){v(e.idToken,"internal-error"),v("undefined"!==typeof e.idToken,"internal-error"),v("undefined"!==typeof e.refreshToken,"internal-error");const t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):function(e){const t=j(e);return v(t,"internal-error"),v("undefined"!==typeof t.exp,"internal-error"),v("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return v(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:i,expiresIn:s}=await async function(e,t){const n=await R(e,{},(async()=>{const n=(0,r.xO)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:s}=e.config,o=D(e,i,"/v1/token",`key=${s}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",T.fetch()(o,{method:"POST",headers:a,body:n})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,i,Number(s))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,s=new z;return n&&(v("string"===typeof n,"internal-error",{appName:e}),s.refreshToken=n),r&&(v("string"===typeof r,"internal-error",{appName:e}),s.accessToken=r),i&&(v("number"===typeof i,"internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new z,this.toJSON())}_performRefresh(){return b("not implemented")}}function q(e,t){v("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}class H{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=(0,s._T)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new $(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new B(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await U(this,this.stsTokenManager.getToken(this.auth,e));return v(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=(0,r.m9)(e),i=await n.getIdToken(t),s=j(i);v(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o="object"===typeof s.firebase?s.firebase:void 0,a=null===o||void 0===o?void 0:o.sign_in_provider;return{claims:s,token:i,authTime:M(F(s.auth_time)),issuedAtTime:M(F(s.iat)),expirationTime:M(F(s.exp)),signInProvider:a||null,signInSecondFactor:(null===o||void 0===o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=(0,r.m9)(e);await V(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(v(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
1otoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((e=>Object.assign({},e))),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new H(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){v(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await V(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await U(this,async function(e,t){return A(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((e=>Object.assign({},e))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,s,o,a,c,u;const l=null!==(n=t.displayName)&&void 0!==n?n:void 0,h=null!==(r=t.email)&&void 0!==r?r:void 0,d=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,f=null!==(s=t.photoURL)&&void 0!==s?s:void 0,p=null!==(o=t.tenantId)&&void 0!==o?o:void 0,m=null!==(a=t._redirectEventId)&&void 0!==a?a:void 0,g=null!==(c=t.createdAt)&&void 0!==c?c:void 0,y=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:b,emailVerified:_,isAnonymous:w,providerData:S,stsTokenManager:k}=t;v(b&&k,e,"internal-error");const I=z.fromJSON(this.name,k);v("string"===typeof b,e,"internal-error"),q(l,e.name),q(h,e.name),v("boolean"===typeof _,e,"internal-error"),v("boolean"===typeof w,e,"internal-error"),q(d,e.name),q(f,e.name),q(p,e.name),q(m,e.name),q(g,e.name),q(y,e.name);const E=new H({uid:b,auth:e,email:h,emailVerified:_,displayName:l,isAnonymous:w,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:I,createdAt:g,lastLoginAt:y});return S&&Array.isArray(S)&&(E.providerData=S.map((e=>Object.assign({},e)))),m&&(E._redirectEventId=m),E}static async _fromIdTokenResponse(e,t,n=!1){const r=new z;r.updateFromServerResponse(t);const i=new H({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await V(i),i}}const W=new Map;function G(e){_(e instanceof Function,"Expected a class definition");let t=W.get(e);return t?(_(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,W.set(e,t),t)}class K{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}K.type="NONE";const X=K;function J(e,t,n){return`firebase:${e}:${t}:${n}`}class Y{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=J(this.userKey,r.apiKey,i),this.fullPersistenceKey=J("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?H._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new Y(G(X),e,n);const r=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let i=r[0]||G(X);const s=J(n,e.config.apiKey,e.name);let o=null;for(const u of t)try{const t=await u._get(s);if(t){const n=H._fromJSON(e,t);u!==i&&(o=n),i=u;break}}catch(c){}const a=r.filter((e=>e._shouldAllowMigration));return i._shouldAllowMigration&&a.length?(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(t.map((async e=>{if(e!==i)try{await e._remove(s)}catch(c){}}))),new Y(i,e,n)):new Y(i,e,n)}}function Q(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(ne(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Z(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(ie(t))return"Blackberry";if(se(t))return"Webos";if(ee(t))return"Safari";if((t.includes("chrome/")||te(t))&&!t.includes("edge/"))return"Chrome";if(re(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null===n||void 0===n?void 0:n.length))return n[1]}return"Other"}function Z(e=(0,r.z$)()){return/firefox\//i.test(e)}function ee(e=(0,r.z$)()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function te(e=(0,r.z$)()){return/crios\//i.test(e)}function ne(e=(0,r.z$)()){return/iemobile/i.test(e)}function re(e=(0,r.z$)()){return/android/i.test(e)}function ie(e=(0,r.z$)()){return/blackberry/i.test(e)}function se(e=(0,r.z$)()){return/webos/i.test(e)}function oe(e=(0,r.z$)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function ae(e=(0,r.z$)()){return oe(e)||re(e)||se(e)||ie(e)||/windows phone/i.test(e)||ne(e)}function ce(e,t=[]){let n;switch(e){case"Browser":n=Q((0,r.z$)());break;case"Worker":n=`${Q((0,r.z$)())}-${e}`;break;default:n=e}const s=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${i.Jn}/${s}`}async function ue(e,t){return A(e,"GET","/v2/recaptchaConfig",O(e,t))}function le(e){return void 0!==e&&void 0!==e.getResponse}function he(e){return void 0!==e&&void 0!==e.enterprise}class de{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some((e=>"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState))}}function fe(e){return new Promise(((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=p("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)}))}function pe(e){return`__${e}${Math.floor(1e6*Math.random())}`}class me{constructor(e){this.type="recaptcha-enterprise",this.auth=be(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;he(i)?i.enterprise.ready((()=>{i.enterprise.execute(t,{action:e}).then((e=>{n(e)})).catch((()=>{n("NO_RECAPTCHA")}))})):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise(((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise((async(t,n)=>
1{ue(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then((r=>{if(void 0!==r.recaptchaKey){const n=new de(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))})).catch((e=>{n(e)}))}))})(this.auth).then((i=>{if(!t&&he(window.grecaptcha))n(i,e,r);else{if("undefined"===typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));fe("https://www.google.com/recaptcha/enterprise.js?render="+i).then((()=>{n(i,e,r)})).catch((e=>{r(e)}))}})).catch((e=>{r(e)}))}))}}async function ge(e,t,n,r=!1){const i=new me(e);let s;try{s=await i.verify(n)}catch(a){s=await i.verify(n,!0)}const o=Object.assign({},t);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}class ye{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise(((n,r)=>{try{n(e(t))}catch(i){r(i)}}));n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(n){t.reverse();for(const e of t)try{e()}catch(r){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null===n||void 0===n?void 0:n.message})}}}class ve{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new _e(this),this.idTokenSubscription=new _e(this),this.beforeStateQueue=new ye(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=l,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=G(t)),this._initializationPromise=this.queue((async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await Y.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(i){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void(await this.currentUser.getIdToken())):void(await this._updateCurrentUser(e,!0)):void 0}async initializeCurrentUser(e){var t;const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,s=null===r||void 0===r?void 0:r._redirectEventId,o=await this.tryRedirectSignIn(e);n&&n!==s||!(null===o||void 0===o?void 0:o.user)||(r=o.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(s){r=n,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(s)))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return v(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(n){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await V(e)}catch(t){if("auth/network-request-failed"!==(null===t||void 0===t?void 0:t.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"===typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}
1async updateCurrentUser(e){const t=e?(0,r.m9)(e):null;return t&&v(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&v(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue((async()=>{await this.assertedPersistence.setPersistence(G(e))}))}async initializeRecaptchaConfig(){const e=await ue(this,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),t=new de(e);if(null==this.tenantId?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled){new me(this).verify()}}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new r.LL("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&G(e)||this._popupRedirectResolver;v(t,this,"argument-error"),this.redirectPersistenceManager=await Y.create(this,[G(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(e)))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"===typeof t?t:t.next.bind(t),s=this._isInitialized?Promise.resolve():this._initializationPromise;return v(s,this,"internal-error"),s.then((()=>i(this.currentUser))),"function"===typeof t?e.addObserver(t,n,r):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return v(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ce(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null===t||void 0===t?void 0:t.error)&&function(e,...t){h.logLevel<=o.in.WARN&&h.warn(`Auth (${i.Jn}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null===t||void 0===t?void 0:t.token}}function be(e){return(0,r.m9)(e)}class _e{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,r.ne)((e=>this.observer=e))}get next(){return v(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function we(e,t){const n=(0,i.qX)(e,"auth");if(n.isInitialized()){const e=n.getImmediate(),i=n.getOptions();if((0,r.vZ)(i,null!==t&&void 0!==t?t:{}))return e;f(e,"already-initialized")}return n.initialize({options:t})}function Se(e,t,n){const r=be(e);v(r._canInitEmulator,r,"emulator-config-failed"),v(/^https?:\/\//.test(t),r,"invali
1d-emulator-scheme");const i=!!(null===n||void 0===n?void 0:n.disableWarnings),s=ke(t),{host:o,port:a}=function(e){const t=ke(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:Ie(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Ie(t)}}}(t),c=null===a?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!==typeof window&&"undefined"!==typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function ke(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Ie(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Ee{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return b("not implemented")}_getIdTokenResponse(e){return b("not implemented")}_linkToIdToken(e,t){return b("not implemented")}_getReauthenticationResolver(e){return b("not implemented")}}async function Te(e,t){return A(e,"POST","/v1/accounts:update",t)}async function Ce(e,t){return N(e,"POST","/v1/accounts:signInWithPassword",O(e,t))}async function xe(e,t){return A(e,"POST","/v1/accounts:sendOobCode",O(e,t))}async function Oe(e,t){return xe(e,t)}async function Ae(e,t){return xe(e,t)}class Re extends Ee{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Re(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new Re(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e;if((null===t||void 0===t?void 0:t.email)&&(null===t||void 0===t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){var t;switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(null===(t=e._getRecaptchaConfig())||void 0===t?void 0:t.emailPasswordEnabled){const t=await ge(e,n,"signInWithPassword");return Ce(e,t)}return Ce(e,n).catch((async t=>{if("auth/missing-recaptcha-token"===t.code){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const t=await ge(e,n,"signInWithPassword");return Ce(e,t)}return Promise.reject(t)}));case"emailLink":return async function(e,t){return N(e,"POST","/v1/accounts:signInWithEmailLink",O(e,t))}(e,{email:this._email,oobCode:this._password});default:f(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Te(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return N(e,"POST","/v1/accounts:signInWithEmailLink",O(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:f(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Ne(e,t){return N(e,"POST","/v1/accounts:signInWithIdp",O(e,t))}
1class De extends Ee{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new De(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):f("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=(0,s._T)(t,["providerId","signInMethod"]);if(!n||!r)return null;const o=new De(n,r);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){return Ne(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Ne(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Ne(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,r.xO)(t)}return e}}const Pe={USER_NOT_FOUND:"user-not-found"};class Le extends Ee{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Le({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Le({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return N(e,"POST","/v1/accounts:signInWithPhoneNumber",O(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await N(e,"POST","/v1/accounts:signInWithPhoneNumber",O(e,t));if(n.temporaryProof)throw L(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return N(e,"POST","/v1/accounts:signInWithPhoneNumber",O(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Pe)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"===typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new Le({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class Me{constructor(e){var t,n,i,s,o,a;const c=(0,r.zd)((0,r.pd)(e)),u=null!==(t=c.apiKey)&&void 0!==t?t:null,l=null!==(n=c.oobCode)&&void 0!==n?n:null,h=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(i=c.mode)&&void 0!==i?i:null);v(u&&l&&h,"argument-error"),this.apiKey=u,this.operation=h,this.code=l,this.continueUrl=null!==(s=c.continueUrl)&&void 0!==s?s:null,this.languageCode=null!==(o=c.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(a=c.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=(0,r.zd)((0,r.pd)(e)).link,n=t?(0,r.zd)((0,r.pd)(t)).deep_link_id:null,i=(0,r.zd)((0,r.pd)(e)).deep_link_id;return(i?(0,r.zd)((0,r.pd)(i)).link:null)||i||n||t||e}(e);try{return new Me(t)}catch(n){return null}}}class Fe{constructor(){this.providerId=Fe.PROVIDER_ID}static credential(e,t){return Re._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Me.parseLink(t);return v(n,"argument-error"),Re._fromEmailAndCode(e,n.code,n.tenantId)}}Fe.PROVIDER_ID="password",Fe.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Fe.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class je{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Ue extends je{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class $e extends Ue{constructor(){super("facebook.com")}
1static credential(e){return De._fromParams({providerId:$e.PROVIDER_ID,signInMethod:$e.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return $e.credentialFromTaggedObject(e)}static credentialFromError(e){return $e.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return $e.credential(e.oauthAccessToken)}catch(t){return null}}}$e.FACEBOOK_SIGN_IN_METHOD="facebook.com",$e.PROVIDER_ID="facebook.com";class Be extends Ue{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return De._fromParams({providerId:Be.PROVIDER_ID,signInMethod:Be.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Be.credentialFromTaggedObject(e)}static credentialFromError(e){return Be.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return Be.credential(t,n)}catch(r){return null}}}Be.GOOGLE_SIGN_IN_METHOD="google.com",Be.PROVIDER_ID="google.com";class Ve extends Ue{constructor(){super("github.com")}static credential(e){return De._fromParams({providerId:Ve.PROVIDER_ID,signInMethod:Ve.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ve.credentialFromTaggedObject(e)}static credentialFromError(e){return Ve.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Ve.credential(e.oauthAccessToken)}catch(t){return null}}}Ve.GITHUB_SIGN_IN_METHOD="github.com",Ve.PROVIDER_ID="github.com";class ze extends Ue{constructor(){super("twitter.com")}static credential(e,t){return De._fromParams({providerId:ze.PROVIDER_ID,signInMethod:ze.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return ze.credentialFromTaggedObject(e)}static credentialFromError(e){return ze.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return ze.credential(t,n)}catch(r){return null}}}async function qe(e,t){return N(e,"POST","/v1/accounts:signUp",O(e,t))}ze.TWITTER_SIGN_IN_METHOD="twitter.com",ze.PROVIDER_ID="twitter.com";class He{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await H._fromIdTokenResponse(e,n,r),s=We(n);return new He({user:i,providerId:s,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=We(n);return new He({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function We(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class Ge extends r.ZR{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,Ge.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new Ge(e,t,n,r)}}function Ke(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw Ge._fromErrorAndOperation(e,n,t,r);throw n}))}function Xe(e){return new Set(e.map((({providerId:e})=>e)).filter((e=>!!e)))}async function Je(e,t){const n=(0,r.m9)(e);await Qe(!0,n,t);const{providerUserInfo:i}=await async function(e,t){return A(e,"POST","/v1/accounts:update",t)}(n.auth,{idToken:await n.getIdToken(),deleteProvider:[t]}),s=Xe(i||[]);return n.providerData=n.providerData.filter((e=>s.has(e.providerId))),s.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function Ye(e,t,n=!1){const r=await U(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return He._forOperation(e,"link",r)}async function Qe(e,t,n){await V(t);const r=!1===e?"provider-already-linked":"no-such-provider";v(Xe(t.providerData).has(n)===e,t.auth,r)}async function Ze(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await U(e,Ke(r,i,t,e),n);v(s.idToken,r,"internal-error");const o=j(s.idToken);v(o,r,"internal-error");const{sub:a}=o;return v(e.uid===a,r,"user-mismatch"),He._forOperation(e,i,s)}catch(s){throw"auth/user-not-found"===(null===s||void 0===s?void 0:s.code)&&f(r,"user-mismatch"),s}}async function et(e,t,n=!1){const r="signIn",i=await Ke(e,r,t),s=await He._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(s.user),s}async function tt(e,t){return et(be(e),t)}async function nt(e,t){const n=(0,r.m9)(e);return await Qe(!1,n,t.providerId),Ye(n,t)}async function rt(e,t){return Ze((0,r.m9)(e),t)}async function it(e,t){const n=be(e),r=await async function(e,t){return N(e,"POST","/v1/accounts:signInWithCustomToken",O(e,t))}(n,{token:t,returnSecureToken:!0}),i=await He._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}class st{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?ot._fromServerResponse(e,t):"totpInfo"in t?at._fromServerResponse(e,t):f(e,"internal-error")}}class ot extends st{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new ot(t)}}class at extends st{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new at(t)}}function ct(e,t,n){var r;v((null===(r=n.url)||void 0===r?void 0:r.length)>
10,e,"invalid-continue-uri"),v("undefined"===typeof n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(v(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(v(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function ut(e,t,n){var r;const i=be(e),s={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await ge(i,s,"getOobCode",!0);n&&ct(i,e,n),await Oe(i,e)}else n&&ct(i,s,n),await Oe(i,s).catch((async e=>{if("auth/missing-recaptcha-token"!==e.code)return Promise.reject(e);{console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");const e=await ge(i,s,"getOobCode",!0);n&&ct(i,e,n),await Oe(i,e)}}))}async function lt(e,t,n){var r;const i=be(e),s={returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"};let o;if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await ge(i,s,"signUpPassword");o=qe(i,e)}else o=qe(i,s).catch((async e=>{if("auth/missing-recaptcha-token"===e.code){console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow.");const e=await ge(i,s,"signUpPassword");return qe(i,e)}return Promise.reject(e)}));const a=await o.catch((e=>Promise.reject(e))),c=await He._fromIdTokenResponse(i,"signIn",a);return await i._updateCurrentUser(c.user),c}function ht(e,t,n){return tt((0,r.m9)(e),Fe.credential(t,n))}async function dt(e,t,n){var r;const i=be(e),s={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};function o(e,t){v(t.handleCodeInApp,i,"argument-error"),t&&ct(i,e,t)}if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await ge(i,s,"getOobCode",!0);o(e,n),await Ae(i,e)}else o(s,n),await Ae(i,s).catch((async e=>{if("auth/missing-recaptcha-token"!==e.code)return Promise.reject(e);{console.log("Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const e=await ge(i,s,"getOobCode",!0);o(e,n),await Ae(i,e)}}))}function ft(e,t){const n=Me.parseLink(t);return"EMAIL_SIGNIN"===(null===n||void 0===n?void 0:n.operation)}async function pt(e,t,n){const i=(0,r.m9)(e),s=Fe.credentialWithLink(t,n||w());return v(s._tenantId===(i.tenantId||null),i,"tenant-id-mismatch"),tt(i,s)}async function mt(e,t){const n=(0,r.m9)(e),i={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&ct(n.auth,i,t);const{email:s}=await async function(e,t){return xe(e,t)}(n.auth,i);s!==e.email&&await e.reload()}async function gt(e,{displayName:t,photoURL:n}){if(void 0===t&&void 0===n)return;const i=(0,r.m9)(e),s={idToken:await i.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},o=await U(i,async function(e,t){return A(e,"POST","/v1/accounts:update",t)}(i.auth,s));i.displayName=o.displayName||null,i.photoURL=o.photoUrl||null;const a=i.providerData.find((({providerId:e})=>"password"===e));a&&(a.displayName=i.displayName,a.photoURL=i.photoURL),await i._updateTokensIfNecessary(o)}function yt(e,t){return bt((0,r.m9)(e),t,null)}function vt(e,t){return bt((0,r.m9)(e),null,t)}async function bt(e,t,n){const{auth:r}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),n&&(i.password=n);const s=await U(e,Te(r,i));await e._updateTokensIfNecessary(s,!0)}function _t(e,t,n,i){return(0,r.m9)(e).onIdTokenChanged(t,n,i)}class wt{constructor(e,t,n){this.type=e,this.credential=t,this.auth=n}static _fromIdtoken(e,t){return new wt("enroll",e,t)}static _fromMfaPendingCredential(e){return new wt("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t,n;if(null===e||void 0===e?void 0:e.multiFactorSession){if(null===(t=e.multiFactorSession)||void 0===t?void 0:t.pendingCredential)return wt._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null===(n=e.multiFactorSession)||void 0===n?void 0:n.idToken)return wt._fromIdtoken(e.multiFactorSession.idToken)}return null}}class St{constructor(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}static _fromError(e,t){const n=be(e),r=t.customData._serverResponse,i=(r.mfaInfo||[]).map((e=>st._fromServerResponse(n,e)));v(r.mfaPendingCredential,n,"internal-error");const s=wt._fromMfaPendingCredential(r.mfaPendingCredential);return new St(s,i,(async e=>{const i=await e._process(n,s);delete r.mfaInfo,delete r.mfaPendingCredential;const o=Object.assign(Object.assign({},r),{idToken:i.idToken,refreshToken:i.refreshToken});switch(t.operationType){case"signIn":const e=await He._fromIdTokenResponse(n,t.operationType,o);return await n._updateCurrentUser(e.user),e;case"reauthenticate":return v(t.user,n,"internal-error"),He._forOperation(t.user,t.operationType,o);default:f(n,"internal-error")}}))}async resolveSignIn(e){const t=e;return this.signInResolver(t)}}function kt(e,t){var n;const i=(0,r.m9)(e),s=t;return v(t.customData.operationType,i,"argument-error"),v(null===(n=s.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,i,"argument-error"),St._fromError(i,s)}class It{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload((t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map((t=>st._fromServerResponse(e.auth,t))))}))}static _fromUser(e){return new It(e)}async getSession(){return wt._fromIdtoken(await this.user.getIdToken(),this.user.auth)}
1async enroll(e,t){const n=e,r=await this.getSession(),i=await U(this.user,n._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const t="string"===typeof e?e:e.uid,n=await this.user.getIdToken();try{const e=await U(this.user,(r=this.user.auth,i={idToken:n,mfaEnrollmentId:t},A(r,"POST","/v2/accounts/mfaEnrollment:withdraw",O(r,i))));this.enrolledFactors=this.enrolledFactors.filter((({uid:e})=>e!==t)),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(s){throw s}var r,i}}const Et=new WeakMap;function Tt(e){const t=(0,r.m9)(e);return Et.has(t)||Et.set(t,It._fromUser(t)),Et.get(t)}const Ct="__sak";class xt{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Ct,"1"),this.storage.removeItem(Ct),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class Ot extends xt{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=(0,r.z$)();return ee(e)||oe(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=ae(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys(((e,t,n)=>{this.notifyListeners(e,n)}));const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}const i=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},s=this.storage.getItem(n);(0,r.w1)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,10):i()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Ot.type="LOCAL";class At extends xt{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(e,t){}_removeListener(e,t){}}At.type="SESSION";const Rt=At;class Nt{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find((t=>t.isListeningto(e)));if(t)return t;const n=new Nt(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,s=this.handlersMap[r];if(!(null===s||void 0===s?void 0:s.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(s).map((async e=>e(t.origin,i))),a=await function(e){return Promise.all(e.map((async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}})))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function Dt(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(10*Math.random());return e+n}Nt.receivers=[];class Pt{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!==typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,s;return new Promise(((o,a)=>{const c=Dt("",20);r.port1.start();const u=setTimeout((()=>{a(new Error("unsupported_event"))}),n);s={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(u),i=setTimeout((()=>{a(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),o(t.data.response);break;default:clearTimeout(u),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])})).finally((()=>{s&&this.removeMessageHandler(s)}))}}function Lt(){return window}
vendor: 1,028 bytes, line 1
1function Mt(){return"undefined"!==typeof Lt().WorkerGlobalScope&&"function"===typeof Lt().importScripts}const Ft="firebaseLocalStorageDb",jt="firebaseLocalStorage",Ut="fbase_key";class $t{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}function Bt(e,t){return e.transaction([jt],t?"readwrite":"readonly").objectStore(jt)}function Vt(){const e=indexedDB.open(Ft,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(jt,{keyPath:Ut})}catch(r){n(r)}})),e.addEventListener("success",(async()=>{const n=e.result;n.objectStoreNames.contains(jt)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Ft);return new $t(e).toPromise()}(),t(await Vt()))}))}))}async function zt(e,t,n){const r=Bt(e,!0).put({[Ut]:t,value:n});return new $t(r).toPromise()}
vendor: 6,894 bytes, line 1
1function qt(e,t){const n=Bt(e,!0).delete(t);return new $t(n).toPromise()}class Ht{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await Vt()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(n){if(t++>3)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Mt()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Nt._getInstance(Mt()?self:null),this.receiver._subscribe("keyChanged",(async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)}))),this.receiver._subscribe("ping",(async(e,t)=>["keyChanged"]))}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new Pt(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&function(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}()===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Vt();return await zt(e,Ct,"1"),await qt(e,Ct),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite((async()=>(await this._withRetries((n=>zt(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){const t=await this._withRetries((t=>async function(e,t){const n=Bt(e,!1).get(t),r=await new $t(n).toPromise();return void 0===r?null:r.value}(t,e)));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>qt(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){const e=await this._withRetries((e=>{const t=Bt(e,!1).getAll();return new $t(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!n.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}Ht.type="LOCAL";const Wt=Ht;const Gt=1e12;class Kt{constructor(e){this.auth=e,this.counter=Gt,this._widgets=new Map}render(e,t){const n=this.counter;return this._widgets.set(n,new Xt(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t;const n=e||Gt;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}getResponse(e){var t;const n=e||Gt;return(null===(t=this._widgets.get(n))||void 0===t?void 0:t.getResponse())||""}async execute(e){var t;const n=e||Gt;return null===(t=this._widgets.get(n))||void 0===t||t.execute(),""}}class Xt{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const r="string"===typeof e?document.getElementById(e):e;v(r,"argument-error",{appName:t}),this.container=r,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout((()=>{this.responseToken=function(e){const t=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<e;r++)t.push(n.charAt(Math.floor(Math.random()*n.length)));return t.join("")}(50);const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(n){}this.timerId=window.setTimeout((()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(n){}this.isVisible&&this.execute()}),6e4)}),500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const Jt=pe("rcb"),Yt=new I(3e4,6e4);class Qt{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null===(e=Lt().grecaptcha)||void 0===e?void 0:e.render)}load(e,t=""){return v(function(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}(t),e,"argument-error"),this.shouldResolveImmediately(t)&&le(Lt().grecaptcha)?Promise.resolve(Lt().grecaptcha):new Promise(((n,i)=>{const s=Lt().setTimeout((()=>{i(p(e,"network-request-failed"))}),Yt.get());Lt()[Jt]=()=>{Lt().clearTimeout(s),delete Lt()[Jt];const r=Lt().grecaptcha;if(!r||!le(r))return void i(p(e,"internal-error"));const o=r.render;r.render=(e,t)=>{const n=o(e,t);return this.counter++,n},this.hostLanguage=t,n(r)};fe(`https://www.google.com/recaptcha/api.js??${(0,r.xO)({onload:Jt,render:"explicit",hl:t})}`).catch((()=>{clearTimeout(s),i(p(e,"internal-error"))}))}))}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(null===(t=Lt().grecaptcha)||void 0===t?void 0:t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class Zt{async load(e){return new Kt(e)}clearedOneInstance(){}}const en="recaptcha",tn={theme:"light",type:"image"};class nn{constructor(e,t=Object.assign({},tn),n){this.parameters=t,this.type=en,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=be(n),this.isInvisible="invisible"===this.parameters.size,v
1("undefined"!==typeof document,this.auth,"operation-not-supported-in-this-environment");const r="string"===typeof e?document.getElementById(e):e;v(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Zt:new Qt,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha(),n=t.getResponse(e);return n||new Promise((n=>{const r=e=>{e&&(this.tokenChangeListeners.delete(r),n(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)}))}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch((e=>{throw this.renderPromise=null,e}))),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach((e=>{this.container.removeChild(e)}))}validateStartingState(){v(!this.parameters.sitekey,this.auth,"argument-error"),v(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),v("undefined"!==typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach((e=>e(t))),"function"===typeof e)e(t);else if("string"===typeof e){const n=Lt()[e];"function"===typeof n&&n(t)}}}assertNotDestroyed(){v(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}
1async init(){v(S()&&!Mt(),this.auth,"internal-error"),await function(){let e=null;return new Promise((t=>{"complete"!==document.readyState?(e=()=>t(),window.addEventListener("load",e)):t()})).catch((t=>{throw e&&window.removeEventListener("load",e),t}))}(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await async function(e){return(await A(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}(this.auth);v(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return v(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class rn{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=Le._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function sn(e,t,n){const i=be(e),s=await an(i,t,(0,r.m9)(n));return new rn(s,(e=>tt(i,e)))}async function on(e,t,n){const i=(0,r.m9)(e);await Qe(!1,i,"phone");const s=await an(i.auth,t,(0,r.m9)(n));return new rn(s,(e=>nt(i,e)))}async function an(e,t,n){var r;const i=await n.verify();try{let s;if(v("string"===typeof i,e,"argument-error"),v(n.type===en,e,"argument-error"),s="string"===typeof t?{phoneNumber:t}:t,"session"in s){const t=s.session;if("phoneNumber"in s){v("enroll"===t.type,e,"internal-error");const n=await function(e,t){return A(e,"POST","/v2/accounts/mfaEnrollment:start",O(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}});return n.phoneSessionInfo.sessionInfo}{v("signin"===t.type,e,"internal-error");const n=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;v(n,e,"missing-multi-factor-info");const o=await function(e,t){return A(e,"POST","/v2/accounts/mfaSignIn:start",O(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}});return o.phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return A(e,"POST","/v1/accounts:sendVerificationCode",O(e,t))}(e,{phoneNumber:s.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}class cn{constructor(e){this.providerId=cn.PROVIDER_ID,this.auth=be(e)}verifyPhoneNumber(e,t){return an(this.auth,e,(0,r.m9)(t))}static credential(e,t){return Le._fromVerification(e,t)}static credentialFromResult(e){const t=e;return cn.credentialFromTaggedObject(t)}static credentialFromError(e){return cn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?Le._fromTokenResponse(t,n):null}}function un(e,t){return t?G(t):(v(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}cn.PROVIDER_ID="phone",cn.PHONE_SIGN_IN_METHOD="phone";class ln extends Ee{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ne(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Ne(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Ne(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function hn(e){return et(e.auth,new ln(e),e.bypassAuthState)}function dn(e){const{auth:t,user:n}=e;return v(n,t,"internal-error"),Ze(n,new ln(e),e.bypassAuthState)}async function fn(e){const{auth:t,user:n}=e;return v(n,t,"internal-error"),Ye(n,new ln(e),e.bypassAuthState)}class pn{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}}))}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:s,type:o}=e;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return hn;case"linkViaPopup":case"linkViaRedirect":return fn;case"reauthViaPopup":case"reauthViaRedirect":return dn;default:f(this.auth,"internal-error")}}resolve(e){_(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){_(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const mn=new I(2e3,1e4);async function gn(e,t,n){const r=be(e);g(e,t,je);
1const i=un(r,n);return new bn(r,"signInViaPopup",t,i).executeNotNull()}async function yn(e,t,n){const i=(0,r.m9)(e);g(i.auth,t,je);const s=un(i.auth,n);return new bn(i.auth,"reauthViaPopup",t,s,i).executeNotNull()}async function vn(e,t,n){const i=(0,r.m9)(e);g(i.auth,t,je);const s=un(i.auth,n);return new bn(i.auth,"linkViaPopup",t,s,i).executeNotNull()}class bn extends pn{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,bn.currentPopupAction&&bn.currentPopupAction.cancel(),bn.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return v(e,this.auth,"internal-error"),e}async onExecution(){_(1===this.filter.length,"Popup operations only handle one event");const e=Dt();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch((e=>{this.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(e=>{e||this.reject(p(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(p(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,bn.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(p(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(e,mn.get())};e()}}bn.currentPopupAction=null;const _n=new Map;class wn extends pn{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=_n.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=In(t),r=kn(e);if(!(await r._isAvailable()))return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}_n.set(this.auth._key(),e)}return this.bypassAuthState||_n.set(this.auth._key(),(()=>Promise.resolve(null))),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Sn(e,t){_n.set(e._key(),t)}function kn(e){return G(e._redirectPersistence)}function In(e){return J("pendingRedirect",e.config.apiKey,e.name)}async function En(e,t,n=!1){const r=be(e),i=un(r,t),s=new wn(r,i,n),o=await s.execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}class Tn{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return xn(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!xn(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(p(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Cn(e))}saveEventToCache(e){this.cachedEventUids.add(Cn(e)),this.lastProcessedEventTime=
vendor: 4,660 bytes, line 1
1Date.now()}}function Cn(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function xn({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null===t||void 0===t?void 0:t.code)}const On=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,An=/^https?/;async function Rn(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e,t={}){return A(e,"GET","/v1/projects",t)}(e);for(const r of t)try{if(Nn(r))return}catch(n){}f(e,"unauthorized-domain")}function Nn(e){const t=w(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!An.test(n))return!1;if(On.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const Dn=new I(3e4,6e4);function Pn(){const e=Lt().___jsl;if(null===e||void 0===e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}let Ln=null;function Mn(e){return Ln=Ln||function(e){return new Promise(((t,n)=>{var r,i,s;function o(){Pn(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Pn(),n(p(e,"network-request-failed"))},timeout:Dn.get()})}if(null===(i=null===(r=Lt().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(s=Lt().gapi)||void 0===s?void 0:s.load)){const t=pe("iframefcb");return Lt()[t]=()=>{gapi.load?o():n(p(e,"network-request-failed"))},fe(`https://apis.google.com/js/api.js?onload=${t}`).catch((e=>n(e)))}o()}})).catch((e=>{throw Ln=null,e}))}(e),Ln}const Fn=new I(5e3,15e3),jn={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Un=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function $n(e){const t=e.config;v(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?E(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,s={apiKey:t.apiKey,appName:e.name,v:i.Jn},o=Un.get(e.config.apiHost);o&&(s.eid=o);const a=e._getFrameworks();return a.length&&(s.fw=a.join(",")),`${n}?${(0,r.xO)(s).slice(1)}`}const Bn={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Vn{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function zn(e,t,n,i=500,s=600){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),a=Math.max((window.screen.availWidth-i)/2,0).toString();let c="";const u=Object.assign(Object.assign({},Bn),{width:i.toString(),height:s.toString(),top:o,left:a}),l=(0,r.z$)().toLowerCase();n&&(c=te(l)?"_blank":n),Z(l)&&(t=t||"http://localhost",u.scrollbars="yes");const h=Object.entries(u).reduce(((e,[t,n])=>`${e}${t}=${n},`),"");if(function(e=(0,r.z$)()){var t;return oe(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(l)&&"_self"!==c)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",c),new Vn(null);const d=window.open(t||"",c,h);v(d,e,"popup-blocked");try{d.focus()}catch(f){}return new Vn(d)}const qn="__/auth/handler",Hn="emulator/auth/handler",Wn=encodeURIComponent("fac");async function Gn(e,t,n,s,o,a){v(e.config.authDomain,e,"auth-domain-config-required"),v(e.config.apiKey,e,"invalid-api-key");const c={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:s,v:i.Jn,eventId:o};if(t instanceof je){t.setDefaultLanguage(e.languageCode),c.providerId=t.providerId||"",(0,r.xb)(t.getCustomParameters())||(c.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(a||{}))c[e]=t}if(t instanceof Ue){const e=t.getScopes().filter((e=>""!==e));e.length>0&&(c.scopes=e.join(","))}e.tenantId&&(c.tid=e.tenantId);const u=c;for(const r of Object.keys(u))void 0===u[r]&&delete u[r];const l=await e._getAppCheckToken(),h=l?`#${Wn}=${encodeURIComponent(l)}`:"";return`${function({config:e}){if(!e.emulator)return`https://${e.authDomain}/${qn}`;return E(e,Hn)}(e)}?${(0,r.xO)(u).slice(1)}${h}`}const Kn="webStorageSupport";const Xn=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Rt,this._completeRedirectFn=En,this._overrideRedirectResult=Sn}
1async _openPopup(e,t,n,r){var i;_(null===(i=this.eventManagers[e._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()");return zn(e,await Gn(e,t,n,w(),r),Dt())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){Lt().location.href=e}(await Gn(e,t,n,w(),r)),new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(_(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch((()=>{delete this.eventManagers[t]})),n}async initAndGetManager(e){const t=await async function(e){const t=await Mn(e),n=Lt().gapi;return v(n,e,"internal-error"),t.open({where:document.body,url:$n(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:jn,dontclear:!0},(t=>new Promise((async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=p(e,"network-request-failed"),s=Lt().setTimeout((()=>{r(i)}),Fn.get());function o(){Lt().clearTimeout(s),n(t)}t.ping(o).then(o,(()=>{r(i)}))}))))}(e),n=new Tn(e);return t.register("authEvent",(t=>{v(null===t||void 0===t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Kn,{type:Kn},(n=>{var r;const i=null===(r=null===n||void 0===n?void 0:n[0])||void 0===r?void 0:r.webStorageSupport;void 0!==i&&t(!!i),f(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Rn(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ae()||ee()||oe()}};class Jn{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return b("unexpected MultiFactorSessionType")}}}class Yn extends Jn{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new Yn(e)}_finalizeEnroll(e,t,n){return function(e,t){return A(e,"POST","/v2/accounts/mfaEnrollment:finalize",O(e,t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return function(e,t){return A(e,"POST","/v2/accounts/mfaSignIn:finalize",O(e,t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class Qn{constructor(){}static assertion(e){return Yn._fromCredential(e)}}Qn.FACTOR_ID="phone";var Zn="@firebase/auth",er="0.23.2";class tr{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged((t=>{e((null===t||void 0===t?void 0:t.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){v(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}(0,r.Pz)("authIdTokenMaxAge");var nr;nr="Browser",(0,i.Xd)(new a.wA("auth",((e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=n.options;v(s&&!s.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:s,authDomain:o,clientPlatform:nr,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ce(nr)},c=new ve(n,r,i,a);return function(e,t){const n=(null===t||void 0===t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(G);(null===t||void 0===t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null===t||void 0===t?void 0:t.popupRedirectResolver)}(c,t),c}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),(0,i.Xd)(new a.wA("auth-internal",(e=>(e=>new tr(e))(be(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,i.KN)(Zn,er,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(nr)),(0,i.KN)(Zn,er,"esm2017")},39828:function(e,t,n){"use strict";n.d(t,{IO:function(){return r.IO},JU:function(){return r.JU},LV:function(){return r.LV},Xo:function(){return r.Xo},ad:function(){return r.ad},ar:function(){return r.ar},at:function(){return r.at},cf:function(){return r.cf},hJ:function(){return r.hJ},iE:function(){return r.iE},j5:function(){return r.j5},n3:function(){return r.n3},oe:function(){return r.oe},qs:function(){return r.qs},r7:function(){return r.r7}});var r=n(88036)},86650:function(e,t,n){"use strict";n.d(t,{connectStorageEmulator:function(){return Te},oq:function(){return ke},Jt:function(){return Se}
1,getStorage:function(){return Ee},iH:function(){return Ie},KV:function(){return we}});var r=n(25816),i=n(74444),s=n(8463);const o="firebasestorage.googleapis.com";class a extends i.ZR{constructor(e,t,n=0){super(l(e),`Firebase Storage: ${t} (${l(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,a.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return l(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var c,u;function l(e){return"storage/"+e}function h(){return new a(c.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function d(){return new a(c.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function f(){return new a(c.CANCELED,"User canceled the upload/download.")}function p(){return new a(c.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function m(e){return new a(c.INVALID_ARGUMENT,e)}function g(){return new a(c.APP_DELETED,"The Firebase app was deleted.")}function y(e,t){return new a(c.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function v(e){throw new a(c.INTERNAL_ERROR,"Internal error: "+e)}!function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CANNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(c||(c={}));class b{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=b.makeFromUrl(e,t)}catch(i){return new b(e,"")}if(""===n.path)return n;throw r=e,new a(c.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+r+"'.");var r}static makeFromUrl(e,t){let n=null;const r="([A-Za-z0-9.\\-_]+)";const i=new RegExp("^gs://"+r+"(/(.*))?$","i");function s(e){e.path_=decodeURIComponent(e.path)}const u=t.replace(/[.]/g,"\\."),l=[{regex:i,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${u}/v[A-Za-z0-9_]+/b/${r}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:s},{regex:new RegExp(`^https?://${t===o?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${r}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:s}];for(let o=0;o<l.length;o++){const t=l[o],r=t.regex.exec(e);if(r){const e=r[t.indices.bucket];let i=r[t.indices.path];i||(i=""),n=new b(e,i),t.postModify(n);break}}if(null==n)throw function(e){return new a(c.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class _{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function w(e){return"string"===typeof e||e instanceof String}function S(e){return k()&&e instanceof Blob}function k(){return"undefined"!==typeof Blob&&!(0,i.UG)()}function I(e,t,n,r){if(r<t)throw m(`Invalid value for '${e}'. Expected ${t} or greater.`);if(r>n)throw m(`Invalid value for '${e}'. Expected ${n} or less.`)}function E(e,t,n){let r=t;return null==n&&(r=`https://${t}`),`${n}://${r}/v0${e}`}function T(e){const t=encodeURIComponent;let n="?";for(const r in e)if(e.hasOwnProperty(r)){n=n+(t(r)+"="+t(e[r]))+"&"}return n=n.slice(0,-1),n}function C(e,t){const n=e>=500&&e<600,r=-1!==[408,429].indexOf(e),i=-1!==t.indexOf(e);return n||r||i}
1!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(u||(u={}));class x{constructor(e,t,n,r,i,s,o,a,c,u,l,h=!0){this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=i,this.additionalRetryCodes_=s,this.callback_=o,this.errorCallback_=a,this.timeout_=c,this.progressCallback_=u,this.connectionFactory_=l,this.retry=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise(((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()}))}start_(){const e=(e,t)=>{if(t)return void e(!1,new O(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const r=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(r),n.send(this.url_,this.method_,this.body_,this.headers_).then((()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(r),this.pendingConnection_=null;const t=n.getErrorCode()===u.NO_ERROR,i=n.getStatus();if(!t||C(i,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===u.ABORT;return void e(!1,new O(!1,null,t))}const s=-1!==this.successCodes_.indexOf(i);e(!0,new O(s,n))}))},t=(e,t)=>{const n=this.resolve_,r=this.reject_,i=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(i,i.getResponse());void 0!==e?n(e):n()}catch(s){r(s)}else if(null!==i){const e=h();e.serverResponse=i.getErrorText(),this.errorCallback_?r(this.errorCallback_(i,e)):r(e)}else if(t.canceled){r(this.appDelete_?g():f())}else{r(d())}};this.canceled_?t(0,new O(!1,null,!0)):this.backoffId_=function(e,t,n){let r=1,i=null,s=null,o=!1,a=0;function c(){return 2===a}let u=!1;function l(...e){u||(u=!0,t.apply(null,e))}function h(t){i=setTimeout((()=>{i=null,e(f,c())}),t)}function d(){s&&clearTimeout(s)}function f(e,...t){if(u)return void d();if(e)return d(),void l.call(null,e,...t);if(c()||o)return d(),void l.call(null,e,...t);let n;r<64&&(r*=2),1===a?(a=2,n=0):n=1e3*(r+Math.random()),h(n)}let p=!1;function m(e){p||(p=!0,d(),u||(null!==i?(e||(a=2),clearTimeout(i),h(0)):e||(a=1)))}return h(0),s=setTimeout((()=>{o=!0,m(!0)}),n),m}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class O{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function A(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function R(...e){const t=A();if(void 0!==t){const n=new t;for(let t=0;t<e.length;t++)n.append(e[t]);return n.getBlob()}if(k())return new Blob(e);throw new a(c.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}function N(e){if("undefined"===typeof atob)throw t="base-64",new a(c.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`);var t;return atob(e)}const D="raw",P="base64",L="base64url",M="data_url";class F{constructor(e,t){this.data=e,this.contentType=t||null}}function j(e,t){switch(e){case D:return new F(U(t));case P:case L:return new F($(e,t));case M:return new F(function(e){const t=new B(e);return t.base64?$(P,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(n){throw y(M,"Malformed data URL.")}return U(t)}(t.rest)}(t),new B(t).contentType)}throw h()}function U(e){const t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<=127)t.push(r);else if(r<=2047)t.push(192|r>>6,128|63&r);else if(55296===(64512&r)){if(n<e.length-1&&56320===(64512&e.charCodeAt(n+1))){r=65536|(1023&r)<<10|1023&e.charCodeAt(++n),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else t.push(239,191,189)}else 56320===(64512&r)?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(t)}function $(e,t){switch(e){case P:{const n=-1!==t.indexOf("-"),r=-1!==t.indexOf("_");if(n||r){throw y(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?")}break}case L:{const n=-1!==t.indexOf("+"),r=-1!==t.indexOf("/");if(n||r){throw y(e,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?")}t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=N(t)}
1catch(i){if(i.message.includes("polyfill"))throw i;throw y(e,"Invalid character found")}const r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}class B{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw y(M,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=t[1]||null;null!=n&&(this.base64=function(e,t){if(!(e.length>=t.length))return!1;return e.substring(e.length-t.length)===t}(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=e.substring(e.indexOf(",")+1)}}class V{constructor(e,t){let n=0,r="";S(e)?(this.data_=e,n=e.size,r=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,t){if(S(this.data_)){const n=function(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.mozSlice?e.mozSlice(t,n):e.slice?e.slice(t,n):null}(this.data_,e,t);return null===n?null:new V(n)}{const n=new Uint8Array(this.data_.buffer,e,t-e);return new V(n,!0)}}static getBlob(...e){if(k()){const t=e.map((e=>e instanceof V?e.data_:e));return new V(R.apply(null,t))}{const t=e.map((e=>w(e)?j(D,e).data:e.data_));let n=0;t.forEach((e=>{n+=e.byteLength}));const r=new Uint8Array(n);let i=0;return t.forEach((e=>{for(let t=0;t<e.length;t++)r[i++]=e[t]})),new V(r,!0)}}uploadData(){return this.data_}}function z(e){let t;try{t=JSON.parse(e)}catch(r){return null}return"object"!==typeof(n=t)||Array.isArray(n)?null:t;var n}function q(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function H(e,t){return t}class W{constructor(e,t,n,r){this.server=e,this.local=t||e,this.writable=!!n,this.xform=r||H}}let G=null;function K(){if(G)return G;const e=[];e.push(new W("bucket")),e.push(new W("generation")),e.push(new W("metageneration")),e.push(new W("name","fullPath",!0));const t=new W("name");t.xform=function(e,t){return function(e){return!w(e)||e.length<2?e:q(e)}(t)},e.push(t);const n=new W("size");return n.xform=function(e,t){return void 0!==t?Number(t):t},e.push(n),e.push(new W("timeCreated")),e.push(new W("updated")),e.push(new W("md5Hash",null,!0)),e.push(new W("cacheControl",null,!0)),e.push(new W("contentDisposition",null,!0)),e.push(new W("contentEncoding",null,!0)),e.push(new W("contentLanguage",null,!0)),e.push(new W("contentType",null,!0)),e.push(new W("metadata","customMetadata",!0)),G=e,G}function X(e,t,n){const r={type:"file"},i=n.length;for(let s=0;s<i;s++){const e=n[s];r[e.local]=e.xform(r,t[e.server])}return function(e,t){Object.defineProperty(e,"ref",{get:function(){const n=e.bucket,r=e.fullPath,i=new b(n,r);return t._makeStorageReference(i)}})}(r,e),r}function J(e,t,n){const r=z(t);if(null===r)return null;return X(e,r,n)}function Y(e,t){const n={},r=t.length;for(let i=0;i<r;i++){const r=t[i];r.writable&&(n[r.server]=e[r.local])}return JSON.stringify(n)}class Q{constructor(e,t,n,r){this.url=e,this.method=t,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function Z(e){if(!e)throw h()}function ee(e,t){return function(n,r){const i=J(e,r,t);return Z(null!==i),i}}function te(e,t){return function(n,r){const i=J(e,r,t);return Z(null!==i),function(e,t,n,r){const i=z(t);if(null===i)return null;if(!w(i.downloadTokens))return null;const s=i.downloadTokens;if(0===s.length)return null;const o=encodeURIComponent;return s.split(",").map((t=>{const i=e.bucket,s=e.fullPath;return E("/b/"+o(i)+"/o/"+o(s),n,r)+T({alt:"media",token:t})}))[0]}(i,r,e.host,e._protocol)}}function ne(e){return function(t,n){let r;var i,s;return 401===t.getStatus()?r=t.getErrorText().includes("Firebase App Check token is invalid")?new a(c.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new a(c.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(s=e.bucket,r=new a(c.QUOTA_EXCEEDED,"Quota for bucket '"+s+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(i=e.path,r=new a(c.UNAUTHORIZED,"User does not have permission to access '"+i+"'.")):r=n,r.status=t.getStatus(),r.serverResponse=n.serverResponse,r}}function re(e){const t=ne(e);return function(n,r){let i=t(n,r);var s;
1return 404===n.getStatus()&&(s=e.path,i=new a(c.OBJECT_NOT_FOUND,"Object '"+s+"' does not exist.")),i.serverResponse=r.serverResponse,i}}function ie(e,t,n){const r=Object.assign({},n);return r.fullPath=e.path,r.size=t.size(),r.contentType||(r.contentType=function(e,t){return e&&e.contentType||t&&t.type()||"application/octet-stream"}(null,t)),r}function se(e,t,n,r,i){const s=t.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"};const a=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();o["Content-Type"]="multipart/related; boundary="+a;const c=ie(t,r,i),u="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Y(c,n)+"\r\n--"+a+"\r\nContent-Type: "+c.contentType+"\r\n\r\n",l="\r\n--"+a+"--",h=V.getBlob(u,r,l);if(null===h)throw p();const d={name:c.fullPath},f=E(s,e.host,e._protocol),m=e.maxUploadRetryTime,g=new Q(f,"POST",ee(e,n),m);return g.urlParams=d,g.headers=o,g.body=h.uploadData(),g.errorHandler=ne(t),g}class oe{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=u.NO_ERROR,this.sendPromise_=new Promise((e=>{this.xhr_.addEventListener("abort",(()=>{this.errorCode_=u.ABORT,e()})),this.xhr_.addEventListener("error",(()=>{this.errorCode_=u.NETWORK_ERROR,e()})),this.xhr_.addEventListener("load",(()=>{e()}))}))}send(e,t,n,r){if(this.sent_)throw v("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==r)for(const i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw v("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw v("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw v("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw v("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class ae extends oe{initXhr(){this.xhr_.responseType="text"}}function ce(){return new ae}class ue{constructor(e,t){this._service=e,this._location=t instanceof b?t:b.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new ue(e,t)}get root(){const e=new b(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return q(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new b(this._location.bucket,e);return new ue(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new a(c.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function le(e,t,n){e._throwIfRoot("uploadBytes");const r=se(e.storage,e._location,K(),new V(t,!0),n);return e.storage.makeRequestWithTokens(r,ce).then((t=>({metadata:t,ref:e})))}function he(e){e._throwIfRoot("getDownloadURL");const t=function(e,t,n){const r=E(t.fullServerUrl(),e.host,e._protocol),i=e.maxOperationRetryTime,s=new Q(r,"GET",te(e,n),i);return s.errorHandler=re(t),s}(e.storage,e._location,K());return e.storage.makeRequestWithTokens(t,ce).then((e=>{if(null===e)throw new a(c.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e}))}function de(e){e._throwIfRoot("deleteObject");const t=function(e,t){const n=E(t.fullServerUrl(),e.host,e._protocol),r=e.maxOperationRetryTime,i=new Q(n,"DELETE",(function(e,t){}),r);return i.successCodes=[200,204],i.errorHandler=re(t),i}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,ce)}function fe(e,t){const n=function(e,t){const n=t.split("/").filter((e=>e.length>0)).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),r=new b(e._location.bucket,n);return new ue(e.storage,r)}function pe(e,t){if(e instanceof ye){const n=e;if(null==n._bucket)throw new a(c.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the 'storageBucket' property when initializing the app?");const r=new ue(n,n._bucket);return null!=t?pe(r,t):r}return void 0!==t?fe(e,t):e}function me(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof ye)return new ue(e,t);throw m("To use ref(service, url), the first argument must be a Storage instance.")}return pe(e,t)}function ge(e,t){const n=null===t||void 0===t?void 0:t.storageBucket;return null==n?null:b.makeFromBucketSpec(n,e)}class ye{constructor(e,t,n,r,i){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=r,this._firebaseVersion=i,this._bucket=null,this._host=o,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=r?b.makeFromBucketSpec(r,this._host):ge(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=b.makeFromBucketSpec(this._url,e):this._bucket=ge(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){I("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){I("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEac
1h((e=>e.cancel())),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new ue(this,e)}_makeRequest(e,t,n,r,i=!0){if(this._deleted)return new _(g());{const s=function(e,t,n,r,i,s,o=!0){const a=T(e.urlParams),c=e.url+a,u=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(u,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(u,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!==t&&void 0!==t?t:"AppManager")}(u,s),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(u,r),new x(c,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,o)}(e,this._appId,n,r,t,this._firebaseVersion,i);return this._requests.add(s),s.getPromise().then((()=>this._requests.delete(s)),(()=>this._requests.delete(s))),s}}async makeRequestWithTokens(e,t){const[n,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,r).getPromise()}}const ve="@firebase/storage",be="0.11.2",_e="storage";function we(e,t,n){return le(e=(0,i.m9)(e),t,n)}function Se(e){return he(e=(0,i.m9)(e))}function ke(e){return de(e=(0,i.m9)(e))}function Ie(e,t){return me(e=(0,i.m9)(e),t)}function Ee(e=(0,r.Mq)(),t){e=(0,i.m9)(e);const n=(0,r.qX)(e,_e).getImmediate({identifier:t}),s=(0,i.P0)("storage");return s&&Te(n,...s),n}function Te(e,t,n,r={}){!function(e,t,n,r={}){e.host=`${t}:${n}`,e._protocol="http";const{mockUserToken:s}=r;s&&(e._overrideAuthToken="string"===typeof s?s:(0,i.Sg)(s,e.app.options.projectId))}(e,t,n,r)}function Ce(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),s=e.getProvider("app-check-internal");return new ye(n,i,s,t,r.Jn)}(0,r.Xd)(new s.wA(_e,Ce,"PUBLIC").setMultipleInstances(!0)),(0,r.KN)(ve,be,""),(0,r.KN)(ve,be,"esm2017")},67421:function(e,t,n){"use strict";n.d(t,{a3:function(){return B},cC:function(){return j},$G:function(){return $}});var r=n(67294),i=n(87462),s=n(71739),o=n.n(s),a=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function c(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(o()[n[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("--\x3e");return{type:"comment",comment:-1!==r?e.slice(4,r):""}}for(var i=new RegExp(a),s=null;null!==(s=i.exec(e));)if(s[0].trim())if(s[1]){var c=s[1].trim(),u=[c,""];c.indexOf("=")>-1&&(u=c.split("=")),t.attrs[u[0]]=u[1],i.lastIndex--}else s[2]&&(t.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return t}var u=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,l=/^\s*$/,h=Object.create(null);function d(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(d,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var f={parse:function(e,t){t||(t={}),t.components||(t.components=h);var n,r=[],i=[],s=-1,o=!1;if(0!==e.indexOf("<")){var a=e.indexOf("<");r.push({type:"text",content:-1===a?e:e.substring(0,a)})}return e.replace(u,(function(a,u){if(o){if(a!=="</"+n.name+">")return;o=!1}var h,d="/"!==a.charAt(1),f=a.startsWith("\x3c!--"),p=u+a.length,m=e.charAt(p);if(f){var g=c(a);return s<0?(r.push(g),r):((h=i[s]).children.push(g),r)}if(d&&(s++,"tag"===(n=c(a)).type&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!m||"<"===m||n.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===s&&r.push(n),(h=i[s-1])&&h.children.push(n),i[s]=n),(!d||n.voidElement)&&(s>-1&&(n.voidElement||n.name===a.slice(2,-1))&&(s--,n=-1===s?r:i[s]),!o&&"<"!==m&&m)){h=-1===s?r:i[s].children;var y=e.indexOf("<",p),v=e.slice(p,-1===y?void 0:y);l.test(v)&&(v=" "),(y>-1&&s+h.length>=0||" "!==v)&&h.push({type:"text",content:v})}})),r},stringify:function(e){return e.reduce((function(e,t){return e+d("",t)}),"")}},p=f;function m(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"===typeof t[0]&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const g={};function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"===typeof t[0]&&g[t[0]]||("string"===typeof t[0]&&(g[t[0]]=new Date),m(...t))}const v=(e,t)=>
1()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout((()=>{e.off("initialized",n)}),0),t()};e.on("initialized",n)}};function b(e,t,n){e.loadNamespaces(t,v(e,n))}function _(e,t,n,r){"string"===typeof n&&(n=[n]),n.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,v(e,r))}function w(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=t.languages[0],i=!!t.options&&t.options.fallbackLng,s=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;const o=(e,n)=>{const r=t.services.backendConnector.state[`${e}|${n}`];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!o(r,e)||i&&!o(s,e))))}function S(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return y("i18n.languages were undefined or empty",t.languages),!0;const r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):w(e,t,n)}const k=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,I={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xa9","&#169;":"\xa9","&reg;":"\xae","&#174;":"\xae","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},E=e=>I[e];let T,C={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(k,E)};function x(){return C}function O(){return T}function A(e,t){if(!e)return!1;const n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function R(e){if(!e)return[];const t=e.props?e.props.children:e.children;return e.props&&e.props.i18nIsDynamicList?N(t):t}function N(e){return Array.isArray(e)?e:[e]}function D(e,t){if(!e)return"";let n="";const i=N(e),s=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return i.forEach(((e,i)=>{if("string"===typeof e)n+=`${e}`;else if((0,r.isValidElement)(e)){const r=Object.keys(e.props).length,o=s.indexOf(e.type)>-1,a=e.props.children;if(!a&&o&&0===r)n+=`<${e.type}/>`;else if(a||o&&0===r)if(e.props.i18nIsDynamicList)n+=`<${i}></${i}>`;else if(o&&1===r&&"string"===typeof a)n+=`<${e.type}>${a}</${e.type}>`;else{const e=D(a,t);n+=`<${i}>${e}</${i}>`}else n+=`<${i}></${i}>`}else if(null===e)m("Trans: the passed in value is invalid - seems you passed in a null child.");else if("object"===typeof e){const{format:t,...r}=e,i=Object.keys(r);if(1===i.length){const e=t?`${i[0]}, ${t}`:i[0];n+=`{{${e}}}`}else m("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",e)}else m("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",e)})),n}function P(e,t,n,s,o,a){if(""===t)return[];const c=s.transKeepBasicHtmlNodesFor||[],u=t&&new RegExp(c.map((e=>`<${e}`)).join("|")).test(t);if(!e&&!u&&!a)return[t];const l={};!function e(t){N(t).forEach((t=>{"string"!==typeof t&&(A(t)?e(R(t)):"object"!==typeof t||(0,r.isValidElement)(t)||Object.assign(l,t))}))}(e);const h=p.parse(`<0>${t}</0>`),d={...l,...o};function f(e,t,n){const i=R(e),s=g(i,t.children,n);return function(e){return"[object Array]"===Object.prototype.toString.call(e)&&e.every((e=>(0,r.isValidElement)(e)))}(i)&&0===s.length||e.props&&e.props.i18nIsDynamicList?i:s}function m(e,t,n,s,o){e.dummy?(e.children=t,n.push((0,r.cloneElement)(e,{key:s},o?void 0:t))):n.push(...r.Children.map([e],(e=>{const n={...e.props};return delete n.i18nIsDynamicList,r.createElement(e.type,(0,i.Z)({},n,{key:s,ref:e.ref},o?{}:{children:t}))})))}function g(t,i,o){const l=N(t);return N(i).reduce(((t,i,h)=>{const p=i.children&&i.children[0]&&i.children[0].content&&n.services.interpolator.interpolate(i.children[0].content,d,n.language);if("tag"===i.type){let a=l[parseInt(i.name,10)];1!==o.length||a||(a=o[0][i.name]),a||(a={});const y=0!==Object.keys(i.attrs).length?function(e,t){const n={...t};return n.props=Object.assign(e.props,t.props),n}({props:i.attrs},a):a,v=(0,r.isValidElement)(y),b=v&&A(i,!0)&&!i.voidElement,_=u&&"object"===typeof y&&y.dummy&&!v,w="object"===typeof e&&null!==e&&Object.hasOwnProperty.call(e,i.name);if("string"===typeof y){const e=n.services.interpolator.interpolate(y,d,n.language);t.push(e)}else if(A(y)||b){m(y,f(y,i,o),t,h)}else if(_){m(y,g(l,i.children,o),t,h)}else if(Number.isNaN(parseFloat(i.name)))if(w){m(y,f(y,i,o),t,h,i.voidElement)}else if(s.transSupportBasicHtmlNodes&&c.indexOf(i.name)>-1)if(i.voidElement)t.push((0,r.createElement)(i.name,{key:`${i.name}-${h}`}));else{const e=g(l,i.children,o);t.push((0,r.createElement)(i.name,{key:`${i.name}-${h}`},e))}else if(i.voidElement)t.push(`<${i.name} />`);else{const e=g(l,i.children,o);t.push(`<${i.name}>${e}</${i.name}>`)}else if("object"!==typeof y||v)m(y,p,t,h,1!==i.children.length||!p);else{const e=i.children[0]?p:null;e&&t.push(e)}}else if("text"===i.type){const e=s.transWrapTextNodes,o=a?s.unescape(n.services.interpolator.interpolate(i.content,d,n.language)):n.services.interpolator.interpolate(i.content,d,n.language);e?t.push((0,r.createElement)(e,{key:`${i.name}-${h}`},o)):t.push(o)}return t}),[])}return R(g([{dummy:!0,children:e||[]}],h,N(e||[]))[0])}function L(e){let{children:t,count:n,parent:i,i18nKey:s,context:o,tOptions:a={}
1,values:c,defaults:u,components:l,ns:h,i18n:d,t:f,shouldUnescape:p,...m}=e;const g=d||O();if(!g)return y("You will need to pass in an i18next instance by using i18nextReactModule"),t;const v=f||g.t.bind(g)||(e=>e);o&&(a.context=o);const b={...x(),...g.options&&g.options.react};let _=h||v.ns||g.options&&g.options.defaultNS;_="string"===typeof _?[_]:_||["translation"];const w=D(t,b),S=u||w||b.transEmptyNodeValue||s,{hashTransKey:k}=b,I=s||(k?k(w||S):w||S);g.options&&g.options.interpolation&&g.options.interpolation.defaultVariables&&(c=c&&Object.keys(c).length>0?{...c,...g.options.interpolation.defaultVariables}:{...g.options.interpolation.defaultVariables});const E=c?a.interpolation:{interpolation:{...a.interpolation,prefix:"#$?",suffix:"?$#"}},T={...a,count:n,...c,...E,defaultValue:S,ns:_},C=P(l||t,I?v(I,T):S,g,b,T,p),A=void 0!==i?i:b.defaultTransParent;return A?(0,r.createElement)(A,m,C):C}const M=(0,r.createContext)();class F{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function j(e){let{children:t,count:n,parent:i,i18nKey:s,context:o,tOptions:a={},values:c,defaults:u,components:l,ns:h,i18n:d,t:f,shouldUnescape:p,...m}=e;const{i18n:g,defaultNS:y}=(0,r.useContext)(M)||{},v=d||g||O(),b=f||v&&v.t.bind(v);return L({children:t,count:n,parent:i,i18nKey:s,context:o,tOptions:a,values:c,defaults:u,components:l,ns:h||b&&b.ns||y||v&&v.options&&v.options.defaultNS,i18n:v,t:f,shouldUnescape:p,...m})}const U=(e,t)=>{const n=(0,r.useRef)();return(0,r.useEffect)((()=>{n.current=t?n.current:e}),[e,t]),n.current};function $(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{i18n:n}=t,{i18n:i,defaultNS:s}=(0,r.useContext)(M)||{},o=n||i||O();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new F),!o){y("You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>"string"===typeof t?t:t&&"object"===typeof t&&"string"===typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}o.options.react&&void 0!==o.options.react.wait&&y("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...x(),...o.options.react,...t},{useSuspense:c,keyPrefix:u}=a;let l=e||s||o.options&&o.options.defaultNS;l="string"===typeof l?[l]:l||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(l);const h=(o.isInitialized||o.initializedStoreOnce)&&l.every((e=>S(e,o,a)));function d(){return o.getFixedT(t.lng||null,"fallback"===a.nsMode?l:l[0],u)}const[f,p]=(0,r.useState)(d);let m=l.join();t.lng&&(m=`${t.lng}${m}`);const g=U(m),v=(0,r.useRef)(!0);(0,r.useEffect)((()=>{const{bindI18n:e,bindI18nStore:n}=a;function r(){v.current&&p(d)}return v.current=!0,h||c||(t.lng?_(o,t.lng,l,(()=>{v.current&&p(d)})):b(o,l,(()=>{v.current&&p(d)}))),h&&g&&g!==m&&v.current&&p(d),e&&o&&o.on(e,r),n&&o&&o.store.on(n,r),()=>{v.current=!1,e&&o&&e.split(" ").forEach((e=>o.off(e,r))),n&&o&&n.split(" ").forEach((e=>o.store.off(e,r)))}}),[o,m]);const w=(0,r.useRef)(!0);(0,r.useEffect)((()=>{v.current&&!w.current&&p(d),w.current=!1}),[o,u]);const k=[f,o,h];if(k.t=f,k.i18n=o,k.ready=h,h)return k;if(!h&&!c)return k;throw new Promise((e=>{t.lng?_(o,t.lng,l,(()=>e())):b(o,l,(()=>e()))}))}function B(e){let{i18n:t,defaultNS:n,children:i}=e;const s=(0,r.useMemo)((()=>({i18n:t,defaultNS:n})),[t,n]);return(0,r.createElement)(M.Provider,{value:s},i)}},1762:function(e,t,n){"use strict";n.d(t,{ng:function(){return bt},mG:function(){return yt},yf:function(){return st},Ho:function(){return vt},RE:function(){return Me},Bs:function(){return _t},Xq:function(){return wt},aC:function(){return St},$N:function(){return je},CU:function(){return kt},J8:function(){return it},vz:function(){return rt},ZE:function(){return Et},Y2:function(){return Tt},TS:function(){return $e},y$:function(){return It},aF:function(){return Ue}});var r=n(67294),i=n(24367),s=Math,o=n(83977),a=n(39828),c=(n(86650),function(e,t){return(c=Object.
1setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)});function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function l(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{c(r.next(e))}catch(t){s(t)}}function a(e){try{c(r.throw(e))}catch(t){s(t)}}function c(e){e.done?i(e.value):function(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(a){s=[6,a],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function p(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{!function(e){e.value instanceof m?Promise.resolve(e.value.v).then(c,u):l(s[0][2],e)}(i[e](t))}catch(n){l(s[0][3],n)}}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function y(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=d(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function v(e){return"function"==typeof e}function b(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}var _=b((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}}));function w(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var S=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var o=d(s),a=o.next();!a.done;a=o.next()){a.value.remove(this)}}catch(g){e={error:g}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else s.remove(this);var c=this.initialTeardown;
vendor: 7,209 bytes, line 1
1if(v(c))try{c()}catch(g){i=g instanceof _?g.errors:[g]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=d(u),h=l.next();!h.done;h=l.next()){var m=h.value;try{E(m)}catch(g){i=null!=i?i:[],g instanceof _?i=p(p([],f(i)),f(g.errors)):i.push(g)}}}catch(g){n={error:g}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new _(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)E(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).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)&&w(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&w(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),k=S.EMPTY;function I(e){return e instanceof S||e&&"closed"in e&&v(e.remove)&&v(e.add)&&v(e.unsubscribe)}function E(e){v(e)?e():e.unsubscribe()}var T=void 0,C=!1,x=!1,O={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=O.delegate;return null!=i&&i.setTimeout?i.setTimeout.apply(i,p([e,t],f(n))):setTimeout.apply(void 0,p([e,t],f(n)))},clearTimeout:function(e){var t=O.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function A(e){O.setTimeout((function(){throw e}))}function R(){}var N=null;function D(e){if(C){var t=!N;if(t&&(N={errorThrown:!1,error:null}),e(),t){var n=N,r=n.errorThrown,i=n.error;if(N=null,r)throw i}}else e()}var P=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,I(t)&&t.add(n)):n.destination=$,n}return u(t,e),t.create=function(e,t,n){return new j(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(S),L=Function.prototype.bind;function M(e,t){return L.call(e,t)}var F=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){U(n)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){U(n)}else U(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){U(t)}},e}(),j=function(e){function t(t,n,r){var i,s,o=e.call(this)||this;v(t)||!t?i={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&x?((s=Object.create(t)).unsubscribe=function(){return o.unsubscribe()},i={next:t.next&&M(t.next,s),error:t.error&&M(t.error,s),complete:t.complete&&M(t.complete,s)}):i=t;return o.destination=new F(i),o}return u(t,e),t}(P);function U(e){A(e)}var $={closed:!0,next:R,error:function(e){throw e},complete:R},B="function"==typeof Symbol&&Symbol.observable||"@@observable";function V(e){return e}function z(e){return 0===e.length?V:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var q=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=function(e){return e&&e instanceof P||function(e){return e&&v(e.next)&&v(e.error)&&v(e.complete)}(e)&&I(e)}(e)?e:new j(e,t,n);return D((function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=H(t))((function(t,r){var i=new j({next:function(t){try{e(t)}catch(n){r(n),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[B]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return z(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=H(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function H(e){var t;return null!==(t=null!=e?e:T)&&void 0!==t?t:Promise}function W(e){return function(t){if(function(e){return v(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(n){this.error(n)}}));throw new TypeError("Unable to lift unknown Observable type")}}function G(e,t,n,r,i){return new K(e,t,n,r,i)}var K=function(e){function t(t,n,r,i,s,o){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=n?function(e){try{n(e)}catch(r){t.error(r)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(n){t.error(n)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return u(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(P),X=b((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),J=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return u(t,e),t.prototype.lift=function(e){var t=new Y(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new X},t.prototype.next=function(e){var t=this;D((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=d(t.currentObservers),s=i.next();!s.done;s=i.next()){s.value.next(e)}}catch(o){n={error:o}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;D((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;D((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0}
vendor: 4,063 bytes, line 1
1,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,n=this,r=n.hasError,i=n.isStopped,s=n.observers;return r||i?k:(this.currentObservers=null,s.push(e),new S((function(){t.currentObservers=null,w(s,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new q;return e.source=this,e},t.create=function(e,t){return new Y(e,t)},t}(q),Y=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return u(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.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,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:k},t}(J),Q={now:function(){return(Q.delegate||Date).now()},delegate:void 0},Z=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Q);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return u(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,o=n._timestampProvider,a=n._windowTime;r||(i.push(t),!s&&i.push(o.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,s=(i?1:2)*t;if(t<1/0&&s<r.length&&r.splice(0,r.length-s),!i){for(var o=n.now(),a=0,c=1;c<r.length&&r[c]<=o;c+=2)a=c;a&&r.splice(0,a+1)}},t}(J),ee=function(e){function t(t,n){return e.call(this)||this}return u(t,e),t.prototype.schedule=function(e,t){return this},t}(S),te={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=te.delegate;return null!=i&&i.setInterval?i.setInterval.apply(i,p([e,t],f(n))):setInterval.apply(void 0,p([e,t],f(n)))},clearInterval:function(e){var t=te.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},ne=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return u(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),te.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;te.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(i){r=!0,n=i||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;
1this.work=this.state=this.scheduler=null,this.pending=!1,w(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(ee),re=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Q.now,e}(),ie=function(e){function t(t,n){void 0===n&&(n=re.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return u(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(re),se=(new ie(ne),new q((function(e){return e.complete()})));function oe(e){return e?function(e){return new q((function(t){return e.schedule((function(){return t.complete()}))}))}(e):se}function ae(e){return e&&v(e.schedule)}function ce(e){return e[e.length-1]}function ue(e){return ae(ce(e))?e.pop():void 0}var le=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function he(e){return v(null==e?void 0:e.then)}function de(e){return v(e[B])}function fe(e){return Symbol.asyncIterator&&v(null==e?void 0:e[Symbol.asyncIterator])}function pe(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.")}var me="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ge(e){return v(null==e?void 0:e[me])}function ye(e){return g(this,arguments,(function(){var t,n,r;return h(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,m(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,m(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,m(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}
1))}))}function ve(e){return v(null==e?void 0:e.getReader)}function be(e){if(e instanceof q)return e;if(null!=e){if(de(e))return function(e){return new q((function(t){var n=e[B]();if(v(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}(e);if(le(e))return function(e){return new q((function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()}))}(e);if(he(e))return function(e){return new q((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,A)}))}(e);if(fe(e))return _e(e);if(ge(e))return function(e){return new q((function(t){var n,r;try{for(var i=d(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(t.next(o),t.closed)return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}))}(e);if(ve(e))return function(e){return _e(ye(e))}(e)}throw pe(e)}function _e(e){return new q((function(t){(function(e,t){var n,r,i,s;return l(this,void 0,void 0,(function(){var o,a;return h(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=y(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function we(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var s=t.schedule((function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()}),r);if(e.add(s),!i)return s}function Se(e,t){return void 0===t&&(t=0),W((function(n,r){n.subscribe(G(r,(function(n){return we(r,e,(function(){return r.next(n)}),t)}),(function(){return we(r,e,(function(){return r.complete()}),t)}),(function(n){return we(r,e,(function(){return r.error(n)}),t)})))}))}function ke(e,t){return void 0===t&&(t=0),W((function(n,r){r.add(e.schedule((function(){return n.subscribe(r)}),t))}))}function Ie(e,t){if(!e)throw new Error("Iterable cannot be null");return new q((function(n){we(n,t,(function(){var r=e[Symbol.asyncIterator]();we(n,t,(function(){r.next().then((function(e){e.done?n.complete():n.next(e.value)}))}),0,!0)}))}))}function Ee(e,t){if(null!=e){if(de(e))return function(e,t){return be(e).pipe(ke(t),Se(t))}(e,t);if(le(e))return function(e,t){return new q((function(n){var r=0;return t.schedule((function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())}))}))}(e,t);if(he(e))return function(e,t){return be(e).pipe(ke(t),Se(t))}(e,t);if(fe(e))return Ie(e,t);if(ge(e))return function(e,t){return new q((function(n){var r;return we(n,t,(function(){r=e[me](),we(n,t,(function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(s){return void n.error(s)}i?n.complete():n.next(t)}),0,!0)})),function(){return v(null==r?void 0:r.return)&&r.return()}}))}(e,t);if(ve(e))return function(e,t){return Ie(ye(e),t)}(e,t)}throw pe(e)}function Te(e,t){return t?Ee(e,t):be(e)}function Ce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ue(e);return Te(e,n)}b((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));function xe(e,t){return W((function(n,r){var i=0;n.subscribe(G(r,(function(n){r.next(e.call(t,n,i++))})))}))}function Oe(e){return W((function(t,n){var r,i=null,s=!1;i=t.subscribe(G(n,void 0,void 0,(function(o){r=be(e(o,Oe(e)(t))),i?(i.unsubscribe(),i=null,r.subscribe(n)):s=!0}))),s&&(i.unsubscribe(),i=null,r.subscribe(n))}))}function Ae(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==t){if(!1!==t){var i=new j({next:function(){i.unsubscribe(),e()}});return t.apply(void 0,p([],f(n))).subscribe(i)}}else e()}function Re(e,t,n){var r,i,s,o,a=!1;return e&&"object"==typeof e?(r=e.bufferSize,o=void 0===r?1/0:r,i=e.windowTime,t=void 0===i?1/0:i,a=void 0!==(s=e.refCount)&&s,n=e.scheduler):o=null!=e?e:1/0,function(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new J}:t,r=e.resetOnError,i=void 0===r||r,s=e.resetOnComplete,o=void 0===s||s,a=e.resetOnRefCountZero,c=void 0===a||a;return function(e){var t,r,s,a=0,u=!1,l=!1,h=function(){null==r||r.unsubscribe(),r=void 0},d=function(){h(),t=s=void 0,u=l=!1},f=function(){var e=t;d(),null==e||e.unsubscribe()};return W((function(e,p){a++,!l&&!u&&h();var m=s=null!=s?s:n();p.add((function(){0===--a&&!l&&!u&&(r=Ae(f,c))})),m.subscribe(p),!t&&a>0&&(t=new j({next:function(e){return m.next(e)},error:function(e){l=!0,h(),r=Ae(d,i,e),m.error(e)},complete:function(){u=!0,h(),r=Ae(d,o),m.complete()}}),be(e).subscribe(t))}))(e)}}({connector:function(){return new Z(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function Ne(e,t){return W((function(n,r){var i=null,s=0,o=!1,a=function(){return o&&!i&&r.complete()};n.subscribe(G(r,(function(n){null==i||i.unsubscribe();var o=0,c=s++;be(e(n,c)).subscribe(i=G(r,(function(e){return r.next(t?t(n,e,c,o++):e)}),(function(){i=null,a()})))}),(function(){o=!0,a()})))}))}function De(e){return new q((function(t){return{unsubscribe:(0,i.MX)(e,t.next.bind(t),t.error.bind(t),t.complete.bind(t))}}))}const Pe=r.createContext(void 0),Le=r.createContext(!1);function Me(e){const{firebaseConfig:t,appName:n,suspense:i}=e,s=r.useMemo((()=>
1{if(e.firebaseApp)return e.firebaseApp;const i=(0,o.C6)().find((e=>e.name===(n||"[DEFAULT]")));if(i){if(t&&((e,t)=>e===t||[...Object.keys(e),...Object.keys(t)].every((n=>e[n]===t[n])))(i.options,t))return i;throw new Error(`Does not match the options already provided to the ${n||"default"} firebase app instance, give this new instance a different appName.`)}{if(!t)throw new Error("No firebaseConfig provided");const e=r.version||"unknown";return(0,o.KN)("react",e),(0,o.KN)("reactfire","4.2.3"),(0,o.ZF)(t,n)}}),[e.firebaseApp,t,n]);return r.createElement(Pe.Provider,{value:s},r.createElement(Le.Provider,Object.assign({value:null!=i&&i},e)))}function Fe(e){let t=r.useContext(Le);return void 0!==e?e:t}function je(){const e=r.useContext(Pe);if(!e)throw new Error("Cannot call useFirebaseApp unless your component is within a FirebaseAppProvider");return e}function Ue(e){const t=St();return et(`auth:user:${t.name}`,De(t),e)}function $e(e){if((null==e?void 0:e.hasOwnProperty("requiredClaims"))&&(null==e?void 0:e.hasOwnProperty("validateCustomClaims")))throw new Error('Cannot have both "requiredClaims" and "validateCustomClaims". Use one or the other.');const t=St();let n=`auth:signInCheck:${t.name}::forceRefresh:${!(null==e||!e.forceRefresh)}`;null!=e&&e.forceRefresh&&(n=`${n}:forceRefresh:${e.forceRefresh}`),null!=e&&e.hasOwnProperty("requiredClaims")?n=`${n}:requiredClaims:${JSON.stringify(e.requiredClaims)}`:null!=e&&e.hasOwnProperty("validateCustomClaims")&&(n=`${n}:validateCustomClaims:${JSON.stringify(e.validateCustomClaims)}`);const r=De(t).pipe(Ne((t=>{var n;return t?e&&(e.hasOwnProperty("requiredClaims")||e.hasOwnProperty("validateCustomClaims"))?Te(t.getIdTokenResult(null!==(n=null==e?void 0:e.forceRefresh)&&void 0!==n&&n)).pipe(xe((n=>{let r;r=e.hasOwnProperty("requiredClaims")?function(e){return function(t){const n={};return Object.keys(e).forEach((r=>{e[r]!==t[r]&&(n[r]=[new Ct("auth/missing-claim",`Expected "${e[r]}", but user has "${t[r]}" instead`)])})),{hasRequiredClaims:0===Object.keys(n).length,errors:n}}}(e.requiredClaims):e.validateCustomClaims;const{hasRequiredClaims:i,errors:s}=r(n.claims);return{signedIn:!0,hasRequiredClaims:i,errors:s,user:t}}))):Ce({signedIn:!0,hasRequiredClaims:!0,errors:{},user:t}):Ce({signedIn:!1,hasRequiredClaims:!1,errors:{},user:null})})));return et(n,r)}var Be,Ve,ze;(ze=Ve||(Ve={})).added="child_added",ze.removed="child_removed",ze.changed="child_changed",ze.moved="child_moved",ze.value="value";Object.freeze(((Be={})[Ve.added]=s.onChildAdded,Be[Ve.removed]=s.onChildRemoved,Be[Ve.changed]=s.onChildChanged,Be[Ve.moved]=s.onChildMoved,Be[Ve.value]=s.onValue,Be));const qe=globalThis._reactFireDatabaseCachedQueries||[];globalThis._reactFireDatabaseCachedQueries||(globalThis._reactFireDatabaseCachedQueries=qe);var He={includeMetadataChanges:!1};function We(e,t){return void 0===t&&(t=He),new q((function(n){return{unsubscribe:(0,a.cf)(e,t,{next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)})}}))}function Ge(e){return We(e,{includeMetadataChanges:!0})}function Ke(e,t){return void 0===t&&(t={}),Ge(e).pipe(xe((function(e){return Xe(e,t)})))}function Xe(e,t){void 0===t&&(t={});var n=e.data();return!e.exists()||"object"!=typeof n||null===n||t.idField&&(n[t.idField]=e.id),n}function Je(e,t){return void 0===t&&(t={}),function(e){return We(e,{includeMetadataChanges:!0}).pipe(xe((function(e){return e.docs})))}(e).pipe(xe((function(e){return e.map((function(e){return Xe(e,t)}))})))}class Ye extends J{constructor(e,t){super(),this._timeoutWindow=t,this._hasValue=!1,this._error=void 0,this._firstEmission=new Promise((e=>this._resolveFirstEmission=e)),this._innerObservable=e.pipe(function(e,t,n){var r=v(e)||t||n?{next:e,error:t,complete:n}:e;return r?W((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var i=!0;e.subscribe(G(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;i=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;i=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;i&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):V}({next:e=>{this._next(e)},error:e=>{this._error=e,this._resolveFirstEmission()}}),Oe((()=>oe())),Re(1)),this._warmupSubscription=this._innerObservable.subscribe(),this._timeoutHandler=setTimeout(this._reset.bind(this),this._timeoutWindow)}get hasValue(){return this._hasValue||!!this._error}get value(){if(this._error)throw this._error;if(!this.hasValue)throw Error("Can only get value if SuspenseSubject has a value");return this._value}get firstEmission(){return this._firstEmission}_next(e){this._hasValue=!0,this._value=e,this._resolveFirstEmission()}_reset(){this._warmupSubscription&&this._warmupSubscription.unsubscribe(),this._hasValue=!1,this._value=void 0,this._error=void 0,this._firstEmission=new Promise((e=>this._resolveFirstEmission=e))}_subscribe(e){return this._timeoutHandler&&clearTimeout(this._timeoutHandler),this._innerSubscriber=this._innerObservable.subscribe(e),this._innerSubscriber}get ourError(){return this._error}}const Qe=globalThis._reactFirePreloadedObservables||new Map;function Ze(e,t){if(Qe.has(t))return Qe.get(t);{const n=new Ye(e,3e4);return Qe.set(t,n),n}}function et(e,t,n={}){var i;if(!e)throw new Error("cannot call useObservable without an observableId");const s=Ze(t,e),o=n.hasOwnProperty("initialData")||n.hasOwnProperty("startWithValue"),a=s.hasValue||o;if(!0===Fe(n.suspense)&&!a)throw s.firstEmission;const c={status:a?"success":"loading",hasEmitted:a,isComplete:!1,data:s.hasValue?s.value:null!==(i=null==n?void 0:n.initialData)&&void 0!==i?i:null==n?void 0:n.startWithValue,error:s.ourError,firstValuePromise:s.firstEmission},[u,l]=r.useReducer(function(e){return function(t,n){const r=Object.assign(Object.assign({},t),{hasEmitted:t.hasEmitted||e.hasValue,error:e.ourError,firstValuePromise:e.firstEmission});switch(e.hasValue&&(r.data=e.value),n){case"value":return r.status="success",r;case"error":return r.status="error",r;case"complete":return r.isComplete=!0,r;default:throw new Error(`invalid action "${n}"`)}}}(s),c);return r.useEffect((()=>{const e=s.subscribe({next:()=>{l("value")},error:e=>{throw l("error"),e},complete:()=>{l("complete")}});return()=>e.unsubscribe()}),[s]),u}globalThis._reactFirePreloadedObservables||(globalThis._reactFirePreloadedObservables=Qe);const tt=globalThis._reactFireFirestoreQueryCache||[];function nt(e){const t=tt.findIndex((t=>(0,a.iE)(t,e)));return t>-1?t:tt.push(e)-1}function rt(e,t){const n=t?Ot(t):"NO_ID_FIELD";return et(`firestore:docData:${e.firestore.app.name}:${e.path}:idField=${n}`,Ke(e,{idField:n}),t)}function it(e,t){const n=t?Ot(t):"NO_ID_FIELD";return et(`firestore:collectionData:${nt(e)}:idField=${n}`,Je(e,{idField:n}),t)}globalThis._reactFireFirestoreQueryCache||(globalThis._reactFireFirestoreQueryCache=tt);const st=r.createContext(void 0),ot=r.createContext(void 0),at=r.createContext(void 0),ct=r.createContext(void 0),ut=r.createContext(void 0),lt=r.createContext(void 0),ht=r.createContext(void 0),dt=r.createContext(void 0),ft=r.createContext(void 0);function pt(e){return function(t){var n,i;if(!t.sdk)throw new Error("no sdk provided");const s=je().name;if((null===(i=null===(n=null==t?void 0:t.sdk)||void 0===n?void 0:n.app)||void 0===i?void 0:i.name)!==s)throw new Error("sdk was initialized with a different firebase app");return r.createElement(e.Provider,Object.assign({value:t.sdk},t))}}function mt(e){const t=r.useContext(e);if(!t)throw new Error("SDK not found. useSdk must be called from within a provider");return t}function gt(e,t,n,i){const s=je();if(r.useContext(t))throw new Error(`Cannot initialize SDK ${e} because it already exists in Context`);const o=r.useMemo((()=>n(s)),[s]);return et(`firebase-sdk:${e}:${s.name}`,Te(o),i)}const yt=pt(st),vt=pt(ot),bt=pt(at),_t=(pt(ct),pt(ut)),wt=(pt(lt),pt(dt),pt(ht)),St=(pt(ft),()=>mt(ot)),kt=()=>mt(ut),It=()=>mt(ht),Et=(e,t)=>
1gt("analytics",at,e,t),Tt=(e,t)=>gt("storage",ht,e,t);class Ct extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="ReactFireError",Object.setPrototypeOf(this,Ct.prototype)}}function xt(e,t){if("idField"===t||"initialData"===t||"suspense"===t)return e?e[t]:void 0;throw new Error(`Field "${t}" is not a valid key in ReactFireOptions`)}function Ot(e){return xt(e,"idField")}},11753:function(e,t,n){"use strict";n.d(t,{$l:function(){return o},BN:function(){return L},DY:function(){return f},J$:function(){return z},JN:function(){return b},LI:function(){return x},PM:function(){return u},W6:function(){return T},i_:function(){return s},kY:function(){return G},ko:function(){return J},kw:function(){return C},mf:function(){return c},o8:function(){return a},qC:function(){return R},s6:function(){return X},sj:function(){return P},u3:function(){return D},u_:function(){return $},w6:function(){return E},xD:function(){return Y}});var r=n(67294);const i=()=>{},s=i(),o=Object,a=e=>e===s,c=e=>"function"==typeof e,u=(e,t)=>({...e,...t}),l=new WeakMap;let h=0;const d=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,s;if(o(e)!==e||r||n==RegExp)i=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(i=l.get(e),i)return i;if(i=++h+"~",l.set(e,i),n==Array){for(i="@",s=0;s<e.length;s++)i+=d(e[s])+",";l.set(e,i)}if(n==o){i="#";const t=o.keys(e).sort();for(;!a(s=t.pop());)a(e[s])||(i+=s+":"+d(e[s])+",");l.set(e,i)}}return i},f=new WeakMap,p={},m={},g="undefined",y=typeof window!=g,v=typeof document!=g,b=(e,t)=>{const n=f.get(e);return[()=>!a(t)&&e.get(t)||p,r=>{if(!a(t)){const i=e.get(t);t in m||(m[t]=i),n[5](t,u(i,r),i||p)}},n[6],()=>!a(t)&&t in m?m[t]:!a(t)&&e.get(t)||p]};let _=!0;const[w,S]=y&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[i,i],k={isOnline:()=>_,isVisible:()=>{const e=v&&document.visibilityState;return a(e)||"hidden"!==e}},I={initFocus:e=>(v&&document.addEventListener("visibilitychange",e),w("focus",e),()=>{v&&document.removeEventListener("visibilitychange",e),S("focus",e)}),initReconnect:e=>{const t=()=>{_=!0,e()},n=()=>{_=!1};
1return w("online",t),w("offline",n),()=>{S("online",t),S("offline",n)}}},E=!r.useId,T=!y||"Deno"in window,C=e=>y&&typeof window.requestAnimationFrame!=g?window.requestAnimationFrame(e):setTimeout(e,1),x=T?r.useEffect:r.useLayoutEffect,O="undefined"!==typeof navigator&&navigator.connection,A=!T&&O&&(["slow-2g","2g"].includes(O.effectiveType)||O.saveData),R=e=>{if(c(e))try{e=e()}catch(n){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?d(e):"",t]};let N=0;const D=()=>++N;var P={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function L(...e){const[t,n,r,i]=e,o=u({populateCache:!0,throwOnError:!0},"boolean"===typeof i?{revalidate:i}:i||{});let l=o.populateCache;const h=o.rollbackOnError;let d=o.optimisticData;const p=!1!==o.revalidate,m=o.throwOnError;if(c(n)){const e=n,r=[],i=t.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(g))}return g(n);async function g(n){const[i]=R(n);if(!i)return;const[o,u]=b(t,i),[g,y,v,_]=f.get(t),w=()=>{const e=g[i];return p&&(delete v[i],delete _[i],e&&e[0])?e[0](2).then((()=>o().data)):o().data};if(e.length<3)return w();let S,k=r;const I=D();y[i]=[I,0];const E=!a(d),T=o(),C=T.data,x=T._c,O=a(x)?C:x;if(E&&(d=c(d)?d(O,C):d,u({data:d,_c:O})),c(k))try{k=k(O)}catch(A){S=A}if(k&&c(k.then)){if(k=await k.catch((e=>{S=e})),I!==y[i][0]){if(S)throw S;return k}S&&E&&(e=>"function"===typeof h?h(e):!1!==h)(S)&&(l=!0,u({data:O,_c:s}))}if(l&&!S)if(c(l)){const e=l(k,O);u({data:e,error:s,_c:s})}else u({data:k,error:s,_c:s});if(y[i][1]=D(),Promise.resolve(w()).then((()=>{u({_c:s})})),!S)return k;if(m)throw S}}const M=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},F=(e,t)=>{if(!f.has(e)){const n=u(I,t),r={},o=L.bind(s,e);let a=i;const c={},l=(e,t)=>{const n=c[e]||[];return c[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},h=(t,n,r)=>{e.set(t,n);const i=c[t];if(i)for(const e of i)e(n,r)},d=()=>{if(!f.has(e)&&(f.set(e,[r,{},{},{},o,h,l]),!T)){const t=n.initFocus(setTimeout.bind(s,M.bind(s,r,0))),i=n.initReconnect(setTimeout.bind(s,M.bind(s,r,1)));a=()=>{t&&t(),i&&i(),f.delete(e)}}};return d(),[e,o,d,a]}return[e,f.get(e)[4]]},[j,U]=F(new Map),$=u({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:(e,t,n,r,i)=>{const s=n.errorRetryCount,o=i.retryCount,c=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!a(s)&&o>s||setTimeout(r,c,i)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:A?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:A?5e3:3e3,compare:(e,t)=>d(e)==d(t),isPaused:()=>!1,cache:j,mutate:U,fallback:{}},k),B=(e,t)=>{const n=u(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:o}=t;r&&s&&(n.use=r.concat(s)),i&&o&&(n.fallback=u(i,o))}return n},V=(0,r.createContext)({}),z=e=>{const{value:t}=e,n=(0,r.useContext)(V),i=c(t),o=(0,r.useMemo)((()=>i?t(n):t),[i,n,t]),a=(0,r.useMemo)((()=>
1i?o:B(n,o)),[i,n,o]),l=o&&o.provider,h=(0,r.useRef)(s);l&&!h.current&&(h.current=F(l(a.cache||j),o));const d=h.current;return d&&(a.cache=d[0],a.mutate=d[1]),x((()=>{if(d)return d[2]&&d[2](),d[3]}),[]),(0,r.createElement)(V.Provider,u(e,{value:a}))},q=y&&window.__SWR_DEVTOOLS_USE__,H=q?window.__SWR_DEVTOOLS_USE__:[],W=e=>c(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],G=()=>u($,(0,r.useContext)(V)),K=H.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=R(t),[,,,i]=f.get(j);if(r.startsWith("$inf$"))return n(...e);const s=i[r];return a(s)?n(...e):(delete i[r],s)}),r))),X=e=>function(...t){const n=G(),[r,i,s]=W(t),o=B(n,s);let a=e;const{use:c}=o,u=(c||[]).concat(K);for(let e=u.length;e--;)a=u[e](a);return a(r,i||o.fetcher||null,o)},J=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},Y=(e,t)=>(...n)=>{const[r,i,s]=W(n),o=(s.use||[]).concat(t);return e(r,i,{...s,use:o})};q&&(window.__SWR_DEVTOOLS_REACT__=r)},95591:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},kY:function(){return s.kY}});var r=n(67294),i=n(61688),s=n(11753);const o=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e)}),a={dedupe:!0},c=(s.$l.defineProperty(s.J$,"defaultValue",{value:s.u_}),(0,s.s6)(((e,t,n)=>{const{cache:c,compare:u,suspense:l,fallbackData:h,revalidateOnMount:d,revalidateIfStale:f,refreshInterval:p,refreshWhenHidden:m,refreshWhenOffline:g,keepPreviousData:y}=n,[v,b,_,w]=s.DY.get(c),[S,k]=(0,s.qC)(e),I=(0,r.useRef)(!1),E=(0,r.useRef)(!1),T=(0,r.useRef)(S),C=(0,r.useRef)(t),x=(0,r.useRef)(n),O=()=>x.current,A=()=>O().isVisible()&&O().isOnline(),[R,N,D,P]=(0,s.JN)(c,S),L=(0,r.useRef)({}).current,M=(0,s.o8)(h)?n.fallback[S]:h,F=(e,t)=>{for(const n in L){const r=n;if("data"===r){if(!u(e[r],t[r])){if(!(0,s.o8)(e[r]))return!1;if(!u(W,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},j=(0,r.useMemo)((()=>{const e=!!S&&!!t&&((0,s.o8)(d)?!O().isPaused()&&!l&&(!!(0,s.o8)(f)||f):d),n=t=>{const n=(0,s.PM)(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=R(),i=P(),o=n(r),a=r===i?o:n(i);let c=o;return[()=>{const e=n(R());return F(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>a]}),[c,S]),U=(0,i.useSyncExternalStore)((0,r.useCallback)((e=>D(S,((t,n)=>{F(n,t)||e()}))),[c,S]),j[0],j[1]),$=!I.current,B=v[S]&&v[S].length>0,V=U.data,z=(0,s.o8)(V)?M:V,q=U.error,H=(0,r.useRef)(z),W=y?(0,s.o8)(V)?H.current:V:z,G=!(B&&!(0,s.o8)(q))&&($&&!(0,s.o8)(d)?d:!O().isPaused()&&(l?!(0,s.o8)(z)&&f:(0,s.o8)(z)||f)),K=!!(S&&t&&$&&G),X=(0,s.o8)(U.isValidating)?K:U.isValidating,J=(0,s.o8)(U.isLoading)?K:U.isLoading,Y=(0,r.useCallback)((async e=>{const t=C.current;if(!S||!t||E.current||O().isPaused())return!1;let r,i,o=!0;const a=e||{},c=!_[S]||!a.dedupe,l=()=>s.w6?!E.current&&S===T.current&&I.current:S===T.current,h={isValidating:!1,isLoading:!1},d=()=>{N(h)},f=()=>{const e=_[S];e&&e[1]===i&&delete _[S]},p={isValidating:!0};(0,s.o8)(R().data)&&(p.isLoading=!0);try{if(c&&(N(p),n.loadingTimeout&&(0,s.o8)(R().data)&&setTimeout((()=>{o&&l()&&O().onLoadingSlow(S,n)}),n.loadingTimeout),_[S]=[t(k),(0,s.u3)()]),[r,i]=_[S],r=await r,c&&setTimeout(f,n.dedupingInterval),!_[S]||_[S][1]!==i)return c&&l()&&O().onDiscarded(S),!1;h.error=s.i_;const e=b[S];if(!(0,s.o8)(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return d(),c&&l()&&O().onDiscarded(S),!1;const a=R().data;h.data=u(a,r)?a:r,c&&l()&&O().onSuccess(r,S,n)}catch(m){f();const e=O(),{shouldRetryOnError:t}=e;e.isPaused()||(h.error=m,c&&l()&&(e.onError(m,S,e),(!0===t||(0,s.mf)(t)&&t(m))&&A()&&e.onErrorRetry(m,S,e,(e=>{const t=v[S];t&&t[0]&&t[0](s.sj.ERROR_REVALIDATE_EVENT,e)}),{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return o=!1,d(),!0}),[S,c]),Q=(0,r.useCallback)(((...e)=>(0,s.BN)(c,T.current,...e)),[]);if((0,s.LI)((()=>{C.current=t,x.current=n,(0,s.o8)(V)||(H.current=V)})),(0,s.LI)((()=>
1{if(!S)return;const e=Y.bind(s.i_,a);let t=0;const n=(0,s.ko)(S,v,((n,r={})=>{if(n==s.sj.FOCUS_EVENT){const n=Date.now();O().revalidateOnFocus&&n>t&&A()&&(t=n+O().focusThrottleInterval,e())}else if(n==s.sj.RECONNECT_EVENT)O().revalidateOnReconnect&&A()&&e();else{if(n==s.sj.MUTATE_EVENT)return Y();if(n==s.sj.ERROR_REVALIDATE_EVENT)return Y(r)}}));return E.current=!1,T.current=S,I.current=!0,N({_k:k}),G&&((0,s.o8)(z)||s.W6?e():(0,s.kw)(e)),()=>{E.current=!0,n()}}),[S]),(0,s.LI)((()=>{let e;function t(){const t=(0,s.mf)(p)?p(R().data):p;t&&-1!==e&&(e=setTimeout(n,t))}function n(){R().error||!m&&!O().isVisible()||!g&&!O().isOnline()?t():Y(a).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[p,m,g,S]),(0,r.useDebugValue)(W),l&&(0,s.o8)(z)&&S){if(!s.w6&&s.W6)throw new Error("Fallback data is required when using suspense in SSR.");C.current=t,x.current=n,E.current=!1;const e=w[S];if(!(0,s.o8)(e)){const t=Q(e);o(t)}if(!(0,s.o8)(q))throw q;{const e=Y(a);(0,s.o8)(W)||(e.status="fulfilled",e.value=!0),o(e)}}return{mutate:Q,get data(){return L.data=!0,W},get error(){return L.error=!0,q},get isValidating(){return L.isValidating=!0,X},get isLoading(){return L.isLoading=!0,J}}})))},44334:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(67294),i=n(95591),s=n(11753);const o=s.w6?e=>{e()}:r.startTransition,a=(0,s.xD)(i.ZP,(()=>(e,t,n={})=>{const{mutate:a}=(0,i.kY)(),c=(0,r.useRef)(e),u=(0,r.useRef)(t),l=(0,r.useRef)(n),h=(0,r.useRef)(0),[d,f,p]=(e=>{const[,t]=(0,r.useState)({}),n=(0,r.useRef)(!1),i=(0,r.useRef)(e),o=(0,r.useRef)({data:!1,error:!1,isValidating:!1}),a=(0,r.useCallback)((e=>{let r=!1;const s=i.current;for(const t in e){const n=t;s[n]!==e[n]&&(s[n]=e[n],o.current[n]&&(r=!0))}r&&!n.current&&t({})}),[]);return(0,s.LI)((()=>(n.current=!1,()=>{n.current=!0}))),[i,o.current,a]})({data:s.i_,error:s.i_,isMutating:!1}),m=d.current,g=(0,r.useCallback)((async(e,t)=>{const[n,r]=(0,s.qC)(c.current);if(!u.current)throw new Error("Can\u2019t trigger the mutation: missing fetcher.");if(!n)throw new Error("Can\u2019t trigger the mutation: missing key.");const i=(0,s.PM)((0,s.PM)({populateCache:!1,throwOnError:!0},l.current),t),d=(0,s.u3)();h.current=d,p({isMutating:!0});try{const t=await a(n,u.current(r,{arg:e}),(0,s.PM)(i,{throwOnError:!0}));var f,m;if(h.current<=d)o((()=>p({data:t,isMutating:!1,error:void 0}))),null==(f=(m=i).onSuccess)||f.call(m,t,n,i);return t}catch(v){var g,y;if(h.current<=d)if(o((()=>p({error:v,isMutating:!1}))),null==(g=(y=i).onError)||g.call(y,v,n,i),i.throwOnError)throw v}}),[]),y=(0,r.useCallback)((()=>{h.current=(0,s.u3)(),p({data:s.i_,error:s.i_,isMutating:!1})}),[]);return(0,s.LI)((()=>{c.current=e,u.current=t,l.current=n})),{trigger:g,reset:y,get data(){return f.data=!0,m.data},get error(){return f.error=!0,m.error},get isMutating(){return f.isMutating=!0,m.isMutating}}}))},97582:function(e,t,n){"use strict";n.d(t,{_T:function(){return i},ev:function(){return s},pi:function(){return r}});var r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}Object.create;function s(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[9774,179],(function(){return t(42110),t(6840),t(59974)}));var n=e.O();_N_E=n}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.