(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2888],{83395:function(n,l,u){"use strict";u.d(l,{BH:function(){return Deferred},G6:function(){return isSafari},L:function(){return base64urlEncodeWithoutPadding},LL:function(){return ErrorFactory},P0:function(){return getDefaultEmulatorHostnameAndPort},Pz:function(){return getExperimentalSetting},Sg:function(){return createMockUserToken},ZR:function(){return FirebaseError},aH:function(){return getDefaultAppConfig},b$:function(){return isReactNative},eu:function(){return validateIndexedDBOpenable},hl:function(){return isIndexedDBAvailable},m9:function(){return getModularInstance},ne:function(){return createSubscribe},pd:function(){return extractQuerystring},q4:function(){return getDefaultEmulatorHost},ru:function(){return isBrowserExtension},tV:function(){return base64Decode},uI:function(){return isMobileCordova},vZ:function(){return function deepEqual(n,l){if(n===l)return!0;let u=Object.keys(n),d=Object.keys(l);for(let h of u){if(!d.includes(h))return!1;let u=n[h],f=l[h];if(isObject(u)&&isObject(f)){if(!deepEqual(u,f))return!1}else if(u!==f)return!1}for(let n of d)if(!u.includes(n))return!1;return!0}},w1:function(){return isIE},xO:function(){return querystring},xb:function(){return isEmpty},z$:function(){return getUA},zd:function(){return querystringDecode}});var d=u(34406);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let stringToByteArray$1=function(n){let l=[],u=0;for(let d=0;d<n.length;d++){let h=n.charCodeAt(d);h<128?l[u++]=h:(h<2048?l[u++]=h>>6|192:((64512&h)==55296&&d+1<n.length&&(64512&n.charCodeAt(d+1))==56320?(h=65536+((1023&h)<<10)+(1023&n.charCodeAt(++d)),l[u++]=h>>18|240,l[u++]=h>>12&63|128):l[u++]=h>>12|224,l[u++]=h>>6&63|128),l[u++]=63&h|128)}return l},byteArrayToString=function(n){let l=[],u=0,d=0;for(;u<n.length;){let h=n[u++];if(h<128)l[d++]=String.fromCharCode(h);else if(h>191&&h<224){let f=n[u++];l[d++]=String.fromCharCode((31&h)<<6|63&f)}else if(h>239&&h<365){let f=n[u++],m=n[u++],g=n[u++],_=((7&h)<<18|(63&f)<<12|(63&m)<<6|63&g)-65536;l[d++]=String.fromCharCode(55296+(_>>10)),l[d++]=String.fromCharCode(56320+(1023&_))}else{let f=n[u++],m=n[u++];l[d++]=String.fromCharCode((15&h)<<12|(63&f)<<6|63&m)}}return l.join("")},h={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(n,l){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let u=l?this.byteToCharMapWebSafe_:this.byteToCharMap_,d=[];for(let l=0;l<n.length;l+=3){let h=n[l],f=l+1<n.length,m=f?n[l+1]:0,g=l+2<n.length,_=g?n[l+2]:0,j=h>>2,$=(3&h)<<4|m>>4,z=(15&m)<<2|_>>6,ee=63&_;g||(ee=64,f||(z=64)),d.push(u[j],u[$],u[z],u[ee])}return d.join("")},encodeString(n,l){return this.HAS_NATIVE_SUPPORT&&!l?btoa(n):this.encodeByteArray(stringToByteArray$1(n),l)},decodeString(n,l){return this.HAS_NATIVE_SUPPORT&&!l?atob(n):byteArrayToString(this.decodeStringToByteArray(n,l))},decodeStringToByteArray(n,l){this.init_();let u=l?this.charToByteMapWebSafe_:this.charToByteMap_,d=[];for(let l=0;l<n.length;){let h=u[n.charAt(l++)],f=l<n.length,m=f?u[n.charAt(l)]:0;++l;let g=l<n.length,_=g?u[n.charAt(l)]:64;++l;let j=l<n.length,$=j?u[n.charAt(l)]:64;if(++l,null==h||null==m||null==_||null==$)throw new DecodeBase64StringError;let z=h<<2|m>>4;if(d.push(z),64!==_){let n=m<<4&240|_>>2;if(d.push(n),64!==$){let n=_<<6&192|$;d.push(n)}}}return d},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};let DecodeBase64StringError=class DecodeBase64StringError extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}};let base64Encode=function(n){let l=stringToByteArray$1(n);return h.encodeByteArray(l,!0)},base64urlEncodeWithoutPadding=function(n){return base64Encode(n).replace(/\./g,"")},base64Decode=function(n){try{return h.decodeString(n,!0)}catch(n){console.error("base64Decode failed: ",n)}return null},getDefaultsFromGlobal=()=>/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==u.g)return u.g;throw Error("Unable to locate global object.")})().__FIREBASE_DEFAULTS__,getDefaultsFromEnvVariable=()=>{if(void 0===d||void 0===d.env)return;let n=d.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},getDefaultsFromCookie=()=>{let n;if("undefined"==typeof document)return;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(n){return}let l=n&&base64Decode(n[1]);return l&&JSON.parse(l)},getDefaults=()=>{try{return getDefaultsFromGlobal()||getDefaultsFromEnvVariable()||getDefaultsFromCookie()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},getDefaultEmulatorHost=n=>{var l,u;return null===(u=null===(l=getDefaults())||void 0===l?void 0:l.emulatorHosts)||void 0===u?void 0:u[n]},getDefaultEmulatorHostnameAndPort=n=>{let l=getDefaultEmulatorHost(n);if(!l)return;let u=l.lastIndexOf(":");if(u<=0||u+1===l.length)throw Error(`Invalid host ${l} with no separate hostname and port!`);let d=parseInt(l.substring(u+1),10);return"["===l[0]?[l.substring(1,u-1),d]:[l.substring(0,u),d]},getDefaultAppConfig=()=>{var n;return null===(n=getDefaults())||void 0===n?void 0:n.config},getExperimentalSetting=n=>{var l;return null===(l=getDefaults())||void 0===l?void 0:l[`_${n}`]};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Deferred=class Deferred{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((n,l)=>{this.resolve=n,this.reject=l})}wrapCallback(n){return(l,u)=>{l?this.reject(l):this.resolve(u),"function"==typeof n&&(this.promise.catch(()=>{}),1===n.length?n(l):n(l,u))}}};/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function createMockUserToken(n,l){if(n.uid)throw Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let u=l||"demo-project",d=n.iat||0,h=n.sub||n.user_id;if(!h)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let f=Object.assign({iss:`https://securetoken.google.com/${u}`,aud:u,iat:d,exp:d+3600,auth_time:d,sub:h,user_id:h,firebase:{sign_in_provider:"custom",identities:{}}},n);return[base64urlEncodeWithoutPadding(JSON.stringify({alg:"none",type:"JWT"})),base64urlEncodeWithoutPadding(JSON.stringify(f)),""].join(".")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function getUA(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function isMobileCordova(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(getUA())}function isBrowserExtension(){let n="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof n&&void 0!==n.id}function isReactNative(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function isIE(){let n=getUA();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function isSafari(){return!function(){var n;let l=null===(n=getDefaults())||void 0===n?void 0:n.forceEnvironment;if("node"===l)return!0;if("browser"===l)return!1;try{return"[object process]"===Object.prototype.toString.call(u.g.process)}catch(n){return!1}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function isIndexedDBAvailable(){try{return"object"==typeof indexedDB}catch(n){return!1}}function validateIndexedDBOpenable(){return new Promise((n,l)=>{try{let u=!0,d="validate-browser-context-for-indexeddb-analytics-module",h=self.indexedDB.open(d);h.onsuccess=()=>{h.result.close(),u||self.indexedDB.deleteDatabase(d),n(!0)},h.onupgradeneeded=()=>{u=!1},h.onerror=()=>{var n;l((null===(n=h.error)||void 0===n?void 0:n.message)||"")}}catch(n){l(n)}})}let FirebaseError=class FirebaseError extends Error{constructor(n,l,u){super(l),this.code=n,this.customData=u,this.name="FirebaseError",Object.setPrototypeOf(this,FirebaseError.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ErrorFactory.prototype.create)}};let ErrorFactory=class ErrorFactory{constructor(n,l,u){this.service=n,this.serviceName=l,this.errors=u}create(n,...l){let u=l[0]||{},d=`${this.service}/${n}`,h=this.errors[n],m=h?h.replace(f,(n,l)=>{let d=u[l];return null!=d?String(d):`<${l}?>`}):"Error",g=`${this.serviceName}: ${m} (${d}).`,_=new FirebaseError(d,g,u);return _}};let f=/\{\$([^}]+)}/g;function isEmpty(n){for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l))return!1;return!0}function isObject(n){return null!==n&&"object"==typeof n}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function querystring(n){let l=[];for(let[u,d]of Object.entries(n))Array.isArray(d)?d.forEach(n=>{l.push(encodeURIComponent(u)+"="+encodeURIComponent(n))}):l.push(encodeURIComponent(u)+"="+encodeURIComponent(d));return l.length?"&"+l.join("&"):""}function querystringDecode(n){let l={},u=n.replace(/^\?/,"").split("&");return u.forEach(n=>{if(n){let[u,d]=n.split("=");l[decodeURIComponent(u)]=decodeURIComponent(d)}}),l}function extractQuerystring(n){let l=n.indexOf("?");if(!l)return"";let u=n.indexOf("#",l);return n.substring(l,u>0?u:void 0)}function createSubscribe(n,l){let u=new ObserverProxy(n,l);return u.subscribe.bind(u)}let ObserverProxy=class ObserverProxy{constructor(n,l){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=l,this.task.then(()=>{n(this)}).catch(n=>{this.error(n)})}next(n){this.forEachObserver(l=>{l.next(n)})}error(n){this.forEachObserver(l=>{l.error(n)}),this.close(n)}complete(){this.forEachObserver(n=>{n.complete()}),this.close()}subscribe(n,l,u){let d;if(void 0===n&&void 0===l&&void 0===u)throw Error("Missing Observer.");void 0===(d=!function(n,l){if("object"!=typeof n||null===n)return!1;for(let u of l)if(u in n&&"function"==typeof n[u])return!0;return!1}(n,["next","error","complete"])?{next:n,error:l,complete:u}:n).next&&(d.next=noop),void 0===d.error&&(d.error=noop),void 0===d.complete&&(d.complete=noop);let h=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?d.error(this.finalError):d.complete()}catch(n){}}),this.observers.push(d),h}unsubscribeOne(n){void 0!==this.observers&&void 0!==this.observers[n]&&(delete this.observers[n],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(n){if(!this.finalized)for(let l=0;l<this.observers.length;l++)this.sendOne(l,n)}sendOne(n,l){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[n])try{l(this.observers[n])}catch(n){"undefined"!=typeof console&&console.error&&console.error(n)}})}close(n){this.finalized||(this.finalized=!0,void 0!==n&&(this.finalError=n),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function noop(){}/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function getModularInstance(n){return n&&n._delegate?n._delegate:n}},20157:function(n,l,u){"use strict";Object.defineProperty(l,"__esModule",{value:!0});let d=u(52322),h=u(2784);l.default=function({html:n,height:l=null,width:u=null,children:f,dataNtpc:m=""}){return(0,h.useEffect)(()=>{m&&performance.mark("mark_feature_usage",{detail:{feature:`next-third-parties-${m}`}})},[m]),(0,d.jsxs)(d.Fragment,{children:[f,n?(0,d.jsx)("div",{style:{height:null!=l?`${l}px`:"auto",width:null!=u?`${u}px`:"auto"},"data-ntpc":m,dangerouslySetInnerHTML:{__html:n}}):null]})}},68925:function(n,l,u){"use strict";let d;var h=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0}),l.sendGAEvent=l.GoogleAnalytics=void 0;let f=u(52322),m=u(2784),g=h(u(45847));l.GoogleAnalytics=function(n){let{gaId:l,dataLayerName:u="dataLayer"}=n;return void 0===d&&(d=u),(0,m.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-ga"}})},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(g.default,{id:"_next-ga-init",dangerouslySetInnerHTML:{__html:`
          window['${u}'] = window['${u}'] || [];
          function gtag(){window['${u}'].push(arguments);}
          gtag('js', new Date());

          gtag('config', '${l}');`}}),(0,f.jsx)(g.default,{id:"_next-ga",src:`https://www.googletagmanager.com/gtag/js?id=${l}`})]})},l.sendGAEvent=function(...n){if(void 0===d){console.warn("@next/third-parties: GA has not been initialized");return}window[d]?window[d].push(arguments):console.warn(`@next/third-parties: GA dataLayer ${d} does not exist`)}},89362:function(n,l,u){"use strict";var d=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0});let h=u(52322),f=u(89565),m=d(u(20157));l.default=function(n){let{apiKey:l,...u}=n,d={...u,key:l},{html:g}=(0,f.GoogleMapsEmbed)(d);return(0,h.jsx)(m.default,{height:d.height||null,width:d.width||null,html:g,dataNtpc:"GoogleMapsEmbed"})}},78072:function(n,l,u){"use strict";let d;var h=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0}),l.sendGTMEvent=l.GoogleTagManager=void 0;let f=u(52322),m=u(2784),g=h(u(45847));l.GoogleTagManager=function(n){let{gtmId:l,dataLayerName:u="dataLayer",auth:h,preview:_,dataLayer:j}=n;void 0===d&&(d=u);let $="dataLayer"!==u?`&l=${u}`:"",z=h?`&gtm_auth=${h}`:"",ee=_?`&gtm_preview=${_}&gtm_cookies_win=x`:"";return(0,m.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-gtm"}})},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(g.default,{id:"_next-gtm-init",dangerouslySetInnerHTML:{__html:`
      (function(w,l){
        w[l]=w[l]||[];
        w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
        ${j?`w[l].push(${JSON.stringify(j)})`:""}
      })(window,'${u}');`}}),(0,f.jsx)(g.default,{id:"_next-gtm","data-ntpc":"GTM",src:`https://www.googletagmanager.com/gtm.js?id=${l}${$}${z}${ee}`})]})},l.sendGTMEvent=n=>{if(void 0===d){console.warn("@next/third-parties: GTM has not been initialized");return}window[d]?window[d].push(n):console.warn(`@next/third-parties: GTM dataLayer ${d} does not exist`)}},48790:function(n,l,u){"use strict";var d=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0}),l.sendGAEvent=l.GoogleAnalytics=l.sendGTMEvent=l.GoogleTagManager=l.YouTubeEmbed=l.GoogleMapsEmbed=void 0;var h=u(89362);Object.defineProperty(l,"GoogleMapsEmbed",{enumerable:!0,get:function(){return d(h).default}});var f=u(62316);Object.defineProperty(l,"YouTubeEmbed",{enumerable:!0,get:function(){return d(f).default}});var m=u(78072);Object.defineProperty(l,"GoogleTagManager",{enumerable:!0,get:function(){return m.GoogleTagManager}}),Object.defineProperty(l,"sendGTMEvent",{enumerable:!0,get:function(){return m.sendGTMEvent}});var g=u(68925);Object.defineProperty(l,"GoogleAnalytics",{enumerable:!0,get:function(){return g.GoogleAnalytics}}),Object.defineProperty(l,"sendGAEvent",{enumerable:!0,get:function(){return g.sendGAEvent}})},62316:function(n,l,u){"use strict";var d=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0});let h=u(52322),f=d(u(45847)),m=u(89565),g=d(u(20157)),_={server:"beforeInteractive",client:"afterInteractive",idle:"lazyOnload",worker:"worker"};l.default=function(n){let{html:l,scripts:u,stylesheets:d}=(0,m.YouTubeEmbed)(n);return(0,h.jsx)(g.default,{height:n.height||null,width:n.width||null,html:l,dataNtpc:"YouTubeEmbed",children:null==u?void 0:u.map(n=>(0,h.jsx)(f.default,{src:n.url,strategy:_[n.strategy],stylesheets:d},n.url))})}},95338:function(n){"use strict";let l=[];n.exports={registerAsset:function(n){return l.push(n)},getAssetByID:function(n){return l[n-1]}}},65963:function(n){"use strict";let l;function hue2rgb(n,l,u){return(u<0&&(u+=1),u>1&&(u-=1),u<1/6)?n+(l-n)*6*u:u<.5?l:u<2/3?n+(l-n)*(2/3-u)*6:n}function hslToRgb(n,l,u){let d=u<.5?u*(1+l):u+l-u*l,h=2*u-d,f=hue2rgb(h,d,n+1/3),m=hue2rgb(h,d,n),g=hue2rgb(h,d,n-1/3);return Math.round(255*f)<<24|Math.round(255*m)<<16|Math.round(255*g)<<8}let u="[-+]?\\d*\\.?\\d+",d=u+"%";function call(...n){return"\\(\\s*("+n.join(")\\s*,?\\s*(")+")\\s*\\)"}function callWithSlashSeparator(...n){return"\\(\\s*("+n.slice(0,n.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+n[n.length-1]+")\\s*\\)"}function commaSeparatedCall(...n){return"\\(\\s*("+n.join(")\\s*,\\s*(")+")\\s*\\)"}function parse255(n){let l=parseInt(n,10);return l<0?0:l>255?255:l}function parse360(n){let l=parseFloat(n);return(l%360+360)%360/360}function parse1(n){let l=parseFloat(n);return l<0?0:l>1?255:Math.round(255*l)}function parsePercentage(n){let l=parseFloat(n);return l<0?0:l>100?1:l/100}n.exports=function(n){let h;if("number"==typeof n)return n>>>0===n&&n>=0&&n<=4294967295?n:null;if("string"!=typeof n)return null;let f=(void 0===l&&(l={rgb:RegExp("rgb"+call(u,u,u)),rgba:RegExp("rgba("+commaSeparatedCall(u,u,u,u)+"|"+callWithSlashSeparator(u,u,u,u)+")"),hsl:RegExp("hsl"+call(u,d,d)),hsla:RegExp("hsla("+commaSeparatedCall(u,d,d,u)+"|"+callWithSlashSeparator(u,d,d,u)+")"),hwb:RegExp("hwb"+call(u,d,d)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),l);if(h=f.hex6.exec(n))return parseInt(h[1]+"ff",16)>>>0;let m=function(n){switch(n){case"transparent":return 0;case"aliceblue":return 4042850303;case"antiquewhite":return 4209760255;case"aqua":case"cyan":return 16777215;case"aquamarine":return 2147472639;case"azure":return 4043309055;case"beige":return 4126530815;case"bisque":return 4293182719;case"black":return 255;case"blanchedalmond":return 4293643775;case"blue":return 65535;case"blueviolet":return 2318131967;case"brown":return 2771004159;case"burlywood":return 3736635391;case"burntsienna":return 3934150143;case"cadetblue":return 1604231423;case"chartreuse":return 2147418367;case"chocolate":return 3530104575;case"coral":return 4286533887;case"cornflowerblue":return 1687547391;case"cornsilk":return 4294499583;case"crimson":return 3692313855;case"darkblue":return 35839;case"darkcyan":return 9145343;case"darkgoldenrod":return 3095792639;case"darkgray":case"darkgrey":return 2846468607;case"darkgreen":return 6553855;case"darkkhaki":return 3182914559;case"darkmagenta":return 2332068863;case"darkolivegreen":return 1433087999;case"darkorange":return 4287365375;case"darkorchid":return 2570243327;case"darkred":return 2332033279;case"darksalmon":return 3918953215;case"darkseagreen":return 2411499519;case"darkslateblue":return 1211993087;case"darkslategray":case"darkslategrey":return 793726975;case"darkturquoise":return 13554175;case"darkviolet":return 2483082239;case"deeppink":return 4279538687;case"deepskyblue":return 12582911;case"dimgray":case"dimgrey":return 1768516095;case"dodgerblue":return 512819199;case"firebrick":return 2988581631;case"floralwhite":return 4294635775;case"forestgreen":return 579543807;case"fuchsia":case"magenta":return 4278255615;case"gainsboro":return 3705462015;case"ghostwhite":return 4177068031;case"gold":return 4292280575;case"goldenrod":return 3668254975;case"gray":case"grey":return 2155905279;case"green":return 8388863;case"greenyellow":return 2919182335;case"honeydew":return 4043305215;case"hotpink":return 4285117695;case"indianred":return 3445382399;case"indigo":return 1258324735;case"ivory":return 4294963455;case"khaki":return 4041641215;case"lavender":return 3873897215;case"lavenderblush":return 4293981695;case"lawngreen":return 2096890111;case"lemonchiffon":return 4294626815;case"lightblue":return 2916673279;case"lightcoral":return 4034953471;case"lightcyan":return 3774873599;case"lightgoldenrodyellow":return 4210742015;case"lightgray":case"lightgrey":return 3553874943;case"lightgreen":return 2431553791;case"lightpink":return 4290167295;case"lightsalmon":return 4288707327;case"lightseagreen":return 548580095;case"lightskyblue":return 2278488831;case"lightslategray":case"lightslategrey":return 2005441023;case"lightsteelblue":return 2965692159;case"lightyellow":return 4294959359;case"lime":return 16711935;case"limegreen":return 852308735;case"linen":return 4210091775;case"maroon":return 2147483903;case"mediumaquamarine":return 1724754687;case"mediumblue":return 52735;case"mediumorchid":return 3126187007;case"mediumpurple":return 2473647103;case"mediumseagreen":return 1018393087;case"mediumslateblue":return 2070474495;case"mediumspringgreen":return 16423679;case"mediumturquoise":return 1221709055;case"mediumvioletred":return 3340076543;case"midnightblue":return 421097727;case"mintcream":return 4127193855;case"mistyrose":return 4293190143;case"moccasin":return 4293178879;case"navajowhite":return 4292783615;case"navy":return 33023;case"oldlace":return 4260751103;case"olive":return 2155872511;case"olivedrab":return 1804477439;case"orange":return 4289003775;case"orangered":return 4282712319;case"orchid":return 3664828159;case"palegoldenrod":return 4008225535;case"palegreen":return 2566625535;case"paleturquoise":return 2951671551;case"palevioletred":return 3681588223;case"papayawhip":return 4293907967;case"peachpuff":return 4292524543;case"peru":return 3448061951;case"pink":return 4290825215;case"plum":return 3718307327;case"powderblue":return 2967529215;case"purple":return 2147516671;case"rebeccapurple":return 1714657791;case"red":return 4278190335;case"rosybrown":return 3163525119;case"royalblue":return 1097458175;case"saddlebrown":return 2336560127;case"salmon":return 4202722047;case"sandybrown":return 4104413439;case"seagreen":return 780883967;case"seashell":return 4294307583;case"sienna":return 2689740287;case"silver":return 3233857791;case"skyblue":return 2278484991;case"slateblue":return 1784335871;case"slategray":case"slategrey":return 1887473919;case"snow":return 4294638335;case"springgreen":return 16744447;case"steelblue":return 1182971135;case"tan":return 3535047935;case"teal":return 8421631;case"thistle":return 3636451583;case"tomato":return 4284696575;case"turquoise":return 1088475391;case"violet":return 4001558271;case"wheat":return 4125012991;case"white":return 4294967295;case"whitesmoke":return 4126537215;case"yellow":return 4294902015;case"yellowgreen":return 2597139199}return null}(n);return null!=m?m:(h=f.rgb.exec(n))?(parse255(h[1])<<24|parse255(h[2])<<16|parse255(h[3])<<8|255)>>>0:(h=f.rgba.exec(n))?void 0!==h[6]?(parse255(h[6])<<24|parse255(h[7])<<16|parse255(h[8])<<8|parse1(h[9]))>>>0:(parse255(h[2])<<24|parse255(h[3])<<16|parse255(h[4])<<8|parse1(h[5]))>>>0:(h=f.hex3.exec(n))?parseInt(h[1]+h[1]+h[2]+h[2]+h[3]+h[3]+"ff",16)>>>0:(h=f.hex8.exec(n))?parseInt(h[1],16)>>>0:(h=f.hex4.exec(n))?parseInt(h[1]+h[1]+h[2]+h[2]+h[3]+h[3]+h[4]+h[4],16)>>>0:(h=f.hsl.exec(n))?(255|hslToRgb(parse360(h[1]),parsePercentage(h[2]),parsePercentage(h[3])))>>>0:(h=f.hsla.exec(n))?void 0!==h[6]?(hslToRgb(parse360(h[6]),parsePercentage(h[7]),parsePercentage(h[8]))|parse1(h[9]))>>>0:(hslToRgb(parse360(h[2]),parsePercentage(h[3]),parsePercentage(h[4]))|parse1(h[5]))>>>0:(h=f.hwb.exec(n))?(255|function(n,l,u){if(l+u>=1){let n=Math.round(255*l/(l+u));return n<<24|n<<16|n<<8}let d=hue2rgb(0,1,n+1/3)*(1-l-u)+l,h=hue2rgb(0,1,n)*(1-l-u)+l,f=hue2rgb(0,1,n-1/3)*(1-l-u)+l;return Math.round(255*d)<<24|Math.round(255*h)<<16|Math.round(255*f)<<8}(parse360(h[1]),parsePercentage(h[2]),parsePercentage(h[3])))>>>0:null}},66417:function(n,l,u){"use strict";u.d(l,{J:function(){return d}});let d="production"},73232:function(n,l,u){"use strict";u.d(l,{X:function(){return d}});let d="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},8589:function(n,l,u){"use strict";u.d(l,{RP:function(){return function notifyEventProcessors(n,l,u,d=0){return new h.cW((h,_)=>{let j=n[d];if(null===l||"function"!=typeof j)h(l);else{let $=j({...l},u);g.X&&j.id&&null===$&&f.kg.log(`Event processor "${j.id}" dropped event`),(0,m.J8)($)?$.then(l=>notifyEventProcessors(n,l,u,d+1).then(h)).then(null,_):notifyEventProcessors(n,$,u,d+1).then(h).then(null,_)}})}},cc:function(){return addGlobalEventProcessor},fH:function(){return getGlobalEventProcessors}});var d=u(90063),h=u(97946),f=u(58536),m=u(81757),g=u(73232);function getGlobalEventProcessors(){return(0,d.Y)("globalEventProcessors",()=>[])}function addGlobalEventProcessor(n){getGlobalEventProcessors().push(n)}},92642:function(n,l,u){"use strict";u.d(l,{$e:function(){return withScope},Tb:function(){return captureException},Yr:function(){return startTransaction},cg:function(){return captureSession},e:function(){return configureScope},eN:function(){return captureEvent},nZ:function(){return getCurrentScope},n_:function(){return addBreadcrumb},s3:function(){return getClient},v:function(){return setContext},yj:function(){return startSession},yl:function(){return flush}});var d=u(58536),h=u(90063),f=u(66417),m=u(73232),g=u(66465),_=u(48364),j=u(48738);function captureException(n,l){return(0,g.Gd)().captureException(n,(0,j.U0)(l))}function captureEvent(n,l){return(0,g.Gd)().captureEvent(n,l)}function configureScope(n){(0,g.Gd)().configureScope(n)}function addBreadcrumb(n,l){(0,g.Gd)().addBreadcrumb(n,l)}function setContext(n,l){(0,g.Gd)().setContext(n,l)}function withScope(...n){let l=(0,g.Gd)();if(2===n.length){let[u,d]=n;return u?l.withScope(()=>(l.getStackTop().scope=u,d(u))):l.withScope(d)}return l.withScope(n[0])}function startTransaction(n,l){return(0,g.Gd)().startTransaction({...n},l)}async function flush(n){let l=getClient();return l?l.flush(n):(m.X&&d.kg.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function getClient(){return(0,g.Gd)().getClient()}function getCurrentScope(){return(0,g.Gd)().getScope()}function startSession(n){let l=getClient(),u=(0,g.aF)(),d=getCurrentScope(),{release:m,environment:j=f.J}=l&&l.getOptions()||{},{userAgent:$}=h.GLOBAL_OBJ.navigator||{},z=(0,_.Hv)({release:m,environment:j,user:d.getUser()||u.getUser(),...$&&{userAgent:$},...n}),ee=u.getSession();return ee&&"ok"===ee.status&&(0,_.CT)(ee,{status:"exited"}),endSession(),u.setSession(z),d.setSession(z),z}function endSession(){let n=(0,g.aF)(),l=getCurrentScope(),u=l.getSession()||n.getSession();u&&(0,_.RJ)(u),_sendSessionUpdate(),n.setSession(),l.setSession()}function _sendSessionUpdate(){let n=(0,g.aF)(),l=getCurrentScope(),u=getClient(),d=l.getSession()||n.getSession();d&&u&&u.captureSession&&u.captureSession(d)}function captureSession(n=!1){if(n){endSession();return}_sendSessionUpdate()}},66465:function(n,l,u){"use strict";u.d(l,{Gd:function(){return getCurrentHub},aF:function(){return getIsolationScope},cu:function(){return getMainCarrier}});var d=u(81757),h=u(63699),f=u(7790),m=u(58536),g=u(90063),_=u(66417),j=u(73232),$=u(51877),z=u(48364),ee=u(91476);let et=parseFloat(ee.J);let Hub=class Hub{constructor(n,l,u,d=et){let h,f;this._version=d,l?h=l:(h=new $.sX).setClient(n),u?f=u:(f=new $.sX).setClient(n),this._stack=[{scope:h}],n&&this.bindClient(n),this._isolationScope=f}isOlderThan(n){return this._version<n}bindClient(n){let l=this.getStackTop();l.client=n,l.scope.setClient(n),n&&n.setupIntegrations&&n.setupIntegrations()}pushScope(){let n=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:n}),n}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(n){let l;let u=this.pushScope();try{l=n(u)}catch(n){throw this.popScope(),n}return(0,d.J8)(l)?l.then(n=>(this.popScope(),n),n=>{throw this.popScope(),n}):(this.popScope(),l)}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(n,l){let u=this._lastEventId=l&&l.event_id?l.event_id:(0,h.DM)(),d=Error("Sentry syntheticException");return this.getScope().captureException(n,{originalException:n,syntheticException:d,...l,event_id:u}),u}captureMessage(n,l,u){let d=this._lastEventId=u&&u.event_id?u.event_id:(0,h.DM)(),f=Error(n);return this.getScope().captureMessage(n,l,{originalException:n,syntheticException:f,...u,event_id:d}),d}captureEvent(n,l){let u=l&&l.event_id?l.event_id:(0,h.DM)();return n.type||(this._lastEventId=u),this.getScope().captureEvent(n,{...l,event_id:u}),u}lastEventId(){return this._lastEventId}addBreadcrumb(n,l){let{scope:u,client:d}=this.getStackTop();if(!d)return;let{beforeBreadcrumb:h=null,maxBreadcrumbs:g=100}=d.getOptions&&d.getOptions()||{};if(g<=0)return;let _=(0,f.yW)(),j={timestamp:_,...n},$=h?(0,m.Cf)(()=>h(j,l)):j;null!==$&&(d.emit&&d.emit("beforeAddBreadcrumb",$,l),u.addBreadcrumb($,g))}setUser(n){this.getScope().setUser(n),this.getIsolationScope().setUser(n)}setTags(n){this.getScope().setTags(n),this.getIsolationScope().setTags(n)}setExtras(n){this.getScope().setExtras(n),this.getIsolationScope().setExtras(n)}setTag(n,l){this.getScope().setTag(n,l),this.getIsolationScope().setTag(n,l)}setExtra(n,l){this.getScope().setExtra(n,l),this.getIsolationScope().setExtra(n,l)}setContext(n,l){this.getScope().setContext(n,l),this.getIsolationScope().setContext(n,l)}configureScope(n){let{scope:l,client:u}=this.getStackTop();u&&n(l)}run(n){let l=makeMain(this);try{n(this)}finally{makeMain(l)}}getIntegration(n){let l=this.getClient();if(!l)return null;try{return l.getIntegration(n)}catch(l){return j.X&&m.kg.warn(`Cannot retrieve integration ${n.id} from the current Hub`),null}}startTransaction(n,l){let u=this._callExtensionMethod("startTransaction",n,l);if(j.X&&!u){let n=this.getClient();n?m.kg.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`):m.kg.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return u}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(n=!1){if(n)return this.endSession();this._sendSessionUpdate()}endSession(){let n=this.getStackTop(),l=n.scope,u=l.getSession();u&&(0,z.RJ)(u),this._sendSessionUpdate(),l.setSession()}startSession(n){let{scope:l,client:u}=this.getStackTop(),{release:d,environment:h=_.J}=u&&u.getOptions()||{},{userAgent:f}=g.GLOBAL_OBJ.navigator||{},m=(0,z.Hv)({release:d,environment:h,user:l.getUser(),...f&&{userAgent:f},...n}),j=l.getSession&&l.getSession();return j&&"ok"===j.status&&(0,z.CT)(j,{status:"exited"}),this.endSession(),l.setSession(m),m}shouldSendDefaultPii(){let n=this.getClient(),l=n&&n.getOptions();return!!(l&&l.sendDefaultPii)}_sendSessionUpdate(){let{scope:n,client:l}=this.getStackTop(),u=n.getSession();u&&l&&l.captureSession&&l.captureSession(u)}_callExtensionMethod(n,...l){let u=getMainCarrier(),d=u.__SENTRY__;if(d&&d.extensions&&"function"==typeof d.extensions[n])return d.extensions[n].apply(this,l);j.X&&m.kg.warn(`Extension method ${n} couldn't be found, doing nothing.`)}};function getMainCarrier(){return g.GLOBAL_OBJ.__SENTRY__=g.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},g.GLOBAL_OBJ}function makeMain(n){let l=getMainCarrier(),u=getHubFromCarrier(l);return setHubOnCarrier(l,n),u}function getCurrentHub(){let n=getMainCarrier();if(n.__SENTRY__&&n.__SENTRY__.acs){let l=n.__SENTRY__.acs.getCurrentHub();if(l)return l}return function(n=getMainCarrier()){return(!(n&&n.__SENTRY__&&n.__SENTRY__.hub)||getHubFromCarrier(n).isOlderThan(et))&&setHubOnCarrier(n,new Hub),getHubFromCarrier(n)}(n)}function getIsolationScope(){return getCurrentHub().getIsolationScope()}function getHubFromCarrier(n){return(0,g.Y)("hub",()=>new Hub,n)}function setHubOnCarrier(n,l){if(!n)return!1;let u=n.__SENTRY__=n.__SENTRY__||{};return u.hub=l,!0}},51877:function(n,l,u){"use strict";let d;u.d(l,{lW:function(){return getGlobalScope},sX:function(){return Scope}});var h=u(81757),f=u(7790),m=u(63699),g=u(58536),_=u(8589),j=u(48364),$=u(29390);let Scope=class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=generatePropagationContext()}static clone(n){return n?n.clone():new Scope}clone(){let n=new Scope;return n._breadcrumbs=[...this._breadcrumbs],n._tags={...this._tags},n._extra={...this._extra},n._contexts={...this._contexts},n._user=this._user,n._level=this._level,n._span=this._span,n._session=this._session,n._transactionName=this._transactionName,n._fingerprint=this._fingerprint,n._eventProcessors=[...this._eventProcessors],n._requestSession=this._requestSession,n._attachments=[...this._attachments],n._sdkProcessingMetadata={...this._sdkProcessingMetadata},n._propagationContext={...this._propagationContext},n._client=this._client,n}setClient(n){this._client=n}getClient(){return this._client}addScopeListener(n){this._scopeListeners.push(n)}addEventProcessor(n){return this._eventProcessors.push(n),this}setUser(n){return this._user=n||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&(0,j.CT)(this._session,{user:n}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(n){return this._requestSession=n,this}setTags(n){return this._tags={...this._tags,...n},this._notifyScopeListeners(),this}setTag(n,l){return this._tags={...this._tags,[n]:l},this._notifyScopeListeners(),this}setExtras(n){return this._extra={...this._extra,...n},this._notifyScopeListeners(),this}setExtra(n,l){return this._extra={...this._extra,[n]:l},this._notifyScopeListeners(),this}setFingerprint(n){return this._fingerprint=n,this._notifyScopeListeners(),this}setLevel(n){return this._level=n,this._notifyScopeListeners(),this}setTransactionName(n){return this._transactionName=n,this._notifyScopeListeners(),this}setContext(n,l){return null===l?delete this._contexts[n]:this._contexts[n]=l,this._notifyScopeListeners(),this}setSpan(n){return this._span=n,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let n=this._span;return n&&n.transaction}setSession(n){return n?this._session=n:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(n){if(!n)return this;let l="function"==typeof n?n(this):n;if(l instanceof Scope){let n=l.getScopeData();this._tags={...this._tags,...n.tags},this._extra={...this._extra,...n.extra},this._contexts={...this._contexts,...n.contexts},n.user&&Object.keys(n.user).length&&(this._user=n.user),n.level&&(this._level=n.level),n.fingerprint.length&&(this._fingerprint=n.fingerprint),l.getRequestSession()&&(this._requestSession=l.getRequestSession()),n.propagationContext&&(this._propagationContext=n.propagationContext)}else(0,h.PO)(l)&&(this._tags={...this._tags,...n.tags},this._extra={...this._extra,...n.extra},this._contexts={...this._contexts,...n.contexts},n.user&&(this._user=n.user),n.level&&(this._level=n.level),n.fingerprint&&(this._fingerprint=n.fingerprint),n.requestSession&&(this._requestSession=n.requestSession),n.propagationContext&&(this._propagationContext=n.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=generatePropagationContext(),this}addBreadcrumb(n,l){let u="number"==typeof l?l:100;if(u<=0)return this;let d={timestamp:(0,f.yW)(),...n},h=this._breadcrumbs;return h.push(d),this._breadcrumbs=h.length>u?h.slice(-u):h,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(n){return this._attachments.push(n),this}getAttachments(){let n=this.getScopeData();return n.attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){let{_breadcrumbs:n,_attachments:l,_contexts:u,_tags:d,_extra:h,_user:f,_level:m,_fingerprint:g,_eventProcessors:_,_propagationContext:j,_sdkProcessingMetadata:$,_transactionName:z,_span:ee}=this;return{breadcrumbs:n,attachments:l,contexts:u,tags:d,extra:h,user:f,level:m,fingerprint:g||[],eventProcessors:_,propagationContext:j,sdkProcessingMetadata:$,transactionName:z,span:ee}}applyToEvent(n,l={},u=[]){(0,$.gi)(n,this.getScopeData());let d=[...u,...(0,_.fH)(),...this._eventProcessors];return(0,_.RP)(d,n,l)}setSDKProcessingMetadata(n){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...n},this}setPropagationContext(n){return this._propagationContext=n,this}getPropagationContext(){return this._propagationContext}captureException(n,l){let u=l&&l.event_id?l.event_id:(0,m.DM)();if(!this._client)return g.kg.warn("No client configured on scope - will not capture exception!"),u;let d=Error("Sentry syntheticException");return this._client.captureException(n,{originalException:n,syntheticException:d,...l,event_id:u},this),u}captureMessage(n,l,u){let d=u&&u.event_id?u.event_id:(0,m.DM)();if(!this._client)return g.kg.warn("No client configured on scope - will not capture message!"),d;let h=Error(n);return this._client.captureMessage(n,l,{originalException:n,syntheticException:h,...u,event_id:d},this),d}captureEvent(n,l){let u=l&&l.event_id?l.event_id:(0,m.DM)();return this._client?this._client.captureEvent(n,{...l,event_id:u},this):g.kg.warn("No client configured on scope - will not capture event!"),u}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(n=>{n(this)}),this._notifyingListeners=!1)}};function getGlobalScope(){return d||(d=new Scope),d}function generatePropagationContext(){return{traceId:(0,m.DM)(),spanId:(0,m.DM)().substring(16)}}},48364:function(n,l,u){"use strict";u.d(l,{CT:function(){return updateSession},Hv:function(){return makeSession},RJ:function(){return closeSession}});var d=u(7790),h=u(63699),f=u(21995);function makeSession(n){let l=(0,d.ph)(),u={sid:(0,h.DM)(),init:!0,timestamp:l,started:l,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>(0,f.Jr)({sid:`${u.sid}`,init:u.init,started:new Date(1e3*u.started).toISOString(),timestamp:new Date(1e3*u.timestamp).toISOString(),status:u.status,errors:u.errors,did:"number"==typeof u.did||"string"==typeof u.did?`${u.did}`:void 0,duration:u.duration,abnormal_mechanism:u.abnormal_mechanism,attrs:{release:u.release,environment:u.environment,ip_address:u.ipAddress,user_agent:u.userAgent}})};return n&&updateSession(u,n),u}function updateSession(n,l={}){if(!l.user||(!n.ipAddress&&l.user.ip_address&&(n.ipAddress=l.user.ip_address),n.did||l.did||(n.did=l.user.id||l.user.email||l.user.username)),n.timestamp=l.timestamp||(0,d.ph)(),l.abnormal_mechanism&&(n.abnormal_mechanism=l.abnormal_mechanism),l.ignoreDuration&&(n.ignoreDuration=l.ignoreDuration),l.sid&&(n.sid=32===l.sid.length?l.sid:(0,h.DM)()),void 0!==l.init&&(n.init=l.init),!n.did&&l.did&&(n.did=`${l.did}`),"number"==typeof l.started&&(n.started=l.started),n.ignoreDuration)n.duration=void 0;else if("number"==typeof l.duration)n.duration=l.duration;else{let l=n.timestamp-n.started;n.duration=l>=0?l:0}l.release&&(n.release=l.release),l.environment&&(n.environment=l.environment),!n.ipAddress&&l.ipAddress&&(n.ipAddress=l.ipAddress),!n.userAgent&&l.userAgent&&(n.userAgent=l.userAgent),"number"==typeof l.errors&&(n.errors=l.errors),l.status&&(n.status=l.status)}function closeSession(n,l){let u={};l?u={status:l}:"ok"===n.status&&(u={status:"exited"}),updateSession(n,u)}},92980:function(n,l,u){"use strict";u.d(l,{_:function(){return getDynamicSamplingContextFromClient},j:function(){return getDynamicSamplingContextFromSpan}});var d=u(21995),h=u(66417),f=u(92642),m=u(85112),g=u(43002);function getDynamicSamplingContextFromClient(n,l,u){let f=l.getOptions(),{publicKey:m}=l.getDsn()||{},{segment:g}=u&&u.getUser()||{},_=(0,d.Jr)({environment:f.environment||h.J,release:f.release,user_segment:g,public_key:m,trace_id:n});return l.emit&&l.emit("createDsc",_),_}function getDynamicSamplingContextFromSpan(n){let l=(0,f.s3)();if(!l)return{};let u=getDynamicSamplingContextFromClient((0,g.XU)(n).trace_id||"",l,(0,f.nZ)()),d=(0,m.G)(n);if(!d)return u;let h=d&&d._frozenDynamicSamplingContext;if(h)return h;let{sampleRate:_,source:j}=d.metadata;null!=_&&(u.sample_rate=`${_}`);let $=(0,g.XU)(d);return j&&"url"!==j&&(u.transaction=$.description),u.sampled=String((0,g.Tt)(d)),l.emit&&l.emit("createDsc",u),u}},29390:function(n,l,u){"use strict";u.d(l,{gi:function(){return applyScopeDataToEvent},yo:function(){return mergeScopeData}});var d=u(21995),h=u(63699),f=u(92980),m=u(85112),g=u(43002);function applyScopeDataToEvent(n,l){let{fingerprint:u,span:_,breadcrumbs:j,sdkProcessingMetadata:$}=l;(function(n,l){let{extra:u,tags:h,user:f,contexts:m,level:g,transactionName:_}=l,j=(0,d.Jr)(u);j&&Object.keys(j).length&&(n.extra={...j,...n.extra});let $=(0,d.Jr)(h);$&&Object.keys($).length&&(n.tags={...$,...n.tags});let z=(0,d.Jr)(f);z&&Object.keys(z).length&&(n.user={...z,...n.user});let ee=(0,d.Jr)(m);ee&&Object.keys(ee).length&&(n.contexts={...ee,...n.contexts}),g&&(n.level=g),_&&(n.transaction=_)})(n,l),_&&function(n,l){n.contexts={trace:(0,g.wy)(l),...n.contexts};let u=(0,m.G)(l);if(u){n.sdkProcessingMetadata={dynamicSamplingContext:(0,f.j)(l),...n.sdkProcessingMetadata};let d=(0,g.XU)(u).description;d&&(n.tags={transaction:d,...n.tags})}}(n,_),n.fingerprint=n.fingerprint?(0,h.lE)(n.fingerprint):[],u&&(n.fingerprint=n.fingerprint.concat(u)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint,function(n,l){let u=[...n.breadcrumbs||[],...l];n.breadcrumbs=u.length?u:void 0}(n,j),n.sdkProcessingMetadata={...n.sdkProcessingMetadata,...$}}function mergeScopeData(n,l){let{extra:u,tags:d,user:h,contexts:f,level:m,sdkProcessingMetadata:g,breadcrumbs:_,fingerprint:j,eventProcessors:$,attachments:z,propagationContext:ee,transactionName:et,span:en}=l;mergeAndOverwriteScopeData(n,"extra",u),mergeAndOverwriteScopeData(n,"tags",d),mergeAndOverwriteScopeData(n,"user",h),mergeAndOverwriteScopeData(n,"contexts",f),mergeAndOverwriteScopeData(n,"sdkProcessingMetadata",g),m&&(n.level=m),et&&(n.transactionName=et),en&&(n.span=en),_.length&&(n.breadcrumbs=[...n.breadcrumbs,..._]),j.length&&(n.fingerprint=[...n.fingerprint,...j]),$.length&&(n.eventProcessors=[...n.eventProcessors,...$]),z.length&&(n.attachments=[...n.attachments,...z]),n.propagationContext={...n.propagationContext,...ee}}function mergeAndOverwriteScopeData(n,l,u){if(u&&Object.keys(u).length)for(let d in n[l]={...n[l]},u)Object.prototype.hasOwnProperty.call(u,d)&&(n[l][d]=u[d])}},85112:function(n,l,u){"use strict";function getRootSpan(n){return n.transaction}u.d(l,{G:function(){return getRootSpan}})},48738:function(n,l,u){"use strict";u.d(l,{R:function(){return prepareEvent},U0:function(){return parseEventHintOrCaptureContext}});var d=u(63699),h=u(7790),f=u(39660),m=u(90063),g=u(64017),_=u(66417),j=u(8589),$=u(51877),z=u(29390),ee=u(43002);function prepareEvent(n,l,u,en,eo,es){let{normalizeDepth:el=3,normalizeMaxBreadth:eu=1e3}=n,ec={...l,event_id:l.event_id||u.event_id||(0,d.DM)(),timestamp:l.timestamp||(0,h.yW)()},eh=u.integrations||n.integrations.map(n=>n.name);(function(n,l){let{environment:u,release:d,dist:h,maxValueLength:m=250}=l;"environment"in n||(n.environment="environment"in l?u:_.J),void 0===n.release&&void 0!==d&&(n.release=d),void 0===n.dist&&void 0!==h&&(n.dist=h),n.message&&(n.message=(0,f.$G)(n.message,m));let g=n.exception&&n.exception.values&&n.exception.values[0];g&&g.value&&(g.value=(0,f.$G)(g.value,m));let j=n.request;j&&j.url&&(j.url=(0,f.$G)(j.url,m))})(ec,n),eh.length>0&&(ec.sdk=ec.sdk||{},ec.sdk.integrations=[...ec.sdk.integrations||[],...eh]),void 0===l.type&&function(n,l){let u;let d=m.GLOBAL_OBJ._sentryDebugIds;if(!d)return;let h=et.get(l);h?u=h:(u=new Map,et.set(l,u));let f=Object.keys(d).reduce((n,h)=>{let f;let m=u.get(h);m?f=m:(f=l(h),u.set(h,f));for(let l=f.length-1;l>=0;l--){let u=f[l];if(u.filename){n[u.filename]=d[h];break}}return n},{});try{n.exception.values.forEach(n=>{n.stacktrace.frames.forEach(n=>{n.filename&&(n.debug_id=f[n.filename])})})}catch(n){}}(ec,n.stackParser);let ep=function(n,l){if(!l)return n;let u=n?n.clone():new $.sX;return u.update(l),u}(en,u.captureContext);u.mechanism&&(0,d.EG)(ec,u.mechanism);let ef=eo&&eo.getEventProcessors?eo.getEventProcessors():[],em=(0,$.lW)().getScopeData();if(es){let n=es.getScopeData();(0,z.yo)(em,n)}if(ep){let n=ep.getScopeData();(0,z.yo)(em,n)}let eg=[...u.attachments||[],...em.attachments];eg.length&&(u.attachments=eg),(0,z.gi)(ec,em);let e_=[...ef,...(0,j.fH)(),...em.eventProcessors],ey=(0,j.RP)(e_,ec,u);return ey.then(n=>(n&&function(n){let l={};try{n.exception.values.forEach(n=>{n.stacktrace.frames.forEach(n=>{n.debug_id&&(n.abs_path?l[n.abs_path]=n.debug_id:n.filename&&(l[n.filename]=n.debug_id),delete n.debug_id)})})}catch(n){}if(0===Object.keys(l).length)return;n.debug_meta=n.debug_meta||{},n.debug_meta.images=n.debug_meta.images||[];let u=n.debug_meta.images;Object.keys(l).forEach(n=>{u.push({type:"sourcemap",code_file:n,debug_id:l[n]})})}(n),"number"==typeof el&&el>0)?function(n,l,u){if(!n)return null;let d={...n,...n.breadcrumbs&&{breadcrumbs:n.breadcrumbs.map(n=>({...n,...n.data&&{data:(0,g.Fv)(n.data,l,u)}}))},...n.user&&{user:(0,g.Fv)(n.user,l,u)},...n.contexts&&{contexts:(0,g.Fv)(n.contexts,l,u)},...n.extra&&{extra:(0,g.Fv)(n.extra,l,u)}};return n.contexts&&n.contexts.trace&&d.contexts&&(d.contexts.trace=n.contexts.trace,n.contexts.trace.data&&(d.contexts.trace.data=(0,g.Fv)(n.contexts.trace.data,l,u))),n.spans&&(d.spans=n.spans.map(n=>{let d=(0,ee.XU)(n).data;return d&&(n.data=(0,g.Fv)(d,l,u)),n})),d}(n,el,eu):n)}let et=new WeakMap;function parseEventHintOrCaptureContext(n){return n?n instanceof $.sX||"function"==typeof n||Object.keys(n).some(n=>en.includes(n))?{captureContext:n}:n:void 0}let en=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"]},43002:function(n,l,u){"use strict";u.d(l,{$k:function(){return spanTimeInputToSeconds},Hb:function(){return spanToTraceHeader},Tt:function(){return spanIsSampled},XU:function(){return spanToJSON},i0:function(){return g},ve:function(){return m},wy:function(){return spanToTraceContext}});var d=u(21995),h=u(49691),f=u(7790);let m=0,g=1;function spanToTraceContext(n){let{spanId:l,traceId:u}=n.spanContext(),{data:h,op:f,parent_span_id:m,status:g,tags:_,origin:j}=spanToJSON(n);return(0,d.Jr)({data:h,op:f,parent_span_id:m,span_id:l,status:g,tags:_,trace_id:u,origin:j})}function spanToTraceHeader(n){let{traceId:l,spanId:u}=n.spanContext(),d=spanIsSampled(n);return(0,h.$p)(l,u,d)}function spanTimeInputToSeconds(n){return"number"==typeof n?ensureTimestampInSeconds(n):Array.isArray(n)?n[0]+n[1]/1e9:n instanceof Date?ensureTimestampInSeconds(n.getTime()):(0,f.ph)()}function ensureTimestampInSeconds(n){return n>9999999999?n/1e3:n}function spanToJSON(n){return"function"==typeof n.getSpanJSON?n.getSpanJSON():"function"==typeof n.toJSON?n.toJSON():{}}function spanIsSampled(n){let{traceFlags:l}=n.spanContext();return!!(l&g)}},91476:function(n,l,u){"use strict";u.d(l,{J:function(){return d}});let d="7.118.0"},16331:function(n,l,u){"use strict";u.d(l,{X:function(){return d}});let d="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},46990:function(n,l,u){"use strict";u.d(l,{EN:function(){return baggageHeaderToDynamicSamplingContext},IQ:function(){return dynamicSamplingContextToSentryBaggageHeader},bU:function(){return m}});var d=u(51982),h=u(81757),f=u(58536);let m="baggage",g="sentry-",_=/^sentry-/;function baggageHeaderToDynamicSamplingContext(n){if(!(0,h.HD)(n)&&!Array.isArray(n))return;let l={};if(Array.isArray(n))l=n.reduce((n,l)=>{let u=baggageHeaderToObject(l);for(let l of Object.keys(u))n[l]=u[l];return n},{});else{if(!n)return;l=baggageHeaderToObject(n)}let u=Object.entries(l).reduce((n,[l,u])=>{if(l.match(_)){let d=l.slice(g.length);n[d]=u}return n},{});return Object.keys(u).length>0?u:void 0}function dynamicSamplingContextToSentryBaggageHeader(n){if(!n)return;let l=Object.entries(n).reduce((n,[l,u])=>(u&&(n[`${g}${l}`]=u),n),{});return function(n){if(0!==Object.keys(n).length)return Object.entries(n).reduce((n,[l,u],h)=>{let m=`${encodeURIComponent(l)}=${encodeURIComponent(u)}`,g=0===h?m:`${n},${m}`;return g.length>8192?(d.X&&f.kg.warn(`Not adding key: ${l} with val: ${u} to baggage header due to exceeding baggage size limits.`),n):g},"")}(l)}function baggageHeaderToObject(n){return n.split(",").map(n=>n.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((n,[l,u])=>(n[l]=u,n),{})}},54194:function(n,l,u){"use strict";u.d(l,{Rt:function(){return htmlTreeAsString},iY:function(){return getComponentName},l4:function(){return getLocationHref},qT:function(){return getDomElement}});var d=u(81757),h=u(90063);let f=(0,h.R)();function htmlTreeAsString(n,l={}){if(!n)return"<unknown>";try{let u,h=n,m=[],g=0,_=0,j=Array.isArray(l)?l:l.keyAttrs,$=!Array.isArray(l)&&l.maxStringLength||80;for(;h&&g++<5&&(u=function(n,l){let u,h,m,g,_;let j=[];if(!n||!n.tagName)return"";if(f.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;j.push(n.tagName.toLowerCase());let $=l&&l.length?l.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if($&&$.length)$.forEach(n=>{j.push(`[${n[0]}="${n[1]}"]`)});else if(n.id&&j.push(`#${n.id}`),(u=n.className)&&(0,d.HD)(u))for(_=0,h=u.split(/\s+/);_<h.length;_++)j.push(`.${h[_]}`);let z=["aria-label","type","name","title","alt"];for(_=0;_<z.length;_++)m=z[_],(g=n.getAttribute(m))&&j.push(`[${m}="${g}"]`);return j.join("")}(h,j),"html"!==u&&(!(g>1)||!(_+3*m.length+u.length>=$)));)m.push(u),_+=u.length,h=h.parentNode;return m.reverse().join(" > ")}catch(n){return"<unknown>"}}function getLocationHref(){try{return f.document.location.href}catch(n){return""}}function getDomElement(n){return f.document&&f.document.querySelector?f.document.querySelector(n):null}function getComponentName(n){if(!f.HTMLElement)return null;let l=n;for(let n=0;n<5&&l;n++){if(l instanceof HTMLElement&&l.dataset.sentryComponent)return l.dataset.sentryComponent;l=l.parentNode}return null}},51982:function(n,l,u){"use strict";u.d(l,{X:function(){return d}});let d="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__},4285:function(n,l,u){"use strict";function isBrowserBundle(){return"undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&!!__SENTRY_BROWSER_BUNDLE__}function getSDKSource(){return"npm"}u.d(l,{S:function(){return getSDKSource},n:function(){return isBrowserBundle}})},81757:function(n,l,u){"use strict";u.d(l,{Cy:function(){return isSyntheticEvent},HD:function(){return isString},J8:function(){return isThenable},Kj:function(){return isRegExp},Le:function(){return isParameterizedString},PO:function(){return isPlainObject},TX:function(){return isDOMError},V9:function(){return isInstanceOf},VW:function(){return isErrorEvent},VZ:function(){return isError},cO:function(){return isEvent},fm:function(){return isDOMException},i2:function(){return isNaN},kK:function(){return isElement},pt:function(){return isPrimitive},y1:function(){return isVueViewModel}});let d=Object.prototype.toString;function isError(n){switch(d.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return isInstanceOf(n,Error)}}function isBuiltin(n,l){return d.call(n)===`[object ${l}]`}function isErrorEvent(n){return isBuiltin(n,"ErrorEvent")}function isDOMError(n){return isBuiltin(n,"DOMError")}function isDOMException(n){return isBuiltin(n,"DOMException")}function isString(n){return isBuiltin(n,"String")}function isParameterizedString(n){return"object"==typeof n&&null!==n&&"__sentry_template_string__"in n&&"__sentry_template_values__"in n}function isPrimitive(n){return null===n||isParameterizedString(n)||"object"!=typeof n&&"function"!=typeof n}function isPlainObject(n){return isBuiltin(n,"Object")}function isEvent(n){return"undefined"!=typeof Event&&isInstanceOf(n,Event)}function isElement(n){return"undefined"!=typeof Element&&isInstanceOf(n,Element)}function isRegExp(n){return isBuiltin(n,"RegExp")}function isThenable(n){return!!(n&&n.then&&"function"==typeof n.then)}function isSyntheticEvent(n){return isPlainObject(n)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n}function isNaN(n){return"number"==typeof n&&n!=n}function isInstanceOf(n,l){try{return n instanceof l}catch(n){return!1}}function isVueViewModel(n){return!!("object"==typeof n&&null!==n&&(n.__isVue||n._isVue))}},58536:function(n,l,u){"use strict";u.d(l,{Cf:function(){return consoleSandbox},LD:function(){return m},RU:function(){return f},kg:function(){return g}});var d=u(51982),h=u(90063);let f=["debug","info","warn","error","log","assert","trace"],m={};function consoleSandbox(n){if(!("console"in h.GLOBAL_OBJ))return n();let l=h.GLOBAL_OBJ.console,u={},d=Object.keys(m);d.forEach(n=>{let d=m[n];u[n]=l[n],l[n]=d});try{return n()}finally{d.forEach(n=>{l[n]=u[n]})}}let g=function(){let n=!1,l={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return d.X?f.forEach(u=>{l[u]=(...l)=>{n&&consoleSandbox(()=>{h.GLOBAL_OBJ.console[u](`Sentry Logger [${u}]:`,...l)})}}):f.forEach(n=>{l[n]=()=>void 0}),l}()},63699:function(n,l,u){"use strict";u.d(l,{DM:function(){return uuid4},Db:function(){return addExceptionTypeValue},EG:function(){return addExceptionMechanism},YO:function(){return checkOrSetAlreadyCaught},jH:function(){return getEventDescription},lE:function(){return arrayify}});var d=u(21995),h=u(90063);function uuid4(){let n=h.GLOBAL_OBJ,l=n.crypto||n.msCrypto,getRandomByte=()=>16*Math.random();try{if(l&&l.randomUUID)return l.randomUUID().replace(/-/g,"");l&&l.getRandomValues&&(getRandomByte=()=>{let n=new Uint8Array(1);return l.getRandomValues(n),n[0]})}catch(n){}return"10000000100040008000100000000000".replace(/[018]/g,n=>(n^(15&getRandomByte())>>n/4).toString(16))}function getFirstException(n){return n.exception&&n.exception.values?n.exception.values[0]:void 0}function getEventDescription(n){let{message:l,event_id:u}=n;if(l)return l;let d=getFirstException(n);return d?d.type&&d.value?`${d.type}: ${d.value}`:d.type||d.value||u||"<unknown>":u||"<unknown>"}function addExceptionTypeValue(n,l,u){let d=n.exception=n.exception||{},h=d.values=d.values||[],f=h[0]=h[0]||{};f.value||(f.value=l||""),f.type||(f.type=u||"Error")}function addExceptionMechanism(n,l){let u=getFirstException(n);if(!u)return;let d=u.mechanism;if(u.mechanism={type:"generic",handled:!0,...d,...l},l&&"data"in l){let n={...d&&d.data,...l.data};u.mechanism.data=n}}function checkOrSetAlreadyCaught(n){if(n&&n.__sentry_captured__)return!0;try{(0,d.xp)(n,"__sentry_captured__",!0)}catch(n){}return!1}function arrayify(n){return Array.isArray(n)?n:[n]}},37392:function(n,l,u){"use strict";u.d(l,{KV:function(){return isNodeEnv}});var d=u(4285);n=u.hmd(n);var h=u(34406);function isNodeEnv(){return!(0,d.n)()&&"[object process]"===Object.prototype.toString.call(void 0!==h?h:0)}},64017:function(n,l,u){"use strict";u.d(l,{Fv:function(){return normalize},Qy:function(){return function normalizeToSize(n,l=3,u=102400){let d=normalize(n,l);return~-encodeURI(JSON.stringify(d)).split(/%..|./).length>u?normalizeToSize(n,l-1,u):d}}});var d=u(81757),h=u(21995),f=u(69038);function normalize(n,l=100,m=Infinity){try{return function visit(n,l,m=Infinity,g=Infinity,_=function(){let n="function"==typeof WeakSet,l=n?new WeakSet:[];return[function(u){if(n)return!!l.has(u)||(l.add(u),!1);for(let n=0;n<l.length;n++){let d=l[n];if(d===u)return!0}return l.push(u),!1},function(u){if(n)l.delete(u);else for(let n=0;n<l.length;n++)if(l[n]===u){l.splice(n,1);break}}]}()){let[j,$]=_;if(null==l||["number","boolean","string"].includes(typeof l)&&!(0,d.i2)(l))return l;let z=function(n,l){try{if("domain"===n&&l&&"object"==typeof l&&l._events)return"[Domain]";if("domainEmitter"===n)return"[DomainEmitter]";if(void 0!==u.g&&l===u.g)return"[Global]";if("undefined"!=typeof window&&l===window)return"[Window]";if("undefined"!=typeof document&&l===document)return"[Document]";if((0,d.y1)(l))return"[VueViewModel]";if((0,d.Cy)(l))return"[SyntheticEvent]";if("number"==typeof l&&l!=l)return"[NaN]";if("function"==typeof l)return`[Function: ${(0,f.$P)(l)}]`;if("symbol"==typeof l)return`[${String(l)}]`;if("bigint"==typeof l)return`[BigInt: ${String(l)}]`;let h=function(n){let l=Object.getPrototypeOf(n);return l?l.constructor.name:"null prototype"}(l);if(/^HTML(\w*)Element$/.test(h))return`[HTMLElement: ${h}]`;return`[object ${h}]`}catch(n){return`**non-serializable** (${n})`}}(n,l);if(!z.startsWith("[object "))return z;if(l.__sentry_skip_normalization__)return l;let ee="number"==typeof l.__sentry_override_normalization_depth__?l.__sentry_override_normalization_depth__:m;if(0===ee)return z.replace("object ","");if(j(l))return"[Circular ~]";if(l&&"function"==typeof l.toJSON)try{let n=l.toJSON();return visit("",n,ee-1,g,_)}catch(n){}let et=Array.isArray(l)?[]:{},en=0,eo=(0,h.Sh)(l);for(let n in eo){if(!Object.prototype.hasOwnProperty.call(eo,n))continue;if(en>=g){et[n]="[MaxProperties ~]";break}let l=eo[n];et[n]=visit(n,l,ee-1,g,_),en++}return $(l),et}("",n,l,m)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}},21995:function(n,l,u){"use strict";u.d(l,{$Q:function(){return markFunctionWrapped},HK:function(){return getOriginalFunction},Jr:function(){return dropUndefinedKeys},Sh:function(){return convertToPlainObject},_j:function(){return urlEncode},hl:function(){return fill},xp:function(){return addNonEnumerableProperty},zf:function(){return extractExceptionKeysForMessage}});var d=u(54194),h=u(51982),f=u(81757),m=u(58536),g=u(39660);function fill(n,l,u){if(!(l in n))return;let d=n[l],h=u(d);"function"==typeof h&&markFunctionWrapped(h,d),n[l]=h}function addNonEnumerableProperty(n,l,u){try{Object.defineProperty(n,l,{value:u,writable:!0,configurable:!0})}catch(u){h.X&&m.kg.log(`Failed to add non-enumerable property "${l}" to object`,n)}}function markFunctionWrapped(n,l){try{let u=l.prototype||{};n.prototype=l.prototype=u,addNonEnumerableProperty(n,"__sentry_original__",l)}catch(n){}}function getOriginalFunction(n){return n.__sentry_original__}function urlEncode(n){return Object.keys(n).map(l=>`${encodeURIComponent(l)}=${encodeURIComponent(n[l])}`).join("&")}function convertToPlainObject(n){if((0,f.VZ)(n))return{message:n.message,name:n.name,stack:n.stack,...getOwnProperties(n)};if(!(0,f.cO)(n))return n;{let l={type:n.type,target:serializeEventTarget(n.target),currentTarget:serializeEventTarget(n.currentTarget),...getOwnProperties(n)};return"undefined"!=typeof CustomEvent&&(0,f.V9)(n,CustomEvent)&&(l.detail=n.detail),l}}function serializeEventTarget(n){try{return(0,f.kK)(n)?(0,d.Rt)(n):Object.prototype.toString.call(n)}catch(n){return"<unknown>"}}function getOwnProperties(n){if("object"!=typeof n||null===n)return{};{let l={};for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&(l[u]=n[u]);return l}}function extractExceptionKeysForMessage(n,l=40){let u=Object.keys(convertToPlainObject(n));if(u.sort(),!u.length)return"[object has no keys]";if(u[0].length>=l)return(0,g.$G)(u[0],l);for(let n=u.length;n>0;n--){let d=u.slice(0,n).join(", ");if(!(d.length>l)){if(n===u.length)return d;return(0,g.$G)(d,l)}}return""}function dropUndefinedKeys(n){let l=new Map;return function _dropUndefinedKeys(n,l){if(function(n){if(!(0,f.PO)(n))return!1;try{let l=Object.getPrototypeOf(n).constructor.name;return!l||"Object"===l}catch(n){return!0}}(n)){let u=l.get(n);if(void 0!==u)return u;let d={};for(let u of(l.set(n,d),Object.keys(n)))void 0!==n[u]&&(d[u]=_dropUndefinedKeys(n[u],l));return d}if(Array.isArray(n)){let u=l.get(n);if(void 0!==u)return u;let d=[];return l.set(n,d),n.forEach(n=>{d.push(_dropUndefinedKeys(n,l))}),d}return n}(n,l)}},69038:function(n,l,u){"use strict";u.d(l,{$P:function(){return getFunctionName},Sq:function(){return stackParserFromStackParserOptions},pE:function(){return createStackParser}});let d=/\(error: (.*)\)/,h=/captureMessage|captureException/;function createStackParser(...n){let l=n.sort((n,l)=>n[0]-l[0]).map(n=>n[1]);return(n,u=0)=>{let f=[],m=n.split("\n");for(let n=u;n<m.length;n++){let u=m[n];if(u.length>1024)continue;let h=d.test(u)?u.replace(d,"$1"):u;if(!h.match(/\S*Error: /)){for(let n of l){let l=n(h);if(l){f.push(l);break}}if(f.length>=50)break}}return function(n){if(!n.length)return[];let l=Array.from(n);return/sentryWrapped/.test(l[l.length-1].function||"")&&l.pop(),l.reverse(),h.test(l[l.length-1].function||"")&&(l.pop(),h.test(l[l.length-1].function||"")&&l.pop()),l.slice(0,50).map(n=>({...n,filename:n.filename||l[l.length-1].filename,function:n.function||"?"}))}(f)}}function stackParserFromStackParserOptions(n){return Array.isArray(n)?createStackParser(...n):n}let f="<anonymous>";function getFunctionName(n){try{if(!n||"function"!=typeof n)return f;return n.name||f}catch(n){return f}}},39660:function(n,l,u){"use strict";u.d(l,{$G:function(){return truncate},U0:function(){return stringMatchesSomePattern},nK:function(){return safeJoin}});var d=u(81757);function truncate(n,l=0){return"string"!=typeof n||0===l?n:n.length<=l?n:`${n.slice(0,l)}...`}function safeJoin(n,l){if(!Array.isArray(n))return"";let u=[];for(let l=0;l<n.length;l++){let h=n[l];try{(0,d.y1)(h)?u.push("[VueViewModel]"):u.push(String(h))}catch(n){u.push("[value cannot be serialized]")}}return u.join(l)}function stringMatchesSomePattern(n,l=[],u=!1){return l.some(l=>(function(n,l,u=!1){return!!(0,d.HD)(n)&&((0,d.Kj)(l)?l.test(n):!!(0,d.HD)(l)&&(u?n===l:n.includes(l)))})(n,l,u))}},97946:function(n,l,u){"use strict";u.d(l,{$2:function(){return rejectedSyncPromise},WD:function(){return resolvedSyncPromise},cW:function(){return SyncPromise}});var d,h,f=u(81757);function resolvedSyncPromise(n){return new SyncPromise(l=>{l(n)})}function rejectedSyncPromise(n){return new SyncPromise((l,u)=>{u(n)})}(d=h||(h={}))[d.PENDING=0]="PENDING",d[d.RESOLVED=1]="RESOLVED",d[d.REJECTED=2]="REJECTED";let SyncPromise=class SyncPromise{constructor(n){SyncPromise.prototype.__init.call(this),SyncPromise.prototype.__init2.call(this),SyncPromise.prototype.__init3.call(this),SyncPromise.prototype.__init4.call(this),this._state=h.PENDING,this._handlers=[];try{n(this._resolve,this._reject)}catch(n){this._reject(n)}}then(n,l){return new SyncPromise((u,d)=>{this._handlers.push([!1,l=>{if(n)try{u(n(l))}catch(n){d(n)}else u(l)},n=>{if(l)try{u(l(n))}catch(n){d(n)}else d(n)}]),this._executeHandlers()})}catch(n){return this.then(n=>n,n)}finally(n){return new SyncPromise((l,u)=>{let d,h;return this.then(l=>{h=!1,d=l,n&&n()},l=>{h=!0,d=l,n&&n()}).then(()=>{if(h){u(d);return}l(d)})})}__init(){this._resolve=n=>{this._setResult(h.RESOLVED,n)}}__init2(){this._reject=n=>{this._setResult(h.REJECTED,n)}}__init3(){this._setResult=(n,l)=>{if(this._state===h.PENDING){if((0,f.J8)(l)){l.then(this._resolve,this._reject);return}this._state=n,this._value=l,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===h.PENDING)return;let n=this._handlers.slice();this._handlers=[],n.forEach(n=>{n[0]||(this._state===h.RESOLVED&&n[1](this._value),this._state===h.REJECTED&&n[2](this._value),n[0]=!0)})}}}},7790:function(n,l,u){"use strict";u.d(l,{Z1:function(){return f},ph:function(){return h},yW:function(){return dateTimestampInSeconds}});var d=u(90063);function dateTimestampInSeconds(){return Date.now()/1e3}let h=function(){let{performance:n}=d.GLOBAL_OBJ;if(!n||!n.now)return dateTimestampInSeconds;let l=Date.now()-n.now(),u=void 0==n.timeOrigin?l:n.timeOrigin;return()=>(u+n.now())/1e3}(),f=(()=>{let{performance:n}=d.GLOBAL_OBJ;if(!n||!n.now)return;let l=n.now(),u=Date.now(),h=n.timeOrigin?Math.abs(n.timeOrigin+l-u):36e5,f=n.timing&&n.timing.navigationStart,m="number"==typeof f?Math.abs(f+l-u):36e5;return h<36e5||m<36e5?h<=m?n.timeOrigin:f:u})()},49691:function(n,l,u){"use strict";u.d(l,{$p:function(){return generateSentryTraceHeader},KA:function(){return tracingContextFromHeaders},pT:function(){return propagationContextFromHeaders}});var d=u(46990),h=u(63699);let f=RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function extractTraceparentData(n){let l;if(!n)return;let u=n.match(f);if(u)return"1"===u[3]?l=!0:"0"===u[3]&&(l=!1),{traceId:u[1],parentSampled:l,parentSpanId:u[2]}}function tracingContextFromHeaders(n,l){let u=extractTraceparentData(n),f=(0,d.EN)(l),{traceId:m,parentSpanId:g,parentSampled:_}=u||{};return u?{traceparentData:u,dynamicSamplingContext:f||{},propagationContext:{traceId:m||(0,h.DM)(),parentSpanId:g||(0,h.DM)().substring(16),spanId:(0,h.DM)().substring(16),sampled:_,dsc:f||{}}}:{traceparentData:u,dynamicSamplingContext:void 0,propagationContext:{traceId:m||(0,h.DM)(),spanId:(0,h.DM)().substring(16)}}}function propagationContextFromHeaders(n,l){let u=extractTraceparentData(n),f=(0,d.EN)(l),{traceId:m,parentSpanId:g,parentSampled:_}=u||{};return u?{traceId:m||(0,h.DM)(),parentSpanId:g||(0,h.DM)().substring(16),spanId:(0,h.DM)().substring(16),sampled:_,dsc:f||{}}:{traceId:m||(0,h.DM)(),spanId:(0,h.DM)().substring(16)}}function generateSentryTraceHeader(n=(0,h.DM)(),l=(0,h.DM)().substring(16),u){let d="";return void 0!==u&&(d=u?"-1":"-0"),`${n}-${l}${d}`}},90063:function(n,l,u){"use strict";function isGlobalObj(n){return n&&n.Math==Math?n:void 0}u.d(l,{GLOBAL_OBJ:function(){return d},R:function(){return getGlobalObject},Y:function(){return getGlobalSingleton}});let d="object"==typeof globalThis&&isGlobalObj(globalThis)||"object"==typeof window&&isGlobalObj(window)||"object"==typeof self&&isGlobalObj(self)||"object"==typeof u.g&&isGlobalObj(u.g)||function(){return this}()||{};function getGlobalObject(){return d}function getGlobalSingleton(n,l,u){let h=u||d,f=h.__SENTRY__=h.__SENTRY__||{},m=f[n]||(f[n]=l());return m}},276:function(n,l,u){var d,h,f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of _(l))$.call(n,h)||h===u||m(n,h,{get:()=>l[h],enumerable:!(d=g(l,h))||d.enumerable});return n},z={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})(z,{composeRefs:()=>composeRefs,setRef:()=>setRef,useComposedRefs:()=>useComposedRefs}),n.exports=__copyProps(m({},"__esModule",{value:!0}),z);var ee=(h=null!=(d=u(2784))?f(j(d)):{},__copyProps(d&&d.__esModule?h:m(h,"default",{value:d,enumerable:!0}),d));function setRef(n,l){"function"==typeof n?n(l):n&&(n.current=l)}function composeRefs(...n){return l=>n.forEach(n=>setRef(n,l))}function useComposedRefs(...n){return ee.useCallback(composeRefs(...n),n)}},7199:function(n,l,u){var d,h,f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of g(l))_.call(n,h)||h===u||f(n,h,{get:()=>l[h],enumerable:!(d=m(l,h))||d.enumerable});return n},j={};n.exports=__copyProps(f({},"__esModule",{value:!0}),j),d=u(276),h=n.exports,__copyProps(j,d,"default"),h&&__copyProps(h,d,"default")},72163:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{currentPlatform:()=>ec,isAndroid:()=>el,isChrome:()=>en,isClient:()=>ee,isIos:()=>eu,isServer:()=>z,isTouchable:()=>es,isWeb:()=>j,isWebTouchable:()=>eo,isWindowDefined:()=>$,useIsomorphicLayoutEffect:()=>et}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);let j=!0,$="u">typeof window,z=j&&!$,ee=j&&$,et=z?_.useEffect:_.useLayoutEffect,en="u">typeof navigator&&/Chrome/.test(navigator.userAgent||""),eo=ee&&("ontouchstart"in window||navigator.maxTouchPoints>0),es=!j||eo,el=!1,eu=!1,ec="web"},35213:function(n,l,u){var d,h,f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of g(l))_.call(n,h)||h===u||f(n,h,{get:()=>l[h],enumerable:!(d=m(l,h))||d.enumerable});return n},j={};n.exports=__copyProps(f({},"__esModule",{value:!0}),j),d=u(72163),h=n.exports,__copyProps(j,d,"default"),h&&__copyProps(h,d,"default")},8698:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function createOptimizedView(n,l,u){}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{createOptimizedView:()=>createOptimizedView}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f)},59600:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function getBaseViews(){return null}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{getBaseViews:()=>getBaseViews}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f)},94092:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{getBoundingClientRect:()=>getBoundingClientRect}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let getBoundingClientRect=n=>{if(!(!n||1!==n.nodeType))return n.getBoundingClientRect?.()}},94228:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{getRect:()=>getRect}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(94092);let getRect=n=>{let l=(0,_.getBoundingClientRect)(n);if(!l)return;let{x:u,y:d,top:h,left:f}=l;return{x:u,y:d,width:n.offsetWidth,height:n.offsetHeight,top:h,left:f}}},18808:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{measureElement:()=>measureElement,measureLayout:()=>measureLayout,useElementLayout:()=>useElementLayout}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(94092);let $=new WeakMap,z=new Set,ee=null;if("u">typeof window&&"ResizeObserver"in window&&(ee=new ResizeObserver(n=>{for(let{target:l}of n){let n=$.get(l);if("function"!=typeof n)return;measureElement(l).then(l=>{n(l)})}}),"function"==typeof window.addEventListener)){let n;window.addEventListener("resize",()=>{clearTimeout(n),n=setTimeout(()=>{z.forEach(n=>n())},4)})}let measureElement=async n=>new Promise(l=>{measureLayout(n,null,(u,d,h,f,m,g)=>{l({nativeEvent:{layout:{x:u,y:d,width:h,height:f,left:m,top:g},target:n},timeStamp:Date.now()})})}),et=new WeakMap,measureLayout=(n,l,u)=>{let d=l||n?.parentNode;if(d instanceof HTMLElement){let l=Date.now();et.set(n,l),Promise.all([getBoundingClientRectAsync(n),getBoundingClientRectAsync(d)]).then(([d,h])=>{if(h&&d&&et.get(n)===l){let{x:n,y:l,width:f,height:m,left:g,top:_}=getRelativeDimensions(d,h);u(n,l,f,m,g,_)}})}},getRelativeDimensions=(n,l)=>{let{height:u,left:d,top:h,width:f}=n,m=d-l.left,g=h-l.top;return{x:m,y:g,width:f,height:u,left:d,top:h}},getBoundingClientRectAsync=n=>new Promise(l=>{let u=setTimeout(function(){l((0,j.getBoundingClientRect)(n))},10);new IntersectionObserver((n,d)=>{clearTimeout(u),d.disconnect(),l(n[0]?.boundingClientRect)},{threshold:1e-4}).observe(n)});function useElementLayout(n,l){(0,_.useIsomorphicLayoutEffect)(()=>{if(!l)return;let u=n.current;u&&$.set(u,l)},[n,l]),(0,_.useIsomorphicLayoutEffect)(()=>{if(!ee)return;let u=n.current;if(!u||!$.has(u))return;let onResize=()=>{measureElement(u).then(l)};return z.add(onResize),ee.observe(u),()=>{z.delete(onResize),ee?.unobserve(u)}},[n])}},58765:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{usePlatformMethods:()=>usePlatformMethods}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(94228),$=u(18808);function usePlatformMethods(n){(0,_.useIsomorphicLayoutEffect)(()=>{let l=n.current;l&&(l.measure||=n=>(0,$.measureLayout)(l,null,n),l.measureLayout||=(n,u)=>(0,$.measureLayout)(l,n,u),l.measureInWindow||=n=>{l&&setTimeout(()=>{let{height:u,left:d,top:h,width:f}=(0,j.getRect)(l);n(d,h,f,u)},0)})},[n])}},52026:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let _ of f(l))m.call(n,_)||_===u||d(n,_,{get:()=>l[_],enumerable:!(g=h(l,_))||g.enumerable});return n},__reExport=(n,l,u)=>(__copyProps(n,l,"default"),u&&__copyProps(u,l,"default")),g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{Stack:()=>eo,Text:()=>es,View:()=>en}),n.exports=__copyProps(d({},"__esModule",{value:!0}),g);var _=u(60724),j=u(11444),$=u(2784),z=(u(8698),u(59600)),ee=u(18808),et=u(58765);u(68585),__reExport(g,u(11444),n.exports),__reExport(g,u(76936),n.exports),(0,z.getBaseViews)(),(0,j.setupHooks)({getBaseViews:z.getBaseViews,usePropsTransform(n,l,u,d){{let h="string"==typeof n,{onMoveShouldSetResponder:f,onMoveShouldSetResponderCapture:m,onResponderEnd:g,onResponderGrant:j,onResponderMove:z,onResponderReject:en,onResponderRelease:eo,onResponderStart:es,onResponderTerminate:el,onResponderTerminationRequest:eu,onScrollShouldSetResponder:ec,onScrollShouldSetResponderCapture:eh,onSelectionChangeShouldSetResponder:ep,onSelectionChangeShouldSetResponderCapture:ef,onStartShouldSetResponder:em,onStartShouldSetResponderCapture:eg,collapsable:e_,focusable:ey,accessible:ev,accessibilityDisabled:eE,onLayout:eS,hrefAttrs:ew,...eT}=l;if(d||h){let n=(0,$.useMemo)(()=>({get current(){return u.current.host}}),[u]);(0,et.usePlatformMethods)(n),(0,ee.useElementLayout)(n,h?eS:void 0),(0,_.useResponderEvents)(n,h?{onMoveShouldSetResponder:f,onMoveShouldSetResponderCapture:m,onResponderEnd:g,onResponderGrant:j,onResponderMove:z,onResponderReject:en,onResponderRelease:eo,onResponderStart:es,onResponderTerminate:el,onResponderTerminationRequest:eu,onScrollShouldSetResponder:ec,onScrollShouldSetResponderCapture:eh,onSelectionChangeShouldSetResponder:ep,onSelectionChangeShouldSetResponderCapture:ef,onStartShouldSetResponder:em,onStartShouldSetResponderCapture:eg}:void 0)}if(h){if(eT.href&&ew){let{download:n,rel:l,target:u}=ew;null!=n&&(eT.download=n),l&&(eT.rel=l),"string"==typeof u&&(eT.target="_"!==u.charAt(0)?`_${u}`:u)}return eT}}},useEvents(n,l,{pseudos:u},d,h){}});let en=j.View,eo=j.Stack,es=j.Text},76936:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty;n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),{})},68585:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{Pressability:()=>m,usePressability:()=>usePressability}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={},usePressability=n=>({})},70941:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function clamp(n,[l,u]){return Math.min(u,Math.max(l,n))}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{clamp:()=>clamp}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f)},99422:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function composeEventHandlers(n,l,{checkDefaultPrevented:u=!0}={}){return n&&l?d=>{if(n?.(d),!d||!(u&&"defaultPrevented"in d)||"defaultPrevented"in d&&!d.defaultPrevented)return l?.(d)}:l||n||void 0}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{composeEventHandlers:()=>composeEventHandlers}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f)},93016:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function concatClassName(n){let l=arguments,u=[],d="",h=l.length,f=null;for(let n=h;n>=0;n--){let h=l[n];if(!h)continue;if(!Array.isArray(h)&&"string"!=typeof h){(f=f||[]).push(h);continue}let g=Array.isArray(h)?h:h.split(" "),_=g.length;for(let n=_-1;n>=0;n--){let l=g[n];if(!l||" "===l)continue;if("_"!==l[0]){d=l+" "+d;continue}let h=l.indexOf("-");if(h<1){d=l+" "+d;continue}let _="_"===l[h+1],j=l.slice(1,l.lastIndexOf("-")),$=_?l.slice(h+2,h+7):null,z=$?j+$:j;!(u.indexOf(z)>-1)&&(u.push(z),j&&f&&f.some(n=>{if($){let l=m[$];return n&&n[l]&&j in n[l]&&null!==n[l]}return n&&j in n&&null!==n[j]})||(d=l+" "+d))}}return d}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{concatClassName:()=>concatClassName}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={hover:"hoverStyle",focus:"focusStyle",press:"pressStyle",focusVisible:"focusVisibleStyle",disabled:"disabledStyle"}},19047:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let _ of f(l))m.call(n,_)||_===u||d(n,_,{get:()=>l[_],enumerable:!(g=h(l,_))||g.enumerable});return n},__reExport=(n,l,u)=>(__copyProps(n,l,"default"),u&&__copyProps(u,l,"default")),g={};n.exports=__copyProps(d({},"__esModule",{value:!0}),g),__reExport(g,u(69949),n.exports),__reExport(g,u(70941),n.exports),__reExport(g,u(99422),n.exports),__reExport(g,u(93016),n.exports),__reExport(g,u(67591),n.exports),__reExport(g,u(38158),n.exports),__reExport(g,u(97972),n.exports),__reExport(g,u(41665),n.exports)},38158:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{shouldRenderNativePlatform:()=>shouldRenderNativePlatform}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213);let j=["web","android","ios"];function shouldRenderNativePlatform(n){if(!n)return null;let l=function(n){let l=!0===n?j:!1===n?[]:Array.isArray(n)?n:[n],u=new Set(l);return u.has("mobile")&&(u.add("android"),u.add("ios"),u.delete("mobile")),u}(n);for(let n of j)if(n===_.currentPlatform&&l.has(n))return n;return null}},67591:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{StyleObjectIdentifier:()=>_,StyleObjectProperty:()=>m,StyleObjectPseudo:()=>j,StyleObjectRules:()=>$,StyleObjectValue:()=>g}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=0,g=1,_=2,j=3,$=4},97972:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{stylePropsAll:()=>el,stylePropsFont:()=>en,stylePropsText:()=>es,stylePropsTextOnly:()=>eo,stylePropsTransform:()=>ee,stylePropsUnitless:()=>z,stylePropsView:()=>et,tokenCategories:()=>$,validPseudoKeys:()=>eu,validStyles:()=>ec}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213);let j={color:!0,textDecorationColor:!0,textShadowColor:!0},$={radius:{borderRadius:!0,borderTopLeftRadius:!0,borderTopRightRadius:!0,borderBottomLeftRadius:!0,borderBottomRightRadius:!0,borderStartStartRadius:!0,borderStartEndRadius:!0,borderEndStartRadius:!0,borderEndEndRadius:!0},size:{width:!0,height:!0,minWidth:!0,minHeight:!0,maxWidth:!0,maxHeight:!0,blockSize:!0,minBlockSize:!0,maxBlockSize:!0,inlineSize:!0,minInlineSize:!0,maxInlineSize:!0},zIndex:{zIndex:!0},color:{backgroundColor:!0,borderColor:!0,borderBlockStartColor:!0,borderBlockEndColor:!0,borderBlockColor:!0,borderBottomColor:!0,borderInlineColor:!0,borderInlineStartColor:!0,borderInlineEndColor:!0,borderTopColor:!0,borderLeftColor:!0,borderRightColor:!0,borderEndColor:!0,borderStartColor:!0,shadowColor:!0,...j,outlineColor:!0,caretColor:!0}},z={WebkitLineClamp:!0,animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,gridTemplateColumns:!0,gridTemplateAreas:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},ee={x:!0,y:!0,scale:!0,perspective:!0,scaleX:!0,scaleY:!0,skewX:!0,skewY:!0,matrix:!0,rotate:!0,rotateY:!0,rotateX:!0,rotateZ:!0},et={backfaceVisibility:!0,borderBottomEndRadius:!0,borderBottomStartRadius:!0,borderBottomWidth:!0,borderLeftWidth:!0,borderRightWidth:!0,borderBlockWidth:!0,borderBlockEndWidth:!0,borderBlockStartWidth:!0,borderInlineWidth:!0,borderInlineEndWidth:!0,borderInlineStartWidth:!0,borderStyle:!0,borderBlockStyle:!0,borderBlockEndStyle:!0,borderBlockStartStyle:!0,borderInlineStyle:!0,borderInlineEndStyle:!0,borderInlineStartStyle:!0,borderTopEndRadius:!0,borderTopStartRadius:!0,borderTopWidth:!0,borderWidth:!0,transform:!0,transformOrigin:!0,alignContent:!0,alignItems:!0,alignSelf:!0,borderEndWidth:!0,borderStartWidth:!0,bottom:!0,display:!0,end:!0,flexBasis:!0,flexDirection:!0,flexWrap:!0,gap:!0,columnGap:!0,rowGap:!0,justifyContent:!0,left:!0,margin:!0,marginBlock:!0,marginBlockEnd:!0,marginBlockStart:!0,marginInline:!0,marginInlineStart:!0,marginInlineEnd:!0,marginBottom:!0,marginEnd:!0,marginHorizontal:!0,marginLeft:!0,marginRight:!0,marginStart:!0,marginTop:!0,marginVertical:!0,overflow:!0,padding:!0,paddingBottom:!0,paddingInline:!0,paddingBlock:!0,paddingBlockStart:!0,paddingInlineEnd:!0,paddingInlineStart:!0,paddingEnd:!0,paddingHorizontal:!0,paddingLeft:!0,paddingRight:!0,paddingStart:!0,paddingTop:!0,paddingVertical:!0,position:!0,right:!0,start:!0,top:!0,inset:!0,insetBlock:!0,insetBlockEnd:!0,insetBlockStart:!0,insetInline:!0,insetInlineEnd:!0,insetInlineStart:!0,direction:!0,shadowOffset:!0,shadowRadius:!0,...$.color,...$.radius,...$.size,...$.radius,...ee,...z,transition:!0,textWrap:!0,backdropFilter:!0,background:!0,backgroundAttachment:!0,backgroundBlendMode:!0,backgroundClip:!0,backgroundColor:!0,backgroundImage:!0,backgroundOrigin:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundSize:!0,borderBottomStyle:!0,borderImage:!0,borderLeftStyle:!0,borderRightStyle:!0,borderTopStyle:!0,boxShadow:!0,boxSizing:!0,caretColor:!0,clipPath:!0,contain:!0,containerType:!0,content:!0,cursor:!0,filter:!0,float:!0,mask:!0,maskBorder:!0,maskBorderMode:!0,maskBorderOutset:!0,maskBorderRepeat:!0,maskBorderSlice:!0,maskBorderSource:!0,maskBorderWidth:!0,maskClip:!0,maskComposite:!0,maskImage:!0,maskMode:!0,maskOrigin:!0,maskPosition:!0,maskRepeat:!0,maskSize:!0,maskType:!0,mixBlendMode:!0,objectFit:!0,objectPosition:!0,outlineOffset:!0,outlineStyle:!0,outlineWidth:!0,overflowBlock:!0,overflowInline:!0,overflowX:!0,overflowY:!0,pointerEvents:!0,scrollbarWidth:!0,textEmphasis:!0,touchAction:!0,transformStyle:!0,userSelect:!0,..._.isAndroid?{elevationAndroid:!0}:{}},en={fontFamily:!0,fontSize:!0,fontStyle:!0,fontWeight:!0,letterSpacing:!0,lineHeight:!0,textTransform:!0},eo={...en,textAlign:!0,textDecorationLine:!0,textDecorationStyle:!0,...j,textShadowOffset:!0,textShadowRadius:!0,userSelect:!0,selectable:!0,verticalAlign:!0,whiteSpace:!0,wordWrap:!0,textOverflow:!0,textDecorationDistance:!0,cursor:!0,WebkitLineClamp:!0,WebkitBoxOrient:!0},es={...et,...eo},el=es,eu={enterStyle:!0,exitStyle:!0,hoverStyle:!0,pressStyle:!0,focusStyle:!0,disabledStyle:!0,focusVisibleStyle:!0},ec={...eu,...et}},41665:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{withStaticProperties:()=>withStaticProperties}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);let j=Symbol(),withStaticProperties=(n,l)=>{let u=(()=>{if(n[j]){let l=(0,_.forwardRef)((l,u)=>(0,_.createElement)(n,{...l,ref:u}));for(let u in n){let d=n[u];l[u]=d&&"object"==typeof d?{...d}:d}}return n})();return Object.assign(u,l),u[j]=!0,u}},74306:function(n,l,u){var d,h,f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of _(l))$.call(n,h)||h===u||m(n,h,{get:()=>l[h],enumerable:!(d=g(l,h))||d.enumerable});return n},z={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})(z,{default:()=>eo,normalizeCSSColor:()=>en,rgba:()=>rgba}),n.exports=__copyProps(m({},"__esModule",{value:!0}),z);var ee=(h=null!=(d=u(65963))?f(j(d)):{},__copyProps(d&&d.__esModule?h:m(h,"default",{value:d,enumerable:!0}),d));let et=ee.default||ee,en=et;function rgba(n){let l=Math.round((4278190080&n)>>>24),u=Math.round((16711680&n)>>>16),d=Math.round((65280&n)>>>8);return{r:l,g:u,b:d,a:((255&n)>>>0)/255}}var eo=en},85360:function(){void 0===globalThis.__DEV__&&(globalThis.__DEV__=!1)},71988:function(n,l,u){var d,h,f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of _(l))$.call(n,h)||h===u||m(n,h,{get:()=>l[h],enumerable:!(d=g(l,h))||d.enumerable});return n},z={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})(z,{addNode:()=>addNode,attachListeners:()=>attachListeners,getResponderNode:()=>getResponderNode,removeNode:()=>removeNode,terminateResponder:()=>terminateResponder}),n.exports=__copyProps(m({},"__esModule",{value:!0}),z);var ee=(h=null!=(d=u(53629))?f(j(d)):{},__copyProps(d&&d.__esModule?h:m(h,"default",{value:d,enumerable:!0}),d)),et=u(55861),en=u(64983),eo=u(2633),es=u(2633);let el={},eu=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],ec=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],eh={touchstart:eu,mousedown:eu,touchmove:ec,mousemove:ec,scroll:["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}]},ep={id:null,idPath:null,node:null},ef=new Map,em=!1,eg=0,e_={id:null,node:null,idPath:null},ey=new et.ResponderTouchHistoryStore;function getResponderConfig(n){let l=ef.get(n);return l??el}function eventListener(n){let l=n.type,u=n.target;if("touchstart"===l&&(em=!0),("touchmove"===l||eg>1)&&(em=!1),"mousedown"===l&&em||"mousemove"===l&&em||"mousemove"===l&&eg<1)return;if(em&&"mouseup"===l){0===eg&&(em=!1);return}let d=(0,en.isStartish)(l)&&(0,es.isPrimaryPointerDown)(n),h=(0,en.isMoveish)(l),f=(0,en.isEndish)(l),m=(0,en.isScroll)(l),g=(0,en.isSelectionChange)(l),_=(0,ee.default)(n,ey);(d||h||f)&&(n.touches?eg=n.touches.length:d?eg=1:f&&(eg=0),ey.recordTouchTrack(l,_.nativeEvent));let j=(0,es.getResponderPaths)(n),$=!1,z;if(d||h||m&&eg>0){let l=e_.idPath,u=j.idPath;if(null!=l&&null!=u){let n=(0,es.getLowestCommonAncestor)(l,u);if(null!=n){let l=u.indexOf(n)+(n===e_.id?1:0);j={idPath:u.slice(l),nodePath:j.nodePath.slice(l)}}else j=null}null!=j&&null!=(z=function(n,l,u){let d=eh[l.type];if(null!=d){let{idPath:h,nodePath:f}=n,m=d[0],g=d[1],{bubbles:_}=d[2],check=(n,l,d)=>{let f=getResponderConfig(n)[d];if(null!=f&&(u.currentTarget=l,!0===f(u))){let u=h.slice(h.indexOf(n));return{id:n,node:l,idPath:u}}};for(let n=h.length-1;n>=0;n--){let l=h[n],d=f[n],g=check(l,d,m);if(null!=g)return g;if(!0===u.isPropagationStopped())return}if(_)for(let n=0;n<h.length;n++){let l=h[n],d=f[n],m=check(l,d,g);if(null!=m)return m;if(!0===u.isPropagationStopped())return}else{let n=h[0],u=f[0];if(l.target===u)return check(n,u,g)}}}(j,n,_))&&(function(n,l){let{id:u,node:d}=e_,{id:h,node:f}=l,{onResponderGrant:m,onResponderReject:g}=getResponderConfig(h);if(n.bubbles=!1,n.cancelable=!1,n.currentTarget=f,null==u)null!=m&&(n.currentTarget=f,n.dispatchConfig.registrationName="onResponderGrant",m(n)),e_=l;else{let{onResponderTerminate:h,onResponderTerminationRequest:_}=getResponderConfig(u),j=!0;null!=_&&(n.currentTarget=d,n.dispatchConfig.registrationName="onResponderTerminationRequest",!1===_(n)&&(j=!1)),j?(null!=h&&(n.currentTarget=d,n.dispatchConfig.registrationName="onResponderTerminate",h(n)),null!=m&&(n.currentTarget=f,n.dispatchConfig.registrationName="onResponderGrant",m(n)),e_=l):null!=g&&(n.currentTarget=f,n.dispatchConfig.registrationName="onResponderReject",g(n))}}(_,z),$=!0)}if(null!=e_.id&&null!=e_.node){let{id:j,node:z}=e_,{onResponderStart:ee,onResponderMove:et,onResponderEnd:eo,onResponderRelease:el,onResponderTerminate:eu,onResponderTerminationRequest:ec}=getResponderConfig(j);if(_.bubbles=!1,_.cancelable=!1,_.currentTarget=z,d)null!=ee&&(_.dispatchConfig.registrationName="onResponderStart",ee(_));else if(h)null!=et&&(_.dispatchConfig.registrationName="onResponderMove",et(_));else{let d=(0,en.isCancelish)(l)||"contextmenu"===l||"blur"===l&&u===window||"blur"===l&&u.contains(z)&&n.relatedTarget!==z||m&&0===eg||m&&u.contains(z)&&u!==z||g&&(0,es.hasValidSelection)(n),h=f&&!d&&!(0,es.hasTargetTouches)(z,n.touches);if(f&&null!=eo&&(_.dispatchConfig.registrationName="onResponderEnd",eo(_)),h&&(null!=el&&(_.dispatchConfig.registrationName="onResponderRelease",el(_)),e_=ep),d){let n=!0;("contextmenu"===l||"scroll"===l||"selectionchange"===l)&&($?n=!1:null!=ec&&(_.dispatchConfig.registrationName="onResponderTerminationRequest",!1===ec(_)&&(n=!1))),n&&(null!=eu&&(_.dispatchConfig.registrationName="onResponderTerminate",eu(_)),e_=ep,em=!1,eg=0)}}}}let ev=["blur","scroll"],eE=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"],eS=Symbol();function attachListeners(){eo.canUseDOM&&!window[eS]&&(window.addEventListener("blur",eventListener),eE.forEach(n=>{document.addEventListener(n,eventListener)}),ev.forEach(n=>{document.addEventListener(n,eventListener,!0)}),window[eS]=!0)}function addNode(n,l,u){(0,es.setResponderId)(l,n),ef.set(n,u)}function removeNode(n){e_.id===n&&terminateResponder(),ef.has(n)&&ef.delete(n)}function terminateResponder(){let{id:n,node:l}=e_;if(null!=n&&null!=l){let{onResponderTerminate:u}=getResponderConfig(n);if(null!=u){let n=(0,ee.default)({},ey);n.currentTarget=l,u(n)}e_=ep}em=!1,eg=0}function getResponderNode(){return e_.node}},55861:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ResponderTouchHistoryStore:()=>ResponderTouchHistoryStore}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(64983);let ResponderTouchHistoryStore=class ResponderTouchHistoryStore{_touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0};recordTouchTrack(n,l){let u=this._touchHistory;if((0,_.isMoveish)(n))l.changedTouches.forEach(n=>(function(n,l){let u=l.touchBank[getTouchIdentifier(n)];u?(u.touchActive=!0,u.previousPageX=u.currentPageX,u.previousPageY=u.currentPageY,u.previousTimeStamp=u.currentTimeStamp,u.currentPageX=n.pageX,u.currentPageY=n.pageY,u.currentTimeStamp=timestampForTouch(n),l.mostRecentTimeStamp=timestampForTouch(n)):console.warn(`Cannot record touch move without a touch start.
`,`Touch Move: ${printTouch(n)}
`,`Touch Bank: ${printTouchBank(l)}`)})(n,u));else if((0,_.isStartish)(n))l.changedTouches.forEach(n=>(function(n,l){let u=getTouchIdentifier(n),d=l.touchBank[u];d?(d.touchActive=!0,d.startPageX=n.pageX,d.startPageY=n.pageY,d.startTimeStamp=timestampForTouch(n),d.currentPageX=n.pageX,d.currentPageY=n.pageY,d.currentTimeStamp=timestampForTouch(n),d.previousPageX=n.pageX,d.previousPageY=n.pageY,d.previousTimeStamp=timestampForTouch(n)):l.touchBank[u]={touchActive:!0,startPageX:n.pageX,startPageY:n.pageY,startTimeStamp:timestampForTouch(n),currentPageX:n.pageX,currentPageY:n.pageY,currentTimeStamp:timestampForTouch(n),previousPageX:n.pageX,previousPageY:n.pageY,previousTimeStamp:timestampForTouch(n)},l.mostRecentTimeStamp=timestampForTouch(n)})(n,u)),u.numberActiveTouches=l.touches.length,1===u.numberActiveTouches&&(u.indexOfSingleActiveTouch=l.touches[0].identifier);else if((0,_.isEndish)(n)&&(l.changedTouches.forEach(n=>(function(n,l){let u=l.touchBank[getTouchIdentifier(n)];u?(u.touchActive=!1,u.previousPageX=u.currentPageX,u.previousPageY=u.currentPageY,u.previousTimeStamp=u.currentTimeStamp,u.currentPageX=n.pageX,u.currentPageY=n.pageY,u.currentTimeStamp=timestampForTouch(n),l.mostRecentTimeStamp=timestampForTouch(n)):console.warn(`Cannot record touch end without a touch start.
`,`Touch End: ${printTouch(n)}
`,`Touch Bank: ${printTouchBank(l)}`)})(n,u)),u.numberActiveTouches=l.touches.length,1===u.numberActiveTouches)){let{touchBank:n}=u;for(let l=0;l<n.length;l++)if(n[l]?.touchActive){u.indexOfSingleActiveTouch=l;break}}}get touchHistory(){return this._touchHistory}};function timestampForTouch(n){return n.timeStamp||n.timestamp}function getTouchIdentifier({identifier:n}){return null==n&&console.error("Touch object is missing identifier."),n}function printTouch(n){return JSON.stringify({identifier:n.identifier,pageX:n.pageX,pageY:n.pageY,timestamp:timestampForTouch(n)})}function printTouchBank(n){let{touchBank:l}=n,u=JSON.stringify(l.slice(0,20));return l.length>20&&(u+=` (original size: ${l.length})`),u}},53629:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{default:()=>createResponderEvent}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2633);let emptyFunction=()=>{},j={},$=[];function normalizeIdentifier(n){return n>20?n%20:n}function createResponderEvent(n,l){let u,d=!1,h,f,m=n.changedTouches,g=n.type,z=!0===n.metaKey,ee=!0===n.shiftKey,et=m?.[0].force||0,en=normalizeIdentifier(m?.[0].identifier||0),eo=m?.[0].clientX||n.clientX,es=m?.[0].clientY||n.clientY,el=m?.[0].pageX||n.pageX,eu=m?.[0].pageY||n.pageY,ec="function"==typeof n.preventDefault?n.preventDefault.bind(n):emptyFunction,eh=n.timeStamp;function normalizeTouches(n){return Array.prototype.slice.call(n).map(n=>({force:n.force,identifier:normalizeIdentifier(n.identifier),get locationX(){return locationX(n.clientX)},get locationY(){return locationY(n.clientY)},pageX:n.pageX,pageY:n.pageY,target:n.target,timestamp:eh}))}if(null!=m)h=normalizeTouches(m),f=normalizeTouches(n.touches);else{let l=[{force:et,identifier:en,get locationX(){return locationX(eo)},get locationY(){return locationY(es)},pageX:el,pageY:eu,target:n.target,timestamp:eh}];h=l,f="mouseup"===g||"dragstart"===g?$:l}let ep={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:n.defaultPrevented,dispatchConfig:j,eventPhase:n.eventPhase,isDefaultPrevented:()=>n.defaultPrevented,isPropagationStopped:()=>d,isTrusted:n.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:z,shiftKey:ee,changedTouches:h,force:et,identifier:en,get locationX(){return locationX(eo)},get locationY(){return locationY(es)},pageX:el,pageY:eu,target:n.target,timestamp:eh,touches:f,type:g},persist:emptyFunction,preventDefault:ec,stopPropagation(){d=!0},target:n.target,timeStamp:eh,touchHistory:l.touchHistory};function locationX(n){if(u=u||(0,_.getBoundingClientRect)(ep.currentTarget))return n-u.left}function locationY(n){if(u=u||(0,_.getBoundingClientRect)(ep.currentTarget))return n-u.top}return ep}},60724:function(n,l,u){var d,h,f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of g(l))_.call(n,h)||h===u||f(n,h,{get:()=>l[h],enumerable:!(d=m(l,h))||d.enumerable});return n},j={};n.exports=__copyProps(f({},"__esModule",{value:!0}),j),d=u(27097),h=n.exports,__copyProps(j,d,"default"),h&&__copyProps(h,d,"default")},64983:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{BLUR:()=>m,CONTEXT_MENU:()=>g,FOCUS_OUT:()=>_,MOUSE_CANCEL:()=>ee,MOUSE_DOWN:()=>j,MOUSE_MOVE:()=>$,MOUSE_UP:()=>z,SCROLL:()=>el,SELECT:()=>eu,SELECTION_CHANGE:()=>ec,TOUCH_CANCEL:()=>es,TOUCH_END:()=>eo,TOUCH_MOVE:()=>en,TOUCH_START:()=>et,isCancelish:()=>isCancelish,isEndish:()=>isEndish,isMoveish:()=>isMoveish,isScroll:()=>isScroll,isSelectionChange:()=>isSelectionChange,isStartish:()=>isStartish}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m="blur",g="contextmenu",_="focusout",j="mousedown",$="mousemove",z="mouseup",ee="dragstart",et="touchstart",en="touchmove",eo="touchend",es="touchcancel",el="scroll",eu="select",ec="selectionchange";function isStartish(n){return n===et||n===j}function isMoveish(n){return n===en||n===$}function isEndish(n){return n===eo||n===z||isCancelish(n)}function isCancelish(n){return n===es||n===ee}function isScroll(n){return n===el}function isSelectionChange(n){return n===eu||n===ec}},27097:function(n,l,u){var d,h,f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of _(l))$.call(n,h)||h===u||m(n,h,{get:()=>l[h],enumerable:!(d=g(l,h))||d.enumerable});return n},__toESM=(n,l,u)=>(u=null!=n?f(j(n)):{},__copyProps(!l&&n&&n.__esModule?u:m(u,"default",{value:n,enumerable:!0}),n)),z={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})(z,{useResponderEvents:()=>useResponderEvents}),n.exports=__copyProps(m({},"__esModule",{value:!0}),z);var ee=__toESM(u(2784)),et=__toESM(u(71988));d=u(2633),h=n.exports,__copyProps(z,d,"default"),h&&__copyProps(h,d,"default");let en={};function useResponderEvents(n,l=en){let u=ee.useId(),d=ee.useRef(!1);ee.useEffect(()=>(et.attachListeners(),()=>{et.removeNode(u)}),[u]),ee.useEffect(()=>{let{onMoveShouldSetResponder:h,onMoveShouldSetResponderCapture:f,onScrollShouldSetResponder:m,onScrollShouldSetResponderCapture:g,onSelectionChangeShouldSetResponder:_,onSelectionChangeShouldSetResponderCapture:j,onStartShouldSetResponder:$,onStartShouldSetResponderCapture:z}=l,ee=n.current;null!=h||null!=f||null!=m||null!=g||null!=_||null!=j||null!=$||null!=z?(et.addNode(u,ee,l),d.current=!0):d.current&&(et.removeNode(u),d.current=!1)},[l,n,u])}},2633:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{canUseDOM:()=>g,getBoundingClientRect:()=>getBoundingClientRect,getLowestCommonAncestor:()=>getLowestCommonAncestor,getResponderPaths:()=>getResponderPaths,hasTargetTouches:()=>hasTargetTouches,hasValidSelection:()=>hasValidSelection,isPrimaryPointerDown:()=>isPrimaryPointerDown,isSelectionValid:()=>isSelectionValid,setResponderId:()=>setResponderId}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m="__reactResponderId",g=!!("u">typeof window&&window.document&&window.document.createElement),getBoundingClientRect=n=>{if(n&&1===n.nodeType&&n.getBoundingClientRect)return n.getBoundingClientRect()};function composedPathFallback(n){let l=[];for(;null!=n&&n!==document.body;)l.push(n),n=n.parentNode;return l}function setResponderId(n,l){null!=n&&(n[m]=l)}function getResponderPaths(n){let l=[],u=[],d=function(n){if("selectionchange"===n.type){let n=window.getSelection()?.anchorNode;return composedPathFallback(n)}return null!=n.composedPath?n.composedPath():composedPathFallback(n.target)}(n);for(let n=0;n<d.length;n++){let h=d[n],f=null!=h?h[m]:null;null!=f&&(l.push(f),u.push(h))}return{idPath:l,nodePath:u}}function getLowestCommonAncestor(n,l){let u=n.length,d=l.length;if(0===u||0===d||n[u-1]!==l[d-1])return null;let h=n[0],f=0,m=l[0],g=0;u-d>0&&(h=n[f=u-d],u=d),d-u>0&&(m=l[g=d-u],d=u);let _=u;for(;_--;){if(h===m)return h;h=n[f++],m=l[g++]}return null}function hasTargetTouches(n,l){if(!l||0===l.length)return!1;for(let u=0;u<l.length;u++){let d=l[u].target;if(null!=d&&n.contains(d))return!0}return!1}function hasValidSelection(n){return"selectionchange"===n.type?isSelectionValid():"select"===n.type}function isPrimaryPointerDown(n){let{altKey:l,button:u,buttons:d,ctrlKey:h,type:f}=n,m=!1===l&&!1===h;return!!("touchstart"===f||"touchmove"===f||"mousedown"===f&&(0===u||1===d)&&m||"mousemove"===f&&1===d&&m)}function isSelectionValid(){let n=window.getSelection();if(!n)return!1;let l=n.toString(),u=n.anchorNode,d=n.focusNode,h=u&&u.nodeType===window.Node.TEXT_NODE||d&&d.nodeType===window.Node.TEXT_NODE;return l.length>=1&&l!==`
`&&!!h}},69949:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{simpleHash:()=>simpleHash}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=new Map,simpleHash=(n,l=10)=>{if(m.has(n))return m.get(n);let u=0,d="",h=n.length;for(let f=0;f<h;f++){let m=n.charCodeAt(f);if("strict"!==l&&(46===m&&(d+="d0t"),(m>=65&&m<=90||m>=97&&m<=122||95===m||45===m||m>=48&&m<=57)&&h<=l)){d+=n[f];continue}u=hashChar(u,n[f])}let f=d+(u?Math.abs(u):"");return m.size>1e4&&m.clear(),m.set(n,f),f},hashChar=(n,l)=>Math.imul(31,n)+l.charCodeAt(0)|0},4179:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useClientValue:()=>useClientValue,useDidFinishSSR:()=>useDidFinishSSR,useDidFinishSSRSync:()=>useDidFinishSSRSync}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);let emptyFn=()=>{},emptyFnFn=()=>emptyFn;function useDidFinishSSR(n,l){if(l?.sync)return(0,_.useSyncExternalStore)(emptyFnFn,()=>n??!0,()=>!1);let[u,d]=(0,_.useState)(n);return(0,_.useEffect)(()=>{d(n??!0)},[]),u??!1}function useDidFinishSSRSync(n){return useDidFinishSSR(n,{sync:!0})}function useClientValue(n){return useDidFinishSSR()?"function"==typeof n?n():n:void 0}},36552:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let _ of f(l))m.call(n,_)||_===u||d(n,_,{get:()=>l[_],enumerable:!(g=h(l,_))||g.enumerable});return n},__reExport=(n,l,u)=>(__copyProps(n,l,"default"),u&&__copyProps(u,l,"default")),g={};n.exports=__copyProps(d({},"__esModule",{value:!0}),g),__reExport(g,u(58981),n.exports),__reExport(g,u(97975),n.exports)},58981:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useEvent:()=>useEvent}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(97975);function useEvent(n){return(0,_.useGet)(n,defaultValue,!0)}let defaultValue=()=>{throw Error("Cannot call an event handler while rendering.")}},97975:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useGet:()=>useGet}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(2784);function useGet(n,l,u){let d=(0,j.useRef)(l??n);return(0,_.useIsomorphicLayoutEffect)(()=>{d.current=n}),(0,j.useCallback)(u?(...n)=>d.current?.apply(null,n):()=>d.current,[])}},62391:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{isServerSide:()=>j,useForceUpdate:()=>useForceUpdate}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);let j=typeof window>"u",idFn=()=>{};function useForceUpdate(){return j?idFn:(0,_.useReducer)(n=>Math.random(),0)[1]}},98517:function(n,l,u){var d,h,f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of _(l))$.call(n,h)||h===u||m(n,h,{get:()=>l[h],enumerable:!(d=g(l,h))||d.enumerable});return n},z={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})(z,{Tamagui:()=>ee,getValueFromIdentifier:()=>getValueFromIdentifier,setIdentifierValue:()=>setIdentifierValue}),n.exports=__copyProps(m({},"__esModule",{value:!0}),z),h=null!=(d=u(19047))?f(j(d)):{},__copyProps(d&&d.__esModule?h:m(h,"default",{value:d,enumerable:!0}),d),u(75769),u(8546),u(29683),u(70157);let ee=void 0,et=new Map,getValueFromIdentifier=n=>et.get(n),setIdentifierValue=(n,l)=>{et.set(n,l)}},74320:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{_withStableStyle:()=>_withStableStyle}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(70157),$=u(52322);let _withStableStyle=(n,l)=>(0,_.forwardRef)((u,d)=>{let{_expressions:h=[],...f}=u,m=(0,j.useTheme)();return(0,$.jsx)(n,{ref:d,style:l(m,h),...f})})},75769:function(n,l,u){let d,h,f;var m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.prototype.hasOwnProperty,$={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})($,{configListeners:()=>et,devConfig:()=>f,getConfig:()=>getConfig,getFont:()=>getFont,getSetting:()=>getSetting,getThemes:()=>getThemes,getToken:()=>getToken,getTokenObject:()=>getTokenObject,getTokenValue:()=>getTokenValue,getTokens:()=>getTokens,onConfiguredOnce:()=>onConfiguredOnce,setConfig:()=>setConfig,setConfigFont:()=>setConfigFont,setTokens:()=>setTokens,setupDev:()=>setupDev,updateConfig:()=>updateConfig,useTokens:()=>ee}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of _(l))j.call(n,u)||void 0===u||m(n,u,{get:()=>l[u],enumerable:!(d=g(l,u))||d.enumerable});return n})(m({},"__esModule",{value:!0}),$);var z=u(35213);let getSetting=n=>d.settings[n]??d[n],setConfig=n=>{d=n},setConfigFont=(n,l,u)=>{d.fonts[n]=l,d.fontsParsed[`$${n}`]=u},getConfig=()=>{if(!d)throw Error("Err0");return d};function setTokens(n){h=n}let getTokens=({prefixed:n}={})=>{let{tokens:l,tokensParsed:u}=d;return!1===n?l:!0===n?u:h},getTokenObject=(n,l)=>d.specificTokens[n]??(l?h[l]?.[n]:h[Object.keys(h).find(l=>h[l][n])||""]?.[n]),getToken=(n,l,u=z.isWeb)=>{let d=getTokenObject(n,l);return u?d?.variable:d?.val},getTokenValue=(n,l)=>{if(!("unset"===n||"auto"===n))return getToken(n,l,!1)},ee=getTokens,getThemes=()=>d.themes,et=new Set,onConfiguredOnce=n=>{d?n(d):et.add(n)},updateConfig=(n,l)=>{Object.assign(d[n],l)},getFont=n=>{let l=getConfig();return l.fontsParsed[n]??Object.entries(l.fontsParsed).find(([u])=>l.fontsParsed[u]?.family?.val===n)?.[1]};function setupDev(n){}},32149:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{accessibilityDirectMap:()=>m,accessibilityWebRoleToNativeRole:()=>$,nativeAccessibilityState:()=>j,nativeAccessibilityValue:()=>_,webToNativeAccessibilityDirectMap:()=>g}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={};{let n={Hidden:!0,ActiveDescendant:!0,Atomic:!0,AutoComplete:!0,Busy:!0,Checked:!0,ColumnCount:"colcount",ColumnIndex:"colindex",ColumnSpan:"colspan",Current:!0,Details:!0,ErrorMessage:!0,Expanded:!0,HasPopup:!0,Invalid:!0,Label:!0,Level:!0,Modal:!0,Multiline:!0,MultiSelectable:!0,Orientation:!0,Owns:!0,Placeholder:!0,PosInSet:!0,Pressed:!0,RoleDescription:!0,RowCount:!0,RowIndex:!0,RowSpan:!0,Selected:!0,SetSize:!0,Sort:!0,ValueMax:!0,ValueMin:!0,ValueNow:!0,ValueText:!0};for(let l in n){let u=n[l];!0===u&&(u=l.toLowerCase()),m[`accessibility${l}`]=`aria-${u}`}}let g=null,_=null,j=null,$=null},57239:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{FONT_DATA_ATTRIBUTE_NAME:()=>_,THEME_CLASSNAME_PREFIX:()=>g,THEME_NAME_SEPARATOR:()=>m,stackDefaultStyles:()=>j,webViewFlexCompatStyles:()=>$}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m="_",g="t_",_="data-tamagui-font",j={},$={display:"flex",alignItems:"stretch",flexDirection:"column",flexBasis:"auto",boxSizing:"border-box",position:"relative",minHeight:0,minWidth:0,flexShrink:0};Object.assign(j,$)},76394:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{isDevTools:()=>m}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=!1},91529:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{webToNativeDynamicExpansion:()=>m,webToNativeExpansion:()=>g}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={},g={}},98157:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ComponentContext:()=>j}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(39947);let j=(0,_.createStyledContext)({disableSSR:void 0,inText:!1,language:null,animationDriver:null,groups:{emit:null,subscribe:null,state:{}}})},85884:function(n,l,u){let d,h;var f,m,g=u(34406),_=Object.create,j=Object.defineProperty,$=Object.getOwnPropertyDescriptor,z=Object.getOwnPropertyNames,ee=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of z(l))et.call(n,h)||h===u||j(n,h,{get:()=>l[h],enumerable:!(d=$(l,h))||d.enumerable});return n},en={};((n,l)=>{for(var u in l)j(n,u,{get:l[u],enumerable:!0})})(en,{Spacer:()=>ex,Unspaced:()=>Unspaced,componentSetStates:()=>eC,createComponent:()=>createComponent,isDisabled:()=>isDisabled,spacedChildren:()=>spacedChildren,subscribeToContextGroup:()=>subscribeToContextGroup,useComponentState:()=>useComponentState}),n.exports=__copyProps(j({},"__esModule",{value:!0}),en);var eo=u(7199),es=u(35213),el=u(19047),eu=(m=null!=(f=u(2784))?_(ee(f)):{},__copyProps(f&&f.__esModule?m:j(m,"default",{value:f,enumerable:!0}),f)),ec=u(75769),eh=u(57239),ep=(u(76394),u(98157)),ef=u(2754),em=u(27419),eg=u(52807),e_=u(68359),ey=u(2533),ev=(u(87296),u(5051)),eE=u(72554),eS=u(34577),ew=u(22514),eT=u(29683),eI=u(70157),eR=u(42962),eP=u(74576),eA=u(68349),eO=(u(35600),u(52322));let eC=new Set;if("u">typeof document){let cancelTouches=()=>{eC.forEach(n=>n(n=>n.press||n.pressIn?{...n,press:!1,pressIn:!1}:n)),eC.clear()};addEventListener("mouseup",cancelTouches),addEventListener("touchend",cancelTouches),addEventListener("touchcancel",cancelTouches)}let useComponentState=(n,{animationDriver:l,groups:u},d,h)=>{var f;let m=l?.useAnimations,g=(0,eu.useRef)(void 0);g.current||(g.current={});let _=!!("animation"in n||n.style&&Object.keys(f=n.style).some(n=>{let l=f[n];return l&&"object"==typeof l&&"_animation"in l})),j=l?.supportsCSSVars,$=g.current,z=!!(_&&!d.isHOC&&m||$.hasAnimated),ee=!es.isServer&&z;ee&&!$.hasAnimated&&($.hasAnimated=!0);let et=ee&&!1!==n.animatePresence&&l?.usePresence?.()||null,en=et?.[2],eo=en?.isPresent===!1,el=en?.isPresent===!0&&!1!==en.initial,ec=!!n.enterStyle,eh=_&&l?.isReactNative,ep=!ee||(0,ew.useDidHydrateOnce)(),ef=ec||el||!ep&&eh?es.isWeb&&!ep?em.defaultComponentState:em.defaultComponentStateShouldEnter:em.defaultComponentStateMounted,e_=isDisabled(n);null!=e_&&(ef.disabled=e_);let ev=(0,eu.useState)(ef),eE=n.forceStyle?{...ev[0],[n.forceStyle]:!0}:ev[0],eS=ev[1],eT=!1===eE.unmounted||"should-enter"===eE.unmounted,eI=ee;es.isWeb&&eh&&!d.isHOC&&!0===eE.unmounted&&(eI=!1,$.willHydrate=!0),e_!==eE.disabled&&(eE.disabled=e_,e_&&Object.assign(eE,em.defaultComponentStateMounted),eS({...eE}));let eR=(0,eg.createShallowSetState)(eS,e_,!1,n.debug);if(en&&eI&&eT&&d.variants){let{enterVariant:l,exitVariant:u,enterExitVariant:h,custom:f}=en;(0,ey.isObj)(f)&&Object.assign(n,f);let m=u??h,g=l??h;eE.unmounted&&g&&d.variants[g]?n[g]=!0:eo&&m&&(n[m]=u!==h)}let eP=!es.isWeb;if(es.isWeb){let{disableClassName:l}=n,u=eI&&!j&&ep&&!es.isServer,f=!d.acceptsClassName&&(h.disableSSR||ep),m=l&&!es.isServer&&ep&&!0===eE.unmounted;(u||m||f)&&(eP=!0)}let eA=n.group;if(eA&&!$.group){let n=new Set;$.group={listeners:n,emit(l,u){n.forEach(n=>n(l,u))},subscribe:l=>(n.add(l),()=>{n.delete(l)})}}if(eA){let n=u.state,l=eR;eR=u=>{l(u),$.group.emit(eA,{pseudo:u});let d={...n[eA],...u};n[eA]=d}}return{curStateRef:$,disabled:e_,groupName:eA,hasAnimationProp:_,hasEnterStyle:ec,isAnimated:eI,isExiting:eo,isHydrated:eT,presence:et,presenceState:en,setState:eS,setStateShallow:eR,shouldAvoidClasses:eP,state:eE,stateRef:g,supportsCSSVars:j,willBeAnimated:ee,willBeAnimatedClient:z}},ek={value:!1};function createComponent(n){let{componentName:l}=n,u=null,f=n.defaultProps;(0,ec.onConfiguredOnce)(n=>{if(u=n,l){let u=n.defaultProps?.[l];u&&(f={...u,...f})}});let{Component:m,isText:_,isZStack:j,isHOC:$,validStyles:z={},variants:ee={}}=n,et=(0,eu.forwardRef)((l,et)=>{let en,eh,eg,ey,eS;let ew=(0,eu.useContext)(ep.ComponentContext),{context:ex,isReactNative:eM}=n;if(ex){eg=(0,eu.useContext)(ex);let{inverseShorthands:n}=(0,ec.getConfig)();for(let u in ex.props){let d=l[u]??l[n[u]]??f?.[u]??f?.[n[u]];void 0===d?eg&&(u in z||u in ee)&&((en||={})[u]=eg[u]):(eh||={})[u]=d}}let eD=en?{...f,...en}:f,eN=l;eD&&(eN=(0,ev.mergeProps)(eD,l));let eV=eN.debug,eF=eN.componentName||n.componentName;g.env.TAMAGUI_IS_CORE_NODE;let eL=ew.animationDriver,ej=eL?.useAnimations,{curStateRef:eU,disabled:eB,groupName:e$,hasAnimationProp:eH,hasEnterStyle:eW,isAnimated:eq,isExiting:ez,isHydrated:eG,presence:eK,presenceState:eX,setState:eY,setStateShallow:eQ,shouldAvoidClasses:eJ,state:eZ,stateRef:e0,supportsCSSVars:e1,willBeAnimated:e2,willBeAnimatedClient:e3}=useComponentState(eN,ew,n,u),e5=!!l.forceStyle,e4=eJ||e5,e9=!!(es.isWeb&&_&&ew.inText),e6=!m||"string"==typeof m,e7=eN.tag,e8=es.isWeb&&e6&&e7||m,te=_?d||e8||"span":h||e8||(e9?"span":"div");eL&&eq&&(te=eL[_?"Text":"View"]||te);let tt=eN["data-disable-theme"]||$;eN.themeShallow&&(eU.themeShallow=!0);let tn={componentName:eF,disable:tt,shallow:eU.themeShallow,debug:eV};"themeInverse"in eN&&(tn.inverse=eN.themeInverse),"theme"in eN&&(tn.name=eN.theme),"boolean"==typeof eU.isListeningToTheme&&(tn.shouldUpdate=()=>e0.current.isListeningToTheme);let[to,ts]=(0,eI.useThemeWithState)(tn);te=m||te;let ta=(0,eT.useMedia)(e0,ew,eV);(0,ef.setDidGetVariableValue)(!1);let tl=eq&&!e1||$&&!1==eZ.unmounted&&eH?"value":"auto",tu={mediaState:ta,noClassNames:e4,resolveValues:tl,isExiting:ez,isAnimated:eq,willBeAnimated:e2},tc=(0,e_.useSplitStyles)(eN,n,ts,to?.state?.name||"",eZ,tu,null,ew,te,eV);eN.group&&"hide"===eN.untilMeasured&&!eU.hasMeasured&&(tc.style||={},tc.style.opacity=0),eU.isListeningToTheme=tc.dynamicThemeAccess;let td=tc.hasMedia&&!0!==tc.hasMedia,th=(0,ef.didGetVariableValue)()||td||e4&&!0===tc.hasMedia,tp=td?tc.hasMedia:null;(0,eT.setMediaShouldUpdate)(e0,{enabled:th,keys:tp});let{viewProps:tf,pseudos:tm,style:tg,classNames:t_,space:ty}=tc,tv=eN,{asChild:tb,children:tE,themeShallow:tS,spaceDirection:tw,onPress:tT,onLongPress:tI,onPressIn:tR,onPressOut:tP,onHoverIn:tA,onHoverOut:tO,onMouseUp:tC,onMouseDown:tk,onMouseEnter:tx,onMouseLeave:tM,onFocus:tD,onBlur:tN,separator:tV,forceStyle:tF,onClick:tL,theme:tj,...tU}=tf,tB=tU;if(!e6&&eN.forceStyle&&(tB.forceStyle=eN.forceStyle),$&&tj&&(tB.theme=tj),te.acceptTagProp&&(tB.tag=e7),(e1?e3:e2)&&ej&&!$){let l=ej({props:tv,style:tg||{},presence:eK,componentState:eZ,styleProps:tu,theme:to.state?.theme,pseudos:tm||null,staticConfig:n,stateRef:e0});(eq||e1)&&l&&(ey=l.style,tB.style=ey,l.className&&(tB.className=`${tB.className||""} ${l.className}`))}e$&&(tU.onLayout=(0,el.composeEventHandlers)(tU.onLayout,n=>{e0.current.group.emit(e$,{layout:n.nativeEvent.layout}),e0.current.hasMeasured||"hide"!==eN.untilMeasured||eY(n=>({...n})),e0.current.hasMeasured=!0})),tB=eR.hooks.usePropsTransform?.(te,tU,e0,eU.willHydrate)||tU,eU.composedRef||(eU.composedRef=(0,eo.composeRefs)(n=>e0.current.host=n,et,eE.setElementProps)),tB.ref=eU.composedRef;let{pseudoGroups:t$,mediaGroups:tH}=tc,unPress=()=>eQ({press:!1,pressIn:!1});(0,eu.useEffect)(()=>{if(eB)return;if(!0===eZ.unmounted&&eW){eQ({unmounted:"should-enter"});return}if(eZ.unmounted){eQ({unmounted:!1});return}let n=subscribeToContextGroup({disabled:eB,componentContext:ew,setStateShallow:eQ,state:eZ,mediaGroups:tH,pseudoGroups:t$});return()=>{n?.(),eC.delete(eY)}},[eZ.unmounted,eB,t$?Object.keys([...t$]).join(""):0,tH?Object.keys([...tH]).join(""):0]);let tW=!eB&&e4&&tm?.pressStyle,tq=!eB&&e4&&tm?.focusStyle,tz=!eB&&e4&&tm?.focusVisibleStyle,tG=!!(tW||tq||tz||tD||tN),tK=!!(e$||tW||tT||tP||tR||tk||tC||tI||tL||tm?.focusVisibleStyle),tX=!eB&&e4&&tm?.hoverStyle,tY=!!(e$||tX||tA||tO),tQ=es.isWeb&&!!(e$||tY||tx||tM),tJ=!eB&&!eN.asChild&&!!(tG||tK||tQ||tW||tX||tq),tZ=!!(e$||tW),t0=tJ?{onPressOut:tK?n=>{unPress(),tP?.(n),tC?.(n)}:void 0,...(tQ||tK)&&{onMouseEnter:n=>{let l={};tY&&(l.hover=!0),tZ&&eZ.pressIn&&(l.press=!0),eQ(l),tA?.(n),tx?.(n)},onMouseLeave:n=>{let l={};tY&&(l.hover=!1),tZ&&eZ.pressIn&&(l.press=!1,l.pressIn=!1),eQ(l),tO?.(n),tM?.(n)}},onPressIn:tK?n=>{(tW||e$)&&eQ({press:!0,pressIn:!0}),tR?.(n),tk?.(n),es.isWeb&&eC.add(eY)}:void 0,onPress:tK?n=>{unPress(),es.isWeb&&tL?.(n),tT?.(n),tI?.(n)}:void 0,...tG&&{onFocus:n=>{tm?.focusVisibleStyle?setTimeout(()=>{eQ({focus:!0,focusVisible:!!ek.value})},0):eQ({focus:!0,focusVisible:!1}),tD?.(n)},onBlur:n=>{eQ({focus:!1,focusVisible:!1}),tN?.(n)}}}:null;t0&&!eM&&Object.assign(tB,getWebEvents(t0)),eR.hooks.useEvents?.(tB,t0,tc,eQ,n);let t1=eN.spaceDirection||"both",t2=!tE||tb?tE:spacedChildren({separator:tV,children:tE,space:ty,direction:t1,isZStack:j,debug:eV});if(tb){te=eP.Slot;{let n=getWebEvents({onPress:tT,onLongPress:tI,onPressIn:tR,onPressOut:tP,onMouseUp:tC,onMouseDown:tk,onMouseEnter:tx,onMouseLeave:tM},"web"===tb||"except-style-web"===tb);Object.assign(tB,n)}}eR.hooks.useChildren&&(eS=eR.hooks.useChildren(te,t2,tB,t0,n)),t2=eS||(0,eu.createElement)(te,tB,t2);let t3=u?.animations?.ResetPresence;t3&&e2&&(eW||eX)&&t2&&"string"!=typeof t2&&(t2=(0,eO.jsx)(t3,{children:t2}));let t5=eU.group,t4=(0,eu.useMemo)(()=>{if(!(!t5||!e$))return t5.listeners.clear(),{...ew.groups,state:{...ew.groups.state,[e$]:{pseudo:em.defaultComponentStateMounted,layout:{width:fromPx(tc.style?.width),height:fromPx(tc.style?.height)}}},emit:t5.emit,subscribe:t5.subscribe}},[e$]);if(e$&&t4&&(t2=(0,eO.jsx)(ep.ComponentContext.Provider,{...ew,groups:t4,children:t2})),t2=tt?t2:(0,eA.getThemedChildren)(to,t2,tn,!1,e0),eM&&!tb&&(t2=(0,eO.jsx)("span",{className:"_dsp_contents",...eG&&t0&&getWebEvents(t0),children:t2})),n.context){let l=n.context.props;for(let n in l)(tB.style&&n in tB.style||n in tB)&&((eh||={})[n]=tB.style?.[n]??tB[n])}if(eh){let l=n.context.Provider;t2=(0,eO.jsx)(l,{...eg,...eh,children:t2})}if(g.env.TAMAGUI_REACT_19){let{rulesToInsert:n}=tc,l=Object.keys(tc.rulesToInsert);l.length&&(t2=(0,eO.jsxs)(eO.Fragment,{children:[t2,l.map(l=>{let u=n[l],d=u[el.StyleObjectIdentifier];return(0,eO.jsx)("style",{href:`t_${d}`,precedence:"default",children:u[el.StyleObjectRules].join(`
`)},d)})]}))}return t2});n.componentName&&(et.displayName=n.componentName);let en=et;function extendStyledConfig(l){return{...n,...l,neverFlatten:!0,isHOC:!0,isStyledHOC:!1}}function styleable(n,l){let u=n.render?.length===2?n:(0,eu.forwardRef)(n),d=extendStyledConfig(l?.staticConfig);return u=l?.disableTheme?u:(0,eS.themeable)(u,d),g.env.TAMAGUI_MEMOIZE_STYLEABLE&&(u=(0,eu.memo)(u)),u.staticConfig=d,u.styleable=styleable,u}return(g.env.TAMAGUI_FORCE_MEMO||n.memo)&&(en=(0,eu.memo)(en)),en.staticConfig=n,en.extractable=function(n,l){return n.staticConfig=extendStyledConfig(l),n.styleable=styleable,n},en.styleable=styleable,en}function getWebEvents(n,l=!0){return{onMouseEnter:n.onMouseEnter,onMouseLeave:n.onMouseLeave,[l?"onClick":"onPress"]:n.onPress,onMouseDown:n.onPressIn,onMouseUp:n.onPressOut,onTouchStart:n.onPressIn,onTouchEnd:n.onPressOut,onFocus:n.onFocus,onBlur:n.onBlur}}function Unspaced(n){return n.children}es.isWeb&&globalThis.document&&(document.addEventListener("keydown",()=>{ek.value=!0}),document.addEventListener("mousedown",()=>{ek.value=!1}),document.addEventListener("mousemove",()=>{ek.value=!1})),Unspaced.isUnspaced=!0;let ex=createComponent({acceptsClassName:!0,memo:!0,componentName:"Spacer",validStyles:el.validStyles,defaultProps:{...eh.stackDefaultStyles,tag:"span",size:!0,pointerEvents:"none"},variants:{size:{"...":(n,{tokens:l})=>{n=!0===n?"$true":n;let u=l.space[n]??n;return{width:u,height:u,minWidth:u,minHeight:u}}},flex:{true:{flexGrow:1}},direction:{horizontal:{height:0,minHeight:0},vertical:{width:0,minWidth:0},both:{}}}});function spacedChildren(n){let{isZStack:l,children:u,space:d,direction:h,spaceFlex:f,separator:m,ensureKeys:g}=n,_=!!(d||f),j=null!=m,$=Array.isArray(u);if(!g&&!(_||j||l))return u;let z=$?u:eu.Children.toArray(u);if(z.length<=1&&!l&&!z[0]?.type?.shouldForwardSpace)return u;let ee=[];for(let[n,u]of z.entries()){let g=null==u||Array.isArray(u)&&0===u.length;if(!g&&eu.default.isValidElement(u)&&u.type?.shouldForwardSpace&&(u=eu.default.cloneElement(u,{space:d,spaceFlex:f,separator:m,key:u.key})),g||!u||u.key&&!l?ee.push(u):ee.push((0,eO.jsx)(eu.Fragment,{children:l?(0,eO.jsx)(eM,{children:u}):u},`${n}0t`)),isUnspaced(u)&&0===n||l)continue;let j=z[n+1];j&&!g&&!isUnspaced(j)&&(m?(_&&ee.push(createSpacer({key:`_${n}_00t`,direction:h,space:d,spaceFlex:f})),ee.push((0,eO.jsx)(eu.Fragment,{children:m},`${n}03t`)),_&&ee.push(createSpacer({key:`_${n}01t`,direction:h,space:d,spaceFlex:f}))):ee.push(createSpacer({key:`_${n}02t`,direction:h,space:d,spaceFlex:f})))}return ee}function createSpacer({key:n,direction:l,space:u,spaceFlex:d}){return(0,eO.jsx)(ex,{size:u,direction:l,..."u">typeof d&&{flex:!0===d?1:!1===d?0:d}},n)}function isUnspaced(n){let l=n?.type;return l?.isVisuallyHidden||l?.isUnspaced}let eM=createComponent({defaultProps:{...eh.stackDefaultStyles,flexDirection:"column",position:"absolute",top:0,right:0,bottom:0,left:0,pointerEvents:"box-none"}}),fromPx=n=>"string"!=typeof n?n:+n.replace("px",""),isDisabled=n=>n.disabled||n.accessibilityState?.disabled||n["aria-disabled"]||n.accessibilityDisabled||!1,subscribeToContextGroup=({disabled:n=!1,setStateShallow:l,pseudoGroups:u,mediaGroups:d,componentContext:h,state:f})=>{if(u||d){let n={pseudo:{},media:{}};return h.groups?.subscribe?.((h,{layout:m,pseudo:g})=>{if(g&&u?.has(String(h)))Object.assign(n.pseudo,g),persist();else if(m&&d){let l=eT.getMediaState(d,m),u=eg.mergeIfNotShallowEqual(n.media,l);u!==n.media&&(Object.assign(n.media,u),persist())}function persist(){let u={...f.group,[h]:n};l({group:u})}})}}},69473:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{createFont:()=>createFont}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=["100","200","300","400","500","600","700","800","900"],processSection=(n,l,u)=>{if("string"==typeof n)return n;let d=Object.keys(n),h=n[d[0]];return Object.fromEntries([...new Set([...l,...d])].map(l=>{let d=n[l]??u??h;return h=d,u=d,[l,d]}))},createFont=n=>{let l=Object.keys(n.size),u=Object.fromEntries(Object.entries(n).map(([u,d])=>[u,processSection(d,"face"===u?m:l,"face"===u?{normal:n.family}:void 0)]));return Object.freeze(u)}},64830:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function createShorthands(n){return Object.freeze(n)}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{createShorthands:()=>createShorthands}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f)},59008:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{createTamagui:()=>createTamagui}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(75769),$=u(14847),z=u(96807),ee=u(8546),et=u(50318),en=u(23956),eo=u(63426),es=u(29683),el=u(84166);u(98517);let eu=new WeakMap;function createTamagui(n){let l;if(eu.has(n))return n;let u={},d=(0,$.createVariables)(n.tokens||{});if(n.tokens){let n={};for(let l in d){u[l]={},n[l]={};let h=d[l];for(let d in h){let f=h[d],m=`$${d}`;u[l][m]=f,n[l][m]=f,n[l][d]=f}}(0,j.setTokens)(n)}if(n.themes){let d=0===Object.keys(n.themes).length;l=(0,ee.scanAllSheets)(d,u)}(0,ee.listenForSheetChanges)();let h=null,f;if(n.fonts){let l=Object.fromEntries(Object.entries(n.fonts).map(([n,l])=>[n,(0,$.createVariables)(l,"f",!0)]));f=(()=>{let n={};for(let u in l){let d=l[u],f=(0,el.parseFont)(d);n[`$${u}`]=f,!h&&f.size&&(h=new Set(Object.keys(f.size)))}return n})()}let m={},g=(()=>{let u=[],h=[],g={};for(let n in d)for(let l in d[n]){let u=d[n][l];m[`$${n}.${l}`]=u,_.isWeb&&((0,en.registerCSSVariable)(u),h.push((0,en.variableToCSS)(u,"zIndex"===n)))}if(_.isWeb){let declarationsToRuleSet=function(n,u=""){return`:root${u} {${l}${[...n].join(`;${l}`)}${l}}`};for(let n in f){let l=f[n],[u,d]=n.includes("_")?n.split("_"):[n],h=(0,el.registerFontVariables)(l);g[n]={name:u.slice(1),declarations:h,language:d}}let l=n.cssStyleSeparator||"";if(u.push(declarationsToRuleSet(h)),g)for(let n in g){let{name:l,declarations:d,language:h="default"}=g[n],f=`.font_${l}`,m=`:root .t_lang-${l}-${h} ${f}`,_="default"===h?` ${f}, ${m}`:m,j=declarationsToRuleSet(d,_);u.push(j)}}let j={...n.themes},$=l??function(n){let l=[],u=new Map;for(let d in n){let h=d.startsWith("dark")?"dark":d.startsWith("light")?"light":"",f=n[d],m=h+JSON.stringify(f);if(u.has(m)){u.get(m).names.push(d);continue}let g={...f};for(let n in g)(0,eo.ensureThemeVariable)(g,n);let _={names:[d],theme:g};l.push(_),u.set(m,_)}return l}(j);return{themes:(0,et.proxyThemesToParents)($),cssRuleSets:u,getThemeRulesSets(){let l=[];if(_.isWeb)for(let{names:u,theme:d}of $){let h=(0,z.getThemeCSSRules)({config:n,themeName:u[0],names:u,theme:d});l=[...l,...h]}return l}}})(),ec=n.shorthands||{},eh=-1,getCSS=(n={})=>{let{separator:l=`
`,sinceLastCall:u,exclude:d}=n;if(u&&eh>=0){let n=(0,ee.getAllRules)();return eh=n.length,n.slice(eh).join(l)}eh=0;let h=(0,ee.getAllRules)().join(l);return"design-system"===d?h:`._ovs-contain {overscroll-behavior:contain;}
.is_Text .is_Text {display:inline-flex;}
._dsp_contents {display:contents;}
${g.cssRuleSets.join(l)}
${d?"":g.getThemeRulesSets().join(l)}
${h}`},ep=(n.settings?.defaultFont??n.defaultFont)||n.fonts&&("body"in n.fonts?"body":"");!ep&&n.fonts&&(ep=Object.keys(n.fonts)[0]),ep?.[0]==="$"&&(ep=ep.slice(1));let ef=`$${ep}`,em={fonts:{},onlyAllowShorthands:!1,fontLanguages:[],animations:{},media:{},...n,unset:{fontFamily:ep?ef:void 0,...n.unset},settings:{webContainerType:"inline-size",...n.settings},tokens:d,shorthands:ec,inverseShorthands:ec?Object.fromEntries(Object.entries(ec).map(([n,l])=>[l,n])):{},themes:g.themes,fontsParsed:f||{},themeConfig:g,tokensParsed:u,parsed:!0,getNewCSS:n=>getCSS({...n,sinceLastCall:!0}),getCSS,defaultFont:ef,fontSizeTokens:h||new Set,specificTokens:m};return(0,j.setConfig)(em),(0,es.configureMedia)(em),eu.set(em,!0),j.configListeners.size&&(j.configListeners.forEach(n=>n(em)),j.configListeners.clear()),em}},84022:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{createTheme:()=>createTheme}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let createTheme=n=>n},55624:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{createTokens:()=>createTokens}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(14847);function createTokens(n){return(0,_.createVariables)(n)}},2754:function(n,l,u){var d=u(34406),h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{createCSSVariable:()=>createCSSVariable,createVariable:()=>createVariable,didGetVariableValue:()=>didGetVariableValue,getVariable:()=>getVariable,getVariableName:()=>getVariableName,getVariableValue:()=>getVariableValue,getVariableVariable:()=>getVariableVariable,isVariable:()=>isVariable,setDidGetVariableValue:()=>setDidGetVariableValue,variableToString:()=>variableToString}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_);var j=u(35213),$=u(19047),z=u(75769);function constructCSSVariableName(n){return`var(--${d.env.TAMAGUI_CSS_VARIABLE_PREFIX||""}${n})`}let createVariable=(n,l=!1)=>{if(!l&&isVariable(n))return n;let{key:u,name:d,val:h}=n;return{isVar:!0,key:u,name:l?d:(0,$.simpleHash)(d,40),val:h,variable:j.isWeb?l?constructCSSVariableName(d):createCSSVariable(d):""}};function variableToString(n,l=!1){return isVariable(n)?!l&&j.isWeb&&n.variable?n.variable:`${n.val}`:`${n||""}`}function isVariable(n){return n&&"object"==typeof n&&"isVar"in n}function getVariable(n,l="size"){if(setDidGetVariableValue(!0),isVariable(n))return variableToString(n);let u=(0,z.getConfig)().tokensParsed;return variableToString(u[l]?.[n]??n)}let ee=!1,setDidGetVariableValue=n=>ee=n,didGetVariableValue=()=>ee;function getVariableValue(n,l){if(isVariable(n))return setDidGetVariableValue(!0),n.val;if(l){let u=z.getConfig().tokensParsed[l]?.[n];if(u)return setDidGetVariableValue(!0),u.val}return n}function getVariableName(n){return isVariable(n)?n.name:n}function getVariableVariable(n){return isVariable(n)?n.variable:n}let createCSSVariable=(n,l=!0)=>{let u=(0,$.simpleHash)(n,60);return l?constructCSSVariableName(u):u}},14847:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{createVariables:()=>createVariables}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(19047),j=u(2754);let $=new WeakMap,createVariables=(n,l="",u=!1)=>{if($.has(n))return n;let d={},h=0;for(let f in n){h++;let m=n[f],g="$"===f[0],$=g?f:`$${f}`,z=g?$.slice(1):f;if((0,j.isVariable)(m)){d[z]=m;continue}let ee=(0,_.simpleHash)(z),et=u?ee.slice(0,2):h;if(et=l?`${l}-${et}`:ee,m&&"object"==typeof m){d[z]=createVariables(n[z],et,!1);continue}let en=(0,j.isVariable)(m)?m:(0,j.createVariable)({val:m,name:et,key:$});d[z]=en}return $.set(d,!0),d}},27419:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{defaultComponentState:()=>m,defaultComponentStateMounted:()=>g,defaultComponentStateShouldEnter:()=>_}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={hover:!1,press:!1,pressIn:!1,focus:!1,focusVisible:!1,unmounted:!0,disabled:!1},g={...m,unmounted:!1},_={...m,unmounted:"should-enter"}},47326:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ThemeManager:()=>ThemeManager,getHasThemeUpdatingProps:()=>getHasThemeUpdatingProps,getManagers:()=>getManagers}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(75769),$=u(57239);let z={name:""};function getHasThemeUpdatingProps(n){return!!(n.name||n.componentName||n.inverse||n.reset)}let ee=0;let ThemeManager=class ThemeManager{constructor(n={},l){if(this.props=n,ee=(ee+1)%Number.MAX_VALUE,this.id=ee,"root"===l){this.updateStateFromProps(n,!1);return}if(!l)throw"❌ 000";if(this.parentManager=l,!this.updateStateFromProps(n,!1))return l}id=0;themeListeners=new Set;parentManager=null;state=z;updateStateFromProps(n=this.props||{},l=!0){if(this.props=n,n.forceTheme)return this.state.theme=n.forceTheme,this.state.name=n.name||"",this.updateState(this.state,!0),this.state;let u=this.getStateIfChanged(n);if(u)return this.updateState(u,l),u}updateState(n,l=!0){this.state=n,this._allKeys=null,l&&queueMicrotask(()=>{this.notify()})}getStateIfChanged(n=this.props,l=this.state,u=this.parentManager){let d=this.getState(n,u);return l&&l!==z&&!d?u?.state:this.getStateShouldChange(d,l)?d:void 0}getStateShouldChange(n,l=this.state){return!(!n?.theme||n.theme===l?.theme)}getState(n=this.props,l=this.parentManager){return function(n,l){if(n.name&&n.reset)throw Error("❌004");if(!getHasThemeUpdatingProps(n))return null;let u=(0,j.getThemes)(),[d,h]=getManagers(l),f=!!l?.state.isComponent,m=n.reset&&!f?1:0,g=d[m],z=d[m+1];if(!g&&n.reset)return null;let{componentName:ee}=n,et=null,en=g?.state.name||"";g?.state.isComponent&&(en=en.replace(/_[A-Z][A-Za-z]+/,""));let eo=n.reset?en:n.name||"",es=h.map(n=>n?.state.name||"");f&&es.shift();let el=en.split($.THEME_NAME_SEPARATOR),eu=el.length,ec=n.componentName&&!eo?eu:0;for(let l=eu;l>=ec;l--){let d=el.slice(0,l).join($.THEME_NAME_SEPARATOR);n.inverse&&(d=inverseThemeName(d));let h=[];if(d&&d!==en&&d.includes(eo)&&h.push(d),eo&&h.unshift(d?`${d}_${eo}`:eo),1===l){let n=h.findIndex(n=>!n.includes("_"));n>0&&h.splice(n,0,eo)}if(ee&&!n.reset){let n=el.length,u=[];if(eo&&n>1){let n=el[0];u.push(`${n}_${eo}_${ee}`)}if(u.push(`${d}_${ee}`),eo){if(l>n){let n=el.slice(0,l-1).join($.THEME_NAME_SEPARATOR);if(n){let l=`${n}_${eo}_${ee}`;u.unshift(l)}}let h=`${d}_${eo}_${ee}`;u.unshift(h)}h=[...u,...h,...es]}let f=h.find(n=>n in u);if(f){let n=f.split("_"),[l,...d]=n,h=n[n.length-1],m=h[0]===h[0].toUpperCase(),j="light"===l?"light":"dark"===l?"dark":void 0,ee=$.THEME_CLASSNAME_PREFIX,en=_.isWeb?`${ee}sub_theme ${ee}${j&&d.length?d.join("_"):l}`:"",eo=(g||z)?.state?.name;et={name:f,parentName:eo,theme:u[f],className:en,isComponent:m,scheme:j};break}}return et}(n,l)||null}_allKeys=null;get allKeys(){return this._allKeys||=new Set([...this.parentManager?.allKeys||[],...Object.keys(this.state.theme||{})]),this._allKeys}notify(n=!1){this.themeListeners.forEach(l=>l(this.state.name,this,n))}onChangeTheme(n,l){return this.themeListeners.add(n),()=>{this.themeListeners.delete(n)}}};let inverseThemeName=n=>n.startsWith("light")?n.replace(/^light/,"dark"):n.replace(/^dark/,"light");function getManagers(n){let l=[],u=[],d=n;for(;d;)u.push(d),d.state.isComponent&&l.push(d),d=d.parentManager;return[u,l]}},38116:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ThemeManagerIDContext:()=>j}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);let j=(0,_.createContext)(1)},449:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{MEDIA_SEP:()=>z,createMediaStyle:()=>createMediaStyle}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(75769),j=u(29683),$=u(89682);let z="_",ee=null,et=null,en={press:"active"},eo=[,,,,,].fill(0).map((n,l)=>Array(l).fill(":root").join("")),createMediaStyle=(n,l,u,d,h,f)=>{let[m,,g,,es]=n,el=(0,_.getSetting)("mediaPropOrder"),eu="theme"===d,ec="platform"===d,eh="group"===d,ep=eu||ec||eh,ef=g.slice(0,g.indexOf("-")+1),em=`${ef}${z}${l.replace("-","")}${h?"0":""}${z}`,eg="",e_,ey,ev=g.replace(ef,em),eE=es.map(n=>n.replace(g,ev)).join(";"),eS=!1;if(ep){let n=(f||0)+(eh||ec?1:0);if(eu||eh){let{name:u,media:d,pseudo:h}=(0,$.getGroupPropParts)(l);e_=d;let f=(0,$.getGroupPropParts)(l);eh&&(ey=u),"press"===h&&(n+=2),"hover"===h&&(eS=!0);let[m,g]=function(n,l,u,d,h=!1,f=""){let m=l.indexOf(":root"),g=l.lastIndexOf("{"),j=l.slice(m,g),$=(0,_.getSetting)("themeClassNameOnRoot")&&h?"":" ",z=d.pseudo?en[d.pseudo]||d.pseudo:void 0,ee=z?`:${z}`:"",et=`:root${f}${$}`,eo=`.t_${u?"group_":""}${n}${ee}`;return[j,`${et}${eo} ${j.replace(":root","")}`]}(u,eE,eh,f,eu,eo[n]);eg=eE.replace(m,g)}else eg=`${eo[n]}${eE}`}if(!ep||e_){if(!et){let n=Object.keys(u);et=Object.fromEntries(n.map(n=>[n,(0,j.mediaObjectToString)(u[n])])),el||(ee=Object.fromEntries(n.map((n,l)=>[n,Array(l+1).fill(":root").join("")])))}let n=e_||l,d=et[n],m=`${h?"not all and ":""}${d}`,g=e_?"":el&&f?eo[f]:ee[n],$=e_?`@container ${ey}`:"@media";e_&&(eE=eg),eg=eE.includes($)?eE.replace("{",` and ${m} {`).replace("and screen and","and"):`${$} ${m}{${g}${eE}}`,e_&&(eg=`@supports (contain: ${(0,_.getSetting)("webContainerType")||"inline-size"}) {${eg}}`)}return eS&&(eg=`@media (hover:hover){${eg}}`),[m,void 0,ev,void 0,[eg]]}},52807:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{createShallowSetState:()=>createShallowSetState,isEqualShallow:()=>isEqualShallow,mergeIfNotShallowEqual:()=>mergeIfNotShallowEqual}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);let callImmediate=n=>n();function createShallowSetState(n,l,u,d){return h=>{(u?_.startTransition:callImmediate)(()=>{n(n=>mergeIfNotShallowEqual(n,h,l,d))})}}function mergeIfNotShallowEqual(n,l,u,d){return u||!n||!l||isEqualShallow(n,l)?n||l:{...n,...l}}function isEqualShallow(n,l){for(let u in l)if(n[u]!==l[u])return!1;return!0}},39947:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{createStyledContext:()=>createStyledContext}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(6780),$=u(52322);function createStyledContext(n){let l=(0,_.createContext)(n),u=l.Provider,d=new Map;return l.Provider=({children:l,scope:h,...f})=>{let m=(0,_.useMemo)(()=>({...n,...f}),[(0,j.objectIdentityKey)(f)]),g=u;if(h){let l=d.get(h);l||(l=(0,_.createContext)(n),d.set(h,l)),g=l.Provider}return(0,$.jsx)(g,{value:m,children:l})},l.props=n,l.context=l,l.useStyledContext=n=>{let u=n?d.get(n):l;return(0,_.useContext)(u)},l}},92235:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{defaultOffset:()=>m}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={height:0,width:0}},29152:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{expandStyle:()=>expandStyle}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(91529),$=u(75769);let z=[["flexGrow",0],["flexShrink",1],["flexBasis","auto"]];function expandStyle(n,l){if("flex"===n)return -1===l?z:[["flexGrow",l],["flexShrink",1],["flexBasis","react-native"===(0,$.getConfig)().settings.styleCompat?0:"auto"]];switch(n){case"textAlignVertical":return[["verticalAlign","center"===l?"middle":l]];case"writingDirection":return[["direction",l]]}return n in es?es[n].map(n=>[n,l]):n in j.webToNativeExpansion?j.webToNativeExpansion[n].map(n=>[n,l]):n in j.webToNativeDynamicExpansion?j.webToNativeDynamicExpansion[n](l):void 0}let ee=["Top","Right","Bottom","Left"],et=["Right","Left"],en=["Top","Bottom"],eo=["X","Y"],es={borderColor:["TopColor","RightColor","BottomColor","LeftColor"],borderRadius:["TopLeftRadius","TopRightRadius","BottomRightRadius","BottomLeftRadius"],borderWidth:["TopWidth","RightWidth","BottomWidth","LeftWidth"],margin:ee,marginHorizontal:et,marginVertical:en,overscrollBehavior:eo,padding:ee,paddingHorizontal:et,paddingVertical:en,..._.isWeb&&{borderStyle:["TopStyle","RightStyle","BottomStyle","LeftStyle"],overflow:eo}};for(let n in es){let l=n.slice(0,/[A-Z]/.exec(n)?.index??n.length);es[n]=es[n].map(n=>`${l}${n}`)}},69494:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{fixStyles:()=>fixStyles}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(71030);function fixStyles(n){for(let l in(null!=n.shadowRadius||n.shadowColor||null!=n.shadowOpacity||n.shadowOffset)&&Object.assign(n,(0,j.normalizeShadow)(n)),z)l in n&&(n[z[l]]||="solid")}let $=_.isWeb?null:"borderStyle",z={borderWidth:"borderStyle",borderBottomWidth:$||"borderBottomStyle",borderTopWidth:$||"borderTopStyle",borderLeftWidth:$||"borderLeftStyle",borderRightWidth:$||"borderRightStyle"}},68885:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{getExpandedShorthands:()=>getExpandedShorthands}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(75769);function getExpandedShorthands(n){let l=(0,_.getConfig)().shorthands;if(!l)return n;let u={};for(let d in n)u[l[d]||d]=n[d];return u}},89682:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{getGroupPropParts:()=>getGroupPropParts}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(29683);function getGroupPropParts(n){let l=(0,_.getMedia)(),[u,d,h,f]=n.split("-"),m=h in l?h:void 0;return{name:d,pseudo:m?f:h,media:m}}},68359:function(n,l,u){let d;var h=u(34406),f=Object.defineProperty,m=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,_=Object.prototype.hasOwnProperty,j={};((n,l)=>{for(var u in l)f(n,u,{get:l[u],enumerable:!0})})(j,{PROP_SPLIT:()=>eE,getSplitStyles:()=>getSplitStyles,getSubStyle:()=>getSubStyle,useSplitStyles:()=>useSplitStyles}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of g(l))_.call(n,u)||void 0===u||f(n,u,{get:()=>l[u],enumerable:!(d=m(l,u))||d.enumerable});return n})(f({},"__esModule",{value:!0}),j);var $=u(35213),z=u(19047),ee=u(2784),et=u(75769),en=u(32149),eo=u(57239),es=(u(76394),u(29683)),el=u(449),eu=u(69494),ec=u(89682),eh=u(2805),ep=u(8546),ef=(u(87296),u(19631)),em=u(97217),eg=u(19097),e_=u(78823),ey=u(15971),ev=u(75038);$.isWeb;let eE="-";function isValidStyleKey(n,l){return(l.validStyles||(l.isText||l.isInput?z.stylePropsText:z.validStyles))[n]||l.accept?.[n]}let getSplitStyles=(n,l,u,h,f,m,g,_,j,ee,eS)=>{d=d||(0,et.getConfig)(),$.isWeb&&m.isAnimated&&d.animations.isReactNative&&!m.noNormalize&&(m.noNormalize="values");let{shorthands:ew}=d,{isHOC:eT,isText:eI,isInput:eP,variants:eA,isReactNative:eO,inlineProps:eC,inlineWhenUnflattened:ek,parentStaticConfig:ex,acceptsClassName:eM}=l,eD={},eN=m.mediaState||es.mediaState,eV={},eF=eM&&$.isWeb&&!m.noClassNames,eL={},ej={},eU={},eB=null,e$=n.space,eH=!1,eW,eq,ez,eG=(n.className,0),eK,eX={get curProps(){return eK||={}},classNames:ej,conf:d,props:n,styleProps:m,componentState:f,staticConfig:l,style:null,theme:u,usedKeys:eV,viewProps:eD,context:_,debug:ee,skipThemeTokenResolution:eS},{asChild:eY}=n,{accept:eQ}=l,{noSkip:eJ,disableExpandShorthands:eZ,noExpand:e0}=m,{webContainerType:e1}=d.settings,e2=ex?.variants;for(let u in n){let g=u,$=n[g];if(eQ){let n=eQ[g];if(("style"===n||"textStyle"===n)&&$&&"object"==typeof $){eD[g]=getSubStyle(eX,g,$,m.noClassNames);continue}}if(eZ||g in ew&&(g=ew[g]),"className"===g||g in eV||eY&&eo.webViewFlexCompatStyles[g]===$)continue;if(g in e_.skipProps&&!eJ&&!eT){if("group"===g){let n=`t_group_${$}`,l=["continer",void 0,n,void 0,[`.${n} { container-name: ${$}; container-type: ${e1||"inline-size"}; }`]];addStyleToInsertRules(eL,l)}continue}let ee=typeof $,et=isValidStyleKey(g,l);if(et&&"string"===ee&&"_"===$[0]){let n=g in z.validStyles,l=!n&&g.includes(eE)&&z.validStyles[g.split(eE)[0]];if(n||l){eF?(mergeClassName(eU,ej,g,$,l),eX.style&&delete eX.style[g]):(eX.style||={},eX.style[g]=(0,ef.reverseMapClassNameToValue)(g,$),delete ej[g]);continue}}if("dataSet"===g){for(let n in $)eD[`data-${hyphenate(n)}`]=$[n];continue}if(!e0){if("disabled"===g&&!0===$&&(eD["aria-disabled"]=!0,("button"===j||"form"===j||"input"===j||"select"===j||"textarea"===j)&&(eD.disabled=!0),!eA?.disabled))continue;if("testID"===g){eD[eO?g:"data-testid"]=$;continue}if("id"===g||"nativeID"===g){eD.id=$;continue}let n=!1;if(eO){if(g in en.accessibilityDirectMap||g.startsWith("accessibility")){eD[g]=$;continue}}else{if(n=!0,g in en.accessibilityDirectMap){eD[en.accessibilityDirectMap[g]]=$;continue}switch(g){case"accessibilityRole":"none"===$?eD.role="presentation":eD.role=eR[$]||$;continue;case"accessibilityLabelledBy":case"accessibilityFlowTo":case"accessibilityControls":case"accessibilityDescribedBy":eD[`aria-${g.replace("accessibility","").toLowerCase()}`]=Array.isArray($)?$.join(" "):$;continue;case"accessibilityKeyShortcuts":Array.isArray($)&&(eD["aria-keyshortcuts"]=$.join(" "));continue;case"accessibilityLiveRegion":eD["aria-live"]="none"===$?"off":$;continue;case"accessibilityReadOnly":eD["aria-readonly"]=$,("input"===j||"select"===j||"textarea"===j)&&(eD.readOnly=!0);continue;case"accessibilityRequired":eD["aria-required"]=$,("input"===j||"select"===j||"textarea"===j)&&(eD.required=$);continue;default:n=!1}}if(n)continue}let eu=g in ew,ep=!et&&eA&&g in eA,ey=eu||et||ep,eS=g in z.validPseudoKeys,ek=!ey&&!eS&&(0,es.isMediaKey)(g),eM=!!(ek||eS);if(eM&&g.startsWith("$group-")){let n=g.split("-")[1];_?.groups.subscribe&&!_?.groups.state[n]&&(g=g.replace("$group-","$group-true-"))}let eK=et||eM||ep&&!e0||eu;if(eK&&("except-style"===eY||"except-style-web"===eY))continue;let e3=!eK||eT&&e2&&g in e2||eC?.has(g),e5=e2?.[g],e4=!!(eT&&(eu||et||eM||e5||g in e_.skipProps)),e9=e3||e4;if(e9&&(passDownProp(eD,g,$,eM),!ep)||!eJ&&g in e_.skipProps)continue;(eI||eP)&&$&&("fontFamily"===g||g===ew.fontFamily)&&$ in d.fontsParsed&&(eX.fontFamily=$);let e6=eM||!ep&&!et,e7=e6?null:(0,em.propMapper)(g,$,eX);if(!e6){if(!e7)continue;let n=(0,em.getPropMappedFontFamily)(e7);n&&(eX.fontFamily=n)}let e8=g,te=$,tt=e7?e7.length:1;for(let u=0;u<tt;u++){if(e7){let[n,l]=e7[u];e8=n,te=l}if(null!=te&&!(e8 in eV)){if(eM=!!((ek=!(eS=e8 in z.validPseudoKeys)&&!et&&(0,es.isMediaKey)(e8))||eS),ep=eA&&e8 in eA,eC?.has(e8)&&(eD[e8]=n[e8]??te),m.noExpand&&eS||eT&&(eM||ex?.variants?.[g])){passDownProp(eD,e8,te,eM);continue}if(eS){if(!te)continue;let n=getSubStyle(eX,e8,te,m.noClassNames),l=eg.pseudoDescriptors[e8],u="enterStyle"===e8,d="exitStyle"===e8;if(!l)continue;if(eF||(eB||={},eB[e8]||={}),eF&&!d){let u=(0,eh.getStyleAtomic)(n,l);for(let n of u){let u=`${n[z.StyleObjectProperty]}${eE}${l.name}`;u in eV||(addStyleToInsertRules(eL,n),mergeClassName(eU,ej,u,n[z.StyleObjectIdentifier],eM,!0))}}if(!eF||d||u){let h=l.stateKey||l.name,g=!1===f[h];d&&(g=!m.isExiting),u&&!1===f.unmounted&&(g=!0);let _=l.priority;for(let l in n){let u=n[l];if(g)applyDefaultStyle(l,eX);else{let n=eV[l]||0,d=_>=n;d&&(eB||={},eB[e8]||={},eB[e8][l]=u,mergeStyle(eX,l,u))}}if(!g)for(let n in te){let l=ew[n]||n;eV[l]=Math.max(_,eV[l]||0)}}continue}if(ek){if(!te)continue;let n=te.space,l=e8.slice(1);if(eH||=!0,(n||!eF||m.willBeAnimated)&&("object"!=typeof eH&&(eH={}),eH[l]=!0),"platform"===ek&&!(0,ev.isActivePlatform)(e8))continue;if(eF){let u=getSubStyle(eX,e8,te,!1);if(n&&(delete u.space,eN[l])){let n=(0,es.getMediaImportanceIfMoreImportant)(l,"space",eV,!0);n&&(e$=te.space,eV.space=n)}let d=(0,eh.getStylesAtomic)(u),h=eG;for(let n of(eG+=1,d)){let u=n[0];if("$"===u[0]&&u.startsWith("$platform")&&!(0,ev.isActivePlatform)(u))continue;let d=(0,el.createMediaStyle)(n,l,es.mediaQueryConfig,ek,!1,h),f=`${n[z.StyleObjectProperty]}${eE}${l}${n[z.StyleObjectPseudo]||""}`;f in eV||(addStyleToInsertRules(eL,d),mergeClassName(eU,ej,f,d[z.StyleObjectIdentifier],!0,!0))}}else{let mergeMediaStyle=function(n,u){eX.style||={},function(n,l,u,d,h,f,m,g){let _=(0,es.getMediaImportanceIfMoreImportant)(l,u,h,f);if(m&&(_=(_||0)+m),null===_)return!1;if(h[u]=_,u in eg.pseudoDescriptors){let l=eg.pseudoDescriptors[u],h=l.stateKey||l.name;if(!1===n.componentState[h])return!1;for(let l in d)mergeStyle(n,l,d[l])}else mergeStyle(n,u,d);return!0}(eX,l,n,u,eV,eN[l],m,0)&&"fontFamily"===n&&(eX.fontFamily=d.fontFamily)},n="theme"===ek,u="group"===ek;if(!n&&"platform"!==ek&&!u&&!eN[l])continue;let d=getSubStyle(eX,e8,te,!0),m=0;if(n){eW=!0;let n=l.slice(6);if(!(h===n||h.startsWith(n)))continue}else if(u){let n=(0,ec.getGroupPropParts)(l),u=n.name,h=_?.groups.state[u];if(!h)continue;let g=n.pseudo,j=n.media,$=f.group?.[u];if(j){(ez||=new Set).add(j);let n=$?.media,l=n?.[j];if(!n&&h.layout&&(l=(0,es.mediaKeyMatch)(j,h.layout)),!l){for(let n in d)applyDefaultStyle(n,eX);continue}m=2}if(g){(eq||=new Set).add(u);let n=($||_.groups.state[u]).pseudo?.[g],l=eg.pseudoPriorities[g];if(!n){for(let n in d)applyDefaultStyle(n,eX);continue}m=l}}for(let n in d){if("space"===n){e$=$.space;continue}if("$"===n[0]){if(!(0,ev.isActivePlatform)(n))continue;for(let l in d[n])mergeMediaStyle(l,d[n][l])}else mergeMediaStyle(n,d[n])}}continue}if(!eT&&isValidStyleKey(e8,l)){mergeStyle(eX,e8,te);continue}ep||(eD[e8]=te)}}}if(!1!==m.noNormalize&&(eX.style&&((0,eu.fixStyles)(eX.style),$.isWeb&&!eO&&(0,eh.styleToCSS)(eX.style)),eX.flatTransforms&&(eX.style||={},Object.entries(eX.flatTransforms).sort(([n],[l])=>n.localeCompare(l)).forEach(([n,l])=>{mergeTransform(eX.style,n,l,!0)})),g)){if(eF)for(let n in g.classNames){let l=g.classNames[n];eX.style&&n in eX.style||n in ej||(ej[n]=l)}if(!eF)for(let n in g.style)n in ej||eX.style&&n in eX.style||(eX.style||={},eX.style[n]=g.style[n])}if(!m.noNormalize&&!l.isReactNative&&!l.isHOC&&(!m.isAnimated||d.animations.supportsCSSVars)&&Array.isArray(eX.style?.transform)&&(eX.style.transform=(0,ey.transformsToString)(eX.style.transform)),eX.style&&eF){let l;if(!eX.style.$$css){let u=(0,eh.getStylesAtomic)(eX.style);for(let d of u){let[u,h,f]=d,g=m.isAnimated&&m.noClassNames&&(!n.animateOnly||n.animateOnly.includes(u)),_=!g&&!m.isAnimated&&n.animateOnly?.includes(u);g?(l||={})[u]=eX.style[u]:_?(l||={})[u]=h:(addStyleToInsertRules(eL,d),mergeClassName(eU,ej,u,f,!1,!0))}eX.style=l||{}}if(eU)for(let n in eU){if(!eU[n])continue;let[l,u]=eU[n],d=`_transform${l}`;if($.isClient&&!ep.insertedTransforms[d]){let l=`.${d} { transform: ${u}; }`;addStyleToInsertRules(eL,[n,u,d,void 0,[l]])}ej[n]=d}}if(eO)0===eD.tabIndex&&(eD.accessible??=!0);else if(null==eD.tabIndex){let l=eD.focusable??eD.accessible;eD.focusable&&delete eD.focusable;let u=eD.role;!1===l&&(eD.tabIndex="-1"),"a"===j||"button"===j||"input"===j||"select"===j||"textarea"===j?(!1===l||!0===n.accessibilityDisabled)&&(eD.tabIndex="-1"):("button"===u||"checkbox"===u||"link"===u||"radio"===u||"textbox"===u||"switch"===u)&&!1!==l&&(eD.tabIndex="0"),l&&(eD.tabIndex="0",delete eD.focusable)}let e3=n.style;if(e3){if(eT)eD.style=normalizeStyle(e3);else{let n=Array.isArray(e3),l=n?e3.length:1;for(let u=0;u<l;u++){let l=n?e3[u]:e3;l&&(l.$$css?Object.assign(eX.classNames,l):(eX.style||={},Object.assign(eX.style,normalizeStyle(l))))}}}let e5={space:e$,hasMedia:eH,fontFamily:eX.fontFamily,viewProps:eD,style:eX.style,pseudos:eB,classNames:ej,rulesToInsert:eL,dynamicThemeAccess:eW,pseudoGroups:eq,mediaGroups:ez};if(!("except-style"===eY||"except-style-web"===eY)){let u=eX.style;{let h=eI||eP?eX.fontFamily||l.defaultProps?.fontFamily:null;h&&"$"===h[0]&&(h=h.slice(1));let f=h?`font_${h}`:"",g=n.group?`t_group_${n.group}`:"",_=n.componentName||l.componentName,j=n.asChild||!_?"":`is_${_}`,$=[];j&&$.push(j),f&&$.push(f),ej&&$.push(Object.values(ej).join(" ")),g&&$.push(g),n.className&&$.push(n.className);let z=$.join(" ");if(m.noMergeStyle)z&&(eD.className=z);else if(m.isAnimated&&!d.animations.supportsCSSVars&&eO)u&&(eD.style=u);else if(eO){let n={$$css:!0};for(let l of z.split(" "))n[l]=l;eD.style=[...Array.isArray(u)?u:[u],n]}else z&&(eD.className=z),u&&(eD.style=u)}}return e5};function mergeClassName(n,l,u,d,h=!1,f=!1){if(d){if(!f&&"_"===d[0]&&d.startsWith("_transform-")){let l=h?u:"transform",f=ep.insertedTransforms[d];!$.isClient||f||((0,ep.scanAllSheets)(),(f=ep.insertedTransforms[d])||!$.isWeb||"_"===d[0]||(f=d)),n[l]||=["",""],n[l][0]+=d.replace("_transform",""),f&&(n[l][1]+=f)}else l[u]=d}}function mergeStyle(n,l,u,d=!1){let{classNames:h,viewProps:f,usedKeys:m,styleProps:g,staticConfig:_}=n;if($.isWeb&&u?.[0]==="_")h[l]=u,m[l]||=1;else if(l in z.stylePropsTransform)n.flatTransforms||={},n.flatTransforms[l]=u;else{let h=!$.isWeb||d||g.noNormalize?u:(0,ef.normalizeValueWithProperty)(u,l);_.accept&&l in _.accept?f[l]=h:(n.style||={},n.style[l]=h)}}let getSubStyle=(n,l,u,d)=>{let{staticConfig:h,props:f,conf:m,styleProps:g}=n,_={};for(let j in u){let $=u[j];j=m.shorthands[j]||j;let ee=(0,em.propMapper)(j,$,n,{...f,...f[l]});if(!(!ee||!h.isHOC&&j in e_.skipProps&&!g.noSkip))for(let[n,l]of ee)!d&&n in z.stylePropsTransform?mergeTransform(_,n,l):_[n]=g.noNormalize?l:(0,ef.normalizeValueWithProperty)(l,j)}return g.noNormalize||(0,eu.fixStyles)(_),_},eS=$.isWeb?ee.useInsertionEffect||$.useIsomorphicLayoutEffect:()=>{},useSplitStyles=(n,l,u,f,m,g,_,j,$,z)=>{d=d||(0,et.getConfig)();let ee=getSplitStyles(n,l,u,f,m,g,_,j,$,z);return h.env.TAMAGUI_REACT_19||eS(()=>{(0,ep.insertStyleRules)(ee.rulesToInsert)},[ee.rulesToInsert]),ee};function addStyleToInsertRules(n,l){{let u=l[z.StyleObjectIdentifier];h.env.TAMAGUI_REACT_19||(0,ep.shouldInsertStyleRules)(u)&&(0,ep.updateRules)(u,l[z.StyleObjectRules]),n[u]=l}}let ew=h.env.TAMAGUI_DEFAULT_COLOR||"rgba(0,0,0,0)",eT={...Object.fromEntries(Object.entries(z.tokenCategories.color).map(([n,l])=>[n,ew])),opacity:1,scale:1,rotate:"0deg",rotateY:"0deg",rotateX:"0deg",x:0,y:0,borderRadius:0},lowercaseHyphenate=n=>`-${n.toLowerCase()}`,hyphenate=n=>n.replace(/[A-Z]/g,lowercaseHyphenate),mergeTransform=(n,l,u,d=!1)=>{"string"!=typeof n.transform&&(n.transform||=[],n.transform[d?"unshift":"push"]({[eI[l]||l]:u}))},eI={x:"translateX",y:"translateY"},eR={adjustable:"slider",header:"heading",image:"img",link:"link",none:"presentation",summary:"region"};function passDownProp(n,l,u,d=!1){if(d){let d={...n[l],...u};delete n[l],n[l]=d}else n[l]=u}function normalizeStyle(n){let l={};for(let u in n){let d=n[u];u in z.stylePropsTransform?mergeTransform(l,u,d):l[u]=(0,ef.normalizeValueWithProperty)(d,u)}return $.isWeb&&Array.isArray(l.transform)&&(l.transform=(0,ey.transformsToString)(l.transform)),(0,eu.fixStyles)(l),l}function applyDefaultStyle(n,l){let u=eT[n];null==u||n in l.usedKeys||l.style&&n in l.style||mergeStyle(l,n,u)}},2805:function(n,l,u){let d;var h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{getStyleAtomic:()=>getStyleAtomic,getStylesAtomic:()=>getStylesAtomic,styleToCSS:()=>styleToCSS}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_);var j=u(19047),$=u(75769),z=u(92235),ee=u(75481),et=u(19631),en=u(19097),eo=u(15971),es=u(29683);function getStylesAtomic(n){styleToCSS(n);let l=[];for(let u in n){let d=n[u];if(u in en.pseudoDescriptors)d&&l.push(...getStyleAtomic(d,en.pseudoDescriptors[u]));else if((0,es.isMediaKey)(u))for(let n in d){let h=getStyleObject(d,n);h&&(h[0]=u,l.push(h))}else{let d=getStyleObject(n,u);d&&l.push(d)}}return l}let getStyleAtomic=(n,l)=>{styleToCSS(n);let u=[];for(let d in n){let h=getStyleObject(n,d,l);h&&u.push(h)}return u},getStyleObject=(n,l,u)=>{let h=n[l];if(null==h)return;"transform"===l&&Array.isArray(n.transform)&&(h=(0,eo.transformsToString)(h));let f=(0,et.normalizeValueWithProperty)(h,l),m=(0,j.simpleHash)(`${f}`),g=u?`0${u.name}-`:"";d||=(0,$.getConfig)();let _=`_${d.inverseShorthands[l]||l}-${g}${m}`,z=function(n,l,u,d){let h=d?"disabled"===d.name?"[aria-disabled]":`:${d.name}`:"",f=d?.selector,m=d?f?`${f} .${n}`:`${eu[d.name]} .${n}${h}`:`:root .${n}`;f===en.pseudoDescriptors.enterStyle.selector&&(m=`${m}, .${n}${f}`);let g=!!d,_=[];switch(l){case"placeholderTextColor":{let n=createDeclarationBlock([["color",u],["opacity",1]],g);_.push(`${m}::placeholder${n}`);break}case"backgroundClip":case"userSelect":{let n=`Webkit${l[0].toUpperCase()}${l.slice(1)}`,d=createDeclarationBlock([[l,u],[n,u]],g);_.push(`${m}${d}`);break}case"pointerEvents":{let n=u;"auto"===u||"box-only"===u?(n="auto","box-only"===u&&_.push(`${m}>*${eh}`)):("none"===u||"box-none"===u)&&(n="none","box-none"===u&&_.push(`${m}>*${ec}`));let l=createDeclarationBlock([["pointerEvents",n]],!0);_.push(`${m}${l}`);break}default:{let n=createDeclarationBlock([[l,u]],g);_.push(`${m}${n}`)}}return d?.name==="hover"&&(_=_.map(n=>`@media (hover) {${n}}`)),_}(_,l,f,u);return[l,f,_,u?.name,z]};function styleToCSS(n){let{shadowOffset:l,shadowRadius:u,shadowColor:d,shadowOpacity:h}=n;if(u||d){let f=l||z.defaultOffset,m=(0,et.normalizeValueWithProperty)(f.width),g=(0,et.normalizeValueWithProperty)(f.height),_=(0,et.normalizeValueWithProperty)(u),j=(0,ee.normalizeColor)(d,h),$=`${m} ${g} ${_} ${j}`;n.boxShadow=n.boxShadow?`${n.boxShadow}, ${$}`:$,delete n.shadowOffset,delete n.shadowRadius,delete n.shadowColor,delete n.shadowOpacity}let{textShadowColor:f,textShadowOffset:m,textShadowRadius:g}=n;if(f||m||g){let{height:l,width:u}=m||z.defaultOffset,d=g||0,h=(0,et.normalizeValueWithProperty)(f,"textShadowColor");if(h&&(0!==l||0!==u||0!==d)){let f=(0,et.normalizeValueWithProperty)(d),m=(0,et.normalizeValueWithProperty)(u),g=(0,et.normalizeValueWithProperty)(l);n.textShadow=`${m} ${g} ${f} ${h}`}delete n.textShadowColor,delete n.textShadowOffset,delete n.textShadowRadius}}function createDeclarationBlock(n,l=!1){let u="";for(let[d,h]of n)u+=`${hyphenateStyleName(d)}:${h}${l?" !important":""};`;return`{${u}}`}let el={},toHyphenLower=n=>`-${n.toLowerCase()}`,hyphenateStyleName=n=>{if(n in el)return el[n];let l=n.replace(/[A-Z]/g,toHyphenLower);return el[n]=l,l},eu=(()=>{let n={};for(let l in en.pseudoDescriptors){let u=en.pseudoDescriptors[l];n[u.name]=`${[...Array(u.priority)].map(()=>":root").join("")} `}return n})(),ec=createDeclarationBlock([["pointerEvents","auto"]],!0),eh=createDeclarationBlock([["pointerEvents","none"]],!0)},96807:function(n,l,u){var d=u(34406),h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{getThemeCSSRules:()=>getThemeCSSRules}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_);var j=u(19047),$=u(57239),z=u(2754),ee=u(23956),et=u(75769);function getThemeCSSRules(n){let l=[];if(!d.env.TAMAGUI_DOES_SSR_CSS||"mutates-themes"===d.env.TAMAGUI_DOES_SSR_CSS||"false"===d.env.TAMAGUI_DOES_SSR_CSS){let{config:u,themeName:h,theme:f,names:m}=n,g=n.hasDarkLight??(u.themes&&("light"in u.themes||"dark"in u.themes)),_=`.${$.THEME_CLASSNAME_PREFIX}`,es="";for(let n in f){let l=f[n],u=null;u=ee.tokensValueToVariable.has(l.val)?ee.tokensValueToVariable.get(l.val).variable:l.val,es+=`--${d.env.TAMAGUI_CSS_VARIABLE_PREFIX||""}${(0,j.simpleHash)(n,40)}:${u};`}let el="dark"===h,eu="light"===h,ec=m.map(n=>`${_}${n}`),eh=new Set(el||eu?ec:[]);if(g){let n=(0,et.getSetting)("maxDarkLightNesting")??3;for(let l of m){let u=el||l.startsWith("dark_"),d=!u&&(eu||l.startsWith("light_"));if(!(u||d)){eh.add(`${_}${l}`);continue}let h=`${_}${l.replace(/^(dark|light)_/,"")}`,f=u?["dark","light"]:["light","dark"],[m,g]=f,j=Math.round(1.5*n);for(let n=0;n<j;n++){let l=n%2==1;if(l&&n<3)continue;let u=Array(n+1).fill(0).map((n,l)=>`${_}${l%2==0?m:g}`),d=u.length>1?u.slice(1):u;if(l){let[n,l,...u]=d;d=[l,...u,l]}let f=d[d.length-1],j=h===f?"":h;eh.add(`${d.join(" ")} ${j}`.trim())}}}let ep=[...eh].sort((n,l)=>n.localeCompare(l)),ef=`${ep.map(n=>`:root${isBaseTheme(n)&&(0,et.getSetting)("themeClassNameOnRoot")?"":" "}${n}`).join(", ")} {${es}}`;if(l.push(ef),(0,et.getSetting)("shouldAddPrefersColorThemes")){let n=f.background?`background:${(0,z.variableToString)(f.background)};`:"",u=f.color?`color:${(0,z.variableToString)(f.color)}`:"",d=`body{${n}${u}}`,m=h.startsWith("dark"),g=`${ep.map(n=>n==en||n===eo?":root":m&&n.startsWith(eo)||!m&&n.startsWith(en)?void 0:n.replace(/^\.t_(dark|light) /,"").trim()).filter(Boolean).join(", ")} {${es}}`,_=`@media(prefers-color-scheme:${m?"dark":"light"}){
    ${d}
    ${g}
  }`;l.push(_)}let em=(0,et.getSetting)("selectionStyles");if(em){let n=em(f);if(n){let u=ec.map(n=>`${n} ::selection`).join(", "),d=Object.entries(n).flatMap(([n,l])=>l?`${"backgroundColor"===n?"background":n}:${(0,z.variableToString)(l)}`:[]).join(";");if(d){let n=`${u}{${d}}`;l.push(n)}}}}return l}let en=".t_dark",eo=".t_light",isBaseTheme=n=>n===en||n===eo||n.startsWith(".t_dark ")||n.startsWith(".t_light ")},67231:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{getFontsForLanguage:()=>getFontsForLanguage,getVariantExtras:()=>getVariantExtras}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2754);let j=new WeakMap,getVariantExtras=n=>{if(j.has(n))return j.get(n);let{curProps:l,props:u,conf:d,context:h,theme:f}=n,m=d.fontsParsed;h?.language&&(m=getFontsForLanguage(d.fontsParsed,h.language));let g={fonts:m,tokens:d.tokensParsed,theme:f,get fontFamily(){return(0,_.getVariableValue)(n.fontFamily||n.curProps.fontFamily||n.conf.defaultFont)},get font(){return m[this.fontFamily]||m[n.conf.defaultFont]},props:new Proxy(u,{get(n,u){for(let h of[u,d.inverseShorthands[u]])if(h)return Reflect.has(l,h)?Reflect.get(l,h):Reflect.get(n,h)}})};return j.set(n,g),g},$=new WeakMap;function getFontsForLanguage(n,l){if($.has(l))return $.get(l);let u={...n,...Object.fromEntries(Object.entries(l).map(([l,u])=>{if("default"===u)return[];let d=`$${l}_${u}`;return[`$${l}`,n[d]]}))};return $.set(l,u),u}},8546:function(n,l,u){var d=u(34406),h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{getAllRules:()=>getAllRules,getAllSelectors:()=>getAllSelectors,getAllTransforms:()=>getAllTransforms,insertStyleRules:()=>insertStyleRules,insertedTransforms:()=>es,listenForSheetChanges:()=>listenForSheetChanges,scanAllSheets:()=>scanAllSheets,setNonce:()=>setNonce,shouldInsertStyleRules:()=>shouldInsertStyleRules,updateRules:()=>updateRules}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_);var j=u(35213),$=u(19047),z=u(2754);let ee=new WeakMap,et=new Map,en={},eo={},es={},getAllSelectors=()=>en,getAllRules=()=>Object.values(eo),getAllTransforms=()=>es;function addTransform(n,l,u){let d=l.indexOf("transform:");if(-1===d)return;let h=l.indexOf(";"),f=l.slice(d+10,h);if(!es[n])return es[n]=f,!0}function listenForSheetChanges(){j.isClient&&new MutationObserver(n=>{for(let l of n)if(l instanceof HTMLStyleElement&&l.sheet||l instanceof HTMLLinkElement&&l.href.endsWith(".css")){scanAllSheets();break}}).observe(document.head,{childList:!0})}let el=null;function scanAllSheets(n=!1,l){let u;if(!j.isClient)return;let d=document.styleSheets||[],h=el,f=new Set(d);if(document.styleSheets){for(let d of f)if(d){let h=updateSheetStyles(d,!1,n,l);h&&(u=h)}el=f}if(h)for(let n of h)n&&!f.has(n)&&updateSheetStyles(n,!0);return u}function track(n,l=!1){let u=(et.get(n)||0)+(l?-1:1);return et.set(n,u),u}let eu=d.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES,ec=eu?+eu:250;function updateSheetStyles(n,l=!1,u=!1,h){let f;try{if(!(f=n.cssRules))return}catch{return}let m=getTamaguiSelector(f[0],u)?.[0],g=getTamaguiSelector(f[f.length-1],u)?.[0],_=`${f.length}${m}${g}`,j=ee.get(n);if(!l&&j===_)return;let $=f.length,et=0,eo;for(let n=0;n<$;n++){let m=f[n];if(!(m instanceof CSSStyleRule))continue;let g=getTamaguiSelector(m,u);if(g)et=0;else{if(++et>ec)return;continue}let[_,j,$]=g;if($){let n=function(n,l){let u=n.selectorText.split(",");if(!u.length)return;if(l&&!eh)for(let n in eh={},l.color){let u=l.color[n];eh[u.name]=u.val}let h=(n.cssText||"").slice(n.selectorText.length+2,-1).split(";"),f={};for(let n of h){let l;let u=n.indexOf(":");if(-1===u)continue;let h=n.indexOf("--"),m=n.slice(-1===h?0:h+2,u);d.env.TAMAGUI_CSS_VARIABLE_PREFIX&&(m=m.replace(d.env.TAMAGUI_CSS_VARIABLE_PREFIX,""));let g=n.slice(u+2);if("v"===g[0]&&g.startsWith("var(")){let n=g.slice(6,-1),u=eh[n];u?l=u:(ep||=getComputedStyle(document.body),l=ep.getPropertyValue("--"+n))}else l=g;f[m]=(0,z.createVariable)({key:m,name:m,val:l},!0)}let m=new Set;for(let n of u){let l=n.lastIndexOf(".t_"),u=n.slice(l).slice(3),[d]=n[l-5],h="d"===d?"dark":"i"===d?"light":"",f=h&&h!==u?`${h}_${u}`:u;f&&"light_dark"!==f&&"dark_light"!==f&&m.add(f)}return{names:[...m],theme:f}}(j,h);n&&(eo||=[]).push(n);continue}if(!d.env.TAMAGUI_REACT_19){let n=track(_,l);l?0===n&&delete en[_]:_ in en||(!_.startsWith("_transform-")||addTransform(_,j.cssText,j))&&(en[_]=j.cssText)}}return ee.set(n,_),eo}let eh,ep=null;function getTamaguiSelector(n,l=!1){if(n instanceof CSSStyleRule){let u=n.selectorText;if(":"===u[0]&&"r"===u[1]){if(u.startsWith(":root ._"))return[getIdentifierFromTamaguiSelector(u),n];if(l&&(u.startsWith(":root.t_")||u.startsWith(":root .t_")))return[u.slice(0,20),n,!0]}}else if(n instanceof CSSMediaRule)return n.cssRules.length>1?void 0:getTamaguiSelector(n.cssRules[0])}let getIdentifierFromTamaguiSelector=n=>{let l=n.indexOf(":");return l>-1?n.slice(7,l):n.slice(7)},ef=null;function updateRules(n,l){if(!d.env.TAMAGUI_REACT_19)return!(n in eo)&&(eo[n]=l.join(" "),!n.startsWith("_transform-")||addTransform(n,l[0]))}let em="";function setNonce(n){em=n}function insertStyleRules(n){if(!d.env.TAMAGUI_REACT_19){if(!ef&&j.isClient&&document.head){let n=document.createElement("style");em&&(n.nonce=em),ef=document.head.appendChild(n).sheet}if(ef)for(let l in n){let u=n[l],d=u[$.StyleObjectIdentifier];if(!shouldInsertStyleRules(d))continue;let h=u[$.StyleObjectRules];for(let n of(en[d]=h.join(`
`),track(d),updateRules(d,h),h))try{ef.insertRule(n,ef.cssRules.length)}catch(n){console.error("Error inserting CSS",n)}}}}let eg=d.env.TAMAGUI_INSERT_SELECTOR_TRIES?+d.env.TAMAGUI_INSERT_SELECTOR_TRIES:1;function shouldInsertStyleRules(n){if(d.env.TAMAGUI_REACT_19)return!0;{let l=et.get(n);return void 0===l||l<eg}}},75038:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{isActivePlatform:()=>isActivePlatform}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213);function isActivePlatform(n){let l=n.slice(10);return l===_.currentPlatform||"web"===l}},2533:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{isObj:()=>isObj}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let isObj=n=>n&&!Array.isArray(n)&&"object"==typeof n},44618:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function isTamaguiComponent(n,l){let u=n?.staticConfig;return!!(u&&(!l||l===u.componentName))}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{isTamaguiComponent:()=>isTamaguiComponent}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f)},73431:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{isTamaguiElement:()=>isTamaguiElement}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(44618);let isTamaguiElement=(n,l)=>(0,_.isValidElement)(n)&&(0,j.isTamaguiComponent)(n.type,l)},87296:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};function log(...n){}((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{log:()=>log}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g),u(29683)},89622:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{matchMedia:()=>m,setupMatchMedia:()=>setupMatchMedia}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m="u">typeof window&&window.matchMedia||function(n){return{match:(n,l)=>!1,addListener(){},removeListener(){},matches:!1}};function setupMatchMedia(n){}},5051:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{mergeProps:()=>mergeProps}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(29683),j=u(19097);let mergeProps=(n,l,u)=>{let d={};for(let h in n)mergeProp(d,n,l,h,u);if(l)for(let n in l)mergeProp(d,l,void 0,n,u);return d};function mergeProp(n,l,u,d,h){let f=h?.[d]||null,m=l[d];if(d in j.pseudoDescriptors||_.mediaKeys.has(d)){n[d]={...n[d],...m};return}u&&(d in u||f&&f in u)||(n[f||d]=m)}},96810:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{mergeVariants:()=>mergeVariants}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let mergeVariants=(n,l,u=0)=>{let d={};for(let h in l){let f=n?.[h],m=l[h];f&&"function"!=typeof m?f&&!m?d[h]=f[h]:0===u?d[h]=mergeVariants(f,m,u+1):d[h]={...f,...m}:d[h]=m}return{...n,...d}}},75481:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{getRgba:()=>getRgba,normalizeColor:()=>normalizeColor,rgba:()=>j.rgba}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(74306),j=u(74306);let normalizeColor=(n,l)=>{if(n){if("$"===n[0])return n;if(n.startsWith("var(")){if("number"==typeof l&&l<1)return`color-mix(in srgb, ${n} ${100*l}%, transparent)`}else{let u=getRgba(n);if(u){let n=`${u.r},${u.g},${u.b}`;return 1===l?`rgb(${n})`:`rgba(${n},${l??u.a??1})`}}return n}},getRgba=n=>{let l=(0,_.normalizeCSSColor)(n);if(null!=l)return(0,_.rgba)(l)}},71030:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{normalizeShadow:()=>normalizeShadow}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(92235),j=u(75481);function normalizeShadow({shadowColor:n,shadowOffset:l,shadowOpacity:u,shadowRadius:d}){let{height:h,width:f}=l||_.defaultOffset;return{shadowOffset:{width:f||0,height:h||0},shadowRadius:d||0,shadowColor:(0,j.normalizeColor)(n,1),shadowOpacity:u??(n?j.getRgba(n)?.a:1)}}},20871:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{normalizeStyle:()=>function normalizeStyle(n,l=!1){let u={};for(let d in n){let h=n[d];if(null==h)continue;if(d in ee.pseudoDescriptors||"$"===d[0]&&(0,$.isObj)(h)){u[d]=normalizeStyle(h,l);continue}let f=l?h:(0,z.normalizeValueWithProperty)(h,d),m=(0,_.expandStyle)(d,f);m?Object.assign(u,Object.fromEntries(m)):u[d]=f}return(0,j.fixStyles)(u),u}}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(29152),j=u(69494),$=u(2533),z=u(19631),ee=u(19097)},19631:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{normalizeValueWithProperty:()=>normalizeValueWithProperty,reverseMapClassNameToValue:()=>reverseMapClassNameToValue}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(19047),$=u(8546);let z={...j.stylePropsAll,translateX:!0,translateY:!0};function normalizeValueWithProperty(n,l=""){if(!_.isWeb||j.stylePropsUnitless[l]||l&&!z[l]||"boolean"==typeof n)return n;let u=n;return n&&"object"==typeof n?n:("number"==typeof n?u=`${n}px`:l&&(u=`${u}`),u)}let ee={};function reverseMapClassNameToValue(n,l){let u;let d=(0,$.getAllSelectors)()[l];if(ee[d])return ee[d];if(!d)return;let h=d.replace(/.*:/,"").replace(/;.*/,"").trim();return u=h.startsWith("var(")?h:j.stylePropsUnitless[n]?+h:h.endsWith("px")?+h.replace("px",""):h,ee[d]=u,u}},6780:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function objectIdentityKey(n){let l="";for(let u in n){l+=u;let d=n[u],h=typeof d;if(d&&("object"===h||"function"===h)){if(m.has(d))l+=m.get(d);else{let n=Math.random();m.set(d,n),l+=n}}else l+=h+d}return l}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{objectIdentityKey:()=>objectIdentityKey}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=new WeakMap},97217:function(n,l,u){var d=u(34406),h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{getFontFamilyFromNameOrVariable:()=>getFontFamilyFromNameOrVariable,getPropMappedFontFamily:()=>getPropMappedFontFamily,getTokenForKey:()=>getTokenForKey,propMapper:()=>propMapper}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_),u(35213);var j=u(19047),$=u(75769),z=u(2754),ee=u(29152),et=u(20871),en=u(67231),eo=u(2533),es=u(19097),el=u(78823);let propMapper=(n,l,u,d)=>{if(ef=null,"elevationAndroid"===n)return;let{conf:h,styleProps:f,fontFamily:m,staticConfig:g}=u;if("unset"===l){let u=h.unset?.[n];if(null==u)return;l=u}let _=f.fallbackProps||d,j=_?new Proxy(u,{get:(n,l)=>"curProps"===l?_:Reflect.get(n,l)}):u,{variants:$}=g;if(!f.noExpand&&$&&n in $){j.curProps[n]=l;let u=resolveVariants(n,l,f,j,"");if(u)return u}if(f.disableExpandShorthands||n in h.shorthands&&(n=h.shorthands[n]),l&&("$"===l[0]?l=getTokenForKey(n,l,f.resolveValues,j):(0,z.isVariable)(l)&&(l=resolveVariableValue(n,l,f.resolveValues))),null!=l){let u=(f.noExpand?null:(0,ee.expandStyle)(n,l))||[[n,l]];return"fontFamily"===n&&ef&&ec.set(u,ef),u}},resolveVariants=(n,l,u,h,f)=>{let m;let{staticConfig:g,conf:_,debug:j}=h,{variants:$}=g;if(!$)return;let ee=function(n,l,u){if("function"==typeof n)return n;let d=n[l];if(d)return d;if(null!=l){let{tokensParsed:d}=u;for(let{name:u,spreadName:h}of eh)if(h in n&&l in d[u])return n[h];let h=n["...fontSize"];if(h&&u.fontSizeTokens.has(l))return h}return n[`:${typeof l}`]||n["..."]}($[n],l,_);if(!ee){if("1"===d.env.TAMAGUI_WARN_ON_MISSING_VARIANT&&"boolean"!=typeof l){let u=g.componentName||"[UnnamedComponent]";console.warn(`No variant found: ${u} has variant "${n}", but no matching value "${l}"`)}return}if("function"==typeof ee){let n=ee,u=(0,en.getVariantExtras)(h);ee=n(l,u)}if((0,eo.isObj)(ee)){let l=ee.fontFamily||ee[_.inverseShorthands.fontFamily];l&&(m=getFontFamilyFromNameOrVariable(l,_),h.fontFamily=m),ee=resolveTokensAndVariants(n,ee,u,h,f)}if(ee){let n=(0,et.normalizeStyle)(ee,!!u.noNormalize),l=Object.entries(n);return m&&"$"===m[0]&&ec.set(l,(0,z.getVariableValue)(m)),l}};function getFontFamilyFromNameOrVariable(n,l){if((0,z.isVariable)(n)){let u=eu.get(n);if(u)return u;for(let u in l.fontsParsed){let d=l.fontsParsed[u].family;if((0,z.isVariable)(d)&&(eu.set(d,u),d===n))return u}}else if("string"==typeof n&&"$"===n[0])return n}let eu=new WeakMap,ec=new WeakMap,getPropMappedFontFamily=n=>n&&ec.get(n),resolveTokensAndVariants=(n,l,u,d,h)=>{let{conf:f,staticConfig:m,debug:g,theme:_}=d,{variants:j}=m,$={};for(let m in l){let g=f.shorthands[m]||m,_=l[m];if(!(!u.noSkip&&g in el.skipProps)){if(u.noExpand)$[g]=_;else if(j&&g in j){if(d.curProps[g]=_,h&&h===n)$[g]="$"===_[0]?getTokenForKey(g,_,u.resolveValues,d):_;else{let l=resolveVariants(g,_,u,d,n);if(l)for(let[n,u]of l)null!=u&&(n in es.pseudoDescriptors?($[n]??={},Object.assign($[n],u)):$[n]=u)}continue}if((0,z.isVariable)(_)){$[g]=resolveVariableValue(g,_,u.resolveValues);continue}if("string"==typeof _){let n="$"===_[0]?getTokenForKey(g,_,u.resolveValues,d):_;$[g]=n;continue}if((0,eo.isObj)(_)){let l=resolveTokensAndVariants(g,_,u,d,n);$[g]??={},Object.assign($[g],l)}else $[g]=_}}return $},eh=["size","color","radius","space","zIndex"].map(n=>({name:n,spreadName:`...${n}`})),ep={fontSize:"size",fontWeight:"weight"},ef=null,getTokenForKey=(n,l,u="none",d)=>{if("none"===u)return l;let{theme:h,conf:f=(0,$.getConfig)(),context:m,fontFamily:g,staticConfig:_}=d,z=f.tokensParsed,ee,et=!1,eo=_?.accept?.[n];if(eo){let n=h?.[l]??z[eo][l];null!=n&&(u="value",ee=n,et=!0)}if(h&&l in h){if(ee=h[l],d.skipThemeTokenResolution&&ee?.val)return l;et=!0}else{if(l in f.specificTokens)et=!0,ee=f.specificTokens[l];else{switch(n){case"fontFamily":ee=(m?.language?en.getFontsForLanguage(f.fontsParsed,m.language):f.fontsParsed)[l]?.family||l,ef=l,et=!0;break;case"fontSize":case"lineHeight":case"letterSpacing":case"fontWeight":{let u=f.defaultFont||"$body",d=g||u;if(d){let h=m?.language?(0,en.getFontsForLanguage)(f.fontsParsed,m.language):f.fontsParsed;ee=(h[d]||h[u])?.[ep[n]||n]?.[l]||l,et=!0}}}for(let u in j.tokenCategories)if(n in j.tokenCategories[u]){let n=z[u][l];null!=n&&(ee=n,et=!0)}}if(!et){let n=z.space[l];null!=n&&(ee=n,et=!0)}}if(et){let l=resolveVariableValue(n,ee,u);return l}};function resolveVariableValue(n,l,u){if("none"===u)return l;if((0,z.isVariable)(l)){if("value"===u)return l.val;let n=l?.get;return"function"==typeof n?n("web"===u?"web":void 0):l.variable}return l}},50318:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{proxyThemeToParents:()=>proxyThemeToParents,proxyThemesToParents:()=>proxyThemesToParents}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(75769);let j={};function proxyThemesToParents(n){for(let{names:l,theme:u}of n)for(let n of l)j[n]=u;let l={};for(let{names:u,theme:d}of n)for(let n of u){let u=proxyThemeToParents(n,d);l[n]=u}return l}function proxyThemeToParents(n,l){let u=[],d=n.split("_").slice(0,-1).map(n=>(u.push(n),u.join("_"))),h=d.length;return new Proxy(l,{get(n,l){if(!l||"undefined"==l||Reflect.has(n,l))return Reflect.get(n,l);for(let n=h-1;n>=0;n--){let u=j[d[n]];if(u&&Reflect.has(u,l))return Reflect.get(u,l)}return(0,_.getTokenObject)(l)}})}},47481:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};function proxyThemeVariables(n){return new Proxy(n||{},{has:(n,l)=>Reflect.has(n,removeStarting$(l)),get:(n,l)=>Reflect.get(n,removeStarting$(l))})}((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{proxyThemeVariables:()=>proxyThemeVariables}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let removeStarting$=n=>"string"==typeof n&&"$"===n[0]?n.slice(1):n},19097:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{pseudoDescriptors:()=>_,pseudoDescriptorsBase:()=>m,pseudoPriorities:()=>g}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={hoverStyle:{name:"hover",priority:1},pressStyle:{name:"active",stateKey:"press",priority:2},focusVisibleStyle:{name:"focus-visible",priority:3,stateKey:"focusVisible"},focusStyle:{name:"focus",priority:3},disabledStyle:{name:"disabled",priority:4,stateKey:"disabled"}},g={hover:1,press:2,focus:3,focusVisible:3,disabled:4},_={...m,enterStyle:{name:"enter",selector:".t_unmounted",priority:4},exitStyle:{name:"exit",priority:5}}},23956:function(n,l,u){var d=u(34406),h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{registerCSSVariable:()=>registerCSSVariable,tokensValueToVariable:()=>$,variableToCSS:()=>variableToCSS}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_);var j=u(2754);let registerCSSVariable=n=>{$.set((0,j.getVariableValue)(n),n)},variableToCSS=(n,l=!1)=>`--${d.env.TAMAGUI_CSS_VARIABLE_PREFIX||""}${(0,j.createCSSVariable)(n.name,!1)}:${l||"number"!=typeof n.val?n.val:`${n.val}px`}`,$=new Map},72554:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{setElementProps:()=>m}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=void 0},78823:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{skipProps:()=>_}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g),u(88225);let _={untilMeasured:1,animation:1,space:1,animateOnly:1,disableClassName:1,debug:1,componentName:1,disableOptimization:1,tag:1,style:1,group:1,themeInverse:1,animatePresence:1}},34577:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{themeable:()=>themeable}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(68349),$=u(52322);function themeable(n,l){let u=(0,_.forwardRef)(function(u,d){let{themeInverse:h,theme:f,componentName:m,themeReset:g,..._}=u,z=(0,$.jsx)(n,{ref:d,..._,"data-disable-theme":!0});return(0,$.jsx)(j.Theme,{componentName:m||l?.componentName,name:f,"disable-child-theme":!0,debug:u.debug,inverse:h,reset:g,children:z})});return u.displayName=`Themed(${n?.displayName||n?.name||"Anonymous"})`,u}},63426:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ensureThemeVariable:()=>ensureThemeVariable}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2754);function ensureThemeVariable(n,l){let u=n[l];(0,_.isVariable)(u)?u.name!==l&&(n[l]=(0,_.createVariable)({key:u.name,name:l,val:u.val})):n[l]=(0,_.createVariable)({key:l,name:l,val:u})}},15971:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{transformsToString:()=>transformsToString}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(19631);function transformsToString(n){return n.map(n=>{let l=Object.keys(n)[0],u=n[l];return"matrix"===l||"matrix3d"===l?`${l}(${u.join(",")})`:`${l}(${(0,_.normalizeValueWithProperty)(u,l)})`}).join(" ")}},88225:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{webPropsToSkip:()=>m}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={}},13061:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useConfiguration:()=>useConfiguration}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(75769),$=u(98157);let useConfiguration=()=>{let{groups:n,animationDriver:l,...u}=(0,_.useContext)($.ComponentContext),{animations:d,...h}=(0,j.getConfig)();return{...h,...u,animationDriver:l??(0,j.getConfig)().animations}}},22514:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useDidHydrateOnce:()=>useDidHydrateOnce,useDidHydrateOnceRoot:()=>useDidHydrateOnceRoot}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784);function useDidHydrateOnceRoot(){return!0}function useDidHydrateOnce(){return useDidHydrateSync()}Date.now();let emptySubscribe=()=>()=>{},getClientSnapshot=()=>!0,getServerSnapshot=()=>!1,useDidHydrateSync=()=>(0,_.useSyncExternalStore)(emptySubscribe,getClientSnapshot,getServerSnapshot)},59799:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{getDisableSSR:()=>getDisableSSR}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(75769);function getDisableSSR(n){return n?.disableSSR??(0,_.getSetting)("disableSSR")}},17450:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useIsTouchDevice:()=>useIsTouchDevice}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(4179);let useIsTouchDevice=()=>!_.isWeb||!!(0,j.useDidFinishSSR)()&&_.isTouchable},29683:function(n,l,u){let d,h;var f=u(34406),m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.prototype.hasOwnProperty,$={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})($,{_dmt:()=>_dmt,configureMedia:()=>configureMedia,getMedia:()=>getMedia,getMediaImportanceIfMoreImportant:()=>getMediaImportanceIfMoreImportant,getMediaKeyImportance:()=>getMediaKeyImportance,getMediaState:()=>getMediaState,isMediaKey:()=>isMediaKey,mediaKeyMatch:()=>mediaKeyMatch,mediaKeyToQuery:()=>mediaKeyToQuery,mediaKeys:()=>ec,mediaObjectToString:()=>mediaObjectToString,mediaQueryConfig:()=>eu,mediaState:()=>el,setMediaShouldUpdate:()=>setMediaShouldUpdate,setupMediaListeners:()=>setupMediaListeners,useMedia:()=>useMedia}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of _(l))j.call(n,u)||void 0===u||m(n,u,{get:()=>l[u],enumerable:!(d=g(l,u))||d.enumerable});return n})(m({},"__esModule",{value:!0}),$);var z=u(35213),ee=u(2784),et=u(75769),en=u(89622),eo=u(19097),es=u(59799);let el={},eu={},getMedia=()=>el,ec=new Set,eh=/\$(platform|theme|group)-/,isMediaKey=n=>{if(ec.has(n))return!0;if("$"===n[0]){let l=n.match(eh);if(l)return l[1]}return!1},ep=Object.keys(eo.pseudoDescriptors).length,getMediaKeyImportance=n=>(0,et.getConfig)().settings.mediaPropOrder?ep:h.indexOf(n)+100,ef=new Set,em=0,configureMedia=n=>{let{media:l}=n,u=(0,et.getSetting)("mediaQueryDefaultActive");if(l){for(let n in em++,l)el[n]=u?.[n]||!1,ec.add(`$${n}`);Object.assign(eu,l),d={...el},h=Object.keys(l),n.disableSSR?setupMediaListeners():updateCurrentState()}},eg=-1;function setupMediaListeners(){if(!(z.isWeb&&z.isServer)&&eg!==em)for(let n in eg=em,ef.forEach(n=>n()),ef.clear(),eu){let update=function(){let l=!!getMatch().matches;l!==el[n]&&(el={...el,[n]:l},updateCurrentState())},l=mediaObjectToString(eu[n],n),getMatch=()=>(0,en.matchMedia)(l),u=getMatch();if(!u)throw Error("⚠️ No match");u.addListener(update),ef.add(()=>{u.removeListener(update)}),update()}}let e_=new Set,ey=!1,ev=-1;function updateCurrentState(){ey&&ev===em||(ev=em,ey=!0,Promise.resolve().then(()=>{ey=!1,e_.forEach(n=>n(el))}))}let eE=new WeakMap;function setMediaShouldUpdate(n,l){return eE.set(n,{...eE.get(n),...l})}function subscribe(n){return e_.add(n),()=>{e_.delete(n)}}function useMedia(n,l,u){let h;let m=n??(0,ee.useRef)(),g=(0,es.getDisableSSR)(l),_=(g||!z.isWeb?el:d)||{},j=eE.get(m);j||(j={prev:_},eE.set(m,j));let getSnapshot=()=>{if(!j)return _;let{enabled:n,keys:l,prev:u=_}=j;if(!1===n)return u;let d=l??(n&&l)??null;return!d||Object.keys(d).every(n=>el[n]===u[n])?u:(j.prev=el,el)};if(f.env.TAMAGUI_SYNC_MEDIA_QUERY)h=(0,ee.useSyncExternalStore)(subscribe,getSnapshot,()=>_);else{let[n,l]=(0,ee.useState)(_);h=n,(0,z.useIsomorphicLayoutEffect)(()=>{function update(){l(getSnapshot)}return update(),g||Promise.resolve().then(()=>{update()}),subscribe(update)},[])}return new Proxy(h,{get(n,l){if(!eS)return"string"==typeof l&&(j.keys||={},j.keys[l]=!0),Reflect.get(h,l)}})}let eS=!1;function _dmt(n){eS=n}function getMediaState(n,l){let u;eS=!0;try{u=Object.fromEntries([...n].map(n=>[n,mediaKeyMatch(n,l)]))}finally{eS=!1}return u}let getMediaImportanceIfMoreImportant=(n,l,u,d)=>{let h=d&&!(0,et.getSetting)("mediaPropOrder")?getMediaKeyImportance(n):ep;return!u[l]||h>u[l]?h:null},ew=new WeakMap,eT={};function mediaObjectToString(n,l){if("string"==typeof n)return n;if(ew.has(n))return ew.get(n);let u=Object.entries(n).map(([n,l])=>(n=n.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`).toLowerCase(),"string"==typeof l||"number"==typeof l&&/[height|width]$/.test(n)&&(l=`${l}px`),`(${n}: ${l})`)).join(" and ");return l&&(eT[l]=u),ew.set(n,u),u}function mediaKeyToQuery(n){return eT[n]||mediaObjectToString(eu[n],n)}function mediaKeyMatch(n,l){let u=eu[n];return Object.keys(u).every(n=>{let d=+u[n],h=n.startsWith("max"),f=n.endsWith("Width"),m=l[f?"width":"height"];return h?m<d:m>d})}},88469:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useProps:()=>useProps,usePropsAndStyle:()=>usePropsAndStyle,useStyle:()=>useStyle}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(75769),$=u(98157),z=u(85884),ee=u(68359),et=u(25476),en=u(29683),eo=u(70157);function useProps(n,l){let[u,d]=usePropsAndStyle(n,{...l,noExpand:!0,noNormalize:!0,resolveValues:"none"});return{...u,...d}}function useStyle(n,l){return usePropsAndStyle(n,l)[1]||{}}function usePropsAndStyle(n,l){let u=l?.forComponent?.staticConfig??et.Stack.staticConfig,[d,h]=(0,eo.useThemeWithState)({componentName:u.componentName,name:"theme"in n?n.theme:void 0,inverse:"themeInverse"in n?n.themeInverse:void 0}),f=(0,_.useContext)($.ComponentContext),{state:m,disabled:g,setStateShallow:es}=(0,z.useComponentState)(n,f,u,(0,j.getConfig)()),el=(0,en.useMedia)(),eu=(0,ee.useSplitStyles)(n,u,h,d.state?.name||"",m,{isAnimated:!1,mediaState:el,noSkip:!0,noMergeStyle:!0,noClassNames:!0,resolveValues:"auto",...l},null,f),{mediaGroups:ec,pseudoGroups:eh}=eu;return(0,_.useEffect)(()=>{if(!g){if(m.unmounted){es({unmounted:!1});return}return(0,z.subscribeToContextGroup)({disabled:g,componentContext:f,setStateShallow:es,state:m,mediaGroups:ec,pseudoGroups:eh})}},[g,eh?Object.keys([...eh]).join(""):0,ec?Object.keys([...ec]).join(""):0]),[eu.viewProps,eu.style||{},h,el]}},70157:function(n,l,u){let d;var h=Object.defineProperty,f=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,g=Object.prototype.hasOwnProperty,_={};((n,l)=>{for(var u in l)h(n,u,{get:l[u],enumerable:!0})})(_,{activeThemeManagers:()=>el,getThemeManager:()=>getThemeManager,getThemeProxied:()=>getThemeProxied,useChangeThemeEffect:()=>useChangeThemeEffect,useTheme:()=>useTheme,useThemeWithState:()=>useThemeWithState}),n.exports=((n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of m(l))g.call(n,u)||void 0===u||h(n,u,{get:()=>l[u],enumerable:!(d=f(l,u))||d.enumerable});return n})(h({},"__esModule",{value:!0}),_);var j=u(35213),$=u(2784),z=u(75769),ee=u(2754),et=u(47326),en=u(38116),eo=u(52807);let es={name:null},useTheme=(n=es)=>{let[l,u]=useThemeWithState(n);return u||function(){if(d)return d;let n=(0,z.getConfig)(),l=n.themes.light?"light":Object.keys(n.themes)[0],u=n.themes[l];return d=getThemeProxied({theme:u,name:l})}()},useThemeWithState=n=>{let l=(0,$.useRef)([]),u=useChangeThemeEffect(n,!1,l.current,j.isServer?void 0:()=>{let u=n.shouldUpdate?.()??(l.current.length>0||void 0);return u}),{themeManager:d,state:h}=u,f=(0,$.useMemo)(()=>d&&h?.theme?getThemeProxied(h,n.deopt,d,l.current,n.debug):{},[h?.theme,d,n.deopt,n.debug]);return[u,f]};function getThemeProxied({theme:n,name:l,scheme:u},d=!1,h,f,m){return n?((0,z.getConfig)(),new Proxy(n,{has:(l,u)=>!!Reflect.has(n,u)||("string"==typeof u?("$"===u[0]&&(u=u.slice(1)),h?.allKeys.has(u)):void 0),get(l,u){if("undefined"!==u&&"string"==typeof u){let l="$"===u[0]?u.slice(1):u,d=n[l];if(d&&"object"==typeof d)return new Proxy(d,{get(n,u){if("val"===u)f&&!f.includes(l)&&f.push(l);else if("get"===u)return n=>(0,ee.getVariable)(d);return Reflect.get(d,u)}})}return Reflect.get(l,u)}})):{}}let el=new Set,eu=new WeakMap,ec={},getId=n=>ec[n],getThemeManager=n=>eu.get(getId(n)),registerThemeManager=n=>{if(!ec[n.id]){let l=ec[n.id]={};eu.set(l,n)}},eh=console.error,useChangeThemeEffect=(n,l=!1,u,d)=>{let{disable:h}=n,f=(0,$.useContext)(en.ThemeManagerIDContext),m=getThemeManager(f);if(!l&&!m||h)return{isNewTheme:!1,state:m?.state,themeManager:m};let[g,_]=(0,$.useState)(createState),{state:ee,mounted:es,isNewTheme:eu,themeManager:ec,inversed:ep}=g,ef=!!(!g.mounted&&n.inverse);function getShouldUpdateTheme(l=ec,u,h=ee,f=!1){let g=d?.();if(!l||!f&&!1===g)return;let _=u||l.getState(n,m);if(f||_&&!(!0!==g&&!l.getStateShouldChange(_,h)))return _}if(j.isServer||(0,$.useEffect)(()=>{if(!ec)return;if(n.inverse&&!es){_(n=>createState({...n,mounted:!0}));return}(eu||getShouldUpdateTheme(ec))&&(el.add(ec),_(createState));let l=ec.onChangeTheme((n,l,u)=>{u&&(console.error=eh,_(n=>createState(n,!0)),console.error=eh)}),h=m?.onChangeTheme((l,h,f)=>{let m=f||d?.()||n.deopt||void 0,g=m??!!(u?.length||eu);g&&(console.error=eh,_(n=>createState(n,m)),console.error=eh)},ec.id);return()=>{l(),h?.(),eu&&el.delete(ec)}},[ec,m,eu,n.componentName,n.inverse,n.name,n.reset,es]),j.isWeb&&ef)return{isNewTheme:!1,inversed:!1,themeManager:m,state:{name:"",...m?.state,className:""}};return{state:ee,isNewTheme:eu,inversed:ep,themeManager:ec};function createState(h,f=!1){if(h&&d?.()===!1&&!f)return h;let g=m,_;if((0,et.getHasThemeUpdatingProps)(n)){let getNewThemeManager=()=>new et.ThemeManager(n,l?"root":m);if(h?.themeManager){g=h.themeManager;let d=f||!!u?.length,j=g.getState(n,m),$=getShouldUpdateTheme(g,j,h.state,d);$?(_=$,h.isNewTheme||l?g.updateState($):g=getNewThemeManager()):h.isNewTheme&&m&&!j&&(g=m)}else _={...(g=getNewThemeManager()).state}}let $=!!(g!==m||n.inverse);$&&registerThemeManager(g);let ee=!!j.isWeb&&!(0,z.getSetting)("disableSSR"),en=!ee||l||h?.mounted;_||($?_=g.state:(_=m.state,g=m));let es=h?.inversed,el=$&&_.scheme!==m?.state.scheme,eu=!l&&(!!el||(ee?null==es&&null:n.inverse)),ec={themeManager:g,isNewTheme:$,mounted:en,inversed:eu},eh=h&&!f&&(0,eo.isEqualShallow)(h,ec)&&(0,eo.isEqualShallow)(h.state,_);return h&&eh?h:(ec.state=_,ec)}}},96775:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{useThemeName:()=>useThemeName}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(2784),$=u(38116),z=u(70157);function useThemeName(n){let l=(0,z.getThemeManager)((0,j.useContext)($.ThemeManagerIDContext)),[u,d]=(0,j.useState)(l?.state.name||"");return(0,_.useIsomorphicLayoutEffect)(()=>{if(l)return d(l.state.name),l.onChangeTheme((l,u)=>{let h=n?.parent&&u.state.parentName||l;h&&d(h)})},[l?.state.name]),u}},11444:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let _ of f(l))m.call(n,_)||_===u||d(n,_,{get:()=>l[_],enumerable:!(g=h(l,_))||g.enumerable});return n},__reExport=(n,l,u)=>(__copyProps(n,l,"default"),u&&__copyProps(u,l,"default")),g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{configureMedia:()=>$.configureMedia,getConfig:()=>_.getConfig,getMedia:()=>$.getMedia,getThemes:()=>_.getThemes,getToken:()=>_.getToken,getTokenValue:()=>_.getTokenValue,getTokens:()=>_.getTokens,mediaKeyMatch:()=>$.mediaKeyMatch,mediaObjectToString:()=>$.mediaObjectToString,mediaQueryConfig:()=>$.mediaQueryConfig,mediaState:()=>$.mediaState,setNonce:()=>j.setNonce,setupDev:()=>_.setupDev,updateConfig:()=>_.updateConfig,useMedia:()=>$.useMedia}),n.exports=__copyProps(d({},"__esModule",{value:!0}),g),__reExport(g,u(98517),n.exports),__reExport(g,u(85884),n.exports),__reExport(g,u(64830),n.exports),__reExport(g,u(84022),n.exports),__reExport(g,u(59008),n.exports),__reExport(g,u(69473),n.exports),__reExport(g,u(55624),n.exports),__reExport(g,u(2754),n.exports),__reExport(g,u(14847),n.exports),__reExport(g,u(84166),n.exports),__reExport(g,u(21241),n.exports),__reExport(g,u(25569),n.exports),__reExport(g,u(52487),n.exports);var _=u(75769),j=u(8546);__reExport(g,u(57239),n.exports),__reExport(g,u(98157),n.exports),__reExport(g,u(74320),n.exports),__reExport(g,u(449),n.exports),__reExport(g,u(52807),n.exports),__reExport(g,u(39947),n.exports),__reExport(g,u(69494),n.exports),__reExport(g,u(68885),n.exports),__reExport(g,u(68359),n.exports),__reExport(g,u(2805),n.exports),__reExport(g,u(85884),n.exports),__reExport(g,u(96807),n.exports),__reExport(g,u(67231),n.exports),__reExport(g,u(44618),n.exports),__reExport(g,u(73431),n.exports),__reExport(g,u(89622),n.exports),__reExport(g,u(5051),n.exports),__reExport(g,u(75481),n.exports),__reExport(g,u(20871),n.exports),__reExport(g,u(19631),n.exports),__reExport(g,u(97217),n.exports),__reExport(g,u(50318),n.exports),__reExport(g,u(47481),n.exports),__reExport(g,u(19097),n.exports),__reExport(g,u(34577),n.exports),__reExport(g,u(63426),n.exports),__reExport(g,u(15971),n.exports);var $=u(29683);__reExport(g,u(70157),n.exports),__reExport(g,u(96775),n.exports),__reExport(g,u(13061),n.exports),__reExport(g,u(17450),n.exports),__reExport(g,u(88469),n.exports),__reExport(g,u(13061),n.exports),__reExport(g,u(74576),n.exports),__reExport(g,u(25476),n.exports),__reExport(g,u(57509),n.exports),__reExport(g,u(9557),n.exports),__reExport(g,u(68349),n.exports),__reExport(g,u(94227),n.exports),__reExport(g,u(94680),n.exports),__reExport(g,u(2984),n.exports),__reExport(g,u(72353),n.exports),__reExport(g,u(4179),n.exports),__reExport(g,u(36552),n.exports),__reExport(g,u(7199),n.exports),__reExport(g,u(19047),n.exports),__reExport(g,u(35213),n.exports),__reExport(g,u(42962),n.exports)},84166:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{insertFont:()=>insertFont,parseFont:()=>parseFont,registerFontVariables:()=>registerFontVariables,updateFont:()=>et}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(75769),j=u(57239),$=u(69473),z=u(14847),ee=u(23956);function insertFont(n,l){let u=(0,$.createFont)(l),d=(0,z.createVariables)(u,n),h=parseFont(d);if("u">typeof document){let l=registerFontVariables(h),u=document.querySelector(`style[${j.FONT_DATA_ATTRIBUTE_NAME}="${n}"]`)||document.createElement("style");u.innerText=`:root .font_${n} {${l.join(";")}}`,u.setAttribute(j.FONT_DATA_ATTRIBUTE_NAME,n),document.head.appendChild(u)}return(0,_.setConfigFont)(n,d,h),h}let et=insertFont;function parseFont(n){let l={};for(let u in n){let d=n[u];if("family"===u||"face"===u)l[u]=d;else for(let n in l[u]={},d){let h=d[n];h.val?.[0]==="$"&&(h=h.val),l[u][`$${n}`]=h}}return l}function registerFontVariables(n){let l=[];for(let u in n)if("face"!==u){if("family"===u){let d=n[u];(0,ee.registerCSSVariable)(d),l.push((0,ee.variableToCSS)(d))}else for(let d in n[u])if("string"!=typeof n[u][d]){let h=n[u][d];(0,ee.registerCSSVariable)(h),l.push((0,ee.variableToCSS)(h))}}return l}},52487:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty;n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),{})},42962:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{hooks:()=>m,setupHooks:()=>setupHooks}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m={};function setupHooks(n){Object.assign(m,n)}},25569:function(n){var l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,f={};((n,u)=>{for(var d in u)l(n,d,{get:u[d],enumerable:!0})})(f,{getReactNativeConfig:()=>getReactNativeConfig,setupReactNative:()=>setupReactNative}),n.exports=((n,f,m,g)=>{if(f&&"object"==typeof f||"function"==typeof f)for(let m of d(f))h.call(n,m)||void 0===m||l(n,m,{get:()=>f[m],enumerable:!(g=u(f,m))||g.enumerable});return n})(l({},"__esModule",{value:!0}),f);let m=new WeakMap;function getReactNativeConfig(n){if(n)return n.getSize&&n.prefetch?g.Image:"Text"===n.displayName&&n.render?g.Text:n.render&&("ScrollView"===n.displayName||"View"===n.displayName)?g.default:n.State?.blurTextInput?g.TextInput:m.get(n)}let g={Image:{isReactNative:!0,inlineProps:new Set(["src","width","height"])},Text:{isReactNative:!0,isText:!0},TextInput:{isReactNative:!0,isInput:!0,isText:!0},default:{isReactNative:!0}};function setupReactNative(n){}},21241:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{styled:()=>styled}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(85884),j=u(96810),$=u(25569);function styled(n,l,u){let d=n.staticConfig,h=!!d&&!(d.isReactNative||d.isHOC),f=d?.isHOC&&!d?.isStyledHOC||h?n:d?.Component||n,m=d?void 0:(0,$.getReactNativeConfig)(f),g=!!(m||u?.isReactNative||d?.isReactNative),z=(()=>{if(l){let{variants:n,name:_,defaultVariants:$,acceptsClassName:z,context:ee,...et}=l,en,eo;if(d&&!(d.isHOC&&!d.isStyledHOC)){let l=d.defaultProps;for(let n in l){let u=l[n];d.defaultVariants&&n in d.defaultVariants&&(!$||!(n in $))&&((en||={})[n]=u),n in et||((eo||={})[n]=l[n])}d.variants&&(n=(0,j.mergeVariants)(d.variants,n))}(eo||$||en)&&(et={...eo,...en,...et,...$}),d?.isHOC&&_&&(et.componentName=_);let es=!!(u?.isText||d?.isText),el=u?.acceptsClassName??z??(h||g||d?.isHOC&&d?.acceptsClassName),eu={...d,...u,...!h&&{Component:f},variants:n,defaultProps:et,defaultVariants:$,componentName:_||d?.componentName,isReactNative:g,isText:es,acceptsClassName:el,context:ee,...m,isStyledHOC:!!d?.isHOC,parentStaticConfig:d};return(et.children||!el||ee)&&(eu.neverFlatten=!0),eu}})(),ee=(0,_.createComponent)(z||{});for(let l in n)"propTypes"!==l&&(l in ee||(ee[l]=n[l]));return ee}},72353:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{Configuration:()=>Configuration}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(2784),j=u(98157),$=u(52322);let Configuration=n=>{let l=(0,_.useContext)(j.ComponentContext);return(0,$.jsx)(j.ComponentContext.Provider,{...l,...n})};Configuration.displayName="Configuration"},94680:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{FontLanguage:()=>FontLanguage}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(52322);let FontLanguage=({children:n,...l})=>(0,_.jsx)("div",{style:{display:"contents"},className:Object.entries(l).map(([n,l])=>`t_lang-${n}-${l}`).join(" "),children:n});FontLanguage.displayName="FontLanguage"},74576:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{Slot:()=>en,Slottable:()=>Slottable}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(7199),j=u(35213),$=u(19047),z=u(2784),ee=u(52322);let et=z.version.startsWith("19."),en=(0,z.forwardRef)(function(n,l){let{children:u,...d}=n;if((0,z.isValidElement)(u)){let n=function(n,l){let u=n.props,d={...u},h="string"==typeof n.type;if(h)for(let n in eo)n in l&&(l[eo[n]]=l[n],delete l[n]);for(let n in u){let f=l[n],m=u[n];h&&n in eo&&(n=eo[n],delete d[n]),es.test(n)?d[n]=(0,$.composeEventHandlers)(m,f):"style"===n?d[n]={...f,...m}:"className"===n&&(d[n]=[f,m].filter(Boolean).join(" "))}return{...l,...d}}(u,d);return(0,z.cloneElement)(u,u.type.avoidForwardRef?n:{...n,ref:(0,_.composeRefs)(l,et?u.props.ref:u.ref)})}return z.Children.count(u)>1?z.Children.only(null):null});en.displayName="Slot";let Slottable=({children:n})=>(0,ee.jsx)(ee.Fragment,{children:n});Slottable.displayName="Slottable";let eo=j.isWeb?{onPress:"onClick",onPressOut:"onMouseUp",onPressIn:"onMouseDown"}:{},es=/^on[A-Z]/},25476:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{Stack:()=>z}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(19047),j=u(57239),$=u(85884);let z=(0,$.createComponent)({acceptsClassName:!0,defaultProps:j.stackDefaultStyles,validStyles:_.validStyles});z.displayName="Stack"},2984:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{TamaguiProvider:()=>TamaguiProvider}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(2784),$=u(98157),z=u(22514),ee=u(29683),et=u(94227),en=u(75769),eo=u(52322);function TamaguiProvider({children:n,disableInjectCSS:l,config:u,className:d,defaultTheme:h,disableRootThemeClass:f,reset:m,themeClassNameOnRoot:g}){return(0,ee.setupMediaListeners)(),_.isClient&&((0,z.useDidHydrateOnceRoot)(),(0,_.useIsomorphicLayoutEffect)(()=>{if(u&&!l){let n=document.createElement("style");return n.appendChild(document.createTextNode(u.getCSS())),document.head.appendChild(n),()=>{document.head.removeChild(n)}}},[u,l])),(0,eo.jsx)(UnmountedClassName,{children:(0,eo.jsx)($.ComponentContext.Provider,{animationDriver:u?.animations,children:(0,eo.jsx)(et.ThemeProvider,{themeClassNameOnRoot:g??(0,en.getSetting)("themeClassNameOnRoot"),disableRootThemeClass:f??(0,en.getSetting)("disableRootThemeClass"),defaultTheme:h??(u?Object.keys(u.themes)[0]:""),reset:m,className:d,children:n})})})}function UnmountedClassName(n){let[l,u]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{u(!0)},[]),_.isWeb?(0,eo.jsx)("span",{style:{display:"contents"},className:l?"":"t_unmounted",children:n.children}):n.children}TamaguiProvider.displayName="TamaguiProvider"},9557:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{Text:()=>z}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(19047),j=u(85884);let $={maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},z=(0,j.createComponent)({acceptsClassName:!0,isText:!0,defaultProps:{fontFamily:"unset",display:"inline",boxSizing:"border-box",wordWrap:"break-word",whiteSpace:"pre-wrap",margin:0},inlineWhenUnflattened:new Set(["fontFamily"]),variants:{numberOfLines:{1:$,":number":n=>n>=1?{WebkitLineClamp:n,WebkitBoxOrient:"vertical",display:"-webkit-box",overflow:"hidden"}:null},selectable:{true:{userSelect:"text",cursor:"text"},false:{userSelect:"none",cursor:"default"}},ellipse:{true:$},ellipsis:{true:$}},validStyles:{..._.validStyles,..._.stylePropsTextOnly}});z.displayName="Text"},68349:function(n,l,u){var d,h,f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,j=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,__copyProps=(n,l,u,d)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let h of _(l))$.call(n,h)||h===u||m(n,h,{get:()=>l[h],enumerable:!(d=g(l,h))||d.enumerable});return n},z={};((n,l)=>{for(var u in l)m(n,u,{get:l[u],enumerable:!0})})(z,{Theme:()=>eu,getThemedChildren:()=>getThemedChildren}),n.exports=__copyProps(m({},"__esModule",{value:!0}),z);var ee=u(35213),et=(h=null!=(d=u(2784))?f(j(d)):{},__copyProps(d&&d.__esModule?h:m(h,"default",{value:d,enumerable:!0}),d)),en=u(2754),eo=u(38116),es=u(70157),el=(u(35600),u(87296),u(52322));let eu=(0,et.forwardRef)(function({children:n,...l},u){if(l.disable)return n;let d=!!l._isRoot,h=(0,es.useChangeThemeEffect)(l,d),f=l["disable-child-theme"]?et.Children.map(n,n=>(0,et.cloneElement)(n,{"data-disable-theme":!0})):n;if(u)try{et.default.Children.only(f),f=(0,et.cloneElement)(f,{ref:u})}catch{}let m=(0,et.useRef)({hasEverThemed:!1});return getThemedChildren(h,f,l,d,m)});function getThemedChildren(n,l,u,d=!1,h){let{themeManager:f,isNewTheme:m}=n;if(!f)throw Error("❌ 005");let{shallow:g,forceClassName:_}=u,j=m||d||h.current.hasEverThemed||"boolean"==typeof u.inverse;if(j&&(h.current.hasEverThemed=!0),!j)return l;let $=l;g&&($=et.Children.toArray(l).map(n=>(0,et.isValidElement)(n)?(0,et.cloneElement)(n,void 0,(0,el.jsx)(eu,{name:f.state.parentName,children:n.props.children})):n));let z=(0,el.jsx)(eo.ThemeManagerIDContext.Provider,{value:f.id,children:$});return!1===_?z:ee.isWeb?function({children:n,themeState:l,forceClassName:u,isRoot:d}){if(d&&!1===u)return n;let h=l.inversed,{className:f,style:m}=function(n,l=!1){if(!n.isNewTheme)return{className:"",style:ec};let u=n.state?.theme&&n.isNewTheme?(0,en.variableToString)(n.state.theme.color):"",d=n.state?.className||"";return l&&(d=d.replace("t_sub_theme","")),{style:u?{color:u}:void 0,className:d}}(l,d),g=(0,el.jsx)("span",{className:`${f} _dsp_contents is_Theme`,style:m,children:n});if(null!=h||u){let n=l.state?.name||"",u=n.startsWith("light")?"t_light is_inversed":n.startsWith("dark")?"t_dark is_inversed":"";g=(0,el.jsx)("span",{className:`${h?u:""} _dsp_contents`,children:g})}return g}({children:z,themeState:n,forceClassName:_,isRoot:d}):z}eu.displayName="Theme",eu.avoidForwardRef=!0;let ec={}},35600:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};function ThemeDebug({themeState:n,themeProps:l,children:u}){return u}((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ThemeDebug:()=>ThemeDebug}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g),u(4179),u(62391),u(2784),u(28316),u(52322),ThemeDebug.displayName="ThemeDebug"},94227:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{ThemeProvider:()=>ThemeProvider}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(35213),j=u(2784),$=u(57239),z=u(68349),ee=u(75769),et=u(52322);let ThemeProvider=n=>(_.isClient&&(0,j.useLayoutEffect)(()=>{if(n.disableRootThemeClass)return;let l=`${$.THEME_CLASSNAME_PREFIX}${n.defaultTheme}`,u=n.themeClassNameOnRoot??(0,ee.getSetting)("themeClassNameOnRoot")?document.documentElement:document.body;return u.classList.add(l),()=>{u.classList.remove(l)}},[n.defaultTheme,n.disableRootThemeClass,n.themeClassNameOnRoot]),(0,et.jsx)(z.Theme,{className:n.className,name:n.defaultTheme,forceClassName:!n.disableRootThemeClass,_isRoot:!0,children:n.children}))},57509:function(n,l,u){var d=Object.defineProperty,h=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,g={};((n,l)=>{for(var u in l)d(n,u,{get:l[u],enumerable:!0})})(g,{View:()=>z}),n.exports=((n,l,u,g)=>{if(l&&"object"==typeof l||"function"==typeof l)for(let u of f(l))m.call(n,u)||void 0===u||d(n,u,{get:()=>l[u],enumerable:!(g=h(l,u))||g.enumerable});return n})(d({},"__esModule",{value:!0}),g);var _=u(19047),j=u(57239),$=u(85884);let z=(0,$.createComponent)({acceptsClassName:!0,defaultProps:j.stackDefaultStyles,validStyles:_.validStyles})},89644:function(n,l,u){n.exports=u(25644)},70353:function(n,l,u){"use strict";var d=u(93044),h=u(86955),f=u(92233),m=u(68030),g=u(97948),_=u(51875),j=u(60842),$=u(98560),z=u(21218),ee=u(68047),et=u(10738);n.exports=function(n){return new Promise(function(l,u){var en,eo=n.data,es=n.headers,el=n.responseType;function done(){n.cancelToken&&n.cancelToken.unsubscribe(en),n.signal&&n.signal.removeEventListener("abort",en)}d.isFormData(eo)&&d.isStandardBrowserEnv()&&delete es["Content-Type"];var eu=new XMLHttpRequest;if(n.auth){var ec=n.auth.username||"",eh=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";es.Authorization="Basic "+btoa(ec+":"+eh)}var ep=g(n.baseURL,n.url);function onloadend(){if(eu){var d="getAllResponseHeaders"in eu?_(eu.getAllResponseHeaders()):null;h(function(n){l(n),done()},function(n){u(n),done()},{data:el&&"text"!==el&&"json"!==el?eu.response:eu.responseText,status:eu.status,statusText:eu.statusText,headers:d,config:n,request:eu}),eu=null}}if(eu.open(n.method.toUpperCase(),m(ep,n.params,n.paramsSerializer),!0),eu.timeout=n.timeout,"onloadend"in eu?eu.onloadend=onloadend:eu.onreadystatechange=function(){eu&&4===eu.readyState&&(0!==eu.status||eu.responseURL&&0===eu.responseURL.indexOf("file:"))&&setTimeout(onloadend)},eu.onabort=function(){eu&&(u(new z("Request aborted",z.ECONNABORTED,n,eu)),eu=null)},eu.onerror=function(){u(new z("Network Error",z.ERR_NETWORK,n,eu,eu)),eu=null},eu.ontimeout=function(){var l=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",d=n.transitional||$;n.timeoutErrorMessage&&(l=n.timeoutErrorMessage),u(new z(l,d.clarifyTimeoutError?z.ETIMEDOUT:z.ECONNABORTED,n,eu)),eu=null},d.isStandardBrowserEnv()){var ef=(n.withCredentials||j(ep))&&n.xsrfCookieName?f.read(n.xsrfCookieName):void 0;ef&&(es[n.xsrfHeaderName]=ef)}"setRequestHeader"in eu&&d.forEach(es,function(n,l){void 0===eo&&"content-type"===l.toLowerCase()?delete es[l]:eu.setRequestHeader(l,n)}),d.isUndefined(n.withCredentials)||(eu.withCredentials=!!n.withCredentials),el&&"json"!==el&&(eu.responseType=n.responseType),"function"==typeof n.onDownloadProgress&&eu.addEventListener("progress",n.onDownloadProgress),"function"==typeof n.onUploadProgress&&eu.upload&&eu.upload.addEventListener("progress",n.onUploadProgress),(n.cancelToken||n.signal)&&(en=function(n){eu&&(u(!n||n&&n.type?new ee:n),eu.abort(),eu=null)},n.cancelToken&&n.cancelToken.subscribe(en),n.signal&&(n.signal.aborted?en():n.signal.addEventListener("abort",en))),eo||(eo=null);var em=et(ep);if(em&&-1===["http","https","file"].indexOf(em)){u(new z("Unsupported protocol "+em+":",z.ERR_BAD_REQUEST,n));return}eu.send(eo)})}},25644:function(n,l,u){"use strict";var d=u(93044),h=u(73644),f=u(62215),m=u(92937),g=function createInstance(n){var l=new f(n),u=h(f.prototype.request,l);return d.extend(u,f.prototype,l),d.extend(u,l),u.create=function(l){return createInstance(m(n,l))},u}(u(10663));g.Axios=f,g.CanceledError=u(68047),g.CancelToken=u(34089),g.isCancel=u(98041),g.VERSION=u(29241).version,g.toFormData=u(49027),g.AxiosError=u(21218),g.Cancel=g.CanceledError,g.all=function(n){return Promise.all(n)},g.spread=u(70783),g.isAxiosError=u(65587),n.exports=g,n.exports.default=g},34089:function(n,l,u){"use strict";var d=u(68047);function CancelToken(n){if("function"!=typeof n)throw TypeError("executor must be a function.");this.promise=new Promise(function(n){l=n});var l,u=this;this.promise.then(function(n){if(u._listeners){var l,d=u._listeners.length;for(l=0;l<d;l++)u._listeners[l](n);u._listeners=null}}),this.promise.then=function(n){var l,d=new Promise(function(n){u.subscribe(n),l=n}).then(n);return d.cancel=function(){u.unsubscribe(l)},d},n(function(n){u.reason||(u.reason=new d(n),l(u.reason))})}CancelToken.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},CancelToken.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},CancelToken.prototype.unsubscribe=function(n){if(this._listeners){var l=this._listeners.indexOf(n);-1!==l&&this._listeners.splice(l,1)}},CancelToken.source=function(){var n;return{token:new CancelToken(function(l){n=l}),cancel:n}},n.exports=CancelToken},68047:function(n,l,u){"use strict";var d=u(21218);function CanceledError(n){d.call(this,null==n?"canceled":n,d.ERR_CANCELED),this.name="CanceledError"}u(93044).inherits(CanceledError,d,{__CANCEL__:!0}),n.exports=CanceledError},98041:function(n){"use strict";n.exports=function(n){return!!(n&&n.__CANCEL__)}},62215:function(n,l,u){"use strict";var d=u(93044),h=u(68030),f=u(946),m=u(6895),g=u(92937),_=u(97948),j=u(17525),$=j.validators;function Axios(n){this.defaults=n,this.interceptors={request:new f,response:new f}}Axios.prototype.request=function(n,l){"string"==typeof n?(l=l||{}).url=n:l=n||{},(l=g(this.defaults,l)).method?l.method=l.method.toLowerCase():this.defaults.method?l.method=this.defaults.method.toLowerCase():l.method="get";var u,d=l.transitional;void 0!==d&&j.assertOptions(d,{silentJSONParsing:$.transitional($.boolean),forcedJSONParsing:$.transitional($.boolean),clarifyTimeoutError:$.transitional($.boolean)},!1);var h=[],f=!0;this.interceptors.request.forEach(function(n){("function"!=typeof n.runWhen||!1!==n.runWhen(l))&&(f=f&&n.synchronous,h.unshift(n.fulfilled,n.rejected))});var _=[];if(this.interceptors.response.forEach(function(n){_.push(n.fulfilled,n.rejected)}),!f){var z=[m,void 0];for(Array.prototype.unshift.apply(z,h),z=z.concat(_),u=Promise.resolve(l);z.length;)u=u.then(z.shift(),z.shift());return u}for(var ee=l;h.length;){var et=h.shift(),en=h.shift();try{ee=et(ee)}catch(n){en(n);break}}try{u=m(ee)}catch(n){return Promise.reject(n)}for(;_.length;)u=u.then(_.shift(),_.shift());return u},Axios.prototype.getUri=function(n){return h(_((n=g(this.defaults,n)).baseURL,n.url),n.params,n.paramsSerializer)},d.forEach(["delete","get","head","options"],function(n){Axios.prototype[n]=function(l,u){return this.request(g(u||{},{method:n,url:l,data:(u||{}).data}))}}),d.forEach(["post","put","patch"],function(n){function generateHTTPMethod(l){return function(u,d,h){return this.request(g(h||{},{method:n,headers:l?{"Content-Type":"multipart/form-data"}:{},url:u,data:d}))}}Axios.prototype[n]=generateHTTPMethod(),Axios.prototype[n+"Form"]=generateHTTPMethod(!0)}),n.exports=Axios},21218:function(n,l,u){"use strict";var d=u(93044);function AxiosError(n,l,u,d,h){Error.call(this),this.message=n,this.name="AxiosError",l&&(this.code=l),u&&(this.config=u),d&&(this.request=d),h&&(this.response=h)}d.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var h=AxiosError.prototype,f={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(n){f[n]={value:n}}),Object.defineProperties(AxiosError,f),Object.defineProperty(h,"isAxiosError",{value:!0}),AxiosError.from=function(n,l,u,f,m,g){var _=Object.create(h);return d.toFlatObject(n,_,function(n){return n!==Error.prototype}),AxiosError.call(_,n.message,l,u,f,m),_.name=n.name,g&&Object.assign(_,g),_},n.exports=AxiosError},946:function(n,l,u){"use strict";var d=u(93044);function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function(n,l,u){return this.handlers.push({fulfilled:n,rejected:l,synchronous:!!u&&u.synchronous,runWhen:u?u.runWhen:null}),this.handlers.length-1},InterceptorManager.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},InterceptorManager.prototype.forEach=function(n){d.forEach(this.handlers,function(l){null!==l&&n(l)})},n.exports=InterceptorManager},97948:function(n,l,u){"use strict";var d=u(99192),h=u(48762);n.exports=function(n,l){return n&&!d(l)?h(n,l):l}},6895:function(n,l,u){"use strict";var d=u(93044),h=u(38556),f=u(98041),m=u(10663),g=u(68047);function throwIfCancellationRequested(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new g}n.exports=function(n){return throwIfCancellationRequested(n),n.headers=n.headers||{},n.data=h.call(n,n.data,n.headers,n.transformRequest),n.headers=d.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),d.forEach(["delete","get","head","post","put","patch","common"],function(l){delete n.headers[l]}),(n.adapter||m.adapter)(n).then(function(l){return throwIfCancellationRequested(n),l.data=h.call(n,l.data,l.headers,n.transformResponse),l},function(l){return!f(l)&&(throwIfCancellationRequested(n),l&&l.response&&(l.response.data=h.call(n,l.response.data,l.response.headers,n.transformResponse))),Promise.reject(l)})}},92937:function(n,l,u){"use strict";var d=u(93044);n.exports=function(n,l){l=l||{};var u={};function getMergedValue(n,l){return d.isPlainObject(n)&&d.isPlainObject(l)?d.merge(n,l):d.isPlainObject(l)?d.merge({},l):d.isArray(l)?l.slice():l}function mergeDeepProperties(u){return d.isUndefined(l[u])?d.isUndefined(n[u])?void 0:getMergedValue(void 0,n[u]):getMergedValue(n[u],l[u])}function valueFromConfig2(n){if(!d.isUndefined(l[n]))return getMergedValue(void 0,l[n])}function defaultToConfig2(u){return d.isUndefined(l[u])?d.isUndefined(n[u])?void 0:getMergedValue(void 0,n[u]):getMergedValue(void 0,l[u])}function mergeDirectKeys(u){return u in l?getMergedValue(n[u],l[u]):u in n?getMergedValue(void 0,n[u]):void 0}var h={url:valueFromConfig2,method:valueFromConfig2,data:valueFromConfig2,baseURL:defaultToConfig2,transformRequest:defaultToConfig2,transformResponse:defaultToConfig2,paramsSerializer:defaultToConfig2,timeout:defaultToConfig2,timeoutMessage:defaultToConfig2,withCredentials:defaultToConfig2,adapter:defaultToConfig2,responseType:defaultToConfig2,xsrfCookieName:defaultToConfig2,xsrfHeaderName:defaultToConfig2,onUploadProgress:defaultToConfig2,onDownloadProgress:defaultToConfig2,decompress:defaultToConfig2,maxContentLength:defaultToConfig2,maxBodyLength:defaultToConfig2,beforeRedirect:defaultToConfig2,transport:defaultToConfig2,httpAgent:defaultToConfig2,httpsAgent:defaultToConfig2,cancelToken:defaultToConfig2,socketPath:defaultToConfig2,responseEncoding:defaultToConfig2,validateStatus:mergeDirectKeys};return d.forEach(Object.keys(n).concat(Object.keys(l)),function(n){var l=h[n]||mergeDeepProperties,f=l(n);d.isUndefined(f)&&l!==mergeDirectKeys||(u[n]=f)}),u}},86955:function(n,l,u){"use strict";var d=u(21218);n.exports=function(n,l,u){var h=u.config.validateStatus;!u.status||!h||h(u.status)?n(u):l(new d("Request failed with status code "+u.status,[d.ERR_BAD_REQUEST,d.ERR_BAD_RESPONSE][Math.floor(u.status/100)-4],u.config,u.request,u))}},38556:function(n,l,u){"use strict";var d=u(93044),h=u(10663);n.exports=function(n,l,u){var f=this||h;return d.forEach(u,function(u){n=u.call(f,n,l)}),n}},10663:function(n,l,u){"use strict";var d,h=u(34406),f=u(93044),m=u(98868),g=u(21218),_=u(98560),j=u(49027),$={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(n,l){!f.isUndefined(n)&&f.isUndefined(n["Content-Type"])&&(n["Content-Type"]=l)}var z={transitional:_,adapter:("undefined"!=typeof XMLHttpRequest?d=u(70353):void 0!==h&&"[object process]"===Object.prototype.toString.call(h)&&(d=u(70353)),d),transformRequest:[function(n,l){if(m(l,"Accept"),m(l,"Content-Type"),f.isFormData(n)||f.isArrayBuffer(n)||f.isBuffer(n)||f.isStream(n)||f.isFile(n)||f.isBlob(n))return n;if(f.isArrayBufferView(n))return n.buffer;if(f.isURLSearchParams(n))return setContentTypeIfUnset(l,"application/x-www-form-urlencoded;charset=utf-8"),n.toString();var u,d=f.isObject(n),h=l&&l["Content-Type"];if((u=f.isFileList(n))||d&&"multipart/form-data"===h){var g=this.env&&this.env.FormData;return j(u?{"files[]":n}:n,g&&new g)}return d||"application/json"===h?(setContentTypeIfUnset(l,"application/json"),function(n,l,u){if(f.isString(n))try{return(0,JSON.parse)(n),f.trim(n)}catch(n){if("SyntaxError"!==n.name)throw n}return(0,JSON.stringify)(n)}(n)):n}],transformResponse:[function(n){var l=this.transitional||z.transitional,u=l&&l.silentJSONParsing,d=l&&l.forcedJSONParsing,h=!u&&"json"===this.responseType;if(h||d&&f.isString(n)&&n.length)try{return JSON.parse(n)}catch(n){if(h){if("SyntaxError"===n.name)throw g.from(n,g.ERR_BAD_RESPONSE,this,null,this.response);throw n}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:u(84684)},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};f.forEach(["delete","get","head"],function(n){z.headers[n]={}}),f.forEach(["post","put","patch"],function(n){z.headers[n]=f.merge($)}),n.exports=z},98560:function(n){"use strict";n.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},29241:function(n){n.exports={version:"0.27.2"}},73644:function(n){"use strict";n.exports=function(n,l){return function(){for(var u=Array(arguments.length),d=0;d<u.length;d++)u[d]=arguments[d];return n.apply(l,u)}}},68030:function(n,l,u){"use strict";var d=u(93044);function encode(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(n,l,u){if(!l)return n;if(u)h=u(l);else if(d.isURLSearchParams(l))h=l.toString();else{var h,f=[];d.forEach(l,function(n,l){null!=n&&(d.isArray(n)?l+="[]":n=[n],d.forEach(n,function(n){d.isDate(n)?n=n.toISOString():d.isObject(n)&&(n=JSON.stringify(n)),f.push(encode(l)+"="+encode(n))}))}),h=f.join("&")}if(h){var m=n.indexOf("#");-1!==m&&(n=n.slice(0,m)),n+=(-1===n.indexOf("?")?"?":"&")+h}return n}},48762:function(n){"use strict";n.exports=function(n,l){return l?n.replace(/\/+$/,"")+"/"+l.replace(/^\/+/,""):n}},92233:function(n,l,u){"use strict";var d=u(93044);n.exports=d.isStandardBrowserEnv()?{write:function(n,l,u,h,f,m){var g=[];g.push(n+"="+encodeURIComponent(l)),d.isNumber(u)&&g.push("expires="+new Date(u).toGMTString()),d.isString(h)&&g.push("path="+h),d.isString(f)&&g.push("domain="+f),!0===m&&g.push("secure"),document.cookie=g.join("; ")},read:function(n){var l=document.cookie.match(RegExp("(^|;\\s*)("+n+")=([^;]*)"));return l?decodeURIComponent(l[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},99192:function(n){"use strict";n.exports=function(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}},65587:function(n,l,u){"use strict";var d=u(93044);n.exports=function(n){return d.isObject(n)&&!0===n.isAxiosError}},60842:function(n,l,u){"use strict";var d=u(93044);n.exports=d.isStandardBrowserEnv()?function(){var n,l=/(msie|trident)/i.test(navigator.userAgent),u=document.createElement("a");function resolveURL(n){var d=n;return l&&(u.setAttribute("href",d),d=u.href),u.setAttribute("href",d),{href:u.href,protocol:u.protocol?u.protocol.replace(/:$/,""):"",host:u.host,search:u.search?u.search.replace(/^\?/,""):"",hash:u.hash?u.hash.replace(/^#/,""):"",hostname:u.hostname,port:u.port,pathname:"/"===u.pathname.charAt(0)?u.pathname:"/"+u.pathname}}return n=resolveURL(window.location.href),function(l){var u=d.isString(l)?resolveURL(l):l;return u.protocol===n.protocol&&u.host===n.host}}():function(){return!0}},98868:function(n,l,u){"use strict";var d=u(93044);n.exports=function(n,l){d.forEach(n,function(u,d){d!==l&&d.toUpperCase()===l.toUpperCase()&&(n[l]=u,delete n[d])})}},84684:function(n){n.exports=null},51875:function(n,l,u){"use strict";var d=u(93044),h=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(n){var l,u,f,m={};return n&&d.forEach(n.split("\n"),function(n){f=n.indexOf(":"),l=d.trim(n.substr(0,f)).toLowerCase(),u=d.trim(n.substr(f+1)),l&&!(m[l]&&h.indexOf(l)>=0)&&("set-cookie"===l?m[l]=(m[l]?m[l]:[]).concat([u]):m[l]=m[l]?m[l]+", "+u:u)}),m}},10738:function(n){"use strict";n.exports=function(n){var l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return l&&l[1]||""}},70783:function(n){"use strict";n.exports=function(n){return function(l){return n.apply(null,l)}}},49027:function(n,l,u){"use strict";var d=u(48834).lW,h=u(93044);n.exports=function(n,l){l=l||new FormData;var u=[];function convertValue(n){return null===n?"":h.isDate(n)?n.toISOString():h.isArrayBuffer(n)||h.isTypedArray(n)?"function"==typeof Blob?new Blob([n]):d.from(n):n}return!function build(n,d){if(h.isPlainObject(n)||h.isArray(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+d);u.push(n),h.forEach(n,function(n,u){if(!h.isUndefined(n)){var f,m=d?d+"."+u:u;if(n&&!d&&"object"==typeof n){if(h.endsWith(u,"{}"))n=JSON.stringify(n);else if(h.endsWith(u,"[]")&&(f=h.toArray(n))){f.forEach(function(n){h.isUndefined(n)||l.append(m,convertValue(n))});return}}build(n,m)}}),u.pop()}else l.append(d,convertValue(n))}(n),l}},17525:function(n,l,u){"use strict";var d=u(29241).version,h=u(21218),f={};["object","boolean","number","function","string","symbol"].forEach(function(n,l){f[n]=function(u){return typeof u===n||"a"+(l<1?"n ":" ")+n}});var m={};f.transitional=function(n,l,u){function formatMessage(n,l){return"[Axios v"+d+"] Transitional option '"+n+"'"+l+(u?". "+u:"")}return function(u,d,f){if(!1===n)throw new h(formatMessage(d," has been removed"+(l?" in "+l:"")),h.ERR_DEPRECATED);return l&&!m[d]&&(m[d]=!0,console.warn(formatMessage(d," has been deprecated since v"+l+" and will be removed in the near future"))),!n||n(u,d,f)}},n.exports={assertOptions:function(n,l,u){if("object"!=typeof n)throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);for(var d=Object.keys(n),f=d.length;f-- >0;){var m=d[f],g=l[m];if(g){var _=n[m],j=void 0===_||g(_,m,n);if(!0!==j)throw new h("option "+m+" must be "+j,h.ERR_BAD_OPTION_VALUE);continue}if(!0!==u)throw new h("Unknown option "+m,h.ERR_BAD_OPTION)}},validators:f}},93044:function(n,l,u){"use strict";var d,h,f=u(73644),m=Object.prototype.toString,g=(d=Object.create(null),function(n){var l=m.call(n);return d[l]||(d[l]=l.slice(8,-1).toLowerCase())});function kindOfTest(n){return n=n.toLowerCase(),function(l){return g(l)===n}}function isArray(n){return Array.isArray(n)}function isUndefined(n){return void 0===n}var _=kindOfTest("ArrayBuffer");function isObject(n){return null!==n&&"object"==typeof n}function isPlainObject(n){if("object"!==g(n))return!1;var l=Object.getPrototypeOf(n);return null===l||l===Object.prototype}var j=kindOfTest("Date"),$=kindOfTest("File"),z=kindOfTest("Blob"),ee=kindOfTest("FileList");function isFunction(n){return"[object Function]"===m.call(n)}var et=kindOfTest("URLSearchParams");function forEach(n,l){if(null!=n){if("object"!=typeof n&&(n=[n]),isArray(n))for(var u=0,d=n.length;u<d;u++)l.call(null,n[u],u,n);else for(var h in n)Object.prototype.hasOwnProperty.call(n,h)&&l.call(null,n[h],h,n)}}var en=(h="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(n){return h&&n instanceof h});n.exports={isArray:isArray,isArrayBuffer:_,isBuffer:function(n){return null!==n&&!isUndefined(n)&&null!==n.constructor&&!isUndefined(n.constructor)&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n)},isFormData:function(n){var l="[object FormData]";return n&&("function"==typeof FormData&&n instanceof FormData||m.call(n)===l||isFunction(n.toString)&&n.toString()===l)},isArrayBufferView:function(n){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer&&_(n.buffer)},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:j,isFile:$,isBlob:z,isFunction:isFunction,isStream:function(n){return isObject(n)&&isFunction(n.pipe)},isURLSearchParams:et,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:forEach,merge:function merge(){var n={};function assignValue(l,u){isPlainObject(n[u])&&isPlainObject(l)?n[u]=merge(n[u],l):isPlainObject(l)?n[u]=merge({},l):isArray(l)?n[u]=l.slice():n[u]=l}for(var l=0,u=arguments.length;l<u;l++)forEach(arguments[l],assignValue);return n},extend:function(n,l,u){return forEach(l,function(l,d){u&&"function"==typeof l?n[d]=f(l,u):n[d]=l}),n},trim:function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")},stripBOM:function(n){return 65279===n.charCodeAt(0)&&(n=n.slice(1)),n},inherits:function(n,l,u,d){n.prototype=Object.create(l.prototype,d),n.prototype.constructor=n,u&&Object.assign(n.prototype,u)},toFlatObject:function(n,l,u){var d,h,f,m={};l=l||{};do{for(h=(d=Object.getOwnPropertyNames(n)).length;h-- >0;)m[f=d[h]]||(l[f]=n[f],m[f]=!0);n=Object.getPrototypeOf(n)}while(n&&(!u||u(n,l))&&n!==Object.prototype);return l},kindOf:g,kindOfTest:kindOfTest,endsWith:function(n,l,u){n=String(n),(void 0===u||u>n.length)&&(u=n.length),u-=l.length;var d=n.indexOf(l,u);return -1!==d&&d===u},toArray:function(n){if(!n)return null;var l=n.length;if(isUndefined(l))return null;for(var u=Array(l);l-- >0;)u[l]=n[l];return u},isTypedArray:en,isFileList:ee}},95766:function(n,l){"use strict";l.byteLength=function(n){var l=getLens(n),u=l[0],d=l[1];return(u+d)*3/4-d},l.toByteArray=function(n){var l,u,f=getLens(n),m=f[0],g=f[1],_=new h((m+g)*3/4-g),j=0,$=g>0?m-4:m;for(u=0;u<$;u+=4)l=d[n.charCodeAt(u)]<<18|d[n.charCodeAt(u+1)]<<12|d[n.charCodeAt(u+2)]<<6|d[n.charCodeAt(u+3)],_[j++]=l>>16&255,_[j++]=l>>8&255,_[j++]=255&l;return 2===g&&(l=d[n.charCodeAt(u)]<<2|d[n.charCodeAt(u+1)]>>4,_[j++]=255&l),1===g&&(l=d[n.charCodeAt(u)]<<10|d[n.charCodeAt(u+1)]<<4|d[n.charCodeAt(u+2)]>>2,_[j++]=l>>8&255,_[j++]=255&l),_},l.fromByteArray=function(n){for(var l,d=n.length,h=d%3,f=[],m=0,g=d-h;m<g;m+=16383)f.push(function(n,l,d){for(var h,f=[],m=l;m<d;m+=3)f.push(u[(h=(n[m]<<16&16711680)+(n[m+1]<<8&65280)+(255&n[m+2]))>>18&63]+u[h>>12&63]+u[h>>6&63]+u[63&h]);return f.join("")}(n,m,m+16383>g?g:m+16383));return 1===h?f.push(u[(l=n[d-1])>>2]+u[l<<4&63]+"=="):2===h&&f.push(u[(l=(n[d-2]<<8)+n[d-1])>>10]+u[l>>4&63]+u[l<<2&63]+"="),f.join("")};for(var u=[],d=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,g=f.length;m<g;++m)u[m]=f[m],d[f.charCodeAt(m)]=m;function getLens(n){var l=n.length;if(l%4>0)throw Error("Invalid string. Length must be a multiple of 4");var u=n.indexOf("=");-1===u&&(u=l);var d=u===l?0:4-u%4;return[u,d]}d["-".charCodeAt(0)]=62,d["_".charCodeAt(0)]=63},48834:function(n,l,u){"use strict";/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */var d=u(95766),h=u(62333),f="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function createBuffer(n){if(n>2147483647)throw RangeError('The value "'+n+'" is invalid for option "size"');var l=new Uint8Array(n);return Object.setPrototypeOf(l,Buffer.prototype),l}function Buffer(n,l,u){if("number"==typeof n){if("string"==typeof l)throw TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(n)}return from(n,l,u)}function from(n,l,u){if("string"==typeof n)return function(n,l){if(("string"!=typeof l||""===l)&&(l="utf8"),!Buffer.isEncoding(l))throw TypeError("Unknown encoding: "+l);var u=0|byteLength(n,l),d=createBuffer(u),h=d.write(n,l);return h!==u&&(d=d.slice(0,h)),d}(n,l);if(ArrayBuffer.isView(n))return function(n){if(isInstance(n,Uint8Array)){var l=new Uint8Array(n);return fromArrayBuffer(l.buffer,l.byteOffset,l.byteLength)}return fromArrayLike(n)}(n);if(null==n)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n);if(isInstance(n,ArrayBuffer)||n&&isInstance(n.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(isInstance(n,SharedArrayBuffer)||n&&isInstance(n.buffer,SharedArrayBuffer)))return fromArrayBuffer(n,l,u);if("number"==typeof n)throw TypeError('The "value" argument must not be of type number. Received type number');var d=n.valueOf&&n.valueOf();if(null!=d&&d!==n)return Buffer.from(d,l,u);var h=function(n){if(Buffer.isBuffer(n)){var l,u=0|checked(n.length),d=createBuffer(u);return 0===d.length||n.copy(d,0,0,u),d}return void 0!==n.length?"number"!=typeof n.length||(l=n.length)!=l?createBuffer(0):fromArrayLike(n):"Buffer"===n.type&&Array.isArray(n.data)?fromArrayLike(n.data):void 0}(n);if(h)return h;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof n[Symbol.toPrimitive])return Buffer.from(n[Symbol.toPrimitive]("string"),l,u);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof n)}function assertSize(n){if("number"!=typeof n)throw TypeError('"size" argument must be of type number');if(n<0)throw RangeError('The value "'+n+'" is invalid for option "size"')}function allocUnsafe(n){return assertSize(n),createBuffer(n<0?0:0|checked(n))}function fromArrayLike(n){for(var l=n.length<0?0:0|checked(n.length),u=createBuffer(l),d=0;d<l;d+=1)u[d]=255&n[d];return u}function fromArrayBuffer(n,l,u){var d;if(l<0||n.byteLength<l)throw RangeError('"offset" is outside of buffer bounds');if(n.byteLength<l+(u||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(d=void 0===l&&void 0===u?new Uint8Array(n):void 0===u?new Uint8Array(n,l):new Uint8Array(n,l,u),Buffer.prototype),d}function checked(n){if(n>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|n}function byteLength(n,l){if(Buffer.isBuffer(n))return n.length;if(ArrayBuffer.isView(n)||isInstance(n,ArrayBuffer))return n.byteLength;if("string"!=typeof n)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof n);var u=n.length,d=arguments.length>2&&!0===arguments[2];if(!d&&0===u)return 0;for(var h=!1;;)switch(l){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return utf8ToBytes(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*u;case"hex":return u>>>1;case"base64":return base64ToBytes(n).length;default:if(h)return d?-1:utf8ToBytes(n).length;l=(""+l).toLowerCase(),h=!0}}function slowToString(n,l,u){var h,f,m=!1;if((void 0===l||l<0)&&(l=0),l>this.length||((void 0===u||u>this.length)&&(u=this.length),u<=0||(u>>>=0)<=(l>>>=0)))return"";for(n||(n="utf8");;)switch(n){case"hex":return function(n,l,u){var d=n.length;(!l||l<0)&&(l=0),(!u||u<0||u>d)&&(u=d);for(var h="",f=l;f<u;++f)h+=g[n[f]];return h}(this,l,u);case"utf8":case"utf-8":return utf8Slice(this,l,u);case"ascii":return function(n,l,u){var d="";u=Math.min(n.length,u);for(var h=l;h<u;++h)d+=String.fromCharCode(127&n[h]);return d}(this,l,u);case"latin1":case"binary":return function(n,l,u){var d="";u=Math.min(n.length,u);for(var h=l;h<u;++h)d+=String.fromCharCode(n[h]);return d}(this,l,u);case"base64":return h=l,f=u,0===h&&f===this.length?d.fromByteArray(this):d.fromByteArray(this.slice(h,f));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(n,l,u){for(var d=n.slice(l,u),h="",f=0;f<d.length-1;f+=2)h+=String.fromCharCode(d[f]+256*d[f+1]);return h}(this,l,u);default:if(m)throw TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),m=!0}}function swap(n,l,u){var d=n[l];n[l]=n[u],n[u]=d}function bidirectionalIndexOf(n,l,u,d,h){var f;if(0===n.length)return -1;if("string"==typeof u?(d=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),(f=u=+u)!=f&&(u=h?0:n.length-1),u<0&&(u=n.length+u),u>=n.length){if(h)return -1;u=n.length-1}else if(u<0){if(!h)return -1;u=0}if("string"==typeof l&&(l=Buffer.from(l,d)),Buffer.isBuffer(l))return 0===l.length?-1:arrayIndexOf(n,l,u,d,h);if("number"==typeof l)return(l&=255,"function"==typeof Uint8Array.prototype.indexOf)?h?Uint8Array.prototype.indexOf.call(n,l,u):Uint8Array.prototype.lastIndexOf.call(n,l,u):arrayIndexOf(n,[l],u,d,h);throw TypeError("val must be string, number or Buffer")}function arrayIndexOf(n,l,u,d,h){var f,m=1,g=n.length,_=l.length;if(void 0!==d&&("ucs2"===(d=String(d).toLowerCase())||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(n.length<2||l.length<2)return -1;m=2,g/=2,_/=2,u/=2}function read(n,l){return 1===m?n[l]:n.readUInt16BE(l*m)}if(h){var j=-1;for(f=u;f<g;f++)if(read(n,f)===read(l,-1===j?0:f-j)){if(-1===j&&(j=f),f-j+1===_)return j*m}else -1!==j&&(f-=f-j),j=-1}else for(u+_>g&&(u=g-_),f=u;f>=0;f--){for(var $=!0,z=0;z<_;z++)if(read(n,f+z)!==read(l,z)){$=!1;break}if($)return f}return -1}function utf8Slice(n,l,u){u=Math.min(n.length,u);for(var d=[],h=l;h<u;){var f,m,g,_,j=n[h],$=null,z=j>239?4:j>223?3:j>191?2:1;if(h+z<=u)switch(z){case 1:j<128&&($=j);break;case 2:(192&(f=n[h+1]))==128&&(_=(31&j)<<6|63&f)>127&&($=_);break;case 3:f=n[h+1],m=n[h+2],(192&f)==128&&(192&m)==128&&(_=(15&j)<<12|(63&f)<<6|63&m)>2047&&(_<55296||_>57343)&&($=_);break;case 4:f=n[h+1],m=n[h+2],g=n[h+3],(192&f)==128&&(192&m)==128&&(192&g)==128&&(_=(15&j)<<18|(63&f)<<12|(63&m)<<6|63&g)>65535&&_<1114112&&($=_)}null===$?($=65533,z=1):$>65535&&($-=65536,d.push($>>>10&1023|55296),$=56320|1023&$),d.push($),h+=z}return function(n){var l=n.length;if(l<=4096)return String.fromCharCode.apply(String,n);for(var u="",d=0;d<l;)u+=String.fromCharCode.apply(String,n.slice(d,d+=4096));return u}(d)}function checkOffset(n,l,u){if(n%1!=0||n<0)throw RangeError("offset is not uint");if(n+l>u)throw RangeError("Trying to access beyond buffer length")}function checkInt(n,l,u,d,h,f){if(!Buffer.isBuffer(n))throw TypeError('"buffer" argument must be a Buffer instance');if(l>h||l<f)throw RangeError('"value" argument is out of bounds');if(u+d>n.length)throw RangeError("Index out of range")}function checkIEEE754(n,l,u,d,h,f){if(u+d>n.length||u<0)throw RangeError("Index out of range")}function writeFloat(n,l,u,d,f){return l=+l,u>>>=0,f||checkIEEE754(n,l,u,4,34028234663852886e22,-34028234663852886e22),h.write(n,l,u,d,23,4),u+4}function writeDouble(n,l,u,d,f){return l=+l,u>>>=0,f||checkIEEE754(n,l,u,8,17976931348623157e292,-17976931348623157e292),h.write(n,l,u,d,52,8),u+8}l.lW=Buffer,l.h2=50,Buffer.TYPED_ARRAY_SUPPORT=function(){try{var n=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(n,l),42===n.foo()}catch(n){return!1}}(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),Buffer.poolSize=8192,Buffer.from=function(n,l,u){return from(n,l,u)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(n,l,u){return(assertSize(n),n<=0)?createBuffer(n):void 0!==l?"string"==typeof u?createBuffer(n).fill(l,u):createBuffer(n).fill(l):createBuffer(n)},Buffer.allocUnsafe=function(n){return allocUnsafe(n)},Buffer.allocUnsafeSlow=function(n){return allocUnsafe(n)},Buffer.isBuffer=function(n){return null!=n&&!0===n._isBuffer&&n!==Buffer.prototype},Buffer.compare=function(n,l){if(isInstance(n,Uint8Array)&&(n=Buffer.from(n,n.offset,n.byteLength)),isInstance(l,Uint8Array)&&(l=Buffer.from(l,l.offset,l.byteLength)),!Buffer.isBuffer(n)||!Buffer.isBuffer(l))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===l)return 0;for(var u=n.length,d=l.length,h=0,f=Math.min(u,d);h<f;++h)if(n[h]!==l[h]){u=n[h],d=l[h];break}return u<d?-1:d<u?1:0},Buffer.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(n,l){if(!Array.isArray(n))throw TypeError('"list" argument must be an Array of Buffers');if(0===n.length)return Buffer.alloc(0);if(void 0===l)for(u=0,l=0;u<n.length;++u)l+=n[u].length;var u,d=Buffer.allocUnsafe(l),h=0;for(u=0;u<n.length;++u){var f=n[u];if(isInstance(f,Uint8Array))h+f.length>d.length?Buffer.from(f).copy(d,h):Uint8Array.prototype.set.call(d,f,h);else if(Buffer.isBuffer(f))f.copy(d,h);else throw TypeError('"list" argument must be an Array of Buffers');h+=f.length}return d},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var n=this.length;if(n%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<n;l+=2)swap(this,l,l+1);return this},Buffer.prototype.swap32=function(){var n=this.length;if(n%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<n;l+=4)swap(this,l,l+3),swap(this,l+1,l+2);return this},Buffer.prototype.swap64=function(){var n=this.length;if(n%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<n;l+=8)swap(this,l,l+7),swap(this,l+1,l+6),swap(this,l+2,l+5),swap(this,l+3,l+4);return this},Buffer.prototype.toString=function(){var n=this.length;return 0===n?"":0==arguments.length?utf8Slice(this,0,n):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(n){if(!Buffer.isBuffer(n))throw TypeError("Argument must be a Buffer");return this===n||0===Buffer.compare(this,n)},Buffer.prototype.inspect=function(){var n="",u=l.h2;return n=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(n+=" ... "),"<Buffer "+n+">"},f&&(Buffer.prototype[f]=Buffer.prototype.inspect),Buffer.prototype.compare=function(n,l,u,d,h){if(isInstance(n,Uint8Array)&&(n=Buffer.from(n,n.offset,n.byteLength)),!Buffer.isBuffer(n))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(void 0===l&&(l=0),void 0===u&&(u=n?n.length:0),void 0===d&&(d=0),void 0===h&&(h=this.length),l<0||u>n.length||d<0||h>this.length)throw RangeError("out of range index");if(d>=h&&l>=u)return 0;if(d>=h)return -1;if(l>=u)return 1;if(l>>>=0,u>>>=0,d>>>=0,h>>>=0,this===n)return 0;for(var f=h-d,m=u-l,g=Math.min(f,m),_=this.slice(d,h),j=n.slice(l,u),$=0;$<g;++$)if(_[$]!==j[$]){f=_[$],m=j[$];break}return f<m?-1:m<f?1:0},Buffer.prototype.includes=function(n,l,u){return -1!==this.indexOf(n,l,u)},Buffer.prototype.indexOf=function(n,l,u){return bidirectionalIndexOf(this,n,l,u,!0)},Buffer.prototype.lastIndexOf=function(n,l,u){return bidirectionalIndexOf(this,n,l,u,!1)},Buffer.prototype.write=function(n,l,u,d){if(void 0===l)d="utf8",u=this.length,l=0;else if(void 0===u&&"string"==typeof l)d=l,u=this.length,l=0;else if(isFinite(l))l>>>=0,isFinite(u)?(u>>>=0,void 0===d&&(d="utf8")):(d=u,u=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var h,f,m,g,_,j,$,z,ee=this.length-l;if((void 0===u||u>ee)&&(u=ee),n.length>0&&(u<0||l<0)||l>this.length)throw RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var et=!1;;)switch(d){case"hex":return function(n,l,u,d){u=Number(u)||0;var h=n.length-u;d?(d=Number(d))>h&&(d=h):d=h;var f=l.length;d>f/2&&(d=f/2);for(var m=0;m<d;++m){var g=parseInt(l.substr(2*m,2),16);if(g!=g)break;n[u+m]=g}return m}(this,n,l,u);case"utf8":case"utf-8":return h=l,f=u,blitBuffer(utf8ToBytes(n,this.length-h),this,h,f);case"ascii":case"latin1":case"binary":return m=l,g=u,blitBuffer(function(n){for(var l=[],u=0;u<n.length;++u)l.push(255&n.charCodeAt(u));return l}(n),this,m,g);case"base64":return _=l,j=u,blitBuffer(base64ToBytes(n),this,_,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $=l,z=u,blitBuffer(function(n,l){for(var u,d,h=[],f=0;f<n.length&&!((l-=2)<0);++f)d=(u=n.charCodeAt(f))>>8,h.push(u%256),h.push(d);return h}(n,this.length-$),this,$,z);default:if(et)throw TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),et=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},Buffer.prototype.slice=function(n,l){var u=this.length;n=~~n,l=void 0===l?u:~~l,n<0?(n+=u)<0&&(n=0):n>u&&(n=u),l<0?(l+=u)<0&&(l=0):l>u&&(l=u),l<n&&(l=n);var d=this.subarray(n,l);return Object.setPrototypeOf(d,Buffer.prototype),d},Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function(n,l,u){n>>>=0,l>>>=0,u||checkOffset(n,l,this.length);for(var d=this[n],h=1,f=0;++f<l&&(h*=256);)d+=this[n+f]*h;return d},Buffer.prototype.readUintBE=Buffer.prototype.readUIntBE=function(n,l,u){n>>>=0,l>>>=0,u||checkOffset(n,l,this.length);for(var d=this[n+--l],h=1;l>0&&(h*=256);)d+=this[n+--l]*h;return d},Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function(n,l){return n>>>=0,l||checkOffset(n,1,this.length),this[n]},Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function(n,l){return n>>>=0,l||checkOffset(n,2,this.length),this[n]|this[n+1]<<8},Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function(n,l){return n>>>=0,l||checkOffset(n,2,this.length),this[n]<<8|this[n+1]},Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function(n,l){return n>>>=0,l||checkOffset(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]},Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function(n,l){return n>>>=0,l||checkOffset(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])},Buffer.prototype.readIntLE=function(n,l,u){n>>>=0,l>>>=0,u||checkOffset(n,l,this.length);for(var d=this[n],h=1,f=0;++f<l&&(h*=256);)d+=this[n+f]*h;return d>=(h*=128)&&(d-=Math.pow(2,8*l)),d},Buffer.prototype.readIntBE=function(n,l,u){n>>>=0,l>>>=0,u||checkOffset(n,l,this.length);for(var d=l,h=1,f=this[n+--d];d>0&&(h*=256);)f+=this[n+--d]*h;return f>=(h*=128)&&(f-=Math.pow(2,8*l)),f},Buffer.prototype.readInt8=function(n,l){return(n>>>=0,l||checkOffset(n,1,this.length),128&this[n])?-((255-this[n]+1)*1):this[n]},Buffer.prototype.readInt16LE=function(n,l){n>>>=0,l||checkOffset(n,2,this.length);var u=this[n]|this[n+1]<<8;return 32768&u?4294901760|u:u},Buffer.prototype.readInt16BE=function(n,l){n>>>=0,l||checkOffset(n,2,this.length);var u=this[n+1]|this[n]<<8;return 32768&u?4294901760|u:u},Buffer.prototype.readInt32LE=function(n,l){return n>>>=0,l||checkOffset(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},Buffer.prototype.readInt32BE=function(n,l){return n>>>=0,l||checkOffset(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},Buffer.prototype.readFloatLE=function(n,l){return n>>>=0,l||checkOffset(n,4,this.length),h.read(this,n,!0,23,4)},Buffer.prototype.readFloatBE=function(n,l){return n>>>=0,l||checkOffset(n,4,this.length),h.read(this,n,!1,23,4)},Buffer.prototype.readDoubleLE=function(n,l){return n>>>=0,l||checkOffset(n,8,this.length),h.read(this,n,!0,52,8)},Buffer.prototype.readDoubleBE=function(n,l){return n>>>=0,l||checkOffset(n,8,this.length),h.read(this,n,!1,52,8)},Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function(n,l,u,d){if(n=+n,l>>>=0,u>>>=0,!d){var h=Math.pow(2,8*u)-1;checkInt(this,n,l,u,h,0)}var f=1,m=0;for(this[l]=255&n;++m<u&&(f*=256);)this[l+m]=n/f&255;return l+u},Buffer.prototype.writeUintBE=Buffer.prototype.writeUIntBE=function(n,l,u,d){if(n=+n,l>>>=0,u>>>=0,!d){var h=Math.pow(2,8*u)-1;checkInt(this,n,l,u,h,0)}var f=u-1,m=1;for(this[l+f]=255&n;--f>=0&&(m*=256);)this[l+f]=n/m&255;return l+u},Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,1,255,0),this[l]=255&n,l+1},Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,2,65535,0),this[l]=255&n,this[l+1]=n>>>8,l+2},Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,2,65535,0),this[l]=n>>>8,this[l+1]=255&n,l+2},Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,4,4294967295,0),this[l+3]=n>>>24,this[l+2]=n>>>16,this[l+1]=n>>>8,this[l]=255&n,l+4},Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,4,4294967295,0),this[l]=n>>>24,this[l+1]=n>>>16,this[l+2]=n>>>8,this[l+3]=255&n,l+4},Buffer.prototype.writeIntLE=function(n,l,u,d){if(n=+n,l>>>=0,!d){var h=Math.pow(2,8*u-1);checkInt(this,n,l,u,h-1,-h)}var f=0,m=1,g=0;for(this[l]=255&n;++f<u&&(m*=256);)n<0&&0===g&&0!==this[l+f-1]&&(g=1),this[l+f]=(n/m>>0)-g&255;return l+u},Buffer.prototype.writeIntBE=function(n,l,u,d){if(n=+n,l>>>=0,!d){var h=Math.pow(2,8*u-1);checkInt(this,n,l,u,h-1,-h)}var f=u-1,m=1,g=0;for(this[l+f]=255&n;--f>=0&&(m*=256);)n<0&&0===g&&0!==this[l+f+1]&&(g=1),this[l+f]=(n/m>>0)-g&255;return l+u},Buffer.prototype.writeInt8=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,1,127,-128),n<0&&(n=255+n+1),this[l]=255&n,l+1},Buffer.prototype.writeInt16LE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,2,32767,-32768),this[l]=255&n,this[l+1]=n>>>8,l+2},Buffer.prototype.writeInt16BE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,2,32767,-32768),this[l]=n>>>8,this[l+1]=255&n,l+2},Buffer.prototype.writeInt32LE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,4,2147483647,-2147483648),this[l]=255&n,this[l+1]=n>>>8,this[l+2]=n>>>16,this[l+3]=n>>>24,l+4},Buffer.prototype.writeInt32BE=function(n,l,u){return n=+n,l>>>=0,u||checkInt(this,n,l,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[l]=n>>>24,this[l+1]=n>>>16,this[l+2]=n>>>8,this[l+3]=255&n,l+4},Buffer.prototype.writeFloatLE=function(n,l,u){return writeFloat(this,n,l,!0,u)},Buffer.prototype.writeFloatBE=function(n,l,u){return writeFloat(this,n,l,!1,u)},Buffer.prototype.writeDoubleLE=function(n,l,u){return writeDouble(this,n,l,!0,u)},Buffer.prototype.writeDoubleBE=function(n,l,u){return writeDouble(this,n,l,!1,u)},Buffer.prototype.copy=function(n,l,u,d){if(!Buffer.isBuffer(n))throw TypeError("argument should be a Buffer");if(u||(u=0),d||0===d||(d=this.length),l>=n.length&&(l=n.length),l||(l=0),d>0&&d<u&&(d=u),d===u||0===n.length||0===this.length)return 0;if(l<0)throw RangeError("targetStart out of bounds");if(u<0||u>=this.length)throw RangeError("Index out of range");if(d<0)throw RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),n.length-l<d-u&&(d=n.length-l+u);var h=d-u;return this===n&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(l,u,d):Uint8Array.prototype.set.call(n,this.subarray(u,d),l),h},Buffer.prototype.fill=function(n,l,u,d){if("string"==typeof n){if("string"==typeof l?(d=l,l=0,u=this.length):"string"==typeof u&&(d=u,u=this.length),void 0!==d&&"string"!=typeof d)throw TypeError("encoding must be a string");if("string"==typeof d&&!Buffer.isEncoding(d))throw TypeError("Unknown encoding: "+d);if(1===n.length){var h,f=n.charCodeAt(0);("utf8"===d&&f<128||"latin1"===d)&&(n=f)}}else"number"==typeof n?n&=255:"boolean"==typeof n&&(n=Number(n));if(l<0||this.length<l||this.length<u)throw RangeError("Out of range index");if(u<=l)return this;if(l>>>=0,u=void 0===u?this.length:u>>>0,n||(n=0),"number"==typeof n)for(h=l;h<u;++h)this[h]=n;else{var m=Buffer.isBuffer(n)?n:Buffer.from(n,d),g=m.length;if(0===g)throw TypeError('The value "'+n+'" is invalid for argument "value"');for(h=0;h<u-l;++h)this[h+l]=m[h%g]}return this};var m=/[^+/0-9A-Za-z-_]/g;function utf8ToBytes(n,l){l=l||1/0;for(var u,d=n.length,h=null,f=[],m=0;m<d;++m){if((u=n.charCodeAt(m))>55295&&u<57344){if(!h){if(u>56319||m+1===d){(l-=3)>-1&&f.push(239,191,189);continue}h=u;continue}if(u<56320){(l-=3)>-1&&f.push(239,191,189),h=u;continue}u=(h-55296<<10|u-56320)+65536}else h&&(l-=3)>-1&&f.push(239,191,189);if(h=null,u<128){if((l-=1)<0)break;f.push(u)}else if(u<2048){if((l-=2)<0)break;f.push(u>>6|192,63&u|128)}else if(u<65536){if((l-=3)<0)break;f.push(u>>12|224,u>>6&63|128,63&u|128)}else if(u<1114112){if((l-=4)<0)break;f.push(u>>18|240,u>>12&63|128,u>>6&63|128,63&u|128)}else throw Error("Invalid code point")}return f}function base64ToBytes(n){return d.toByteArray(function(n){if((n=(n=n.split("=")[0]).trim().replace(m,"")).length<2)return"";for(;n.length%4!=0;)n+="=";return n}(n))}function blitBuffer(n,l,u,d){for(var h=0;h<d&&!(h+u>=l.length)&&!(h>=n.length);++h)l[h+u]=n[h];return h}function isInstance(n,l){return n instanceof l||null!=n&&null!=n.constructor&&null!=n.constructor.name&&n.constructor.name===l.name}var g=function(){for(var n="0123456789abcdef",l=Array(256),u=0;u<16;++u)for(var d=16*u,h=0;h<16;++h)l[d+h]=n[u]+n[h];return l}()},13421:function(n,l){"use strict";/*!
 * cookie
 * Copyright(c) 2012-2014 Roman Shtylman
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */l.parse=function(n,l){if("string"!=typeof n)throw TypeError("argument str must be a string");for(var d={},h=n.split(";"),f=(l||{}).decode||u,m=0;m<h.length;m++){var g=h[m],_=g.indexOf("=");if(!(_<0)){var j=g.substring(0,_).trim();if(void 0==d[j]){var $=g.substring(_+1,g.length).trim();'"'===$[0]&&($=$.slice(1,-1)),d[j]=function(n,l){try{return l(n)}catch(l){return n}}($,f)}}}return d},l.serialize=function(n,l,u){var f=u||{},m=f.encode||d;if("function"!=typeof m)throw TypeError("option encode is invalid");if(!h.test(n))throw TypeError("argument name is invalid");var g=m(l);if(g&&!h.test(g))throw TypeError("argument val is invalid");var _=n+"="+g;if(null!=f.maxAge){var j=f.maxAge-0;if(isNaN(j)||!isFinite(j))throw TypeError("option maxAge is invalid");_+="; Max-Age="+Math.floor(j)}if(f.domain){if(!h.test(f.domain))throw TypeError("option domain is invalid");_+="; Domain="+f.domain}if(f.path){if(!h.test(f.path))throw TypeError("option path is invalid");_+="; Path="+f.path}if(f.expires){if("function"!=typeof f.expires.toUTCString)throw TypeError("option expires is invalid");_+="; Expires="+f.expires.toUTCString()}if(f.httpOnly&&(_+="; HttpOnly"),f.secure&&(_+="; Secure"),f.sameSite)switch("string"==typeof f.sameSite?f.sameSite.toLowerCase():f.sameSite){case!0:case"strict":_+="; SameSite=Strict";break;case"lax":_+="; SameSite=Lax";break;case"none":_+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return _};var u=decodeURIComponent,d=encodeURIComponent,h=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},35196:function(n,l,u){"use strict";var d=this&&this.__assign||function(){return(d=Object.assign||function(n){for(var l,u=1,d=arguments.length;u<d;u++)for(var h in l=arguments[u])Object.prototype.hasOwnProperty.call(l,h)&&(n[h]=l[h]);return n}).apply(this,arguments)},h=this&&this.__rest||function(n,l){var u={};for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&0>l.indexOf(d)&&(u[d]=n[d]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var h=0,d=Object.getOwnPropertySymbols(n);h<d.length;h++)0>l.indexOf(d[h])&&Object.prototype.propertyIsEnumerable.call(n,d[h])&&(u[d[h]]=n[d[h]]);return u};Object.defineProperty(l,"__esModule",{value:!0}),l.checkCookies=l.hasCookie=l.removeCookies=l.deleteCookie=l.setCookies=l.setCookie=l.getCookie=l.getCookies=void 0;var f=u(13421),isClientSide=function(){return"undefined"!=typeof window},stringify=function(n){void 0===n&&(n="");try{var l=JSON.stringify(n);return/^[\{\[]/.test(l)?l:n}catch(l){return n}};l.getCookies=function(n){if(n&&(l=n.req),!isClientSide())return l&&l.cookies?l.cookies:l&&l.headers&&l.headers.cookie?(0,f.parse)(l.headers.cookie):{};for(var l,u={},d=document.cookie?document.cookie.split("; "):[],h=0,m=d.length;h<m;h++){var g=d[h].split("="),_=g.slice(1).join("=");u[g[0]]=_}return u},l.getCookie=function(n,u){var d,h=(0,l.getCookies)(u)[n];if(void 0!==h)return"true"===(d=h?h.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent):h)||"false"!==d&&("undefined"!==d?"null"===d?null:d:void 0)},l.setCookie=function(n,l,u){if(u){var m,g,_,j=u.req,$=u.res,z=h(u,["req","res"]);g=j,_=$,m=z}var ee=(0,f.serialize)(n,stringify(l),d({path:"/"},m));if(isClientSide())document.cookie=ee;else if(_&&g){var et=_.getHeader("Set-Cookie");if(Array.isArray(et)||(et=et?[String(et)]:[]),_.setHeader("Set-Cookie",et.concat(ee)),g&&g.cookies){var en=g.cookies;""===l?delete en[n]:en[n]=stringify(l)}if(g&&g.headers&&g.headers.cookie){var en=(0,f.parse)(g.headers.cookie);""===l?delete en[n]:en[n]=stringify(l),g.headers.cookie=Object.entries(en).reduce(function(n,l){return n.concat("".concat(l[0],"=").concat(l[1],";"))},"")}}},l.setCookies=function(n,u,d){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,l.setCookie)(n,u,d)},l.deleteCookie=function(n,u){return(0,l.setCookie)(n,"",d(d({},u),{maxAge:-1}))},l.removeCookies=function(n,u){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,l.deleteCookie)(n,u)},l.hasCookie=function(n,u){return!!n&&(0,l.getCookies)(u).hasOwnProperty(n)},l.checkCookies=function(n,u){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,l.hasCookie)(n,u)}},38076:function(n,l,u){"use strict";function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function _arrayLikeToArray(n,l){(null==l||l>n.length)&&(l=n.length);for(var u=0,d=Array(l);u<l;u++)d[u]=n[u];return d}function filterUniqueArray(n){return n.filter(function(l,u){return n.lastIndexOf(l)===u})}u.r(l),u.d(l,{assignStyle:function(){return function assignStyle(n){for(var l=0,u=arguments.length<=1?0:arguments.length-1;l<u;++l){var d=l+1<1||arguments.length<=l+1?void 0:arguments[l+1];for(var h in d){var f=d[h],m=n[h];if(m&&f){if(Array.isArray(m)){n[h]=filterUniqueArray(m.concat(f));continue}if(Array.isArray(f)){n[h]=filterUniqueArray([m].concat(function(n){if(Array.isArray(n))return _arrayLikeToArray(n)}(f)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(f)||function(n,l){if(n){if("string"==typeof n)return _arrayLikeToArray(n,l);var u=Object.prototype.toString.call(n).slice(8,-1);if("Object"===u&&n.constructor&&(u=n.constructor.name),"Map"===u||"Set"===u)return Array.from(u);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return _arrayLikeToArray(n,l)}}(f)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));continue}if("object"===_typeof(f)){n[h]=assignStyle({},m,f);continue}}n[h]=f}}return n}},camelCaseProperty:function(){return camelCaseProperty},cssifyDeclaration:function(){return cssifyDeclaration},cssifyObject:function(){return cssifyObject},hyphenateProperty:function(){return hyphenateProperty},isPrefixedProperty:function(){return isPrefixedProperty},isPrefixedValue:function(){return isPrefixedValue},isUnitlessProperty:function(){return isUnitlessProperty},normalizeProperty:function(){return normalizeProperty},resolveArrayValue:function(){return resolveArrayValue},unprefixProperty:function(){return unprefixProperty},unprefixValue:function(){return unprefixValue}});var d=/-([a-z])/g,h=/^Ms/g,f={};function toUpper(n){return n[1].toUpperCase()}function camelCaseProperty(n){if(f.hasOwnProperty(n))return f[n];var l=n.replace(d,toUpper).replace(h,"ms");return f[n]=l,l}var m=u(23603);function hyphenateProperty(n){return(0,m.default)(n)}function cssifyDeclaration(n,l){return hyphenateProperty(n)+":"+l}function cssifyObject(n){var l="";for(var u in n){var d=n[u];("string"==typeof d||"number"==typeof d)&&(l&&(l+=";"),l+=cssifyDeclaration(u,d))}return l}var g=/^(Webkit|Moz|O|ms)/;function isPrefixedProperty(n){return g.test(n)}var _=/-webkit-|-moz-|-ms-/;function isPrefixedValue(n){return"string"==typeof n&&_.test(n)}for(var j={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],z=["Webkit","ms","Moz","O"],ee=0,et=$.length;ee<et;++ee){var en=$[ee];j[en]=!0;for(var eo=0,es=z.length;eo<es;++eo)j[z[eo]+en.charAt(0).toUpperCase()+en.slice(1)]=!0}for(var el in j)j[hyphenateProperty(el)]=!0;function isUnitlessProperty(n){return j.hasOwnProperty(n)}var eu=/^(ms|Webkit|Moz|O)/;function unprefixProperty(n){var l=n.replace(eu,"");return l.charAt(0).toLowerCase()+l.slice(1)}function normalizeProperty(n){return unprefixProperty(camelCaseProperty(n))}function resolveArrayValue(n,l){return l.join(";"+hyphenateProperty(n)+":")}var ec=/(-ms-|-webkit-|-moz-|-o-)/g;function unprefixValue(n){return"string"==typeof n?n.replace(ec,""):n}},39977:function(n,l,u){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n){return(0,h.default)(n)};var d,h=(d=u(23603))&&d.__esModule?d:{default:d}},36793:function(n,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n){return"string"==typeof n&&u.test(n)};var u=/-webkit-|-moz-|-ms-/},14983:function(n){"use strict";var validateFormat=function(n){};n.exports=function(n,l){for(var u,d=arguments.length,h=Array(d>2?d-2:0),f=2;f<d;f++)h[f-2]=arguments[f];if(validateFormat(l),!n){if(void 0===l)u=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var m=0;(u=Error(l.replace(/%s/g,function(){return String(h[m++])}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},23603:function(n,l,u){"use strict";u.r(l);var d=/[A-Z]/g,h=/^ms-/,f={};function toHyphenLower(n){return"-"+n.toLowerCase()}l.default=function(n){if(f.hasOwnProperty(n))return f[n];var l=n.replace(d,toHyphenLower);return f[n]=h.test(l)?"-"+l:l}},62333:function(n,l){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */l.read=function(n,l,u,d,h){var f,m,g=8*h-d-1,_=(1<<g)-1,j=_>>1,$=-7,z=u?h-1:0,ee=u?-1:1,et=n[l+z];for(z+=ee,f=et&(1<<-$)-1,et>>=-$,$+=g;$>0;f=256*f+n[l+z],z+=ee,$-=8);for(m=f&(1<<-$)-1,f>>=-$,$+=d;$>0;m=256*m+n[l+z],z+=ee,$-=8);if(0===f)f=1-j;else{if(f===_)return m?NaN:(et?-1:1)*(1/0);m+=Math.pow(2,d),f-=j}return(et?-1:1)*m*Math.pow(2,f-d)},l.write=function(n,l,u,d,h,f){var m,g,_,j=8*f-h-1,$=(1<<j)-1,z=$>>1,ee=23===h?5960464477539062e-23:0,et=d?0:f-1,en=d?1:-1,eo=l<0||0===l&&1/l<0?1:0;for(isNaN(l=Math.abs(l))||l===1/0?(g=isNaN(l)?1:0,m=$):(m=Math.floor(Math.log(l)/Math.LN2),l*(_=Math.pow(2,-m))<1&&(m--,_*=2),m+z>=1?l+=ee/_:l+=ee*Math.pow(2,1-z),l*_>=2&&(m++,_/=2),m+z>=$?(g=0,m=$):m+z>=1?(g=(l*_-1)*Math.pow(2,h),m+=z):(g=l*Math.pow(2,z-1)*Math.pow(2,h),m=0));h>=8;n[u+et]=255&g,et+=en,g/=256,h-=8);for(m=m<<h|g,j+=h;j>0;n[u+et]=255&m,et+=en,m/=256,j-=8);n[u+et-en]|=128*eo}},35970:function(n,l,u){"use strict";l.Z=function(n){var l=n.prefixMap,u=n.plugins;return function prefix(n){for(var g in n){var _=n[g];if((0,m.default)(_))n[g]=prefix(_);else if(Array.isArray(_)){for(var j=[],$=0,z=_.length;$<z;++$){var ee=(0,h.default)(u,g,_[$],n,l);(0,f.default)(j,ee||_[$])}j.length>0&&(n[g]=j)}else{var et=(0,h.default)(u,g,_,n,l);et&&(n[g]=et),n=(0,d.default)(l,g,n)}}return n}};var d=_interopRequireDefault(u(28030)),h=_interopRequireDefault(u(30288)),f=_interopRequireDefault(u(69584)),m=_interopRequireDefault(u(799));function _interopRequireDefault(n){return n&&n.__esModule?n:{default:n}}},62204:function(n,l){"use strict";l.Z=function(){return null}},19629:function(n,l,u){"use strict";l.Z=function(n,l){if("string"==typeof l&&!(0,d.isPrefixedValue)(l)&&-1!==l.indexOf("cross-fade("))return f.map(function(n){return l.replace(h,n+"cross-fade(")})};var d=u(38076),h=/cross-fade\(/g,f=["-webkit-",""]},9270:function(n,l){"use strict";l.Z=function(n,l){if("cursor"===n&&d.hasOwnProperty(l))return u.map(function(n){return n+l})};var u=["-webkit-","-moz-",""],d={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0}},69528:function(n,l,u){"use strict";l.Z=function(n,l){if("string"==typeof l&&!(0,d.isPrefixedValue)(l)&&-1!==l.indexOf("filter("))return f.map(function(n){return l.replace(h,n+"filter(")})};var d=u(38076),h=/filter\(/g,f=["-webkit-",""]},10876:function(n,l,u){"use strict";l.Z=function(n,l){if("string"==typeof l&&!(0,h.default)(l)&&l.indexOf("image-set(")>-1)return f.map(function(n){return l.replace(/image-set\(/g,n+"image-set(")})};var d,h=(d=u(36793))&&d.__esModule?d:{default:d},f=["-webkit-",""]},14819:function(n,l){"use strict";l.Z=function(n,l,d){if(Object.prototype.hasOwnProperty.call(u,n))for(var h=u[n],f=0,m=h.length;f<m;++f)d[h[f]]=l};var u={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]}},38572:function(n,l){"use strict";l.Z=function(n,l){if("position"===n&&"sticky"===l)return["-webkit-sticky","sticky"]}},70300:function(n,l){"use strict";l.Z=function(n,l){if(d.hasOwnProperty(n)&&h.hasOwnProperty(l))return u.map(function(n){return n+l})};var u=["-webkit-","-moz-",""],d={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},h={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0}},63132:function(n,l,u){"use strict";l.Z=function(n,l,u,_){if("string"==typeof l&&m.hasOwnProperty(n)){var j=function(n,l){if((0,h.default)(n))return n;for(var u=n.split(/,(?![^()]*(?:\([^()]*\))?\))/g),f=0,m=u.length;f<m;++f){var _=u[f],j=[_];for(var $ in l){var z=(0,d.default)($);if(_.indexOf(z)>-1&&"order"!==z)for(var ee=l[$],et=0,en=ee.length;et<en;++et)j.unshift(_.replace(z,g[ee[et]]+z))}u[f]=j.join(",")}return u.join(",")}(l,_),$=j.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(n){return!/-moz-|-ms-/.test(n)}).join(",");if(n.indexOf("Webkit")>-1)return $;var z=j.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(n){return!/-webkit-|-ms-/.test(n)}).join(",");return n.indexOf("Moz")>-1?z:(u["Webkit"+(0,f.default)(n)]=$,u["Moz"+(0,f.default)(n)]=z,j)}};var d=_interopRequireDefault(u(39977)),h=_interopRequireDefault(u(36793)),f=_interopRequireDefault(u(16135));function _interopRequireDefault(n){return n&&n.__esModule?n:{default:n}}var m={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},g={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"}},69584:function(n,l){"use strict";function addIfNew(n,l){-1===n.indexOf(l)&&n.push(l)}Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n,l){if(Array.isArray(l))for(var u=0,d=l.length;u<d;++u)addIfNew(n,l[u]);else addIfNew(n,l)}},16135:function(n,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n){return n.charAt(0).toUpperCase()+n.slice(1)}},799:function(n,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n){return n instanceof Object&&!Array.isArray(n)}},28030:function(n,l,u){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n,l,u){var d=n[l];if(d&&u.hasOwnProperty(l))for(var f=(0,h.default)(l),m=0;m<d.length;++m){var g=d[m]+f;u[g]||(u[g]=u[l])}return u};var d,h=(d=u(16135))&&d.__esModule?d:{default:d}},30288:function(n,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(n,l,u,d,h){for(var f=0,m=n.length;f<m;++f){var g=n[f](l,u,d,h);if(g)return g}}},47677:function(n){"use strict";n.exports=function(n,l,u,d,h,f,m,g){if(!n){var _;if(void 0===l)_=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[u,d,h,f,m,g],$=0;(_=Error(l.replace(/%s/g,function(){return j[$++]}))).name="Invariant Violation"}throw _.framesToPop=1,_}}},55351:function(n,l,u){"use strict";u.d(l,{Iv:function(){return CourseJsonLd},PB:function(){return NextSeo},lX:function(){return DefaultSeo}});var d=u(2784),h=u(97729),f=u.n(h);function _extends(){return(_extends=Object.assign?Object.assign.bind():function(n){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(n[d]=u[d])}return n}).apply(this,arguments)}function _objectWithoutPropertiesLoose(n,l){if(null==n)return{};var u,d,h={},f=Object.keys(n);for(d=0;d<f.length;d++)u=f[d],l.indexOf(u)>=0||(h[u]=n[u]);return h}var m=["keyOverride"],g=["crossOrigin"],_={templateTitle:"",noindex:!1,nofollow:!1,norobots:!1,defaultOpenGraphImageWidth:0,defaultOpenGraphImageHeight:0,defaultOpenGraphVideoWidth:0,defaultOpenGraphVideoHeight:0},buildOpenGraphMediaTags=function(n,l,u){void 0===l&&(l=[]);var h=void 0===u?{}:u,f=h.defaultWidth,m=h.defaultHeight;return l.reduce(function(l,u,h){return l.push(d.createElement("meta",{key:"og:"+n+":0"+h,property:"og:"+n,content:u.url})),u.alt&&l.push(d.createElement("meta",{key:"og:"+n+":alt0"+h,property:"og:"+n+":alt",content:u.alt})),u.secureUrl&&l.push(d.createElement("meta",{key:"og:"+n+":secure_url0"+h,property:"og:"+n+":secure_url",content:u.secureUrl.toString()})),u.type&&l.push(d.createElement("meta",{key:"og:"+n+":type0"+h,property:"og:"+n+":type",content:u.type.toString()})),u.width?l.push(d.createElement("meta",{key:"og:"+n+":width0"+h,property:"og:"+n+":width",content:u.width.toString()})):f&&l.push(d.createElement("meta",{key:"og:"+n+":width0"+h,property:"og:"+n+":width",content:f.toString()})),u.height?l.push(d.createElement("meta",{key:"og:"+n+":height"+h,property:"og:"+n+":height",content:u.height.toString()})):m&&l.push(d.createElement("meta",{key:"og:"+n+":height"+h,property:"og:"+n+":height",content:m.toString()})),l},[])},buildTags=function(n){var l,u,h,f,j,$=[];n.titleTemplate&&(_.templateTitle=n.titleTemplate);var z="";n.title?(z=n.title,_.templateTitle&&(z=_.templateTitle.replace(/%s/g,function(){return z}))):n.defaultTitle&&(z=n.defaultTitle),z&&$.push(d.createElement("title",{key:"title"},z));var ee=void 0===n.noindex?_.noindex||n.dangerouslySetAllPagesToNoIndex:n.noindex,et=void 0===n.nofollow?_.nofollow||n.dangerouslySetAllPagesToNoFollow:n.nofollow,en=n.norobots||_.norobots,eo="";if(n.robotsProps){var es=n.robotsProps,el=es.nosnippet,eu=es.maxSnippet,ec=es.maxImagePreview,eh=es.maxVideoPreview,ep=es.noarchive,ef=es.noimageindex,em=es.notranslate,eg=es.unavailableAfter;eo=(el?",nosnippet":"")+(eu?",max-snippet:"+eu:"")+(ec?",max-image-preview:"+ec:"")+(ep?",noarchive":"")+(eg?",unavailable_after:"+eg:"")+(ef?",noimageindex":"")+(eh?",max-video-preview:"+eh:"")+(em?",notranslate":"")}if(n.norobots&&(_.norobots=!0),ee||et?(n.dangerouslySetAllPagesToNoIndex&&(_.noindex=!0),n.dangerouslySetAllPagesToNoFollow&&(_.nofollow=!0),$.push(d.createElement("meta",{key:"robots",name:"robots",content:(ee?"noindex":"index")+","+(et?"nofollow":"follow")+eo}))):(!en||eo)&&$.push(d.createElement("meta",{key:"robots",name:"robots",content:"index,follow"+eo})),n.description&&$.push(d.createElement("meta",{key:"description",name:"description",content:n.description})),n.themeColor&&$.push(d.createElement("meta",{key:"theme-color",name:"theme-color",content:n.themeColor})),n.mobileAlternate&&$.push(d.createElement("link",{rel:"alternate",key:"mobileAlternate",media:n.mobileAlternate.media,href:n.mobileAlternate.href})),n.languageAlternates&&n.languageAlternates.length>0&&n.languageAlternates.forEach(function(n){$.push(d.createElement("link",{rel:"alternate",key:"languageAlternate-"+n.hrefLang,hrefLang:n.hrefLang,href:n.href}))}),n.twitter&&(n.twitter.cardType&&$.push(d.createElement("meta",{key:"twitter:card",name:"twitter:card",content:n.twitter.cardType})),n.twitter.site&&$.push(d.createElement("meta",{key:"twitter:site",name:"twitter:site",content:n.twitter.site})),n.twitter.handle&&$.push(d.createElement("meta",{key:"twitter:creator",name:"twitter:creator",content:n.twitter.handle}))),n.facebook&&n.facebook.appId&&$.push(d.createElement("meta",{key:"fb:app_id",property:"fb:app_id",content:n.facebook.appId})),(null!=(l=n.openGraph)&&l.title||z)&&$.push(d.createElement("meta",{key:"og:title",property:"og:title",content:(null==(f=n.openGraph)?void 0:f.title)||z})),(null!=(u=n.openGraph)&&u.description||n.description)&&$.push(d.createElement("meta",{key:"og:description",property:"og:description",content:(null==(j=n.openGraph)?void 0:j.description)||n.description})),n.openGraph){if((n.openGraph.url||n.canonical)&&$.push(d.createElement("meta",{key:"og:url",property:"og:url",content:n.openGraph.url||n.canonical})),n.openGraph.type){var e_=n.openGraph.type.toLowerCase();$.push(d.createElement("meta",{key:"og:type",property:"og:type",content:e_})),"profile"===e_&&n.openGraph.profile?(n.openGraph.profile.firstName&&$.push(d.createElement("meta",{key:"profile:first_name",property:"profile:first_name",content:n.openGraph.profile.firstName})),n.openGraph.profile.lastName&&$.push(d.createElement("meta",{key:"profile:last_name",property:"profile:last_name",content:n.openGraph.profile.lastName})),n.openGraph.profile.username&&$.push(d.createElement("meta",{key:"profile:username",property:"profile:username",content:n.openGraph.profile.username})),n.openGraph.profile.gender&&$.push(d.createElement("meta",{key:"profile:gender",property:"profile:gender",content:n.openGraph.profile.gender}))):"book"===e_&&n.openGraph.book?(n.openGraph.book.authors&&n.openGraph.book.authors.length&&n.openGraph.book.authors.forEach(function(n,l){$.push(d.createElement("meta",{key:"book:author:0"+l,property:"book:author",content:n}))}),n.openGraph.book.isbn&&$.push(d.createElement("meta",{key:"book:isbn",property:"book:isbn",content:n.openGraph.book.isbn})),n.openGraph.book.releaseDate&&$.push(d.createElement("meta",{key:"book:release_date",property:"book:release_date",content:n.openGraph.book.releaseDate})),n.openGraph.book.tags&&n.openGraph.book.tags.length&&n.openGraph.book.tags.forEach(function(n,l){$.push(d.createElement("meta",{key:"book:tag:0"+l,property:"book:tag",content:n}))})):"article"===e_&&n.openGraph.article?(n.openGraph.article.publishedTime&&$.push(d.createElement("meta",{key:"article:published_time",property:"article:published_time",content:n.openGraph.article.publishedTime})),n.openGraph.article.modifiedTime&&$.push(d.createElement("meta",{key:"article:modified_time",property:"article:modified_time",content:n.openGraph.article.modifiedTime})),n.openGraph.article.expirationTime&&$.push(d.createElement("meta",{key:"article:expiration_time",property:"article:expiration_time",content:n.openGraph.article.expirationTime})),n.openGraph.article.authors&&n.openGraph.article.authors.length&&n.openGraph.article.authors.forEach(function(n,l){$.push(d.createElement("meta",{key:"article:author:0"+l,property:"article:author",content:n}))}),n.openGraph.article.section&&$.push(d.createElement("meta",{key:"article:section",property:"article:section",content:n.openGraph.article.section})),n.openGraph.article.tags&&n.openGraph.article.tags.length&&n.openGraph.article.tags.forEach(function(n,l){$.push(d.createElement("meta",{key:"article:tag:0"+l,property:"article:tag",content:n}))})):("video.movie"===e_||"video.episode"===e_||"video.tv_show"===e_||"video.other"===e_)&&n.openGraph.video&&(n.openGraph.video.actors&&n.openGraph.video.actors.length&&n.openGraph.video.actors.forEach(function(n,l){n.profile&&$.push(d.createElement("meta",{key:"video:actor:0"+l,property:"video:actor",content:n.profile})),n.role&&$.push(d.createElement("meta",{key:"video:actor:role:0"+l,property:"video:actor:role",content:n.role}))}),n.openGraph.video.directors&&n.openGraph.video.directors.length&&n.openGraph.video.directors.forEach(function(n,l){$.push(d.createElement("meta",{key:"video:director:0"+l,property:"video:director",content:n}))}),n.openGraph.video.writers&&n.openGraph.video.writers.length&&n.openGraph.video.writers.forEach(function(n,l){$.push(d.createElement("meta",{key:"video:writer:0"+l,property:"video:writer",content:n}))}),n.openGraph.video.duration&&$.push(d.createElement("meta",{key:"video:duration",property:"video:duration",content:n.openGraph.video.duration.toString()})),n.openGraph.video.releaseDate&&$.push(d.createElement("meta",{key:"video:release_date",property:"video:release_date",content:n.openGraph.video.releaseDate})),n.openGraph.video.tags&&n.openGraph.video.tags.length&&n.openGraph.video.tags.forEach(function(n,l){$.push(d.createElement("meta",{key:"video:tag:0"+l,property:"video:tag",content:n}))}),n.openGraph.video.series&&$.push(d.createElement("meta",{key:"video:series",property:"video:series",content:n.openGraph.video.series})))}n.defaultOpenGraphImageWidth&&(_.defaultOpenGraphImageWidth=n.defaultOpenGraphImageWidth),n.defaultOpenGraphImageHeight&&(_.defaultOpenGraphImageHeight=n.defaultOpenGraphImageHeight),n.openGraph.images&&n.openGraph.images.length&&$.push.apply($,buildOpenGraphMediaTags("image",n.openGraph.images,{defaultWidth:_.defaultOpenGraphImageWidth,defaultHeight:_.defaultOpenGraphImageHeight})),n.defaultOpenGraphVideoWidth&&(_.defaultOpenGraphVideoWidth=n.defaultOpenGraphVideoWidth),n.defaultOpenGraphVideoHeight&&(_.defaultOpenGraphVideoHeight=n.defaultOpenGraphVideoHeight),n.openGraph.videos&&n.openGraph.videos.length&&$.push.apply($,buildOpenGraphMediaTags("video",n.openGraph.videos,{defaultWidth:_.defaultOpenGraphVideoWidth,defaultHeight:_.defaultOpenGraphVideoHeight})),n.openGraph.audio&&$.push.apply($,buildOpenGraphMediaTags("audio",n.openGraph.audio)),n.openGraph.locale&&$.push(d.createElement("meta",{key:"og:locale",property:"og:locale",content:n.openGraph.locale})),(n.openGraph.siteName||n.openGraph.site_name)&&$.push(d.createElement("meta",{key:"og:site_name",property:"og:site_name",content:n.openGraph.siteName||n.openGraph.site_name}))}return n.canonical&&$.push(d.createElement("link",{rel:"canonical",href:n.canonical,key:"canonical"})),n.additionalMetaTags&&n.additionalMetaTags.length>0&&n.additionalMetaTags.forEach(function(n){var l,u,h=n.keyOverride,f=_objectWithoutPropertiesLoose(n,m);$.push(d.createElement("meta",_extends({key:"meta:"+(null!=(l=null!=(u=null!=h?h:f.name)?u:f.property)?l:f.httpEquiv)},f)))}),null!=(h=n.additionalLinkTags)&&h.length&&n.additionalLinkTags.forEach(function(n){var l,u=n.crossOrigin,h=_objectWithoutPropertiesLoose(n,g);$.push(d.createElement("link",_extends({key:"link"+(null!=(l=h.keyOverride)?l:h.href)+h.rel},h,{crossOrigin:"anonymous"===u||"use-credentials"===u||""===u?u:void 0})))}),$},WithHead=function(n){return d.createElement(f(),null,buildTags(n))},DefaultSeo=function(n){var l=n.title,u=n.titleTemplate,h=n.defaultTitle,f=n.themeColor,m=n.dangerouslySetAllPagesToNoIndex,g=n.dangerouslySetAllPagesToNoFollow,_=n.description,j=n.canonical,$=n.facebook,z=n.openGraph,ee=n.additionalMetaTags,et=n.twitter,en=n.defaultOpenGraphImageWidth,eo=n.defaultOpenGraphImageHeight,es=n.defaultOpenGraphVideoWidth,el=n.defaultOpenGraphVideoHeight,eu=n.mobileAlternate,ec=n.languageAlternates,eh=n.additionalLinkTags,ep=n.robotsProps,ef=n.norobots;return d.createElement(WithHead,{title:l,titleTemplate:u,defaultTitle:h,themeColor:f,dangerouslySetAllPagesToNoIndex:void 0!==m&&m,dangerouslySetAllPagesToNoFollow:void 0!==g&&g,description:_,canonical:j,facebook:$,openGraph:z,additionalMetaTags:ee,twitter:et,defaultOpenGraphImageWidth:en,defaultOpenGraphImageHeight:eo,defaultOpenGraphVideoWidth:es,defaultOpenGraphVideoHeight:el,mobileAlternate:eu,languageAlternates:ec,additionalLinkTags:eh,robotsProps:ep,norobots:ef})},NextSeo=function(n){var l=n.title,u=n.themeColor,h=n.noindex,f=n.nofollow,m=n.robotsProps,g=n.description,_=n.canonical,j=n.openGraph,$=n.facebook,z=n.twitter,ee=n.additionalMetaTags,et=n.titleTemplate,en=n.defaultTitle,eo=n.mobileAlternate,es=n.languageAlternates,el=n.additionalLinkTags;return d.createElement(d.Fragment,null,d.createElement(WithHead,{title:l,themeColor:u,noindex:h,nofollow:f,robotsProps:m,description:g,canonical:_,facebook:$,openGraph:j,additionalMetaTags:ee,twitter:z,titleTemplate:et,defaultTitle:en,mobileAlternate:eo,languageAlternates:es,additionalLinkTags:el}))},toJson=function(n,l){var u=l;return Array.isArray(u)&&1===u.length&&(u=_extends({},l[0])),{__html:JSON.stringify(Array.isArray(u)?u.map(function(l){return formatObjectForSchema(n,l)}):formatObjectForSchema(n,u),safeJsonLdReplacer)}},formatObjectForSchema=function(n,l){var u=l.id,d=_extends({},(void 0===u?void 0:u)?{"@id":l.id}:{},l);return delete d.id,_extends({"@context":"https://schema.org","@type":n},d)},j=Object.freeze({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"}),$=RegExp("["+Object.keys(j).join("")+"]","g"),ESCAPE_REPLACER=function(n){return j[n]},safeJsonLdReplacer=function(n,l){switch(typeof l){case"object":if(null===l)return;return l;case"number":case"boolean":case"bigint":return l;case"string":return l.replace($,ESCAPE_REPLACER);default:return}},z=["type","keyOverride","scriptKey","scriptId","dataArray","useAppDir"];function JsonLd(n){var l=n.type,u=void 0===l?"Thing":l,h=n.keyOverride,m=n.scriptKey,g=n.scriptId,_=void 0===g?void 0:g,j=n.dataArray,$=n.useAppDir,ee=_objectWithoutPropertiesLoose(n,z),JsonLdScript=function(){return d.createElement("script",{type:"application/ld+json",id:_,"data-testid":_,dangerouslySetInnerHTML:toJson(u,void 0===j?_extends({},ee):j),key:"jsonld-"+m+(h?"-"+h:"")})};return void 0!==$&&$?d.createElement(JsonLdScript,null):d.createElement(f(),null,JsonLdScript())}var ee=["type","keyOverride","courseName","provider"];function CourseJsonLd(n){var l=n.type,u=n.keyOverride,h=n.courseName,f=n.provider,m=_objectWithoutPropertiesLoose(n,ee),g=_extends({name:h},m,{provider:function(n){if(n)return{"@type":n.type||"Organization",name:n.name,sameAs:n.url}}(f)});return d.createElement(JsonLd,_extends({type:void 0===l?"Course":l,keyOverride:u},g,{scriptKey:"course"}))}},86570:function(n,l,u){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return u(78911)}])},78911:function(n,l,u){"use strict";let d,h,f,m,g,_;u.r(l),u.d(l,{default:function(){return _app}});var j,$,z,ee,et,en,eo,es,el,eu,ec,eh,ep,ef,em,eg,e_,ey=u(52322),ev=u(90191);let eE={defaultTitle:"Crone",titleTemplate:"Crone \xb7 %s",description:ev.Dh,facebook:{appId:"667461174982660"},openGraph:{type:"website",locale:"en_US",title:"Crone",description:ev.$O,images:[{url:`${ev.nW}/shared-dupe/og/2024-04-11-banner-min.png`,secureUrl:ev.nW+"/shared-dupe/og/2024-04-11-banner-min.png",width:1200,height:675,type:"image/png",alt:ev.Rv}],url:ev.nW,siteName:"Crone"},twitter:{handle:"@croneai",site:"@croneai",cardType:"summary_large_image"},additionalLinkTags:[{rel:"apple-touch-icon",sizes:"180x180",href:"/favicon/apple-touch-icon.png"},{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon/favicon-32x32.png"},{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon/favicon-16x16.png"},{rel:"manifest",href:"/favicon/site.webmanifest"},{rel:"mask-icon",href:"/favicon/safari-pinned-tab.svg",color:"#5bbad5"}],additionalMetaTags:[{name:"msapplication-TileColor",content:"#2b5797"},{name:"theme-color",content:"#ffffff"},{name:"apple-itunes-app",content:"app-id=6476424527"},{name:"viewport",content:"width=device-width, initial-scale=1"},{name:"robots",content:"index, follow"},{name:"googlebot",content:"index, follow"}]};var eS=u(63197),ew=u(20908),eT=u(21675),eI=u(99347),eR=u(67587),eP=u(95062);let eA=!1;var eO={addListener:()=>{eA||(console.warn(`[expo-notifications] Notifications handling is not yet fully supported on ${eP.Z.OS}. Handling notifications will have no effect.`),eA=!0)},removeListeners:()=>{}};let NotificationTimeoutError=class NotificationTimeoutError extends eT.D{constructor(n,l){super("ERR_NOTIFICATION_TIMEOUT",`Notification handling timed out for ID ${n}.`),this.info={id:n,notification:l}}};let eC=new eI.v(eO),ek=null,ex=null;u(98728),u(40645);var eM=u(93878),eD=u(48790),eN=u(36370),eV=u(714),eF=u(3709),eL=u(3241),ej=u(53429);let Query=class Query extends ej.F{constructor(n){super(),this.abortSignalConsumed=!1,this.defaultOptions=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.cache=n.cache,this.logger=n.logger||eV._,this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.initialState=n.state||function(n){let l="function"==typeof n.initialData?n.initialData():n.initialData,u=void 0!==l,d=u?"function"==typeof n.initialDataUpdatedAt?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:u?null!=d?d:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:u?"success":"loading",fetchStatus:"idle"}}(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(n){this.options={...this.defaultOptions,...n},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.cache.remove(this)}setData(n,l){let u=(0,eN.oE)(this.state.data,n,this.options);return this.dispatch({data:u,type:"success",dataUpdatedAt:null==l?void 0:l.updatedAt,manual:null==l?void 0:l.manual}),u}setState(n,l){this.dispatch({type:"setState",state:n,setStateOptions:l})}cancel(n){var l;let u=this.promise;return null==(l=this.retryer)||l.cancel(n),u?u.then(eN.ZT).catch(eN.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(n=>!1!==n.options.enabled)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(n=>n.getCurrentResult().isStale)}isStaleByTime(n=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!(0,eN.Kp)(this.state.dataUpdatedAt,n)}onFocus(){var n;let l=this.observers.find(n=>n.shouldFetchOnWindowFocus());l&&l.refetch({cancelRefetch:!1}),null==(n=this.retryer)||n.continue()}onOnline(){var n;let l=this.observers.find(n=>n.shouldFetchOnReconnect());l&&l.refetch({cancelRefetch:!1}),null==(n=this.retryer)||n.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(l=>l!==n),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(n,l){var u,d,h,f;if("idle"!==this.state.fetchStatus){if(this.state.dataUpdatedAt&&null!=l&&l.cancelRefetch)this.cancel({silent:!0});else if(this.promise)return null==(h=this.retryer)||h.continueRetry(),this.promise}if(n&&this.setOptions(n),!this.options.queryFn){let n=this.observers.find(n=>n.options.queryFn);n&&this.setOptions(n.options)}let m=(0,eN.G9)(),g={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},addSignalProperty=n=>{Object.defineProperty(n,"signal",{enumerable:!0,get:()=>{if(m)return this.abortSignalConsumed=!0,m.signal}})};addSignalProperty(g);let _={fetchOptions:l,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(g)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'")};addSignalProperty(_),null==(u=this.options.behavior)||u.onFetch(_),this.revertState=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==(null==(d=_.fetchOptions)?void 0:d.meta))&&this.dispatch({type:"fetch",meta:null==(f=_.fetchOptions)?void 0:f.meta});let onError=n=>{if((0,eL.DV)(n)&&n.silent||this.dispatch({type:"error",error:n}),!(0,eL.DV)(n)){var l,u,d,h;null==(l=(u=this.cache.config).onError)||l.call(u,n,this),null==(d=(h=this.cache.config).onSettled)||d.call(h,this.state.data,n,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=(0,eL.Mz)({fn:_.fetchFn,abort:null==m?void 0:m.abort.bind(m),onSuccess:n=>{var l,u,d,h;if(void 0===n){onError(Error(this.queryHash+" data is undefined"));return}this.setData(n),null==(l=(u=this.cache.config).onSuccess)||l.call(u,n,this),null==(d=(h=this.cache.config).onSettled)||d.call(h,n,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError,onFail:(n,l)=>{this.dispatch({type:"failed",failureCount:n,error:l})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:_.options.retry,retryDelay:_.options.retryDelay,networkMode:_.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(n){this.state=(l=>{var u,d;switch(n.type){case"failed":return{...l,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null!=(u=n.meta)?u:null,fetchStatus:(0,eL.Kw)(this.options.networkMode)?"fetching":"paused",...!l.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...l,data:n.data,dataUpdateCount:l.dataUpdateCount+1,dataUpdatedAt:null!=(d=n.dataUpdatedAt)?d:Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let h=n.error;if((0,eL.DV)(h)&&h.revert&&this.revertState)return{...this.revertState,fetchStatus:"idle"};return{...l,error:h,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:h,fetchStatus:"idle",status:"error"};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...n.state}}})(this.state),eF.V.batch(()=>{this.observers.forEach(l=>{l.onQueryUpdate(n)}),this.cache.notify({query:this,type:"updated",action:n})})}};var eU=u(22436);let QueryCache=class QueryCache extends eU.l{constructor(n){super(),this.config=n||{},this.queries=[],this.queriesMap={}}build(n,l,u){var d;let h=l.queryKey,f=null!=(d=l.queryHash)?d:(0,eN.Rm)(h,l),m=this.get(f);return m||(m=new Query({cache:this,logger:n.getLogger(),queryKey:h,queryHash:f,options:n.defaultQueryOptions(l),state:u,defaultOptions:n.getQueryDefaults(h)}),this.add(m)),m}add(n){this.queriesMap[n.queryHash]||(this.queriesMap[n.queryHash]=n,this.queries.push(n),this.notify({type:"added",query:n}))}remove(n){let l=this.queriesMap[n.queryHash];l&&(n.destroy(),this.queries=this.queries.filter(l=>l!==n),l===n&&delete this.queriesMap[n.queryHash],this.notify({type:"removed",query:n}))}clear(){eF.V.batch(()=>{this.queries.forEach(n=>{this.remove(n)})})}get(n){return this.queriesMap[n]}getAll(){return this.queries}find(n,l){let[u]=(0,eN.I6)(n,l);return void 0===u.exact&&(u.exact=!0),this.queries.find(n=>(0,eN._x)(u,n))}findAll(n,l){let[u]=(0,eN.I6)(n,l);return Object.keys(u).length>0?this.queries.filter(n=>(0,eN._x)(u,n)):this.queries}notify(n){eF.V.batch(()=>{this.listeners.forEach(({listener:l})=>{l(n)})})}onFocus(){eF.V.batch(()=>{this.queries.forEach(n=>{n.onFocus()})})}onOnline(){eF.V.batch(()=>{this.queries.forEach(n=>{n.onOnline()})})}};var eB=u(96278);let MutationCache=class MutationCache extends eU.l{constructor(n){super(),this.config=n||{},this.mutations=[],this.mutationId=0}build(n,l,u){let d=new eB.m({mutationCache:this,logger:n.getLogger(),mutationId:++this.mutationId,options:n.defaultMutationOptions(l),state:u,defaultOptions:l.mutationKey?n.getMutationDefaults(l.mutationKey):void 0});return this.add(d),d}add(n){this.mutations.push(n),this.notify({type:"added",mutation:n})}remove(n){this.mutations=this.mutations.filter(l=>l!==n),this.notify({type:"removed",mutation:n})}clear(){eF.V.batch(()=>{this.mutations.forEach(n=>{this.remove(n)})})}getAll(){return this.mutations}find(n){return void 0===n.exact&&(n.exact=!0),this.mutations.find(l=>(0,eN.X7)(n,l))}findAll(n){return this.mutations.filter(l=>(0,eN.X7)(n,l))}notify(n){eF.V.batch(()=>{this.listeners.forEach(({listener:l})=>{l(n)})})}resumePausedMutations(){var n;return this.resuming=(null!=(n=this.resuming)?n:Promise.resolve()).then(()=>{let n=this.mutations.filter(n=>n.state.isPaused);return eF.V.batch(()=>n.reduce((n,l)=>n.then(()=>l.continue().catch(eN.ZT)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}};var e$=u(85289),eH=u(63240),eW=u(54388);let QueryClient=class QueryClient{constructor(n={}){this.queryCache=n.queryCache||new QueryCache,this.mutationCache=n.mutationCache||new MutationCache,this.logger=n.logger||eV._,this.defaultOptions=n.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,1===this.mountCount&&(this.unsubscribeFocus=e$.j.subscribe(()=>{e$.j.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=eH.N.subscribe(()=>{eH.N.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var n,l;this.mountCount--,0===this.mountCount&&(null==(n=this.unsubscribeFocus)||n.call(this),this.unsubscribeFocus=void 0,null==(l=this.unsubscribeOnline)||l.call(this),this.unsubscribeOnline=void 0)}isFetching(n,l){let[u]=(0,eN.I6)(n,l);return u.fetchStatus="fetching",this.queryCache.findAll(u).length}isMutating(n){return this.mutationCache.findAll({...n,fetching:!0}).length}getQueryData(n,l){var u;return null==(u=this.queryCache.find(n,l))?void 0:u.state.data}ensureQueryData(n,l,u){let d=(0,eN._v)(n,l,u),h=this.getQueryData(d.queryKey);return h?Promise.resolve(h):this.fetchQuery(d)}getQueriesData(n){return this.getQueryCache().findAll(n).map(({queryKey:n,state:l})=>{let u=l.data;return[n,u]})}setQueryData(n,l,u){let d=this.queryCache.find(n),h=null==d?void 0:d.state.data,f=(0,eN.SE)(l,h);if(void 0===f)return;let m=(0,eN._v)(n),g=this.defaultQueryOptions(m);return this.queryCache.build(this,g).setData(f,{...u,manual:!0})}setQueriesData(n,l,u){return eF.V.batch(()=>this.getQueryCache().findAll(n).map(({queryKey:n})=>[n,this.setQueryData(n,l,u)]))}getQueryState(n,l){var u;return null==(u=this.queryCache.find(n,l))?void 0:u.state}removeQueries(n,l){let[u]=(0,eN.I6)(n,l),d=this.queryCache;eF.V.batch(()=>{d.findAll(u).forEach(n=>{d.remove(n)})})}resetQueries(n,l,u){let[d,h]=(0,eN.I6)(n,l,u),f=this.queryCache,m={type:"active",...d};return eF.V.batch(()=>(f.findAll(d).forEach(n=>{n.reset()}),this.refetchQueries(m,h)))}cancelQueries(n,l,u){let[d,h={}]=(0,eN.I6)(n,l,u);void 0===h.revert&&(h.revert=!0);let f=eF.V.batch(()=>this.queryCache.findAll(d).map(n=>n.cancel(h)));return Promise.all(f).then(eN.ZT).catch(eN.ZT)}invalidateQueries(n,l,u){let[d,h]=(0,eN.I6)(n,l,u);return eF.V.batch(()=>{var n,l;if(this.queryCache.findAll(d).forEach(n=>{n.invalidate()}),"none"===d.refetchType)return Promise.resolve();let u={...d,type:null!=(n=null!=(l=d.refetchType)?l:d.type)?n:"active"};return this.refetchQueries(u,h)})}refetchQueries(n,l,u){let[d,h]=(0,eN.I6)(n,l,u),f=eF.V.batch(()=>this.queryCache.findAll(d).filter(n=>!n.isDisabled()).map(n=>{var l;return n.fetch(void 0,{...h,cancelRefetch:null==(l=null==h?void 0:h.cancelRefetch)||l,meta:{refetchPage:d.refetchPage}})})),m=Promise.all(f).then(eN.ZT);return null!=h&&h.throwOnError||(m=m.catch(eN.ZT)),m}fetchQuery(n,l,u){let d=(0,eN._v)(n,l,u),h=this.defaultQueryOptions(d);void 0===h.retry&&(h.retry=!1);let f=this.queryCache.build(this,h);return f.isStaleByTime(h.staleTime)?f.fetch(h):Promise.resolve(f.state.data)}prefetchQuery(n,l,u){return this.fetchQuery(n,l,u).then(eN.ZT).catch(eN.ZT)}fetchInfiniteQuery(n,l,u){let d=(0,eN._v)(n,l,u);return d.behavior=(0,eW.Gm)(),this.fetchQuery(d)}prefetchInfiniteQuery(n,l,u){return this.fetchInfiniteQuery(n,l,u).then(eN.ZT).catch(eN.ZT)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(n){this.defaultOptions=n}setQueryDefaults(n,l){let u=this.queryDefaults.find(l=>(0,eN.yF)(n)===(0,eN.yF)(l.queryKey));u?u.defaultOptions=l:this.queryDefaults.push({queryKey:n,defaultOptions:l})}getQueryDefaults(n){if(!n)return;let l=this.queryDefaults.find(l=>(0,eN.to)(n,l.queryKey));return null==l?void 0:l.defaultOptions}setMutationDefaults(n,l){let u=this.mutationDefaults.find(l=>(0,eN.yF)(n)===(0,eN.yF)(l.mutationKey));u?u.defaultOptions=l:this.mutationDefaults.push({mutationKey:n,defaultOptions:l})}getMutationDefaults(n){if(!n)return;let l=this.mutationDefaults.find(l=>(0,eN.to)(n,l.mutationKey));return null==l?void 0:l.defaultOptions}defaultQueryOptions(n){if(null!=n&&n._defaulted)return n;let l={...this.defaultOptions.queries,...this.getQueryDefaults(null==n?void 0:n.queryKey),...n,_defaulted:!0};return!l.queryHash&&l.queryKey&&(l.queryHash=(0,eN.Rm)(l.queryKey,l)),void 0===l.refetchOnReconnect&&(l.refetchOnReconnect="always"!==l.networkMode),void 0===l.useErrorBoundary&&(l.useErrorBoundary=!!l.suspense),l}defaultMutationOptions(n){return null!=n&&n._defaulted?n:{...this.defaultOptions.mutations,...this.getMutationDefaults(null==n?void 0:n.mutationKey),...n,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}};var eq=u(55830),ez=u(2784);let Hydrate=({children:n,options:l,state:u})=>(!function(n,l={}){let u=(0,eq.NL)({context:l.context}),d=ez.useRef(l);d.current=l,ez.useMemo(()=>{n&&function(n,l,u){if("object"!=typeof l||null===l)return;let d=n.getMutationCache(),h=n.getQueryCache(),f=l.mutations||[],m=l.queries||[];f.forEach(l=>{var h;d.build(n,{...null==u?void 0:null==(h=u.defaultOptions)?void 0:h.mutations,mutationKey:l.mutationKey},l.state)}),m.forEach(({queryKey:l,state:d,queryHash:f})=>{var m;let g=h.get(f);if(g){if(g.state.dataUpdatedAt<d.dataUpdatedAt){let{fetchStatus:n,...l}=d;g.setState(l)}return}h.build(n,{...null==u?void 0:null==(m=u.defaultOptions)?void 0:m.queries,queryKey:l,queryHash:f},{...d,fetchStatus:"idle"})})}(u,n,d.current)},[u,n])}(u,l),n),ReactQueryDevtools=function(){return null};var eG=u(52026),eK=u(23650);let TamaguiProvider=({children:n,...l})=>(0,ey.jsx)(eG.TamaguiProvider,{...l,children:(0,ey.jsx)(eK.Xp,{shouldAddRootHost:!0,children:n})}),eX={ussel:"userSelect",cur:"cursor",pe:"pointerEvents",col:"color",ff:"fontFamily",fos:"fontSize",fost:"fontStyle",fow:"fontWeight",ls:"letterSpacing",lh:"lineHeight",ta:"textAlign",tt:"textTransform",ww:"wordWrap",ac:"alignContent",ai:"alignItems",als:"alignSelf",b:"bottom",bc:"backgroundColor",bg:"backgroundColor",bbc:"borderBottomColor",bblr:"borderBottomLeftRadius",bbrr:"borderBottomRightRadius",bbw:"borderBottomWidth",blc:"borderLeftColor",blw:"borderLeftWidth",boc:"borderColor",br:"borderRadius",bs:"borderStyle",brw:"borderRightWidth",brc:"borderRightColor",btc:"borderTopColor",btlr:"borderTopLeftRadius",btrr:"borderTopRightRadius",btw:"borderTopWidth",bw:"borderWidth",dsp:"display",f:"flex",fb:"flexBasis",fd:"flexDirection",fg:"flexGrow",fs:"flexShrink",fw:"flexWrap",h:"height",jc:"justifyContent",l:"left",m:"margin",mah:"maxHeight",maw:"maxWidth",mb:"marginBottom",mih:"minHeight",miw:"minWidth",ml:"marginLeft",mr:"marginRight",mt:"marginTop",mx:"marginHorizontal",my:"marginVertical",o:"opacity",ov:"overflow",p:"padding",pb:"paddingBottom",pl:"paddingLeft",pos:"position",pr:"paddingRight",pt:"paddingTop",px:"paddingHorizontal",py:"paddingVertical",r:"right",shac:"shadowColor",shar:"shadowRadius",shof:"shadowOffset",shop:"shadowOpacity",t:"top",w:"width",zi:"zIndex"};eX.bls="borderLeftStyle",eX.brs="borderRightStyle",eX.bts="borderTopStyle",eX.bbs="borderBottomStyle",eX.bxs="boxSizing",eX.bxsh="boxShadow",eX.ox="overflowX",eX.oy="overflowY";var eY=u(11444);let eQ=globalThis.matchMedia;var eJ=u(43397);function Bezier(n,l,u,d){function calcBezier(n,l,u){return(((1-3*u+3*l)*n+(3*u-6*l))*n+3*l)*n}function getSlope(n,l,u){return 3*(1-3*u+3*l)*n*n+2*(3*u-6*l)*n+3*l}if(!(n>=0&&n<=1&&u>=0&&u<=1))throw Error("[Reanimated] Bezier x values must be in [0, 1] range.");if(n===l&&u===d)return function(n){return n};let h=Array(11);for(let l=0;l<11;++l)h[l]=calcBezier(.1*l,n,u);return function(f){return n===l&&u===d?f:0===f?0:1===f?1:calcBezier(function(l){let d=0,f=1;for(;10!==f&&h[f]<=l;++f)d+=.1;--f;let m=(l-h[f])/(h[f+1]-h[f]),g=d+.1*m,_=getSlope(g,n,u);return _>=.001?function(n,l,u,d){for(let h=0;h<4;++h){let h=getSlope(l,u,d);if(0===h)break;let f=calcBezier(l,u,d)-n;l-=f/h}return l}(l,g,n,u):0===_?g:function(n,l,u,d,h){let f,m;let g=0;do(f=calcBezier(m=l+(u-l)/2,d,h)-n)>0?u=m:l=m;while(Math.abs(f)>1e-7&&++g<10);return m}(l,d,d+.1,n,u)}(f),l,d)}}let eZ={linear:function(n){return n},ease:function(n){return Bezier(.42,0,1,1)(n)},quad:function(n){return n*n},cubic:function(n){return n*n*n},poly:function(n){return l=>Math.pow(l,n)},sin:function(n){return 1-Math.cos(n*Math.PI/2)},circle:function(n){return 1-Math.sqrt(1-n*n)},exp:function(n){return Math.pow(2,10*(n-1))},elastic:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,l=n*Math.PI;return n=>1-Math.pow(Math.cos(n*Math.PI/2),3)*Math.cos(n*l)},back:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.70158;return l=>l*l*((n+1)*l-n)},bounce:function(n){if(n<1/2.75)return 7.5625*n*n;if(n<2/2.75){let l=n-1.5/2.75;return 7.5625*l*l+.75}if(n<2.5/2.75){let l=n-2.25/2.75;return 7.5625*l*l+.9375}let l=n-2.625/2.75;return 7.5625*l*l+.984375},bezier:function(n,l,u,d){return{factory:()=>Bezier(n,l,u,d)}},bezierFn:function(n,l,u,d){return Bezier(n,l,u,d)},steps:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return u=>{let d=Math.min(Math.max(u,0),1)*n;return l?Math.ceil(d)/n:Math.floor(d)/n}},in:function(n){return n},out:function(n){return l=>1-n(1-l)},inOut:function(n){return l=>l<.5?n(2*l)/2:1-n((1-l)*2)/2}};var e0=u(26516),e1=u(34406);function isJest(){return!!e1.env.JEST_WORKER_ID}function isChromeDebugger(){return!u.g.nativeCallSyncHook||!!u.g.__REMOTEDEV__}function isWeb(){return"web"===e0.Z.OS}function isWindows(){return"windows"===e0.Z.OS}function shouldBeUseWeb(){return isJest()||isChromeDebugger()||isWeb()||isWindows()}function isFabric(){return!!u.g._IS_FABRIC}function isWindowAvailable(){return"undefined"!=typeof window}function isReducedMotion(){return isWeb()?!!isWindowAvailable()&&!window.matchMedia("(prefers-reduced-motion: no-preference)").matches:!!u.g._REANIMATED_IS_REDUCED_MOTION}let e2=((j={})[j.ACCELEROMETER=1]="ACCELEROMETER",j[j.GYROSCOPE=2]="GYROSCOPE",j[j.GRAVITY=3]="GRAVITY",j[j.MAGNETIC_FIELD=4]="MAGNETIC_FIELD",j[j.ROTATION=5]="ROTATION",j),e3=(($={}).System="system",$.Always="always",$.Never="never",$);function mockedRequestAnimationFrame(n){return setTimeout(()=>n(performance.now()),0)}function _defineProperty(n,l,u){var d;return(l="symbol"==typeof(d=function(n,l){if("object"!=typeof n||null===n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var d=u.call(n,l||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(l,"string"))?d:String(d))in n?Object.defineProperty(n,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[l]=u,n}let e5=isJest()||!globalThis.requestAnimationFrame?mockedRequestAnimationFrame:globalThis.requestAnimationFrame;var e4=((z=e4||{}).WEB_IOS="web iOS",z.WEB_ANDROID="web Android",z.WEB="web",z.UNKNOWN="unknown",z);let e9={UI_THREAD_PROPS_WHITELIST:{opacity:!0,transform:!0,backgroundColor:!0,borderRightColor:!0,borderBottomColor:!0,borderColor:!0,borderEndColor:!0,borderLeftColor:!0,borderStartColor:!0,borderTopColor:!0,shadowOpacity:!0,shadowRadius:!0,scaleX:!0,scaleY:!0,translateX:!0,translateY:!0},NATIVE_THREAD_PROPS_WHITELIST:{borderBottomWidth:!0,borderEndWidth:!0,borderLeftWidth:!0,borderRightWidth:!0,borderStartWidth:!0,borderTopWidth:!0,borderWidth:!0,bottom:!0,flex:!0,flexGrow:!0,flexShrink:!0,height:!0,left:!0,margin:!0,marginBottom:!0,marginEnd:!0,marginHorizontal:!0,marginLeft:!0,marginRight:!0,marginStart:!0,marginTop:!0,marginVertical:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,padding:!0,paddingBottom:!0,paddingEnd:!0,paddingHorizontal:!0,paddingLeft:!0,paddingRight:!0,paddingStart:!0,paddingTop:!0,paddingVertical:!0,right:!0,start:!0,top:!0,width:!0,zIndex:!0,borderBottomEndRadius:!0,borderBottomLeftRadius:!0,borderBottomRightRadius:!0,borderBottomStartRadius:!0,borderRadius:!0,borderTopEndRadius:!0,borderTopLeftRadius:!0,borderTopRightRadius:!0,borderTopStartRadius:!0,elevation:!0,fontSize:!0,lineHeight:!0,textShadowRadius:!0,textShadowOffset:!0,letterSpacing:!0,aspectRatio:!0,columnGap:!0,end:!0,flexBasis:!0,gap:!0,rowGap:!0,display:!0,backfaceVisibility:!0,overflow:!0,resizeMode:!0,fontStyle:!0,fontWeight:!0,textAlign:!0,textDecorationLine:!0,fontFamily:!0,textAlignVertical:!0,fontVariant:!0,textDecorationStyle:!0,textTransform:!0,writingDirection:!0,alignContent:!0,alignItems:!0,alignSelf:!0,direction:!0,flexDirection:!0,flexWrap:!0,justifyContent:!0,position:!0,color:!0,tintColor:!0,shadowColor:!0,placeholderTextColor:!0}};if(isWeb()){try{d=u(51811).Z}catch(n){}try{h=u(46195).t_}catch(n){}try{f=u(46195).aO}catch(n){}}let e6=new class{constructor(){_defineProperty(this,"nextSensorId",0),_defineProperty(this,"sensors",new Map),_defineProperty(this,"platform",void 0),_defineProperty(this,"getSensorCallback",(n,l,u)=>{switch(l){case e2.ACCELEROMETER:case e2.GRAVITY:return()=>{let{x:l,y:d,z:h}=n;this.platform===e4.WEB_ANDROID&&([l,d,h]=[-l,-d,-h]),u({x:l,y:d,z:h,interfaceOrientation:0})};case e2.GYROSCOPE:case e2.MAGNETIC_FIELD:return()=>{let{x:l,y:d,z:h}=n;u({x:l,y:d,z:h,interfaceOrientation:0})};case e2.ROTATION:return()=>{let[l,d,h,f]=n.quaternion;this.platform===e4.WEB_ANDROID&&([h,f]=[f,-h]);let m=-Math.atan2(2*(h*f+l*d),l*l-d*d-h*h+f*f),g=Math.sin(-2*(d*f-l*h)),_=-Math.atan2(2*(d*h+l*f),l*l+d*d-h*h-f*f);u({qw:l,qx:d,qy:h,qz:f,yaw:m,pitch:g,roll:_,interfaceOrientation:0})}}})}makeShareableClone(){throw Error("[Reanimated] makeShareableClone should never be called in JSReanimated.")}scheduleOnUI(n){e5(n)}createWorkletRuntime(n,l){throw Error("[Reanimated] createWorkletRuntime is not available in JSReanimated.")}scheduleOnRuntime(){throw Error("[Reanimated] scheduleOnRuntime is not available in JSReanimated.")}registerEventHandler(n,l,u){return -1}unregisterEventHandler(n){}enableLayoutAnimations(){isWeb()?console.warn("[Reanimated] Layout Animations are not supported on web yet."):isJest()?console.warn("[Reanimated] Layout Animations are no-ops when using Jest."):isChromeDebugger()?console.warn("[Reanimated] Layout Animations are no-ops when using Chrome Debugger."):console.warn("[Reanimated] Layout Animations are not supported on this configuration.")}configureLayoutAnimation(){}setShouldAnimateExitingForTag(){}registerSensor(n,l,u,d){if(!isWindowAvailable())return -1;if(void 0===this.platform&&this.detectPlatform(),!(this.getSensorName(n) in window))return console.warn("[Reanimated] Sensor is not available."+(isWeb()&&"https:"!==location.protocol?" Make sure you use secure origin with `npx expo start --web --https`.":"")+(this.platform===e4.WEB_IOS?" For iOS web, you will also have to also grant permission in the browser: https://dev.to/li/how-to-requestpermission-for-devicemotion-and-deviceorientation-events-in-ios-13-46g2.":"")),-1;void 0===this.platform&&this.detectPlatform();let h=this.initializeSensor(n,l);return h.addEventListener("reading",this.getSensorCallback(h,n,d)),h.start(),this.sensors.set(this.nextSensorId,h),this.nextSensorId++}unregisterSensor(n){let l=this.sensors.get(n);void 0!==l&&(l.stop(),this.sensors.delete(n))}subscribeForKeyboardEvents(n){return isWeb()?console.warn("[Reanimated] useAnimatedKeyboard is not available on web yet."):isJest()?console.warn("[Reanimated] useAnimatedKeyboard is not available when using Jest."):isChromeDebugger()?console.warn("[Reanimated] useAnimatedKeyboard is not available when using Chrome Debugger."):console.warn("[Reanimated] useAnimatedKeyboard is not available on this configuration."),-1}unsubscribeFromKeyboardEvents(n){}initializeSensor(n,l){let u=l<=0?{referenceFrame:"device"}:{frequency:1e3/l};switch(n){case e2.ACCELEROMETER:return new window.Accelerometer(u);case e2.GYROSCOPE:return new window.Gyroscope(u);case e2.GRAVITY:return new window.GravitySensor(u);case e2.MAGNETIC_FIELD:return new window.Magnetometer(u);case e2.ROTATION:return new window.AbsoluteOrientationSensor(u)}}getSensorName(n){switch(n){case e2.ACCELEROMETER:return"Accelerometer";case e2.GRAVITY:return"GravitySensor";case e2.GYROSCOPE:return"Gyroscope";case e2.MAGNETIC_FIELD:return"Magnetometer";case e2.ROTATION:return"AbsoluteOrientationSensor"}}detectPlatform(){let n=navigator.userAgent||navigator.vendor||window.opera;void 0===n?this.platform=e4.UNKNOWN:/iPad|iPhone|iPod/.test(n)?this.platform=e4.WEB_IOS:/android/i.test(n)?this.platform=e4.WEB_ANDROID:this.platform=e4.WEB}makeSynchronizedDataHolder(n){throw Error("[Reanimated] makeSynchronizedDataHolder is not available in JSReanimated.")}getDataSynchronously(n){throw Error("[Reanimated] getDataSynchronously is not available in JSReanimated.")}getViewProp(n,l,u){throw Error("[Reanimated] getViewProp is not available in JSReanimated.")}configureProps(){throw Error("[Reanimated] configureProps is not available in JSReanimated.")}};u.g._makeShareableClone=()=>{throw Error("[Reanimated] _makeShareableClone should never be called in JSReanimated.")},u.g._scheduleOnJS=()=>{throw Error("[Reanimated] _scheduleOnJS should never be called in JSReanimated.")},u.g._scheduleOnRuntime=()=>{throw Error("[Reanimated] _scheduleOnRuntime should never be called in JSReanimated.")};let _updatePropsJS=(n,l,u)=>{if(l._component){let h=l._component,[f]=Object.keys(n).reduce((l,u)=>{let d=n[u];return l["function"==typeof d?1:0][u]=d,l},[{},{}]);"function"==typeof h.setNativeProps?setNativeProps(h,f,u):void 0!==d&&void 0!==h.style?updatePropsDOM(h,f,u):Object.keys(h.props).length>0?Object.keys(h.props).forEach(n=>{if(!f[n])return;let l=n.replace(/[A-Z]/g,n=>"-"+n.toLowerCase());h._touchableNode.setAttribute(l,f[n])}):console.warn(`[Reanimated] It's not possible to manipulate the component ${h}`)}},setNativeProps=(n,l,u)=>{var d,h;if(u){let u={};for(let n in l)e9.NATIVE_THREAD_PROPS_WHITELIST[n]&&(u[n]=l[n]);null===(h=n.setNativeProps)||void 0===h||h.call(n,u)}let f=n.previousStyle?n.previousStyle:{},m={...f,...l};n.previousStyle=m,null===(d=n.setNativeProps)||void 0===d||d.call(n,{style:m})},updatePropsDOM=(n,l,u)=>{let m=n.previousStyle?n.previousStyle:{},g={...m,...l};n.previousStyle=g;let _=d(g);for(let l in Array.isArray(_.transform)&&void 0!==h&&(_.transform=h(_.transform)),void 0!==f&&(_.textShadowColor||_.textShadowRadius||_.textShadowOffset)&&(_.textShadow=f({textShadowColor:_.textShadowColor,textShadowOffset:_.textShadowOffset,textShadowRadius:_.textShadowRadius})),_)u?n.setAttribute(l,_[l]):n.style[l]=_[l]},e7=shouldBeUseWeb(),e8=new WeakMap,te=Symbol("shareable flag");function isHostObject(n){return"REANIMATED_MAGIC_KEY"in n}function registerShareableMapping(n,l){e7||e8.set(n,l||te)}let tt={__init:()=>new Proxy({},{get:(n,l)=>{if("_isReanimatedSharedValue"===l||"__remoteFunction"===l)return!1;throw Error(`[Reanimated] Trying to access property \`${String(l)}\` of an object which cannot be sent to the UI runtime.`)},set:()=>{throw Error("[Reanimated] Trying to write to an object which cannot be sent to the UI runtime.")}})},tn=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","DataView"];function shareables_makeShareableCloneRecursive(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e7)return n;if(d>=30){if(30===d)m=n;else if(n===m)throw Error("[Reanimated] Trying to convert a cyclic object to a shareable. This is not supported.")}else m=void 0;let h=typeof n,f="function"===h;if(("object"===h||f)&&null!==n){let h=e8.get(n);if(h===te)return n;if(void 0!==h)return h;{let h;if(Array.isArray(n))h=n.map(n=>shareables_makeShareableCloneRecursive(n,l,d+1));else if(f&&void 0===n.__workletHash)h=n;else if(isHostObject(n))h=n;else if(Object.getPrototypeOf(n)===Object.prototype||f)for(let[u,f]of(h={},void 0!==n.__workletHash&&(n.__stackDetails&&delete n.__stackDetails,h.__initData=shareables_makeShareableCloneRecursive(n.__initData,!0,d+1)),Object.entries(n)))("__initData"!==u||void 0===h.__initData)&&(h[u]=shareables_makeShareableCloneRecursive(f,l,d+1));else if(n instanceof RegExp){let l=n.source,u=n.flags,d=shareables_makeShareableCloneRecursive({__init:()=>new RegExp(l,u)});return registerShareableMapping(n,d),d}else if(n instanceof ArrayBuffer)h=n;else if(ArrayBuffer.isView(n)){let l=n.buffer,d=n.constructor.name,h=shareables_makeShareableCloneRecursive({__init:()=>{if(!tn.includes(d))throw Error(`[Reanimated] Invalid array view name \`${d}\`.`);let n=u.g[d];if(void 0===n)throw Error(`[Reanimated] Constructor for \`${d}\` not found.`);return new n(l)}});return registerShareableMapping(n,h),h}else{let l=shareables_makeShareableCloneRecursive(tt);return e8.set(n,l),l}let m=e6.makeShareableClone(h,l);return e8.set(n,m),e8.set(m,te),m}}return e6.makeShareableClone(n,l)}function makeShareableCloneOnUIRecursive(n){return e7?n:function cloneRecursive(n){if("object"==typeof n&&null!==n||"function"==typeof n){if(isHostObject(n))return _makeShareableClone(n);if(n.__remoteFunction)return n.__remoteFunction;if(Array.isArray(n))return _makeShareableClone(n.map(cloneRecursive));let l={};for(let[u,d]of Object.entries(n))l[u]=cloneRecursive(d);return _makeShareableClone(l)}return _makeShareableClone(n)}(n)}function makeShareable(n){if(e7)return n;let l=shareables_makeShareableCloneRecursive({__init:()=>n});return registerShareableMapping(n,l),n}let to="[-+]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)",ts=to+"%";function call(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];return"\\(\\s*("+l.join(")\\s*,\\s*(")+")\\s*\\)"}let ta={rgb:RegExp("rgb"+call(to,to,to)),rgba:RegExp("rgba"+call(to,to,to,to)),hsl:RegExp("hsl"+call(to,ts,ts)),hsla:RegExp("hsla"+call(to,ts,ts,to)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/};function hue2rgb(n,l,u){return(u<0&&(u+=1),u>1&&(u-=1),u<1/6)?n+(l-n)*6*u:u<.5?l:u<2/3?n+(l-n)*(2/3-u)*6:n}function hslToRgb(n,l,u){let d=u<.5?u*(1+l):u+l-u*l,h=2*u-d,f=hue2rgb(h,d,n+1/3),m=hue2rgb(h,d,n),g=hue2rgb(h,d,n-1/3);return Math.round(255*f)<<24|Math.round(255*m)<<16|Math.round(255*g)<<8}function parse255(n){let l=Number.parseInt(n,10);return l<0?0:l>255?255:l}function parse360(n){let l=Number.parseFloat(n);return(l%360+360)%360/360}function parse1(n){let l=Number.parseFloat(n);return l<0?0:l>1?255:Math.round(255*l)}function parsePercentage(n){let l=Number.parseFloat(n);return l<0?0:l>100?1:l/100}let tl=makeShareable({transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}),tu=makeShareable(["backgroundColor","borderBottomColor","borderColor","borderLeftColor","borderRightColor","borderTopColor","borderStartColor","borderEndColor","borderBlockColor","borderBlockEndColor","borderBlockStartColor","color","shadowColor","textDecorationColor","tintColor","textShadowColor","overlayColor"]);isWeb();let tc="android"===e0.Z.OS;function processColorInitially(n){let l;if(null==n||"number"==typeof n)return n;let u="number"==typeof n?n>>>0===n&&n>=0&&n<=4294967295?n:null:"string"!=typeof n?null:(l=ta.hex6.exec(n))?Number.parseInt(l[1]+"ff",16)>>>0:void 0!==tl[n]?tl[n]:(l=ta.rgb.exec(n))?(parse255(l[1])<<24|parse255(l[2])<<16|parse255(l[3])<<8|255)>>>0:(l=ta.rgba.exec(n))?(parse255(l[1])<<24|parse255(l[2])<<16|parse255(l[3])<<8|parse1(l[4]))>>>0:(l=ta.hex3.exec(n))?Number.parseInt(l[1]+l[1]+l[2]+l[2]+l[3]+l[3]+"ff",16)>>>0:(l=ta.hex8.exec(n))?Number.parseInt(l[1],16)>>>0:(l=ta.hex4.exec(n))?Number.parseInt(l[1]+l[1]+l[2]+l[2]+l[3]+l[3]+l[4]+l[4],16)>>>0:(l=ta.hsl.exec(n))?(255|hslToRgb(parse360(l[1]),parsePercentage(l[2]),parsePercentage(l[3])))>>>0:(l=ta.hsla.exec(n))?(hslToRgb(parse360(l[1]),parsePercentage(l[2]),parsePercentage(l[3]))|parse1(l[4]))>>>0:null;return null==u?void 0:"number"!=typeof u?null:u=(u<<24|u>>>8)>>>0}function isColor(n){return"string"==typeof n&&null!=processColorInitially(n)}function convertToRGBA(n){let l=processColorInitially(n);return[(l<<8>>>24)/255,(l<<16>>>24)/255,(l<<24>>>24)/255,(l>>>24)/255]}function rgbaArrayToRGBAColor(n){return`rgba(${Math.round(255*n[0])}, ${Math.round(255*n[1])}, ${Math.round(255*n[2])}, ${n[3]})`}function toLinearSpace(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2.2,u=[];for(let d=0;d<3;++d)u.push(Math.pow(n[d],l));return u.push(n[3]),u}function toGammaSpace(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2.2,u=[];for(let d=0;d<3;++d)u.push(Math.pow(n[d],1/l));return u.push(n[3]),u}function isAffineMatrixFlat(n){return Array.isArray(n)&&16===n.length&&n.every(n=>"number"==typeof n&&!isNaN(n))}function unflatten(n){return[[n[0],n[1],n[2],n[3]],[n[4],n[5],n[6],n[7]],[n[8],n[9],n[10],n[11]],[n[12],n[13],n[14],n[15]]]}function maybeFlattenMatrix(n){return Array.isArray(n)&&4===n.length&&n.every(n=>Array.isArray(n)&&4===n.length&&n.every(n=>"number"==typeof n&&!isNaN(n)))?n.flat():n}function multiplyMatrices(n,l){return[[n[0][0]*l[0][0]+n[0][1]*l[1][0]+n[0][2]*l[2][0]+n[0][3]*l[3][0],n[0][0]*l[0][1]+n[0][1]*l[1][1]+n[0][2]*l[2][1]+n[0][3]*l[3][1],n[0][0]*l[0][2]+n[0][1]*l[1][2]+n[0][2]*l[2][2]+n[0][3]*l[3][2],n[0][0]*l[0][3]+n[0][1]*l[1][3]+n[0][2]*l[2][3]+n[0][3]*l[3][3]],[n[1][0]*l[0][0]+n[1][1]*l[1][0]+n[1][2]*l[2][0]+n[1][3]*l[3][0],n[1][0]*l[0][1]+n[1][1]*l[1][1]+n[1][2]*l[2][1]+n[1][3]*l[3][1],n[1][0]*l[0][2]+n[1][1]*l[1][2]+n[1][2]*l[2][2]+n[1][3]*l[3][2],n[1][0]*l[0][3]+n[1][1]*l[1][3]+n[1][2]*l[2][3]+n[1][3]*l[3][3]],[n[2][0]*l[0][0]+n[2][1]*l[1][0]+n[2][2]*l[2][0]+n[2][3]*l[3][0],n[2][0]*l[0][1]+n[2][1]*l[1][1]+n[2][2]*l[2][1]+n[2][3]*l[3][1],n[2][0]*l[0][2]+n[2][1]*l[1][2]+n[2][2]*l[2][2]+n[2][3]*l[3][2],n[2][0]*l[0][3]+n[2][1]*l[1][3]+n[2][2]*l[2][3]+n[2][3]*l[3][3]],[n[3][0]*l[0][0]+n[3][1]*l[1][0]+n[3][2]*l[2][0]+n[3][3]*l[3][0],n[3][0]*l[0][1]+n[3][1]*l[1][1]+n[3][2]*l[2][1]+n[3][3]*l[3][1],n[3][0]*l[0][2]+n[3][1]*l[1][2]+n[3][2]*l[2][2]+n[3][3]*l[3][2],n[3][0]*l[0][3]+n[3][1]*l[1][3]+n[3][2]*l[2][3]+n[3][3]*l[3][3]]]}function norm3d(n,l,u){return Math.sqrt(n*n+l*l+u*u)}function transposeMatrix(n){let l=n.flat();return[[l[0],l[4],l[8],l[12]],[l[1],l[5],l[9],l[13]],[l[2],l[6],l[10],l[14]],[l[3],l[7],l[11],l[15]]]}function innerProduct(n,l){return n.reduce((u,d,h)=>u+n[h]*l[h],0)}function projection(n,l){let u=innerProduct(n,l)/innerProduct(n,n);return n.map(n=>n*u)}function subtractVectors(n,l){return n.map((u,d)=>n[d]-l[d])}function decomposeMatrixIntoMatricesAndAngles(n){let l,u;let{scaleMatrix:d,rotationMatrix:h,translationMatrix:f,skewMatrix:m}=function(n){let l=maybeFlattenMatrix(n);if(0===l[15])throw Error("[Reanimated] Invalid transform matrix.");l.forEach((n,u)=>l[u]/=l[15]);let u=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[l[12],l[13],l[14],1]],d=l[15]*norm3d(l[0],l[4],l[8]),h=l[15]*norm3d(l[1],l[5],l[9]),f=l[15]*norm3d(l[2],l[6],l[10]),m=[[l[0]/d,l[1]/d,l[2]/d,0],[l[4]/h,l[5]/h,l[6]/h,0],[l[8]/f,l[9]/f,l[10]/f,0],[0,0,0,1]],{rotationMatrix:g,skewMatrix:_}=function(n){let[l,u,d,h]=n,f=subtractVectors(u,projection(l,u)),m=subtractVectors(subtractVectors(d,projection(l,d)),projection(f,d)),g=subtractVectors(subtractVectors(subtractVectors(h,projection(l,h)),projection(f,h)),projection(m,h)),[_,j,$,z]=[l,f,m,g].map(n=>{var l;return l=1/Math.sqrt(innerProduct(n,n)),n.map(n=>n*l)}),ee=[[_[0],j[0],$[0],z[0]],[_[1],j[1],$[1],z[1]],[_[2],j[2],$[2],z[2]],[_[3],j[3],$[3],z[3]]],et=[[innerProduct(_,l),innerProduct(_,u),innerProduct(_,d),innerProduct(_,h)],[0,innerProduct(j,u),innerProduct(j,d),innerProduct(j,h)],[0,0,innerProduct($,d),innerProduct($,h)],[0,0,0,innerProduct(z,h)]];return{rotationMatrix:transposeMatrix(ee),skewMatrix:transposeMatrix(et)}}(m);return{translationMatrix:u,scaleMatrix:[[d,0,0,0],[0,h,0,0],[0,0,f,0],[0,0,0,1]],rotationMatrix:g,skewMatrix:_}}(n),g=-h[0][2],_=Math.asin(g);return 1===g||-1===g?(u=0,l=Math.atan2(g*h[0][1],g*h[0][2])):(u=Math.atan2(h[0][1],h[0][0]),l=Math.atan2(h[1][2],h[2][2])),{scaleMatrix:d,rotationMatrix:h,translationMatrix:f,skewMatrix:m,rx:l||0,ry:_||0,rz:u||0}}let td=!1,th=isReducedMotion();function initialUpdaterRun(n){td=!0;let l=n();return td=!1,l}function recognizePrefixSuffix(n){if("string"!=typeof n)return{strippedValue:n};{let l=n.match(/([A-Za-z]*)(-?\d*\.?\d*)([eE][-+]?[0-9]+)?([A-Za-z%]*)/);if(!l)throw Error("[Reanimated] Couldn't parse animation value.");let u=l[1],d=l[4],h=l[2]+(l[3]??"");return{prefix:u,suffix:d,strippedValue:parseFloat(h)}}}function getReduceMotionFromConfig(n){return n&&n!==e3.System?n===e3.Always:th}function getReduceMotionForAnimation(n){if(n)return getReduceMotionFromConfig(n)}let tp=shouldBeUseWeb();function defineAnimation(n,l){if(td)return n;let create=()=>{let n=l();return!function(n){let l=n.onStart,u=n.onFrame;if(n.isHigherOrder){n.onStart=(n,u,d,h)=>(void 0===n.reduceMotion&&(n.reduceMotion=getReduceMotionFromConfig()),l(n,u,d,h));return}let d=Object.assign({},n);delete d.callback;let prefNumberSuffOnStart=(n,u,d,h)=>{let{prefix:f,suffix:m,strippedValue:g}=recognizePrefixSuffix(u);n.__prefix=f,n.__suffix=m,n.strippedCurrent=g;let{strippedValue:_}=recognizePrefixSuffix(n.toValue);if(n.current=g,n.startValue=g,n.toValue=_,h&&h!==n){let{prefix:n,suffix:l,strippedValue:u}=recognizePrefixSuffix(h.current);h.current=u,h.__prefix=n,h.__suffix=l}l(n,g,d,h),n.current=(n.__prefix??"")+n.current+(n.__suffix??""),h&&h!==n&&(h.current=(h.__prefix??"")+h.current+(h.__suffix??""))},prefNumberSuffOnFrame=(n,l)=>{n.current=n.strippedCurrent;let d=u(n,l);return n.strippedCurrent=n.current,n.current=(n.__prefix??"")+n.current+(n.__suffix??""),d},h=["R","G","B","A"],colorOnStart=(n,l,u,f)=>{let m,g,_;let j=[];isColor(l)&&(g=toLinearSpace(convertToRGBA(n.current)),m=toLinearSpace(convertToRGBA(l)),n.toValue&&(_=toLinearSpace(convertToRGBA(n.toValue)))),h.forEach((l,h)=>{n[l]=Object.assign({},d),n[l].current=g[h],n[l].toValue=_?_[h]:void 0,n[l].onStart(n[l],m[h],u,f?f[l]:void 0),j.push(n[l].current)}),n.current=rgbaArrayToRGBAColor(toGammaSpace(j))},colorOnFrame=(n,l)=>{let u=toLinearSpace(convertToRGBA(n.current)),d=[],f=!0;return h.forEach((h,m)=>{n[h].current=u[m];let g=n[h].onFrame(n[h],l);f=f&&g,d.push(n[h].current)}),n.current=rgbaArrayToRGBAColor(toGammaSpace(d)),f},transformationMatrixOnStart=(n,l,u,h)=>{let f=n.toValue;n.startMatrices=decomposeMatrixIntoMatricesAndAngles(l),n.stopMatrices=decomposeMatrixIntoMatricesAndAngles(f),n[0]=Object.assign({},d),n[0].current=0,n[0].toValue=100,n[0].onStart(n[0],0,u,h?h[0]:void 0),n.current=l},transformationMatrixOnFrame=(n,l)=>{let u=!0,d=n[0].onFrame(n[0],l);u=u&&d;let h=n[0].current/100,f=[];["translationMatrix","scaleMatrix","skewMatrix"].forEach((l,u)=>{var d;return f.push(function(n,l){let u=isAffineMatrixFlat(n),d=maybeFlattenMatrix(n),h=maybeFlattenMatrix(l),f=d.map((n,l)=>d[l]+h[l]);return u?f:unflatten(f)}(d=n.startMatrices[l],function(n,l){let u=isAffineMatrixFlat(n),d=maybeFlattenMatrix(n),h=d.map(n=>n*l);return u?h:unflatten(h)}(function(n,l){let u=isAffineMatrixFlat(n),d=maybeFlattenMatrix(n),h=maybeFlattenMatrix(l),f=d.map((n,l)=>d[l]-h[l]);return u?f:unflatten(f)}(n.stopMatrices[l],d),h)))});let[m,g,_]=f,j=[];["x","y","z"].forEach((l,u)=>{var d;let f=(d=n.startMatrices["r"+l])+h*(n.stopMatrices["r"+l]-d);j.push(function(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"z",u=Math.cos(n),d=Math.sin(n);switch(l){case"z":return[[u,d,0,0],[-d,u,0,0],[0,0,1,0],[0,0,0,1]];case"y":return[[u,0,-d,0],[0,1,0,0],[d,0,u,0],[0,0,0,1]];case"x":return[[1,0,0,0],[0,u,d,0],[0,-d,u,0],[0,0,0,1]]}}(f,l))});let[$,z,ee]=j,et=multiplyMatrices($,multiplyMatrices(z,ee)),en=multiplyMatrices(multiplyMatrices(g,multiplyMatrices(_,et)),m).flat();return n.current=en,u},arrayOnStart=(n,l,u,h)=>{l.forEach((l,f)=>{n[f]=Object.assign({},d),n[f].current=l,n[f].toValue=n.toValue[f],n[f].onStart(n[f],l,u,h?h[f]:void 0)}),n.current=l},arrayOnFrame=(n,l)=>{let u=!0;return n.current.forEach((d,h)=>{let f=n[h].onFrame(n[h],l);u=u&&f,n.current[h]=n[h].current}),u},objectOnStart=(n,l,u,h)=>{for(let f in l)n[f]=Object.assign({},d),n[f].onStart=n.onStart,n[f].current=l[f],n[f].toValue=n.toValue[f],n[f].onStart(n[f],l[f],u,h?h[f]:void 0);n.current=l},objectOnFrame=(n,l)=>{let u=!0,d={};for(let h in n.current){let f=n[h].onFrame(n[h],l);u=u&&f,d[h]=n[h].current}return n.current=d,u};n.onStart=(n,u,d,h)=>{if(void 0===n.reduceMotion&&(n.reduceMotion=getReduceMotionFromConfig()),n.reduceMotion){void 0!==n.toValue?n.current=n.toValue:l(n,u,d,h),n.startTime=0,n.onFrame=()=>!0;return}if(isColor(u)){colorOnStart(n,u,d,h),n.onFrame=colorOnFrame;return}if(isAffineMatrixFlat(u)){transformationMatrixOnStart(n,u,d,h),n.onFrame=transformationMatrixOnFrame;return}if(Array.isArray(u)){arrayOnStart(n,u,d,h),n.onFrame=arrayOnFrame;return}if("string"==typeof u){prefNumberSuffOnStart(n,u,d,h),n.onFrame=prefNumberSuffOnFrame;return}if("object"==typeof u&&null!==u){objectOnStart(n,u,d,h),n.onFrame=objectOnFrame;return}l(n,u,d,h)}}(n),n};return _WORKLET||tp?create():create}function cancelAnimation(n){n.value=n.value}let withTiming=function(n,l,u){return defineAnimation(n,()=>{let d={duration:300,easing:eZ.inOut(eZ.quad)};return l&&Object.keys(l).forEach(n=>d[n]=l[n]),{type:"timing",onFrame:function(n,l){let{toValue:u,startTime:h,startValue:f}=n,m=l-h;if(m>=d.duration)return n.startTime=0,n.current=u,!0;let g=n.easing(m/d.duration);return n.current=f+(u-f)*g,!1},onStart:function(l,u,h,f){f&&"timing"===f.type&&f.toValue===n&&f.startTime?(l.startTime=f.startTime,l.startValue=f.startValue):(l.startTime=h,l.startValue=u),l.current=u,"object"==typeof d.easing?l.easing=d.easing.factory():l.easing=d.easing},progress:0,toValue:n,startValue:0,startTime:0,easing:()=>0,current:n,callback:u,reduceMotion:getReduceMotionForAnimation(null==l?void 0:l.reduceMotion)}})},withSpring=(n,l,u)=>defineAnimation(n,()=>{let d;let h={damping:10,mass:1,stiffness:100,overshootClamping:!1,restDisplacementThreshold:.01,restSpeedThreshold:2,velocity:0,duration:2e3,dampingRatio:.5,reduceMotion:void 0,...l,useDuration:!!(null!=l&&l.duration||null!=l&&l.dampingRatio),skipAnimation:!1};return h.skipAnimation=(d="",["stiffness","damping","dampingRatio","restDisplacementThreshold","restSpeedThreshold","mass"].forEach(n=>{let l=h[n];l<=0&&(d+=`, ${n} must be grater than zero but got ${l}`)}),h.duration<0&&(d+=`, duration can't be negative, got ${h.duration}`),""!==d&&console.warn("[Reanimated] Invalid spring config"+d),""!==d),0===h.duration&&(h.skipAnimation=!0),{onFrame:function(n,l){let{toValue:u,startTimestamp:d,current:f}=n,m=l-d;if(h.useDuration&&m>=h.duration||h.skipAnimation)return n.current=u,n.lastTimestamp=0,!0;let{lastTimestamp:g,velocity:_}=n,j=Math.min(l-g,64);n.lastTimestamp=l;let $=j/1e3,z=-_,ee=u-f,{zeta:et,omega0:en,omega1:eo}=n,{position:es,velocity:el}=et<1?function(n,l){let{toValue:u,current:d,velocity:h}=n,{zeta:f,t:m,omega0:g,omega1:_}=l,j=-h,$=u-d,z=Math.sin(_*m),ee=Math.cos(_*m),et=Math.exp(-f*g*m),en=et*(z*((j+f*g*$)/_)+$*ee);return{position:u-en,velocity:f*g*en-et*(ee*(j+f*g*$)-_*$*z)}}(n,{zeta:et,v0:z,x0:ee,omega0:en,omega1:eo,t:$}):function(n,l){let{toValue:u}=n,{v0:d,x0:h,omega0:f,t:m}=l,g=Math.exp(-f*m);return{position:u-g*(h+(d+f*h)*m),velocity:g*(d*(m*f-1)+m*h*f*f)}}(n,{v0:z,x0:ee,omega0:en,t:$});n.current=es,n.velocity=el;let{isOvershooting:eu,isVelocity:ec,isDisplacement:eh}=function(n,l){let{toValue:u,velocity:d,startValue:h,current:f}=n,m=!!l.overshootClamping&&(f>u&&h<u||f<u&&h>u),g=Math.abs(d)<l.restSpeedThreshold,_=Math.abs(u-f)<l.restDisplacementThreshold;return{isOvershooting:m,isVelocity:g,isDisplacement:_}}(n,h);return!h.useDuration&&(!!eu||!!ec&&!!eh)&&(n.velocity=0,n.current=u,n.lastTimestamp=0,!0)},onStart:function(n,l,u,d){n.current=l,n.startValue=l;let f=h.mass,m=(null==d?void 0:d.lastTimestamp)&&(null==d?void 0:d.startTimestamp)&&(null==d?void 0:d.toValue)===n.toValue&&(null==d?void 0:d.duration)===n.duration&&(null==d?void 0:d.dampingRatio)===n.dampingRatio,g=h.duration,_=m?null==d?void 0:d.startValue:Number(n.toValue)-l;if(d?n.velocity=(m?null==d?void 0:d.velocity:(null==d?void 0:d.velocity)+h.velocity)||0:n.velocity=h.velocity||0,m)n.zeta=(null==d?void 0:d.zeta)||0,n.omega0=(null==d?void 0:d.omega0)||0,n.omega1=(null==d?void 0:d.omega1)||0;else{if(h.useDuration){let l=m?g-(((null==d?void 0:d.lastTimestamp)||0)-((null==d?void 0:d.startTimestamp)||0)):g;h.duration=l,f=function(n,l,u){if(l.skipAnimation)return 0;let{stiffness:d,dampingRatio:h,restSpeedThreshold:f,duration:m}=l;return function(n){let{min:l,max:u,func:d,maxIterations:h=20}=n,f=h,m=(u+l)/2;for(;Math.abs(d(m))>5e-5&&f>0;)f-=1,0>d(m)?l=m:u=m,m=(l+u)/2;return m}({min:0,max:100,func:l=>{let g=(l*u*u+d*n*n)/(Math.exp(1-.5*h)*d),_=2*h*Math.sqrt(d*l);return 1e3*(-2*l/_)*Math.log(.01*f/g)-m}})}(_,h,n.velocity)}let{zeta:l,omega0:u,omega1:j}=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,l=arguments.length>1?arguments[1]:void 0;if(l.skipAnimation)return{zeta:0,omega0:0,omega1:0};if(l.useDuration){let{stiffness:u,dampingRatio:d}=l,h=Math.sqrt(u/n),f=h*Math.sqrt(1-d**2);return{zeta:d,omega0:h,omega1:f}}{let{damping:n,mass:u,stiffness:d}=l,h=n/(2*Math.sqrt(d*u)),f=Math.sqrt(d/u),m=f*Math.sqrt(1-h**2);return{zeta:h,omega0:f,omega1:m}}}(f,h);n.zeta=l,n.omega0=u,n.omega1=j}n.lastTimestamp=(null==d?void 0:d.lastTimestamp)||u,n.startTimestamp=m&&(null==d?void 0:d.startTimestamp)||u},toValue:n,velocity:h.velocity||0,current:n,startValue:0,callback:u,lastTimestamp:0,startTimestamp:0,zeta:0,omega0:0,omega1:0,reduceMotion:getReduceMotionForAnimation(h.reduceMotion)}}),tf=isWeb(),tm=tf?.05:1,withDecay=function(n,l){return defineAnimation(0,()=>{let u={deceleration:.998,velocityFactor:1,velocity:0,rubberBandFactor:.6};n&&Object.keys(n).forEach(l=>u[l]=n[l]);let d=u.rubberBandEffect&&Array.isArray(u.clamp)&&2===u.clamp.length?(n,l)=>(function(n,l,u){let{lastTimestamp:d,startTimestamp:h,current:f,velocity:m}=n,g=Math.min(l-d,64),_=Math.abs(f-u.clamp[0])<Math.abs(f-u.clamp[1])?0:1,j=0;(f<u.clamp[0]||f>u.clamp[1])&&(j=f-u.clamp[_]);let $=m*Math.exp(-(1-u.deceleration)*(l-h)*.1)-j*u.rubberBandFactor;if(Math.abs(j)>.1)n.springActive=!0;else if(n.springActive)return n.current=u.clamp[_],!0;else if(Math.abs($)<tm)return!0;return n.current=f+$*u.velocityFactor*g/1e3,n.velocity=$,n.lastTimestamp=l,!1})(n,l,u):(n,l)=>(function(n,l,u){let{lastTimestamp:d,startTimestamp:h,initialVelocity:f,current:m,velocity:g}=n,_=Math.min(l-d,64),j=g*Math.exp(-(1-u.deceleration)*(l-h)*.1);if(n.current=m+j*u.velocityFactor*_/1e3,n.velocity=j,n.lastTimestamp=l,u.clamp){if(f<0&&n.current<=u.clamp[0])return n.current=u.clamp[0],!0;if(f>0&&n.current>=u.clamp[1])return n.current=u.clamp[1],!0}return Math.abs(j)<tm})(n,l,u);return{onFrame:d,onStart:function(n,l,d){n.current=l,n.lastTimestamp=d,n.startTimestamp=d,n.initialVelocity=u.velocity,function(n){if(n.clamp){if(!Array.isArray(n.clamp))throw Error(`[Reanimated] \`config.clamp\` must be an array but is ${typeof n.clamp}.`);if(2!==n.clamp.length)throw Error(`[Reanimated] \`clamp array\` must contain 2 items but is given ${n.clamp.length}.`)}if(n.velocityFactor<=0)throw Error(`[Reanimated] \`config.velocityFactor\` must be greather then 0 but is ${n.velocityFactor}.`);if(n.rubberBandEffect&&!n.clamp)throw Error("[Reanimated] You need to set `clamp` property when using `rubberBandEffect`.")}(u),n.reduceMotion&&u.clamp&&(l<u.clamp[0]?n.current=u.clamp[0]:l>u.clamp[1]&&(n.current=u.clamp[1]))},callback:l,velocity:u.velocity??0,initialVelocity:0,current:0,lastTimestamp:0,startTimestamp:0,reduceMotion:getReduceMotionForAnimation(u.reduceMotion)}})},tg=isJest(),t_=shouldBeUseWeb(),ty=[],tv=t_?()=>{}:function(){u.g.__callMicrotasks()};function runOnUI(n){return function(){for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];if(tg){e6.scheduleOnUI(shareables_makeShareableCloneRecursive(()=>{n(...u)}));return}ty.push([n,u]),1===ty.length&&queueMicrotask(()=>{let n=ty;ty=[],e6.scheduleOnUI(shareables_makeShareableCloneRecursive(()=>{n.forEach(n=>{let[l,u]=n;l(...u)}),tv()}))})}}function runOnUIImmediately(n){return function(){for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];e6.scheduleOnUI(shareables_makeShareableCloneRecursive(()=>{n(...u)}))}}function runWorkletOnJS(n){for(var l=arguments.length,u=Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];n(...u)}function runOnJS(n){return t_||!_WORKLET?function(){for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];return queueMicrotask(u.length?()=>n(...u):n)}:n.__workletHash?function(){for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];return runOnJS(runWorkletOnJS)(n,...u)}:(n.__remoteFunction&&(n=n.__remoteFunction),function(){for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];_scheduleOnJS(n,u.length>0?makeShareableCloneOnUIRecursive(u):void 0)})}let withDelay=function(n,l,u){return defineAnimation(l,()=>{let d="function"==typeof l?l():l;return{isHigherOrder:!0,onFrame:function(l,u){let{startTime:h,started:f,previousAnimation:m}=l,g=l.current;if(u-h>n||l.reduceMotion){f||(d.onStart(d,g,u,m),l.previousAnimation=null,l.started=!0);let n=d.onFrame(d,u);return l.current=d.current,n}if(m){let n=m.finished||m.onFrame(m,u);l.current=m.current,n&&(l.previousAnimation=null)}return!1},onStart:function(n,l,u,h){n.startTime=u,n.started=!1,n.current=l,h===n?n.previousAnimation=h.previousAnimation:n.previousAnimation=h,void 0===d.reduceMotion&&(d.reduceMotion=n.reduceMotion)},current:d.current,callback:n=>{d.callback&&d.callback(n)},previousAnimation:null,startTime:0,started:!1,reduceMotion:getReduceMotionForAnimation(u)}})};function valueSetter(n,l){let d=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=n._animation;if(h&&(h.cancelled=!0,n._animation=null),"function"==typeof l||null!==l&&"object"==typeof l&&void 0!==l.onFrame){let f="function"==typeof l?l():l;if(n._value===f.current&&!f.isHigherOrder&&!d){f.callback&&f.callback(!0);return}let m=u.g.__frameTimestamp||_getAnimationTimestamp();f.onStart(f,n.value,m,h);let step=l=>{let u=l<(f.timestamp||0)?f.timestamp:l;if(f.cancelled){f.callback&&f.callback(!1);return}let d=f.onFrame(f,u);f.finished=!0,f.timestamp=u,n._value=f.current,d?f.callback&&f.callback(!0):requestAnimationFrame(step)};n._animation=f,step(m)}else{if(n._value===l&&!d)return;n._value=l}}let tb=shouldBeUseWeb();function makeMutable(n){let l,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=n;u||tb||registerShareableMapping(l=e6.makeSynchronizedDataHolder(shareables_makeShareableCloneRecursive(d)));let h=shareables_makeShareableCloneRecursive({__init:()=>(function(n,l){let u=new Map,d=n,h={set value(newValue){valueSetter(h,newValue)},get value(){return d},set _value(newValue){d=newValue,l&&_updateDataSynchronously(l,makeShareableCloneOnUIRecursive(newValue)),u.forEach(n=>{n(newValue)})},get _value(){return d},modify:function(n){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];valueSetter(h,void 0!==n?n(d):d,l)},addListener:(n,l)=>{u.set(n,l)},removeListener:n=>{u.delete(n)},_animation:null,_isReanimatedSharedValue:!0};return h})(n,l)}),f=tb?new Map:void 0,m={set value(newValue){tb?valueSetter(m,newValue):runOnUI(()=>{m.value=newValue})()},get value(){if(l)return e6.getDataSynchronously(l);return d},set _value(newValue){if(!tb)throw Error("[Reanimated] Setting `_value` directly is only possible on the UI runtime.");d=newValue,f.forEach(n=>{n(newValue)})},get _value(){if(!tb)throw Error("[Reanimated] Reading from `_value` directly is only possible on the UI runtime.");return d},modify:function(n){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];tb?valueSetter(m,void 0!==n?n(m.value):m.value,l):runOnUI(()=>{m.modify(n,l)})()},addListener:(n,l)=>{if(!tb)throw Error("[Reanimated] Adding listeners is only possible on the UI runtime.");f.set(n,l)},removeListener:n=>{if(!tb)throw Error("[Reanimated] Removing listeners is only possible on the UI runtime.");f.delete(n)},_isReanimatedSharedValue:!0};return registerShareableMapping(m,h),m}function useSharedValue(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=(0,ez.useRef)(makeMutable(n,l));return null===u.current&&(u.current=makeMutable(n,l)),(0,ez.useEffect)(()=>()=>{cancelAnimation(u.current)},[]),u.current}function isSharedValue(n){return(null==n?void 0:n._isReanimatedSharedValue)===!0}let tE=isJest(),tS=9999;function startMapper(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],h=tS+=1;return runOnUI(()=>{let f=u.g.__mapperRegistry;void 0===f&&(f=u.g.__mapperRegistry=function(){let n=new Map,l=[],u=!1,d=!1;function mapperRun(){if(u=!1,!d)try{for(let u of(d=!0,n.size!==l.length&&function(){let u=new Map;n.forEach(n=>{if(n.outputs)for(let l of n.outputs){let d=u.get(l);void 0===d?u.set(l,[n]):d.push(n)}});let d=new Set,h=[];n.forEach(n=>{d.has(n)||function dfs(n){for(let l of(d.add(n),n.inputs)){let n=u.get(l);if(n)for(let l of n)d.has(l)||dfs(l)}h.push(n)}(n)}),l=h}(),l))u.dirty&&(u.dirty=!1,u.worklet())}finally{d=!1}}function maybeRequestUpdates(){tE?mapperRun():u||(d?requestAnimationFrame(mapperRun):queueMicrotask(mapperRun),u=!0)}return{start:(u,d,h,f)=>{let m={id:u,dirty:!0,worklet:d,inputs:function extractInputs(n,l){if(Array.isArray(n))for(let u of n)u&&extractInputs(u,l);else if(isSharedValue(n))l.push(n);else if(Object.getPrototypeOf(n)===Object.prototype)for(let u of Object.values(n))u&&extractInputs(u,l);return l}(h,[]),outputs:f};for(let u of(n.set(m.id,m),l=[],m.inputs))u.addListener(m.id,()=>{m.dirty=!0,maybeRequestUpdates()});maybeRequestUpdates()},stop:u=>{let d=n.get(u);if(d)for(let u of(n.delete(d.id),l=[],d.inputs))u.removeListener(d.id)}}}()),f.start(h,n,l,d)})(),h}function stopMapper(n){runOnUI(()=>{let l=u.g.__mapperRegistry;null==l||l.stop(n)})()}g=shouldBeUseWeb()?(n,l,u,d)=>{u&&u.items.forEach((n,u)=>{_updatePropsJS(l,n,d)})}:(n,l)=>{!function(n){for(let l in n)tu.includes(l)&&(n[l]=function(n){let l=processColorInitially(n);return null==l?void 0:"number"!=typeof l?null:(tc&&(l|=0),l)}(n[l]))}(l),u.g.UpdatePropsManager.update(n,l)};let updatePropsJestWrapper=(n,l,u,d,h)=>{h.forEach(n=>{n(l)}),d.current.value={...d.current.value,...l},g(n,l,u)},tw=isFabric()?()=>{let n=[];return{update(l,u){l.value.forEach(l=>{n.push({shadowNodeWrapper:l.shadowNodeWrapper,updates:u}),1===n.length&&queueMicrotask(this.flush)})},flush(){_updatePropsFabric(n),n.length=0}}}:()=>{let n=[];return{update(l,u){l.value.forEach(l=>{n.push({tag:l.tag,name:l.name||"RCTView",updates:u}),1===n.length&&queueMicrotask(this.flush)})},flush(){_updatePropsPaper(n),n.length=0}}};if(shouldBeUseWeb()){let maybeThrowError=()=>{if(!isJest())throw Error("[Reanimated] `UpdatePropsManager` is not available on non-native platform.")};u.g.UpdatePropsManager=new Proxy({},{get:maybeThrowError,set:()=>(maybeThrowError(),!1)})}else runOnUIImmediately(()=>{u.g.UpdatePropsManager=tw()})();function isAnimated(n){return Array.isArray(n)?n.some(isAnimated):"object"==typeof n&&null!==n&&(void 0!==n.onFrame||Object.values(n).some(isAnimated))}function shallowEqual(n,l){let u=Object.keys(n),d=Object.keys(l);if(u.length!==d.length)return!1;for(let d=0;d<u.length;d++)if(n[u[d]]!==l[u[d]])return!1;return!0}function makeViewDescriptorsSet(){let n=makeMutable([]);return{shareableViewDescriptors:n,add:l=>{n.modify(n=>{let u=n.findIndex(n=>n.tag===l.tag);return -1!==u?n[u]=l:n.push(l),n},!1)},remove:l=>{n.modify(n=>{let u=n.findIndex(n=>n.tag===l);return -1!==u&&n.splice(u,1),n},!1)}}}let tT=shouldBeUseWeb();function prepareAnimation(n,l,u,d){if(Array.isArray(l)&&l.forEach((l,h)=>{prepareAnimation(n,l,u&&u[h],d&&d[h])}),"object"==typeof l&&l.onFrame){let h=l.current;void 0!==d&&("object"==typeof d?void 0!==d.value?h=d.value:void 0!==d.onFrame&&((null==u?void 0:u.current)!==void 0?h=u.current:(null==d?void 0:d.current)!==void 0&&(h=d.current)):h=d),l.callStart=n=>{l.onStart(l,h,n,u)},l.callStart(n),l.callStart=null}else"object"==typeof l&&Object.keys(l).forEach(h=>prepareAnimation(n,l[h],u&&u[h],d&&d[h]))}function runAnimations(n,l,u,d,h){if(!h.value)return!0;if(Array.isArray(n)){d[u]=[];let f=!0;return n.forEach((n,m)=>{runAnimations(n,l,m,d[u],h)||(f=!1)}),f}if("object"==typeof n&&n.onFrame){let h=!0;return!n.finished&&(n.callStart&&(n.callStart(l),n.callStart=null),h=n.onFrame(n,l),n.timestamp=l,h&&(n.finished=!0,n.callback&&n.callback(!0))),d[u]=n.current,h}if("object"!=typeof n)return d[u]=n,!0;{d[u]={};let f=!0;return Object.keys(n).forEach(m=>{runAnimations(n[m],l,m,d[u],h)||(f=!1)}),f}}function useAnimatedStyle(n,l,d){let h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],f=function(){let n=(0,ez.useRef)(null);if(null===n.current){let l={items:new Set,add:n=>{l.items.has(n)||l.items.add(n)},remove:n=>{l.items.delete(n)}};n.current=l}return n.current}(),m=(0,ez.useRef)(),_=Object.values(n.__closure??{});if(tT){var j;!_.length&&null!==(j=l)&&void 0!==j&&j.length&&(_=l)}let $=d?Array.isArray(d)?d:[d]:[],z=d?Object.values($).reduce((n,l)=>n+l.__workletHash.toString(),""):null,ee=useSharedValue(!0),et=(0,ez.useRef)({});if(l?l.push(n.__workletHash):l=[..._,n.__workletHash],z&&l.push(z),!m.current){let l=initialUpdaterRun(n);!function(n){if("object"!=typeof n)throw Error(`[Reanimated] \`useAnimatedStyle\` has to return an object, found ${typeof n} instead.`);if(Array.isArray(n))throw Error("[Reanimated] `useAnimatedStyle` has to return an object and cannot return static styles combined with dynamic ones. Please do merging where a component receives props.")}(l),m.current={initial:{value:l,updater:n},remoteState:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=shareables_makeShareableCloneRecursive({__init:()=>n});return registerShareableMapping(n,l),n}({last:l,animations:{},isAnimationCancelled:!1,isAnimationRunning:!1}),viewDescriptors:makeViewDescriptorsSet()}}let{initial:en,remoteState:eo,viewDescriptors:es}=m.current,el=es.shareableViewDescriptors,eu=tT?f:void 0;return(l.push(el),(0,ez.useEffect)(()=>{let l;let f=n;d&&(f=()=>{let l=n();return $.forEach(n=>{n(l)}),l}),l=isJest()?()=>{!function(n,l,d,h,f,m){let g;let _=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],j=d.animations??{},$=l()??{},z=d.last,ee=!1;Object.keys(j).forEach(n=>{let l=$[n];isAnimated(l)||delete j[n]}),Object.keys($).forEach(n=>{let l=$[n];isAnimated(l)&&(prepareAnimation(g=u.g.__frameTimestamp||_getAnimationTimestamp(),l,j[n],z[n]),j[n]=l,ee=!0)}),ee?(d.animations=j,d.isAnimationRunning||(d.isAnimationCancelled=!1,d.isAnimationRunning=!0,function frame(l){let{animations:u,last:g,isAnimationCancelled:j}=d;if(j){d.isAnimationRunning=!1;return}let $={},z=!0;Object.keys(u).forEach(n=>{let d=runAnimations(u[n],l,n,$,f);d?(g[n]=$[n],delete u[n]):z=!1}),Object.keys($).length&&updatePropsJestWrapper(n,$,h,m,_),z?d.isAnimationRunning=!1:requestAnimationFrame(frame)}(g))):(d.isAnimationCancelled=!0,d.animations=[]),d.last=$,shallowEqual(z,$)||updatePropsJestWrapper(n,$,h,m,_)}(el,n,eo,eu,ee,et,$)}:()=>{!function(n,l,d,h,f){let m;let _=arguments.length>5&&void 0!==arguments[5]&&arguments[5],j=d.animations??{},$=l()??{},z=d.last,ee={},et=!1,en=!1;for(let n in $){let l=$[n];isAnimated(l)?(prepareAnimation(m=u.g.__frameTimestamp||_getAnimationTimestamp(),l,j[n],z[n]),j[n]=l,et=!0):(en=!0,ee[n]=l,delete j[n])}if(et){let frame=l=>{let{animations:u,last:m,isAnimationCancelled:_}=d;if(_){d.isAnimationRunning=!1;return}let j={},$=!0;for(let n in u){let d=runAnimations(u[n],l,n,j,f);d?(m[n]=j[n],delete u[n]):$=!1}j&&g(n,j,h),$?d.isAnimationRunning=!1:requestAnimationFrame(frame)};d.animations=j,d.isAnimationRunning||(d.isAnimationCancelled=!1,d.isAnimationRunning=!0,frame(m)),en&&g(n,ee,h)}else d.isAnimationCancelled=!0,d.animations=[],shallowEqual(z,$)||g(n,$,h,_);d.last=$}(el,f,eo,eu,ee,h)};let m=startMapper(l,_);return()=>{stopMapper(m)}},l),(0,ez.useEffect)(()=>(ee.value=!0,()=>{ee.value=!1}),[]),!function checkSharedValueUsage(n,l){if(Array.isArray(n))for(let u of n)checkSharedValueUsage(u,l);else if("object"==typeof n&&null!==n&&void 0===n.value)for(let l of Object.keys(n))checkSharedValueUsage(n[l],l);else if(void 0!==l&&"object"==typeof n&&null!==n&&void 0!==n.value)throw Error(`[Reanimated] Invalid value passed to \`${l}\`, maybe you forgot to use \`.value\`?`)}(en.value),isJest())?{viewDescriptors:es,initial:en,viewsRef:f,animatedStyle:et}:{viewDescriptors:es,initial:en,viewsRef:f}}function withSequence(n){let l;for(var u=arguments.length,d=Array(u>1?u-1:0),h=1;h<u;h++)d[h-1]=arguments[h];return(n&&("string"==typeof n?l=n:d.unshift(n)),0===d.length)?(console.warn("[Reanimated] No animation was provided for the sequence"),defineAnimation(0,()=>({onStart:(n,l)=>n.current=l,onFrame:()=>!0,current:0,animationIndex:0,reduceMotion:getReduceMotionForAnimation(l)}))):defineAnimation(d[0],()=>{let n=d.map(n=>{let l="function"==typeof n?n():n;return l.finished=!1,l});function findNextNonReducedMotionAnimationIndex(l){for(;l<n.length-1&&n[l].reduceMotion;)l++;return l}return{isHigherOrder:!0,onFrame:function(l,u){let d=n[l.animationIndex],h=d.onFrame(d,u);if(l.current=d.current,h){if(d.callback&&d.callback(!0),d.finished=!0,l.animationIndex=findNextNonReducedMotionAnimationIndex(l.animationIndex+1),l.animationIndex<n.length){let h=n[l.animationIndex];return h.onStart(h,d.current,u,d),!1}return!0}return!1},onStart:function(l,u,d,h){n.forEach(n=>{void 0===n.reduceMotion&&(n.reduceMotion=l.reduceMotion)}),l.animationIndex=findNextNonReducedMotionAnimationIndex(0),void 0===h&&(h=n[n.length-1]);let f=n[l.animationIndex];f.onStart(f,u,d,h)},animationIndex:0,current:n[0].current,callback:l=>{l||n.forEach(n=>{"function"!=typeof n.callback||n.finished||n.callback(l)})},reduceMotion:getReduceMotionForAnimation(l)}})}let withRepeat=function(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,u=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0;return defineAnimation(n,()=>{let f="function"==typeof n?n():n;return{isHigherOrder:!0,onFrame:function(n,d){let h=f.onFrame(f,d);if(n.current=f.current,h){if(n.reps+=1,f.callback&&f.callback(!0,n.current),n.reduceMotion||l>0&&n.reps>=l)return!0;let h=u?f.current:n.startValue;u&&(f.toValue=n.startValue,n.startValue=h),f.onStart(f,h,d,f.previousAnimation)}return!1},onStart:function(n,d,h,m){n.startValue=d,n.reps=0,void 0===f.reduceMotion&&(f.reduceMotion=n.reduceMotion),n.reduceMotion&&u&&(l<=0||l%2==0)?(n.current=n.startValue,n.onFrame=()=>!0):f.onStart(f,d,h,m)},reps:0,current:f.current,callback:n=>{d&&d(n),!n&&f.callback&&f.callback(!1)},startValue:0,reduceMotion:getReduceMotionForAnimation(h)}})},debug=(...n)=>{u.g.shouldDebugMoti&&console.log("[moti]",...n)},use_motify_isColor=n=>!!({backgroundColor:!0,borderBottomColor:!0,borderLeftColor:!0,borderRightColor:!0,borderTopColor:!0,color:!0,shadowColor:!0,borderColor:!0,borderEndColor:!0,borderStartColor:!0})[n],isTransform=n=>!!({perspective:!0,rotate:!0,rotateX:!0,rotateY:!0,rotateZ:!0,scale:!0,scaleX:!0,scaleY:!0,translateX:!0,translateY:!0,skewX:!0,skewY:!0})[n],tI=["stiffness","overshootClamping","restDisplacementThreshold","restSpeedThreshold","velocity","reduceMotion","mass","damping","duration","dampingRatio"];function animationConfig(n,l){let u=0,d=!0,h="spring";(use_motify_isColor(n)||"opacity"===n)&&(h="timing");let f=l?.[n];f?.type?h=f.type:l?.type&&(h=l.type);let m=f?.loop??l?.loop;null!=m&&(u=m?-1:0),f?.repeat!=null?u=f?.repeat:l?.repeat!=null&&(u=l.repeat),f?.repeatReverse!=null?d=f.repeatReverse:l?.repeatReverse!=null&&(d=l.repeatReverse);let g={},animation=(...n)=>n;if("timing"===h){let u=l?.[n]?.duration??l?.duration,d=l?.[n]?.easing??l?.easing;d&&(g.easing=d),null!=u&&(g.duration=u),animation=withTiming}else if("spring"===h)for(let u of(animation=withSpring,g={},tI)){let d=l?.[n]?.[u],h=l?.[u];null!=d?g[u]=d:null!=h&&(g[u]=h)}else if("decay"===h)for(let u of(animation=withDecay,g={},["clamp","velocity","deceleration","velocityFactor","reduceMotion","velocityFactor"])){let d=l?.[n]?.[u],h=l?.[u];null!=d?g[u]=d:null!=h&&(g[u]=h)}else"no-animation"===h&&(animation=n=>n,g={},u=0);return{animation,config:g,repeatReverse:d,repeatCount:u,shouldRepeat:!!u}}let getSequenceArray=(n,l,u,d,h,f)=>{let m=[];for(let g of l){let l;let _="object"==typeof g?g&&g?.value!=null&&g?.value!==!1:null!=g&&!1!==g;if(_){let _=u,j=g,$=Object.assign({},d),z=h;if("object"==typeof g){let u=Object.assign({},g);delete u.delay,delete u.value;let{config:d,animation:h}=animationConfig(n,u);$=Object.assign({},$,d),z=h,null!=g.delay&&(_=g.delay),j=g.value,l=g.onDidAnimate}let ee=z(j,$,(n=!1,u)=>{f(n,u,{attemptedSequenceValue:j}),l&&runOnJS(l)(n,u,{attemptedSequenceItemValue:j,attemptedSequenceArray:u})});null!=_?m.push(withDelay(_,ee)):m.push(ee)}}return m};var tR=u(90605),tP=u(28316),exports_findNodeHandle=n=>{var l;try{l=(0,tP.findDOMNode)(n)}catch(n){}return l};let tA=new Map;function reportFatalErrorOnJS(n){let{message:l,stack:d}=n,h=Error();h.message=l,h.stack=d?function(n){let l=n.match(/worklet_(\d+):(\d+):(\d+)/g),u=n;return null==l||l.forEach(n=>{let[,l,d,h]=n.split(/:|_/).map(Number),f=tA.get(l);if(!f)return;let[m,g,_]=f,[j,$,z]=function(n){var l,u;let d=null===(l=n.stack)||void 0===l?void 0:null===(u=l.split("\n"))||void 0===u?void 0:u[0];if(d){let n=/@([^@]+):(\d+):(\d+)/.exec(d);if(n){let[,l,u,d]=n;return[l,Number(u),Number(d)]}}return["unknown",0,0]}(m);u=u.replace(n,`${j}:${d+$+g}:${h+z+_}`)}),u}(d):void 0,h.name="ReanimatedError",h.jsEngine="reanimated",u.g.ErrorUtils.reportFatalError(h)}let tO=isJest(),tC=shouldBeUseWeb(),tk=isChromeDebugger();function callGuardDEV(n){for(var l=arguments.length,d=Array(l>1?l-1:0),h=1;h<l;h++)d[h-1]=arguments[h];try{n(...d)}catch(n){if(u.g.__ErrorUtils)u.g.__ErrorUtils.reportFatalError(n);else throw n}}let tx={...console};function registerEventHandler(n,l){let d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return e6.registerEventHandler(shareables_makeShareableCloneRecursive(function(l,d){u.g.__frameTimestamp=l,n(d),u.g.__flushAnimationFrame(l),u.g.__frameTimestamp=void 0}),l,d)}isFabric(),shouldBeUseWeb()&&(u.g._WORKLET=!1,u.g._log=console.log,u.g._getAnimationTimestamp=()=>performance.now()),isWeb()||(tO&&(globalThis.requestAnimationFrame=mockedRequestAnimationFrame),runOnUIImmediately(()=>{if(u.g.__callGuardDEV=callGuardDEV,u.g.__ErrorUtils={reportFatalError:n=>{runOnJS(reportFatalErrorOnJS)({message:n.message,stack:n.stack})}},tk||(u.g.console={assert:runOnJS(tx.assert),debug:runOnJS(tx.debug),log:runOnJS(tx.log),warn:runOnJS(tx.warn),error:runOnJS(tx.error),info:runOnJS(tx.info)}),!tC){let n,l;n=[],l=!1,u.g.queueMicrotask=l=>{n.push(l)},u.g.__callMicrotasks=()=>{if(!l)try{l=!0;for(let l=0;l<n.length;l+=1)n[l]();n=[],u.g._maybeFlushUIUpdatesQueue()}finally{l=!1}},function(){let n=u.g.requestAnimationFrame,l=[],d=-1;u.g.__flushAnimationFrame=n=>{let u=l;l=[],u.forEach(l=>l(n)),tv()},u.g.requestAnimationFrame=h=>(l.push(h),1===l.length&&n(n=>{d>=n||(d=n,u.g.__frameTimestamp=n,u.g.__flushAnimationFrame(n),u.g.__frameTimestamp=void 0)}),-1)}()}})());let tM={enableLayoutAnimations:!1,setByUser:!1};function configureLayoutAnimations(n,l,u){let d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";e6.configureLayoutAnimation(n,l,d,shareables_makeShareableCloneRecursive(u))}function WorkletEventHandler_defineProperty(n,l,u){var d;return(l="symbol"==typeof(d=function(n,l){if("object"!=typeof n||null===n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var d=u.call(n,l||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(l,"string"))?d:String(d))in n?Object.defineProperty(n,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[l]=u,n}let tD=shouldBeUseWeb();let WorkletEventHandler=class WorkletEventHandler{constructor(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];WorkletEventHandler_defineProperty(this,"worklet",void 0),WorkletEventHandler_defineProperty(this,"eventNames",void 0),WorkletEventHandler_defineProperty(this,"reattachNeeded",void 0),WorkletEventHandler_defineProperty(this,"listeners",void 0),WorkletEventHandler_defineProperty(this,"viewTag",void 0),WorkletEventHandler_defineProperty(this,"registrations",void 0),this.worklet=n,this.eventNames=l,this.reattachNeeded=!1,this.listeners={},this.viewTag=void 0,this.registrations=[],tD&&(this.listeners=l.reduce((l,u)=>(l[u]=l=>{n({...l.nativeEvent,eventName:u})},l),{}))}updateWorklet(n){this.worklet=n,this.reattachNeeded=!0}registerForEvents(n,l){this.viewTag=n,this.registrations=this.eventNames.map(l=>registerEventHandler(this.worklet,l,n)),0===this.registrations.length&&l&&this.registrations.push(registerEventHandler(this.worklet,l,n))}registerForEventByName(n){this.registrations.push(registerEventHandler(this.worklet,n))}unregisterFromEvents(){this.registrations.forEach(n=>e6.unregisterEventHandler(n)),this.registrations=[]}};var tN=u(47677),tV=u.n(tN);function configureProps(){var n,l;!function(){for(let n in e9.NATIVE_THREAD_PROPS_WHITELIST)if(n in e9.UI_THREAD_PROPS_WHITELIST)throw Error(`[Reanimated] Property \`${n}\` was whitelisted both as UI and native prop. Please remove it from one of the lists.`)}(),n=Object.keys(e9.UI_THREAD_PROPS_WHITELIST),l=Object.keys(e9.NATIVE_THREAD_PROPS_WHITELIST),isJest()||isChromeDebugger()||isWindows()||e6.configureProps(n,l)}let tF=new Set;function adaptViewConfig(n){let l=n.uiViewClassName,u=n.validAttributes;if(!tF.has(l)){let n={};Object.keys(u).forEach(l=>{l in e9.NATIVE_THREAD_PROPS_WHITELIST||l in e9.UI_THREAD_PROPS_WHITELIST||(n[l]=!0)}),function(n){let l=Object.keys(e9.UI_THREAD_PROPS_WHITELIST).length;e9.UI_THREAD_PROPS_WHITELIST={...e9.UI_THREAD_PROPS_WHITELIST,...n},l!==Object.keys(e9.UI_THREAD_PROPS_WHITELIST).length&&configureProps()}(n),tF.add(l)}}configureProps();var tL=u(63366);let tj=((ee={})[ee.ENTERING=1]="ENTERING",ee[ee.EXITING=2]="EXITING",ee[ee.LAYOUT=3]="LAYOUT",ee[ee.SHARED_ELEMENT_TRANSITION=4]="SHARED_ELEMENT_TRANSITION",ee[ee.SHARED_ELEMENT_TRANSITION_PROGRESS=5]="SHARED_ELEMENT_TRANSITION_PROGRESS",ee);let SharedTransition=class SharedTransition{custom(){return this}progressAnimation(){return this}duration(){return this}reduceMotion(){return this}defaultTransitionType(){return this}registerTransition(){}unregisterTransition(){}getReduceMotion(){return e3.System}static custom(){return new SharedTransition}static duration(){return new SharedTransition}static progressAnimation(){return new SharedTransition}static defaultTransitionType(){return new SharedTransition}static reduceMotion(){return new SharedTransition}};isFabric();let tU=[];function flush(){runOnUI(removeFromPropsRegistryOnUI)(tU),tU=[]}function removeFromPropsRegistryOnUI(n){_removeFromPropsRegistry(n)}let tB={targetOriginX:0,targetOriginY:0,targetWidth:0,targetHeight:0,targetGlobalOriginX:0,targetGlobalOriginY:0,targetBorderRadius:0,windowWidth:0,windowHeight:0,currentOriginX:0,currentOriginY:0,currentWidth:0,currentHeight:0,currentGlobalOriginX:0,currentGlobalOriginY:0,currentBorderRadius:0};function maybeBuild(n,l,u){var d;if(!("build"in n)||"function"!=typeof n.build)return n;{let h=n.build(),f=h(tB),m=f.animations,g=(d=l||{},Object.keys(m).filter(n=>Object.prototype.hasOwnProperty.call(d,n)));return g.length>0&&console.warn(`[Reanimated] ${1===g.length?"Property":"Properties: "} "${g}" of ${u} may be overwritten with layout animation. Please create a wrapper with the layout animation you want to apply.`),n.build()}}let t$=(0,ez.createContext)(null);var tH=u(88837),tW=u(31368);function JSPropsUpdater_defineProperty(n,l,u){var d;return(l="symbol"==typeof(d=function(n,l){if("object"!=typeof n||null===n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var d=u.call(n,l||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(l,"string"))?d:String(d))in n?Object.defineProperty(n,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[l]=u,n}let tq=shouldBeUseWeb();let JSPropsUpdaterPaper=class JSPropsUpdaterPaper{constructor(){JSPropsUpdater_defineProperty(this,"_reanimatedEventEmitter",void 0),this._reanimatedEventEmitter=new tH.Z(tW.Z.ReanimatedModule)}addOnJSPropsChangeListener(n){let l=exports_findNodeHandle(n);JSPropsUpdaterPaper._tagToComponentMapping.set(l,n),1===JSPropsUpdaterPaper._tagToComponentMapping.size&&this._reanimatedEventEmitter.addListener("onReanimatedPropsChange",n=>{let l=JSPropsUpdaterPaper._tagToComponentMapping.get(n.viewTag);null==l||l._updateFromNative(n.props)})}removeOnJSPropsChangeListener(n){let l=exports_findNodeHandle(n);JSPropsUpdaterPaper._tagToComponentMapping.delete(l),0===JSPropsUpdaterPaper._tagToComponentMapping.size&&this._reanimatedEventEmitter.removeAllListeners("onReanimatedPropsChange")}};JSPropsUpdater_defineProperty(JSPropsUpdaterPaper,"_tagToComponentMapping",new Map);let JSPropsUpdaterFabric=class JSPropsUpdaterFabric{constructor(){if(!JSPropsUpdaterFabric.isInitialized){let updater=(n,l)=>{let u=JSPropsUpdaterFabric._tagToComponentMapping.get(n);null==u||u._updateFromNative(l)};runOnUIImmediately(()=>{u.g.updateJSProps=(n,l)=>{runOnJS(updater)(n,l)}})(),JSPropsUpdaterFabric.isInitialized=!0}}addOnJSPropsChangeListener(n){if(!JSPropsUpdaterFabric.isInitialized)return;let l=exports_findNodeHandle(n);JSPropsUpdaterFabric._tagToComponentMapping.set(l,n)}removeOnJSPropsChangeListener(n){if(!JSPropsUpdaterFabric.isInitialized)return;let l=exports_findNodeHandle(n);JSPropsUpdaterFabric._tagToComponentMapping.delete(l)}};JSPropsUpdater_defineProperty(JSPropsUpdaterFabric,"_tagToComponentMapping",new Map),JSPropsUpdater_defineProperty(JSPropsUpdaterFabric,"isInitialized",!1);var tz=tq?class{addOnJSPropsChangeListener(n){}removeOnJSPropsChangeListener(n){}}:u.g._IS_FABRIC?JSPropsUpdaterFabric:JSPropsUpdaterPaper;function flattenArray(n){if(!Array.isArray(n))return[n];let l=[],_flattenArray=n=>{n.forEach(n=>{Array.isArray(n)?_flattenArray(n):l.push(n)})};return _flattenArray(n),l}let has=(n,l)=>("function"==typeof l||"object"==typeof l)&&null!=l&&n in l;var createAnimatedComponent_setAndForwardRef=function(n){let{getForwardedRef:l,setLocalRef:u}=n;return function(n){let d=l();u(n),"function"==typeof d?d(n):"object"==typeof d&&null!=d&&(d.current=n)}};function InlinePropManager_defineProperty(n,l,u){var d;return(l="symbol"==typeof(d=function(n,l){if("object"!=typeof n||null===n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var d=u.call(n,l||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(l,"string"))?d:String(d))in n?Object.defineProperty(n,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[l]=u,n}let tG=shouldBeUseWeb();function isInlineStyleTransform(n){return!!Array.isArray(n)&&n.some(n=>hasInlineStyles(n))}function getInlinePropsUpdate(n){let l={};for(let[u,d]of Object.entries(n))isSharedValue(d)?l[u]=d.value:Array.isArray(d)?l[u]=d.map(n=>getInlinePropsUpdate(n)):"object"==typeof d?l[u]=getInlinePropsUpdate(d):l[u]=d;return l}function hasInlineStyles(n){return!!n&&Object.keys(n).some(l=>{let u=n[l];return isSharedValue(u)||"transform"===l&&isInlineStyleTransform(u)})}let InlinePropManager=class InlinePropManager{constructor(){InlinePropManager_defineProperty(this,"_inlinePropsViewDescriptors",null),InlinePropManager_defineProperty(this,"_inlinePropsMapperId",null),InlinePropManager_defineProperty(this,"_inlineProps",{})}attachInlineProps(n,l){let u=function(n){let l={};for(let u in n){let d=n[u];if("style"===u){let u=flattenArray(n.style??[]);u.forEach(n=>{if(n)for(let[u,d]of Object.entries(n))isSharedValue(d)?l[u]=d:"transform"===u&&isInlineStyleTransform(d)&&(l[u]=d)})}else isSharedValue(d)&&(l[u]=d)}return l}(n.props),d=function(n,l){if(Object.keys(n).length!==Object.keys(l).length)return!0;for(let u of Object.keys(n))if(n[u]!==l[u])return!0;return!1}(u,this._inlineProps);if(d){if(!this._inlinePropsViewDescriptors){this._inlinePropsViewDescriptors=makeViewDescriptorsSet();let{viewTag:n,viewName:d,shadowNodeWrapper:h,viewConfig:f}=l;Object.keys(u).length&&f&&adaptViewConfig(f),this._inlinePropsViewDescriptors.add({tag:n,name:d,shadowNodeWrapper:h})}let d=this._inlinePropsViewDescriptors.shareableViewDescriptors,h=tG?{items:new Set([n])}:void 0;this._inlineProps=u,this._inlinePropsMapperId&&stopMapper(this._inlinePropsMapperId),this._inlinePropsMapperId=null,Object.keys(u).length&&(this._inlinePropsMapperId=startMapper(()=>{let n=getInlinePropsUpdate(u);g(d,n,h)},Object.values(u)))}}detachInlineProps(){this._inlinePropsMapperId&&stopMapper(this._inlinePropsMapperId)}};var tK=u(17693);function dummyListener(){}let PropsFilter=class PropsFilter{constructor(){var n,l,u;l={},(n="symbol"==typeof(u=function(n,l){if("object"!=typeof n||null===n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var d=u.call(n,l||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(n="_initialStyle","string"))?u:String(u))in this?Object.defineProperty(this,n,{value:l,enumerable:!0,configurable:!0,writable:!0}):this[n]=l}filterNonAnimatedProps(n){let l=n.props,u={};for(let d in l){let h=l[d];if("style"===d){let h=l.style,f=flattenArray(h??[]),m=f.map(l=>l&&l.viewDescriptors?(l.viewsRef.add(n),n._isFirstRender&&(this._initialStyle={...l.initial.value,...this._initialStyle,...initialUpdaterRun(l.initial.updater)}),this._initialStyle):hasInlineStyles(l)?function(n,l){if(l)return getInlinePropsUpdate(n);let u={};for(let[l,d]of Object.entries(n))isSharedValue(d)||"transform"===l&&isInlineStyleTransform(d)||(u[l]=d);return u}(l,n._isFirstRender):l);u[d]=tK.Z.flatten(m)}else if("animatedProps"===d){let d=l.animatedProps;void 0!==d.initial&&Object.keys(d.initial.value).forEach(l=>{var h,f;u[l]=null===(h=d.initial)||void 0===h?void 0:h.value[l],null===(f=d.viewsRef)||void 0===f||f.add(n)})}else has("current",h)&&h.current instanceof WorkletEventHandler?h.current.eventNames.length>0?h.current.eventNames.forEach(n=>{u[n]=has("listeners",h.current)?h.current.listeners[n]:dummyListener}):u[d]=dummyListener:isSharedValue(h)?n._isFirstRender&&(u[d]=h.value):"onGestureHandlerStateChange"===d&&isChromeDebugger()||(u[d]=h)}return u}};function convertAnimationObjectToKeyframes(n){let l=`@keyframes ${n.name} { `;for(let[u,d]of Object.entries(n.style)){for(let[n,h]of(l+=`${u}% { `,Object.entries(d))){if("transform"!==n){l+=`${n}: ${h}; `;continue}l+="transform:",h.forEach(n=>{for(let[u,d]of Object.entries(n))l+=` ${u}(${d})`}),l+="; "}l+="} "}return l+="} "}function convertTransformToString(n){if(!n)return"";let l="";return n.forEach(n=>{for(let[u,d]of Object.entries(n))"reversed"!==u&&(0>u.indexOf("translate")?l+=`${u}(${d}) `:l+=`${u}(${d}px) `)}),l}let tX={BounceIn:{name:"BounceIn",style:{0:{transform:[{scale:0}]},55:{transform:[{scale:1.2}]},70:{transform:[{scale:.9}]},85:{transform:[{scale:1.1}]},100:{transform:[{scale:1}]}},duration:.6},BounceInRight:{name:"BounceInRight",style:{0:{transform:[{translateX:"100vw"}]},55:{transform:[{translateX:"-20px"}]},70:{transform:[{translateX:"10px"}]},85:{transform:[{translateX:"-10px"}]},100:{transform:[{translateX:"0px"}]}},duration:.6},BounceInLeft:{name:"BounceInLeft",style:{0:{transform:[{translateX:"-100vw"}]},55:{transform:[{translateX:"20px"}]},70:{transform:[{translateX:"-10px"}]},85:{transform:[{translateX:"10px"}]},100:{transform:[{translateX:"0px"}]}},duration:.6},BounceInUp:{name:"BounceInUp",style:{0:{transform:[{translateY:"-100vh"}]},55:{transform:[{translateY:"20px"}]},70:{transform:[{translateY:"-10px"}]},85:{transform:[{translateY:"10px"}]},100:{transform:[{translateY:"0px"}]}},duration:.6},BounceInDown:{name:"BounceInDown",style:{0:{transform:[{translateY:"100vh"}]},55:{transform:[{translateY:"-20px"}]},70:{transform:[{translateY:"10px"}]},85:{transform:[{translateY:"-10px"}]},100:{transform:[{translateY:"0px"}]}},duration:.6}},tY={BounceOut:{name:"BounceOut",style:{15:{transform:[{scale:1.1}]},30:{transform:[{scale:.9}]},45:{transform:[{scale:1.2}]},100:{transform:[{scale:.1}]}},duration:.6},BounceOutRight:{name:"BounceOutRight",style:{15:{transform:[{translateX:"-10px"}]},30:{transform:[{translateX:"10px"}]},45:{transform:[{translateX:"-20px"}]},100:{transform:[{translateX:"100vh"}]}},duration:.6},BounceOutLeft:{name:"BounceOutLeft",style:{15:{transform:[{translateX:"10px"}]},30:{transform:[{translateX:"-10px"}]},45:{transform:[{translateX:"20px"}]},100:{transform:[{translateX:"-100vh"}]}},duration:.6},BounceOutUp:{name:"BounceOutUp",style:{15:{transform:[{translateY:"10px"}]},30:{transform:[{translateY:"-10px"}]},45:{transform:[{translateY:"20px"}]},100:{transform:[{translateY:"-100vh"}]}},duration:.6},BounceOutDown:{name:"BounceOutDown",style:{15:{transform:[{translateY:"-10px"}]},30:{transform:[{translateY:"10px"}]},45:{transform:[{translateY:"-20px"}]},100:{transform:[{translateY:"100vh"}]}},duration:.6}},tQ={BounceIn:{style:convertAnimationObjectToKeyframes(tX.BounceIn),duration:tX.BounceIn.duration},BounceInRight:{style:convertAnimationObjectToKeyframes(tX.BounceInRight),duration:tX.BounceInRight.duration},BounceInLeft:{style:convertAnimationObjectToKeyframes(tX.BounceInLeft),duration:tX.BounceInLeft.duration},BounceInUp:{style:convertAnimationObjectToKeyframes(tX.BounceInUp),duration:tX.BounceInUp.duration},BounceInDown:{style:convertAnimationObjectToKeyframes(tX.BounceInDown),duration:tX.BounceInDown.duration}},tJ={BounceOut:{style:convertAnimationObjectToKeyframes(tY.BounceOut),duration:tY.BounceOut.duration},BounceOutRight:{style:convertAnimationObjectToKeyframes(tY.BounceOutRight),duration:tY.BounceOutRight.duration},BounceOutLeft:{style:convertAnimationObjectToKeyframes(tY.BounceOutLeft),duration:tY.BounceOutLeft.duration},BounceOutUp:{style:convertAnimationObjectToKeyframes(tY.BounceOutUp),duration:tY.BounceOutUp.duration},BounceOutDown:{style:convertAnimationObjectToKeyframes(tY.BounceOutDown),duration:tY.BounceOutDown.duration}},tZ={FadeIn:{name:"FadeIn",style:{0:{opacity:0}},duration:.3},FadeInRight:{name:"FadeInRight",style:{0:{opacity:0,transform:[{translateX:"25px"}]}},duration:.3},FadeInLeft:{name:"FadeInLeft",style:{0:{opacity:0,transform:[{translateX:"-25px"}]}},duration:.3},FadeInUp:{name:"FadeInUp",style:{0:{opacity:0,transform:[{translateY:"-25px"}]}},duration:.3},FadeInDown:{name:"FadeInDown",style:{0:{opacity:0,transform:[{translateY:"25px"}]}},duration:.3}},t0={FadeOut:{name:"FadeOut",style:{100:{opacity:0}},duration:.3},FadeOutRight:{name:"FadeOutRight",style:{100:{opacity:0,transform:[{translateX:"25px"}]}},duration:.3},FadeOutLeft:{name:"FadeOutLeft",style:{100:{opacity:0,transform:[{translateX:"-25px"}]}},duration:.3},FadeOutUp:{name:"FadeOutUp",style:{100:{opacity:0,transform:[{translateY:"-25px"}]}},duration:.3},FadeOutDown:{name:"FadeOutDown",style:{100:{opacity:0,transform:[{translateY:"25px"}]}},duration:.3}},t1={FadeIn:{style:convertAnimationObjectToKeyframes(tZ.FadeIn),duration:tZ.FadeIn.duration},FadeInRight:{style:convertAnimationObjectToKeyframes(tZ.FadeInRight),duration:tZ.FadeInRight.duration},FadeInLeft:{style:convertAnimationObjectToKeyframes(tZ.FadeInLeft),duration:tZ.FadeInLeft.duration},FadeInUp:{style:convertAnimationObjectToKeyframes(tZ.FadeInUp),duration:tZ.FadeInUp.duration},FadeInDown:{style:convertAnimationObjectToKeyframes(tZ.FadeInDown),duration:tZ.FadeInDown.duration}},t2={FadeOut:{style:convertAnimationObjectToKeyframes(t0.FadeOut),duration:t0.FadeOut.duration},FadeOutRight:{style:convertAnimationObjectToKeyframes(t0.FadeOutRight),duration:t0.FadeOutRight.duration},FadeOutLeft:{style:convertAnimationObjectToKeyframes(t0.FadeOutLeft),duration:t0.FadeOutLeft.duration},FadeOutUp:{style:convertAnimationObjectToKeyframes(t0.FadeOutUp),duration:t0.FadeOutUp.duration},FadeOutDown:{style:convertAnimationObjectToKeyframes(t0.FadeOutDown),duration:t0.FadeOutDown.duration}},t3={FlipInYRight:{name:"FlipInYRight",style:{0:{transform:[{perspective:"500px",rotateY:"90deg",translateX:"100%"}]},100:{transform:[{perspective:"500px",rotateY:"0deg",translateX:"0%"}]}},duration:.3},FlipInYLeft:{name:"FlipInYLeft",style:{0:{transform:[{perspective:"500px",rotateY:"-90deg",translateX:"-100%"}]},100:{transform:[{perspective:"500px",rotateY:"0deg",translateX:"0%"}]}},duration:.3},FlipInXUp:{name:"FlipInXUp",style:{0:{transform:[{perspective:"500px",rotateX:"90deg",translateY:"-100%"}]},100:{transform:[{perspective:"500px",rotateX:"0deg",translateY:"0%"}]}},duration:.3},FlipInXDown:{name:"FlipInXDown",style:{0:{transform:[{perspective:"500px",rotateX:"-90deg",translateY:"100%"}]},100:{transform:[{perspective:"500px",rotateX:"0deg",translateY:"0%"}]}},duration:.3},FlipInEasyX:{name:"FlipInEasyX",style:{0:{transform:[{perspective:"500px",rotateX:"90deg"}]},100:{transform:[{perspective:"500px",rotateX:"0deg"}]}},duration:.3},FlipInEasyY:{name:"FlipInEasyY",style:{0:{transform:[{perspective:"500px",rotateY:"90deg"}]},100:{transform:[{perspective:"500px",rotateY:"0deg"}]}},duration:.3}},t5={FlipOutYRight:{name:"FlipOutYRight",style:{0:{transform:[{perspective:"500px",rotateY:"0deg",translateX:"0%"}]},100:{transform:[{perspective:"500px",rotateY:"90deg",translateX:"100%"}]}},duration:.3},FlipOutYLeft:{name:"FlipOutYLeft",style:{0:{transform:[{perspective:"500px",rotateY:"0deg",translateX:"0%"}]},100:{transform:[{perspective:"500px",rotateY:"-90deg",translateX:"-100%"}]}},duration:.3},FlipOutXUp:{name:"FlipOutXUp",style:{0:{transform:[{perspective:"500px",rotateX:"0deg",translateY:"0%"}]},100:{transform:[{perspective:"500px",rotateX:"90deg",translateY:"-100%"}]}},duration:.3},FlipOutXDown:{name:"FlipOutXDown",style:{0:{transform:[{perspective:"500px",rotateX:"0deg",translateY:"0%"}]},100:{transform:[{perspective:"500px",rotateX:"-90deg",translateY:"100%"}]}},duration:.3},FlipOutEasyX:{name:"FlipOutEasyX",style:{0:{transform:[{perspective:"500px",rotateX:"0deg"}]},100:{transform:[{perspective:"500px",rotateX:"90deg"}]}},duration:.3},FlipOutEasyY:{name:"FlipOutEasyY",style:{0:{transform:[{perspective:"500px",rotateY:"0deg"}]},100:{transform:[{perspective:"500px",rotateY:"90deg"}]}},duration:.3}},t4={FlipInYRight:{style:convertAnimationObjectToKeyframes(t3.FlipInYRight),duration:t3.FlipInYRight.duration},FlipInYLeft:{style:convertAnimationObjectToKeyframes(t3.FlipInYLeft),duration:t3.FlipInYLeft.duration},FlipInXUp:{style:convertAnimationObjectToKeyframes(t3.FlipInXUp),duration:t3.FlipInXUp.duration},FlipInXDown:{style:convertAnimationObjectToKeyframes(t3.FlipInXDown),duration:t3.FlipInXDown.duration},FlipInEasyX:{style:convertAnimationObjectToKeyframes(t3.FlipInEasyX),duration:t3.FlipInEasyX.duration},FlipInEasyY:{style:convertAnimationObjectToKeyframes(t3.FlipInEasyY),duration:t3.FlipInEasyY.duration}},t9={FlipOutYRight:{style:convertAnimationObjectToKeyframes(t5.FlipOutYRight),duration:t5.FlipOutYRight.duration},FlipOutYLeft:{style:convertAnimationObjectToKeyframes(t5.FlipOutYLeft),duration:t5.FlipOutYLeft.duration},FlipOutXUp:{style:convertAnimationObjectToKeyframes(t5.FlipOutXUp),duration:t5.FlipOutXUp.duration},FlipOutXDown:{style:convertAnimationObjectToKeyframes(t5.FlipOutXDown),duration:t5.FlipOutXDown.duration},FlipOutEasyX:{style:convertAnimationObjectToKeyframes(t5.FlipOutEasyX),duration:t5.FlipOutEasyX.duration},FlipOutEasyY:{style:convertAnimationObjectToKeyframes(t5.FlipOutEasyY),duration:t5.FlipOutEasyY.duration}},t6={LightSpeedInRight:{name:"LightSpeedInRight",style:{0:{transform:[{translateX:"100vw",skewX:"-45deg"}],opacity:0},70:{transform:[{skewX:"10deg"}]},85:{transform:[{skewX:"-5deg"}]},100:{transform:[{skewX:"0deg"}]}},duration:.3},LightSpeedInLeft:{name:"LightSpeedInLeft",style:{0:{transform:[{translateX:"-100vw",skewX:"45deg"}],opacity:0},70:{transform:[{skewX:"-10deg"}]},85:{transform:[{skewX:"5deg"}]},100:{transform:[{skewX:"0deg"}]}},duration:.3}},t7={LightSpeedOutRight:{name:"LightSpeedOutRight",style:{100:{transform:[{translateX:"100vw",skewX:"-45deg"}],opacity:0}},duration:.3},LightSpeedOutLeft:{name:"LightSpeedOutLeft",style:{100:{transform:[{translateX:"-100vw",skew:"45deg"}],opacity:0}},duration:.3}},t8={LightSpeedInRight:{style:convertAnimationObjectToKeyframes(t6.LightSpeedInRight),duration:t6.LightSpeedInRight.duration},LightSpeedInLeft:{style:convertAnimationObjectToKeyframes(t6.LightSpeedInLeft),duration:t6.LightSpeedInLeft.duration}},re={LightSpeedOutRight:{style:convertAnimationObjectToKeyframes(t7.LightSpeedOutRight),duration:t7.LightSpeedOutRight.duration},LightSpeedOutLeft:{style:convertAnimationObjectToKeyframes(t7.LightSpeedOutLeft),duration:t7.LightSpeedOutLeft.duration}},rr={PinwheelIn:{name:"PinwheelIn",style:{0:{transform:[{rotate:"5rad",scale:0}],opacity:0},100:{transform:[{rotate:"0deg",scale:1}],opacity:1}},duration:.3},PinwheelOut:{name:"PinwheelOut",style:{100:{transform:[{rotate:"5rad",scale:0}],opacity:0}},duration:.3}},rn={PinwheelIn:{style:convertAnimationObjectToKeyframes(rr.PinwheelIn),duration:rr.PinwheelIn.duration},PinwheelOut:{style:convertAnimationObjectToKeyframes(rr.PinwheelOut),duration:rr.PinwheelOut.duration}},ri={RollInLeft:{name:"RollInLeft",style:{0:{transform:[{translateX:"-100vw",rotate:"-180deg"}]}},duration:.3},RollInRight:{name:"RollInRight",style:{0:{transform:[{translateX:"100vw",rotate:"180deg"}]}},duration:.3}},ro={RollOutLeft:{name:"RollOutLeft",style:{100:{transform:[{translateX:"-100vw",rotate:"-180deg"}]}},duration:.3},RollOutRight:{name:"RollOutRight",style:{100:{transform:[{translateX:"100vw",rotate:"180deg"}]}},duration:.3}},rs={RollInLeft:{style:convertAnimationObjectToKeyframes(ri.RollInLeft),duration:ri.RollInLeft.duration},RollInRight:{style:convertAnimationObjectToKeyframes(ri.RollInRight),duration:ri.RollInRight.duration}},ra={RollOutLeft:{style:convertAnimationObjectToKeyframes(ro.RollOutLeft),duration:ro.RollOutLeft.duration},RollOutRight:{style:convertAnimationObjectToKeyframes(ro.RollOutRight),duration:ro.RollOutRight.duration}},rl={RotateInDownLeft:{name:"RotateInDownLeft",style:{0:{transform:[{translateX:"-50%",translateY:"-250%",rotate:"-90deg"}],opacity:0}},duration:.3},RotateInDownRight:{name:"RotateInDownRight",style:{0:{transform:[{translateX:"40%",translateY:"-250%",rotate:"90deg"}],opacity:0}},duration:.3},RotateInUpLeft:{name:"RotateInUpLeft",style:{0:{transform:[{translateX:"-40%",translateY:"250%",rotate:"90deg"}],opacity:0}},duration:.3},RotateInUpRight:{name:"RotateInUpRight",style:{0:{transform:[{translateX:"40%",translateY:"250%",rotate:"-90deg"}],opacity:0}},duration:.3}},ru={RotateOutDownLeft:{name:"RotateOutDownLeft",style:{100:{transform:[{translateX:"-40%",translateY:"250%",rotate:"90deg"}],opacity:0}},duration:.3},RotateOutDownRight:{name:"RotateOutDownRight",style:{100:{transform:[{translateX:"40%",translateY:"250%",rotate:"-90deg"}],opacity:0}},duration:.3},RotateOutUpLeft:{name:"RotateOutUpLeft",style:{100:{transform:[{translateX:"-40%",translateY:"-250%",rotate:"-90deg"}],opacity:0}},duration:.3},RotateOutUpRight:{name:"RotateOutUpRight",style:{100:{transform:[{translateX:"40%",translateY:"-250%",rotate:"90deg"}],opacity:0}},duration:.3}},rd={RotateInDownLeft:{style:convertAnimationObjectToKeyframes(rl.RotateInDownLeft),duration:rl.RotateInDownLeft.duration},RotateInDownRight:{style:convertAnimationObjectToKeyframes(rl.RotateInDownRight),duration:rl.RotateInDownRight.duration},RotateInUpLeft:{style:convertAnimationObjectToKeyframes(rl.RotateInUpLeft),duration:rl.RotateInUpLeft.duration},RotateInUpRight:{style:convertAnimationObjectToKeyframes(rl.RotateInUpRight),duration:rl.RotateInUpRight.duration}},rh={RotateOutDownLeft:{style:convertAnimationObjectToKeyframes(ru.RotateOutDownLeft),duration:ru.RotateOutDownLeft.duration},RotateOutDownRight:{style:convertAnimationObjectToKeyframes(ru.RotateOutDownRight),duration:ru.RotateOutDownRight.duration},RotateOutUpLeft:{style:convertAnimationObjectToKeyframes(ru.RotateOutUpLeft),duration:ru.RotateOutUpLeft.duration},RotateOutUpRight:{style:convertAnimationObjectToKeyframes(ru.RotateOutUpRight),duration:ru.RotateOutUpRight.duration}},rp={SlideInRight:{name:"SlideInRight",style:{0:{transform:[{translateX:"100vw"}]},100:{transform:[{translateX:"0%"}]}},duration:.3},SlideInLeft:{name:"SlideInLeft",style:{0:{transform:[{translateX:"-100vw"}]},100:{transform:[{translateX:"0%"}]}},duration:.3},SlideInUp:{name:"SlideInUp",style:{0:{transform:[{translateY:"-100vh"}]},100:{transform:[{translateY:"0%"}]}},duration:.3},SlideInDown:{name:"SlideInDown",style:{0:{transform:[{translateY:"100vh"}]},100:{transform:[{translateY:"0%"}]}},duration:.3}},rf={SlideOutRight:{name:"SlideOutRight",style:{0:{transform:[{translateX:"0%"}]},100:{transform:[{translateX:"100vw"}]}},duration:.3},SlideOutLeft:{name:"SlideOutLeft",style:{0:{transform:[{translateX:"0%"}]},100:{transform:[{translateX:"-100vw"}]}},duration:.3},SlideOutUp:{name:"SlideOutUp",style:{0:{transform:[{translateY:"0%"}]},100:{transform:[{translateY:"-100vh"}]}},duration:.3},SlideOutDown:{name:"SlideOutDown",style:{0:{transform:[{translateY:"0%"}]},100:{transform:[{translateY:"100vh"}]}},duration:.3}},rm={SlideInRight:{style:convertAnimationObjectToKeyframes(rp.SlideInRight),duration:rp.SlideInRight.duration},SlideInLeft:{style:convertAnimationObjectToKeyframes(rp.SlideInLeft),duration:rp.SlideInLeft.duration},SlideInUp:{style:convertAnimationObjectToKeyframes(rp.SlideInUp),duration:rp.SlideInUp.duration},SlideInDown:{style:convertAnimationObjectToKeyframes(rp.SlideInDown),duration:rp.SlideInDown.duration}},rg={SlideOutRight:{style:convertAnimationObjectToKeyframes(rf.SlideOutRight),duration:rf.SlideOutRight.duration},SlideOutLeft:{style:convertAnimationObjectToKeyframes(rf.SlideOutLeft),duration:rf.SlideOutLeft.duration},SlideOutUp:{style:convertAnimationObjectToKeyframes(rf.SlideOutUp),duration:rf.SlideOutUp.duration},SlideOutDown:{style:convertAnimationObjectToKeyframes(rf.SlideOutDown),duration:rf.SlideOutDown.duration}},r_={StretchInX:{name:"StretchInX",style:{0:{transform:[{scaleX:0}]},100:{transform:[{scaleX:1}]}},duration:.3},StretchInY:{name:"StretchInY",style:{0:{transform:[{scaleY:0}]},100:{transform:[{scaleY:1}]}},duration:.3}},ry={StretchOutX:{name:"StretchOutX",style:{0:{transform:[{scaleX:1}]},100:{transform:[{scaleX:0}]}},duration:.3},StretchOutY:{name:"StretchOutY",style:{0:{transform:[{scaleY:1}]},100:{transform:[{scaleY:0}]}},duration:.3}},rv={StretchInX:{style:convertAnimationObjectToKeyframes(r_.StretchInX),duration:r_.StretchInX.duration},StretchInY:{style:convertAnimationObjectToKeyframes(r_.StretchInY),duration:r_.StretchInY.duration}},rb={StretchOutX:{style:convertAnimationObjectToKeyframes(ry.StretchOutX),duration:ry.StretchOutX.duration},StretchOutY:{style:convertAnimationObjectToKeyframes(ry.StretchOutY),duration:ry.StretchOutY.duration}},rE={ZoomIn:{name:"ZoomIn",style:{0:{transform:[{scale:0}]},100:{transform:[{scale:1}]}},duration:.3},ZoomInRotate:{name:"ZoomInRotate",style:{0:{transform:[{scale:0,rotate:"0.3rad"}]},100:{transform:[{scale:1,rotate:"0deg"}]}},duration:.3},ZoomInRight:{name:"ZoomInRight",style:{0:{transform:[{translateX:"100vw",scale:0}]},100:{transform:[{translateX:"0%",scale:1}]}},duration:.3},ZoomInLeft:{name:"ZoomInLeft",style:{0:{transform:[{translateX:"-100vw",scale:0}]},100:{transform:[{translateX:"0%",scale:1}]}},duration:.3},ZoomInUp:{name:"ZoomInUp",style:{0:{transform:[{translateY:"-100vh",scale:0}]},100:{transform:[{translateY:"0%",scale:1}]}},duration:.3},ZoomInDown:{name:"ZoomInDown",style:{0:{transform:[{translateY:"100vh",scale:0}]},100:{transform:[{translateY:"0%",scale:1}]}},duration:.3},ZoomInEasyUp:{name:"ZoomInEasyUp",style:{0:{transform:[{translateY:"-100%",scale:0}]},100:{transform:[{translateY:"0%",scale:1}]}},duration:.3},ZoomInEasyDown:{name:"ZoomInEasyDown",style:{0:{transform:[{translateY:"100%",scale:0}]},100:{transform:[{translateY:"0%",scale:1}]}},duration:.3}},rS={ZoomOut:{name:"ZoomOut",style:{100:{transform:[{scale:0}]}},duration:.3},ZoomOutRotate:{name:"ZoomOutRotate",style:{100:{transform:[{scale:0,rotate:"0.3rad"}]}},duration:.3},ZoomOutRight:{name:"ZoomOutRight",style:{100:{transform:[{translateX:"100vw",scale:0}]}},duration:.3},ZoomOutLeft:{name:"ZoomOutLeft",style:{100:{transform:[{translateX:"-100vw",scale:1}]}},duration:.3},ZoomOutUp:{name:"ZoomOutUp",style:{100:{transform:[{translateY:"-100vh",scale:0}]}},duration:.3},ZoomOutDown:{name:"ZoomOutDown",style:{100:{transform:[{translateY:"100vh",scale:0}]}},duration:.3},ZoomOutEasyUp:{name:"ZoomOutEasyUp",style:{100:{transform:[{translateY:"-100%",scale:0}]}},duration:.3},ZoomOutEasyDown:{name:"ZoomOutEasyDown",style:{100:{transform:[{translateY:"100%",scale:0}]}},duration:.3}},rw={ZoomIn:{style:convertAnimationObjectToKeyframes(rE.ZoomIn),duration:rE.ZoomIn.duration},ZoomInRotate:{style:convertAnimationObjectToKeyframes(rE.ZoomInRotate),duration:rE.ZoomInRotate.duration},ZoomInRight:{style:convertAnimationObjectToKeyframes(rE.ZoomInRight),duration:rE.ZoomInRight.duration},ZoomInLeft:{style:convertAnimationObjectToKeyframes(rE.ZoomInLeft),duration:rE.ZoomInLeft.duration},ZoomInUp:{style:convertAnimationObjectToKeyframes(rE.ZoomInUp),duration:rE.ZoomInUp.duration},ZoomInDown:{style:convertAnimationObjectToKeyframes(rE.ZoomInDown),duration:rE.ZoomInDown.duration},ZoomInEasyUp:{style:convertAnimationObjectToKeyframes(rE.ZoomInEasyUp),duration:rE.ZoomInEasyUp.duration},ZoomInEasyDown:{style:convertAnimationObjectToKeyframes(rE.ZoomInEasyDown),duration:rE.ZoomInEasyDown.duration}},rT={ZoomOut:{style:convertAnimationObjectToKeyframes(rS.ZoomOut),duration:rS.ZoomOut.duration},ZoomOutRotate:{style:convertAnimationObjectToKeyframes(rS.ZoomOutRotate),duration:rS.ZoomOutRotate.duration},ZoomOutRight:{style:convertAnimationObjectToKeyframes(rS.ZoomOutRight),duration:rS.ZoomOutRight.duration},ZoomOutLeft:{style:convertAnimationObjectToKeyframes(rS.ZoomOutLeft),duration:rS.ZoomOutLeft.duration},ZoomOutUp:{style:convertAnimationObjectToKeyframes(rS.ZoomOutUp),duration:rS.ZoomOutUp.duration},ZoomOutDown:{style:convertAnimationObjectToKeyframes(rS.ZoomOutDown),duration:rS.ZoomOutDown.duration},ZoomOutEasyUp:{style:convertAnimationObjectToKeyframes(rS.ZoomOutEasyUp),duration:rS.ZoomOutEasyUp.duration},ZoomOutEasyDown:{style:convertAnimationObjectToKeyframes(rS.ZoomOutEasyDown),duration:rS.ZoomOutEasyDown.duration}},rI=new Map,rR=((et={})[et.LINEAR=0]="LINEAR",et[et.SEQUENCED=1]="SEQUENCED",et[et.FADING=2]="FADING",et),rP={...tZ,...t0,...tX,...tY,...t3,...t5,...r_,...ry,...rE,...rS,...rp,...rf,...t6,...t7,...rr,...rl,...ru,...ri,...ro},rA={...t1,...t2,...tQ,...tJ,...t4,...t9,...rv,...rb,...rw,...rT,...rm,...rg,...t8,...re,...rn,...rd,...rh,...rs,...ra},rO={linear:[0,0,1,1],ease:[.42,0,1,1],quad:[.11,0,.5,0],cubic:[.32,0,.67,0],sin:[.12,0,.39,0],circle:[.55,0,1,.45],exp:[.7,0,.84,0]},rC="ReanimatedWebAnimationsStyle";function insertWebAnimation(n,l){let u=document.getElementById(rC);if(!u.sheet){console.error("[Reanimated] Failed to create layout animations stylesheet");return}let d=u.sheet.insertRule(l);rI.set(n,d)}function createAnimationWithExistingTransform(n,l,u){let d;if(u)d=u;else{if(!(n in rA))return"";d=structuredClone(rP[n])}let h=generateNextCustomKeyframeName();d.name=h;let f=function(n){let l=n.map(n=>{let l={};for(let[u,d]of Object.entries(n))u.includes("translate")?l[u]=`${d}px`:l[u]=d;return l});return l}(l);!function(n,l){for(let u of Object.values(n.style))u.transform?Array.prototype.unshift.apply(u.transform,l):u.transform=l}(d,f);let m=convertAnimationObjectToKeyframes(d);return insertWebAnimation(h,m),h}let rk=0;function generateNextCustomKeyframeName(){return`REA${rk++}`}let rx=isReducedMotion();function getRandomDelay(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;return Math.floor(Math.random()*(n+1))/1e3}function getReducedMotionFromConfig(n){if(!n.reduceMotionV)return rx;switch(n.reduceMotionV){case e3.Never:return!1;case e3.Always:return!0;default:return rx}}function setElementAnimation(n,l,u){let{animationName:d,duration:h,delay:f,easing:m}=l;n.style.animationName=d,n.style.animationDuration=`${h}s`,n.style.animationDelay=`${f}s`,n.style.animationTimingFunction=m,n.onanimationend=()=>{var u;null===(u=l.callback)||void 0===u||u.call(l,!0),n.removeEventListener("animationcancel",animationCancelHandler)};let animationCancelHandler=()=>{var u;null===(u=l.callback)||void 0===u||u.call(l,!1),n.removeEventListener("animationcancel",animationCancelHandler)};n.onanimationstart=()=>{l.animationType===tj.ENTERING&&_updatePropsJS({visibility:"initial"},{_component:n}),n.addEventListener("animationcancel",animationCancelHandler),n.style.transform=convertTransformToString(u)},function(n,l){let u=Math.max(1250*l,l+160);setTimeout(()=>(function(n){var l;if(!rI.has(n))return;let u=document.getElementById(rC);null===(l=u.sheet)||void 0===l||l.deleteRule(rI.get(n)),rI.delete(n)})(n),u)}(d,h+f)}function startWebLayoutAnimation(n,l,u,d){let h=function(n,l){var u,d,h,f;let m=function(n,l){let u=n===tj.ENTERING?l.entering:n===tj.EXITING?l.exiting:n===tj.LAYOUT?l.layout:null;return u}(l,n);if(!m)return null;let g=l===tj.LAYOUT,_="function"==typeof m?m.presetName:m.constructor.presetName,j=!(_ in rA)&&!g&&(console.warn("[Reanimated] Couldn't load entering/exiting animation. Current version supports only predefined animations with modifiers: duration, delay, easing, randomizeDelay, wtihCallback, reducedMotion."),!0);if(j)return null;let $=function(n){if(n){if("string"==typeof n.transform)throw Error("[Reanimated] String transform is currently unsupported.");if(!Array.isArray(n))return n.transform;for(let l=n.length-1;l>=0;--l)if(n[l].transform)return n[l].transform}}(n.style),z=$?createAnimationWithExistingTransform(_,$):_,ee=(u=z,d=l,h=m,f=_,{animationName:u,animationType:d,duration:function(n,l,u){let d=l?.3:rA[u].duration;return void 0!==n.durationV?n.durationV/1e3:d}(h,d===tj.LAYOUT,f),delay:function(n){let l=n.randomizeDelay,u=l?getRandomDelay():0;return n.delayV?l?getRandomDelay(n.delayV):n.delayV/1e3:u}(h),easing:function(n){let l=void 0!==n.easingV&&n.easingV.name in rO?n.easingV.name:"linear";return`cubic-bezier(${rO[l].toString()})`}(h),callback:void 0!==h.callbackV?h.callbackV:null,reversed:!!h.reversed});return{animationConfig:ee,transform:$}}(n,u);if(h){let{animationConfig:n,transform:f}=h;!function(n,l,u,d,h){switch(n){case tj.ENTERING:setElementAnimation(u,l);break;case tj.LAYOUT:d.reversed=l.reversed,function(n,l,u,d){let h;let{animationName:f}=l;switch(f){case"LinearTransition":default:h=rR.LINEAR;break;case"SequencedTransition":h=rR.SEQUENCED;break;case"FadingTransition":h=rR.FADING}l.animationName=function(n,l,u){let d;let h=generateNextCustomKeyframeName();switch(n){case rR.LINEAR:d=function(n,l){let{translateX:u,translateY:d,scaleX:h,scaleY:f}=l,m={name:n,style:{0:{transform:[{translateX:`${u}px`,translateY:`${d}px`,scale:`${h},${f}`}]}},duration:300};return m}(h,l);break;case rR.SEQUENCED:d=function(n,l){let{translateX:u,translateY:d,scaleX:h,scaleY:f,reversed:m}=l,g=m?`1,${h}`:`${f},1`,_={name:n,style:{0:{transform:[{translateX:`${u}px`,translateY:`${d}px`,scale:`${h},${f}`}]},50:{transform:[{translateX:m?`${u}px`:"0px",translateY:m?"0px":`${d}px`,scale:g}]},100:{transform:[{translateX:"0px",translateY:"0px",scale:"1,1"}]}},duration:300};return _}(h,l);break;case rR.FADING:d=function(n,l){let{translateX:u,translateY:d,scaleX:h,scaleY:f}=l,m={name:n,style:{0:{opacity:1,transform:[{translateX:`${u}px`,translateY:`${d}px`,scale:`${h},${f}`}]},20:{opacity:0,transform:[{translateX:`${u}px`,translateY:`${d}px`,scale:`${h},${f}`}]},60:{opacity:0,transform:[{translateX:"0px",translateY:"0px",scale:"1,1"}]},100:{opacity:1,transform:[{translateX:"0px",translateY:"0px",scale:"1,1"}]}},duration:300};return m}(h,l)}if(u)return createAnimationWithExistingTransform("",u,d);let f=convertAnimationObjectToKeyframes(d);return insertWebAnimation(h,f),h}(h,u,d);let m=d?structuredClone(d):[];m.push(u),n.style.transform=convertTransformToString(m),setElementAnimation(n,l,d)}(u,l,d,h);break;case tj.EXITING:!function(n,l){let u=n.offsetParent,d=n.cloneNode();for(n.style.animationName="",n.style.visibility="hidden";n.firstChild;)d.appendChild(n.firstChild);setElementAnimation(d,l),null==u||u.appendChild(d),d.style.position="absolute",d.style.top=`${n.offsetTop}px`,d.style.left=`${n.offsetLeft}px`,d.style.margin="0px";let h=d.onanimationend;d.onanimationend=function(n){null!=u&&u.contains(d)&&u.removeChild(d),null==h||h.call(this,n)}}(u,l)}}(u,n,l,d,f)}else _updatePropsJS({visibility:"initial"},{_component:l})}function _extends(){return(_extends=Object.assign?Object.assign.bind():function(n){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(n[d]=u[d])}return n}).apply(this,arguments)}function createAnimatedComponent_defineProperty(n,l,u){var d;return(l="symbol"==typeof(d=function(n,l){if("object"!=typeof n||null===n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var d=u.call(n,l||"default");if("object"!=typeof d)return d;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(l,"string"))?d:String(d))in n?Object.defineProperty(n,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[l]=u,n}let rM=isWeb(),rD=isFabric();function isSameAnimatedStyle(n,l){return(null==n?void 0:n.viewsRef)===(null==l?void 0:l.viewsRef)}function createAnimatedComponent(n,l){tV()("function"!=typeof n||n.prototype&&n.prototype.isReactComponent,`Looks like you're passing a function component \`${n.name}\` to \`createAnimatedComponent\` function which supports only class components. Please wrap your function component with \`React.forwardRef()\` or use a class component instead.`);let AnimatedComponent=class AnimatedComponent extends ez.Component{constructor(n){super(n),createAnimatedComponent_defineProperty(this,"_styles",null),createAnimatedComponent_defineProperty(this,"_animatedProps",void 0),createAnimatedComponent_defineProperty(this,"_viewTag",-1),createAnimatedComponent_defineProperty(this,"_isFirstRender",!0),createAnimatedComponent_defineProperty(this,"animatedStyle",{value:{}}),createAnimatedComponent_defineProperty(this,"_component",null),createAnimatedComponent_defineProperty(this,"_sharedElementTransition",null),createAnimatedComponent_defineProperty(this,"_jsPropsUpdater",new tz),createAnimatedComponent_defineProperty(this,"_InlinePropManager",new InlinePropManager),createAnimatedComponent_defineProperty(this,"_PropsFilter",new PropsFilter),createAnimatedComponent_defineProperty(this,"_viewInfo",void 0),createAnimatedComponent_defineProperty(this,"context",void 0),createAnimatedComponent_defineProperty(this,"_setComponentRef",createAnimatedComponent_setAndForwardRef({getForwardedRef:()=>this.props.forwardedRef,setLocalRef:n=>{let l=rM?n:exports_findNodeHandle(n),{layout:u,entering:d,exiting:h,sharedTransitionTag:f}=this.props;if((u||d||h||f)&&null!=l){var m,g,_;shouldBeUseWeb()||function(n){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];l?(tM={enableLayoutAnimations:n,setByUser:!0},e6.enableLayoutAnimations(n)):tM.setByUser||tM.enableLayoutAnimations===n||(tM.enableLayoutAnimations=n,e6.enableLayoutAnimations(n))}(!0,!1),u&&configureLayoutAnimations(l,tj.LAYOUT,maybeBuild(u,void 0,AnimatedComponent.displayName));let n=null===(m=this.context)||void 0===m?void 0:m.current;if(d&&!n&&configureLayoutAnimations(l,tj.ENTERING,maybeBuild(d,null===(g=this.props)||void 0===g?void 0:g.style,AnimatedComponent.displayName)),h){let n="getReduceMotion"in h&&"function"==typeof h.getReduceMotion?getReduceMotionFromConfig(h.getReduceMotion()):getReduceMotionFromConfig();n||configureLayoutAnimations(l,tj.EXITING,maybeBuild(h,null===(_=this.props)||void 0===_?void 0:_.style,AnimatedComponent.displayName))}if(f&&!rM){let n=this.props.sharedTransitionStyle??new SharedTransition,u=getReduceMotionFromConfig(n.getReduceMotion());u||(n.registerTransition(l,f),this._sharedElementTransition=n)}}n!==this._component&&(this._component=n)}})),isJest()&&(this.animatedStyle={value:{}})}componentDidMount(){if(this._attachNativeEvents(),this._jsPropsUpdater.addOnJSPropsChangeListener(this),this._attachAnimatedStyles(),this._InlinePropManager.attachInlineProps(this,this._getViewInfo()),rM){if(!function(){if(null!==document.getElementById(rC))return;let n=document.createElement("style");n.id=rC,n.onload=()=>{if(!n.sheet){console.error("[Reanimated] Failed to create layout animations stylesheet");return}for(let l in rA)n.sheet.insertRule(rA[l].style)},document.head.appendChild(n)}(),!this.props.entering||getReducedMotionFromConfig(this.props.entering)){this._isFirstRender=!1;return}startWebLayoutAnimation(this.props,this._component,tj.ENTERING)}this._isFirstRender=!1}componentWillUnmount(){var n;this._detachNativeEvents(),this._jsPropsUpdater.removeOnJSPropsChangeListener(this),this._detachStyles(),this._InlinePropManager.detachInlineProps(),null===(n=this._sharedElementTransition)||void 0===n||n.unregisterTransition(this._viewTag),rM&&this.props.exiting&&!getReducedMotionFromConfig(this.props.exiting)&&startWebLayoutAnimation(this.props,this._component,tj.EXITING)}_getEventViewRef(){var n,l,u;return null!==(n=this._component)&&void 0!==n&&n.getScrollableNode?null===(l=(u=this._component).getScrollableNode)||void 0===l?void 0:l.call(u):this._component}_attachNativeEvents(){let n=this._getEventViewRef(),u=null;for(let d in this.props){let h=this.props[d];has("current",h)&&h.current instanceof WorkletEventHandler&&(null===u&&(u=exports_findNodeHandle(null!=l&&l.setNativeProps?this:n)),h.current.registerForEvents(u,d))}}_detachNativeEvents(){for(let n in this.props){let l=this.props[n];has("current",l)&&l.current instanceof WorkletEventHandler&&l.current.unregisterFromEvents()}}_detachStyles(){if(rM&&null!==this._styles)for(let n of this._styles)null!=n&&n.viewsRef&&n.viewsRef.remove(this);else if(-1!==this._viewTag&&null!==this._styles){var n,l;for(let n of this._styles)n.viewDescriptors.remove(this._viewTag);null!==(n=this.props.animatedProps)&&void 0!==n&&n.viewDescriptors&&this.props.animatedProps.viewDescriptors.remove(this._viewTag),rD&&(l=this._viewTag,tU.push(l),1===tU.length&&queueMicrotask(flush))}}_reattachNativeEvents(n){for(let l in n){let n=this.props[l];has("current",n)&&n.current instanceof WorkletEventHandler&&n.current.reattachNeeded&&n.current.unregisterFromEvents()}let u=null;for(let n in this.props){let d=this.props[n];if(has("current",d)&&d.current instanceof WorkletEventHandler&&d.current.reattachNeeded){if(null===u){let n=this._getEventViewRef();u=exports_findNodeHandle(null!=l&&l.setNativeProps?this:n)}d.current.registerForEvents(u,n),d.current.reattachNeeded=!1}}}_updateFromNative(n){if(null!=l&&l.setNativeProps)l.setNativeProps(this._component,n);else{var u,d;null===(u=this._component)||void 0===u||null===(d=u.setNativeProps)||void 0===d||d.call(u,n)}}_getViewInfo(){var n,l,u,d;let h,f,m;if(void 0!==this._viewInfo)return this._viewInfo;let g=null,_=null!==(n=this._component)&&void 0!==n&&n.getAnimatableRef?null===(l=(u=this._component).getAnimatableRef)||void 0===l?void 0:l.call(u):this;if(rM)h=this._component,f=null,g=null,m=null;else{let n=tL.RNRenderer.findHostInstance_DEPRECATED(_);if(!n)throw Error("[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?");h=null==n?void 0:n._nativeTag,f=null==n?void 0:null===(d=n.viewConfig)||void 0===d?void 0:d.uiViewClassName,m=null==n?void 0:n.viewConfig,rD&&(g=function(){throw Error("[Reanimated] Trying to call `getShadowNodeWrapperFromRef` on web.")}(this))}return this._viewInfo={viewTag:h,viewName:f,shadowNodeWrapper:g,viewConfig:m},this._viewInfo}_attachAnimatedStyles(){var n,l;let u=this.props.style?flattenArray(this.props.style).filter(n=>null==n?void 0:n.viewDescriptors):[],d=this._styles;this._styles=u;let h=this._animatedProps;this._animatedProps=this.props.animatedProps;let{viewTag:f,viewName:m,shadowNodeWrapper:g,viewConfig:_}=this._getViewInfo(),j=(null===(n=this.props.animatedProps)||void 0===n?void 0:n.viewDescriptors)||u.length;if(j&&_&&adaptViewConfig(_),this._viewTag=f,d){let n=1===u.length&&1===d.length&&isSameAnimatedStyle(u[0],d[0]);if(!n)for(let n of d){let l=u.some(l=>isSameAnimatedStyle(l,n));l||n.viewDescriptors.remove(f)}}u.forEach(n=>{n.viewDescriptors.add({tag:f,name:m,shadowNodeWrapper:g}),isJest()&&(this.animatedStyle.value={...this.animatedStyle.value,...n.initial.value},n.animatedStyle.current=this.animatedStyle)}),h&&!isSameAnimatedStyle(h,this.props.animatedProps)&&h.viewDescriptors.remove(f),null!==(l=this.props.animatedProps)&&void 0!==l&&l.viewDescriptors&&this.props.animatedProps.viewDescriptors.add({tag:f,name:m,shadowNodeWrapper:g})}componentDidUpdate(n,l,u){this._reattachNativeEvents(n),this._attachAnimatedStyles(),this._InlinePropManager.attachInlineProps(this,this._getViewInfo()),rM&&null!==u&&this.props.layout&&!getReducedMotionFromConfig(this.props.layout)&&function(n,l,u){if(!n.layout)return;let d=l.getBoundingClientRect();if(d.x===u.x&&d.y===u.y&&d.width===u.width&&d.height===u.height)return;let h={translateX:u.x-d.x,translateY:u.y-d.y,scaleX:u.width/d.width,scaleY:u.height/d.height,reversed:!1};startWebLayoutAnimation(n,l,tj.LAYOUT,h)}(this.props,this._component,u)}getSnapshotBeforeUpdate(){return void 0!==this._component.getBoundingClientRect?this._component.getBoundingClientRect():null}render(){let l=this._PropsFilter.filterNonAnimatedProps(this);isJest()&&(l.animatedStyle=this.animatedStyle),this._isFirstRender&&rM&&l.entering&&!getReducedMotionFromConfig(l.entering)&&(l.style={...l.style??{},visibility:"hidden"});let u=e0.Z.select({web:{},default:{collapsable:!1}});return ez.createElement(n,_extends({},l,{ref:this._setComponentRef},u))}};return createAnimatedComponent_defineProperty(AnimatedComponent,"displayName",void 0),createAnimatedComponent_defineProperty(AnimatedComponent,"contextType",t$),AnimatedComponent.displayName=`AnimatedComponent(${n.displayName||n.name||"Component"})`,ez.forwardRef((n,l)=>ez.createElement(AnimatedComponent,_extends({},n,null===l?null:{forwardedRef:l})))}let rN=createAnimatedComponent(tR.Z);var rV=u(33028),rF=u(31461),rL=u(3019),rj=u(82980),rU=u(77859),rB=u(75532),r$=u(39838),rH=u(12153),rW=u(10890),rq=u(29145),rz=u(51756),rG=u(29360),rK=["hrefAttrs","numberOfLines","onClick","onLayout","onPress","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture","selectable"],rX=Object.assign({},rj.lG,rj.LO,rj._T,rj.YB,rj.Uy,rj.hJ,rj.E5,rj.vr,{href:!0,lang:!0,pointerEvents:!0}),pickProps=n=>(0,rU.Z)(n,rX),rY=ez.forwardRef((n,l)=>{var u=n.hrefAttrs,d=n.numberOfLines,h=n.onClick,f=n.onLayout,m=n.onPress,g=n.onMoveShouldSetResponder,_=n.onMoveShouldSetResponderCapture,j=n.onResponderEnd,$=n.onResponderGrant,z=n.onResponderMove,ee=n.onResponderReject,et=n.onResponderRelease,en=n.onResponderStart,eo=n.onResponderTerminate,es=n.onResponderTerminationRequest,el=n.onScrollShouldSetResponder,eu=n.onScrollShouldSetResponderCapture,ec=n.onSelectionChangeShouldSetResponder,eh=n.onSelectionChangeShouldSetResponderCapture,ep=n.onStartShouldSetResponder,ef=n.onStartShouldSetResponderCapture,em=n.selectable,eg=(0,rF.Z)(n,rK);null!=em&&(0,rG.O)("selectable","selectable prop is deprecated. Use styles.userSelect.");var e_=ez.useContext(rq.Z),ey=ez.useRef(null),ev=(0,rz.PE)().direction;(0,rB.Z)(ey,f),(0,rW.Z)(ey,{onMoveShouldSetResponder:g,onMoveShouldSetResponderCapture:_,onResponderEnd:j,onResponderGrant:$,onResponderMove:z,onResponderReject:ee,onResponderRelease:et,onResponderStart:en,onResponderTerminate:eo,onResponderTerminationRequest:es,onScrollShouldSetResponder:el,onScrollShouldSetResponderCapture:eu,onSelectionChangeShouldSetResponder:ec,onSelectionChangeShouldSetResponderCapture:eh,onStartShouldSetResponder:ep,onStartShouldSetResponderCapture:ef});var eE=ez.useCallback(n=>{null!=h?h(n):null!=m&&(n.stopPropagation(),m(n))},[h,m]),eS=e_?"span":"div",ew=null!=n.lang?(0,rz.w1)(n.lang):null,eT=n.dir||ew,eI=eT||ev,eR=pickProps(eg);if(eR.dir=eT,e_||(eR.dir=null!=eT?eT:"auto"),(h||m)&&(eR.onClick=eE),eR.style=[null!=d&&d>1&&{WebkitLineClamp:d},!0===e_?rJ.textHasAncestor$raw:rJ.text$raw,1===d&&rJ.textOneLine,null!=d&&d>1&&rJ.textMultiLine,n.style,!0===em&&rJ.selectable,!1===em&&rJ.notSelectable,m&&rJ.pressable],null!=n.href&&(eS="a",null!=u)){var eP=u.download,eA=u.rel,eO=u.target;null!=eP&&(eR.download=eP),null!=eA&&(eR.rel=eA),"string"==typeof eO&&(eR.target="_"!==eO.charAt(0)?"_"+eO:eO)}var eC=(0,rH.Z)(eR),ek=(0,r$.Z)(ey,eC,l);eR.ref=ek;var ex=(0,rL.Z)(eS,eR,{writingDirection:eI});return e_?ex:ez.createElement(rq.Z.Provider,{value:!0},ex)});rY.displayName="Text";var rQ={backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",color:"black",display:"inline",font:"14px System",listStyle:"none",margin:0,padding:0,position:"relative",textAlign:"start",textDecoration:"none",whiteSpace:"pre-wrap",wordWrap:"break-word"},rJ=tK.Z.create({text$raw:rQ,textHasAncestor$raw:(0,rV.Z)((0,rV.Z)({},rQ),{},{color:"inherit",font:"inherit",textAlign:"inherit",whiteSpace:"inherit"}),textOneLine:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",wordWrap:"normal"},textMultiLine:{display:"-webkit-box",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",WebkitBoxOrient:"vertical"},notSelectable:{userSelect:"none"},selectable:{userSelect:"text"},pressable:{cursor:"pointer"}});let rZ=createAnimatedComponent(rY),r0={transform:!0,opacity:!0,height:!0,width:!0,backgroundColor:!0,borderColor:!0,borderLeftColor:!0,borderRightColor:!0,borderTopColor:!0,borderBottomColor:!0,borderRadius:!0,borderTopLeftRadius:!0,borderTopRightRadius:!0,borderBottomLeftRadius:!0,borderBottomRightRadius:!0,borderLeftWidth:!0,borderRightWidth:!0,borderTopWidth:!0,borderBottomWidth:!0,color:!0,left:!0,right:!0,top:!0,bottom:!0,fontSize:!0,fontWeight:!0,lineHeight:!0,letterSpacing:!0},r1={View:rN,Text:rZ,isReactNative:!0,animations:en={"100ms":{type:"timing",duration:100},bouncy:{damping:9,mass:.9,stiffness:150},lazy:{damping:18,stiffness:50},medium:{damping:15,stiffness:120,mass:1},slow:{damping:15,stiffness:40},quick:{damping:20,mass:1.2,stiffness:250},tooltip:{damping:10,mass:.9,stiffness:100}},usePresence:eJ.oO,ResetPresence:eJ.il,useAnimatedNumber(n){let l=useSharedValue(n);return(0,ez.useMemo)(()=>({getInstance:()=>l,getValue:()=>l.value,setValue(n,u={type:"spring"},d){"direct"===u.type?(l.value=n,d?.()):"spring"===u.type?l.value=withSpring(n,u,d?()=>{runOnJS(d)()}:void 0):l.value=withTiming(n,u,d?()=>{runOnJS(d)()}:void 0)},stop(){cancelAnimation(l)}}),[l])},useAnimatedNumberReaction({value:n},l){let u=n.getInstance();return function(n,l,u){let d=useSharedValue(null,!0),h=Object.values(n.__closure??{});if(shouldBeUseWeb()){var f;!h.length&&null!==(f=u)&&void 0!==f&&f.length&&(h=u)}void 0===u?u=[...Object.values(n.__closure??{}),...Object.values(l.__closure??{}),n.__workletHash,l.__workletHash]:u.push(n.__workletHash,l.__workletHash),(0,ez.useEffect)(()=>{let u=startMapper(()=>{let u=n();l(u,d.value),d.value=u},h,[]);return()=>{stopMapper(u)}},u)}(()=>u.value,(n,u)=>{u!==n&&runOnJS(l)(n)},[l,u])},useAnimatedNumberStyle(n,l){let u=n.getInstance(),d=function(n,l){let u=(0,ez.useRef)(null),d=Object.values(n.__closure??{});if(shouldBeUseWeb()){var h;!d.length&&null!==(h=l)&&void 0!==h&&h.length&&(d=l)}void 0===l?l=[...d,n.__workletHash]:l.push(n.__workletHash),null===u.current&&(u.current=makeMutable(initialUpdaterRun(n)));let f=u.current;return(0,ez.useEffect)(()=>{let l=startMapper(()=>{f.value=n()},d,[f]);return()=>{stopMapper(l)}},l),(0,ez.useEffect)(()=>()=>{u.current=null},[]),f}(()=>u.value,[u,l]);return useAnimatedStyle(()=>l(d.value),[n,l,d,u])},useAnimations:n=>{let{props:l,presence:u,style:d,componentState:h}=n,f=Array.isArray(l.animation)?l.animation[0]:l.animation,m=!0===h.unmounted,g={},_={};if(m||!f)_=d;else{let n=l.animateOnly;for(let l in d){let u=d[l];!r0[l]||"auto"===u||"string"==typeof u&&u.startsWith("calc")||n&&!n.includes(l)?_[l]=u:g[l]=u}}"should-enter"===h.unmounted&&(_=d);let j=JSON.stringify(g),$=(0,ez.useMemo)(()=>JSON.parse(j),[j]),z=!!u?.[1],ee=(0,ez.useContext)(eJ.Oy),et=m?{type:"transition",duration:0}:en[f],eo=!1;if(Array.isArray(l.animation)){let n=l.animation[1];if(n&&"object"==typeof n)for(let l in n){let u=n[l];eo||(et=Object.apply({},et),eo=!0),"string"==typeof u?et[l]=en[u]:et[l]=u}}let es={animate:z||!0===h.unmounted?{}:$,transition:h.unmounted?{duration:0}:et,usePresenceValue:u||void 0,presenceContext:ee,exit:z?$:void 0},el=function({animate:n,from:l=!1,transition:u,exitTransition:d,delay:h,state:f,stylePriority:m="animate",onDidAnimate:g,exit:_,animateInitialState:j=!1,usePresenceValue:$,presenceContext:z}){let ee=useSharedValue(!1),[et,en]=$??[],eo=z?.initial===!1&&!j,{custom:es,reanimatedSafeToUnmount:el,reanimatedOnDidAnimate:eu}=(0,ez.useMemo)(()=>({custom:()=>z?.custom,reanimatedSafeToUnmount:()=>{en?.()},reanimatedOnDidAnimate:(...n)=>{g?.(...n)}}),[g,z,en]),ec=!!("function"==typeof _||"object"==typeof _&&_&&Object.keys(_).length>0),eh=useAnimatedStyle(()=>{let j,$;let z={transform:[]},en=f?.__state?.value||{};debug("style",j=n&&"value"in n?n.value||{}:n||{});let eh=l||{},ep=_||{};"function"==typeof ep&&(ep=ep(es()));let ef=!et&&ec,em={};em="state"===m?Object.assign({},j,en):Object.assign({},en,j),em=ee.value||eo||!Object.keys(eh).length?Object.assign({},eh,em):eh,ef&&ep&&(em=Object.assign({},ep));let eg={},e_=new Set(["position","zIndex","borderTopStyle","borderBottomStyle","borderLeftStyle","borderRightStyle","borderStyle","pointerEvents","outline"]);if(Object.keys(ep||{}).forEach(n=>{e_.has(n)||(eg[n]=!0)}),$=u&&"value"in u?u.value:u,en.transition&&($=Object.assign({},$,en.transition)),ef&&d){let n;n=d&&"value"in d?d.value:"function"==typeof d?d(es()):d,$=Object.assign({},$,n)}return Object.keys(em).forEach(n=>{var l;let u,d,f=em[n];"object"==typeof f&&f&&"onDidAnimate"in f&&(d=f.onDidAnimate,f=f.value);let{animation:m,config:_,shouldRepeat:j,repeatCount:ee,repeatReverse:et}=animationConfig(n,$),callback=(l=!1,u,h)=>{if(g&&runOnJS(eu)(n,l,u,{attemptedValue:f,attemptedSequenceItemValue:h?.attemptedSequenceValue}),d&&runOnJS(d)(l,u,{attemptedValue:f}),ef){eg[n]=!1;let l=Object.values(eg).some(Boolean);l||runOnJS(el)()}},{delayMs:en}=(l=$,u=h,l?.[n]?.delay!=null?u=l?.[n]?.delay:l?.delay!=null&&(u=l.delay),{delayMs:u});if(null!=f&&!1!==f){if("transform"===n)Array.isArray(f)?f.forEach(n=>{z.transform=z.transform||[];let l=Object.keys(n)[0],u=n[l],d={};if(Array.isArray(u)){let n=getSequenceArray(l,u,en,_,m,callback);if(n.length){let u=withSequence(n[0],...n.slice(1));j&&(u=withRepeat(u,ee,et)),d[l]=u}}else{$?.[l]?.delay!=null&&(en=$?.[l]?.delay);let n=l;$&&"transform"in $&&!(n in $)&&(n="transform");let{animation:h,config:f,shouldRepeat:m,repeatCount:g,repeatReverse:_}=animationConfig(n,$),j=h(u,f,callback);m&&(j=withRepeat(j,g,_)),null!=en?d[l]=withDelay(en,j):d[l]=j}Object.keys(d).length&&Array.isArray(z.transform)&&z.transform.push(d)}):console.error("[moti]: Invalid transform value. Needs to be an array.");else if(Array.isArray(f)){let l=getSequenceArray(n,f,en,_,m,callback),u=withSequence(l[0],...l.slice(1));if(j&&(u=withRepeat(u,ee,et)),isTransform(n)){if(z.transform=z.transform||[],l.length){let l={};l[n]=u,z.transform.push(l)}}else l.length&&(z[n]=u)}else if(isTransform(n)){z.transform=z.transform||[],$?.[n]?.delay!=null&&(en=$?.[n]?.delay);let l={},u=m(f,_,callback);j&&(u=withRepeat(u,ee,et)),null!=en?l[n]=withDelay(en,u):l[n]=u,z.transform.push(l)}else if("object"==typeof f)for(let l in z[n]={},f||{}){let u=m(f,_,callback);j&&(u=withRepeat(u,ee,et)),null!=en?z[n][l]=withDelay(en,u):z[n][l]=u}else{let l=m(f,_,callback);j&&(l=withRepeat(l,ee,et)),null!=en&&"number"==typeof en?z[n]=withDelay(en,l):z[n]=l}}}),z.transform?.length||delete z.transform,z},[n,es,h,eo,_,d,l,ec,ee,et,g,eu,el,f,m,u]);return(0,ez.useEffect)(function(){l&&!1===ee.value&&(ee.value=!0),et||ec||el()},[ec,et,el]),{style:eh}}(es);return{style:[_,el.style]}}},r2={$0:0,"$0.25":2,"$0.5":4,"$0.75":8,$1:20,"$1.5":24,$2:28,"$2.5":32,$3:36,"$3.5":40,$4:44,$true:44,"$4.5":48,$5:52,$6:64,$7:74,$8:84,$9:94,$10:104,$11:124,$12:144,$13:164,$14:184,$15:204,$16:224,$17:224,$18:244,$19:264,$20:284},r3=Object.entries(r2).map(([n,l])=>[n,0===l?0:2===l?.5:4===l?1:8===l?1.5:l<=16?Math.round(.333*l):Math.floor(.7*l-12)]),r5=r3.slice(1).map(([n,l])=>[`-${n.slice(1)}`,-l]),r4={...Object.fromEntries(r3),...Object.fromEntries(r5)},r9={0:0,1:100,2:200,3:300,4:400,5:500},r6={light:{blue:{blue1:"hsl(206, 100%, 99.2%)",blue2:"hsl(210, 100%, 98.0%)",blue3:"hsl(209, 100%, 96.5%)",blue4:"hsl(210, 98.8%, 94.0%)",blue5:"hsl(209, 95.0%, 90.1%)",blue6:"hsl(209, 81.2%, 84.5%)",blue7:"hsl(208, 77.5%, 76.9%)",blue8:"hsl(206, 81.9%, 65.3%)",blue9:"hsl(206, 100%, 50.0%)",blue10:"hsl(208, 100%, 47.3%)",blue11:"hsl(211, 100%, 43.2%)",blue12:"hsl(211, 100%, 15.0%)"},gray:{gray1:"hsl(0, 0%, 99.0%)",gray2:"hsl(0, 0%, 97.3%)",gray3:"hsl(0, 0%, 95.1%)",gray4:"hsl(0, 0%, 93.0%)",gray5:"hsl(0, 0%, 90.9%)",gray6:"hsl(0, 0%, 88.7%)",gray7:"hsl(0, 0%, 85.8%)",gray8:"hsl(0, 0%, 78.0%)",gray9:"hsl(0, 0%, 56.1%)",gray10:"hsl(0, 0%, 52.3%)",gray11:"hsl(0, 0%, 43.5%)",gray12:"hsl(0, 0%, 9.0%)"},green:{green1:"hsl(136, 50.0%, 98.9%)",green2:"hsl(138, 62.5%, 96.9%)",green3:"hsl(139, 55.2%, 94.5%)",green4:"hsl(140, 48.7%, 91.0%)",green5:"hsl(141, 43.7%, 86.0%)",green6:"hsl(143, 40.3%, 79.0%)",green7:"hsl(146, 38.5%, 69.0%)",green8:"hsl(151, 40.2%, 54.1%)",green9:"hsl(151, 55.0%, 41.5%)",green10:"hsl(152, 57.5%, 37.6%)",green11:"hsl(153, 67.0%, 28.5%)",green12:"hsl(155, 40.0%, 14.0%)"},orange:{orange1:"hsl(24, 70.0%, 99.0%)",orange2:"hsl(24, 83.3%, 97.6%)",orange3:"hsl(24, 100%, 95.3%)",orange4:"hsl(25, 100%, 92.2%)",orange5:"hsl(25, 100%, 88.2%)",orange6:"hsl(25, 100%, 82.8%)",orange7:"hsl(24, 100%, 75.3%)",orange8:"hsl(24, 94.5%, 64.3%)",orange9:"hsl(24, 94.0%, 50.0%)",orange10:"hsl(24, 100%, 46.5%)",orange11:"hsl(24, 100%, 37.0%)",orange12:"hsl(15, 60.0%, 17.0%)"},pink:{pink1:"hsl(322, 100%, 99.4%)",pink2:"hsl(323, 100%, 98.4%)",pink3:"hsl(323, 86.3%, 96.5%)",pink4:"hsl(323, 78.7%, 94.2%)",pink5:"hsl(323, 72.2%, 91.1%)",pink6:"hsl(323, 66.3%, 86.6%)",pink7:"hsl(323, 62.0%, 80.1%)",pink8:"hsl(323, 60.3%, 72.4%)",pink9:"hsl(322, 65.0%, 54.5%)",pink10:"hsl(322, 63.9%, 50.7%)",pink11:"hsl(322, 75.0%, 46.0%)",pink12:"hsl(320, 70.0%, 13.5%)"},purple:{purple1:"hsl(280, 65.0%, 99.4%)",purple2:"hsl(276, 100%, 99.0%)",purple3:"hsl(276, 83.1%, 97.0%)",purple4:"hsl(275, 76.4%, 94.7%)",purple5:"hsl(275, 70.8%, 91.8%)",purple6:"hsl(274, 65.4%, 87.8%)",purple7:"hsl(273, 61.0%, 81.7%)",purple8:"hsl(272, 60.0%, 73.5%)",purple9:"hsl(272, 51.0%, 54.0%)",purple10:"hsl(272, 46.8%, 50.3%)",purple11:"hsl(272, 50.0%, 45.8%)",purple12:"hsl(272, 66.0%, 16.0%)"},red:{red1:"hsl(359, 100%, 99.4%)",red2:"hsl(359, 100%, 98.6%)",red3:"hsl(360, 100%, 96.8%)",red4:"hsl(360, 97.9%, 94.8%)",red5:"hsl(360, 90.2%, 91.9%)",red6:"hsl(360, 81.7%, 87.8%)",red7:"hsl(359, 74.2%, 81.7%)",red8:"hsl(359, 69.5%, 74.3%)",red9:"hsl(358, 75.0%, 59.0%)",red10:"hsl(358, 69.4%, 55.2%)",red11:"hsl(358, 65.0%, 48.7%)",red12:"hsl(354, 50.0%, 14.6%)"},yellow:{yellow1:"hsl(60, 54.0%, 98.5%)",yellow2:"hsl(52, 100%, 95.5%)",yellow3:"hsl(55, 100%, 90.9%)",yellow4:"hsl(54, 100%, 86.6%)",yellow5:"hsl(52, 97.9%, 82.0%)",yellow6:"hsl(50, 89.4%, 76.1%)",yellow7:"hsl(47, 80.4%, 68.0%)",yellow8:"hsl(48, 100%, 46.1%)",yellow9:"hsl(53, 92.0%, 50.0%)",yellow10:"hsl(50, 100%, 48.5%)",yellow11:"hsl(42, 100%, 29.0%)",yellow12:"hsl(40, 55.0%, 13.5%)"}},dark:{blue:{blue1:"hsl(212, 35.0%, 9.2%)",blue2:"hsl(216, 50.0%, 11.8%)",blue3:"hsl(214, 59.4%, 15.3%)",blue4:"hsl(214, 65.8%, 17.9%)",blue5:"hsl(213, 71.2%, 20.2%)",blue6:"hsl(212, 77.4%, 23.1%)",blue7:"hsl(211, 85.1%, 27.4%)",blue8:"hsl(211, 89.7%, 34.1%)",blue9:"hsl(206, 100%, 50.0%)",blue10:"hsl(209, 100%, 60.6%)",blue11:"hsl(210, 100%, 66.1%)",blue12:"hsl(206, 98.0%, 95.8%)"},gray:{gray1:"hsl(0, 0%, 8.5%)",gray2:"hsl(0, 0%, 11.0%)",gray3:"hsl(0, 0%, 13.6%)",gray4:"hsl(0, 0%, 15.8%)",gray5:"hsl(0, 0%, 17.9%)",gray6:"hsl(0, 0%, 20.5%)",gray7:"hsl(0, 0%, 24.3%)",gray8:"hsl(0, 0%, 31.2%)",gray9:"hsl(0, 0%, 43.9%)",gray10:"hsl(0, 0%, 49.4%)",gray11:"hsl(0, 0%, 62.8%)",gray12:"hsl(0, 0%, 93.0%)"},green:{green1:"hsl(146, 30.0%, 7.4%)",green2:"hsl(155, 44.2%, 8.4%)",green3:"hsl(155, 46.7%, 10.9%)",green4:"hsl(154, 48.4%, 12.9%)",green5:"hsl(154, 49.7%, 14.9%)",green6:"hsl(154, 50.9%, 17.6%)",green7:"hsl(153, 51.8%, 21.8%)",green8:"hsl(151, 51.7%, 28.4%)",green9:"hsl(151, 55.0%, 41.5%)",green10:"hsl(151, 49.3%, 46.5%)",green11:"hsl(151, 50.0%, 53.2%)",green12:"hsl(137, 72.0%, 94.0%)"},orange:{orange1:"hsl(30, 70.0%, 7.2%)",orange2:"hsl(28, 100%, 8.4%)",orange3:"hsl(26, 91.1%, 11.6%)",orange4:"hsl(25, 88.3%, 14.1%)",orange5:"hsl(24, 87.6%, 16.6%)",orange6:"hsl(24, 88.6%, 19.8%)",orange7:"hsl(24, 92.4%, 24.0%)",orange8:"hsl(25, 100%, 29.0%)",orange9:"hsl(24, 94.0%, 50.0%)",orange10:"hsl(24, 100%, 58.5%)",orange11:"hsl(24, 100%, 62.2%)",orange12:"hsl(24, 97.0%, 93.2%)"},pink:{pink1:"hsl(318, 25.0%, 9.6%)",pink2:"hsl(319, 32.2%, 11.6%)",pink3:"hsl(319, 41.0%, 16.0%)",pink4:"hsl(320, 45.4%, 18.7%)",pink5:"hsl(320, 49.0%, 21.1%)",pink6:"hsl(321, 53.6%, 24.4%)",pink7:"hsl(321, 61.1%, 29.7%)",pink8:"hsl(322, 74.9%, 37.5%)",pink9:"hsl(322, 65.0%, 54.5%)",pink10:"hsl(323, 72.8%, 59.2%)",pink11:"hsl(325, 90.0%, 66.4%)",pink12:"hsl(322, 90.0%, 95.8%)"},purple:{purple1:"hsl(284, 20.0%, 9.6%)",purple2:"hsl(283, 30.0%, 11.8%)",purple3:"hsl(281, 37.5%, 16.5%)",purple4:"hsl(280, 41.2%, 20.0%)",purple5:"hsl(279, 43.8%, 23.3%)",purple6:"hsl(277, 46.4%, 27.5%)",purple7:"hsl(275, 49.3%, 34.6%)",purple8:"hsl(272, 52.1%, 45.9%)",purple9:"hsl(272, 51.0%, 54.0%)",purple10:"hsl(273, 57.3%, 59.1%)",purple11:"hsl(275, 80.0%, 71.0%)",purple12:"hsl(279, 75.0%, 95.7%)"},red:{red1:"hsl(353, 23.0%, 9.8%)",red2:"hsl(357, 34.4%, 12.0%)",red3:"hsl(356, 43.4%, 16.4%)",red4:"hsl(356, 47.6%, 19.2%)",red5:"hsl(356, 51.1%, 21.9%)",red6:"hsl(356, 55.2%, 25.9%)",red7:"hsl(357, 60.2%, 31.8%)",red8:"hsl(358, 65.0%, 40.4%)",red9:"hsl(358, 75.0%, 59.0%)",red10:"hsl(358, 85.3%, 64.0%)",red11:"hsl(358, 100%, 69.5%)",red12:"hsl(351, 89.0%, 96.0%)"},yellow:{yellow1:"hsl(45, 100%, 5.5%)",yellow2:"hsl(46, 100%, 6.7%)",yellow3:"hsl(45, 100%, 8.7%)",yellow4:"hsl(45, 100%, 10.4%)",yellow5:"hsl(47, 100%, 12.1%)",yellow6:"hsl(49, 100%, 14.3%)",yellow7:"hsl(49, 90.3%, 18.4%)",yellow8:"hsl(50, 100%, 22.0%)",yellow9:"hsl(53, 92.0%, 50.0%)",yellow10:"hsl(54, 100%, 68.0%)",yellow11:"hsl(48, 100%, 47.0%)",yellow12:"hsl(53, 100%, 91.0%)"}}},r7={...r6.dark.blue,...r6.dark.gray,...r6.dark.green,...r6.dark.orange,...r6.dark.pink,...r6.dark.purple,...r6.dark.red,...r6.dark.yellow},r8={...r6.light.blue,...r6.light.gray,...r6.light.green,...r6.light.orange,...r6.light.pink,...r6.light.purple,...r6.light.red,...r6.light.yellow},ne={...postfixObjKeys(r8,"Light"),...postfixObjKeys(r7,"Dark")};function postfixObjKeys(n,l){return Object.fromEntries(Object.entries(n).map(([n,u])=>[`${n}${l}`,u]))}let nt={0:0,1:3,2:5,3:7,4:9,true:9,5:10,6:16,7:19,8:22,9:26,10:34,11:42,12:50};(0,eY.createTokens)({color:ne,radius:nt,zIndex:r9,space:r4,size:r2});let nr=eG.createTamagui,no=(0,eG.createTokens)({size:r2,space:r4,zIndex:r9,color:{gray50:"#f9fafb",gray100:"#f3f4f6",gray200:"#e5e7eb",gray300:"#d1d5db",gray400:"#9ca3af",gray500:"#6b7280",gray600:"#4b5563",gray700:"#374151",gray800:"#1f2937",gray900:"#111827",gray950:"#030712",red50:"#fef2f2",red100:"#fee2e2",red200:"#fecaca",red300:"#fca5a5",red400:"#f87171",red500:"#ef4444",red600:"#dc2626",red700:"#b91c1c",red800:"#991b1b",red900:"#7f1d1d",red950:"#450a0a",orange50:"#fff7ed",orange100:"#ffedd5",orange200:"#fed7aa",orange300:"#fdba74",orange400:"#fb923c",orange500:"#f97316",orange600:"#ea580c",orange700:"#c2410c",orange800:"#9a3412",orange900:"#7c2d12",orange950:"#431407",amber50:"#fffbeb",amber100:"#fef3c7",amber200:"#fde68a",amber300:"#fcd34d",amber400:"#fbbf24",amber500:"#f59e0b",amber600:"#d97706",amber700:"#b45309",amber800:"#92400e",amber900:"#78350f",yellow50:"#fefce8",yellow100:"#fef9c3",yellow200:"#fef08a",yellow300:"#fde047",yellow400:"#facc15",yellow500:"#eab308",yellow600:"#ca8a04",yellow700:"#a16207",yellow800:"#854d0e",yellow900:"#713f12",yellow950:"#422006",emerald50:"#ecfdf5",emerald100:"#d1fae5",emerald200:"#a7f3d0",emerald300:"#6ee7b7",emerald400:"#34d399",emerald500:"#10b981",emerald600:"#059669",emerald700:"#047857",emerald800:"#065f46",emerald900:"#064e3b",emerald950:"#022c22",cyan50:"#ecfeff",cyan100:"#cffafe",cyan200:"#a5f3fc",cyan300:"#67e8f9",cyan400:"#22d3ee",cyan500:"#06b6d4",cyan600:"#0891b2",cyan700:"#0e7490",cyan800:"#155e75",cyan900:"#164e63",cyan950:"#083344",sky50:"#f0f9ff",sky100:"#e0f2fe",sky200:"#bae6fd",sky300:"#7dd3fc",sky400:"#38bdf8",sky500:"#0ea5e9",sky600:"#0284c7",sky700:"#0369a1",sky800:"#075985",sky900:"#0c4a6e",sky950:"#082f49",blue50:"#eff6ff",blue100:"#dbeafe",blue200:"#bfdbfe",blue300:"#93c5fd",blue400:"#60a5fa",blue500:"#3b82f6",blue600:"#2563eb",blue700:"#1d4ed8",blue800:"#1e40af",blue900:"#1e3a8a",blue950:"#172554",indigo50:"#eef2ff",indigo100:"#e0e7ff",indigo200:"#c7d2fe",indigo300:"#a5b4fc",indigo400:"#818cf8",indigo500:"#6366f1",indigo600:"#4f46e5",indigo700:"#4338ca",indigo800:"#3730a3",indigo900:"#312e81",indigo950:"#1e1b4b",pink50:"#fdf2f8",pink100:"#fce7f3",pink200:"#fbcfe8",pink300:"#f9a8d4",pink400:"#f472b6",pink500:"#ec4899",pink600:"#db2777",pink700:"#be185d",pink800:"#9d174d",pink900:"#831843",pink950:"#500724",rose50:"#fff1f2",rose100:"#ffe4e6",rose200:"#fecdd3",rose300:"#fda4af",rose400:"#fb7185",rose500:"#f43f5e",rose600:"#e11d48",rose700:"#be123c",rose800:"#9f1239",rose900:"#881337",rose950:"#4c0519"},radius:nt}),ns=(0,eG.createFont)({family:"Sfizia",size:{1:12,2:14,3:15,4:16,5:18,6:20,7:24,8:30},lineHeight:{1:16,2:17,3:19,4:22,5:25,6:32,7:34,8:37},weight:{thin:"400",normal:"400",bold:"700"},face:{400:{normal:"Sfizia",italic:"SfiziaItalic"},700:{normal:"SfiziaBold"}}}),nl=(0,eG.createFont)({family:"Wotfard",size:{1:12,2:14,3:15,4:16,5:18,6:20,7:24,8:30},lineHeight:{1:16,2:17,3:19,4:22,5:25,6:28,7:30,8:34},weight:{thin:"400",normal:"400",bold:"700"},face:{400:{normal:"Wotfard",italic:"WotfardItalic"},700:{normal:"WotfardBold"}}}),nu=nr({animations:r1,themes:{dark:{...no.color,background:"#ffffff"},light:{...no.color,background:"#ffffff"}},shouldAddPrefersColorThemes:!0,themeClassNameOnRoot:!0,onlyAllowShorthands:!1,shorthands:eX,fonts:{body:nl,heading:nl,serif:ns},defaultFont:"body",tokens:no,media:((0,eY.setupMatchMedia)(eQ),{xs:{maxWidth:640},sm:{maxWidth:768},md:{maxWidth:1024},lg:{maxWidth:1280},xl:{maxWidth:1536},xxl:{maxWidth:1600},gtXs:{minWidth:641},gtSm:{minWidth:769},gtMd:{minWidth:1025},gtLg:{minWidth:1281},short:{maxHeight:820},tall:{minHeight:820},hoverNone:{hover:"none"},pointerCoarse:{pointer:"coarse"}})});var nd=u(86230);let nh="Toast",np="Toast";var nf=u(14503);let nm="ToastProvider",[ng,n_]=(0,nd.B)("Toast"),{Provider:ny,useStyledContext:nv}=(0,eG.createStyledContext)(),ToastProvider=n=>{let{__scopeToast:l,id:u,burntOptions:d,native:h,notificationOptions:f,label:m="Notification",duration:g=5e3,swipeDirection:_="right",swipeThreshold:j=50,children:$}=n,z=ez.useId(),ee=u??z,[et,en]=ez.useState({}),[eo,es]=ez.useState(0),el=ez.useRef(!1),eu=ez.useRef(!1),ec=ez.useCallback((n,l)=>{ez.startTransition(()=>{en(u=>({...u,[n]:l}))})},[]),eh=ez.useMemo(()=>({duration:g,burntOptions:d,native:h,notificationOptions:f}),[JSON.stringify([g,d,h,f])]);return(0,ey.jsx)(ng.Provider,{__scopeCollection:l||np,children:(0,ey.jsx)(ny,{scope:l,id:ee,label:m,duration:g,swipeDirection:_,swipeThreshold:j,toastCount:eo,viewports:et,onViewportChange:ec,onToastAdd:ez.useCallback(()=>{ez.startTransition(()=>{es(n=>n+1)})},[]),onToastRemove:ez.useCallback(()=>{ez.startTransition(()=>{es(n=>n-1)})},[]),isFocusedToastEscapeKeyDownRef:el,isClosePausedRef:eu,options:eh,children:(0,ey.jsx)(nf.e7,{options:eh,children:$})})})};function ReprogapateToastProvider(n){let{children:l,context:u}=n;return(0,ey.jsx)(ng.Provider,{__scopeCollection:np,children:(0,ey.jsx)(ny,{...u,children:(0,ey.jsx)(nf.e7,{options:u.options,children:l})})})}ToastProvider.propTypes={label(n){if(n.label&&"string"==typeof n.label&&!n.label.trim()){let n=`Invalid prop \`label\` supplied to \`${nm}\`. Expected non-empty \`string\`.`;return Error(n)}return null}},ToastProvider.displayName=nm;var nb={};(eo=ep||(ep={})).Standalone="standalone",eo.Expo="expo",eo.Guest="guest",(es=ef||(ef={})).Bare="bare",es.Standalone="standalone",es.StoreClient="storeClient",(el=em||(em={})).Handset="handset",el.Tablet="tablet",el.Desktop="desktop",el.TV="tv",el.Unsupported="unsupported";var nE=u(34406);let nS="EXPO_CONSTANTS_INSTALLATION_ID",nw=(Date.now()+"-"+Math.floor(1e9*Math.random())).toString();var nT={get appOwnership(){return null},get executionEnvironment(){return ef.Bare},get installationId(){let n;try{n=localStorage.getItem(nS),(null==n||"string"!=typeof n)&&(n=(Date.now()+"-"+Math.floor(1e9*Math.random())).toString(),localStorage.setItem(nS,n))}catch{n=nw}finally{return n}},get sessionId(){return nw},get platform(){return{web:"undefined"!=typeof navigator?{ua:navigator.userAgent}:void 0}},get isHeadless(){if("undefined"==typeof navigator)return!0;return/\bHeadlessChrome\//.test(navigator.userAgent)},get isDevice(){return!0},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){if("undefined"!=typeof location)return location.origin;return""},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return function(){if("undefined"!=typeof navigator&&"string"==typeof navigator.userAgent){let n=navigator.userAgent.toLowerCase();if(n.includes("edge"))return"Edge";if(n.includes("edg"))return"Chromium Edge";if(n.includes("opr")&&window.opr)return"Opera";if(n.includes("chrome")&&window.chrome)return"Chrome";else if(n.includes("trident"))return"IE";else if(n.includes("firefox"))return"Firefox";else if(n.includes("safari"))return"Safari"}}()},get nativeAppVersion(){return null},get nativeBuildVersion(){return null},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return nE.env.APP_MANIFEST||{}},get manifest2(){return null},get experienceUrl(){if("undefined"!=typeof location)return location.origin;return""},get debugMode(){return!1},getWebViewUserAgentAsync:async()=>"undefined"!=typeof navigator?navigator.userAgent:null};nT||console.warn("No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?");let nI=null;if(nb.ExpoUpdates){let n;nb.ExpoUpdates.manifest?n=nb.ExpoUpdates.manifest:nb.ExpoUpdates.manifestString&&(n=JSON.parse(nb.ExpoUpdates.manifestString)),n&&Object.keys(n).length>0&&(nI=n)}let nR=null;if(tW.Z.EXDevLauncher){let n;tW.Z.EXDevLauncher.manifestString&&(n=JSON.parse(tW.Z.EXDevLauncher.manifestString)),n&&Object.keys(n).length>0&&(nR=n)}let nP=null;if(nT&&nT.manifest){let n=nT.manifest;nP="string"==typeof n?JSON.parse(n):n}let nA=nI??nR??nP,{name:nO,appOwnership:nC,...nk}=nT||{},nx={...nk,appOwnership:nC??null};function isManifest(n){return"metadata"in n}function getManifest(n=!1){if(!nA){let l=null===nA?"null":"undefined";if(nk.executionEnvironment===ef.Bare&&"web"!==e0.Z.OS)n||console.warn(`Constants.manifest is ${l} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`);else if(nk.executionEnvironment===ef.StoreClient||nk.executionEnvironment===ef.Standalone)throw new eT.D("ERR_CONSTANTS_MANIFEST_UNAVAILABLE",`Constants.manifest is ${l}, must be an object.`)}return nA}Object.defineProperties(nx,{installationId:{get:()=>nk.installationId,enumerable:!1},__unsafeNoWarnManifest:{get(){let n=getManifest(!0);return n&&!isManifest(n)?n:null},enumerable:!1},__unsafeNoWarnManifest2:{get(){let n=getManifest(!0);return n&&isManifest(n)?n:null},enumerable:!1},manifest:{get(){let n=getManifest();return n&&!isManifest(n)?n:null},enumerable:!0},manifest2:{get(){let n=getManifest();return n&&isManifest(n)?n:null},enumerable:!0},expoConfig:{get(){let n=getManifest(!0);return n?nb.ExpoUpdates&&nb.ExpoUpdates.isEmbeddedLaunch?nP:isManifest(n)?n.extra?.expoClient??null:isManifest(n)?null:n:null},enumerable:!0},expoGoConfig:{get(){let n=getManifest(!0);return n?isManifest(n)?n.extra?.expoGo??null:isManifest(n)?null:n:null},enumerable:!0},easConfig:{get(){let n=getManifest(!0);return n?isManifest(n)?n.extra?.eas??null:isManifest(n)?null:n:null},enumerable:!0},__rawManifest_TEST:{get:()=>nA,set(n){nA=n},enumerable:!1}});var nM=u(37809),nD=u(71083),nN=u(59213),nV=u(42474),nF=u(99810),nL=u(17860);let nj=(0,eG.styled)(eG.Stack,{name:"ToastAnnounceExclude"}),nU=ez.forwardRef((n,l)=>{let{altText:u,...d}=n;return(0,ey.jsx)(nj,{"data-toast-announce-exclude":"","data-toast-announce-alt":u||void 0,...d,ref:l})}),ToastAnnounce=n=>{let{__scopeToast:l,children:u,...d}=n,h=nv(l),[f,m]=ez.useState(!1),[g,_]=ez.useState(!1);return function(n=()=>{}){let l=(0,eG.useEvent)(n);(0,nF.LI)(()=>{let n=0,u=0;return n=requestAnimationFrame(()=>{u=requestAnimationFrame(l)}),()=>{cancelAnimationFrame(n),cancelAnimationFrame(u)}},[l])}(()=>{ez.startTransition(()=>{m(!0)})}),ez.useEffect(()=>{let n=setTimeout(()=>_(!0),1e3);return()=>clearTimeout(n)},[]),g?null:(0,ey.jsx)(eK.h_,{asChild:!0,children:(0,ey.jsx)(nL.T,{...d,children:f&&(0,ey.jsxs)(eG.Text,{children:[h.label," ",u]})})})};var nB=u(37751),n$=u(31159),nH=u(45975),nW=u(27318),nq=u(37288);function ToastPortal({children:n,zIndex:l}){let u=n;return"android"===e0.Z.OS&&(u=(0,ey.jsx)(ReprogapateToastProvider,{context:nv(),children:n})),(0,ey.jsx)(eK.h_,{zIndex:l||1e9,children:u})}var nz=u(34406);let nG="ToastViewport",nK=["F8"],nX="toast.viewportPause",nY="toast.viewportResume",nQ=(0,eG.styled)(nq.FA,{name:"ViewportWrapper",variants:{unstyled:{false:{pointerEvents:"box-none",top:0,bottom:0,left:0,right:0,position:nF.$L?"fixed":"absolute",maxWidth:"100%",tabIndex:0,zIndex:1e5}}},defaultVariants:{unstyled:"1"===nz.env.TAMAGUI_HEADLESS}}),nJ=(0,eG.styled)(nq.FA,{name:nG,variants:{unstyled:{false:{pointerEvents:"box-none",position:nF.$L?"fixed":"absolute",maxWidth:"100%"}}},defaultVariants:{unstyled:"1"===nz.env.TAMAGUI_HEADLESS}}),nZ=ez.memo(ez.forwardRef((n,l)=>{let{__scopeToast:u,hotkey:d=nK,label:h="Notifications ({hotkey})",name:f="default",multipleToasts:m,zIndex:g,portalToRoot:_,...j}=n,$=nv(u),z=n_(u||np),ee=ez.useRef(null),et=ez.useRef(null),en=ez.useRef(null),eo=ez.useRef(null),es=ez.useCallback(n=>{$.viewports[f]!==n&&$.onViewportChange(f,n)},[f,$.viewports]),el=(0,nB.ex)(l,eo,es),eu=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),ec=$.toastCount>0;ez.useEffect(()=>{if(!nF.$L||0===$.toastCount)return;let handleKeyDown=n=>{d.every(l=>n[l]||n.code===l)&&eo.current?.focus()};return document.addEventListener("keydown",handleKeyDown),()=>{document.removeEventListener("keydown",handleKeyDown)}},[d,$.toastCount]),ez.useEffect(()=>{if(!nF.$L||0===$.toastCount)return;let n=en.current,l=eo.current;if(ec&&n&&l){let handlePause=()=>{if(!$.isClosePausedRef.current){let n=new CustomEvent(nX);l.dispatchEvent(n),$.isClosePausedRef.current=!0}},handleResume=()=>{if($.isClosePausedRef.current){let n=new CustomEvent(nY);l.dispatchEvent(n),$.isClosePausedRef.current=!1}},handleFocusOutResume=l=>{n.contains(l.relatedTarget)||handleResume()},handlePointerLeaveResume=()=>{n.contains(document.activeElement)||handleResume()};return n.addEventListener("focusin",handlePause),n.addEventListener("focusout",handleFocusOutResume),n.addEventListener("pointermove",handlePause),n.addEventListener("pointerleave",handlePointerLeaveResume),window.addEventListener("blur",handlePause),window.addEventListener("focus",handleResume),()=>{n.removeEventListener("focusin",handlePause),n.removeEventListener("focusout",handleFocusOutResume),n.removeEventListener("pointermove",handlePause),n.removeEventListener("pointerleave",handlePointerLeaveResume),window.removeEventListener("blur",handlePause),window.removeEventListener("focus",handleResume)}}},[ec,$.isClosePausedRef,$.toastCount]);let eh=ez.useCallback(({tabbingDirection:n})=>{let l=z().map(l=>{let u=l.ref.current,d=[u,...function(n){if(!nF.$L)return[];let l=[],u=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let l="INPUT"===n.tagName&&"hidden"===n.type;return n.disabled||n.hidden||l?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;u.nextNode();)l.push(u.currentNode);return l}(u)];return"forwards"===n?d:d.reverse()});return("forwards"===n?l.reverse():l).flat()},[z]);ez.useEffect(()=>{if(!nF.$L||0===$.toastCount)return;let n=eo.current;if(n){let handleKeyDown=l=>{let u=l.altKey||l.ctrlKey||l.metaKey;if("Tab"===l.key&&!u){let u=document.activeElement,d=l.shiftKey;if(l.target===n&&d){ee.current?.focus();return}let h=eh({tabbingDirection:d?"backwards":"forwards"}),f=h.findIndex(n=>n===u);focusFirst(h.slice(f+1))?l.preventDefault():d?ee.current?.focus():et.current?.focus()}};return n.addEventListener("keydown",handleKeyDown),()=>n.removeEventListener("keydown",handleKeyDown)}},[z,eh,$.toastCount]);let ep=(0,ey.jsxs)(nQ,{ref:en,role:"region","aria-label":h.replace("{hotkey}",eu),tabIndex:-1,children:[ec&&(0,ey.jsx)(n0,{__scopeToast:u,viewportName:f,ref:ee,onFocusFromOutsideViewport:()=>{let n=eh({tabbingDirection:"forwards"});focusFirst(n)}}),(0,ey.jsx)(ng.Slot,{__scopeCollection:u||np,children:(0,ey.jsx)(nJ,{focusable:$.toastCount>0,ref:el,...j,children:(0,ey.jsx)(eK.$2,{render:n=>(0,ey.jsx)(nW.M,{exitBeforeEnter:!m,children:n}),name:f??"default"})})}),ec&&(0,ey.jsx)(n0,{__scopeToast:u,viewportName:f,ref:et,onFocusFromOutsideViewport:()=>{let n=eh({tabbingDirection:"backwards"});focusFirst(n)}})]});return _?(0,ey.jsx)(ToastPortal,{..."number"==typeof g?{zIndex:g}:{},children:ep}):ep}));nZ.displayName=nG;let n0=ez.forwardRef((n,l)=>{let{__scopeToast:u,onFocusFromOutsideViewport:d,viewportName:h,...f}=n,m=nv(u).viewports[h];return(0,ey.jsx)(nL.T,{"aria-hidden":!0,tabIndex:0,...f,ref:l,position:nF.$L?"fixed":"absolute",onFocus:n=>{if(!nF.$L)return;let l=n.relatedTarget;m?.contains(l)||d()}})});function focusFirst(n){if(!nF.$L)return;let l=document.activeElement;return n.some(n=>n===l||(n.focus(),document.activeElement!==l))}n0.displayName="ToastFocusProxy";var n1=u(34406);let n2=(0,eG.styled)(nD.K,{name:"ToastImpl",focusable:!0,variants:{unstyled:{false:{focusStyle:{outlineStyle:"solid",outlineWidth:2,outlineColor:"$outlineColor"},backgroundColor:"$color6",borderRadius:"$10",paddingHorizontal:"$5",paddingVertical:"$2",marginHorizontal:"auto",marginVertical:"$1"}}},defaultVariants:{unstyled:"1"===n1.env.TAMAGUI_HEADLESS}}),{Provider:n3,useStyledContext:n5}=(0,eG.createStyledContext)({onClose(){}}),n4=ez.forwardRef((n,l)=>{let{__scopeToast:u,type:d="foreground",duration:h,open:f,onClose:m,onEscapeKeyDown:g,onPause:_,onResume:j,onSwipeStart:$,onSwipeMove:z,onSwipeCancel:ee,onSwipeEnd:et,viewportName:en="default",...eo}=n,es=(0,eJ.hO)(),el=nv(u),[eu,ec]=ez.useState(null),eh=(0,nB.ex)(l,n=>ec(n)),ep=h||el.duration,ef=ez.useRef(0),em=ez.useRef(ep),eg=ez.useRef(0),{onToastAdd:e_,onToastRemove:ev}=el,eE=ez.useMemo(()=>el.viewports[en],[el.viewports,en]),eS=(0,eG.useEvent)(()=>{es&&(nF.$L&&eu?.contains(document.activeElement)&&eE?.focus(),m())}),ew=ez.useCallback(n=>{n&&n!==Number.POSITIVE_INFINITY&&(clearTimeout(eg.current),ef.current=new Date().getTime(),eg.current=setTimeout(eS,n))},[eS]),eT=ez.useCallback(()=>{ew(em.current),j?.()},[j,ew]),eI=ez.useCallback(()=>{let n=new Date().getTime()-ef.current;em.current=em.current-n,window.clearTimeout(eg.current),_?.()},[_]);ez.useEffect(()=>{if(nF.$L&&eE)return eE.addEventListener(nX,eI),eE.addEventListener(nY,eT),()=>{eE.removeEventListener(nX,eI),eE.removeEventListener(nY,eT)}},[eE,ep,_,j,ew]),ez.useEffect(()=>{f&&!el.isClosePausedRef.current&&ew(ep)},[f,ep,el.isClosePausedRef,ew]),ez.useEffect(()=>(e_(),()=>ev()),[e_,ev]);let eR=ez.useMemo(()=>nF.$L&&eu?function getAnnounceTextContent(n){if(!nF.$L)return"";let l=[];return Array.from(n.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&l.push(n.textContent),n.nodeType===n.ELEMENT_NODE){let u=n.ariaHidden||n.hidden||"none"===n.style.display,d=""===n.dataset.toastAnnounceExclude;if(!u){if(d){let u=n.dataset.toastAnnounceAlt;u&&l.push(u)}else l.push(...getAnnounceTextContent(n))}}}),l}(eu):null,[eu]),eP=["left","right","horizontal"].includes(el.swipeDirection),{animationDriver:eA}=(0,eG.useConfiguration)();if(!eA)throw Error("Must set animations in tamagui.config.ts");let{useAnimatedNumber:eO,useAnimatedNumberStyle:eC}=eA,ek=eO(0),ex=eA.NumberView??eA.View??eG.Stack,eM=eC(ek,n=>({transform:[eP?{translateX:n}:{translateY:n}]})),eD=ez.useMemo(()=>nH.Z.create({onMoveShouldSetPanResponder:(n,l)=>!!shouldGrantGestureMove(el.swipeDirection,l)&&($?.(n),!0),onPanResponderGrant:n=>{nF.$L||eI?.()},onPanResponderMove:(n,l)=>{let{x:u,y:d}=getGestureDistance(el.swipeDirection,l);ek.setValue(eP?u:d,{type:"direct"}),isDeltaInDirection({x:u,y:d},el.swipeDirection,el.swipeThreshold)&&et?.(n),z?.(n)},onPanResponderEnd:(n,{dx:l,dy:u})=>{isDeltaInDirection({x:l,y:u},el.swipeDirection,el.swipeThreshold)||(nF.$L||eT?.(),ee?.(n),ek.setValue(0,{type:"spring"}))}}),[eI,eT]),eN=(0,eG.useThemeName)();return(0,ey.jsxs)(ey.Fragment,{children:[eR&&(0,ey.jsx)(ToastAnnounce,{__scopeToast:u,role:"status","aria-live":"foreground"===d?"assertive":"polite","aria-atomic":!0,children:eR}),(0,ey.jsx)(eK.b5,{hostName:en??"default",children:(0,ey.jsx)(n3,{scope:u,onClose:()=>{eS()},children:(0,ey.jsx)(n$.XA,{onEscapeKeyDown:(0,nM.Mj)(g,()=>{el.isFocusedToastEscapeKeyDownRef.current||eS(),el.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,ey.jsx)(eG.Theme,{forceClassName:!0,name:eN,children:(0,ey.jsx)(ex,{...eD?.panHandlers,style:[{margin:"auto"},eM],children:(0,ey.jsx)(ng.ItemSlot,{__scopeCollection:u||np,children:(0,ey.jsx)(n2,{role:"status","aria-live":"off","aria-atomic":!0,"data-state":f?"open":"closed","data-swipe-direction":el.swipeDirection,pointerEvents:"auto",touchAction:"none",userSelect:"none",...eo,ref:eh,...nF.$L&&{onKeyDown:(0,nM.Mj)(n.onKeyDown,n=>{"Escape"===n.key&&(g?.(n),g?.(n),n.defaultPrevented||(el.isFocusedToastEscapeKeyDownRef.current=!0,eS()))})}})})})})})},n.id)})]})});n4.propTypes={type(n){if(n.type&&!["foreground","background"].includes(n.type)){let n=`Invalid prop \`type\` supplied to \`${nh}\`. Expected \`foreground | background\`.`;return Error(n)}return null}};let isDeltaInDirection=(n,l,u=0)=>{let d=Math.abs(n.x),h=Math.abs(n.y),f=d>h;return"left"===l||"right"===l||"horizontal"===l?f&&d>u:!f&&h>u},shouldGrantGestureMove=(n,{dx:l,dy:u})=>("horizontal"===n||"left"===n)&&l<-10||("horizontal"===n||"right"===n)&&l>10||("vertical"===n||"up"===n)&&u>-10||("vertical"===n||"down"===n)&&u<10,getGestureDistance=(n,{dx:l,dy:u})=>{let d=0,h=0;return"horizontal"===n?h=l:"left"===n?h=Math.min(0,l):"right"===n?h=Math.max(0,l):"vertical"===n?d=u:"up"===n?d=Math.min(0,u):"down"===n&&(d=Math.max(0,u)),{x:h,y:d}};var n9=u(34406);let n6="ToastTitle",n7=(0,eG.styled)(nN.J,{name:n6,variants:{unstyled:{false:{color:"$color",size:"$4"}}},defaultVariants:{unstyled:"1"===n9.env.TAMAGUI_HEADLESS}});n7.displayName=n6;let n8="ToastDescription",ie=(0,eG.styled)(nN.J,{name:n8,variants:{unstyled:{false:{color:"$color11",size:"$1"}}},defaultVariants:{unstyled:"1"===n9.env.TAMAGUI_HEADLESS}});ie.displayName=n8;let it="ToastAction",ii=ez.forwardRef((n,l)=>{let{altText:u,...d}=n;return u?(0,ey.jsx)(nU,{altText:u,asChild:!0,children:(0,ey.jsx)(ia,{...d,ref:l})}):null});ii.propTypes={altText:n=>n.altText?null:Error(`Missing prop \`altText\` expected on \`${it}\``)},ii.displayName=it;let io="ToastClose",is=(0,eG.styled)(nD.K,{name:io,tag:"button"}),ia=ez.forwardRef((n,l)=>{let{__scopeToast:u,...d}=n,h=n5(u);return(0,ey.jsx)(nU,{asChild:!0,children:(0,ey.jsx)(is,{accessibilityLabel:"Dialog Close",...d,ref:l,onPress:(0,nM.Mj)(n.onPress,h.onClose)})})});ia.displayName=io;let il=n2.styleable((n,l)=>{let{forceMount:u,open:d,defaultOpen:h,onOpenChange:f,...m}=n,[g,_]=(0,nV.T)({prop:d,defaultProp:h??!0,onChange:f,strategy:"most-recent-wins"}),j=ez.useId(),$=(0,eG.useEvent)(n.onPause),z=(0,eG.useEvent)(n.onResume);return u||g?(0,ey.jsx)(n4,{id:j,open:g,...m,ref:l,onClose:()=>_(!1),onPause:$,onResume:z,onSwipeEnd:(0,nM.Mj)(n.onSwipeEnd,n=>{_(!1)})}):null});il.displayName=nh;let iu=(0,nM.$e)(il,{Title:n7,Description:ie,Action:ii,Close:ia}),NativeToast=()=>{let n=(0,nf.JW)();if(!n||n.isHandledNatively)return null;let l=n.customData?.type;return(0,ey.jsx)(iu,{duration:n.duration||3e3,viewportName:n.viewportName,enterStyle:{scale:.5,y:-25,o:0},exitStyle:{scale:1,y:-20,o:0},y:0,scale:1,o:1,animation:"quick",children:(0,ey.jsxs)(nq.FA,{py:"$1.5",bg:"error"===l?"$red100":"$emerald100",boc:"error"===l?"$red800":"$emerald800",px:"$2",bw:"$1",ai:"center",br:"$3",children:[(0,ey.jsx)(iu.Title,{lh:"$1",children:n.title}),!!n.message&&(0,ey.jsx)(iu.Description,{fontSize:"$5",children:n.message})]})},n.id)},id=nx.executionEnvironment===ef.StoreClient,CustomToast=()=>id?null:(0,ey.jsx)(NativeToast,{});var ih=u(11274);let ToastViewport_web_ToastViewport=()=>(0,ey.jsx)(nZ,{left:0,right:0,top:10}),ip=(0,ez.createContext)({deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image"}),SolitoImageProvider=({children:n,...l})=>{let u=(0,ez.useContext)(ip),[d]=(0,ez.useState)(()=>({...u,...l}));return(0,ey.jsx)(ip.Provider,{value:d,children:n})},im="http:",ig=RegExp(`${im}//localhost:`,"g"),getImageUrl=()=>{let n=`${ev.G8}`;return n.replace(ig,()=>`${im}//${function(){if(void 0!==_)return _;let n=ev.G8;return _=n?.split(":")[0]??"localhost"}()}:`)},SolitoImageProvider_SolitoImageProvider=({children:n})=>(0,ey.jsx)(SolitoImageProvider,{nextJsURL:getImageUrl(),children:n});(eu=eg||(eg={}))[eu.MixWithOthers=0]="MixWithOthers",eu[eu.DoNotMix=1]="DoNotMix",eu[eu.DuckOthers=2]="DuckOthers",(ec=e_||(e_={}))[ec.DoNotMix=1]="DoNotMix",ec[ec.DuckOthers=2]="DuckOthers";var i_=u(20877);let _populateMissingKeys=(n,l)=>{for(let u in l)n.hasOwnProperty(u)||(n[u]=l[u]);return n},iy={allowsRecordingIOS:!1,interruptionModeIOS:eg.MixWithOthers,playsInSilentModeIOS:!1,staysActiveInBackground:!1,interruptionModeAndroid:e_.DuckOthers,shouldDuckAndroid:!0,playThroughEarpieceAndroid:!1},iv=null;async function setAudioModeAsync(n){let l=_populateMissingKeys(n,iv||iy);if(!eg[l.interruptionModeIOS])throw Error('"interruptionModeIOS" was set to an invalid value.');if(!e_[l.interruptionModeAndroid])throw Error('"interruptionModeAndroid" was set to an invalid value.');if("boolean"!=typeof l.allowsRecordingIOS||"boolean"!=typeof l.playsInSilentModeIOS||"boolean"!=typeof l.staysActiveInBackground||"boolean"!=typeof l.shouldDuckAndroid||"boolean"!=typeof l.playThroughEarpieceAndroid)throw Error('"allowsRecordingIOS", "playsInSilentModeIOS", "playThroughEarpieceAndroid", "staysActiveInBackground" and "shouldDuckAndroid" must be booleans.');return iv=l,await i_.Z.setAudioMode(l)}async function setAudioMode(){try{await setAudioModeAsync({allowsRecordingIOS:!1,staysActiveInBackground:!0,playsInSilentModeIOS:!0,shouldDuckAndroid:!0,interruptionModeAndroid:e_.DoNotMix,interruptionModeIOS:eg.DoNotMix,playThroughEarpieceAndroid:!1}),console.log("Audio mode set successfully.")}catch(n){console.error("Failed to set audio mode",n)}}function CrossPlatformProvider({children:n,...l}){return(0,ez.useEffect)(()=>{setAudioMode()},[]),(0,ey.jsx)(ih.PK,{initialMetrics:null,children:(0,ey.jsx)(TamaguiProvider,{config:nu,disableRootThemeClass:!0,...l,children:(0,ey.jsx)(eK.Xp,{shouldAddRootHost:!0,children:(0,ey.jsx)(SolitoImageProvider_SolitoImageProvider,{children:(0,ey.jsxs)(ToastProvider,{swipeDirection:"horizontal",duration:4e3,native:["mobile"],children:[n,(0,ey.jsx)(CustomToast,{}),(0,ey.jsx)(ToastViewport_web_ToastViewport,{})]})})})})})}var iE=u(55351),iS=u(5632),iw=u(14675),iT=u(55915);u(31403),iw.t.getValue("isCronie")?console.log("PostHog tracking is disabled based on local settings."):eS.ZP.init("phc_O3cCKnKvkt8IBAv3BGhmUxfo2ftEeY19vY1tpmzSOMH",{api_host:"https://app.posthog.com",loaded:n=>{}}),eh={handleNotification:async()=>({shouldShowAlert:!0,shouldPlaySound:!1,shouldSetBadge:!1})},ek&&(ek.remove(),ek=null),ex&&(ex.remove(),ex=null),eh&&(ek=eC.addListener("onHandleNotification",async({id:n,notification:l})=>{if(!eO.handleNotificationAsync){eh.handleError?.(n,new eR.N("Notifications","handleNotificationAsync"));return}try{let u=await eh.handleNotification(l);await eO.handleNotificationAsync(n,u),eh.handleSuccess?.(n)}catch(l){eh.handleError?.(n,l)}}),ex=eC.addListener("onHandleNotificationTimeout",({id:n,notification:l})=>eh.handleError?.(n,new NotificationTimeoutError(n,l))));var _app=({Component:n,pageProps:l})=>{let u=(0,iS.useRouter)();(0,ez.useEffect)(()=>{let handleRouteChange=()=>eS.ZP?.capture("$pageview");return u.events.on("routeChangeComplete",handleRouteChange),()=>{u.events.off("routeChangeComplete",handleRouteChange)}},[]);let[d]=(0,ez.useState)(()=>new QueryClient({defaultOptions:{queries:{staleTime:6e4}}}));return(0,ey.jsxs)(ey.Fragment,{children:[(0,ey.jsx)(iE.lX,{...eE}),(0,ey.jsx)(CrossPlatformProvider,{children:(0,ey.jsxs)(ew.zf,{client:eS.ZP,children:[(0,ey.jsx)(eq.aH,{client:d,children:(0,ey.jsxs)(Hydrate,{state:l.dehydratedState,children:[(0,ey.jsx)(ReactQueryDevtools,{initialIsOpen:!1}),(0,ey.jsx)(iT.nY,{children:(0,ey.jsx)(eM.Ho,{children:(0,ey.jsx)(n,{...l})})})]})}),(0,ey.jsx)(eD.GoogleTagManager,{gtmId:"GTM-NW4RJJT5"})]})})]})}},66788:function(n,l,u){"use strict";let d,h,f,m,g,_,j,$,z,ee,et,en,eo,es,el,eu,ec,eh,ep,ef,em,eg,e_;var ey,ev,eE,eS,ew,eT,eI,eR,eP,eA,eO={};u.r(eO),u.d(eO,{FunctionToString:function(){return e$},InboundFilters:function(){return eG},LinkedErrors:function(){return eY}});var eC={};u.r(eC),u.d(eC,{Breadcrumbs:function(){return tg},Dedupe:function(){return tS},GlobalHandlers:function(){return tn},HttpContext:function(){return tb},LinkedErrors:function(){return ty},TryCatch:function(){return ta}});var ek=u(91476);function applySdkMetadata(n,l,u=[l],d="npm"){let h=n._metadata||{};h.sdk||(h.sdk={name:`sentry.javascript.${l}`,packages:u.map(n=>({name:`${d}:@sentry/${n}`,version:ek.J})),version:ek.J}),n._metadata=h}var ex=u(92642);function hasTracingEnabled(n){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;let l=(0,ex.s3)(),u=n||l&&l.getOptions();return!!u&&(u.enableTracing||"tracesSampleRate"in u||"tracesSampler"in u)}var eM=u(21995),eD=u(63699),eN=u(58536),eV=u(73232),eF=u(8589),eL=u(66465);let ej=[];function afterSetupIntegrations(n,l){for(let u of l)u&&u.afterAllSetup&&u.afterAllSetup(n)}function setupIntegration(n,l,u){if(u[l.name]){eV.X&&eN.kg.log(`Integration skipped because it was already installed: ${l.name}`);return}if(u[l.name]=l,-1===ej.indexOf(l.name)&&(l.setupOnce(eF.cc,eL.Gd),ej.push(l.name)),l.setup&&"function"==typeof l.setup&&l.setup(n),n.on&&"function"==typeof l.preprocessEvent){let u=l.preprocessEvent.bind(l);n.on("preprocessEvent",(l,d)=>u(l,d,n))}if(n.addEventProcessor&&"function"==typeof l.processEvent){let u=l.processEvent.bind(l),d=Object.assign((l,d)=>u(l,d,n),{id:l.name});n.addEventProcessor(d)}eV.X&&eN.kg.log(`Integration installed: ${l.name}`)}function convertIntegrationFnToClass(n,l){return Object.assign(function(...n){return l(...n)},{id:n})}let eU="FunctionToString",eB=new WeakMap,functionToStringIntegration=()=>({name:eU,setupOnce(){d=Function.prototype.toString;try{Function.prototype.toString=function(...n){let l=(0,eM.HK)(this),u=eB.has((0,ex.s3)())&&void 0!==l?l:this;return d.apply(u,n)}}catch(n){}},setup(n){eB.set(n,!0)}}),e$=convertIntegrationFnToClass(eU,functionToStringIntegration);var eH=u(39660);let eW=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],eq=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],ez="InboundFilters",inboundFiltersIntegration=(n={})=>({name:ez,setupOnce(){},processEvent(l,u,d){var h;let f=d.getOptions(),m=function(n={},l={}){return{allowUrls:[...n.allowUrls||[],...l.allowUrls||[]],denyUrls:[...n.denyUrls||[],...l.denyUrls||[]],ignoreErrors:[...n.ignoreErrors||[],...l.ignoreErrors||[],...n.disableErrorDefaults?[]:eW],ignoreTransactions:[...n.ignoreTransactions||[],...l.ignoreTransactions||[],...n.disableTransactionDefaults?[]:eq],ignoreInternal:void 0===n.ignoreInternal||n.ignoreInternal}}(n,f);return(m.ignoreInternal&&function(n){try{return"SentryError"===n.exception.values[0].type}catch(n){}return!1}(l)?(eV.X&&eN.kg.warn(`Event dropped due to being internal Sentry Error.
Event: ${(0,eD.jH)(l)}`),0):(h=m.ignoreErrors,!l.type&&h&&h.length&&(function(n){let l;let u=[];n.message&&u.push(n.message);try{l=n.exception.values[n.exception.values.length-1]}catch(n){}return l&&l.value&&(u.push(l.value),l.type&&u.push(`${l.type}: ${l.value}`)),eV.X&&0===u.length&&eN.kg.error(`Could not extract message for event ${(0,eD.jH)(n)}`),u})(l).some(n=>(0,eH.U0)(n,h)))?(eV.X&&eN.kg.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${(0,eD.jH)(l)}`),0):!function(n,l){if("transaction"!==n.type||!l||!l.length)return!1;let u=n.transaction;return!!u&&(0,eH.U0)(u,l)}(l,m.ignoreTransactions)?!function(n,l){if(!l||!l.length)return!1;let u=_getEventFilterUrl(n);return!!u&&(0,eH.U0)(u,l)}(l,m.denyUrls)?function(n,l){if(!l||!l.length)return!0;let u=_getEventFilterUrl(n);return!u||(0,eH.U0)(u,l)}(l,m.allowUrls)||(eV.X&&eN.kg.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${(0,eD.jH)(l)}.
Url: ${_getEventFilterUrl(l)}`),0):(eV.X&&eN.kg.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${(0,eD.jH)(l)}.
Url: ${_getEventFilterUrl(l)}`),0):(eV.X&&eN.kg.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${(0,eD.jH)(l)}`),0))?l:null}}),eG=convertIntegrationFnToClass(ez,inboundFiltersIntegration);function _getEventFilterUrl(n){try{let l;try{l=n.exception.values[0].stacktrace.frames}catch(n){}return l?function(n=[]){for(let l=n.length-1;l>=0;l--){let u=n[l];if(u&&"<anonymous>"!==u.filename&&"[native code]"!==u.filename)return u.filename||null}return null}(l):null}catch(l){return eV.X&&eN.kg.error(`Cannot extract url for event ${(0,eD.jH)(n)}`),null}}var eK=u(81757);function applyAggregateErrorsToEvent(n,l,u=250,d,h,f,m){if(!f.exception||!f.exception.values||!m||!(0,eK.V9)(m.originalException,Error))return;let g=f.exception.values.length>0?f.exception.values[f.exception.values.length-1]:void 0;g&&(f.exception.values=(function aggregateExceptionsFromError(n,l,u,d,h,f,m,g){if(f.length>=u+1)return f;let _=[...f];if((0,eK.V9)(d[h],Error)){applyExceptionGroupFieldsForParentException(m,g);let f=n(l,d[h]),j=_.length;applyExceptionGroupFieldsForChildException(f,h,j,g),_=aggregateExceptionsFromError(n,l,u,d[h],h,[f,..._],f,j)}return Array.isArray(d.errors)&&d.errors.forEach((d,f)=>{if((0,eK.V9)(d,Error)){applyExceptionGroupFieldsForParentException(m,g);let j=n(l,d),$=_.length;applyExceptionGroupFieldsForChildException(j,`errors[${f}]`,$,g),_=aggregateExceptionsFromError(n,l,u,d,h,[j,..._],j,$)}}),_})(n,l,h,m.originalException,d,f.exception.values,g,0).map(n=>(n.value&&(n.value=(0,eH.$G)(n.value,u)),n)))}function applyExceptionGroupFieldsForParentException(n,l){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,..."AggregateError"===n.type&&{is_exception_group:!0},exception_id:l}}function applyExceptionGroupFieldsForChildException(n,l,u,d){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,type:"chained",source:l,exception_id:u,parent_id:d}}function exceptionFromError(n,l){let u={type:l.name||l.constructor.name,value:l.message},d=n(l.stack||"",1);return d.length&&(u.stacktrace={frames:d}),u}let eX="LinkedErrors",eY=convertIntegrationFnToClass(eX,(n={})=>{let l=n.limit||5,u=n.key||"cause";return{name:eX,setupOnce(){},preprocessEvent(n,d,h){let f=h.getOptions();applyAggregateErrorsToEvent(exceptionFromError,f.stackParser,f.maxValueLength,u,l,n,d)}}});var eQ=u(90063);let eJ=eQ.GLOBAL_OBJ,eZ=0;function wrap(n,l={},u){if("function"!=typeof n)return n;try{let l=n.__sentry_wrapped__;if(l)return l;if((0,eM.HK)(n))return n}catch(l){return n}let sentryWrapped=function(){let d=Array.prototype.slice.call(arguments);try{u&&"function"==typeof u&&u.apply(this,arguments);let h=d.map(n=>wrap(n,l));return n.apply(this,h)}catch(n){throw eZ++,setTimeout(()=>{eZ--}),(0,ex.$e)(u=>{u.addEventProcessor(n=>(l.mechanism&&((0,eD.Db)(n,void 0,void 0),(0,eD.EG)(n,l.mechanism)),n.extra={...n.extra,arguments:d},n)),(0,ex.Tb)(n)}),n}};try{for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(sentryWrapped[l]=n[l])}catch(n){}(0,eM.$Q)(sentryWrapped,n),(0,eM.xp)(n,"__sentry_wrapped__",sentryWrapped);try{let l=Object.getOwnPropertyDescriptor(sentryWrapped,"name");l.configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>n.name})}catch(n){}return sentryWrapped}var e0=u(51982),e1=u(69038);let e2={},e3={};function addHandler(n,l){e2[n]=e2[n]||[],e2[n].push(l)}function maybeInstrument(n,l){e3[n]||(l(),e3[n]=!0)}function triggerHandlers(n,l){let u=n&&e2[n];if(u)for(let d of u)try{d(l)}catch(l){e0.X&&eN.kg.error(`Error while triggering instrumentation handler.
Type: ${n}
Name: ${(0,e1.$P)(d)}
Error:`,l)}}let e5=null;function addGlobalErrorInstrumentationHandler(n){let l="error";addHandler(l,n),maybeInstrument(l,instrumentError)}function instrumentError(){e5=eQ.GLOBAL_OBJ.onerror,eQ.GLOBAL_OBJ.onerror=function(n,l,u,d,h){return triggerHandlers("error",{column:d,error:h,line:u,msg:n,url:l}),!!e5&&!e5.__SENTRY_LOADER__&&e5.apply(this,arguments)},eQ.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let e4=null;function addGlobalUnhandledRejectionInstrumentationHandler(n){let l="unhandledrejection";addHandler(l,n),maybeInstrument(l,instrumentUnhandledRejection)}function instrumentUnhandledRejection(){e4=eQ.GLOBAL_OBJ.onunhandledrejection,eQ.GLOBAL_OBJ.onunhandledrejection=function(n){return triggerHandlers("unhandledrejection",n),!e4||!!e4.__SENTRY_LOADER__||e4.apply(this,arguments)},eQ.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var e9=u(54194);let e6="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;var e7=u(64017),e8=u(97946);function eventbuilder_exceptionFromError(n,l){let u=eventbuilder_parseStackFrames(n,l),d={type:l&&l.name,value:function(n){let l=n&&n.message;return l?l.error&&"string"==typeof l.error.message?l.error.message:l:"No error message"}(l)};return u.length&&(d.stacktrace={frames:u}),void 0===d.type&&""===d.value&&(d.value="Unrecoverable error caught"),d}function eventFromError(n,l){return{exception:{values:[eventbuilder_exceptionFromError(n,l)]}}}function eventbuilder_parseStackFrames(n,l){let u=l.stacktrace||l.stack||"",d=function(n){if(n){if("number"==typeof n.framesToPop)return n.framesToPop;if(te.test(n.message))return 1}return 0}(l);try{return n(u,d)}catch(n){}return[]}let te=/Minified React error #\d+;/i;function eventbuilder_eventFromUnknownInput(n,l,u,d,h){let f;if((0,eK.VW)(l)&&l.error)return eventFromError(n,l.error);if((0,eK.TX)(l)||(0,eK.fm)(l)){if("stack"in l)f=eventFromError(n,l);else{let h=l.name||((0,eK.TX)(l)?"DOMError":"DOMException"),m=l.message?`${h}: ${l.message}`:h;f=eventFromString(n,m,u,d),(0,eD.Db)(f,m)}return"code"in l&&(f.tags={...f.tags,"DOMException.code":`${l.code}`}),f}return(0,eK.VZ)(l)?eventFromError(n,l):((0,eK.PO)(l)||(0,eK.cO)(l)?f=function(n,l,u,d){let h=(0,ex.s3)(),f=h&&h.getOptions().normalizeDepth,m={exception:{values:[{type:(0,eK.cO)(l)?l.constructor.name:d?"UnhandledRejection":"Error",value:function(n,{isUnhandledRejection:l}){let u=(0,eM.zf)(n),d=l?"promise rejection":"exception";if((0,eK.VW)(n))return`Event \`ErrorEvent\` captured as ${d} with message \`${n.message}\``;if((0,eK.cO)(n)){let l=function(n){try{let l=Object.getPrototypeOf(n);return l?l.constructor.name:void 0}catch(n){}}(n);return`Event \`${l}\` (type=${n.type}) captured as ${d}`}return`Object captured as ${d} with keys: ${u}`}(l,{isUnhandledRejection:d})}]},extra:{__serialized__:(0,e7.Qy)(l,f)}};if(u){let l=eventbuilder_parseStackFrames(n,u);l.length&&(m.exception.values[0].stacktrace={frames:l})}return m}(n,l,u,h):(f=eventFromString(n,l,u,d),(0,eD.Db)(f,`${l}`,void 0)),(0,eD.EG)(f,{synthetic:!0}),f)}function eventFromString(n,l,u,d){let h={};if(d&&u){let d=eventbuilder_parseStackFrames(n,u);d.length&&(h.exception={values:[{value:l,stacktrace:{frames:d}}]})}if((0,eK.Le)(l)){let{__sentry_template_string__:n,__sentry_template_values__:u}=l;return h.logentry={message:n,params:u},h}return h.message=l,h}let tt="GlobalHandlers",globalHandlersIntegration=(n={})=>{let l={onerror:!0,onunhandledrejection:!0,...n};return{name:tt,setupOnce(){Error.stackTraceLimit=50},setup(n){l.onerror&&(addGlobalErrorInstrumentationHandler(l=>{let{stackParser:u,attachStacktrace:d}=getOptions();if((0,ex.s3)()!==n||eZ>0)return;let{msg:h,url:f,line:m,column:g,error:_}=l,j=void 0===_&&(0,eK.HD)(h)?function(n,l,u,d){let h=(0,eK.VW)(n)?n.message:n,f="Error",m=h.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);m&&(f=m[1],h=m[2]);let g={exception:{values:[{type:f,value:h}]}};return _enhanceEventWithInitialFrame(g,l,u,d)}(h,f,m,g):_enhanceEventWithInitialFrame(eventbuilder_eventFromUnknownInput(u,_||h,void 0,d,!1),f,m,g);j.level="error",(0,ex.eN)(j,{originalException:_,mechanism:{handled:!1,type:"onerror"}})}),globalHandlerLog("onerror")),l.onunhandledrejection&&(addGlobalUnhandledRejectionInstrumentationHandler(l=>{let{stackParser:u,attachStacktrace:d}=getOptions();if((0,ex.s3)()!==n||eZ>0)return;let h=function(n){if((0,eK.pt)(n))return n;try{if("reason"in n)return n.reason;if("detail"in n&&"reason"in n.detail)return n.detail.reason}catch(n){}return n}(l),f=(0,eK.pt)(h)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(h)}`}]}}:eventbuilder_eventFromUnknownInput(u,h,void 0,d,!0);f.level="error",(0,ex.eN)(f,{originalException:h,mechanism:{handled:!1,type:"onunhandledrejection"}})}),globalHandlerLog("onunhandledrejection"))}}},tn=convertIntegrationFnToClass(tt,globalHandlersIntegration);function _enhanceEventWithInitialFrame(n,l,u,d){let h=n.exception=n.exception||{},f=h.values=h.values||[],m=f[0]=f[0]||{},g=m.stacktrace=m.stacktrace||{},_=g.frames=g.frames||[],j=isNaN(parseInt(d,10))?void 0:d,$=isNaN(parseInt(u,10))?void 0:u,z=(0,eK.HD)(l)&&l.length>0?l:(0,e9.l4)();return 0===_.length&&_.push({colno:j,filename:z,function:"?",in_app:!0,lineno:$}),n}function globalHandlerLog(n){e6&&eN.kg.log(`Global Handler attached: ${n}`)}function getOptions(){let n=(0,ex.s3)(),l=n&&n.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return l}let to=["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"],ts="TryCatch",browserApiErrorsIntegration=(n={})=>{let l={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...n};return{name:ts,setupOnce(){l.setTimeout&&(0,eM.hl)(eJ,"setTimeout",_wrapTimeFunction),l.setInterval&&(0,eM.hl)(eJ,"setInterval",_wrapTimeFunction),l.requestAnimationFrame&&(0,eM.hl)(eJ,"requestAnimationFrame",_wrapRAF),l.XMLHttpRequest&&"XMLHttpRequest"in eJ&&(0,eM.hl)(XMLHttpRequest.prototype,"send",_wrapXHR);let n=l.eventTarget;if(n){let l=Array.isArray(n)?n:to;l.forEach(_wrapEventTarget)}}}},ta=convertIntegrationFnToClass(ts,browserApiErrorsIntegration);function _wrapTimeFunction(n){return function(...l){let u=l[0];return l[0]=wrap(u,{mechanism:{data:{function:(0,e1.$P)(n)},handled:!1,type:"instrument"}}),n.apply(this,l)}}function _wrapRAF(n){return function(l){return n.apply(this,[wrap(l,{mechanism:{data:{function:"requestAnimationFrame",handler:(0,e1.$P)(n)},handled:!1,type:"instrument"}})])}}function _wrapXHR(n){return function(...l){let u=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in u&&"function"==typeof u[n]&&(0,eM.hl)(u,n,function(l){let u={mechanism:{data:{function:n,handler:(0,e1.$P)(l)},handled:!1,type:"instrument"}},d=(0,eM.HK)(l);return d&&(u.mechanism.data.handler=(0,e1.$P)(d)),wrap(l,u)})}),n.apply(this,l)}}function _wrapEventTarget(n){let l=eJ[n]&&eJ[n].prototype;l&&l.hasOwnProperty&&l.hasOwnProperty("addEventListener")&&((0,eM.hl)(l,"addEventListener",function(l){return function(u,d,h){try{"function"==typeof d.handleEvent&&(d.handleEvent=wrap(d.handleEvent,{mechanism:{data:{function:"handleEvent",handler:(0,e1.$P)(d),target:n},handled:!1,type:"instrument"}}))}catch(n){}return l.apply(this,[u,wrap(d,{mechanism:{data:{function:"addEventListener",handler:(0,e1.$P)(d),target:n},handled:!1,type:"instrument"}}),h])}}),(0,eM.hl)(l,"removeEventListener",function(n){return function(l,u,d){try{let h=u&&u.__sentry_wrapped__;h&&n.call(this,l,h,d)}catch(n){}return n.call(this,l,u,d)}}))}function instrumentConsole(){"console"in eQ.GLOBAL_OBJ&&eN.RU.forEach(function(n){n in eQ.GLOBAL_OBJ.console&&(0,eM.hl)(eQ.GLOBAL_OBJ.console,n,function(l){return eN.LD[n]=l,function(...l){triggerHandlers("console",{args:l,level:n});let u=eN.LD[n];u&&u.apply(eQ.GLOBAL_OBJ.console,l)}})})}let tl=eQ.GLOBAL_OBJ;function addClickKeypressInstrumentationHandler(n){addHandler("dom",n),maybeInstrument("dom",instrumentDOM)}function instrumentDOM(){if(!tl.document)return;let n=triggerHandlers.bind(null,"dom"),l=makeDOMEventHandler(n,!0);tl.document.addEventListener("click",l,!1),tl.document.addEventListener("keypress",l,!1),["EventTarget","Node"].forEach(l=>{let u=tl[l]&&tl[l].prototype;u&&u.hasOwnProperty&&u.hasOwnProperty("addEventListener")&&((0,eM.hl)(u,"addEventListener",function(l){return function(u,d,h){if("click"===u||"keypress"==u)try{let d=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=d[u]=d[u]||{refCount:0};if(!f.handler){let d=makeDOMEventHandler(n);f.handler=d,l.call(this,u,d,h)}f.refCount++}catch(n){}return l.call(this,u,d,h)}}),(0,eM.hl)(u,"removeEventListener",function(n){return function(l,u,d){if("click"===l||"keypress"==l)try{let u=this.__sentry_instrumentation_handlers__||{},h=u[l];h&&(h.refCount--,h.refCount<=0&&(n.call(this,l,h.handler,d),h.handler=void 0,delete u[l]),0===Object.keys(u).length&&delete this.__sentry_instrumentation_handlers__)}catch(n){}return n.call(this,l,u,d)}}))})}function makeDOMEventHandler(n,l=!1){return u=>{if(!u||u._sentryCaptured)return;let d=function(n){try{return n.target}catch(n){return null}}(u);if("keypress"===u.type&&(!d||!d.tagName||"INPUT"!==d.tagName&&"TEXTAREA"!==d.tagName&&!d.isContentEditable))return;(0,eM.xp)(u,"_sentryCaptured",!0),d&&!d._sentryId&&(0,eM.xp)(d,"_sentryId",(0,eD.DM)());let g="keypress"===u.type?"input":u.type;!function(n){if(n.type!==f)return!1;try{if(!n.target||n.target._sentryId!==m)return!1}catch(n){}return!0}(u)&&(n({event:u,name:g,global:l}),f=u.type,m=d?d._sentryId:void 0),clearTimeout(h),h=tl.setTimeout(()=>{m=void 0,f=void 0},1e3)}}let tu=eQ.GLOBAL_OBJ,tc="__sentry_xhr_v3__";function addXhrInstrumentationHandler(n){addHandler("xhr",n),maybeInstrument("xhr",instrumentXHR)}function instrumentXHR(){if(!tu.XMLHttpRequest)return;let n=XMLHttpRequest.prototype;(0,eM.hl)(n,"open",function(n){return function(...l){let u=Date.now(),d=(0,eK.HD)(l[0])?l[0].toUpperCase():void 0,h=function(n){if((0,eK.HD)(n))return n;try{return n.toString()}catch(n){}}(l[1]);if(!d||!h)return n.apply(this,l);this[tc]={method:d,url:h,request_headers:{}},"POST"===d&&h.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let onreadystatechangeHandler=()=>{let n=this[tc];if(n&&4===this.readyState){try{n.status_code=this.status}catch(n){}let l={args:[d,h],endTimestamp:Date.now(),startTimestamp:u,xhr:this};triggerHandlers("xhr",l)}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?(0,eM.hl)(this,"onreadystatechange",function(n){return function(...l){return onreadystatechangeHandler(),n.apply(this,l)}}):this.addEventListener("readystatechange",onreadystatechangeHandler),(0,eM.hl)(this,"setRequestHeader",function(n){return function(...l){let[u,d]=l,h=this[tc];return h&&(0,eK.HD)(u)&&(0,eK.HD)(d)&&(h.request_headers[u.toLowerCase()]=d),n.apply(this,l)}}),n.apply(this,l)}}),(0,eM.hl)(n,"send",function(n){return function(...l){let u=this[tc];if(!u)return n.apply(this,l);void 0!==l[0]&&(u.body=l[0]);let d={args:[u.method,u.url],startTimestamp:Date.now(),xhr:this};return triggerHandlers("xhr",d),n.apply(this,l)}})}let td=(0,eQ.R)();function supportsFetch(){if(!("fetch"in td))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(n){return!1}}function isNativeFetch(n){return n&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(n.toString())}function addFetchInstrumentationHandler(n){let l="fetch";addHandler(l,n),maybeInstrument(l,instrumentFetch)}function instrumentFetch(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!supportsFetch())return!1;if(isNativeFetch(td.fetch))return!0;let n=!1,l=td.document;if(l&&"function"==typeof l.createElement)try{let u=l.createElement("iframe");u.hidden=!0,l.head.appendChild(u),u.contentWindow&&u.contentWindow.fetch&&(n=isNativeFetch(u.contentWindow.fetch)),l.head.removeChild(u)}catch(n){e0.X&&eN.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return n})()&&(0,eM.hl)(eQ.GLOBAL_OBJ,"fetch",function(n){return function(...l){let{method:u,url:d}=function(n){if(0===n.length)return{method:"GET",url:""};if(2===n.length){let[l,u]=n;return{url:getUrlFromResource(l),method:hasProp(u,"method")?String(u.method).toUpperCase():"GET"}}let l=n[0];return{url:getUrlFromResource(l),method:hasProp(l,"method")?String(l.method).toUpperCase():"GET"}}(l),h={args:l,fetchData:{method:u,url:d},startTimestamp:Date.now()};return triggerHandlers("fetch",{...h}),n.apply(eQ.GLOBAL_OBJ,l).then(n=>{let l={...h,endTimestamp:Date.now(),response:n};return triggerHandlers("fetch",l),n},n=>{let l={...h,endTimestamp:Date.now(),error:n};throw triggerHandlers("fetch",l),n})}})}function hasProp(n,l){return!!n&&"object"==typeof n&&!!n[l]}function getUrlFromResource(n){return"string"==typeof n?n:n?hasProp(n,"url")?n.url:n.toString?n.toString():"":""}let th=(0,eQ.R)(),tp=eQ.GLOBAL_OBJ;function addHistoryInstrumentationHandler(n){let l="history";addHandler(l,n),maybeInstrument(l,instrumentHistory)}function instrumentHistory(){if(!function(){let n=th.chrome,l=n&&n.app&&n.app.runtime,u="history"in th&&!!th.history.pushState&&!!th.history.replaceState;return!l&&u}())return;let n=tp.onpopstate;function historyReplacementFunction(n){return function(...l){let u=l.length>2?l[2]:void 0;if(u){let n=g,l=String(u);g=l,triggerHandlers("history",{from:n,to:l})}return n.apply(this,l)}}tp.onpopstate=function(...l){let u=tp.location.href,d=g;if(g=u,triggerHandlers("history",{from:d,to:u}),n)try{return n.apply(this,l)}catch(n){}},(0,eM.hl)(tp.history,"pushState",historyReplacementFunction),(0,eM.hl)(tp.history,"replaceState",historyReplacementFunction)}let tf=["fatal","error","warning","log","info","debug"];function url_parseUrl(n){if(!n)return{};let l=n.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!l)return{};let u=l[6]||"",d=l[8]||"";return{host:l[4],path:l[5],protocol:l[2],search:u,hash:d,relative:l[5]+u+d}}let tm="Breadcrumbs",breadcrumbsIntegration=(n={})=>{let l={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...n};return{name:tm,setupOnce(){},setup(n){var u;l.console&&function(n){let l="console";addHandler(l,n),maybeInstrument(l,instrumentConsole)}(function(l){var u;if((0,ex.s3)()!==n)return;let d={category:"console",data:{arguments:l.args,logger:"console"},level:"warn"===(u=l.level)?"warning":tf.includes(u)?u:"log",message:(0,eH.nK)(l.args," ")};if("assert"===l.level){if(!1!==l.args[0])return;d.message=`Assertion failed: ${(0,eH.nK)(l.args.slice(1)," ")||"console.assert"}`,d.data.arguments=l.args.slice(1)}(0,ex.n_)(d,{input:l.args,level:l.level})}),l.dom&&addClickKeypressInstrumentationHandler((u=l.dom,function(l){let d,h;if((0,ex.s3)()!==n)return;let f="object"==typeof u?u.serializeAttribute:void 0,m="object"==typeof u&&"number"==typeof u.maxStringLength?u.maxStringLength:void 0;m&&m>1024&&(e6&&eN.kg.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${m} was configured. Sentry will use 1024 instead.`),m=1024),"string"==typeof f&&(f=[f]);try{let n=l.event,u=n&&n.target?n.target:n;d=(0,e9.Rt)(u,{keyAttrs:f,maxStringLength:m}),h=(0,e9.iY)(u)}catch(n){d="<unknown>"}if(0===d.length)return;let g={category:`ui.${l.name}`,message:d};h&&(g.data={"ui.component_name":h}),(0,ex.n_)(g,{event:l.event,name:l.name,global:l.global})})),l.xhr&&addXhrInstrumentationHandler(function(l){if((0,ex.s3)()!==n)return;let{startTimestamp:u,endTimestamp:d}=l,h=l.xhr[tc];if(!u||!d||!h)return;let{method:f,url:m,status_code:g,body:_}=h,j={xhr:l.xhr,input:_,startTimestamp:u,endTimestamp:d};(0,ex.n_)({category:"xhr",data:{method:f,url:m,status_code:g},type:"http"},j)}),l.fetch&&addFetchInstrumentationHandler(function(l){if((0,ex.s3)()!==n)return;let{startTimestamp:u,endTimestamp:d}=l;if(!(!d||l.fetchData.url.match(/sentry_key/)&&"POST"===l.fetchData.method)){if(l.error){let n=l.fetchData,h={data:l.error,input:l.args,startTimestamp:u,endTimestamp:d};(0,ex.n_)({category:"fetch",data:n,level:"error",type:"http"},h)}else{let n=l.response,h={...l.fetchData,status_code:n&&n.status},f={input:l.args,response:n,startTimestamp:u,endTimestamp:d};(0,ex.n_)({category:"fetch",data:h,type:"http"},f)}}}),l.history&&addHistoryInstrumentationHandler(function(l){if((0,ex.s3)()!==n)return;let u=l.from,d=l.to,h=url_parseUrl(eJ.location.href),f=u?url_parseUrl(u):void 0,m=url_parseUrl(d);f&&f.path||(f=h),h.protocol===m.protocol&&h.host===m.host&&(d=m.relative),h.protocol===f.protocol&&h.host===f.host&&(u=f.relative),(0,ex.n_)({category:"navigation",data:{from:u,to:d}})}),l.sentry&&n.on&&n.on("beforeSendEvent",function(l){(0,ex.s3)()===n&&(0,ex.n_)({category:`sentry.${"transaction"===l.type?"transaction":"event"}`,event_id:l.event_id,level:l.level,message:(0,eD.jH)(l)},{event:l})})}}},tg=convertIntegrationFnToClass(tm,breadcrumbsIntegration),t_="LinkedErrors",integrations_linkederrors_linkedErrorsIntegration=(n={})=>{let l=n.limit||5,u=n.key||"cause";return{name:t_,setupOnce(){},preprocessEvent(n,d,h){let f=h.getOptions();applyAggregateErrorsToEvent(eventbuilder_exceptionFromError,f.stackParser,f.maxValueLength,u,l,n,d)}}},ty=convertIntegrationFnToClass(t_,integrations_linkederrors_linkedErrorsIntegration),tv="HttpContext",httpContextIntegration=()=>({name:tv,setupOnce(){},preprocessEvent(n){if(!eJ.navigator&&!eJ.location&&!eJ.document)return;let l=n.request&&n.request.url||eJ.location&&eJ.location.href,{referrer:u}=eJ.document||{},{userAgent:d}=eJ.navigator||{},h={...n.request&&n.request.headers,...u&&{Referer:u},...d&&{"User-Agent":d}},f={...n.request,...l&&{url:l},headers:h};n.request=f}}),tb=convertIntegrationFnToClass(tv,httpContextIntegration),tE="Dedupe",dedupeIntegration=()=>{let n;return{name:tE,setupOnce(){},processEvent(l){if(l.type)return l;try{var u;if((u=n)&&(function(n,l){let u=n.message,d=l.message;return!!((u||d)&&(!u||d)&&(u||!d)&&u===d&&_isSameFingerprint(n,l)&&_isSameStacktrace(n,l))}(l,u)||function(n,l){let u=_getExceptionFromEvent(l),d=_getExceptionFromEvent(n);return!!(u&&d&&u.type===d.type&&u.value===d.value&&_isSameFingerprint(n,l)&&_isSameStacktrace(n,l))}(l,u)))return e6&&eN.kg.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(n){}return n=l}}},tS=convertIntegrationFnToClass(tE,dedupeIntegration);function _isSameStacktrace(n,l){let u=_getFramesFromEvent(n),d=_getFramesFromEvent(l);if(!u&&!d)return!0;if(u&&!d||!u&&d||d.length!==u.length)return!1;for(let n=0;n<d.length;n++){let l=d[n],h=u[n];if(l.filename!==h.filename||l.lineno!==h.lineno||l.colno!==h.colno||l.function!==h.function)return!1}return!0}function _isSameFingerprint(n,l){let u=n.fingerprint,d=l.fingerprint;if(!u&&!d)return!0;if(u&&!d||!u&&d)return!1;try{return!(u.join("")!==d.join(""))}catch(n){return!1}}function _getExceptionFromEvent(n){return n.exception&&n.exception.values&&n.exception.values[0]}function _getFramesFromEvent(n){let l=n.exception;if(l)try{return l.values[0].stacktrace.frames}catch(n){}}let tw={};eJ.Sentry&&eJ.Sentry.Integrations&&(tw=eJ.Sentry.Integrations);let tT={...tw,...eO,...eC},tI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function dsn_dsnToString(n,l=!1){let{host:u,path:d,pass:h,port:f,projectId:m,protocol:g,publicKey:_}=n;return`${g}://${_}${l&&h?`:${h}`:""}@${u}${f?`:${f}`:""}/${d?`${d}/`:d}${m}`}function dsnFromString(n){let l=tI.exec(n);if(!l){(0,eN.Cf)(()=>{console.error(`Invalid Sentry Dsn: ${n}`)});return}let[u,d,h="",f,m="",g]=l.slice(1),_="",j=g,$=j.split("/");if($.length>1&&(_=$.slice(0,-1).join("/"),j=$.pop()),j){let n=j.match(/^\d+/);n&&(j=n[0])}return dsnFromComponents({host:f,pass:h,path:_,projectId:j,port:m,protocol:u,publicKey:d})}function dsnFromComponents(n){return{protocol:n.protocol,publicKey:n.publicKey||"",pass:n.pass||"",host:n.host,port:n.port||"",path:n.path||"",projectId:n.projectId}}function createEnvelope(n,l=[]){return[n,l]}function forEachEnvelopeItem(n,l){let u=n[1];for(let n of u){let u=n[0].type,d=l(n,u);if(d)return!0}return!1}function encodeUTF8(n,l){let u=l||new TextEncoder;return u.encode(n)}let tR={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:"metric_bucket"};function getSdkMetadataForEnvelopeHeader(n){if(!n||!n.sdk)return;let{name:l,version:u}=n.sdk;return{name:l,version:u}}function createEventEnvelopeHeaders(n,l,u,d){let h=n.sdkProcessingMetadata&&n.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:n.event_id,sent_at:new Date().toISOString(),...l&&{sdk:l},...!!u&&d&&{dsn:dsn_dsnToString(d)},...h&&{trace:(0,eM.Jr)({...h})}}}let SentryError=class SentryError extends Error{constructor(n,l="warn"){super(n),this.message=n,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=l}};var tP=u(48364),tA=u(92980),tO=u(48738);let tC="Not capturing exception because it's already been captured.";let BaseClient=class BaseClient{constructor(n){if(this._options=n,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],n.dsn?this._dsn=function(n){let l="string"==typeof n?dsnFromString(n):dsnFromComponents(n);if(l&&function(n){if(!e0.X)return!0;let{port:l,projectId:u,protocol:d}=n,h=["protocol","publicKey","host","projectId"].find(l=>!n[l]&&(eN.kg.error(`Invalid Sentry Dsn: ${l} missing`),!0));return!h&&(u.match(/^\d+$/)?"http"===d||"https"===d?!(l&&isNaN(parseInt(l,10)))||(eN.kg.error(`Invalid Sentry Dsn: Invalid port ${l}`),!1):(eN.kg.error(`Invalid Sentry Dsn: Invalid protocol ${d}`),!1):(eN.kg.error(`Invalid Sentry Dsn: Invalid projectId ${u}`),!1))}(l))return l}(n.dsn):eV.X&&eN.kg.warn("No DSN provided, client will not send events."),this._dsn){let l=function(n,l={}){let u="string"==typeof l?l:l.tunnel,d="string"!=typeof l&&l._metadata?l._metadata.sdk:void 0;return u||`${function(n){let l=n.protocol?`${n.protocol}:`:"",u=n.port?`:${n.port}`:"";return`${l}//${n.host}${u}${n.path?`/${n.path}`:""}/api/`}(n)}${n.projectId}/envelope/?${(0,eM._j)({sentry_key:n.publicKey,sentry_version:"7",...d&&{sentry_client:`${d.name}/${d.version}`}})}`}(this._dsn,n);this._transport=n.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...n.transportOptions,url:l})}}captureException(n,l,u){if((0,eD.YO)(n)){eV.X&&eN.kg.log(tC);return}let d=l&&l.event_id;return this._process(this.eventFromException(n,l).then(n=>this._captureEvent(n,l,u)).then(n=>{d=n})),d}captureMessage(n,l,u,d){let h=u&&u.event_id,f=(0,eK.Le)(n)?n:String(n),m=(0,eK.pt)(n)?this.eventFromMessage(f,l,u):this.eventFromException(n,u);return this._process(m.then(n=>this._captureEvent(n,u,d)).then(n=>{h=n})),h}captureEvent(n,l,u){if(l&&l.originalException&&(0,eD.YO)(l.originalException)){eV.X&&eN.kg.log(tC);return}let d=l&&l.event_id,h=n.sdkProcessingMetadata||{},f=h.capturedSpanScope;return this._process(this._captureEvent(n,l,f||u).then(n=>{d=n})),d}captureSession(n){"string"!=typeof n.release?eV.X&&eN.kg.warn("Discarded session because of missing or non-string release"):(this.sendSession(n),(0,tP.CT)(n,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(n){let l=this._transport;return l?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(n).then(u=>l.flush(n).then(n=>u&&n))):(0,e8.WD)(!0)}close(n){return this.flush(n).then(n=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(n){this._eventProcessors.push(n)}setupIntegrations(n){(n&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(n){return this.getIntegrationByName(n)}getIntegrationByName(n){return this._integrations[n]}getIntegration(n){try{return this._integrations[n.id]||null}catch(l){return eV.X&&eN.kg.warn(`Cannot retrieve integration ${n.id} from the current Client`),null}}addIntegration(n){let l=this._integrations[n.name];setupIntegration(this,n,this._integrations),l||afterSetupIntegrations(this,[n])}sendEvent(n,l={}){this.emit("beforeSendEvent",n,l);let u=function(n,l,u,d){var h;let f=getSdkMetadataForEnvelopeHeader(u),m=n.type&&"replay_event"!==n.type?n.type:"event";(h=u&&u.sdk)&&(n.sdk=n.sdk||{},n.sdk.name=n.sdk.name||h.name,n.sdk.version=n.sdk.version||h.version,n.sdk.integrations=[...n.sdk.integrations||[],...h.integrations||[]],n.sdk.packages=[...n.sdk.packages||[],...h.packages||[]]);let g=createEventEnvelopeHeaders(n,f,d,l);delete n.sdkProcessingMetadata;let _=[{type:m},n];return createEnvelope(g,[_])}(n,this._dsn,this._options._metadata,this._options.tunnel);for(let n of l.attachments||[])u=function(n,l){let[u,d]=n;return[u,[...d,l]]}(u,function(n,l){let u="string"==typeof n.data?encodeUTF8(n.data,l):n.data;return[(0,eM.Jr)({type:"attachment",length:u.length,filename:n.filename,content_type:n.contentType,attachment_type:n.attachmentType}),u]}(n,this._options.transportOptions&&this._options.transportOptions.textEncoder));let d=this._sendEnvelope(u);d&&d.then(l=>this.emit("afterSendEvent",n,l),null)}sendSession(n){let l=function(n,l,u,d){let h=getSdkMetadataForEnvelopeHeader(u),f={sent_at:new Date().toISOString(),...h&&{sdk:h},...!!d&&l&&{dsn:dsn_dsnToString(l)}},m="aggregates"in n?[{type:"sessions"},n]:[{type:"session"},n.toJSON()];return createEnvelope(f,[m])}(n,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(l)}recordDroppedEvent(n,l,u){if(this._options.sendClientReports){let u=`${n}:${l}`;eV.X&&eN.kg.log(`Adding outcome: "${u}"`),this._outcomes[u]=this._outcomes[u]+1||1}}captureAggregateMetrics(n){eV.X&&eN.kg.log(`Flushing aggregated metrics, number of metrics: ${n.length}`);let l=function(n,l,u,d){let h={sent_at:new Date().toISOString()};u&&u.sdk&&(h.sdk={name:u.sdk.name,version:u.sdk.version}),d&&l&&(h.dsn=dsn_dsnToString(l));let f=function(n){let l=function(n){let l="";for(let u of n){let n=Object.entries(u.tags),d=n.length>0?`|#${n.map(([n,l])=>`${n}:${l}`).join(",")}`:"";l+=`${u.name}@${u.unit}:${u.metric}|${u.metricType}${d}|T${u.timestamp}
`}return l}(n),u={type:"statsd",length:l.length};return[u,l]}(n);return createEnvelope(h,[f])}(n,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(l)}on(n,l){this._hooks[n]||(this._hooks[n]=[]),this._hooks[n].push(l)}emit(n,...l){this._hooks[n]&&this._hooks[n].forEach(n=>n(...l))}_setupIntegrations(){let{integrations:n}=this._options;this._integrations=function(n,l){let u={};return l.forEach(l=>{l&&setupIntegration(n,l,u)}),u}(this,n),afterSetupIntegrations(this,n),this._integrationsInitialized=!0}_updateSessionFromEvent(n,l){let u=!1,d=!1,h=l.exception&&l.exception.values;if(h)for(let n of(d=!0,h)){let l=n.mechanism;if(l&&!1===l.handled){u=!0;break}}let f="ok"===n.status,m=f&&0===n.errors||f&&u;m&&((0,tP.CT)(n,{...u&&{status:"crashed"},errors:n.errors||Number(d||u)}),this.captureSession(n))}_isClientDoneProcessing(n){return new e8.cW(l=>{let u=0,d=setInterval(()=>{0==this._numProcessing?(clearInterval(d),l(!0)):(u+=1,n&&u>=n&&(clearInterval(d),l(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(n,l,u,d=(0,eL.aF)()){let h=this.getOptions(),f=Object.keys(this._integrations);return!l.integrations&&f.length>0&&(l.integrations=f),this.emit("preprocessEvent",n,l),(0,tO.R)(h,n,l,u,this,d).then(n=>{if(null===n)return n;let l={...d.getPropagationContext(),...u?u.getPropagationContext():void 0},h=n.contexts&&n.contexts.trace;if(!h&&l){let{traceId:d,spanId:h,parentSpanId:f,dsc:m}=l;n.contexts={trace:{trace_id:d,span_id:h,parent_span_id:f},...n.contexts};let g=m||(0,tA._)(d,this,u);n.sdkProcessingMetadata={dynamicSamplingContext:g,...n.sdkProcessingMetadata}}return n})}_captureEvent(n,l={},u){return this._processEvent(n,l,u).then(n=>n.event_id,n=>{eV.X&&("log"===n.logLevel?eN.kg.log(n.message):eN.kg.warn(n))})}_processEvent(n,l,u){let d=this.getOptions(),{sampleRate:h}=d,f=isTransactionEvent(n),m=isErrorEvent(n),g=n.type||"error",_=`before send for type \`${g}\``;if(m&&"number"==typeof h&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error",n),(0,e8.$2)(new SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${h})`,"log"));let j="replay_event"===g?"replay":g,$=n.sdkProcessingMetadata||{},z=$.capturedSpanIsolationScope;return this._prepareEvent(n,l,u,z).then(u=>{if(null===u)throw this.recordDroppedEvent("event_processor",j,n),new SentryError("An event processor returned `null`, will not send event.","log");let h=l.data&&!0===l.data.__sentry__;if(h)return u;let f=function(n,l,u){let{beforeSend:d,beforeSendTransaction:h}=n;return isErrorEvent(l)&&d?d(l,u):isTransactionEvent(l)&&h?h(l,u):l}(d,u,l);return function(n,l){let u=`${l} must return \`null\` or a valid event.`;if((0,eK.J8)(n))return n.then(n=>{if(!(0,eK.PO)(n)&&null!==n)throw new SentryError(u);return n},n=>{throw new SentryError(`${l} rejected with ${n}`)});if(!(0,eK.PO)(n)&&null!==n)throw new SentryError(u);return n}(f,_)}).then(d=>{if(null===d)throw this.recordDroppedEvent("before_send",j,n),new SentryError(`${_} returned \`null\`, will not send event.`,"log");let h=u&&u.getSession();!f&&h&&this._updateSessionFromEvent(h,d);let m=d.transaction_info;return f&&m&&d.transaction!==n.transaction&&(d.transaction_info={...m,source:"custom"}),this.sendEvent(d,l),d}).then(null,n=>{if(n instanceof SentryError)throw n;throw this.captureException(n,{data:{__sentry__:!0},originalException:n}),new SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${n}`)})}_process(n){this._numProcessing++,n.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(n){if(this.emit("beforeEnvelope",n),this._isEnabled()&&this._transport)return this._transport.send(n).then(null,n=>{eV.X&&eN.kg.error("Error while sending event:",n)});eV.X&&eN.kg.error("Transport disabled")}_clearOutcomes(){let n=this._outcomes;return this._outcomes={},Object.keys(n).map(l=>{let[u,d]=l.split(":");return{reason:u,category:d,quantity:n[l]}})}};function isErrorEvent(n){return void 0===n.type}function isTransactionEvent(n){return"transaction"===n.type}var tk=u(4285),tx=u(7790);let BrowserClient=class BrowserClient extends BaseClient{constructor(n){let l=eJ.SENTRY_SDK_SOURCE||(0,tk.S)();applySdkMetadata(n,"browser",["browser"],l),super(n),n.sendClientReports&&eJ.document&&eJ.document.addEventListener("visibilitychange",()=>{"hidden"===eJ.document.visibilityState&&this._flushOutcomes()})}eventFromException(n,l){return function(n,l,u,d){let h=u&&u.syntheticException||void 0,f=eventbuilder_eventFromUnknownInput(n,l,h,d);return(0,eD.EG)(f),f.level="error",u&&u.event_id&&(f.event_id=u.event_id),(0,e8.WD)(f)}(this._options.stackParser,n,l,this._options.attachStacktrace)}eventFromMessage(n,l="info",u){return function(n,l,u="info",d,h){let f=d&&d.syntheticException||void 0,m=eventFromString(n,l,f,h);return m.level=u,d&&d.event_id&&(m.event_id=d.event_id),(0,e8.WD)(m)}(this._options.stackParser,n,l,u,this._options.attachStacktrace)}captureUserFeedback(n){if(!this._isEnabled()){e6&&eN.kg.warn("SDK not enabled, will not capture user feedback.");return}let l=function(n,{metadata:l,tunnel:u,dsn:d}){let h={event_id:n.event_id,sent_at:new Date().toISOString(),...l&&l.sdk&&{sdk:{name:l.sdk.name,version:l.sdk.version}},...!!u&&!!d&&{dsn:dsn_dsnToString(d)}},f=[{type:"user_report"},n];return createEnvelope(h,[f])}(n,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(l)}_prepareEvent(n,l,u){return n.platform=n.platform||"javascript",super._prepareEvent(n,l,u)}_flushOutcomes(){let n=this._clearOutcomes();if(0===n.length){e6&&eN.kg.log("No outcomes to send");return}if(!this._dsn){e6&&eN.kg.log("No dsn provided, will not send outcomes");return}e6&&eN.kg.log("Sending outcomes:",n);let l=function(n,l,u){let d=[{type:"client_report"},{timestamp:(0,tx.yW)(),discarded_events:n}];return createEnvelope(l?{dsn:l}:{},[d])}(n,this._options.tunnel&&dsn_dsnToString(this._dsn));this._sendEnvelope(l)}};function createFrame(n,l,u,d){let h={filename:n,function:l,in_app:!0};return void 0!==u&&(h.lineno=u),void 0!==d&&(h.colno=d),h}let tM=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tD=/\((\S*)(?::(\d+))(?::(\d+))\)/,tN=[30,n=>{let l=tM.exec(n);if(l){let n=l[2]&&0===l[2].indexOf("eval");if(n){let n=tD.exec(l[2]);n&&(l[2]=n[1],l[3]=n[2],l[4]=n[3])}let[u,d]=extractSafariExtensionDetails(l[1]||"?",l[2]);return createFrame(d,u,l[3]?+l[3]:void 0,l[4]?+l[4]:void 0)}}],tV=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tL=[50,n=>{let l=tV.exec(n);if(l){let n=l[3]&&l[3].indexOf(" > eval")>-1;if(n){let n=tF.exec(l[3]);n&&(l[1]=l[1]||"eval",l[3]=n[1],l[4]=n[2],l[5]="")}let u=l[3],d=l[1]||"?";return[d,u]=extractSafariExtensionDetails(d,u),createFrame(u,d,l[4]?+l[4]:void 0,l[5]?+l[5]:void 0)}}],tj=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,tU=[40,n=>{let l=tj.exec(n);return l?createFrame(l[2],l[1]||"?",+l[3],l[4]?+l[4]:void 0):void 0}],tB=(0,e1.pE)(...[tN,tL,tU]),extractSafariExtensionDetails=(n,l)=>{let u=-1!==n.indexOf("safari-extension"),d=-1!==n.indexOf("safari-web-extension");return u||d?[-1!==n.indexOf("@")?n.split("@")[0]:"?",u?`safari-extension:${l}`:`safari-web-extension:${l}`]:[n,l]};function isRateLimited(n,l,u=Date.now()){return(n[l]||n.all||0)>u}function updateRateLimits(n,{statusCode:l,headers:u},d=Date.now()){let h={...n},f=u&&u["x-sentry-rate-limits"],m=u&&u["retry-after"];if(f)for(let n of f.trim().split(",")){let[l,u,,,f]=n.split(":",5),m=parseInt(l,10),g=(isNaN(m)?60:m)*1e3;if(u)for(let n of u.split(";"))"metric_bucket"===n?(!f||f.split(";").includes("custom"))&&(h[n]=d+g):h[n]=d+g;else h.all=d+g}else m?h.all=d+function(n,l=Date.now()){let u=parseInt(`${n}`,10);if(!isNaN(u))return 1e3*u;let d=Date.parse(`${n}`);return isNaN(d)?6e4:d-l}(m,d):429===l&&(h.all=d+6e4);return h}function createTransport(n,l,u=function(n){let l=[];function remove(n){return l.splice(l.indexOf(n),1)[0]}return{$:l,add:function(u){if(!(void 0===n||l.length<n))return(0,e8.$2)(new SentryError("Not adding Promise because buffer limit was reached."));let d=u();return -1===l.indexOf(d)&&l.push(d),d.then(()=>remove(d)).then(null,()=>remove(d).then(null,()=>{})),d},drain:function(n){return new e8.cW((u,d)=>{let h=l.length;if(!h)return u(!0);let f=setTimeout(()=>{n&&n>0&&u(!1)},n);l.forEach(n=>{(0,e8.WD)(n).then(()=>{--h||(clearTimeout(f),u(!0))},d)})})}}}(n.bufferSize||30)){let d={};function send(h){let f=[];if(forEachEnvelopeItem(h,(l,u)=>{let h=tR[u];if(isRateLimited(d,h)){let d=getEventForEnvelopeItem(l,u);n.recordDroppedEvent("ratelimit_backoff",h,d)}else f.push(l)}),0===f.length)return(0,e8.WD)();let m=createEnvelope(h[0],f),recordEnvelopeLoss=l=>{forEachEnvelopeItem(m,(u,d)=>{let h=getEventForEnvelopeItem(u,d);n.recordDroppedEvent(l,tR[d],h)})};return u.add(()=>l({body:function(n,l){let[u,d]=n,h=JSON.stringify(u);function append(n){"string"==typeof h?h="string"==typeof n?h+n:[encodeUTF8(h,l),n]:h.push("string"==typeof n?encodeUTF8(n,l):n)}for(let n of d){let[l,u]=n;if(append(`
${JSON.stringify(l)}
`),"string"==typeof u||u instanceof Uint8Array)append(u);else{let n;try{n=JSON.stringify(u)}catch(l){n=JSON.stringify((0,e7.Fv)(u))}append(n)}}return"string"==typeof h?h:function(n){let l=n.reduce((n,l)=>n+l.length,0),u=new Uint8Array(l),d=0;for(let l of n)u.set(l,d),d+=l.length;return u}(h)}(m,n.textEncoder)}).then(n=>(void 0!==n.statusCode&&(n.statusCode<200||n.statusCode>=300)&&eV.X&&eN.kg.warn(`Sentry responded with status code ${n.statusCode} to sent event.`),d=updateRateLimits(d,n),n),n=>{throw recordEnvelopeLoss("network_error"),n})).then(n=>n,n=>{if(n instanceof SentryError)return eV.X&&eN.kg.error("Skipped sending event because buffer is full."),recordEnvelopeLoss("queue_overflow"),(0,e8.WD)();throw n})}return send.__sentry__baseTransport__=!0,{send,flush:n=>u.drain(n)}}function getEventForEnvelopeItem(n,l){if("event"===l||"transaction"===l)return Array.isArray(n)?n[1]:void 0}function makeFetchTransport(n,l=function(){if(em)return em;if(isNativeFetch(eJ.fetch))return em=eJ.fetch.bind(eJ);let n=eJ.document,l=eJ.fetch;if(n&&"function"==typeof n.createElement)try{let u=n.createElement("iframe");u.hidden=!0,n.head.appendChild(u);let d=u.contentWindow;d&&d.fetch&&(l=d.fetch),n.head.removeChild(u)}catch(n){e6&&eN.kg.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return em=l.bind(eJ)}()){let u=0,d=0;return createTransport(n,function(h){let f=h.body.length;u+=f,d++;let m={body:h.body,method:"POST",referrerPolicy:"origin",headers:n.headers,keepalive:u<=6e4&&d<15,...n.fetchOptions};try{return l(n.url,m).then(n=>(u-=f,d--,{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}))}catch(n){return em=void 0,u-=f,d--,(0,e8.$2)(n)}})}function makeXHRTransport(n){return createTransport(n,function(l){return new e8.cW((u,d)=>{let h=new XMLHttpRequest;for(let l in h.onerror=d,h.onreadystatechange=()=>{4===h.readyState&&u({statusCode:h.status,headers:{"x-sentry-rate-limits":h.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":h.getResponseHeader("Retry-After")}})},h.open("POST",n.url),n.headers)Object.prototype.hasOwnProperty.call(n.headers,l)&&h.setRequestHeader(l,n.headers[l]);h.send(l.body)})})}let t$=[inboundFiltersIntegration(),functionToStringIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),integrations_linkederrors_linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration()];var tH=u(34406),tW=u(43002);function getMetricSummaryJsonForSpan(n){let l=_?_.get(n):void 0;if(!l)return;let u={};for(let[,[n,d]]of l)u[n]||(u[n]=[]),u[n].push((0,eM.Jr)(d));return u}let tq="sentry.source",tz="sentry.sample_rate",tG="sentry.op",tK="sentry.origin";var tX=u(85112);function setHttpStatus(n,l){n.setTag("http.status_code",String(l)),n.setData("http.response.status_code",l);let u=function(n){if(n<400&&n>=100)return"ok";if(n>=400&&n<500)switch(n){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(n>=500&&n<600)switch(n){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}(l);"unknown_error"!==u&&n.setStatus(u)}(ey=eR||(eR={})).Ok="ok",ey.DeadlineExceeded="deadline_exceeded",ey.Unauthenticated="unauthenticated",ey.PermissionDenied="permission_denied",ey.NotFound="not_found",ey.ResourceExhausted="resource_exhausted",ey.InvalidArgument="invalid_argument",ey.Unimplemented="unimplemented",ey.Unavailable="unavailable",ey.InternalError="internal_error",ey.UnknownError="unknown_error",ey.Cancelled="cancelled",ey.AlreadyExists="already_exists",ey.FailedPrecondition="failed_precondition",ey.Aborted="aborted",ey.OutOfRange="out_of_range",ey.DataLoss="data_loss";let SpanRecorder=class SpanRecorder{constructor(n=1e3){this._maxlen=n,this.spans=[]}add(n){this.spans.length>this._maxlen?n.spanRecorder=void 0:this.spans.push(n)}};let Span=class Span{constructor(n={}){this._traceId=n.traceId||(0,eD.DM)(),this._spanId=n.spanId||(0,eD.DM)().substring(16),this._startTime=n.startTimestamp||(0,tx.ph)(),this.tags=n.tags?{...n.tags}:{},this.data=n.data?{...n.data}:{},this.instrumenter=n.instrumenter||"sentry",this._attributes={},this.setAttributes({[tK]:n.origin||"manual",[tG]:n.op,...n.attributes}),this._name=n.name||n.description,n.parentSpanId&&(this._parentSpanId=n.parentSpanId),"sampled"in n&&(this._sampled=n.sampled),n.status&&(this._status=n.status),n.endTimestamp&&(this._endTime=n.endTimestamp),void 0!==n.exclusiveTime&&(this._exclusiveTime=n.exclusiveTime),this._measurements=n.measurements?{...n.measurements}:{}}get name(){return this._name||""}set name(n){this.updateName(n)}get description(){return this._name}set description(n){this._name=n}get traceId(){return this._traceId}set traceId(n){this._traceId=n}get spanId(){return this._spanId}set spanId(n){this._spanId=n}set parentSpanId(n){this._parentSpanId=n}get parentSpanId(){return this._parentSpanId}get sampled(){return this._sampled}set sampled(n){this._sampled=n}get attributes(){return this._attributes}set attributes(n){this._attributes=n}get startTimestamp(){return this._startTime}set startTimestamp(n){this._startTime=n}get endTimestamp(){return this._endTime}set endTimestamp(n){this._endTime=n}get status(){return this._status}set status(n){this._status=n}get op(){return this._attributes[tG]}set op(n){this.setAttribute(tG,n)}get origin(){return this._attributes[tK]}set origin(n){this.setAttribute(tK,n)}spanContext(){let{_spanId:n,_traceId:l,_sampled:u}=this;return{spanId:n,traceId:l,traceFlags:u?tW.i0:tW.ve}}startChild(n){let l=new Span({...n,parentSpanId:this._spanId,sampled:this._sampled,traceId:this._traceId});l.spanRecorder=this.spanRecorder,l.spanRecorder&&l.spanRecorder.add(l);let u=(0,tX.G)(this);if(l.transaction=u,eV.X&&u){let d=n&&n.op||"< unknown op >",h=(0,tW.XU)(l).description||"< unknown name >",f=u.spanContext().spanId,m=`[Tracing] Starting '${d}' span on transaction '${h}' (${f}).`;eN.kg.log(m),this._logMessage=m}return l}setTag(n,l){return this.tags={...this.tags,[n]:l},this}setData(n,l){return this.data={...this.data,[n]:l},this}setAttribute(n,l){void 0===l?delete this._attributes[n]:this._attributes[n]=l}setAttributes(n){Object.keys(n).forEach(l=>this.setAttribute(l,n[l]))}setStatus(n){return this._status=n,this}setHttpStatus(n){return setHttpStatus(this,n),this}setName(n){this.updateName(n)}updateName(n){return this._name=n,this}isSuccess(){return"ok"===this._status}finish(n){return this.end(n)}end(n){if(this._endTime)return;let l=(0,tX.G)(this);if(eV.X&&l&&l.spanContext().spanId!==this._spanId){let n=this._logMessage;n&&eN.kg.log(n.replace("Starting","Finishing"))}this._endTime=(0,tW.$k)(n)}toTraceparent(){return(0,tW.Hb)(this)}toContext(){return(0,eM.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(n){return this.data=n.data||{},this._name=n.name||n.description,this._endTime=n.endTimestamp,this.op=n.op,this._parentSpanId=n.parentSpanId,this._sampled=n.sampled,this._spanId=n.spanId||this._spanId,this._startTime=n.startTimestamp||this._startTime,this._status=n.status,this.tags=n.tags||{},this._traceId=n.traceId||this._traceId,this}getTraceContext(){return(0,tW.wy)(this)}getSpanJSON(){return(0,eM.Jr)({data:this._getData(),description:this._name,op:this._attributes[tG],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[tK],_metrics_summary:getMetricSummaryJsonForSpan(this),profile_id:this._attributes.profile_id,exclusive_time:this._exclusiveTime,measurements:Object.keys(this._measurements).length>0?this._measurements:void 0})}isRecording(){return!this._endTime&&!!this._sampled}toJSON(){return this.getSpanJSON()}_getData(){let{data:n,_attributes:l}=this,u=Object.keys(n).length>0,d=Object.keys(l).length>0;return u||d?u&&d?{...n,...l}:u?n:l:void 0}};function startInactiveSpan(n){if(!hasTracingEnabled())return;let l=function(n){if(n.startTime){let l={...n};return l.startTimestamp=(0,tW.$k)(n.startTime),delete l.startTime,l}return n}(n),u=(0,eL.Gd)(),d=n.scope?n.scope.getSpan():trace_getActiveSpan(),h=n.onlyIfParent&&!d;if(h)return;let f=n.scope||(0,ex.nZ)(),m=f.clone();return function(n,{parentSpan:l,spanContext:u,forceTransaction:d,scope:h}){var f;let m;if(!hasTracingEnabled())return;let g=(0,eL.aF)();if(l&&!d)m=l.startChild(u);else if(l){let d=(0,tA.j)(l),{traceId:h,spanId:f}=l.spanContext(),g=(0,tW.Tt)(l);m=n.startTransaction({traceId:h,parentSpanId:f,parentSampled:g,...u,metadata:{dynamicSamplingContext:d,...u.metadata}})}else{let{traceId:l,dsc:d,parentSpanId:f,sampled:_}={...g.getPropagationContext(),...h.getPropagationContext()};m=n.startTransaction({traceId:l,parentSpanId:f,parentSampled:_,...u,metadata:{dynamicSamplingContext:d,...u.metadata}})}return h.setSpan(m),(f=m)&&((0,eM.xp)(f,tQ,g),(0,eM.xp)(f,tY,h)),m}(u,{parentSpan:d,spanContext:l,forceTransaction:n.forceTransaction,scope:m})}function trace_getActiveSpan(){return(0,ex.nZ)().getSpan()}let tY="_sentryScope",tQ="_sentryIsolationScope";let Transaction=class Transaction extends Span{constructor(n,l){super(n),this._contexts={},this._hub=l||(0,eL.Gd)(),this._name=n.name||"",this._metadata={...n.metadata},this._trimEnd=n.trimEnd,this.transaction=this;let u=this._metadata.dynamicSamplingContext;u&&(this._frozenDynamicSamplingContext={...u})}get name(){return this._name}set name(n){this.setName(n)}get metadata(){return{source:"custom",spanMetadata:{},...this._metadata,...this._attributes[tq]&&{source:this._attributes[tq]},...this._attributes[tz]&&{sampleRate:this._attributes[tz]}}}set metadata(n){this._metadata=n}setName(n,l="custom"){this._name=n,this.setAttribute(tq,l)}updateName(n){return this._name=n,this}initSpanRecorder(n=1e3){this.spanRecorder||(this.spanRecorder=new SpanRecorder(n)),this.spanRecorder.add(this)}setContext(n,l){null===l?delete this._contexts[n]:this._contexts[n]=l}setMeasurement(n,l,u=""){this._measurements[n]={value:l,unit:u}}setMetadata(n){this._metadata={...this._metadata,...n}}end(n){let l=(0,tW.$k)(n),u=this._finishTransaction(l);if(u)return this._hub.captureEvent(u)}toContext(){let n=super.toContext();return(0,eM.Jr)({...n,name:this._name,trimEnd:this._trimEnd})}updateWithContext(n){return super.updateWithContext(n),this._name=n.name||"",this._trimEnd=n.trimEnd,this}getDynamicSamplingContext(){return(0,tA.j)(this)}setHub(n){this._hub=n}getProfileId(){if(void 0!==this._contexts&&void 0!==this._contexts.profile)return this._contexts.profile.profile_id}_finishTransaction(n){if(void 0!==this._endTime)return;this._name||(eV.X&&eN.kg.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>"),super.end(n);let l=this._hub.getClient();if(l&&l.emit&&l.emit("finishTransaction",this),!0!==this._sampled){eV.X&&eN.kg.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),l&&l.recordDroppedEvent("sample_rate","transaction");return}let u=this.spanRecorder?this.spanRecorder.spans.filter(n=>n!==this&&(0,tW.XU)(n).timestamp):[];if(this._trimEnd&&u.length>0){let n=u.map(n=>(0,tW.XU)(n).timestamp).filter(Boolean);this._endTime=n.reduce((n,l)=>n>l?n:l)}let{scope:d,isolationScope:h}={scope:this[tY],isolationScope:this[tQ]},{metadata:f}=this,{source:m}=f,g={contexts:{...this._contexts,trace:(0,tW.wy)(this)},spans:u,start_timestamp:this._startTime,tags:this.tags,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{...f,capturedSpanScope:d,capturedSpanIsolationScope:h,...(0,eM.Jr)({dynamicSamplingContext:(0,tA.j)(this)})},_metrics_summary:getMetricSummaryJsonForSpan(this),...m&&{transaction_info:{source:m}}},_=Object.keys(this._measurements).length>0;return _&&(eV.X&&eN.kg.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),g.measurements=this._measurements),eV.X&&eN.kg.log(`[Tracing] Finishing ${this.op} transaction: ${this._name}.`),g}};let tJ={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3};let IdleTransactionSpanRecorder=class IdleTransactionSpanRecorder extends SpanRecorder{constructor(n,l,u,d){super(d),this._pushActivity=n,this._popActivity=l,this.transactionSpanId=u}add(n){if(n.spanContext().spanId!==this.transactionSpanId){let l=n.end;n.end=(...u)=>(this._popActivity(n.spanContext().spanId),l.apply(n,u)),void 0===(0,tW.XU)(n).timestamp&&this._pushActivity(n.spanContext().spanId)}super.add(n)}};let IdleTransaction=class IdleTransaction extends Transaction{constructor(n,l,u=tJ.idleTimeout,d=tJ.finalTimeout,h=tJ.heartbeatInterval,f=!1,m=!1){super(n,l),this._idleHub=l,this._idleTimeout=u,this._finalTimeout=d,this._heartbeatInterval=h,this._onScope=f,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason="externalFinish",this._autoFinishAllowed=!m,f&&(eV.X&&eN.kg.log(`Setting idle transaction on scope. Span ID: ${this.spanContext().spanId}`),l.getScope().setSpan(this)),m||this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason="finalTimeout",this.end())},this._finalTimeout)}end(n){let l=(0,tW.$k)(n);if(this._finished=!0,this.activities={},"ui.action.click"===this.op&&this.setAttribute("finishReason",this._finishReason),this.spanRecorder){for(let n of(eV.X&&eN.kg.log("[Tracing] finishing IdleTransaction",new Date(1e3*l).toISOString(),this.op),this._beforeFinishCallbacks))n(this,l);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanContext().spanId===this.spanContext().spanId)return!0;!(0,tW.XU)(n).timestamp&&(n.setStatus("cancelled"),n.end(l),eV.X&&eN.kg.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));let{start_timestamp:u,timestamp:d}=(0,tW.XU)(n),h=u&&u<l,f=(this._finalTimeout+this._idleTimeout)/1e3,m=d&&u&&d-u<f;if(eV.X){let l=JSON.stringify(n,void 0,2);h?m||eN.kg.log("[Tracing] discarding Span since it finished after Transaction final timeout",l):eN.kg.log("[Tracing] discarding Span since it happened after Transaction was finished",l)}return h&&m}),eV.X&&eN.kg.log("[Tracing] flushing IdleTransaction")}else eV.X&&eN.kg.log("[Tracing] No active IdleTransaction");if(this._onScope){let n=this._idleHub.getScope();n.getTransaction()===this&&n.setSpan(void 0)}return super.end(n)}registerBeforeFinishCallback(n){this._beforeFinishCallbacks.push(n)}initSpanRecorder(n){this.spanRecorder||(this.spanRecorder=new IdleTransactionSpanRecorder(n=>{this._finished||this._pushActivity(n)},n=>{this._finished||this._popActivity(n)},this.spanContext().spanId,n),eV.X&&eN.kg.log("Starting heartbeat"),this._pingHeartbeat()),this.spanRecorder.add(this)}cancelIdleTimeout(n,{restartOnChildSpanChange:l}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=!1===l,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,0===Object.keys(this.activities).length&&this._idleTimeoutCanceledPermanently&&(this._finishReason="cancelled",this.end(n)))}setFinishReason(n){this._finishReason=n}sendAutoFinishSignal(){this._autoFinishAllowed||(eV.X&&eN.kg.log("[Tracing] Received finish signal for idle transaction."),this._restartIdleTimeout(),this._autoFinishAllowed=!0)}_restartIdleTimeout(n){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{this._finished||0!==Object.keys(this.activities).length||(this._finishReason="idleTimeout",this.end(n))},this._idleTimeout)}_pushActivity(n){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),eV.X&&eN.kg.log(`[Tracing] pushActivity: ${n}`),this.activities[n]=!0,eV.X&&eN.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(n){if(this.activities[n]&&(eV.X&&eN.kg.log(`[Tracing] popActivity ${n}`),delete this.activities[n],eV.X&&eN.kg.log("[Tracing] new activities count",Object.keys(this.activities).length)),0===Object.keys(this.activities).length){let n=(0,tx.ph)();this._idleTimeoutCanceledPermanently?this._autoFinishAllowed&&(this._finishReason="cancelled",this.end(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let n=Object.keys(this.activities).join("");n===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=n,this._heartbeatCounter>=3?this._autoFinishAllowed&&(eV.X&&eN.kg.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason="heartbeatFailed",this.end()):this._pingHeartbeat()}_pingHeartbeat(){eV.X&&eN.kg.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};function getActiveTransaction(n){let l=n||(0,eL.Gd)(),u=l.getScope();return u.getTransaction()}let tZ=!1;function errorCallback(){let n=getActiveTransaction();if(n){let l="internal_error";eV.X&&eN.kg.log(`[Tracing] Transaction: ${l} -> Global error occured`),n.setStatus(l)}}function sampleTransaction(n,l,u){let d;return hasTracingEnabled(l)?void 0!==n.sampled?n.setAttribute(tz,Number(n.sampled)):("function"==typeof l.tracesSampler?(d=l.tracesSampler(u),n.setAttribute(tz,Number(d))):void 0!==u.parentSampled?d=u.parentSampled:void 0!==l.tracesSampleRate?(d=l.tracesSampleRate,n.setAttribute(tz,Number(d))):(d=1,n.setAttribute(tz,d)),isValidSampleRate(d))?d?(n.sampled=Math.random()<d,n.sampled)?eV.X&&eN.kg.log(`[Tracing] starting ${n.op} transaction - ${(0,tW.XU)(n).description}`):eV.X&&eN.kg.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(d)})`):(eV.X&&eN.kg.log(`[Tracing] Discarding transaction because ${"function"==typeof l.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),n.sampled=!1):(eV.X&&eN.kg.warn("[Tracing] Discarding transaction because of invalid sample rate."),n.sampled=!1):n.sampled=!1,n}function isValidSampleRate(n){return(0,eK.i2)(n)||!("number"==typeof n||"boolean"==typeof n)?(eV.X&&eN.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(n)} of type ${JSON.stringify(typeof n)}.`),!1):!(n<0)&&!(n>1)||(eV.X&&eN.kg.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${n}.`),!1)}function traceHeaders(){let n=this.getScope(),l=n.getSpan();return l?{"sentry-trace":(0,tW.Hb)(l)}:{}}function _startTransaction(n,l){let u=this.getClient(),d=u&&u.getOptions()||{},h=d.instrumenter||"sentry",f=n.instrumenter||"sentry";h!==f&&(eV.X&&eN.kg.error(`A transaction was started with instrumenter=\`${f}\`, but the SDK is configured with the \`${h}\` instrumenter.
The transaction will not be sampled. Please use the ${h} instrumentation to start transactions.`),n.sampled=!1);let m=new Transaction(n,this);return(m=sampleTransaction(m,d,{name:n.name,parentSampled:n.parentSampled,transactionContext:n,attributes:{...n.data,...n.attributes},...l})).isRecording()&&m.initSpanRecorder(d._experiments&&d._experiments.maxSpans),u&&u.emit&&u.emit("startTransaction",m),m}function startIdleTransaction(n,l,u,d,h,f,m,g=!1){let _=n.getClient(),j=_&&_.getOptions()||{},$=new IdleTransaction(l,n,u,d,m,h,g);return($=sampleTransaction($,j,{name:l.name,parentSampled:l.parentSampled,transactionContext:l,attributes:{...l.data,...l.attributes},...f})).isRecording()&&$.initSpanRecorder(j._experiments&&j._experiments.maxSpans),_&&_.emit&&_.emit("startTransaction",$),$}function addTracingExtensions(){let n=(0,eL.cu)();n.__SENTRY__&&(n.__SENTRY__.extensions=n.__SENTRY__.extensions||{},n.__SENTRY__.extensions.startTransaction||(n.__SENTRY__.extensions.startTransaction=_startTransaction),n.__SENTRY__.extensions.traceHeaders||(n.__SENTRY__.extensions.traceHeaders=traceHeaders),tZ||(tZ=!0,addGlobalErrorInstrumentationHandler(errorCallback),addGlobalUnhandledRejectionInstrumentationHandler(errorCallback)))}errorCallback.tag="sentry_tracingErrorCallback";var t0=u(49691);let t1="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,t2=eQ.GLOBAL_OBJ;function registerBackgroundTabDetection(){t2.document?t2.document.addEventListener("visibilitychange",()=>{let n=getActiveTransaction();if(t2.document.hidden&&n){let l="cancelled",{op:u,status:d}=(0,tW.XU)(n);t1&&eN.kg.log(`[Tracing] Transaction: ${l} -> since tab moved to the background, op: ${u}`),d||n.setStatus(l),n.setTag("visibilitychange","document.hidden"),n.end()}}):t1&&eN.kg.warn("[Tracing] Could not set up background tab detection due to lack of global document")}let bindReporter=(n,l,u)=>{let d,h;return f=>{l.value>=0&&(f||u)&&((h=l.value-(d||0))||void 0===d)&&(d=l.value,l.delta=h,n(l))}},generateUniqueID=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,getNavigationEntryFromPerformanceTiming=()=>{let n=t2.performance.timing,l=t2.performance.navigation.type,u={entryType:"navigation",startTime:0,type:2==l?"back_forward":1===l?"reload":"navigate"};for(let l in n)"navigationStart"!==l&&"toJSON"!==l&&(u[l]=Math.max(n[l]-n.navigationStart,0));return u},getNavigationEntry=()=>t2.__WEB_VITALS_POLYFILL__?t2.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||getNavigationEntryFromPerformanceTiming()):t2.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],getActivationStart=()=>{let n=getNavigationEntry();return n&&n.activationStart||0},initMetric=(n,l)=>{let u=getNavigationEntry(),d="navigate";return u&&(d=t2.document&&t2.document.prerendering||getActivationStart()>0?"prerender":u.type.replace(/_/g,"-")),{name:n,value:void 0===l?-1:l,rating:"good",delta:0,entries:[],id:generateUniqueID(),navigationType:d}},observe=(n,l,u)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(n)){let d=new PerformanceObserver(n=>{l(n.getEntries())});return d.observe(Object.assign({type:n,buffered:!0},u||{})),d}}catch(n){}},onHidden=(n,l)=>{let onHiddenOrPageHide=u=>{("pagehide"===u.type||"hidden"===t2.document.visibilityState)&&(n(u),l&&(removeEventListener("visibilitychange",onHiddenOrPageHide,!0),removeEventListener("pagehide",onHiddenOrPageHide,!0)))};t2.document&&(addEventListener("visibilitychange",onHiddenOrPageHide,!0),addEventListener("pagehide",onHiddenOrPageHide,!0))},onCLS=(n,l={})=>{let u;let d=initMetric("CLS",0),h=0,f=[],handleEntries=n=>{n.forEach(n=>{if(!n.hadRecentInput){let l=f[0],m=f[f.length-1];h&&0!==f.length&&n.startTime-m.startTime<1e3&&n.startTime-l.startTime<5e3?(h+=n.value,f.push(n)):(h=n.value,f=[n]),h>d.value&&(d.value=h,d.entries=f,u&&u())}})},m=observe("layout-shift",handleEntries);if(m){u=bindReporter(n,d,l.reportAllChanges);let stopListening=()=>{handleEntries(m.takeRecords()),u(!0)};return onHidden(stopListening),stopListening}},t3=-1,initHiddenTime=()=>{t2.document&&t2.document.visibilityState&&(t3="hidden"!==t2.document.visibilityState||t2.document.prerendering?1/0:0)},trackChanges=()=>{onHidden(({timeStamp:n})=>{t3=n},!0)},getVisibilityWatcher=()=>(t3<0&&(initHiddenTime(),trackChanges()),{get firstHiddenTime(){return t3}}),onFID=n=>{let l;let u=getVisibilityWatcher(),d=initMetric("FID"),handleEntry=n=>{n.startTime<u.firstHiddenTime&&(d.value=n.processingStart-n.startTime,d.entries.push(n),l(!0))},handleEntries=n=>{n.forEach(handleEntry)},h=observe("first-input",handleEntries);l=bindReporter(n,d),h&&onHidden(()=>{handleEntries(h.takeRecords()),h.disconnect()},!0)},t5=0,t4=1/0,t9=0,updateEstimate=n=>{n.forEach(n=>{n.interactionId&&(t4=Math.min(t4,n.interactionId),t5=(t9=Math.max(t9,n.interactionId))?(t9-t4)/7+1:0)})},getInteractionCount=()=>j?t5:performance.interactionCount||0,initInteractionCountPolyfill=()=>{"interactionCount"in performance||j||(j=observe("event",updateEstimate,{type:"event",buffered:!0,durationThreshold:0}))},getInteractionCountForNavigation=()=>getInteractionCount(),t6=[],t7={},processEntry=n=>{let l=t6[t6.length-1],u=t7[n.interactionId];if(u||t6.length<10||n.duration>l.latency){if(u)u.entries.push(n),u.latency=Math.max(u.latency,n.duration);else{let l={id:n.interactionId,latency:n.duration,entries:[n]};t7[l.id]=l,t6.push(l)}t6.sort((n,l)=>l.latency-n.latency),t6.splice(10).forEach(n=>{delete t7[n.id]})}},estimateP98LongestInteraction=()=>{let n=Math.min(t6.length-1,Math.floor(getInteractionCountForNavigation()/50));return t6[n]},onINP=(n,l)=>{let u;l=l||{},initInteractionCountPolyfill();let d=initMetric("INP"),handleEntries=n=>{n.forEach(n=>{if(n.interactionId&&processEntry(n),"first-input"===n.entryType){let l=!t6.some(l=>l.entries.some(l=>n.duration===l.duration&&n.startTime===l.startTime));l&&processEntry(n)}});let l=estimateP98LongestInteraction();l&&l.latency!==d.value&&(d.value=l.latency,d.entries=l.entries,u())},h=observe("event",handleEntries,{durationThreshold:l.durationThreshold||40});u=bindReporter(n,d,l.reportAllChanges),h&&(h.observe({type:"first-input",buffered:!0}),onHidden(()=>{handleEntries(h.takeRecords()),d.value<0&&getInteractionCountForNavigation()>0&&(d.value=0,d.entries=[]),u(!0)}))},t8={},onLCP=n=>{let l;let u=getVisibilityWatcher(),d=initMetric("LCP"),handleEntries=n=>{let h=n[n.length-1];if(h){let n=Math.max(h.startTime-getActivationStart(),0);n<u.firstHiddenTime&&(d.value=n,d.entries=[h],l())}},h=observe("largest-contentful-paint",handleEntries);if(h){l=bindReporter(n,d);let stopListening=()=>{t8[d.id]||(handleEntries(h.takeRecords()),h.disconnect(),t8[d.id]=!0,l(!0))};return["keydown","click"].forEach(n=>{t2.document&&addEventListener(n,stopListening,{once:!0,capture:!0})}),onHidden(stopListening,!0),stopListening}},whenReady=n=>{t2.document&&(t2.document.prerendering?addEventListener("prerenderingchange",()=>whenReady(n),!0):"complete"!==t2.document.readyState?addEventListener("load",()=>whenReady(n),!0):setTimeout(n,0))},onTTFB=(n,l)=>{l=l||{};let u=initMetric("TTFB"),d=bindReporter(n,u,l.reportAllChanges);whenReady(()=>{let n=getNavigationEntry();if(n){if(u.value=Math.max(n.responseStart-getActivationStart(),0),u.value<0||u.value>performance.now())return;u.entries=[n],d(!0)}})},re={},rr={};function addLcpInstrumentationHandler(n,l=!1){return addMetricObserver("lcp",n,instrumentLcp,ee,l)}function addPerformanceInstrumentationHandler(n,l){return instrument_addHandler(n,l),rr[n]||(function(n){let l={};"event"===n&&(l.durationThreshold=0),observe(n,l=>{instrument_triggerHandlers(n,{entries:l})},l)}(n),rr[n]=!0),getCleanupCallback(n,l)}function instrument_triggerHandlers(n,l){let u=re[n];if(u&&u.length)for(let d of u)try{d(l)}catch(l){t1&&eN.kg.error(`Error while triggering instrumentation handler.
Type: ${n}
Name: ${(0,e1.$P)(d)}
Error:`,l)}}function instrumentCls(){return onCLS(n=>{instrument_triggerHandlers("cls",{metric:n}),$=n},{reportAllChanges:!0})}function instrumentFid(){return onFID(n=>{instrument_triggerHandlers("fid",{metric:n}),z=n})}function instrumentLcp(){return onLCP(n=>{instrument_triggerHandlers("lcp",{metric:n}),ee=n})}function instrumentTtfb(){return onTTFB(n=>{instrument_triggerHandlers("ttfb",{metric:n}),et=n})}function instrumentInp(){return onINP(n=>{instrument_triggerHandlers("inp",{metric:n}),en=n})}function addMetricObserver(n,l,u,d,h=!1){let f;return instrument_addHandler(n,l),rr[n]||(f=u(),rr[n]=!0),d&&l({metric:d}),getCleanupCallback(n,l,h?f:void 0)}function instrument_addHandler(n,l){re[n]=re[n]||[],re[n].push(l)}function getCleanupCallback(n,l,u){return()=>{u&&u();let d=re[n];if(!d)return;let h=d.indexOf(l);-1!==h&&d.splice(h,1)}}function createSpanItem(n){return[{type:"span"},n]}function isMeasurementValue(n){return"number"==typeof n&&isFinite(n)}function _startChild(n,{startTimestamp:l,...u}){return l&&n.startTimestamp>l&&(n.startTimestamp=l),n.startChild({startTimestamp:l,...u})}function msToSec(n){return n/1e3}function getBrowserPerformanceAPI(){return t2&&t2.addEventListener&&t2.performance}let rn=0,ri={};function startTrackingWebVitals(){let n=getBrowserPerformanceAPI();if(n&&tx.Z1){n.mark&&t2.performance.mark("sentry-tracing-init");let l=addMetricObserver("fid",({metric:n})=>{let l=n.entries[n.entries.length-1];if(!l)return;let u=msToSec(tx.Z1),d=msToSec(l.startTime);t1&&eN.kg.log("[Measurements] Adding FID"),ri.fid={value:n.value,unit:"millisecond"},ri["mark.fid"]={value:u+d,unit:"second"}},instrumentFid,z),u=function(n,l=!1){return addMetricObserver("cls",n,instrumentCls,$,l)}(({metric:n})=>{let l=n.entries[n.entries.length-1];l&&(t1&&eN.kg.log("[Measurements] Adding CLS"),ri.cls={value:n.value,unit:""},es=l)},!0),d=addLcpInstrumentationHandler(({metric:n})=>{let l=n.entries[n.entries.length-1];l&&(t1&&eN.kg.log("[Measurements] Adding LCP"),ri.lcp={value:n.value,unit:"millisecond"},eo=l)},!0),h=addMetricObserver("ttfb",({metric:n})=>{let l=n.entries[n.entries.length-1];l&&(t1&&eN.kg.log("[Measurements] Adding TTFB"),ri.ttfb={value:n.value,unit:"millisecond"})},instrumentTtfb,et);return()=>{l(),u(),d(),h()}}return()=>void 0}function startTrackingLongTasks(){addPerformanceInstrumentationHandler("longtask",({entries:n})=>{for(let l of n){let n=getActiveTransaction();if(!n)return;let u=msToSec(tx.Z1+l.startTime),d=msToSec(l.duration);n.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:u,endTimestamp:u+d})}})}function startTrackingInteractions(){addPerformanceInstrumentationHandler("event",({entries:n})=>{for(let l of n){let n=getActiveTransaction();if(!n)return;if("click"===l.name){let u=msToSec(tx.Z1+l.startTime),d=msToSec(l.duration),h={description:(0,e9.Rt)(l.target),op:`ui.interaction.${l.name}`,origin:"auto.ui.browser.metrics",startTimestamp:u,endTimestamp:u+d},f=(0,e9.iY)(l.target);f&&(h.attributes={"ui.component_name":f}),n.startChild(h)}}})}function startTrackingINP(n,l){let u=getBrowserPerformanceAPI();if(u&&tx.Z1){let u=addMetricObserver("inp",({metric:u})=>{let d;if(void 0===u.value)return;let h=u.entries.find(n=>n.duration===u.value&&void 0!==ro[n.name]),f=(0,ex.s3)();if(!h||!f)return;let m=ro[h.name],g=f.getOptions(),_=msToSec(tx.Z1+h.startTime),j=msToSec(u.value),$=void 0!==h.interactionId?n[h.interactionId]:void 0;if(void 0===$)return;let{routeName:z,parentContext:ee,activeTransaction:et,user:en,replayId:eo}=$,es=void 0!==en?en.email||en.id||en.ip_address:void 0,el=void 0!==et?et.getProfileId():void 0,eu=new Span({startTimestamp:_,endTimestamp:_+j,op:`ui.interaction.${m}`,name:(0,e9.Rt)(h.target),attributes:{release:g.release,environment:g.environment,transaction:z,...void 0!==es&&""!==es?{user:es}:{},...void 0!==el?{profile_id:el}:{},...void 0!==eo?{replay_id:eo}:{}},exclusiveTime:u.value,measurements:{inp:{value:u.value,unit:"millisecond"}}}),ec=!!hasTracingEnabled(g)&&(isValidSampleRate(d=void 0!==ee&&"function"==typeof g.tracesSampler?g.tracesSampler({transactionContext:ee,name:ee.name,parentSampled:ee.parentSampled,attributes:{...ee.data,...ee.attributes},location:t2.location}):void 0!==ee&&void 0!==ee.sampled?ee.sampled:void 0!==g.tracesSampleRate?g.tracesSampleRate:1)?!0===d?l:!1===d?0:d*l:(t1&&eN.kg.warn("[Tracing] Discarding interaction span because of invalid sample rate."),!1));if(ec&&Math.random()<ec){let n=eu?function(n,l){let u={sent_at:new Date().toISOString()};l&&(u.dsn=dsn_dsnToString(l));let d=n.map(createSpanItem);return createEnvelope(u,d)}([eu],f.getDsn()):void 0,l=f&&f.getTransport();l&&n&&l.send(n).then(null,n=>{t1&&eN.kg.error("Error while sending interaction:",n)});return}},instrumentInp,en);return()=>{u()}}return()=>void 0}let ro={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 addPerformanceEntries(n){let l=getBrowserPerformanceAPI();if(!l||!t2.performance.getEntries||!tx.Z1)return;t1&&eN.kg.log("[Tracing] Adding & adjusting spans using Performance API");let u=msToSec(tx.Z1),d=l.getEntries(),{op:h,start_timestamp:f}=(0,tW.XU)(n);if(d.slice(rn).forEach(l=>{let d=msToSec(l.startTime),h=msToSec(l.duration);if("navigation"!==n.op||!f||!(u+d<f))switch(l.entryType){case"navigation":["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(d=>{_addPerformanceNavigationTiming(n,l,d,u)}),_addPerformanceNavigationTiming(n,l,"secureConnection",u,"TLS/SSL","connectEnd"),_addPerformanceNavigationTiming(n,l,"fetch",u,"cache","domainLookupStart"),_addPerformanceNavigationTiming(n,l,"domainLookup",u,"DNS"),l.responseEnd&&(_startChild(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:u+msToSec(l.requestStart),endTimestamp:u+msToSec(l.responseEnd)}),_startChild(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:u+msToSec(l.responseStart),endTimestamp:u+msToSec(l.responseEnd)}));break;case"mark":case"paint":case"measure":{(function(n,l,u,d,h){let f=h+u;_startChild(n,{description:l.name,endTimestamp:f+d,op:l.entryType,origin:"auto.resource.browser.metrics",startTimestamp:f})})(n,l,d,h,u);let f=getVisibilityWatcher(),m=l.startTime<f.firstHiddenTime;"first-paint"===l.name&&m&&(t1&&eN.kg.log("[Measurements] Adding FP"),ri.fp={value:l.startTime,unit:"millisecond"}),"first-contentful-paint"===l.name&&m&&(t1&&eN.kg.log("[Measurements] Adding FCP"),ri.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":(function(n,l,u,d,h,f){if("xmlhttprequest"===l.initiatorType||"fetch"===l.initiatorType)return;let m=url_parseUrl(u),g={};setResourceEntrySizeData(g,l,"transferSize","http.response_transfer_size"),setResourceEntrySizeData(g,l,"encodedBodySize","http.response_content_length"),setResourceEntrySizeData(g,l,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in l&&(g["resource.render_blocking_status"]=l.renderBlockingStatus),m.protocol&&(g["url.scheme"]=m.protocol.split(":").pop()),m.host&&(g["server.address"]=m.host),g["url.same_origin"]=u.includes(t2.location.origin);let _=f+d,j=_+h;_startChild(n,{description:u.replace(t2.location.origin,""),endTimestamp:j,op:l.initiatorType?`resource.${l.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:_,data:g})})(n,l,l.name,d,h,u)}}),rn=Math.max(d.length-1,0),function(n){let l=t2.navigator;if(!l)return;let u=l.connection;u&&(u.effectiveType&&n.setTag("effectiveConnectionType",u.effectiveType),u.type&&n.setTag("connectionType",u.type),isMeasurementValue(u.rtt)&&(ri["connection.rtt"]={value:u.rtt,unit:"millisecond"})),isMeasurementValue(l.deviceMemory)&&n.setTag("deviceMemory",`${l.deviceMemory} GB`),isMeasurementValue(l.hardwareConcurrency)&&n.setTag("hardwareConcurrency",String(l.hardwareConcurrency))}(n),"pageload"===h){(function(n){let l=getNavigationEntry();if(!l)return;let{responseStart:u,requestStart:d}=l;d<=u&&(t1&&eN.kg.log("[Measurements] Adding TTFB Request Time"),n["ttfb.requestTime"]={value:u-d,unit:"millisecond"})})(ri),["fcp","fp","lcp"].forEach(n=>{if(!ri[n]||!f||u>=f)return;let l=ri[n].value,d=u+msToSec(l),h=Math.abs((d-f)*1e3),m=h-l;t1&&eN.kg.log(`[Measurements] Normalized ${n} from ${l} to ${h} (${m})`),ri[n].value=h});let l=ri["mark.fid"];l&&ri.fid&&(_startChild(n,{description:"first input delay",endTimestamp:l.value+msToSec(ri.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:l.value}),delete ri["mark.fid"]),"fcp"in ri||delete ri.cls,Object.keys(ri).forEach(n=>{!function(n,l,u){let d=getActiveTransaction();d&&d.setMeasurement(n,l,u)}(n,ri[n].value,ri[n].unit)}),eo&&(t1&&eN.kg.log("[Measurements] Adding LCP Data"),eo.element&&n.setTag("lcp.element",(0,e9.Rt)(eo.element)),eo.id&&n.setTag("lcp.id",eo.id),eo.url&&n.setTag("lcp.url",eo.url.trim().slice(0,200)),n.setTag("lcp.size",eo.size)),es&&es.sources&&(t1&&eN.kg.log("[Measurements] Adding CLS Data"),es.sources.forEach((l,u)=>n.setTag(`cls.source.${u+1}`,(0,e9.Rt)(l.node))))}eo=void 0,es=void 0,ri={}}function _addPerformanceNavigationTiming(n,l,u,d,h,f){let m=f?l[f]:l[`${u}End`],g=l[`${u}Start`];g&&m&&_startChild(n,{op:"browser",origin:"auto.browser.browser.metrics",description:h||u,startTimestamp:d+msToSec(g),endTimestamp:d+msToSec(m)})}function setResourceEntrySizeData(n,l,u,d){let h=l[u];null!=h&&h<2147483647&&(n[d]=h)}var rs=u(46990);let ra=["localhost",/^\/(?!\/)/],rl={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:ra,tracePropagationTargets:ra};function instrumentOutgoingRequests(n){let{traceFetch:l,traceXHR:u,tracePropagationTargets:d,tracingOrigins:h,shouldCreateSpanForRequest:f,enableHTTPTimings:m}={traceFetch:rl.traceFetch,traceXHR:rl.traceXHR,...n},g="function"==typeof f?f:n=>!0,shouldAttachHeadersWithTargets=n=>{var l;return l=d||h,(0,eH.U0)(n,l||ra)},_={};l&&addFetchInstrumentationHandler(n=>{let l=function(n,l,u,d,h="auto.http.browser"){if(!hasTracingEnabled()||!n.fetchData)return;let f=l(n.fetchData.url);if(n.endTimestamp&&f){let l=n.fetchData.__span;if(!l)return;let u=d[l];u&&(function(n,l){if(l.response){setHttpStatus(n,l.response.status);let u=l.response&&l.response.headers&&l.response.headers.get("content-length");if(u){let l=parseInt(u);l>0&&n.setAttribute("http.response_content_length",l)}}else l.error&&n.setStatus("internal_error");n.end()}(u,n),delete d[l]);return}let m=(0,ex.nZ)(),g=(0,ex.s3)(),{method:_,url:j}=n.fetchData,$=function(n){try{let l=new URL(n);return l.href}catch(n){return}}(j),z=$?url_parseUrl($).host:void 0,ee=f?startInactiveSpan({name:`${_} ${j}`,onlyIfParent:!0,attributes:{url:j,type:"fetch","http.method":_,"http.url":$,"server.address":z,[tK]:h},op:"http.client"}):void 0;if(ee&&(n.fetchData.__span=ee.spanContext().spanId,d[ee.spanContext().spanId]=ee),u(n.fetchData.url)&&g){let l=n.args[0];n.args[1]=n.args[1]||{};let u=n.args[1];u.headers=function(n,l,u,d,h){let f=h||u.getSpan(),m=(0,eL.aF)(),{traceId:g,spanId:_,sampled:j,dsc:$}={...m.getPropagationContext(),...u.getPropagationContext()},z=f?(0,tW.Hb)(f):(0,t0.$p)(g,_,j),ee=(0,rs.IQ)($||(f?(0,tA.j)(f):(0,tA._)(g,l,u))),et=d.headers||("undefined"!=typeof Request&&(0,eK.V9)(n,Request)?n.headers:void 0);if(!et)return{"sentry-trace":z,baggage:ee};if("undefined"!=typeof Headers&&(0,eK.V9)(et,Headers)){let n=new Headers(et);return n.append("sentry-trace",z),ee&&n.append(rs.bU,ee),n}if(Array.isArray(et)){let n=[...et,["sentry-trace",z]];return ee&&n.push([rs.bU,ee]),n}{let n="baggage"in et?et.baggage:void 0,l=[];return Array.isArray(n)?l.push(...n):n&&l.push(n),ee&&l.push(ee),{...et,"sentry-trace":z,baggage:l.length>0?l.join(","):void 0}}}(l,g,m,u,ee)}return ee}(n,g,shouldAttachHeadersWithTargets,_);if(l){let u=request_getFullURL(n.fetchData.url),d=u?url_parseUrl(u).host:void 0;l.setAttributes({"http.url":u,"server.address":d})}m&&l&&addHTTPTimings(l)}),u&&addXhrInstrumentationHandler(n=>{let l=function(n,l,u,d){let h=n.xhr,f=h&&h[tc];if(!hasTracingEnabled()||!h||h.__sentry_own_request__||!f)return;let m=l(f.url);if(n.endTimestamp&&m){let n=h.__sentry_xhr_span_id__;if(!n)return;let l=d[n];l&&void 0!==f.status_code&&(setHttpStatus(l,f.status_code),l.end(),delete d[n]);return}let g=(0,ex.nZ)(),_=(0,eL.aF)(),j=request_getFullURL(f.url),$=j?url_parseUrl(j).host:void 0,z=m?startInactiveSpan({name:`${f.method} ${f.url}`,onlyIfParent:!0,attributes:{type:"xhr","http.method":f.method,"http.url":j,url:f.url,"server.address":$,[tK]:"auto.http.browser"},op:"http.client"}):void 0;z&&(h.__sentry_xhr_span_id__=z.spanContext().spanId,d[h.__sentry_xhr_span_id__]=z);let ee=(0,ex.s3)();if(h.setRequestHeader&&u(f.url)&&ee){let{traceId:n,spanId:l,sampled:u,dsc:d}={..._.getPropagationContext(),...g.getPropagationContext()},f=z?(0,tW.Hb)(z):(0,t0.$p)(n,l,u),m=(0,rs.IQ)(d||(z?(0,tA.j)(z):(0,tA._)(n,ee,g)));(function(n,l,u){try{n.setRequestHeader("sentry-trace",l),u&&n.setRequestHeader(rs.bU,u)}catch(n){}})(h,f,m)}return z}(n,g,shouldAttachHeadersWithTargets,_);m&&l&&addHTTPTimings(l)})}function addHTTPTimings(n){let{url:l}=(0,tW.XU)(n).data||{};if(!l||"string"!=typeof l)return;let u=addPerformanceInstrumentationHandler("resource",({entries:d})=>{d.forEach(d=>{if("resource"===d.entryType&&"initiatorType"in d&&"string"==typeof d.nextHopProtocol&&("fetch"===d.initiatorType||"xmlhttprequest"===d.initiatorType)&&d.name.endsWith(l)){let l=function(n){let{name:l,version:u}=function(n){let l="unknown",u="unknown",d="";for(let h of n){if("/"===h){[l,u]=n.split("/");break}if(!isNaN(Number(h))){l="h"===d?"http":d,u=n.split(d)[1];break}d+=h}return d===n&&(l=d),{name:l,version:u}}(n.nextHopProtocol),d=[];return(d.push(["network.protocol.version",u],["network.protocol.name",l]),tx.Z1)?[...d,["http.request.redirect_start",getAbsoluteTime(n.redirectStart)],["http.request.fetch_start",getAbsoluteTime(n.fetchStart)],["http.request.domain_lookup_start",getAbsoluteTime(n.domainLookupStart)],["http.request.domain_lookup_end",getAbsoluteTime(n.domainLookupEnd)],["http.request.connect_start",getAbsoluteTime(n.connectStart)],["http.request.secure_connection_start",getAbsoluteTime(n.secureConnectionStart)],["http.request.connection_end",getAbsoluteTime(n.connectEnd)],["http.request.request_start",getAbsoluteTime(n.requestStart)],["http.request.response_start",getAbsoluteTime(n.responseStart)],["http.request.response_end",getAbsoluteTime(n.responseEnd)]]:d}(d);l.forEach(l=>n.setAttribute(...l)),setTimeout(u)}})})}function getAbsoluteTime(n=0){return((tx.Z1||performance.timeOrigin)+n)/1e3}function request_getFullURL(n){try{let l=new URL(n,t2.location.origin);return l.href}catch(n){return}}let ru={...tJ,markBackgroundTransactions:!0,routingInstrumentation:function(n,l=!0,u=!0){let d;if(!t2||!t2.location){t1&&eN.kg.warn("Could not initialize routing instrumentation due to invalid location");return}let h=t2.location.href;l&&(d=n({name:t2.location.pathname,startTimestamp:tx.Z1?tx.Z1/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),u&&addHistoryInstrumentationHandler(({to:l,from:u})=>{if(void 0===u&&h&&-1!==h.indexOf(l)){h=void 0;return}u!==l&&(h=void 0,d&&(t1&&eN.kg.log(`[Tracing] Finishing current transaction with op: ${d.op}`),d.end()),d=n({name:t2.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...rl};let browsertracing_BrowserTracing=class browsertracing_BrowserTracing{constructor(n){this.name="BrowserTracing",this._hasSetTracePropagationTargets=!1,addTracingExtensions(),t1&&(this._hasSetTracePropagationTargets=!!(n&&(n.tracePropagationTargets||n.tracingOrigins))),this.options={...ru,...n},void 0!==this.options._experiments.enableLongTask&&(this.options.enableLongTask=this.options._experiments.enableLongTask),n&&!n.tracePropagationTargets&&n.tracingOrigins&&(this.options.tracePropagationTargets=n.tracingOrigins),this._collectWebVitals=startTrackingWebVitals(),this._interactionIdToRouteNameMapping={},this.options.enableInp&&startTrackingINP(this._interactionIdToRouteNameMapping,this.options.interactionsSampleRate),this.options.enableLongTask&&startTrackingLongTasks(),this.options._experiments.enableInteractions&&startTrackingInteractions(),this._latestRoute={name:void 0,context:void 0}}setupOnce(n,l){this._getCurrentHub=l;let u=l(),d=u.getClient(),h=d&&d.getOptions(),{routingInstrumentation:f,startTransactionOnLocationChange:m,startTransactionOnPageLoad:g,markBackgroundTransactions:_,traceFetch:j,traceXHR:$,shouldCreateSpanForRequest:z,enableHTTPTimings:ee,_experiments:et}=this.options,en=h&&h.tracePropagationTargets,eo=en||this.options.tracePropagationTargets;t1&&this._hasSetTracePropagationTargets&&en&&eN.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."),f(n=>{let u=this._createRouteTransaction(n);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(u,n,l),u},g,m),_&&registerBackgroundTabDetection(),et.enableInteractions&&this._registerInteractionListener(),this.options.enableInp&&this._registerInpInteractionListener(),instrumentOutgoingRequests({traceFetch:j,traceXHR:$,tracePropagationTargets:eo,shouldCreateSpanForRequest:z,enableHTTPTimings:ee})}_createRouteTransaction(n){let l;if(!this._getCurrentHub){t1&&eN.kg.warn(`[Tracing] Did not create ${n.op} transaction because _getCurrentHub is invalid.`);return}let u=this._getCurrentHub(),{beforeNavigate:d,idleTimeout:h,finalTimeout:f,heartbeatInterval:m}=this.options,g="pageload"===n.op;if(g){let u=g?getMetaContent("sentry-trace"):"",d=g?getMetaContent("baggage"):void 0,{traceId:h,dsc:f,parentSpanId:m,sampled:_}=(0,t0.pT)(u,d);l={traceId:h,parentSpanId:m,parentSampled:_,...n,metadata:{...n.metadata,dynamicSamplingContext:f},trimEnd:!0}}else l={trimEnd:!0,...n};let _="function"==typeof d?d(l):l,j=void 0===_?{...l,sampled:!1}:_;j.metadata=j.name!==l.name?{...j.metadata,source:"custom"}:j.metadata,this._latestRoute.name=j.name,this._latestRoute.context=j,!1===j.sampled&&t1&&eN.kg.log(`[Tracing] Will not send ${j.op} transaction because of beforeNavigate.`),t1&&eN.kg.log(`[Tracing] Starting ${j.op} transaction on scope`);let{location:$}=t2,z=startIdleTransaction(u,j,h,f,!0,{location:$},m,g);return g&&t2.document&&(t2.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(t2.document.readyState)&&z.sendAutoFinishSignal()}),["interactive","complete"].includes(t2.document.readyState)&&z.sendAutoFinishSignal()),z.registerBeforeFinishCallback(n=>{this._collectWebVitals(),addPerformanceEntries(n)}),z}_registerInteractionListener(){let n;let registerInteractionTransaction=()=>{let{idleTimeout:l,finalTimeout:u,heartbeatInterval:d}=this.options,h="ui.action.click",f=getActiveTransaction();if(f&&f.op&&["navigation","pageload"].includes(f.op)){t1&&eN.kg.warn(`[Tracing] Did not create ${h} transaction because a pageload or navigation transaction is in progress.`);return}if(n&&(n.setFinishReason("interactionInterrupted"),n.end(),n=void 0),!this._getCurrentHub){t1&&eN.kg.warn(`[Tracing] Did not create ${h} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRoute.name){t1&&eN.kg.warn(`[Tracing] Did not create ${h} transaction because _latestRouteName is missing.`);return}let m=this._getCurrentHub(),{location:g}=t2,_={name:this._latestRoute.name,op:h,trimEnd:!0,data:{[tq]:this._latestRoute.context?function(n){let l=n.attributes&&n.attributes[tq],u=n.data&&n.data[tq],d=n.metadata&&n.metadata.source;return l||u||d}(this._latestRoute.context):"url"}};n=startIdleTransaction(m,_,l,u,!0,{location:g},d)};["click"].forEach(n=>{t2.document&&addEventListener(n,registerInteractionTransaction,{once:!1,capture:!0})})}_registerInpInteractionListener(){let handleEntries=({entries:n})=>{let l=(0,ex.s3)(),u=void 0!==l&&void 0!==l.getIntegrationByName?l.getIntegrationByName("Replay"):void 0,d=void 0!==u?u.getReplayId():void 0,h=getActiveTransaction(),f=(0,ex.nZ)(),m=void 0!==f?f.getUser():void 0;n.forEach(n=>{if("duration"in n){let l=n.interactionId;if(void 0===l)return;let u=this._interactionIdToRouteNameMapping[l],f=n.duration,g=n.startTime,_=Object.keys(this._interactionIdToRouteNameMapping),j=_.length>0?_.reduce((n,l)=>this._interactionIdToRouteNameMapping[n].duration<this._interactionIdToRouteNameMapping[l].duration?n:l):void 0;if("first-input"===n.entryType){let n=_.map(n=>this._interactionIdToRouteNameMapping[n]).some(n=>n.duration===f&&n.startTime===g);if(n)return}if(l){if(u)u.duration=Math.max(u.duration,f);else if(_.length<10||void 0===j||f>this._interactionIdToRouteNameMapping[j].duration){let n=this._latestRoute.name,u=this._latestRoute.context;n&&u&&(j&&Object.keys(this._interactionIdToRouteNameMapping).length>=10&&delete this._interactionIdToRouteNameMapping[j],this._interactionIdToRouteNameMapping[l]={routeName:n,duration:f,parentContext:u,user:m,activeTransaction:h,replayId:d,startTime:g})}}}})};addPerformanceInstrumentationHandler("event",handleEntries),addPerformanceInstrumentationHandler("first-input",handleEntries)}};function getMetaContent(n){let l=(0,e9.qT)(`meta[name=${n}]`);return l?l.getAttribute("content"):void 0}let rd={...tJ,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableInp:!1,interactionsSampleRate:1,_experiments:{},...rl},browserTracingIntegration=(n={})=>{let l=!!t1&&!!(n.tracePropagationTargets||n.tracingOrigins);addTracingExtensions(),!n.tracePropagationTargets&&n.tracingOrigins&&(n.tracePropagationTargets=n.tracingOrigins);let u={...rd,...n},d=startTrackingWebVitals(),h={};u.enableInp&&startTrackingINP(h,u.interactionsSampleRate),u.enableLongTask&&startTrackingLongTasks(),u._experiments.enableInteractions&&startTrackingInteractions();let f={name:void 0,context:void 0};function _createRouteTransaction(n){let l;let h=(0,eL.Gd)(),{beforeStartSpan:m,idleTimeout:g,finalTimeout:_,heartbeatInterval:j}=u,$="pageload"===n.op;if($){let u=$?browserTracingIntegration_getMetaContent("sentry-trace"):"",d=$?browserTracingIntegration_getMetaContent("baggage"):void 0,{traceId:h,dsc:f,parentSpanId:m,sampled:g}=(0,t0.pT)(u,d);l={traceId:h,parentSpanId:m,parentSampled:g,...n,metadata:{...n.metadata,dynamicSamplingContext:f},trimEnd:!0}}else l={trimEnd:!0,...n};let z=m?m(l):l;z.metadata=z.name!==l.name?{...z.metadata,source:"custom"}:z.metadata,f.name=z.name,f.context=z,!1===z.sampled&&t1&&eN.kg.log(`[Tracing] Will not send ${z.op} transaction because of beforeNavigate.`),t1&&eN.kg.log(`[Tracing] Starting ${z.op} transaction on scope`);let{location:ee}=t2,et=startIdleTransaction(h,z,g,_,!0,{location:ee},j,$);return $&&t2.document&&(t2.document.addEventListener("readystatechange",()=>{["interactive","complete"].includes(t2.document.readyState)&&et.sendAutoFinishSignal()}),["interactive","complete"].includes(t2.document.readyState)&&et.sendAutoFinishSignal()),et.registerBeforeFinishCallback(n=>{d(),addPerformanceEntries(n)}),et}return{name:"BrowserTracing",setupOnce:()=>{},afterAllSetup(n){let d;let m=n.getOptions(),{markBackgroundSpan:g,traceFetch:_,traceXHR:j,shouldCreateSpanForRequest:$,enableHTTPTimings:z,_experiments:ee}=u,et=m&&m.tracePropagationTargets,en=et||u.tracePropagationTargets;t1&&l&&et&&eN.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 eo=t2.location&&t2.location.href;if(n.on&&(n.on("startNavigationSpan",n=>{d&&(t1&&eN.kg.log(`[Tracing] Finishing current transaction with op: ${(0,tW.XU)(d).op}`),d.end()),d=_createRouteTransaction({op:"navigation",...n})}),n.on("startPageLoadSpan",n=>{d&&(t1&&eN.kg.log(`[Tracing] Finishing current transaction with op: ${(0,tW.XU)(d).op}`),d.end()),d=_createRouteTransaction({op:"pageload",...n})})),u.instrumentPageLoad&&n.emit&&t2.location){let l={name:t2.location.pathname,startTimestamp:tx.Z1?tx.Z1/1e3:void 0,origin:"auto.pageload.browser",attributes:{[tq]:"url"}};startBrowserTracingPageLoadSpan(n,l)}u.instrumentNavigation&&n.emit&&t2.location&&addHistoryInstrumentationHandler(({to:l,from:u})=>{if(void 0===u&&eo&&-1!==eo.indexOf(l)){eo=void 0;return}if(u!==l){eo=void 0;let l={name:t2.location.pathname,origin:"auto.navigation.browser",attributes:{[tq]:"url"}};startBrowserTracingNavigationSpan(n,l)}}),g&&registerBackgroundTabDetection(),ee.enableInteractions&&function(n,l){let u;let registerInteractionTransaction=()=>{let{idleTimeout:d,finalTimeout:h,heartbeatInterval:f}=n,m="ui.action.click",g=getActiveTransaction();if(g&&g.op&&["navigation","pageload"].includes(g.op)){t1&&eN.kg.warn(`[Tracing] Did not create ${m} transaction because a pageload or navigation transaction is in progress.`);return}if(u&&(u.setFinishReason("interactionInterrupted"),u.end(),u=void 0),!l.name){t1&&eN.kg.warn(`[Tracing] Did not create ${m} transaction because _latestRouteName is missing.`);return}let{location:_}=t2,j={name:l.name,op:m,trimEnd:!0,data:{[tq]:l.context?function(n){let l=n.attributes&&n.attributes[tq],u=n.data&&n.data[tq],d=n.metadata&&n.metadata.source;return l||u||d}(l.context):"url"}};u=startIdleTransaction((0,eL.Gd)(),j,d,h,!0,{location:_},f)};["click"].forEach(n=>{t2.document&&addEventListener(n,registerInteractionTransaction,{once:!1,capture:!0})})}(u,f),u.enableInp&&function(n,l){let handleEntries=({entries:u})=>{let d=(0,ex.s3)(),h=void 0!==d&&void 0!==d.getIntegrationByName?d.getIntegrationByName("Replay"):void 0,f=void 0!==h?h.getReplayId():void 0,m=getActiveTransaction(),g=(0,ex.nZ)(),_=void 0!==g?g.getUser():void 0;u.forEach(u=>{if("duration"in u){let d=u.interactionId;if(void 0===d)return;let h=n[d],g=u.duration,j=u.startTime,$=Object.keys(n),z=$.length>0?$.reduce((l,u)=>n[l].duration<n[u].duration?l:u):void 0;if("first-input"===u.entryType){let l=$.map(l=>n[l]).some(n=>n.duration===g&&n.startTime===j);if(l)return}if(d){if(h)h.duration=Math.max(h.duration,g);else if($.length<10||void 0===z||g>n[z].duration){let u=l.name,h=l.context;u&&h&&(z&&Object.keys(n).length>=10&&delete n[z],n[d]={routeName:u,duration:g,parentContext:h,user:_,activeTransaction:m,replayId:f,startTime:j})}}}})};addPerformanceInstrumentationHandler("event",handleEntries),addPerformanceInstrumentationHandler("first-input",handleEntries)}(h,f),instrumentOutgoingRequests({traceFetch:_,traceXHR:j,tracePropagationTargets:en,shouldCreateSpanForRequest:$,enableHTTPTimings:z})},options:u}};function startBrowserTracingPageLoadSpan(n,l){if(!n.emit)return;n.emit("startPageLoadSpan",l);let u=trace_getActiveSpan(),d=u&&(0,tW.XU)(u).op;return"pageload"===d?u:void 0}function startBrowserTracingNavigationSpan(n,l){if(!n.emit)return;n.emit("startNavigationSpan",l);let u=trace_getActiveSpan(),d=u&&(0,tW.XU)(u).op;return"navigation"===d?u:void 0}function browserTracingIntegration_getMetaContent(n){let l=(0,e9.qT)(`meta[name=${n}]`);return l?l.getAttribute("content"):void 0}let rh={"routing.instrumentation":"next-app-router"};var rp=u(5632),rf=u.n(rp),rm=u(16331);let rg={"routing.instrumentation":"next-pages-router"},r_=(0,ex.s3)();function nextRouterInstrumentation(n,l=!0,u=!0,d,h){let f=!eJ.document.getElementById("__NEXT_DATA__");f?function(n,l=!0,u=!0,d,h){let f;let m=eJ.location.pathname;if(l){let l={name:m,op:"pageload",origin:"auto.pageload.nextjs.app_router_instrumentation",tags:rh,startTimestamp:tx.Z1?tx.Z1/1e3:void 0,metadata:{source:"url"}};f=n(l),d(l)}u&&addFetchInstrumentationHandler(l=>{if(void 0!==l.endTimestamp||"GET"!==l.fetchData.method)return;let u=function(n){if(!n[0]||"object"!=typeof n[0]||void 0===n[0].searchParams||!n[1]||"object"!=typeof n[1]||!("headers"in n[1]))return null;try{let l=n[0],u=n[1].headers;if("1"!==u.RSC||"1"===u["Next-Router-Prefetch"])return null;return{targetPathname:l.pathname}}catch(n){return null}}(l.args);if(null===u)return;let d=u.targetPathname,g={...rh,from:m};m=d,f&&f.end();let _={name:d,op:"navigation",origin:"auto.navigation.nextjs.app_router_instrumentation",tags:g,metadata:{source:"url"}};n(_),h(_)})}(n,l,u,d||(()=>void 0),h||(()=>void 0)):function(n,l=!0,u=!0,d,h){let{route:f,params:m,sentryTrace:g,baggage:_}=function(){let n;let l=eJ.document.getElementById("__NEXT_DATA__");if(l&&l.innerHTML)try{n=JSON.parse(l.innerHTML)}catch(n){rm.X&&eN.kg.warn("Could not extract __NEXT_DATA__")}if(!n)return{};let u={},{page:d,query:h,props:f}=n;return u.route=d,u.params=h,f&&f.pageProps&&(u.sentryTrace=f.pageProps._sentryTraceData,u.baggage=f.pageProps._sentryBaggage),u}(),{traceparentData:j,dynamicSamplingContext:$,propagationContext:z}=(0,t0.KA)(g,_);if((0,ex.nZ)().setPropagationContext(z),e_=f||eJ.location.pathname,l){let l={name:e_,op:"pageload",origin:"auto.pageload.nextjs.pages_router_instrumentation",tags:rg,startTimestamp:tx.Z1?tx.Z1/1e3:void 0,...m&&r_&&r_.getOptions().sendDefaultPii&&{data:m},...j,metadata:{source:f?"route":"url",dynamicSamplingContext:j&&!$?{}:$}};eg=n(l),d(l)}u&&rf().events.on("routeChangeStart",l=>{let u,d;let f=l.split(/[\?#]/,1)[0],m=function(n){let l=(eJ.__BUILD_MANIFEST||{}).sortedPages;if(l)return l.find(l=>{let u=function(n){let l=n.split("/"),u="";l[l.length-1].match(/^\[\[\.\.\..+\]\]$/)&&(l.pop(),u="(?:/(.+?))?");let d=l.map(n=>n.replace(/^\[\.\.\..+\]$/,"(.+?)").replace(/^\[.*\]$/,"([^/]+?)")).join("/");return RegExp(`^${d}${u}(?:/)?$`)}(l);return n.match(u)})}(f);m?(u=m,d="route"):(u=f,d="url");let g={...rg,from:e_};e_=u,eg&&eg.end();let _={name:u,op:"navigation",origin:"auto.navigation.nextjs.pages_router_instrumentation",tags:g,metadata:{source:d}},j=n(_);if(h(_),j){let n=j.startChild({op:"ui.nextjs.route-change",origin:"auto.ui.nextjs.pages_router_instrumentation",description:"Next.js Route Change"}),finishRouteChangeSpan=()=>{n.end(),rf().events.off("routeChangeComplete",finishRouteChangeSpan)};rf().events.on("routeChangeComplete",finishRouteChangeSpan)}})}(n,l,u,d||(()=>void 0),h||(()=>void 0))}let BrowserTracing=class BrowserTracing extends browsertracing_BrowserTracing{constructor(n){super({tracingOrigins:[...rl.tracingOrigins,/^(api\/)/],routingInstrumentation:nextRouterInstrumentation,...n})}};function browserTracingIntegration_browserTracingIntegration(n){let l=browserTracingIntegration({tracingOrigins:[...rl.tracingOrigins,/^(api\/)/],...n,instrumentNavigation:!1,instrumentPageLoad:!1}),u={...l.options,instrumentPageLoad:!0,instrumentNavigation:!0,...n};return{...l,options:u,afterAllSetup(n){let startPageloadCallback=l=>{startBrowserTracingPageLoadSpan(n,l)},startNavigationCallback=l=>{startBrowserTracingNavigationSpan(n,l)};nextRouterInstrumentation(()=>void 0,!1,u.instrumentNavigation,startPageloadCallback,startNavigationCallback),l.afterAllSetup(n),nextRouterInstrumentation(()=>void 0,u.instrumentPageLoad,!1,startPageloadCallback,startNavigationCallback)}}}function _optionalChain(n){let l;let u=n[0],d=1;for(;d<n.length;){let h=n[d],f=n[d+1];if(d+=2,("optionalAccess"===h||"optionalCall"===h)&&null==u)return;"access"===h||"optionalAccess"===h?(l=u,u=f(u)):("call"===h||"optionalCall"===h)&&(u=f((...n)=>u.call(l,...n)),l=void 0)}return u}let ry=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function resolve(...n){let l="",u=!1;for(let d=n.length-1;d>=-1&&!u;d--){let h=d>=0?n[d]:"/";h&&(l=`${h}/${l}`,u="/"===h.charAt(0))}return l=(function(n,l){let u=0;for(let l=n.length-1;l>=0;l--){let d=n[l];"."===d?n.splice(l,1):".."===d?(n.splice(l,1),u++):u&&(n.splice(l,1),u--)}if(l)for(;u--;u)n.unshift("..");return n})(l.split("/").filter(n=>!!n),!u).join("/"),(u?"/":"")+l||"."}function trim(n){let l=0;for(;l<n.length&&""===n[l];l++);let u=n.length-1;for(;u>=0&&""===n[u];u--);return l>u?[]:n.slice(l,u-l+1)}let rv="RewriteFrames",rewriteFramesIntegration=(n={})=>{let l=n.root,u=n.prefix||"app:///",d=n.iteratee||(n=>{if(!n.filename)return n;let d=/^[a-zA-Z]:\\/.test(n.filename)||n.filename.includes("\\")&&!n.filename.includes("/"),h=/^\//.test(n.filename);if(d||h){var f;let h;let m=d?n.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):n.filename,g=l?function(n,l){n=resolve(n).slice(1),l=resolve(l).slice(1);let u=trim(n.split("/")),d=trim(l.split("/")),h=Math.min(u.length,d.length),f=h;for(let n=0;n<h;n++)if(u[n]!==d[n]){f=n;break}let m=[];for(let n=f;n<u.length;n++)m.push("..");return(m=m.concat(d.slice(f))).join("/")}(l,m):(h=function(n){let l=n.length>1024?`<truncated>${n.slice(-1024)}`:n,u=ry.exec(l);return u?u.slice(1):[]}(m)[2],f&&h.slice(-1*f.length)===f&&(h=h.slice(0,h.length-f.length)),h);n.filename=`${u}${g}`}return n});return{name:rv,setupOnce(){},processEvent(n){let l=n;return n.exception&&Array.isArray(n.exception.values)&&(l=function(n){try{return{...n,exception:{...n.exception,values:n.exception.values.map(n=>{var l;return{...n,...n.stacktrace&&{stacktrace:{...l=n.stacktrace,frames:l&&l.frames&&l.frames.map(n=>d(n))}}}})}}}catch(l){return n}}(l)),l}}};convertIntegrationFnToClass(rv,rewriteFramesIntegration);let rb=eQ.GLOBAL_OBJ,rewriteFramesIntegration_rewriteFramesIntegration=n=>{let l=rb.__rewriteFramesAssetPrefixPath__||"";return rewriteFramesIntegration({iteratee:n=>{try{let{origin:u}=new URL(n.filename);n.filename=_optionalChain([n,"access",n=>n.filename,"optionalAccess",n=>n.replace,"call",n=>n(u,"app://"),"access",n=>n.replace,"call",n=>n(l,"")])}catch(n){}return n.filename&&n.filename.startsWith("app:///_next")&&(n.filename=decodeURI(n.filename)),n.filename&&n.filename.match(/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/)&&(n.in_app=!1),n},...n})},rE=eQ.GLOBAL_OBJ;function maybeUpdateBrowserTracingIntegration(n){let l=n.find(n=>"BrowserTracing"===n.name);if(!l)return n;if(l.afterAllSetup&&l.options){let{options:u}=l;n[n.indexOf(l)]=browserTracingIntegration_browserTracingIntegration(u)}if(!(l instanceof BrowserTracing)){let u=l.options;delete u.routingInstrumentation,delete u.tracingOrigins,n[n.indexOf(l)]=new BrowserTracing(u)}return n}function removeTrailingSlash(n){return"/"===n[n.length-1]?n.slice(0,-1):n}({...tT});var rS=u(37392);function isBrowser(){return"undefined"!=typeof window&&(!(0,rS.KV)()||void 0!==eQ.GLOBAL_OBJ.process&&"renderer"===eQ.GLOBAL_OBJ.process.type)}let rw=eQ.GLOBAL_OBJ,rT="sentryReplaySession",rI="Unable to send Replay";function _optionalChain$5(n){let l;let u=n[0],d=1;for(;d<n.length;){let h=n[d],f=n[d+1];if(d+=2,("optionalAccess"===h||"optionalCall"===h)&&null==u)return;"access"===h||"optionalAccess"===h?(l=u,u=f(u)):("call"===h||"optionalCall"===h)&&(u=f((...n)=>u.call(l,...n)),l=void 0)}return u}function isShadowRoot(n){let l=_optionalChain$5([n,"optionalAccess",n=>n.host]);return _optionalChain$5([l,"optionalAccess",n=>n.shadowRoot])===n}function isNativeShadowDom(n){return"[object ShadowRoot]"===Object.prototype.toString.call(n)}function stringifyStylesheet(n){try{var l;let u=n.rules||n.cssRules;return u?((l=Array.from(u,stringifyRule).join("")).includes(" background-clip: text;")&&!l.includes(" -webkit-background-clip: text;")&&(l=l.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),l):null}catch(n){return null}}function stringifyRule(n){let l;if("styleSheet"in n)try{l=stringifyStylesheet(n.styleSheet)||function(n){let{cssText:l}=n;if(l.split('"').length<3)return l;let u=["@import",`url(${JSON.stringify(n.href)})`];return""===n.layerName?u.push("layer"):n.layerName&&u.push(`layer(${n.layerName})`),n.supportsText&&u.push(`supports(${n.supportsText})`),n.media.length&&u.push(n.media.mediaText),u.join(" ")+";"}(n)}catch(n){}else if("selectorText"in n&&n.selectorText.includes(":"))return n.cssText.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2");return l||n.cssText}(ev=eP||(eP={}))[ev.Document=0]="Document",ev[ev.DocumentType=1]="DocumentType",ev[ev.Element=2]="Element",ev[ev.Text=3]="Text",ev[ev.CDATA=4]="CDATA",ev[ev.Comment=5]="Comment";let Mirror=class Mirror{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(n){if(!n)return -1;let l=_optionalChain$5([this,"access",n=>n.getMeta,"call",l=>l(n),"optionalAccess",n=>n.id]);return()=>-1,null!=l?l:-1}getNode(n){return this.idNodeMap.get(n)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(n){return this.nodeMetaMap.get(n)||null}removeNodeFromMap(n){let l=this.getId(n);this.idNodeMap.delete(l),n.childNodes&&n.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(n){return this.idNodeMap.has(n)}hasNode(n){return this.nodeMetaMap.has(n)}add(n,l){let u=l.id;this.idNodeMap.set(u,n),this.nodeMetaMap.set(n,l)}replace(n,l){let u=this.getNode(n);if(u){let n=this.nodeMetaMap.get(u);n&&this.nodeMetaMap.set(l,n)}this.idNodeMap.set(n,l)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function shouldMaskInput({maskInputOptions:n,tagName:l,type:u}){return"OPTION"===l&&(l="SELECT"),!!(n[l.toLowerCase()]||u&&n[u]||"password"===u||"INPUT"===l&&!u&&n.text)}function maskInputValue({isMasked:n,element:l,value:u,maskInputFn:d}){let h=u||"";return n?(d&&(h=d(h,l)),"*".repeat(h.length)):h}function toLowerCase(n){return n.toLowerCase()}function toUpperCase(n){return n.toUpperCase()}let rR="__rrweb_original__";function getInputType(n){let l=n.type;return n.hasAttribute("data-rr-is-password")?"password":l?toLowerCase(l):null}function getInputValue(n,l,u){return"INPUT"===l&&("radio"===u||"checkbox"===u)?n.getAttribute("value")||"":n.value}let rP=1,rA=RegExp("[^a-z0-9-_:]");function genId(){return rP++}let rO=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,rC=/^(?:[a-z+]+:)?\/\//i,rk=/^www\..*/i,rx=/^(data:)([^,]*),(.*)/i;function absoluteToStylesheet(n,l){return(n||"").replace(rO,(n,u,d,h,f,m)=>{let g=d||f||m,_=u||h||"";if(!g)return n;if(rC.test(g)||rk.test(g)||rx.test(g))return`url(${_}${g}${_})`;if("/"===g[0])return`url(${_}${(l.indexOf("//")>-1?l.split("/").slice(0,3).join("/"):l.split("/")[0]).split("?")[0]+g}${_})`;let j=l.split("/"),$=g.split("/");for(let n of(j.pop(),$))"."!==n&&(".."===n?j.pop():j.push(n));return`url(${_}${j.join("/")}${_})`})}let rM=/^[^ \t\n\r\u000c]+/,rD=/^[, \t\n\r\u000c]+/;function absoluteToDoc(n,l){if(!l||""===l.trim())return l;let u=n.createElement("a");return u.href=l,u.href}function getHref(){let n=document.createElement("a");return n.href="",n.href}function transformAttribute(n,l,u,d,h,f){return d?"src"!==u&&("href"!==u||"use"===l&&"#"===d[0])&&("xlink:href"!==u||"#"===d[0])&&("background"!==u||"table"!==l&&"td"!==l&&"th"!==l)?"srcset"===u?function(n,l){if(""===l.trim())return l;let u=0;function collectCharacters(n){let d;let h=n.exec(l.substring(u));return h?(d=h[0],u+=d.length,d):""}let d=[];for(;collectCharacters(rD),!(u>=l.length);){let h=collectCharacters(rM);if(","===h.slice(-1))h=absoluteToDoc(n,h.substring(0,h.length-1)),d.push(h);else{let f="";h=absoluteToDoc(n,h);let m=!1;for(;;){let n=l.charAt(u);if(""===n){d.push((h+f).trim());break}if(m)")"===n&&(m=!1);else{if(","===n){u+=1,d.push((h+f).trim());break}"("===n&&(m=!0)}f+=n,u+=1}}}return d.join(", ")}(n,d):"style"===u?absoluteToStylesheet(d,getHref()):"object"===l&&"data"===u?absoluteToDoc(n,d):"function"==typeof f?f(u,d,h):d:absoluteToDoc(n,d):d}function ignoreAttribute(n,l,u){return("video"===n||"audio"===n)&&"autoplay"===l}function distanceToMatch(n,l,u=1/0,d=0){return!n||n.nodeType!==n.ELEMENT_NODE||d>u?-1:l(n)?d:distanceToMatch(n.parentNode,l,u,d+1)}function createMatchPredicate(n,l){return u=>{if(null===u)return!1;try{if(n){if("string"==typeof n){if(u.matches(`.${n}`))return!0}else if(function(n,l){for(let u=n.classList.length;u--;){let d=n.classList[u];if(l.test(d))return!0}return!1}(u,n))return!0}if(l&&u.matches(l))return!0;return!1}catch(n){return!1}}}function needMaskingText(n,l,u,d,h,f){try{let m=n.nodeType===n.ELEMENT_NODE?n:n.parentElement;if(null===m)return!1;if("INPUT"===m.tagName){let n=m.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(n))return!0}let g=-1,_=-1;if(f){if((_=distanceToMatch(m,createMatchPredicate(d,h)))<0)return!0;g=distanceToMatch(m,createMatchPredicate(l,u),_>=0?_:1/0)}else{if((g=distanceToMatch(m,createMatchPredicate(l,u)))<0)return!1;_=distanceToMatch(m,createMatchPredicate(d,h),g>=0?g:1/0)}return g>=0?!(_>=0)||g<=_:!(_>=0)&&!!f}catch(n){}return!!f}function lowerIfExists(n){return null==n?"":n.toLowerCase()}function serializeNodeWithId(n,l){let u;let{doc:d,mirror:h,blockClass:f,blockSelector:m,unblockSelector:g,maskAllText:_,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,skipChild:et=!1,inlineStylesheet:en=!0,maskInputOptions:eo={},maskAttributeFn:es,maskTextFn:ec,maskInputFn:eh,slimDOMOptions:ep,dataURLOptions:ef={},inlineImages:em=!1,recordCanvas:eg=!1,onSerialize:e_,onIframeLoad:ey,iframeLoadTimeout:ev=5e3,onStylesheetLoad:eE,stylesheetLoadTimeout:eS=5e3,keepIframeSrcFn:ew=()=>!1,newlyAddedElement:eT=!1}=l,{preserveWhiteSpace:eI=!0}=l,eR=function(n,l){let{doc:u,mirror:d,blockClass:h,blockSelector:f,unblockSelector:m,maskAllText:g,maskAttributeFn:_,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,inlineStylesheet:et,maskInputOptions:en={},maskTextFn:eo,maskInputFn:es,dataURLOptions:ec={},inlineImages:eh,recordCanvas:ep,keepIframeSrcFn:ef,newlyAddedElement:em=!1}=l,eg=function(n,l){if(!l.hasNode(n))return;let u=l.getId(n);return 1===u?void 0:u}(u,d);switch(n.nodeType){case n.DOCUMENT_NODE:if("CSS1Compat"!==n.compatMode)return{type:eP.Document,childNodes:[],compatMode:n.compatMode};return{type:eP.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:eP.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:eg};case n.ELEMENT_NODE:return function(n,l){let u;let{doc:d,blockClass:h,blockSelector:f,unblockSelector:m,inlineStylesheet:g,maskInputOptions:_={},maskAttributeFn:j,maskInputFn:$,dataURLOptions:z={},inlineImages:ee,recordCanvas:et,keepIframeSrcFn:en,newlyAddedElement:eo=!1,rootId:es,maskAllText:ec,maskTextClass:eh,unmaskTextClass:ep,maskTextSelector:ef,unmaskTextSelector:em}=l,eg=function(n,l,u,d){try{if(d&&n.matches(d))return!1;if("string"==typeof l){if(n.classList.contains(l))return!0}else for(let u=n.classList.length;u--;){let d=n.classList[u];if(l.test(d))return!0}if(u)return n.matches(u)}catch(n){}return!1}(n,h,f,m),e_=function(n){if(n instanceof HTMLFormElement)return"form";let l=toLowerCase(n.tagName);return rA.test(l)?"div":l}(n),ey={},ev=n.attributes.length;for(let l=0;l<ev;l++){let u=n.attributes[l];u.name&&!ignoreAttribute(e_,u.name,u.value)&&(ey[u.name]=transformAttribute(d,e_,toLowerCase(u.name),u.value,n,j))}if("link"===e_&&g){let l=Array.from(d.styleSheets).find(l=>l.href===n.href),u=null;l&&(u=stringifyStylesheet(l)),u&&(delete ey.rel,delete ey.href,ey._cssText=absoluteToStylesheet(u,l.href))}if("style"===e_&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){let l=stringifyStylesheet(n.sheet);l&&(ey._cssText=absoluteToStylesheet(l,getHref()))}if("input"===e_||"textarea"===e_||"select"===e_||"option"===e_){let l=getInputType(n),u=getInputValue(n,toUpperCase(e_),l),d=n.checked;if("submit"!==l&&"button"!==l&&u){let d=needMaskingText(n,eh,ef,ep,em,shouldMaskInput({type:l,tagName:toUpperCase(e_),maskInputOptions:_}));ey.value=maskInputValue({isMasked:d,element:n,value:u,maskInputFn:$})}d&&(ey.checked=d)}if("option"===e_&&(n.selected&&!_.select?ey.selected=!0:delete ey.selected),"canvas"===e_&&et){if("2d"===n.__context)!function(n){let l=n.getContext("2d");if(!l)return!0;for(let u=0;u<n.width;u+=50)for(let d=0;d<n.height;d+=50){let h=l.getImageData,f=rR in h?h[rR]:h,m=new Uint32Array(f.call(l,u,d,Math.min(50,n.width-u),Math.min(50,n.height-d)).data.buffer);if(m.some(n=>0!==n))return!1}return!0}(n)&&(ey.rr_dataURL=n.toDataURL(z.type,z.quality));else if(!("__context"in n)){let l=n.toDataURL(z.type,z.quality),u=document.createElement("canvas");u.width=n.width,u.height=n.height;let d=u.toDataURL(z.type,z.quality);l!==d&&(ey.rr_dataURL=l)}}if("img"===e_&&ee){el||(eu=(el=d.createElement("canvas")).getContext("2d"));let l=n.crossOrigin;n.crossOrigin="anonymous";let recordInlineImage=()=>{n.removeEventListener("load",recordInlineImage);try{el.width=n.naturalWidth,el.height=n.naturalHeight,eu.drawImage(n,0,0),ey.rr_dataURL=el.toDataURL(z.type,z.quality)}catch(l){console.warn(`Cannot inline img src=${n.currentSrc}! Error: ${l}`)}l?ey.crossOrigin=l:n.removeAttribute("crossorigin")};n.complete&&0!==n.naturalWidth?recordInlineImage():n.addEventListener("load",recordInlineImage)}if(("audio"===e_||"video"===e_)&&(ey.rr_mediaState=n.paused?"paused":"played",ey.rr_mediaCurrentTime=n.currentTime),!eo&&(n.scrollLeft&&(ey.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(ey.rr_scrollTop=n.scrollTop)),eg){let{width:l,height:u}=n.getBoundingClientRect();ey={class:ey.class,rr_width:`${l}px`,rr_height:`${u}px`}}"iframe"!==e_||en(ey.src)||(n.contentDocument||(ey.rr_src=ey.src),delete ey.src);try{customElements.get(e_)&&(u=!0)}catch(n){}return{type:eP.Element,tagName:e_,attributes:ey,childNodes:[],isSVG:!!("svg"===n.tagName||n.ownerSVGElement)||void 0,needBlock:eg,rootId:es,isCustom:u}}(n,{doc:u,blockClass:h,blockSelector:f,unblockSelector:m,inlineStylesheet:et,maskAttributeFn:_,maskInputOptions:en,maskInputFn:es,dataURLOptions:ec,inlineImages:eh,recordCanvas:ep,keepIframeSrcFn:ef,newlyAddedElement:em,rootId:eg,maskAllText:g,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee});case n.TEXT_NODE:return function(n,l){let{maskAllText:u,maskTextClass:d,unmaskTextClass:h,maskTextSelector:f,unmaskTextSelector:m,maskTextFn:g,maskInputOptions:_,maskInputFn:j,rootId:$}=l,z=n.parentNode&&n.parentNode.tagName,ee=n.textContent,et="STYLE"===z||void 0,en="SCRIPT"===z||void 0,eo="TEXTAREA"===z||void 0;if(et&&ee){try{n.nextSibling||n.previousSibling||_optionalChain$5([n,"access",n=>n.parentNode,"access",n=>n.sheet,"optionalAccess",n=>n.cssRules])&&(ee=stringifyStylesheet(n.parentNode.sheet))}catch(l){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${l}`,n)}ee=absoluteToStylesheet(ee,getHref())}en&&(ee="SCRIPT_PLACEHOLDER");let es=needMaskingText(n,d,f,h,m,u);if(et||en||eo||!ee||!es||(ee=g?g(ee,n.parentElement):ee.replace(/[\S]/g,"*")),eo&&ee&&(_.textarea||es)&&(ee=j?j(ee,n.parentNode):ee.replace(/[\S]/g,"*")),"OPTION"===z&&ee){let l=shouldMaskInput({type:null,tagName:z,maskInputOptions:_});ee=maskInputValue({isMasked:needMaskingText(n,d,f,h,m,l),element:n,value:ee,maskInputFn:j})}return{type:eP.Text,textContent:ee||"",isStyle:et,rootId:$}}(n,{maskAllText:g,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,maskTextFn:eo,maskInputOptions:en,maskInputFn:es,rootId:eg});case n.CDATA_SECTION_NODE:return{type:eP.CDATA,textContent:"",rootId:eg};case n.COMMENT_NODE:return{type:eP.Comment,textContent:n.textContent||"",rootId:eg};default:return!1}}(n,{doc:d,mirror:h,blockClass:f,blockSelector:m,maskAllText:_,unblockSelector:g,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,inlineStylesheet:en,maskInputOptions:eo,maskAttributeFn:es,maskTextFn:ec,maskInputFn:eh,dataURLOptions:ef,inlineImages:em,recordCanvas:eg,keepIframeSrcFn:ew,newlyAddedElement:eT});if(!eR)return console.warn(n,"not serialized"),null;u=h.hasNode(n)?h.getId(n):!function(n,l){if(l.comment&&n.type===eP.Comment)return!0;if(n.type===eP.Element){if(l.script&&("script"===n.tagName||"link"===n.tagName&&("preload"===n.attributes.rel||"modulepreload"===n.attributes.rel)&&"script"===n.attributes.as||"link"===n.tagName&&"prefetch"===n.attributes.rel&&"string"==typeof n.attributes.href&&n.attributes.href.endsWith(".js"))||l.headFavicon&&("link"===n.tagName&&"shortcut icon"===n.attributes.rel||"meta"===n.tagName&&(lowerIfExists(n.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===lowerIfExists(n.attributes.name)||"icon"===lowerIfExists(n.attributes.rel)||"apple-touch-icon"===lowerIfExists(n.attributes.rel)||"shortcut icon"===lowerIfExists(n.attributes.rel))))return!0;if("meta"===n.tagName){if(l.headMetaDescKeywords&&lowerIfExists(n.attributes.name).match(/^description|keywords$/)||l.headMetaSocial&&(lowerIfExists(n.attributes.property).match(/^(og|twitter|fb):/)||lowerIfExists(n.attributes.name).match(/^(og|twitter):/)||"pinterest"===lowerIfExists(n.attributes.name)))return!0;if(l.headMetaRobots&&("robots"===lowerIfExists(n.attributes.name)||"googlebot"===lowerIfExists(n.attributes.name)||"bingbot"===lowerIfExists(n.attributes.name)))return!0;if(l.headMetaHttpEquiv&&void 0!==n.attributes["http-equiv"])return!0;else if(l.headMetaAuthorship&&("author"===lowerIfExists(n.attributes.name)||"generator"===lowerIfExists(n.attributes.name)||"framework"===lowerIfExists(n.attributes.name)||"publisher"===lowerIfExists(n.attributes.name)||"progid"===lowerIfExists(n.attributes.name)||lowerIfExists(n.attributes.property).match(/^article:/)||lowerIfExists(n.attributes.property).match(/^product:/)))return!0;else if(l.headMetaVerification&&("google-site-verification"===lowerIfExists(n.attributes.name)||"yandex-verification"===lowerIfExists(n.attributes.name)||"csrf-token"===lowerIfExists(n.attributes.name)||"p:domain_verify"===lowerIfExists(n.attributes.name)||"verify-v1"===lowerIfExists(n.attributes.name)||"verification"===lowerIfExists(n.attributes.name)||"shopify-checkout-api-token"===lowerIfExists(n.attributes.name)))return!0}}return!1}(eR,ep)&&(eI||eR.type!==eP.Text||eR.isStyle||eR.textContent.replace(/^\s+|\s+$/gm,"").length)?genId():-2;let eA=Object.assign(eR,{id:u});if(h.add(n,eA),-2===u)return null;e_&&e_(n);let eO=!et;if(eA.type===eP.Element){eO=eO&&!eA.needBlock,delete eA.needBlock;let l=n.shadowRoot;l&&isNativeShadowDom(l)&&(eA.isShadowHost=!0)}if((eA.type===eP.Document||eA.type===eP.Element)&&eO){ep.headWhitespace&&eA.type===eP.Element&&"head"===eA.tagName&&(eI=!1);let l={doc:d,mirror:h,blockClass:f,blockSelector:m,maskAllText:_,unblockSelector:g,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,skipChild:et,inlineStylesheet:en,maskInputOptions:eo,maskAttributeFn:es,maskTextFn:ec,maskInputFn:eh,slimDOMOptions:ep,dataURLOptions:ef,inlineImages:em,recordCanvas:eg,preserveWhiteSpace:eI,onSerialize:e_,onIframeLoad:ey,iframeLoadTimeout:ev,onStylesheetLoad:eE,stylesheetLoadTimeout:eS,keepIframeSrcFn:ew};for(let u of Array.from(n.childNodes)){let n=serializeNodeWithId(u,l);n&&eA.childNodes.push(n)}if(n.nodeType===n.ELEMENT_NODE&&n.shadowRoot)for(let u of Array.from(n.shadowRoot.childNodes)){let d=serializeNodeWithId(u,l);d&&(isNativeShadowDom(n.shadowRoot)&&(d.isShadow=!0),eA.childNodes.push(d))}}return n.parentNode&&isShadowRoot(n.parentNode)&&isNativeShadowDom(n.parentNode)&&(eA.isShadow=!0),eA.type===eP.Element&&"iframe"===eA.tagName&&function(n,l,u){let d;let h=n.contentWindow;if(!h)return;let f=!1;try{d=h.document.readyState}catch(n){return}if("complete"!==d){let d=setTimeout(()=>{f||(l(),f=!0)},u);n.addEventListener("load",()=>{clearTimeout(d),f=!0,l()});return}let m="about:blank";if(h.location.href!==m||n.src===m||""===n.src)return setTimeout(l,0),n.addEventListener("load",l);n.addEventListener("load",l)}(n,()=>{let l=n.contentDocument;if(l&&ey){let u=serializeNodeWithId(l,{doc:l,mirror:h,blockClass:f,blockSelector:m,unblockSelector:g,maskAllText:_,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,skipChild:!1,inlineStylesheet:en,maskInputOptions:eo,maskAttributeFn:es,maskTextFn:ec,maskInputFn:eh,slimDOMOptions:ep,dataURLOptions:ef,inlineImages:em,recordCanvas:eg,preserveWhiteSpace:eI,onSerialize:e_,onIframeLoad:ey,iframeLoadTimeout:ev,onStylesheetLoad:eE,stylesheetLoadTimeout:eS,keepIframeSrcFn:ew});u&&ey(n,u)}},ev),eA.type===eP.Element&&"link"===eA.tagName&&"stylesheet"===eA.attributes.rel&&function(n,l,u){let d,h=!1;try{d=n.sheet}catch(n){return}if(d)return;let f=setTimeout(()=>{h||(l(),h=!0)},u);n.addEventListener("load",()=>{clearTimeout(f),h=!0,l()})}(n,()=>{if(eE){let l=serializeNodeWithId(n,{doc:d,mirror:h,blockClass:f,blockSelector:m,unblockSelector:g,maskAllText:_,maskTextClass:j,unmaskTextClass:$,maskTextSelector:z,unmaskTextSelector:ee,skipChild:!1,inlineStylesheet:en,maskInputOptions:eo,maskAttributeFn:es,maskTextFn:ec,maskInputFn:eh,slimDOMOptions:ep,dataURLOptions:ef,inlineImages:em,recordCanvas:eg,preserveWhiteSpace:eI,onSerialize:e_,onIframeLoad:ey,iframeLoadTimeout:ev,onStylesheetLoad:eE,stylesheetLoadTimeout:eS,keepIframeSrcFn:ew});l&&eE(n,l)}},eS),eA}function _optionalChain$4(n){let l;let u=n[0],d=1;for(;d<n.length;){let h=n[d],f=n[d+1];if(d+=2,("optionalAccess"===h||"optionalCall"===h)&&null==u)return;"access"===h||"optionalAccess"===h?(l=u,u=f(u)):("call"===h||"optionalCall"===h)&&(u=f((...n)=>u.call(l,...n)),l=void 0)}return u}function on(n,l,u=document){let d={capture:!0,passive:!0};return u.addEventListener(n,l,d),()=>u.removeEventListener(n,l,d)}let rN="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.",rV={map:{},getId:()=>(console.error(rN),-1),getNode:()=>(console.error(rN),null),removeNodeFromMap(){console.error(rN)},has:()=>(console.error(rN),!1),reset(){console.error(rN)}};function throttle$1(n,l,u={}){let d=null,h=0;return function(...f){let m=Date.now();h||!1!==u.leading||(h=m);let g=l-(m-h),_=this;g<=0||g>l?(d&&(function(...n){getImplementation("clearTimeout")(...n)}(d),d=null),h=m,n.apply(_,f)):d||!1===u.trailing||(d=setTimeout$1(()=>{h=!1===u.leading?0:Date.now(),d=null,n.apply(_,f)},g))}}function patch(n,l,u){try{if(!(l in n))return()=>{};let d=n[l],h=u(d);return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:d}})),n[l]=h,()=>{n[l]=d}}catch(n){return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(rV=new Proxy(rV,{get:(n,l,u)=>("map"===l&&console.error(rN),Reflect.get(n,l,u))}));let rF=Date.now;function getWindowScroll(n){let l=n.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:void 0!==n.pageXOffset?n.pageXOffset:_optionalChain$4([l,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollLeft])||_optionalChain$4([l,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollLeft])||_optionalChain$4([l,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollLeft])||0,top:l.scrollingElement?l.scrollingElement.scrollTop:void 0!==n.pageYOffset?n.pageYOffset:_optionalChain$4([l,"optionalAccess",n=>n.documentElement,"access",n=>n.scrollTop])||_optionalChain$4([l,"optionalAccess",n=>n.body,"optionalAccess",n=>n.parentElement,"optionalAccess",n=>n.scrollTop])||_optionalChain$4([l,"optionalAccess",n=>n.body,"optionalAccess",n=>n.scrollTop])||0}}function getWindowHeight(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function getWindowWidth(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function closestElementOfNode(n){if(!n)return null;let l=n.nodeType===n.ELEMENT_NODE?n:n.parentElement;return l}function isBlocked(n,l,u,d,h){if(!n)return!1;let f=closestElementOfNode(n);if(!f)return!1;let m=createMatchPredicate(l,u);if(!h){let n=d&&f.matches(d);return m(f)&&!n}let g=distanceToMatch(f,m),_=-1;return!(g<0)&&(d&&(_=distanceToMatch(f,createMatchPredicate(null,d))),g>-1&&_<0||g<_)}function isIgnored(n,l){return -2===l.getId(n)}function legacy_isTouchEvent(n){return!!n.changedTouches}function isSerializedIframe(n,l){return!!("IFRAME"===n.nodeName&&l.getMeta(n))}function isSerializedStylesheet(n,l){return!!("LINK"===n.nodeName&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&"stylesheet"===n.getAttribute("rel")&&l.getMeta(n))}function hasShadowRoot(n){return!!_optionalChain$4([n,"optionalAccess",n=>n.shadowRoot])}/[1-9][0-9]{12}/.test(Date.now().toString())||(rF=()=>new Date().getTime());let StyleSheetMirror=class StyleSheetMirror{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(n){var l;return l=this.styleIDMap.get(n),null!=l?l:-1}has(n){return this.styleIDMap.has(n)}add(n,l){let u;return this.has(n)?this.getId(n):(u=void 0===l?this.id++:l,this.styleIDMap.set(n,u),this.idStyleMap.set(u,n),u)}getStyle(n){return this.idStyleMap.get(n)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function getShadowHost(n){let l=null;return _optionalChain$4([n,"access",n=>n.getRootNode,"optionalCall",n=>n(),"optionalAccess",n=>n.nodeType])===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(l=n.getRootNode().host),l}function inDom(n){let l=n.ownerDocument;return!!l&&(l.contains(n)||function(n){let l=n.ownerDocument;if(!l)return!1;let u=function(n){let l,u=n;for(;l=getShadowHost(u);)u=l;return u}(n);return l.contains(u)}(n))}let rL={};function getImplementation(n){let l=rL[n];if(l)return l;let u=window.document,d=window[n];if(u&&"function"==typeof u.createElement)try{let l=u.createElement("iframe");l.hidden=!0,u.head.appendChild(l);let h=l.contentWindow;h&&h[n]&&(d=h[n]),u.head.removeChild(l)}catch(n){}return rL[n]=d.bind(window)}function setTimeout$1(...n){return getImplementation("setTimeout")(...n)}var rj=((eE=rj||{})[eE.DomContentLoaded=0]="DomContentLoaded",eE[eE.Load=1]="Load",eE[eE.FullSnapshot=2]="FullSnapshot",eE[eE.IncrementalSnapshot=3]="IncrementalSnapshot",eE[eE.Meta=4]="Meta",eE[eE.Custom=5]="Custom",eE[eE.Plugin=6]="Plugin",eE),rU=((eS=rU||{})[eS.Mutation=0]="Mutation",eS[eS.MouseMove=1]="MouseMove",eS[eS.MouseInteraction=2]="MouseInteraction",eS[eS.Scroll=3]="Scroll",eS[eS.ViewportResize=4]="ViewportResize",eS[eS.Input=5]="Input",eS[eS.TouchMove=6]="TouchMove",eS[eS.MediaInteraction=7]="MediaInteraction",eS[eS.StyleSheetRule=8]="StyleSheetRule",eS[eS.CanvasMutation=9]="CanvasMutation",eS[eS.Font=10]="Font",eS[eS.Log=11]="Log",eS[eS.Drag=12]="Drag",eS[eS.StyleDeclaration=13]="StyleDeclaration",eS[eS.Selection=14]="Selection",eS[eS.AdoptedStyleSheet=15]="AdoptedStyleSheet",eS[eS.CustomElement=16]="CustomElement",eS),rB=((ew=rB||{})[ew.MouseUp=0]="MouseUp",ew[ew.MouseDown=1]="MouseDown",ew[ew.Click=2]="Click",ew[ew.ContextMenu=3]="ContextMenu",ew[ew.DblClick=4]="DblClick",ew[ew.Focus=5]="Focus",ew[ew.Blur=6]="Blur",ew[ew.TouchStart=7]="TouchStart",ew[ew.TouchMove_Departed=8]="TouchMove_Departed",ew[ew.TouchEnd=9]="TouchEnd",ew[ew.TouchCancel=10]="TouchCancel",ew),r$=((eT=r$||{})[eT.Mouse=0]="Mouse",eT[eT.Pen=1]="Pen",eT[eT.Touch=2]="Touch",eT);let DoubleLinkedList=class DoubleLinkedList{constructor(){this.length=0,this.head=null,this.tail=null}get(n){if(n>=this.length)throw Error("Position outside of list range");let l=this.head;for(let u=0;u<n;u++)l=function(n){let l;let u=n[0],d=1;for(;d<n.length;){let h=n[d],f=n[d+1];if(d+=2,("optionalAccess"===h||"optionalCall"===h)&&null==u)return;"access"===h||"optionalAccess"===h?(l=u,u=f(u)):("call"===h||"optionalCall"===h)&&(u=f((...n)=>u.call(l,...n)),l=void 0)}return u}([l,"optionalAccess",n=>n.next])||null;return l}addNode(n){let l={value:n,previous:null,next:null};if(n.__ln=l,n.previousSibling&&"__ln"in n.previousSibling){let u=n.previousSibling.__ln.next;l.next=u,l.previous=n.previousSibling.__ln,n.previousSibling.__ln.next=l,u&&(u.previous=l)}else if(n.nextSibling&&"__ln"in n.nextSibling&&n.nextSibling.__ln.previous){let u=n.nextSibling.__ln.previous;l.previous=u,l.next=n.nextSibling.__ln,n.nextSibling.__ln.previous=l,u&&(u.next=l)}else this.head&&(this.head.previous=l),l.next=this.head,this.head=l;null===l.next&&(this.tail=l),this.length++}removeNode(n){let l=n.__ln;this.head&&(l.previous?(l.previous.next=l.next,l.next?l.next.previous=l.previous:this.tail=l.previous):(this.head=l.next,this.head?this.head.previous=null:this.tail=null),n.__ln&&delete n.__ln,this.length--)}};let moveKey=(n,l)=>`${n}@${l}`;let MutationBuffer=class MutationBuffer{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=n=>{n.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;let n=[],l=new Set,u=new DoubleLinkedList,getNextId=n=>{let l=n,u=-2;for(;-2===u;)u=(l=l&&l.nextSibling)&&this.mirror.getId(l);return u},pushAdd=d=>{if(!d.parentNode||!inDom(d))return;let h=isShadowRoot(d.parentNode)?this.mirror.getId(getShadowHost(d)):this.mirror.getId(d.parentNode),f=getNextId(d);if(-1===h||-1===f)return u.addNode(d);let m=serializeNodeWithId(d,{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:n=>{isSerializedIframe(n,this.mirror)&&this.iframeManager.addIframe(n),isSerializedStylesheet(n,this.mirror)&&this.stylesheetManager.trackLinkElement(n),hasShadowRoot(d)&&this.shadowDomManager.addShadowRoot(d.shadowRoot,this.doc)},onIframeLoad:(n,l)=>{this.iframeManager.attachIframe(n,l),this.shadowDomManager.observeAttachShadow(n)},onStylesheetLoad:(n,l)=>{this.stylesheetManager.attachLinkElement(n,l)}});m&&(n.push({parentId:h,nextId:f,node:m}),l.add(m.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let n of this.movedSet)(!isParentRemoved(this.removes,n,this.mirror)||this.movedSet.has(n.parentNode))&&pushAdd(n);for(let n of this.addedSet)isAncestorInSet(this.droppedSet,n)||isParentRemoved(this.removes,n,this.mirror)?isAncestorInSet(this.movedSet,n)?pushAdd(n):this.droppedSet.add(n):pushAdd(n);let d=null;for(;u.length;){let n=null;if(d){let l=this.mirror.getId(d.value.parentNode),u=getNextId(d.value);-1!==l&&-1!==u&&(n=d)}if(!n){let l=u.tail;for(;l;){let u=l;if(l=l.previous,u){let l=this.mirror.getId(u.value.parentNode),d=getNextId(u.value);if(-1===d)continue;if(-1!==l){n=u;break}{let l=u.value;if(l.parentNode&&l.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let d=l.parentNode.host,h=this.mirror.getId(d);if(-1!==h){n=u;break}}}}}}if(!n){for(;u.head;)u.removeNode(u.head.value);break}d=n.previous,u.removeNode(n.value),pushAdd(n.value)}let h={texts:this.texts.map(n=>({id:this.mirror.getId(n.node),value:n.value})).filter(n=>!l.has(n.id)).filter(n=>this.mirror.has(n.id)),attributes:this.attributes.map(n=>{let{attributes:l}=n;if("string"==typeof l.style){let u=JSON.stringify(n.styleDiff),d=JSON.stringify(n._unchangedStyles);u.length<l.style.length&&(u+d).split("var(").length===l.style.split("var(").length&&(l.style=n.styleDiff)}return{id:this.mirror.getId(n.node),attributes:l}}).filter(n=>!l.has(n.id)).filter(n=>this.mirror.has(n.id)),removes:this.removes,adds:n};(h.texts.length||h.attributes.length||h.removes.length||h.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(h))},this.processMutation=n=>{if(!isIgnored(n.target,this.mirror))switch(n.type){case"characterData":{let l=n.target.textContent;isBlocked(n.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||l===n.oldValue||this.texts.push({value:needMaskingText(n.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&l?this.maskTextFn?this.maskTextFn(l,closestElementOfNode(n.target)):l.replace(/[\S]/g,"*"):l,node:n.target});break}case"attributes":{let l=n.target,u=n.attributeName,d=n.target.getAttribute(u);if("value"===u){let u=getInputType(l),h=l.tagName;d=getInputValue(l,h,u);let f=shouldMaskInput({maskInputOptions:this.maskInputOptions,tagName:h,type:u}),m=needMaskingText(n.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,f);d=maskInputValue({isMasked:m,element:l,value:d,maskInputFn:this.maskInputFn})}if(isBlocked(n.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||d===n.oldValue)return;let h=this.attributeMap.get(n.target);if("IFRAME"===l.tagName&&"src"===u&&!this.keepIframeSrcFn(d)){if(l.contentDocument)return;u="rr_src"}if(h||(h={node:n.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(h),this.attributeMap.set(n.target,h)),"type"===u&&"INPUT"===l.tagName&&"password"===(n.oldValue||"").toLowerCase()&&l.setAttribute("data-rr-is-password","true"),!ignoreAttribute(l.tagName,u)&&(h.attributes[u]=transformAttribute(this.doc,toLowerCase(l.tagName),toLowerCase(u),d,l,this.maskAttributeFn),"style"===u)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(n){this.unattachedDoc=this.doc}let u=this.unattachedDoc.createElement("span");for(let d of(n.oldValue&&u.setAttribute("style",n.oldValue),Array.from(l.style))){let n=l.style.getPropertyValue(d),f=l.style.getPropertyPriority(d);n!==u.style.getPropertyValue(d)||f!==u.style.getPropertyPriority(d)?""===f?h.styleDiff[d]=n:h.styleDiff[d]=[n,f]:h._unchangedStyles[d]=[n,f]}for(let n of Array.from(u.style))""===l.style.getPropertyValue(n)&&(h.styleDiff[n]=!1)}break}case"childList":if(isBlocked(n.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;n.addedNodes.forEach(l=>this.genAdds(l,n.target)),n.removedNodes.forEach(l=>{let u=this.mirror.getId(l),d=isShadowRoot(n.target)?this.mirror.getId(n.target.host):this.mirror.getId(n.target);isBlocked(n.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||isIgnored(l,this.mirror)||-1===this.mirror.getId(l)||(this.addedSet.has(l)?(deepDelete(this.addedSet,l),this.droppedSet.add(l)):this.addedSet.has(n.target)&&-1===u||function isAncestorRemoved(n,l){if(isShadowRoot(n))return!1;let u=l.getId(n);return!l.has(u)||(!n.parentNode||n.parentNode.nodeType!==n.DOCUMENT_NODE)&&(!n.parentNode||isAncestorRemoved(n.parentNode,l))}(n.target,this.mirror)||(this.movedSet.has(l)&&this.movedMap[moveKey(u,d)]?deepDelete(this.movedSet,l):this.removes.push({parentId:d,id:u,isShadow:!!(isShadowRoot(n.target)&&isNativeShadowDom(n.target))||void 0})),this.mapRemoves.push(l))})}},this.genAdds=(n,l)=>{if(!this.processedNodeManager.inOtherBuffer(n,this)&&!(this.addedSet.has(n)||this.movedSet.has(n))){if(this.mirror.hasNode(n)){if(isIgnored(n,this.mirror))return;this.movedSet.add(n);let u=null;l&&this.mirror.hasNode(l)&&(u=this.mirror.getId(l)),u&&-1!==u&&(this.movedMap[moveKey(this.mirror.getId(n),u)]=!0)}else this.addedSet.add(n),this.droppedSet.delete(n);!isBlocked(n,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&(n.childNodes.forEach(n=>this.genAdds(n)),hasShadowRoot(n)&&n.shadowRoot.childNodes.forEach(l=>{this.processedNodeManager.add(l,this),this.genAdds(l,n)}))}}}init(n){["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(l=>{this[l]=n[l]})}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 deepDelete(n,l){n.delete(l),l.childNodes.forEach(l=>deepDelete(n,l))}function isParentRemoved(n,l,u){return 0!==n.length&&function _isParentRemoved(n,l,u){let{parentNode:d}=l;if(!d)return!1;let h=u.getId(d);return!!n.some(n=>n.id===h)||_isParentRemoved(n,d,u)}(n,l,u)}function isAncestorInSet(n,l){return 0!==n.size&&function _isAncestorInSet(n,l){let{parentNode:u}=l;return!!u&&(!!n.has(u)||_isAncestorInSet(n,u))}(n,l)}let callbackWrapper=n=>ec?(...l)=>{try{return n(...l)}catch(n){if(ec&&!0===ec(n))return()=>{};throw n}}:n;function _optionalChain$2(n){let l;let u=n[0],d=1;for(;d<n.length;){let h=n[d],f=n[d+1];if(d+=2,("optionalAccess"===h||"optionalCall"===h)&&null==u)return;"access"===h||"optionalAccess"===h?(l=u,u=f(u)):("call"===h||"optionalCall"===h)&&(u=f((...n)=>u.call(l,...n)),l=void 0)}return u}let rH=[];function esm_getEventTarget(n){try{if("composedPath"in n){let l=n.composedPath();if(l.length)return l[0]}else if("path"in n&&n.path.length)return n.path[0]}catch(n){}return n&&n.target}function initMutationObserver(n,l){let u=new MutationBuffer;rH.push(u),u.init(n);let d=window.MutationObserver||window.__rrMutationObserver,h=_optionalChain$2([window,"optionalAccess",n=>n.Zone,"optionalAccess",n=>n.__symbol__,"optionalCall",n=>n("MutationObserver")]);h&&window[h]&&(d=window[h]);let f=new d(callbackWrapper(l=>{n.onMutation&&!1===n.onMutation(l)||u.processMutations.bind(u)(l)}));return f.observe(l,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),f}function initScrollObserver({scrollCb:n,doc:l,mirror:u,blockClass:d,blockSelector:h,unblockSelector:f,sampling:m}){let g=callbackWrapper(throttle$1(callbackWrapper(m=>{let g=esm_getEventTarget(m);if(!g||isBlocked(g,d,h,f,!0))return;let _=u.getId(g);if(g===l&&l.defaultView){let u=getWindowScroll(l.defaultView);n({id:_,x:u.left,y:u.top})}else n({id:_,x:g.scrollLeft,y:g.scrollTop})}),m.scroll||100));return on("scroll",g,l)}let rW=["INPUT","TEXTAREA","SELECT"],rq=new WeakMap;function getNestedCSSRulePositions(n){return function(n,l){if(hasNestedCSSRule("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||hasNestedCSSRule("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||hasNestedCSSRule("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||hasNestedCSSRule("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){let u=Array.from(n.parentRule.cssRules),d=u.indexOf(n);l.unshift(d)}else if(n.parentStyleSheet){let u=Array.from(n.parentStyleSheet.cssRules),d=u.indexOf(n);l.unshift(d)}return l}(n,[])}function getIdAndStyleId(n,l,u){let d,h;return n?(n.ownerNode?d=l.getId(n.ownerNode):h=u.getId(n),{styleId:h,id:d}):{}}function initAdoptedStyleSheetObserver({mirror:n,stylesheetManager:l},u){let d=null;d="#document"===u.nodeName?n.getId(u):n.getId(u.host);let h="#document"===u.nodeName?_optionalChain$2([u,"access",n=>n.defaultView,"optionalAccess",n=>n.Document]):_optionalChain$2([u,"access",n=>n.ownerDocument,"optionalAccess",n=>n.defaultView,"optionalAccess",n=>n.ShadowRoot]),f=_optionalChain$2([h,"optionalAccess",n=>n.prototype])?Object.getOwnPropertyDescriptor(_optionalChain$2([h,"optionalAccess",n=>n.prototype]),"adoptedStyleSheets"):void 0;return null!==d&&-1!==d&&h&&f?(Object.defineProperty(u,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get(){return _optionalChain$2([f,"access",n=>n.get,"optionalAccess",n=>n.call,"call",n=>n(this)])},set(n){let u=_optionalChain$2([f,"access",n=>n.set,"optionalAccess",n=>n.call,"call",l=>l(this,n)]);if(null!==d&&-1!==d)try{l.adoptStyleSheets(n,d)}catch(n){}return u}}),callbackWrapper(()=>{Object.defineProperty(u,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get:f.get,set:f.set})})):()=>{}}function initObservers(n,l={}){let u=n.doc.defaultView;if(!u)return()=>{};let d=initMutationObserver(n,n.doc),h=function({mousemoveCb:n,sampling:l,doc:u,mirror:d}){let h;if(!1===l.mousemove)return()=>{};let f="number"==typeof l.mousemove?l.mousemove:50,m="number"==typeof l.mousemoveCallback?l.mousemoveCallback:500,g=[],_=throttle$1(callbackWrapper(l=>{let u=Date.now()-h;n(g.map(n=>(n.timeOffset-=u,n)),l),g=[],h=null}),m),j=callbackWrapper(throttle$1(callbackWrapper(n=>{let l=esm_getEventTarget(n),{clientX:u,clientY:f}=legacy_isTouchEvent(n)?n.changedTouches[0]:n;h||(h=rF()),g.push({x:u,y:f,id:d.getId(l),timeOffset:rF()-h}),_("undefined"!=typeof DragEvent&&n instanceof DragEvent?rU.Drag:n instanceof MouseEvent?rU.MouseMove:rU.TouchMove)}),f,{trailing:!1})),$=[on("mousemove",j,u),on("touchmove",j,u),on("drag",j,u)];return callbackWrapper(()=>{$.forEach(n=>n())})}(n),f=function({mouseInteractionCb:n,doc:l,mirror:u,blockClass:d,blockSelector:h,unblockSelector:f,sampling:m}){if(!1===m.mouseInteraction)return()=>{};let g=!0===m.mouseInteraction||void 0===m.mouseInteraction?{}:m.mouseInteraction,_=[],j=null,getHandler=l=>m=>{let g=esm_getEventTarget(m);if(isBlocked(g,d,h,f,!0))return;let _=null,$=l;if("pointerType"in m){switch(m.pointerType){case"mouse":_=r$.Mouse;break;case"touch":_=r$.Touch;break;case"pen":_=r$.Pen}_===r$.Touch?rB[l]===rB.MouseDown?$="TouchStart":rB[l]===rB.MouseUp&&($="TouchEnd"):r$.Pen}else legacy_isTouchEvent(m)&&(_=r$.Touch);null!==_?(j=_,($.startsWith("Touch")&&_===r$.Touch||$.startsWith("Mouse")&&_===r$.Mouse)&&(_=null)):rB[l]===rB.Click&&(_=j,j=null);let z=legacy_isTouchEvent(m)?m.changedTouches[0]:m;if(!z)return;let ee=u.getId(g),{clientX:et,clientY:en}=z;callbackWrapper(n)({type:rB[$],id:ee,x:et,y:en,...null!==_&&{pointerType:_}})};return Object.keys(rB).filter(n=>Number.isNaN(Number(n))&&!n.endsWith("_Departed")&&!1!==g[n]).forEach(n=>{let u=toLowerCase(n),d=getHandler(n);if(window.PointerEvent)switch(rB[n]){case rB.MouseDown:case rB.MouseUp:u=u.replace("mouse","pointer");break;case rB.TouchStart:case rB.TouchEnd:return}_.push(on(u,d,l))}),callbackWrapper(()=>{_.forEach(n=>n())})}(n),m=initScrollObserver(n),g=function({viewportResizeCb:n},{win:l}){let u=-1,d=-1,h=callbackWrapper(throttle$1(callbackWrapper(()=>{let l=getWindowHeight(),h=getWindowWidth();(u!==l||d!==h)&&(n({width:Number(h),height:Number(l)}),u=l,d=h)}),200));return on("resize",h,l)}(n,{win:u}),_=function({inputCb:n,doc:l,mirror:u,blockClass:d,blockSelector:h,unblockSelector:f,ignoreClass:m,ignoreSelector:g,maskInputOptions:_,maskInputFn:j,sampling:$,userTriggeredOnInput:z,maskTextClass:ee,unmaskTextClass:et,maskTextSelector:en,unmaskTextSelector:eo}){function eventHandler(n){let u=esm_getEventTarget(n),$=n.isTrusted,es=u&&toUpperCase(u.tagName);if("OPTION"===es&&(u=u.parentElement),!u||!es||0>rW.indexOf(es)||isBlocked(u,d,h,f,!0))return;let el=u;if(el.classList.contains(m)||g&&el.matches(g))return;let eu=getInputType(u),ec=getInputValue(el,es,eu),eh=!1,ep=shouldMaskInput({maskInputOptions:_,tagName:es,type:eu}),ef=needMaskingText(u,ee,en,et,eo,ep);("radio"===eu||"checkbox"===eu)&&(eh=u.checked),ec=maskInputValue({isMasked:ef,element:u,value:ec,maskInputFn:j}),cbWithDedup(u,z?{text:ec,isChecked:eh,userTriggered:$}:{text:ec,isChecked:eh});let em=u.name;"radio"===eu&&em&&eh&&l.querySelectorAll(`input[type="radio"][name="${em}"]`).forEach(n=>{if(n!==u){let l=maskInputValue({isMasked:ef,element:n,value:getInputValue(n,es,eu),maskInputFn:j});cbWithDedup(n,z?{text:l,isChecked:!eh,userTriggered:!1}:{text:l,isChecked:!eh})}})}function cbWithDedup(l,d){let h=rq.get(l);if(!h||h.text!==d.text||h.isChecked!==d.isChecked){rq.set(l,d);let h=u.getId(l);callbackWrapper(n)({...d,id:h})}}let es="last"===$.input?["change"]:["input","change"],el=es.map(n=>on(n,callbackWrapper(eventHandler),l)),eu=l.defaultView;if(!eu)return()=>{el.forEach(n=>n())};let ec=eu.Object.getOwnPropertyDescriptor(eu.HTMLInputElement.prototype,"value"),eh=[[eu.HTMLInputElement.prototype,"value"],[eu.HTMLInputElement.prototype,"checked"],[eu.HTMLSelectElement.prototype,"value"],[eu.HTMLTextAreaElement.prototype,"value"],[eu.HTMLSelectElement.prototype,"selectedIndex"],[eu.HTMLOptionElement.prototype,"selected"]];return ec&&ec.set&&el.push(...eh.map(n=>(function hookSetter(n,l,u,d,h=window){let f=h.Object.getOwnPropertyDescriptor(n,l);return h.Object.defineProperty(n,l,d?u:{set(n){setTimeout$1(()=>{u.set.call(this,n)},0),f&&f.set&&f.set.call(this,n)}}),()=>hookSetter(n,l,f||{},!0)})(n[0],n[1],{set(){callbackWrapper(eventHandler)({target:this,isTrusted:!1})}},!1,eu))),callbackWrapper(()=>{el.forEach(n=>n())})}(n),j=function({mediaInteractionCb:n,blockClass:l,blockSelector:u,unblockSelector:d,mirror:h,sampling:f,doc:m}){let g=callbackWrapper(m=>throttle$1(callbackWrapper(f=>{let g=esm_getEventTarget(f);if(!g||isBlocked(g,l,u,d,!0))return;let{currentTime:_,volume:j,muted:$,playbackRate:z}=g;n({type:m,id:h.getId(g),currentTime:_,volume:j,muted:$,playbackRate:z})}),f.media||500)),_=[on("play",g(0),m),on("pause",g(1),m),on("seeked",g(2),m),on("volumechange",g(3),m),on("ratechange",g(4),m)];return callbackWrapper(()=>{_.forEach(n=>n())})}(n),$=function({styleSheetRuleCb:n,mirror:l,stylesheetManager:u},{win:d}){let h,f;if(!d.CSSStyleSheet||!d.CSSStyleSheet.prototype)return()=>{};let m=d.CSSStyleSheet.prototype.insertRule;d.CSSStyleSheet.prototype.insertRule=new Proxy(m,{apply:callbackWrapper((d,h,f)=>{let[m,g]=f,{id:_,styleId:j}=getIdAndStyleId(h,l,u.styleMirror);return(_&&-1!==_||j&&-1!==j)&&n({id:_,styleId:j,adds:[{rule:m,index:g}]}),d.apply(h,f)})});let g=d.CSSStyleSheet.prototype.deleteRule;d.CSSStyleSheet.prototype.deleteRule=new Proxy(g,{apply:callbackWrapper((d,h,f)=>{let[m]=f,{id:g,styleId:_}=getIdAndStyleId(h,l,u.styleMirror);return(g&&-1!==g||_&&-1!==_)&&n({id:g,styleId:_,removes:[{index:m}]}),d.apply(h,f)})}),d.CSSStyleSheet.prototype.replace&&(h=d.CSSStyleSheet.prototype.replace,d.CSSStyleSheet.prototype.replace=new Proxy(h,{apply:callbackWrapper((d,h,f)=>{let[m]=f,{id:g,styleId:_}=getIdAndStyleId(h,l,u.styleMirror);return(g&&-1!==g||_&&-1!==_)&&n({id:g,styleId:_,replace:m}),d.apply(h,f)})})),d.CSSStyleSheet.prototype.replaceSync&&(f=d.CSSStyleSheet.prototype.replaceSync,d.CSSStyleSheet.prototype.replaceSync=new Proxy(f,{apply:callbackWrapper((d,h,f)=>{let[m]=f,{id:g,styleId:_}=getIdAndStyleId(h,l,u.styleMirror);return(g&&-1!==g||_&&-1!==_)&&n({id:g,styleId:_,replaceSync:m}),d.apply(h,f)})}));let _={};canMonkeyPatchNestedCSSRule("CSSGroupingRule")?_.CSSGroupingRule=d.CSSGroupingRule:(canMonkeyPatchNestedCSSRule("CSSMediaRule")&&(_.CSSMediaRule=d.CSSMediaRule),canMonkeyPatchNestedCSSRule("CSSConditionRule")&&(_.CSSConditionRule=d.CSSConditionRule),canMonkeyPatchNestedCSSRule("CSSSupportsRule")&&(_.CSSSupportsRule=d.CSSSupportsRule));let j={};return Object.entries(_).forEach(([d,h])=>{j[d]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(j[d].insertRule,{apply:callbackWrapper((d,h,f)=>{let[m,g]=f,{id:_,styleId:j}=getIdAndStyleId(h.parentStyleSheet,l,u.styleMirror);return(_&&-1!==_||j&&-1!==j)&&n({id:_,styleId:j,adds:[{rule:m,index:[...getNestedCSSRulePositions(h),g||0]}]}),d.apply(h,f)})}),h.prototype.deleteRule=new Proxy(j[d].deleteRule,{apply:callbackWrapper((d,h,f)=>{let[m]=f,{id:g,styleId:_}=getIdAndStyleId(h.parentStyleSheet,l,u.styleMirror);return(g&&-1!==g||_&&-1!==_)&&n({id:g,styleId:_,removes:[{index:[...getNestedCSSRulePositions(h),m]}]}),d.apply(h,f)})})}),callbackWrapper(()=>{d.CSSStyleSheet.prototype.insertRule=m,d.CSSStyleSheet.prototype.deleteRule=g,h&&(d.CSSStyleSheet.prototype.replace=h),f&&(d.CSSStyleSheet.prototype.replaceSync=f),Object.entries(_).forEach(([n,l])=>{l.prototype.insertRule=j[n].insertRule,l.prototype.deleteRule=j[n].deleteRule})})}(n,{win:u}),z=initAdoptedStyleSheetObserver(n,n.doc),ee=function({styleDeclarationCb:n,mirror:l,ignoreCSSAttributes:u,stylesheetManager:d},{win:h}){let f=h.CSSStyleDeclaration.prototype.setProperty;h.CSSStyleDeclaration.prototype.setProperty=new Proxy(f,{apply:callbackWrapper((h,m,g)=>{let[_,j,$]=g;if(u.has(_))return f.apply(m,[_,j,$]);let{id:z,styleId:ee}=getIdAndStyleId(_optionalChain$2([m,"access",n=>n.parentRule,"optionalAccess",n=>n.parentStyleSheet]),l,d.styleMirror);return(z&&-1!==z||ee&&-1!==ee)&&n({id:z,styleId:ee,set:{property:_,value:j,priority:$},index:getNestedCSSRulePositions(m.parentRule)}),h.apply(m,g)})});let m=h.CSSStyleDeclaration.prototype.removeProperty;return h.CSSStyleDeclaration.prototype.removeProperty=new Proxy(m,{apply:callbackWrapper((h,f,g)=>{let[_]=g;if(u.has(_))return m.apply(f,[_]);let{id:j,styleId:$}=getIdAndStyleId(_optionalChain$2([f,"access",n=>n.parentRule,"optionalAccess",n=>n.parentStyleSheet]),l,d.styleMirror);return(j&&-1!==j||$&&-1!==$)&&n({id:j,styleId:$,remove:{property:_},index:getNestedCSSRulePositions(f.parentRule)}),h.apply(f,g)})}),callbackWrapper(()=>{h.CSSStyleDeclaration.prototype.setProperty=f,h.CSSStyleDeclaration.prototype.removeProperty=m})}(n,{win:u}),et=n.collectFonts?function({fontCb:n,doc:l}){let u=l.defaultView;if(!u)return()=>{};let d=[],h=new WeakMap,f=u.FontFace;u.FontFace=function(n,l,u){let d=new f(n,l,u);return h.set(d,{family:n,buffer:"string"!=typeof l,descriptors:u,fontSource:"string"==typeof l?l:JSON.stringify(Array.from(new Uint8Array(l)))}),d};let m=patch(l.fonts,"add",function(l){return function(u){return setTimeout$1(callbackWrapper(()=>{let l=h.get(u);l&&(n(l),h.delete(u))}),0),l.apply(this,[u])}});return d.push(()=>{u.FontFace=f}),d.push(m),callbackWrapper(()=>{d.forEach(n=>n())})}(n):()=>{},en=function(n){let{doc:l,mirror:u,blockClass:d,blockSelector:h,unblockSelector:f,selectionCb:m}=n,g=!0,_=callbackWrapper(()=>{let n=l.getSelection();if(!n||g&&_optionalChain$2([n,"optionalAccess",n=>n.isCollapsed]))return;g=n.isCollapsed||!1;let _=[],j=n.rangeCount||0;for(let l=0;l<j;l++){let m=n.getRangeAt(l),{startContainer:g,startOffset:j,endContainer:$,endOffset:z}=m,ee=isBlocked(g,d,h,f,!0)||isBlocked($,d,h,f,!0);ee||_.push({start:u.getId(g),startOffset:j,end:u.getId($),endOffset:z})}m({ranges:_})});return _(),on("selectionchange",_)}(n),eo=function({doc:n,customElementCb:l}){let u=n.defaultView;if(!u||!u.customElements)return()=>{};let d=patch(u.customElements,"define",function(n){return function(u,d,h){try{l({define:{name:u}})}catch(n){}return n.apply(this,[u,d,h])}});return d}(n),es=[];for(let l of n.plugins)es.push(l.observer(l.callback,u,l.options));return callbackWrapper(()=>{rH.forEach(n=>n.reset()),d.disconnect(),h(),f(),m(),g(),_(),j(),$(),z(),ee(),et(),en(),eo(),es.forEach(n=>n())})}function hasNestedCSSRule(n){return void 0!==window[n]}function canMonkeyPatchNestedCSSRule(n){return!!(void 0!==window[n]&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}let CrossOriginIframeMirror=class CrossOriginIframeMirror{constructor(n){this.generateIdFn=n,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(n,l,u,d){let h=u||this.getIdToRemoteIdMap(n),f=d||this.getRemoteIdToIdMap(n),m=h.get(l);return m||(m=this.generateIdFn(),h.set(l,m),f.set(m,l)),m}getIds(n,l){let u=this.getIdToRemoteIdMap(n),d=this.getRemoteIdToIdMap(n);return l.map(l=>this.getId(n,l,u,d))}getRemoteId(n,l,u){let d=u||this.getRemoteIdToIdMap(n);if("number"!=typeof l)return l;let h=d.get(l);return h||-1}getRemoteIds(n,l){let u=this.getRemoteIdToIdMap(n);return l.map(l=>this.getRemoteId(n,l,u))}reset(n){if(!n){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(n),this.iframeRemoteIdToIdMap.delete(n)}getIdToRemoteIdMap(n){let l=this.iframeIdToRemoteIdMap.get(n);return l||(l=new Map,this.iframeIdToRemoteIdMap.set(n,l)),l}getRemoteIdToIdMap(n){let l=this.iframeRemoteIdToIdMap.get(n);return l||(l=new Map,this.iframeRemoteIdToIdMap.set(n,l)),l}};function _optionalChain$1(n){let l;let u=n[0],d=1;for(;d<n.length;){let h=n[d],f=n[d+1];if(d+=2,("optionalAccess"===h||"optionalCall"===h)&&null==u)return;"access"===h||"optionalAccess"===h?(l=u,u=f(u)):("call"===h||"optionalCall"===h)&&(u=f((...n)=>u.call(l,...n)),l=void 0)}return u}let IframeManagerNoop=class IframeManagerNoop{constructor(){this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}};let IframeManager=class IframeManager{constructor(n){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new CrossOriginIframeMirror(genId),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=n.mutationCb,this.wrappedEmit=n.wrappedEmit,this.stylesheetManager=n.stylesheetManager,this.recordCrossOriginIframes=n.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=n.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(n){this.iframes.set(n,!0),n.contentWindow&&this.crossOriginIframeMap.set(n.contentWindow,n)}addLoadListener(n){this.loadListener=n}attachIframe(n,l){this.mutationCb({adds:[{parentId:this.mirror.getId(n),nextId:null,node:l}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),_optionalChain$1([this,"access",n=>n.loadListener,"optionalCall",l=>l(n)]),n.contentDocument&&n.contentDocument.adoptedStyleSheets&&n.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.contentDocument.adoptedStyleSheets,this.mirror.getId(n.contentDocument))}handleMessage(n){if("rrweb"!==n.data.type||n.origin!==n.data.origin)return;let l=n.source;if(!l)return;let u=this.crossOriginIframeMap.get(n.source);if(!u)return;let d=this.transformCrossOriginEvent(u,n.data.event);d&&this.wrappedEmit(d,n.data.isCheckout)}transformCrossOriginEvent(n,l){switch(l.type){case rj.FullSnapshot:{this.crossOriginIframeMirror.reset(n),this.crossOriginIframeStyleMirror.reset(n),this.replaceIdOnNode(l.data.node,n);let u=l.data.node.id;return this.crossOriginIframeRootIdMap.set(n,u),this.patchRootIdOnNode(l.data.node,u),{timestamp:l.timestamp,type:rj.IncrementalSnapshot,data:{source:rU.Mutation,adds:[{parentId:this.mirror.getId(n),nextId:null,node:l.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case rj.Meta:case rj.Load:case rj.DomContentLoaded:break;case rj.Plugin:return l;case rj.Custom:return this.replaceIds(l.data.payload,n,["id","parentId","previousId","nextId"]),l;case rj.IncrementalSnapshot:switch(l.data.source){case rU.Mutation:return l.data.adds.forEach(l=>{this.replaceIds(l,n,["parentId","nextId","previousId"]),this.replaceIdOnNode(l.node,n);let u=this.crossOriginIframeRootIdMap.get(n);u&&this.patchRootIdOnNode(l.node,u)}),l.data.removes.forEach(l=>{this.replaceIds(l,n,["parentId","id"])}),l.data.attributes.forEach(l=>{this.replaceIds(l,n,["id"])}),l.data.texts.forEach(l=>{this.replaceIds(l,n,["id"])}),l;case rU.Drag:case rU.TouchMove:case rU.MouseMove:return l.data.positions.forEach(l=>{this.replaceIds(l,n,["id"])}),l;case rU.ViewportResize:return!1;case rU.MediaInteraction:case rU.MouseInteraction:case rU.Scroll:case rU.CanvasMutation:case rU.Input:return this.replaceIds(l.data,n,["id"]),l;case rU.StyleSheetRule:case rU.StyleDeclaration:return this.replaceIds(l.data,n,["id"]),this.replaceStyleIds(l.data,n,["styleId"]),l;case rU.Font:return l;case rU.Selection:return l.data.ranges.forEach(l=>{this.replaceIds(l,n,["start","end"])}),l;case rU.AdoptedStyleSheet:return this.replaceIds(l.data,n,["id"]),this.replaceStyleIds(l.data,n,["styleIds"]),_optionalChain$1([l,"access",n=>n.data,"access",n=>n.styles,"optionalAccess",n=>n.forEach,"call",l=>l(l=>{this.replaceStyleIds(l,n,["styleId"])})]),l}}return!1}replace(n,l,u,d){for(let h of d)(Array.isArray(l[h])||"number"==typeof l[h])&&(Array.isArray(l[h])?l[h]=n.getIds(u,l[h]):l[h]=n.getId(u,l[h]));return l}replaceIds(n,l,u){return this.replace(this.crossOriginIframeMirror,n,l,u)}replaceStyleIds(n,l,u){return this.replace(this.crossOriginIframeStyleMirror,n,l,u)}replaceIdOnNode(n,l){this.replaceIds(n,l,["id","rootId"]),"childNodes"in n&&n.childNodes.forEach(n=>{this.replaceIdOnNode(n,l)})}patchRootIdOnNode(n,l){n.type===eP.Document||n.rootId||(n.rootId=l),"childNodes"in n&&n.childNodes.forEach(n=>{this.patchRootIdOnNode(n,l)})}};let ShadowDomManagerNoop=class ShadowDomManagerNoop{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}};let ShadowDomManager=class ShadowDomManager{constructor(n){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=n.mutationCb,this.scrollCb=n.scrollCb,this.bypassOptions=n.bypassOptions,this.mirror=n.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(n,l){if(!isNativeShadowDom(n)||this.shadowDoms.has(n))return;this.shadowDoms.add(n);let u=initMutationObserver({...this.bypassOptions,doc:l,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},n);this.restoreHandlers.push(()=>u.disconnect()),this.restoreHandlers.push(initScrollObserver({...this.bypassOptions,scrollCb:this.scrollCb,doc:n,mirror:this.mirror})),setTimeout$1(()=>{n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n.host)),this.restoreHandlers.push(initAdoptedStyleSheetObserver({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},n))},0)}observeAttachShadow(n){n.contentWindow&&n.contentDocument&&this.patchAttachShadow(n.contentWindow.Element,n.contentDocument)}patchAttachShadow(n,l){let u=this;this.restoreHandlers.push(patch(n.prototype,"attachShadow",function(n){return function(d){let h=n.call(this,d);return this.shadowRoot&&inDom(this)&&u.addShadowRoot(this.shadowRoot,l),h}}))}reset(){this.restoreHandlers.forEach(n=>{try{n()}catch(n){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}};let CanvasManagerNoop=class CanvasManagerNoop{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}};let StylesheetManager=class StylesheetManager{constructor(n){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=n.mutationCb,this.adoptedStyleSheetCb=n.adoptedStyleSheetCb}attachLinkElement(n,l){"_cssText"in l.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:l.id,attributes:l.attributes}]}),this.trackLinkElement(n)}trackLinkElement(n){this.trackedLinkElements.has(n)||(this.trackedLinkElements.add(n),this.trackStylesheetInLinkElement(n))}adoptStyleSheets(n,l){if(0===n.length)return;let u={id:l,styleIds:[]},d=[];for(let l of n){let n;this.styleMirror.has(l)?n=this.styleMirror.getId(l):(n=this.styleMirror.add(l),d.push({styleId:n,rules:Array.from(l.rules||CSSRule,(n,l)=>({rule:stringifyRule(n),index:l}))})),u.styleIds.push(n)}d.length>0&&(u.styles=d),this.adoptedStyleSheetCb(u)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(n){}};let ProcessedNodeManager=class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){!function(...n){getImplementation("requestAnimationFrame")(...n)}(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(n,l){let u=this.nodeMap.get(n);return u&&Array.from(u).some(n=>n!==l)}add(n,l){this.nodeMap.set(n,(this.nodeMap.get(n)||new Set).add(l))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}};let rz=new Mirror;function record(n={}){let l;let{emit:u,checkoutEveryNms:d,checkoutEveryNth:h,blockClass:f="rr-block",blockSelector:m=null,unblockSelector:g=null,ignoreClass:_="rr-ignore",ignoreSelector:j=null,maskAllText:$=!1,maskTextClass:z="rr-mask",unmaskTextClass:ee=null,maskTextSelector:et=null,unmaskTextSelector:en=null,inlineStylesheet:eo=!0,maskAllInputs:es,maskInputOptions:el,slimDOMOptions:eu,maskAttributeFn:ef,maskInputFn:em,maskTextFn:eg,maxCanvasSize:e_=null,packFn:ey,sampling:ev={},dataURLOptions:eE={},mousemoveWait:eS,recordCanvas:ew=!1,recordCrossOriginIframes:eT=!1,recordAfter:eI="DOMContentLoaded"===n.recordAfter?n.recordAfter:"load",userTriggeredOnInput:eR=!1,collectFonts:eP=!1,inlineImages:eA=!1,plugins:eO,keepIframeSrcFn:eC=()=>!1,ignoreCSSAttributes:ek=new Set([]),errorHandler:ex,onMutation:eM,getCanvasManager:eD}=n;ec=ex;let eN=!eT||window.parent===window,eV=!1;if(!eN)try{window.parent.document&&(eV=!1)}catch(n){eV=!0}if(eN&&!u)throw Error("emit function is required");void 0!==eS&&void 0===ev.mousemove&&(ev.mousemove=eS),rz.reset();let eF=!0===es?{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!==el?el:{},eL=!0===eu||"all"===eu?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===eu,headMetaDescKeywords:"all"===eu}:eu||{};!function(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...n)=>{let l=n[0];if(!(0 in n))throw TypeError("1 argument is required");do if(this===l)return!0;while(l=l&&l.parentNode);return!1})}();let ej=0,eventProcessor=n=>{for(let l of eO||[])l.eventProcessor&&(n=l.eventProcessor(n));return ey&&!eV&&(n=ey(n)),n};eh=(n,f)=>{if(n.timestamp=rF(),_optionalChain([rH,"access",n=>n[0],"optionalAccess",n=>n.isFrozen,"call",n=>n()])&&n.type!==rj.FullSnapshot&&!(n.type===rj.IncrementalSnapshot&&n.data.source===rU.Mutation)&&rH.forEach(n=>n.unfreeze()),eN)_optionalChain([u,"optionalCall",l=>l(eventProcessor(n),f)]);else if(eV){let l={type:"rrweb",event:eventProcessor(n),origin:window.location.origin,isCheckout:f};window.parent.postMessage(l,"*")}if(n.type===rj.FullSnapshot)l=n,ej=0;else if(n.type===rj.IncrementalSnapshot){if(n.data.source===rU.Mutation&&n.data.isAttachIframe)return;ej++;let u=h&&ej>=h,f=d&&l&&n.timestamp-l.timestamp>d;(u||f)&&takeFullSnapshot(!0)}};let wrappedMutationEmit=n=>{eh({type:rj.IncrementalSnapshot,data:{source:rU.Mutation,...n}})},wrappedScrollEmit=n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.Scroll,...n}}),wrappedCanvasMutationEmit=n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.CanvasMutation,...n}}),eU=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.AdoptedStyleSheet,...n}})}),eB="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new IframeManagerNoop:new IframeManager({mirror:rz,mutationCb:wrappedMutationEmit,stylesheetManager:eU,recordCrossOriginIframes:eT,wrappedEmit:eh});for(let n of eO||[])n.getMirror&&n.getMirror({nodeMirror:rz,crossOriginIframeMirror:eB.crossOriginIframeMirror,crossOriginIframeStyleMirror:eB.crossOriginIframeStyleMirror});let e$=new ProcessedNodeManager,eH=function(n,l){try{return n?n(l):new CanvasManagerNoop}catch(n){return console.warn("Unable to initialize CanvasManager"),new CanvasManagerNoop}}(eD,{mirror:rz,win:window,mutationCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.CanvasMutation,...n}}),recordCanvas:ew,blockClass:f,blockSelector:m,unblockSelector:g,maxCanvasSize:e_,sampling:ev.canvas,dataURLOptions:eE,errorHandler:ex}),eW="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new ShadowDomManagerNoop:new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{onMutation:eM,blockClass:f,blockSelector:m,unblockSelector:g,maskAllText:$,maskTextClass:z,unmaskTextClass:ee,maskTextSelector:et,unmaskTextSelector:en,inlineStylesheet:eo,maskInputOptions:eF,dataURLOptions:eE,maskAttributeFn:ef,maskTextFn:eg,maskInputFn:em,recordCanvas:ew,inlineImages:eA,sampling:ev,slimDOMOptions:eL,iframeManager:eB,stylesheetManager:eU,canvasManager:eH,keepIframeSrcFn:eC,processedNodeManager:e$},mirror:rz}),takeFullSnapshot=(n=!1)=>{eh({type:rj.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}},n),eU.reset(),eW.init(),rH.forEach(n=>n.lock());let l=function(n,l){let{mirror:u=new Mirror,blockClass:d="rr-block",blockSelector:h=null,unblockSelector:f=null,maskAllText:m=!1,maskTextClass:g="rr-mask",unmaskTextClass:_=null,maskTextSelector:j=null,unmaskTextSelector:$=null,inlineStylesheet:z=!0,inlineImages:ee=!1,recordCanvas:et=!1,maskAllInputs:en=!1,maskAttributeFn:eo,maskTextFn:es,maskInputFn:el,slimDOM:eu=!1,dataURLOptions:ec,preserveWhiteSpace:eh,onSerialize:ep,onIframeLoad:ef,iframeLoadTimeout:em,onStylesheetLoad:eg,stylesheetLoadTimeout:e_,keepIframeSrcFn:ey=()=>!1}=l||{},ev=!0===en?{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===en?{}:en,eE=!0===eu||"all"===eu?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===eu,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===eu?{}:eu;return serializeNodeWithId(n,{doc:n,mirror:u,blockClass:d,blockSelector:h,unblockSelector:f,maskAllText:m,maskTextClass:g,unmaskTextClass:_,maskTextSelector:j,unmaskTextSelector:$,skipChild:!1,inlineStylesheet:z,maskInputOptions:ev,maskAttributeFn:eo,maskTextFn:es,maskInputFn:el,slimDOMOptions:eE,dataURLOptions:ec,inlineImages:ee,recordCanvas:et,preserveWhiteSpace:eh,onSerialize:ep,onIframeLoad:ef,iframeLoadTimeout:em,onStylesheetLoad:eg,stylesheetLoadTimeout:e_,keepIframeSrcFn:ey,newlyAddedElement:!1})}(document,{mirror:rz,blockClass:f,blockSelector:m,unblockSelector:g,maskAllText:$,maskTextClass:z,unmaskTextClass:ee,maskTextSelector:et,unmaskTextSelector:en,inlineStylesheet:eo,maskAllInputs:eF,maskAttributeFn:ef,maskInputFn:em,maskTextFn:eg,slimDOM:eL,dataURLOptions:eE,recordCanvas:ew,inlineImages:eA,onSerialize:n=>{isSerializedIframe(n,rz)&&eB.addIframe(n),isSerializedStylesheet(n,rz)&&eU.trackLinkElement(n),hasShadowRoot(n)&&eW.addShadowRoot(n.shadowRoot,document)},onIframeLoad:(n,l)=>{eB.attachIframe(n,l),eW.observeAttachShadow(n)},onStylesheetLoad:(n,l)=>{eU.attachLinkElement(n,l)},keepIframeSrcFn:eC});if(!l)return console.warn("Failed to snapshot the document");eh({type:rj.FullSnapshot,data:{node:l,initialOffset:getWindowScroll(window)}}),rH.forEach(n=>n.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&eU.adoptStyleSheets(document.adoptedStyleSheets,rz.getId(document))};ep=takeFullSnapshot;try{let n=[],observe=n=>callbackWrapper(initObservers)({onMutation:eM,mutationCb:wrappedMutationEmit,mousemoveCb:(n,l)=>eh({type:rj.IncrementalSnapshot,data:{source:l,positions:n}}),mouseInteractionCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.MouseInteraction,...n}}),scrollCb:wrappedScrollEmit,viewportResizeCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.ViewportResize,...n}}),inputCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.Input,...n}}),mediaInteractionCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.MediaInteraction,...n}}),styleSheetRuleCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.StyleSheetRule,...n}}),styleDeclarationCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.StyleDeclaration,...n}}),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:n=>eh({type:rj.IncrementalSnapshot,data:{source:rU.Font,...n}}),selectionCb:n=>{eh({type:rj.IncrementalSnapshot,data:{source:rU.Selection,...n}})},customElementCb:n=>{eh({type:rj.IncrementalSnapshot,data:{source:rU.CustomElement,...n}})},blockClass:f,ignoreClass:_,ignoreSelector:j,maskAllText:$,maskTextClass:z,unmaskTextClass:ee,maskTextSelector:et,unmaskTextSelector:en,maskInputOptions:eF,inlineStylesheet:eo,sampling:ev,recordCanvas:ew,inlineImages:eA,userTriggeredOnInput:eR,collectFonts:eP,doc:n,maskAttributeFn:ef,maskInputFn:em,maskTextFn:eg,keepIframeSrcFn:eC,blockSelector:m,unblockSelector:g,slimDOMOptions:eL,dataURLOptions:eE,mirror:rz,iframeManager:eB,stylesheetManager:eU,shadowDomManager:eW,processedNodeManager:e$,canvasManager:eH,ignoreCSSAttributes:ek,plugins:_optionalChain([eO,"optionalAccess",n=>n.filter,"call",n=>n(n=>n.observer),"optionalAccess",n=>n.map,"call",n=>n(n=>({observer:n.observer,options:n.options,callback:l=>eh({type:rj.Plugin,data:{plugin:n.name,payload:l}})}))])||[]},{});eB.addLoadListener(l=>{try{n.push(observe(l.contentDocument))}catch(n){console.warn(n)}});let init=()=>{takeFullSnapshot(),n.push(observe(document))};return"interactive"===document.readyState||"complete"===document.readyState?init():(n.push(on("DOMContentLoaded",()=>{eh({type:rj.DomContentLoaded,data:{}}),"DOMContentLoaded"===eI&&init()})),n.push(on("load",()=>{eh({type:rj.Load,data:{}}),"load"===eI&&init()},window))),()=>{n.forEach(n=>n()),e$.destroy(),ep=void 0,ec=void 0}}catch(n){console.warn(n)}}function timestampToMs(n){return n>9999999999?n:1e3*n}function timestampToS(n){return n>9999999999?n/1e3:n}function addBreadcrumbEvent(n,l){"sentry.transaction"!==l.category&&(["ui.click","ui.input"].includes(l.category)?n.triggerUserActivity():n.checkAndHandleExpiredSession(),n.addUpdate(()=>(n.throttledAddEvent({type:rj.Custom,timestamp:1e3*(l.timestamp||0),data:{tag:"breadcrumb",payload:(0,e7.Fv)(l,10,1e3)}}),"console"===l.category)))}function getClosestInteractive(n){let l=n.closest("button,a");return l||n}function getClickTargetNode(n){let l=getTargetNode(n);return l&&l instanceof Element?getClosestInteractive(l):l}function getTargetNode(n){return"object"==typeof n&&n&&"target"in n?n.target:n}record.mirror=rz,record.takeFullSnapshot=function(n){if(!ep)throw Error("please take full snapshot after start recording");ep(n)};let ClickDetector=class ClickDetector{constructor(n,l,u=addBreadcrumbEvent){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=l.timeout/1e3,this._threshold=l.threshold/1e3,this._scollTimeout=l.scrollTimeout/1e3,this._replay=n,this._ignoreSelector=l.ignoreSelector,this._addBreadcrumbEvent=u}addListeners(){var n;let l=(n=()=>{this._lastMutation=nowInSeconds()},ef||(ef=[],(0,eM.hl)(rw,"open",function(n){return function(...l){if(ef)try{ef.forEach(n=>n())}catch(n){}return n.apply(rw,l)}})),ef.push(n),()=>{let l=ef?ef.indexOf(n):-1;l>-1&&ef.splice(l,1)});this._teardown=()=>{l(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(n,l){var u;if(u=this._ignoreSelector,!rG.includes(l.tagName)||"INPUT"===l.tagName&&!["submit","button"].includes(l.getAttribute("type")||"")||"A"===l.tagName&&(l.hasAttribute("download")||l.hasAttribute("target")&&"_self"!==l.getAttribute("target"))||u&&l.matches(u)||!(n.data&&"number"==typeof n.data.nodeId&&n.timestamp))return;let d={timestamp:timestampToS(n.timestamp),clickBreadcrumb:n,clickCount:0,node:l};this._clicks.some(n=>n.node===d.node&&1>Math.abs(n.timestamp-d.timestamp))||(this._clicks.push(d),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(n=Date.now()){this._lastMutation=timestampToS(n)}registerScroll(n=Date.now()){this._lastScroll=timestampToS(n)}registerClick(n){let l=getClosestInteractive(n);this._handleMultiClick(l)}_handleMultiClick(n){this._getClicks(n).forEach(n=>{n.clickCount++})}_getClicks(n){return this._clicks.filter(l=>l.node===n)}_checkClicks(){let n=[],l=nowInSeconds();for(let u of(this._clicks.forEach(u=>{!u.mutationAfter&&this._lastMutation&&(u.mutationAfter=u.timestamp<=this._lastMutation?this._lastMutation-u.timestamp:void 0),!u.scrollAfter&&this._lastScroll&&(u.scrollAfter=u.timestamp<=this._lastScroll?this._lastScroll-u.timestamp:void 0),u.timestamp+this._timeout<=l&&n.push(u)}),n)){let n=this._clicks.indexOf(u);n>-1&&(this._generateBreadcrumbs(u),this._clicks.splice(n,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(n){let l=this._replay,u=n.scrollAfter&&n.scrollAfter<=this._scollTimeout,d=n.mutationAfter&&n.mutationAfter<=this._threshold,{clickCount:h,clickBreadcrumb:f}=n;if(!u&&!d){let u=1e3*Math.min(n.mutationAfter||this._timeout,this._timeout),d=u<1e3*this._timeout?"mutation":"timeout",m={type:"default",message:f.message,timestamp:f.timestamp,category:"ui.slowClickDetected",data:{...f.data,url:rw.location.href,route:l.getCurrentRoute(),timeAfterClickMs:u,endReason:d,clickCount:h||1}};this._addBreadcrumbEvent(l,m);return}if(h>1){let n={type:"default",message:f.message,timestamp:f.timestamp,category:"ui.multiClick",data:{...f.data,url:rw.location.href,route:l.getCurrentRoute(),clickCount:h,metric:!0}};this._addBreadcrumbEvent(l,n)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=setTimeout(()=>this._checkClicks(),1e3)}};let rG=["A","BUTTON","INPUT"];function nowInSeconds(){return Date.now()/1e3}function createBreadcrumb(n){return{timestamp:Date.now()/1e3,type:"default",...n}}(eI=eA||(eA={}))[eI.Document=0]="Document",eI[eI.DocumentType=1]="DocumentType",eI[eI.Element=2]="Element",eI[eI.Text=3]="Text",eI[eI.CDATA=4]="CDATA",eI[eI.Comment=5]="Comment";let rK=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]),handleDomListener=n=>l=>{if(!n.isEnabled())return;let u=function(n){let{target:l,message:u}=function(n){let l;let u="click"===n.name,d=null;try{d=u?getClickTargetNode(n.event):getTargetNode(n.event),l=(0,e9.Rt)(d,{maxStringLength:200})||"<unknown>"}catch(n){l="<unknown>"}return{target:d,message:l}}(n);return createBreadcrumb({category:`ui.${n.name}`,...getBaseDomBreadcrumb(l,u)})}(l);if(!u)return;let d="click"===l.name,h=d?l.event:void 0;d&&n.clickDetector&&h&&h.target&&!h.altKey&&!h.metaKey&&!h.ctrlKey&&!h.shiftKey&&function(n,l,u){n.handleClick(l,u)}(n.clickDetector,u,getClickTargetNode(l.event)),addBreadcrumbEvent(n,u)};function getBaseDomBreadcrumb(n,l){let u=record.mirror.getId(n),d=u&&record.mirror.getNode(u),h=d&&record.mirror.getMeta(d),f=h&&h.type===eA.Element?h:null;return{message:l,data:f?{nodeId:u,node:{id:u,tagName:f.tagName,textContent:Array.from(f.childNodes).map(n=>n.type===eA.Text&&n.textContent).filter(Boolean).map(n=>n.trim()).join(""),attributes:function(n){let l={};for(let u in n)if(rK.has(u)){let d=u;("data-testid"===u||"data-test-id"===u)&&(d="testId"),l[d]=n[u]}return l}(f.attributes)}}:{}}}let rX={resource:function(n){let{entryType:l,initiatorType:u,name:d,responseEnd:h,startTime:f,decodedBodySize:m,encodedBodySize:g,responseStatus:_,transferSize:j}=n;return["fetch","xmlhttprequest"].includes(u)?null:{type:`${l}.${u}`,start:esm_getAbsoluteTime(f),end:esm_getAbsoluteTime(h),name:d,data:{size:j,statusCode:_,decodedBodySize:m,encodedBodySize:g}}},paint:function(n){let{duration:l,entryType:u,name:d,startTime:h}=n,f=esm_getAbsoluteTime(h);return{type:u,name:d,start:f,end:f+l,data:void 0}},navigation:function(n){let{entryType:l,name:u,decodedBodySize:d,duration:h,domComplete:f,encodedBodySize:m,domContentLoadedEventStart:g,domContentLoadedEventEnd:_,domInteractive:j,loadEventStart:$,loadEventEnd:z,redirectCount:ee,startTime:et,transferSize:en,type:eo}=n;return 0===h?null:{type:`${l}.${eo}`,start:esm_getAbsoluteTime(et),end:esm_getAbsoluteTime(f),name:u,data:{size:en,decodedBodySize:d,encodedBodySize:m,duration:h,domInteractive:j,domContentLoadedEventStart:g,domContentLoadedEventEnd:_,loadEventStart:$,loadEventEnd:z,domComplete:f,redirectCount:ee}}}};function createPerformanceEntry(n){return rX[n.entryType]?rX[n.entryType](n):null}function esm_getAbsoluteTime(n){return((tx.Z1||rw.performance.timeOrigin)+n)/1e3}let rY="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function logInfo(n,l){rY&&(eN.kg.info(n),l&&addLogBreadcrumb(n))}function logInfoNextTick(n,l){rY&&(eN.kg.info(n),l&&setTimeout(()=>{addLogBreadcrumb(n)},0))}function addLogBreadcrumb(n){(0,ex.n_)({category:"console",data:{logger:"replay"},level:"info",message:n},{level:"info"})}let EventBufferSizeExceededError=class EventBufferSizeExceededError extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}};let EventBufferArray=class EventBufferArray{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(n){let l=JSON.stringify(n).length;if(this._totalSize+=l,this._totalSize>2e7)throw new EventBufferSizeExceededError;this.events.push(n)}finish(){return new Promise(n=>{let l=this.events;this.clear(),n(JSON.stringify(l))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let n=this.events.map(n=>n.timestamp).sort()[0];return n?timestampToMs(n):null}};let WorkerHandler=class WorkerHandler{constructor(n){this._worker=n,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((n,l)=>{this._worker.addEventListener("message",({data:u})=>{u.success?n():l()},{once:!0}),this._worker.addEventListener("error",n=>{l(n)},{once:!0})})),this._ensureReadyPromise}destroy(){logInfo("[Replay] Destroying compression worker"),this._worker.terminate()}postMessage(n,l){let u=this._getAndIncrementId();return new Promise((d,h)=>{let listener=({data:l})=>{if(l.method===n&&l.id===u){if(this._worker.removeEventListener("message",listener),!l.success){rY&&eN.kg.error("[Replay]",l.response),h(Error("Error in compression worker"));return}d(l.response)}};this._worker.addEventListener("message",listener),this._worker.postMessage({id:u,method:n,arg:l})})}_getAndIncrementId(){return this._id++}};let EventBufferCompressionWorker=class EventBufferCompressionWorker{constructor(n){this._worker=new WorkerHandler(n),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(n){let l=timestampToMs(n.timestamp);(!this._earliestTimestamp||l<this._earliestTimestamp)&&(this._earliestTimestamp=l);let u=JSON.stringify(n);return(this._totalSize+=u.length,this._totalSize>2e7)?Promise.reject(new EventBufferSizeExceededError):this._sendEventToWorker(u)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,n=>{rY&&eN.kg.warn('[Replay] Sending "clear" message to worker failed',n)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(n){return this._worker.postMessage("addEvent",n)}async _finishRequest(){let n=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,n}};let EventBufferProxy=class EventBufferProxy{constructor(n){this._fallback=new EventBufferArray,this._compression=new EventBufferCompressionWorker(n),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(n){this._used.hasCheckout=n}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(n){return this._used.addEvent(n)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(n){logInfo("[Replay] Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){let{events:n,hasCheckout:l}=this._fallback,u=[];for(let l of n)u.push(this._compression.addEvent(l));this._compression.hasCheckout=l,this._used=this._compression;try{await Promise.all(u)}catch(n){rY&&eN.kg.warn("[Replay] Failed to add events when switching buffers.",n)}}};function hasSessionStorage(){try{return"sessionStorage"in rw&&!!rw.sessionStorage}catch(n){return!1}}function isSampled(n){return void 0!==n&&Math.random()<n}function makeSession(n){let l=Date.now(),u=n.id||(0,eD.DM)(),d=n.started||l,h=n.lastActivity||l,f=n.segmentId||0,m=n.sampled,g=n.previousSessionId;return{id:u,started:d,lastActivity:h,segmentId:f,sampled:m,previousSessionId:g}}function saveSession(n){if(hasSessionStorage())try{rw.sessionStorage.setItem(rT,JSON.stringify(n))}catch(n){}}function createSession({sessionSampleRate:n,allowBuffering:l,stickySession:u=!1},{previousSessionId:d}={}){let h=isSampled(n)?"session":!!l&&"buffer",f=makeSession({sampled:h,previousSessionId:d});return u&&saveSession(f),f}function isExpired(n,l,u=+new Date){return null===n||void 0===l||l<0||0!==l&&n+l<=u}function isSessionExpired(n,{maxReplayDuration:l,sessionIdleExpire:u,targetTime:d=Date.now()}){return isExpired(n.started,l,d)||isExpired(n.lastActivity,u,d)}function shouldRefreshSession(n,{sessionIdleExpire:l,maxReplayDuration:u}){return!!isSessionExpired(n,{sessionIdleExpire:l,maxReplayDuration:u})&&("buffer"!==n.sampled||0!==n.segmentId)}function loadOrCreateSession({traceInternals:n,sessionIdleExpire:l,maxReplayDuration:u,previousSessionId:d},h){let f=h.stickySession&&function(n){if(!hasSessionStorage())return null;try{let l=rw.sessionStorage.getItem(rT);if(!l)return null;let u=JSON.parse(l);return logInfoNextTick("[Replay] Loading existing session",n),makeSession(u)}catch(n){return null}}(n);return f?shouldRefreshSession(f,{sessionIdleExpire:l,maxReplayDuration:u})?(logInfoNextTick("[Replay] Session in sessionStorage is expired, creating new one..."),createSession(h,{previousSessionId:f.id})):f:(logInfoNextTick("[Replay] Creating new session",n),createSession(h,{previousSessionId:d}))}function addEventSync(n,l,u){return!!shouldAddEvent(n,l)&&(_addEvent(n,l,u),!0)}async function _addEvent(n,l,u){if(!n.eventBuffer)return null;try{u&&"buffer"===n.recordingMode&&n.eventBuffer.clear(),u&&(n.eventBuffer.hasCheckout=!0);let d=n.getOptions(),h=function(n,l){try{if("function"==typeof l&&n.type===rj.Custom)return l(n)}catch(n){return rY&&eN.kg.error("[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...",n),null}return n}(l,d.beforeAddRecordingEvent);if(!h)return;return await n.eventBuffer.addEvent(h)}catch(d){let l=d&&d instanceof EventBufferSizeExceededError?"addEventSizeExceeded":"addEvent";rY&&eN.kg.error(d),await n.stop({reason:l});let u=(0,ex.s3)();u&&u.recordDroppedEvent("internal_sdk_error","replay")}}function shouldAddEvent(n,l){if(!n.eventBuffer||n.isPaused()||!n.isEnabled())return!1;let u=timestampToMs(l.timestamp);return!(u+n.timeouts.sessionIdlePause<Date.now())&&(!(u>n.getContext().initialTimestamp+n.getOptions().maxReplayDuration)||(logInfo(`[Replay] Skipping event with timestamp ${u} because it is after maxReplayDuration`,n.getOptions()._experiments.traceInternals),!1))}function esm_isTransactionEvent(n){return"transaction"===n.type}function isFeedbackEvent(n){return"feedback"===n.type}function handleAfterSendEvent(n){let l=function(){let n=(0,ex.s3)();if(!n)return!1;let l=n.getTransport();return!!l&&(l.send.__sentry__baseTransport__||!1)}();return(u,d)=>{if(!n.isEnabled()||u.type&&!esm_isTransactionEvent(u))return;let h=d&&d.statusCode;if(!l||h&&!(h<200)&&!(h>=300)){if(esm_isTransactionEvent(u)){!function(n,l){let u=n.getContext();l.contexts&&l.contexts.trace&&l.contexts.trace.trace_id&&u.traceIds.size<100&&u.traceIds.add(l.contexts.trace.trace_id)}(n,u);return}!function(n,l){let u=n.getContext();if(l.event_id&&u.errorIds.size<100&&u.errorIds.add(l.event_id),"buffer"!==n.recordingMode||!l.tags||!l.tags.replayId)return;let{beforeErrorSampling:d}=n.getOptions();("function"!=typeof d||d(l))&&setTimeout(()=>{n.sendBufferedReplayOrFlush()})}(n,u)}}}function createPerformanceSpans(n,l){return l.map(({type:l,start:u,end:d,name:h,data:f})=>{let m=n.throttledAddEvent({type:rj.Custom,timestamp:u,data:{tag:"performanceSpan",payload:{op:l,description:h,startTimestamp:u,endTimestamp:d,data:f}}});return"string"==typeof m?Promise.resolve(null):m})}function addNetworkBreadcrumb(n,l){var u;n.isEnabled()&&null!==l&&(u=l.name,(!rY||!n.getOptions()._experiments.traceInternals)&&function(n,l){let u=l&&void 0!==l.getClient?l.getClient():l,d=u&&u.getDsn(),h=u&&u.getOptions().tunnel;return!!d&&n.includes(d.host)||!!h&&removeTrailingSlash(n)===removeTrailingSlash(h)}(u,(0,ex.s3)())||n.addUpdate(()=>(createPerformanceSpans(n,[l]),!0)))}function getBodySize(n,l){if(n)try{if("string"==typeof n)return l.encode(n).length;if(n instanceof URLSearchParams)return l.encode(n.toString()).length;if(n instanceof FormData){let u=_serializeFormData(n);return l.encode(u).length}if(n instanceof Blob)return n.size;if(n instanceof ArrayBuffer)return n.byteLength}catch(n){}}function parseContentLengthHeader(n){if(!n)return;let l=parseInt(n,10);return isNaN(l)?void 0:l}function getBodyString(n){try{if("string"==typeof n)return[n];if(n instanceof URLSearchParams)return[n.toString()];if(n instanceof FormData)return[_serializeFormData(n)];if(!n)return[void 0]}catch(l){return rY&&eN.kg.warn("[Replay] Failed to serialize body",n),[void 0,"BODY_PARSE_ERROR"]}return rY&&eN.kg.info("[Replay] Skipping network body because of body type",n),[void 0,"UNPARSEABLE_BODY_TYPE"]}function mergeWarning(n,l){if(!n)return{headers:{},size:void 0,_meta:{warnings:[l]}};let u={...n._meta},d=u.warnings||[];return u.warnings=[...d,l],n._meta=u,n}function makeNetworkReplayBreadcrumb(n,l){if(!l)return null;let{startTimestamp:u,endTimestamp:d,url:h,method:f,statusCode:m,request:g,response:_}=l,j={type:n,start:u/1e3,end:d/1e3,name:h,data:(0,eM.Jr)({method:f,statusCode:m,request:g,response:_})};return j}function buildSkippedNetworkRequestOrResponse(n){return{headers:{},size:n,_meta:{warnings:["URL_SKIPPED"]}}}function buildNetworkRequestOrResponse(n,l,u){if(!l&&0===Object.keys(n).length)return;if(!l)return{headers:n};if(!u)return{headers:n,size:l};let d={headers:n,size:l},{body:h,warnings:f}=function(n){if(!n||"string"!=typeof n)return{body:n};let l=n.length>15e4,u=function(n){let l=n[0],u=n[n.length-1];return"["===l&&"]"===u||"{"===l&&"}"===u}(n);if(l){let l=n.slice(0,15e4);return u?{body:l,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${l}…`,warnings:["TEXT_TRUNCATED"]}}if(u)try{let l=JSON.parse(n);return{body:l}}catch(n){}return{body:n}}(u);return d.body=h,f&&f.length>0&&(d._meta={warnings:f}),d}function getAllowedHeaders(n,l){return Object.keys(n).reduce((u,d)=>{let h=d.toLowerCase();return l.includes(h)&&n[d]&&(u[h]=n[d]),u},{})}function _serializeFormData(n){return new URLSearchParams(n).toString()}function urlMatches(n,l){let u=function(n,l=rw.document.baseURI){if(n.startsWith("http://")||n.startsWith("https://")||n.startsWith(rw.location.origin))return n;let u=new URL(n,l);if(u.origin!==new URL(l).origin)return n;let d=u.href;return!n.endsWith("/")&&d.endsWith("/")?d.slice(0,-1):d}(n);return(0,eH.U0)(u,l)}async function captureFetchBreadcrumbToReplay(n,l,u){try{let d=await _prepareFetchData(n,l,u),h=makeNetworkReplayBreadcrumb("resource.fetch",d);addNetworkBreadcrumb(u.replay,h)}catch(n){rY&&eN.kg.error("[Replay] Failed to capture fetch breadcrumb",n)}}async function _prepareFetchData(n,l,u){let d=Date.now(),{startTimestamp:h=d,endTimestamp:f=d}=l,{url:m,method:g,status_code:_=0,request_body_size:j,response_body_size:$}=n.data,z=urlMatches(m,u.networkDetailAllowUrls)&&!urlMatches(m,u.networkDetailDenyUrls),ee=z?function({networkCaptureBodies:n,networkRequestHeaders:l},u,d){let h=u?1===u.length&&"string"!=typeof u[0]?getHeadersFromOptions(u[0],l):2===u.length?getHeadersFromOptions(u[1],l):{}:{};if(!n)return buildNetworkRequestOrResponse(h,d,void 0);let f=_getFetchRequestArgBody(u),[m,g]=getBodyString(f),_=buildNetworkRequestOrResponse(h,d,m);return g?mergeWarning(_,g):_}(u,l.input,j):buildSkippedNetworkRequestOrResponse(j),et=await _getResponseInfo(z,u,l.response,$);return{startTimestamp:h,endTimestamp:f,url:m,method:g,statusCode:_,request:ee,response:et}}async function _getResponseInfo(n,{networkCaptureBodies:l,textEncoder:u,networkResponseHeaders:d},h,f){if(!n&&void 0!==f)return buildSkippedNetworkRequestOrResponse(f);let m=h?getAllHeaders(h.headers,d):{};if(!h||!l&&void 0!==f)return buildNetworkRequestOrResponse(m,f,void 0);let[g,_]=await _parseFetchResponseBody(h),j=function(n,{networkCaptureBodies:l,textEncoder:u,responseBodySize:d,captureDetails:h,headers:f}){try{let m=n&&n.length&&void 0===d?getBodySize(n,u):d;if(!h)return buildSkippedNetworkRequestOrResponse(m);if(l)return buildNetworkRequestOrResponse(f,m,n);return buildNetworkRequestOrResponse(f,m,void 0)}catch(n){return rY&&eN.kg.warn("[Replay] Failed to serialize response body",n),buildNetworkRequestOrResponse(f,d,void 0)}}(g,{networkCaptureBodies:l,textEncoder:u,responseBodySize:f,captureDetails:n,headers:m});return _?mergeWarning(j,_):j}async function _parseFetchResponseBody(n){let l=function(n){try{return n.clone()}catch(n){rY&&eN.kg.warn("[Replay] Failed to clone response body",n)}}(n);if(!l)return[void 0,"BODY_PARSE_ERROR"];try{let n=await new Promise((n,u)=>{let d=setTimeout(()=>u(Error("Timeout while trying to read response body")),500);_getResponseText(l).then(l=>n(l),n=>u(n)).finally(()=>clearTimeout(d))});return[n]}catch(n){return rY&&eN.kg.warn("[Replay] Failed to get text body from response",n),[void 0,"BODY_PARSE_ERROR"]}}function _getFetchRequestArgBody(n=[]){if(2===n.length&&"object"==typeof n[1])return n[1].body}function getAllHeaders(n,l){let u={};return l.forEach(l=>{n.get(l)&&(u[l]=n.get(l))}),u}function getHeadersFromOptions(n,l){if(!n)return{};let u=n.headers;return u?u instanceof Headers?getAllHeaders(u,l):Array.isArray(u)?{}:getAllowedHeaders(u,l):{}}async function _getResponseText(n){return await n.text()}async function captureXhrBreadcrumbToReplay(n,l,u){try{let d=function(n,l,u){let d=Date.now(),{startTimestamp:h=d,endTimestamp:f=d,input:m,xhr:g}=l,{url:_,method:j,status_code:$=0,request_body_size:z,response_body_size:ee}=n.data;if(!_)return null;if(!g||!urlMatches(_,u.networkDetailAllowUrls)||urlMatches(_,u.networkDetailDenyUrls)){let n=buildSkippedNetworkRequestOrResponse(z),l=buildSkippedNetworkRequestOrResponse(ee);return{startTimestamp:h,endTimestamp:f,url:_,method:j,statusCode:$,request:n,response:l}}let et=g[tc],en=et?getAllowedHeaders(et.request_headers,u.networkRequestHeaders):{},eo=getAllowedHeaders(function(n){let l=n.getAllResponseHeaders();return l?l.split("\r\n").reduce((n,l)=>{let[u,d]=l.split(": ");return n[u.toLowerCase()]=d,n},{}):{}}(g),u.networkResponseHeaders),[es,el]=u.networkCaptureBodies?getBodyString(m):[void 0],[eu,ec]=u.networkCaptureBodies?function(n){let l=[];try{return[n.responseText]}catch(n){l.push(n)}try{return function(n,l){try{if("string"==typeof n)return[n];if(n instanceof Document)return[n.body.outerHTML];if("json"===l&&n&&"object"==typeof n)return[JSON.stringify(n)];if(!n)return[void 0]}catch(l){return rY&&eN.kg.warn("[Replay] Failed to serialize body",n),[void 0,"BODY_PARSE_ERROR"]}return rY&&eN.kg.info("[Replay] Skipping network body because of body type",n),[void 0,"UNPARSEABLE_BODY_TYPE"]}(n.response,n.responseType)}catch(n){l.push(n)}return rY&&eN.kg.warn("[Replay] Failed to get xhr response body",...l),[void 0]}(g):[void 0],eh=buildNetworkRequestOrResponse(en,z,es),ep=buildNetworkRequestOrResponse(eo,ee,eu);return{startTimestamp:h,endTimestamp:f,url:_,method:j,statusCode:$,request:el?mergeWarning(eh,el):eh,response:ec?mergeWarning(ep,ec):ep}}(n,l,u),h=makeNetworkReplayBreadcrumb("resource.xhr",d);addNetworkBreadcrumb(u.replay,h)}catch(n){rY&&eN.kg.error("[Replay] Failed to capture xhr breadcrumb",n)}}let rQ=null,handleScopeListener=n=>l=>{if(!n.isEnabled())return;let u=function(n){let l=n.getLastBreadcrumb&&n.getLastBreadcrumb();return rQ!==l&&l?(rQ=l,!l.category||["fetch","xhr","sentry.event","sentry.transaction"].includes(l.category)||l.category.startsWith("ui."))?null:"console"===l.category?function(n){let l=n.data&&n.data.arguments;if(!Array.isArray(l)||0===l.length)return createBreadcrumb(n);let u=!1,d=l.map(n=>{if(!n)return n;if("string"==typeof n)return n.length>5e3?(u=!0,`${n.slice(0,5e3)}…`):n;if("object"==typeof n)try{let l=(0,e7.Fv)(n,7),d=JSON.stringify(l);if(d.length>5e3)return u=!0,`${JSON.stringify(l,null,2).slice(0,5e3)}…`;return l}catch(n){}return n});return createBreadcrumb({...n,data:{...n.data,arguments:d,...u?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(l):createBreadcrumb(l):null}(l);u&&addBreadcrumbEvent(n,u)};async function addMemoryEntry(n){try{return Promise.all(createPerformanceSpans(n,[function(n){let{jsHeapSizeLimit:l,totalJSHeapSize:u,usedJSHeapSize:d}=n,h=Date.now()/1e3;return{type:"memory",name:"memory",start:h,end:h,data:{memory:{jsHeapSizeLimit:l,totalJSHeapSize:u,usedJSHeapSize:d}}}}(rw.performance.memory)]))}catch(n){return[]}}async function prepareReplayEvent({client:n,scope:l,replayId:u,event:d}){let h="object"!=typeof n._integrations||null===n._integrations||Array.isArray(n._integrations)?void 0:Object.keys(n._integrations),f={event_id:u,integrations:h};n.emit&&n.emit("preprocessEvent",d,f);let m=await (0,tO.R)(n.getOptions(),d,f,l,n,(0,eL.aF)());if(!m)return null;m.platform=m.platform||"javascript";let g=n.getSdkMetadata&&n.getSdkMetadata(),{name:_,version:j}=g&&g.sdk||{};return m.sdk={...m.sdk,name:_||"sentry.javascript.unknown",version:j||"0.0.0"},m}async function sendReplayRequest({recordingData:n,replayId:l,segmentId:u,eventContext:d,timestamp:h,session:f}){var m;let g;let _=function({recordingData:n,headers:l}){let u;let d=`${JSON.stringify(l)}
`;if("string"==typeof n)u=`${d}${n}`;else{let l=new TextEncoder,h=l.encode(d);(u=new Uint8Array(h.length+n.length)).set(h),u.set(n,h.length)}return u}({recordingData:n,headers:{segment_id:u}}),{urls:j,errorIds:$,traceIds:z,initialTimestamp:ee}=d,et=(0,ex.s3)(),en=(0,ex.nZ)(),eo=et&&et.getTransport(),es=et&&et.getDsn();if(!et||!eo||!es||!f.sampled)return;let el={type:"replay_event",replay_start_timestamp:ee/1e3,timestamp:h/1e3,error_ids:$,trace_ids:z,urls:j,replay_id:l,segment_id:u,replay_type:f.sampled},eu=await prepareReplayEvent({scope:en,client:et,replayId:l,event:el});if(!eu){et.recordDroppedEvent("event_processor","replay",el),logInfo("An event processor returned `null`, will not send event.");return}delete eu.sdkProcessingMetadata;let ec=(m=et.getOptions().tunnel,createEnvelope(createEventEnvelopeHeaders(eu,getSdkMetadataForEnvelopeHeader(eu),m,es),[[{type:"replay_event"},eu],[{type:"replay_recording",length:"string"==typeof _?new TextEncoder().encode(_).length:_.length},_]]));try{g=await eo.send(ec)}catch(l){let n=Error(rI);try{n.cause=l}catch(n){}throw n}if(!g)return g;if("number"==typeof g.statusCode&&(g.statusCode<200||g.statusCode>=300))throw new TransportStatusCodeError(g.statusCode);let eh=updateRateLimits({},g);if(isRateLimited(eh,"replay"))throw new RateLimitError(eh);return g}let TransportStatusCodeError=class TransportStatusCodeError extends Error{constructor(n){super(`Transport returned status code ${n}`)}};let RateLimitError=class RateLimitError extends Error{constructor(n){super("Rate limit hit"),this.rateLimits=n}};async function sendReplay(n,l={count:0,interval:5e3}){let{recordingData:u,options:d}=n;if(u.length)try{return await sendReplayRequest(n),!0}catch(u){if(u instanceof TransportStatusCodeError||u instanceof RateLimitError)throw u;if((0,ex.v)("Replays",{_retryCount:l.count}),rY&&d._experiments&&d._experiments.captureExceptions&&(0,ex.Tb)(u),l.count>=3){let n=Error(`${rI} - max retries exceeded`);try{n.cause=u}catch(n){}throw n}return l.interval*=++l.count,new Promise((u,d)=>{setTimeout(async()=>{try{await sendReplay(n,l),u(!0)}catch(n){d(n)}},l.interval)})}}let rJ="__THROTTLED";let ReplayContainer=class ReplayContainer{constructor({options:n,recordingOptions:l}){ReplayContainer.prototype.__init.call(this),ReplayContainer.prototype.__init2.call(this),ReplayContainer.prototype.__init3.call(this),ReplayContainer.prototype.__init4.call(this),ReplayContainer.prototype.__init5.call(this),ReplayContainer.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=l,this._options=n,this._debouncedFlush=function(n,l,u){let d,h,f;let m=u&&u.maxWait?Math.max(u.maxWait,l):0;function invokeFunc(){return cancelTimers(),d=n()}function cancelTimers(){void 0!==h&&clearTimeout(h),void 0!==f&&clearTimeout(f),h=f=void 0}function debounced(){return h&&clearTimeout(h),h=setTimeout(invokeFunc,l),m&&void 0===f&&(f=setTimeout(invokeFunc,m)),d}return debounced.cancel=cancelTimers,debounced.flush=function(){return void 0!==h||void 0!==f?invokeFunc():d},debounced}(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=function(n,l,u){let d=new Map,_cleanup=n=>{let l=n-5;d.forEach((n,u)=>{u<l&&d.delete(u)})},_getTotalCount=()=>[...d.values()].reduce((n,l)=>n+l,0),h=!1;return(...l)=>{let u=Math.floor(Date.now()/1e3);if(_cleanup(u),_getTotalCount()>=300){let n=h;return h=!0,n?"__SKIPPED":rJ}h=!1;let f=d.get(u)||0;return d.set(u,f+1),n(...l)}}((n,l)=>shouldAddEvent(this,n)?_addEvent(this,n,l):Promise.resolve(null),0,0);let{slowClickTimeout:u,slowClickIgnoreSelectors:d}=this.getOptions(),h=u?{threshold:Math.min(3e3,u),timeout:u,scrollTimeout:300,ignoreSelector:d?d.join(","):""}:void 0;h&&(this.clickDetector=new ClickDetector(this,h))}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}initializeSampling(n){let{errorSampleRate:l,sessionSampleRate:u}=this._options;if(!(l<=0)||!(u<=0)){if(this._initializeSessionForSampling(n),!this.session){this._handleException(Error("Unable to initialize and create session"));return}!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",logInfoNextTick(`[Replay] Starting replay in ${this.recordingMode} mode`,this._options._experiments.traceInternals),this._initializeRecording())}}start(){if(this._isEnabled&&"session"===this.recordingMode)throw Error("Replay recording is already in progress");if(this._isEnabled&&"buffer"===this.recordingMode)throw Error("Replay buffering is in progress, call `flush()` to save the replay");logInfoNextTick("[Replay] Starting replay in session mode",this._options._experiments.traceInternals),this._updateUserActivity();let n=loadOrCreateSession({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=n,this._initializeRecording()}startBuffering(){if(this._isEnabled)throw Error("Replay recording is already in progress");logInfoNextTick("[Replay] Starting replay in buffer mode",this._options._experiments.traceInternals);let n=loadOrCreateSession({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=n,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{var n;let l;let u=this._canvas;this._stopRecording=record({...this._recordingOptions,..."buffer"===this.recordingMode&&{checkoutEveryNms:6e4},emit:(n=this,l=!1,(u,d)=>{if(!n.checkAndHandleExpiredSession()){rY&&eN.kg.warn("[Replay] Received replay event after session expired.");return}let h=d||!l;l=!0,n.clickDetector&&function(n,l){try{if(3!==l.type)return;let{source:u}=l.data;if(u===rU.Mutation&&n.registerMutation(l.timestamp),u===rU.Scroll&&n.registerScroll(l.timestamp),l.data.source===rU.MouseInteraction){let{type:u,id:d}=l.data,h=record.mirror.getNode(d);h instanceof HTMLElement&&u===rB.Click&&n.registerClick(h)}}catch(n){}}(n.clickDetector,u),n.addUpdate(()=>{if("buffer"===n.recordingMode&&h&&n.setInitialState(),!addEventSync(n,u,h))return!0;if(!h)return!1;if(h&&n.session&&0===n.session.segmentId&&addEventSync(n,function(n){let l=n.getOptions();return{type:rj.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:n.isRecordingCanvas(),sessionSampleRate:l.sessionSampleRate,errorSampleRate:l.errorSampleRate,useCompressionOption:l.useCompression,blockAllMedia:l.blockAllMedia,maskAllText:l.maskAllText,maskAllInputs:l.maskAllInputs,useCompression:!!n.eventBuffer&&"worker"===n.eventBuffer.type,networkDetailHasUrls:l.networkDetailAllowUrls.length>0,networkCaptureBodies:l.networkCaptureBodies,networkRequestHasHeaders:l.networkRequestHeaders.length>0,networkResponseHasHeaders:l.networkResponseHeaders.length>0}}}}(n),!1),n.session&&n.session.previousSessionId)return!0;if("buffer"===n.recordingMode&&n.session&&n.eventBuffer){let l=n.eventBuffer.getEarliestTimestamp();l&&(logInfo(`[Replay] Updating session start time to earliest event in buffer to ${new Date(l)}`,n.getOptions()._experiments.traceInternals),n.session.started=l,n.getOptions().stickySession&&saveSession(n.session))}return"session"===n.recordingMode&&n.flush(),!0})}),onMutation:this._onMutationHandler,...u?{recordCanvas:u.recordCanvas,getCanvasManager:u.getCanvasManager,sampling:u.sampling,dataURLOptions:u.dataURLOptions}:{}})}catch(n){this._handleException(n)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(n){return this._handleException(n),!1}}async stop({forceFlush:n=!1,reason:l}={}){if(this._isEnabled){this._isEnabled=!1;try{logInfo(`[Replay] Stopping Replay${l?` triggered by ${l}`:""}`,this._options._experiments.traceInternals),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),n&&await this._flush({force:!0}),this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,function(){if(hasSessionStorage())try{rw.sessionStorage.removeItem(rT)}catch(n){}}(),this.session=void 0}catch(n){this._handleException(n)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),logInfo("[Replay] Pausing replay",this._options._experiments.traceInternals))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),logInfo("[Replay] Resuming replay",this._options._experiments.traceInternals))}async sendBufferedReplayOrFlush({continueRecording:n=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();let l=Date.now();logInfo("[Replay] Converting buffer to session",this._options._experiments.traceInternals),await this.flushImmediate();let u=this.stopRecording();n&&u&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this._updateUserActivity(l),this._updateSessionActivity(l),this._maybeSaveSession()),this.startRecording())}addUpdate(n){let l=n();"buffer"!==this.recordingMode&&!0!==l&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}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}checkAndHandleExpiredSession(){if(this._lastActivity&&isExpired(this._lastActivity,this.timeouts.sessionIdlePause)&&this.session&&"session"===this.session.sampled){this.pause();return}return!!this._checkSession()}setInitialState(){let n=`${rw.location.pathname}${rw.location.hash}${rw.location.search}`,l=`${rw.location.origin}${n}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=l,this._context.initialTimestamp=Date.now(),this._context.urls.push(l)}throttledAddEvent(n,l){let u=this._throttledAddEvent(n,l);if(u===rJ){let n=createBreadcrumb({category:"replay.throttled"});this.addUpdate(()=>!addEventSync(this,{type:5,timestamp:n.timestamp||0,data:{tag:"breadcrumb",payload:n,metric:!0}}))}return u}getCurrentRoute(){let n=this.lastTransaction||(0,ex.nZ)().getTransaction(),l=n&&(0,tW.XU)(n).data||{},u=l[tq];if(n&&u&&["route","custom"].includes(u))return(0,tW.XU)(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=function({useCompression:n,workerUrl:l}){if(n&&window.Worker){let n=function(n){try{let l=n||("undefined"!=typeof __SENTRY_EXCLUDE_REPLAY_WORKER__&&__SENTRY_EXCLUDE_REPLAY_WORKER__?"":function(){let n=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))},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;++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(n)}());if(!l)return;logInfo(`[Replay] Using compression worker${n?` from ${n}`:""}`);let u=new Worker(l);return new EventBufferProxy(u)}catch(n){logInfo("[Replay] Failed to create compression worker")}}(l);if(n)return n}return logInfo("[Replay] Using simple buffer"),new EventBufferArray}({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_handleException(n){rY&&eN.kg.error("[Replay]",n),rY&&this._options._experiments&&this._options._experiments.captureExceptions&&(0,ex.Tb)(n)}_initializeSessionForSampling(n){let l=this._options.errorSampleRate>0,u=loadOrCreateSession({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,traceInternals:this._options._experiments.traceInternals,previousSessionId:n},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:l});this.session=u}_checkSession(){if(!this.session)return!1;let n=this.session;return!shouldRefreshSession(n,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(n),!1)}async _refreshSession(n){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(n.id))}_addListeners(){try{rw.document.addEventListener("visibilitychange",this._handleVisibilityChange),rw.addEventListener("blur",this._handleWindowBlur),rw.addEventListener("focus",this._handleWindowFocus),rw.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(function(n){let l=(0,ex.nZ)(),u=(0,ex.s3)();l.addScopeListener(handleScopeListener(n)),addClickKeypressInstrumentationHandler(handleDomListener(n)),addHistoryInstrumentationHandler(l=>{if(!n.isEnabled())return;let u=function(n){let{from:l,to:u}=n,d=Date.now()/1e3;return{type:"navigation.push",start:d,end:d,name:u,data:{previous:l}}}(l);null!==u&&(n.getContext().urls.push(u.name),n.triggerUserActivity(),n.addUpdate(()=>(createPerformanceSpans(n,[u]),!1)))}),function(n){let l=(0,ex.s3)();try{let u=new TextEncoder,{networkDetailAllowUrls:d,networkDetailDenyUrls:h,networkCaptureBodies:f,networkRequestHeaders:m,networkResponseHeaders:g}=n.getOptions(),_={replay:n,textEncoder:u,networkDetailAllowUrls:d,networkDetailDenyUrls:h,networkCaptureBodies:f,networkRequestHeaders:m,networkResponseHeaders:g};l&&l.on?l.on("beforeAddBreadcrumb",(n,l)=>(function(n,l,u){if(l.data)try{var d,h;"xhr"===l.category&&(d=u)&&d.xhr&&(function(n,l,u){let{xhr:d,input:h}=l;if(!d)return;let f=getBodySize(h,u.textEncoder),m=d.getResponseHeader("content-length")?parseContentLengthHeader(d.getResponseHeader("content-length")):function(n,l,u){try{let d="json"===l&&n&&"object"==typeof n?JSON.stringify(n):n;return getBodySize(d,u)}catch(n){return}}(d.response,d.responseType,u.textEncoder);void 0!==f&&(n.data.request_body_size=f),void 0!==m&&(n.data.response_body_size=m)}(l,u,n),captureXhrBreadcrumbToReplay(l,u,n)),"fetch"===l.category&&(h=u)&&h.response&&(function(n,l,u){let{input:d,response:h}=l,f=d?_getFetchRequestArgBody(d):void 0,m=getBodySize(f,u.textEncoder),g=h?parseContentLengthHeader(h.headers.get("content-length")):void 0;void 0!==m&&(n.data.request_body_size=m),void 0!==g&&(n.data.response_body_size=g)}(l,u,n),captureFetchBreadcrumbToReplay(l,u,n))}catch(n){rY&&eN.kg.warn("Error when enriching network breadcrumb")}})(_,n,l)):(addFetchInstrumentationHandler(l=>{if(!n.isEnabled())return;let u=function(n){let{startTimestamp:l,endTimestamp:u,fetchData:d,response:h}=n;if(!u)return null;let{method:f,url:m}=d;return{type:"resource.fetch",start:l/1e3,end:u/1e3,name:m,data:{method:f,statusCode:h?h.status:void 0}}}(l);addNetworkBreadcrumb(n,u)}),addXhrInstrumentationHandler(l=>{if(!n.isEnabled())return;let u=function(n){let{startTimestamp:l,endTimestamp:u,xhr:d}=n,h=d[tc];if(!l||!u||!h)return null;let{method:f,url:m,status_code:g}=h;return void 0===m?null:{type:"resource.xhr",name:m,start:l/1e3,end:u/1e3,data:{method:f,statusCode:g}}}(l);addNetworkBreadcrumb(n,u)}))}catch(n){}}(n);let d=function(n,l=!1){let u=l?handleAfterSendEvent(n):void 0;return Object.assign((l,d)=>{if(!n.isEnabled())return l;if("replay_event"===l.type)return delete l.breadcrumbs,l;if(l.type&&!esm_isTransactionEvent(l)&&!isFeedbackEvent(l))return l;let h=n.checkAndHandleExpiredSession();if(!h)return l;if(isFeedbackEvent(l))return n.flush(),l.contexts.feedback.replay_id=n.getSessionId(),n.triggerUserActivity(),n.addUpdate(()=>!l.timestamp||(n.throttledAddEvent({type:rj.Custom,timestamp:1e3*l.timestamp,data:{tag:"breadcrumb",payload:{timestamp:l.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:l.event_id}}}}),!1)),l;if(!l.type&&l.exception&&l.exception.values&&l.exception.values.length&&d.originalException&&d.originalException.__rrweb__&&!n.getOptions()._experiments.captureExceptions)return rY&&eN.kg.log("[Replay] Ignoring error from rrweb internals",l),null;let f="buffer"===n.recordingMode&&l.message!==rI&&!!l.exception&&!l.type&&isSampled(n.getOptions().errorSampleRate),m=f||"session"===n.recordingMode;return m&&(l.tags={...l.tags,replayId:n.getSessionId()}),u&&u(l,{statusCode:200}),l},{id:"Replay"})}(n,!(u&&u.on));u&&u.addEventProcessor?u.addEventProcessor(d):function(n){let l=(0,ex.s3)();l&&l.addEventProcessor&&l.addEventProcessor(n)}(d),u&&u.on&&(u.on("beforeSendEvent",l=>{n.isEnabled()&&!l.type&&function(n,l){let u=l.exception&&l.exception.values&&l.exception.values[0].value;if("string"==typeof u&&(u.match(/reactjs\.org\/docs\/error-decoder\.html\?invariant=(418|419|422|423|425)/)||u.match(/(does not match server-rendered HTML|Hydration failed because)/i))){let l=createBreadcrumb({category:"replay.hydrate-error"});addBreadcrumbEvent(n,l)}}(n,l)}),u.on("afterSendEvent",handleAfterSendEvent(n)),u.on("createDsc",l=>{let u=n.getSessionId();if(u&&n.isEnabled()&&"session"===n.recordingMode){let d=n.checkAndHandleExpiredSession();d&&(l.replay_id=u)}}),u.on("startTransaction",l=>{n.lastTransaction=l}),u.on("finishTransaction",l=>{n.lastTransaction=l}),u.on("beforeSendFeedback",(l,u)=>{let d=n.getSessionId();u&&u.includeReplay&&n.isEnabled()&&d&&l.contexts&&l.contexts.feedback&&(l.contexts.feedback.replay_id=d)}))}(this),this._hasInitializedCoreListeners=!0)}catch(n){this._handleException(n)}this._performanceCleanupCallback=function(n){function addPerformanceEntry(l){n.performanceEntries.includes(l)||n.performanceEntries.push(l)}function onEntries({entries:n}){n.forEach(addPerformanceEntry)}let l=[];return["navigation","paint","resource"].forEach(n=>{l.push(addPerformanceInstrumentationHandler(n,onEntries))}),l.push(addLcpInstrumentationHandler(({metric:l})=>{n.replayPerformanceEntries.push(function(n){let l=n.entries,u=l[l.length-1],d=u?u.element:void 0,h=n.value,f=esm_getAbsoluteTime(h),m={type:"largest-contentful-paint",name:"largest-contentful-paint",start:f,end:f,data:{value:h,size:h,nodeId:d?record.mirror.getId(d):void 0}};return m}(l))})),()=>{l.forEach(n=>n())}}(this)}_removeListeners(){try{rw.document.removeEventListener("visibilitychange",this._handleVisibilityChange),rw.removeEventListener("blur",this._handleWindowBlur),rw.removeEventListener("focus",this._handleWindowFocus),rw.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(n){this._handleException(n)}}__init(){this._handleVisibilityChange=()=>{"visible"===rw.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()}}__init2(){this._handleWindowBlur=()=>{let n=createBreadcrumb({category:"ui.blur"});this._doChangeToBackgroundTasks(n)}}__init3(){this._handleWindowFocus=()=>{let n=createBreadcrumb({category:"ui.focus"});this._doChangeToForegroundTasks(n)}}__init4(){this._handleKeyboardEvent=n=>{!function(n,l){if(!n.isEnabled())return;n.updateUserActivity();let u=function(n){var l;let{metaKey:u,shiftKey:d,ctrlKey:h,altKey:f,key:m,target:g}=n;if(!g||"INPUT"===(l=g).tagName||"TEXTAREA"===l.tagName||l.isContentEditable||!m)return null;let _=1===m.length;if(!(u||h||f)&&_)return null;let j=(0,e9.Rt)(g,{maxStringLength:200})||"<unknown>",$=getBaseDomBreadcrumb(g,j);return createBreadcrumb({category:"ui.keyDown",message:j,data:{...$.data,metaKey:u,shiftKey:d,ctrlKey:h,altKey:f,key:m}})}(l);u&&addBreadcrumbEvent(n,u)}(this,n)}}_doChangeToBackgroundTasks(n){if(!this.session)return;let l=isSessionExpired(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire});l||(n&&this._createCustomBreadcrumb(n),this.conditionalFlush())}_doChangeToForegroundTasks(n){if(!this.session)return;let l=this.checkAndHandleExpiredSession();if(!l){logInfo("[Replay] Document has become active, but session has expired");return}n&&this._createCustomBreadcrumb(n)}_updateUserActivity(n=Date.now()){this._lastActivity=n}_updateSessionActivity(n=Date.now()){this.session&&(this.session.lastActivity=n,this._maybeSaveSession())}_createCustomBreadcrumb(n){this.addUpdate(()=>{this.throttledAddEvent({type:rj.Custom,timestamp:n.timestamp||0,data:{tag:"breadcrumb",payload:n}})})}_addPerformanceEntries(){let n=this.performanceEntries.map(createPerformanceEntry).filter(Boolean).concat(this.replayPerformanceEntries);return this.performanceEntries=[],this.replayPerformanceEntries=[],Promise.all(createPerformanceSpans(this,n))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){let{session:n,eventBuffer:l}=this;if(!n||!l||n.segmentId)return;let u=l.getEarliestTimestamp();u&&u<this._context.initialTimestamp&&(this._context.initialTimestamp=u)}_popEventContext(){let n={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(),n}async _runFlush(){let n=this.getSessionId();if(!this.session||!this.eventBuffer||!n){rY&&eN.kg.error("[Replay] No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),this.eventBuffer&&this.eventBuffer.hasEvents&&(await addMemoryEntry(this),this.eventBuffer&&n===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();let l=Date.now();if(l-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw Error("Session is too long, not sending replay");let u=this._popEventContext(),d=this.session.segmentId++;this._maybeSaveSession();let h=await this.eventBuffer.finish();await sendReplay({replayId:n,recordingData:h,segmentId:d,eventContext:u,session:this.session,options:this.getOptions(),timestamp:l})}catch(l){this._handleException(l),this.stop({reason:"sendReplay"});let n=(0,ex.s3)();n&&n.recordDroppedEvent("send_error","replay")}}__init5(){this._flush=async({force:n=!1}={})=>{if(!this._isEnabled&&!n)return;if(!this.checkAndHandleExpiredSession()){rY&&eN.kg.error("[Replay] Attempting to finish replay event after session expired.");return}if(!this.session)return;let l=this.session.started,u=Date.now(),d=u-l;this._debouncedFlush.cancel();let h=d<this._options.minReplayDuration,f=d>this._options.maxReplayDuration+5e3;if(h||f){logInfo(`[Replay] Session duration (${Math.floor(d/1e3)}s) is too ${h?"short":"long"}, not sending replay.`,this._options._experiments.traceInternals),h&&this._debouncedFlush();return}let m=this.eventBuffer;if(m&&0===this.session.segmentId&&!m.hasCheckout&&logInfo("[Replay] Flushing initial segment without checkout.",this._options._experiments.traceInternals),!this._flushLock){this._flushLock=this._runFlush(),await this._flushLock,this._flushLock=void 0;return}try{await this._flushLock}catch(n){rY&&eN.kg.error(n)}finally{this._debouncedFlush()}}}_maybeSaveSession(){this.session&&this._options.stickySession&&saveSession(this.session)}__init6(){this._onMutationHandler=n=>{let l=n.length,u=this._options.mutationLimit,d=this._options.mutationBreadcrumbLimit,h=u&&l>u;if(l>d||h){let n=createBreadcrumb({category:"replay.mutations",data:{count:l,limit:h}});this._createCustomBreadcrumb(n)}return!h||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}};function getOption(n,l,u,d){let h="string"==typeof d?d.split(","):[],f=[...n,...h,...l];return void 0!==u&&("string"==typeof u&&f.push(`.${u}`),(0,eN.Cf)(()=>{console.warn("[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.")})),f.join(",")}let rZ='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',r0=["content-length","content-type","accept"],r1=!1;let Replay$1=class Replay$1{static __initStatic(){this.id="Replay"}constructor({flushMinDelay:n=5e3,flushMaxDelay:l=5500,minReplayDuration:u=4999,maxReplayDuration:d=36e5,stickySession:h=!0,useCompression:f=!0,workerUrl:m,_experiments:g={},sessionSampleRate:_,errorSampleRate:j,maskAllText:$=!0,maskAllInputs:z=!0,blockAllMedia:ee=!0,mutationBreadcrumbLimit:et=750,mutationLimit:en=1e4,slowClickTimeout:eo=7e3,slowClickIgnoreSelectors:es=[],networkDetailAllowUrls:el=[],networkDetailDenyUrls:eu=[],networkCaptureBodies:ec=!0,networkRequestHeaders:eh=[],networkResponseHeaders:ep=[],mask:ef=[],maskAttributes:em=["title","placeholder"],unmask:eg=[],block:e_=[],unblock:ey=[],ignore:ev=[],maskFn:eE,beforeAddRecordingEvent:eS,beforeErrorSampling:ew,blockClass:eT,blockSelector:eI,maskInputOptions:eR,maskTextClass:eP,maskTextSelector:eA,ignoreClass:eO}={}){this.name=Replay$1.id;let eC=function({mask:n,unmask:l,block:u,unblock:d,ignore:h,blockClass:f,blockSelector:m,maskTextClass:g,maskTextSelector:_,ignoreClass:j}){let $=getOption(n,[".sentry-mask","[data-sentry-mask]"],g,_),z=getOption(l,[".sentry-unmask","[data-sentry-unmask]"]),ee={maskTextSelector:$,unmaskTextSelector:z,blockSelector:getOption(u,[".sentry-block","[data-sentry-block]",'base[href="/"]'],f,m),unblockSelector:getOption(d,[".sentry-unblock","[data-sentry-unblock]"]),ignoreSelector:getOption(h,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'],j)};return f instanceof RegExp&&(ee.blockClass=f),g instanceof RegExp&&(ee.maskTextClass=g),ee}({mask:ef,unmask:eg,block:e_,unblock:ey,ignore:ev,blockClass:eT,blockSelector:eI,maskTextClass:eP,maskTextSelector:eA,ignoreClass:eO});if(this._recordingOptions={maskAllInputs:z,maskAllText:$,maskInputOptions:{...eR||{},password:!0},maskTextFn:eE,maskInputFn:eE,maskAttributeFn:(n,l,u)=>(function({el:n,key:l,maskAttributes:u,maskAllText:d,privacyOptions:h,value:f}){return!d||h.unmaskTextSelector&&n.matches(h.unmaskTextSelector)?f:u.includes(l)||"value"===l&&"INPUT"===n.tagName&&["submit","button"].includes(n.getAttribute("type")||"")?f.replace(/[\S]/g,"*"):f})({maskAttributes:em,maskAllText:$,privacyOptions:eC,key:n,value:l,el:u}),...eC,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:n=>{try{n.__rrweb__=!0}catch(n){}}},this._initialOptions={flushMinDelay:n,flushMaxDelay:l,minReplayDuration:Math.min(u,15e3),maxReplayDuration:Math.min(d,36e5),stickySession:h,sessionSampleRate:_,errorSampleRate:j,useCompression:f,workerUrl:m,blockAllMedia:ee,maskAllInputs:z,maskAllText:$,mutationBreadcrumbLimit:et,mutationLimit:en,slowClickTimeout:eo,slowClickIgnoreSelectors:es,networkDetailAllowUrls:el,networkDetailDenyUrls:eu,networkCaptureBodies:ec,networkRequestHeaders:_getMergedNetworkHeaders(eh),networkResponseHeaders:_getMergedNetworkHeaders(ep),beforeAddRecordingEvent:eS,beforeErrorSampling:ew,_experiments:g},"number"==typeof _&&(console.warn(`[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysSessionSampleRate: ${_} })`),this._initialOptions.sessionSampleRate=_),"number"==typeof j&&(console.warn(`[Replay] You are passing \`errorSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysOnErrorSampleRate: ${j} })`),this._initialOptions.errorSampleRate=j),this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${rZ}`:rZ),this._isInitialized&&isBrowser())throw Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return r1}set _isInitialized(n){r1=n}setupOnce(){isBrowser()&&(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(n){return this._replay&&this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(n):Promise.resolve()}getReplayId(){if(this._replay&&this._replay.isEnabled())return this._replay.getSessionId()}_initialize(){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(),this._replay.initializeSampling())}_setup(){let n=function(n){let l=(0,ex.s3)(),u=l&&l.getOptions(),d={sessionSampleRate:0,errorSampleRate:0,...(0,eM.Jr)(n)};return u?(null==n.sessionSampleRate&&null==n.errorSampleRate&&null==u.replaysSessionSampleRate&&null==u.replaysOnErrorSampleRate&&(0,eN.Cf)(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),"number"==typeof u.replaysSessionSampleRate&&(d.sessionSampleRate=u.replaysSessionSampleRate),"number"==typeof u.replaysOnErrorSampleRate&&(d.errorSampleRate=u.replaysOnErrorSampleRate)):(0,eN.Cf)(()=>{console.warn("SDK client is not available.")}),d}(this._initialOptions);this._replay=new ReplayContainer({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(){try{let n=(0,ex.s3)(),l=n.getIntegrationByName("ReplayCanvas");if(!l)return;this._replay._canvas=l.getOptions()}catch(n){}}};function _getMergedNetworkHeaders(n){return[...r0,...n.map(n=>n.toLowerCase())]}Replay$1.__initStatic();var r2=window;r2.__sentryRewritesTunnelPath__=void 0,r2.SENTRY_RELEASE={id:"5f409e4109afe60a9ac9e257146893e135335e0a"},r2.__sentryBasePath=void 0,r2.__rewriteFramesAssetPrefixPath__="",function(n){let l={environment:function(n){let l=n?"production":tH.env.VERCEL_ENV;return l?`vercel-${l}`:void 0}(!0)||"production",defaultIntegrations:function(n){let l=[...t$,rewriteFramesIntegration_rewriteFramesIntegration()];return("undefined"==typeof __SENTRY_TRACING__||__SENTRY_TRACING__)&&hasTracingEnabled(n)&&l.push(browserTracingIntegration_browserTracingIntegration()),l}(n),...n};(function(n){let{integrations:l}=n;l&&(Array.isArray(l)?n.integrations=maybeUpdateBrowserTracingIntegration(l):n.integrations=n=>{let u=l(n);return maybeUpdateBrowserTracingIntegration(u)})})(l),function(n){let l=rE.__sentryRewritesTunnelPath__;if(l&&n.dsn){let u=dsnFromString(n.dsn);if(!u)return;let d=u.host.match(/^o(\d+)\.ingest(?:\.([a-z]{2}))?\.sentry\.io$/);if(d){let h=d[1],f=d[2],m=`${l}?o=${h}&p=${u.projectId}`;f&&(m+=`&r=${f}`),n.tunnel=m,rm.X&&eN.kg.info(`Tunneling events to "${m}"`)}else rm.X&&eN.kg.warn("Provided DSN is not a Sentry SaaS DSN. Will not tunnel events.")}}(l),applySdkMetadata(l,"nextjs",["nextjs","react"]),function(n){let l={...n};applySdkMetadata(l,"react"),function(n={}){void 0===n.defaultIntegrations&&(n.defaultIntegrations=[...t$]),void 0===n.release&&("string"==typeof __SENTRY_RELEASE__&&(n.release=__SENTRY_RELEASE__),eJ.SENTRY_RELEASE&&eJ.SENTRY_RELEASE.id&&(n.release=eJ.SENTRY_RELEASE.id)),void 0===n.autoSessionTracking&&(n.autoSessionTracking=!0),void 0===n.sendClientReports&&(n.sendClientReports=!0);let l={...n,stackParser:(0,e1.Sq)(n.stackParser||tB),integrations:function(n){let l;let u=n.defaultIntegrations||[],d=n.integrations;u.forEach(n=>{n.isDefaultInstance=!0}),l=Array.isArray(d)?[...u,...d]:"function"==typeof d?(0,eD.lE)(d(u)):u;let h=function(n){let l={};return n.forEach(n=>{let{name:u}=n,d=l[u];d&&!d.isDefaultInstance&&n.isDefaultInstance||(l[u]=n)}),Object.keys(l).map(n=>l[n])}(l),f=function(n,l){for(let u=0;u<n.length;u++)if(!0===l(n[u]))return u;return -1}(h,n=>"Debug"===n.name);if(-1!==f){let[n]=h.splice(f,1);h.push(n)}return h}(n),transport:n.transport||(supportsFetch()?makeFetchTransport:makeXHRTransport)};(function(n,l){!0===l.debug&&(eV.X?eN.kg.enable():(0,eN.Cf)(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")}));let u=(0,ex.nZ)();u.update(l.initialScope);let d=new n(l);(function(n){let l=(0,eL.Gd)(),u=l.getStackTop();u.client=n,u.scope.setClient(n)})(d),d.init?d.init():d.setupIntegrations&&d.setupIntegrations()})(BrowserClient,l),n.autoSessionTracking&&function(){if(void 0===eJ.document){e6&&eN.kg.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}(0,ex.yj)({ignoreDuration:!0}),(0,ex.cg)(),addHistoryInstrumentationHandler(({from:n,to:l})=>{void 0!==n&&n!==l&&((0,ex.yj)({ignoreDuration:!0}),(0,ex.cg)())})}()}(l)}(l);let u=(0,ex.nZ)();u.setTag("runtime","browser");let filterTransactions=n=>"transaction"===n.type&&"/404"===n.transaction?null:n;filterTransactions.id="NextClient404Filter",u.addEventProcessor(filterTransactions)}({dsn:"https://297d9b5f85ed4f73934dc622fe2e9b49@o1410859.ingest.sentry.io/6753367",tracesSampleRate:1,debug:!1,replaysOnErrorSampleRate:1,replaysSessionSampleRate:.1,integrations:[new Replay$1({maskAllText:!0,blockAllMedia:!0})]})},73986:function(n,l,u){"use strict";let d;u.d(l,{$:function(){return Sound}});var h,f,m=u(95062),g=u(67587),_=u(99347),j=u(95338),$=u(18065),z=u(31368);let AssetSourceResolver=class AssetSourceResolver{constructor(n,l,u){this.serverUrl=n||"https://expo.dev",this.jsbundleUrl=null,this.asset=u}isLoadedFromServer(){return!0}isLoadedFromFileSystem(){return!1}defaultAsset(){return this.assetServerURL()}assetServerURL(){let n=new URL(function(n){let l=AssetSourceResolver.pickScale(n.scales,$.Z.get()),u=n.type?`.${n.type}`:"";return n.httpServerLocation.replace(/\.\.\//g,"_")+"/"+n.name+(1===l?"":"@"+l+"x")+u}(this.asset),this.serverUrl);return n.searchParams.set("platform",m.Z.OS),n.searchParams.set("hash",this.asset.hash),this.fromSource(n.toString().replace(n.origin,""))}fromSource(n){return{__packager_asset:!0,width:this.asset.width??void 0,height:this.asset.height??void 0,uri:n,scale:AssetSourceResolver.pickScale(this.asset.scales,$.Z.get())}}static pickScale(n,l){for(let u=0;u<n.length;u++)if(n[u]>=l)return n[u];return n[n.length-1]||1}};async function downloadAsync(n,l,u,d){return n}let ee={}.assetMapOverride;function getFilename(n){let{pathname:l,searchParams:u}=new URL(n,"https://e");return l.substring(l.lastIndexOf("/")+1)}function getFileExtension(n){let l=getFilename(n),u=l.lastIndexOf(".");return u>0?l.substring(u):""}function setCustomSourceTransformer(n){d=n}function resolveAssetSource(n){if("object"==typeof n)return n;let l=(0,j.getAssetByID)(n);if(!l)return null;let u=new AssetSourceResolver("https://expo.dev",null,l);return d?d(u):u.defaultAsset()}Object.defineProperty(resolveAssetSource,"setCustomSourceTransformer",{get:()=>setCustomSourceTransformer});let{pickScale:et}=AssetSourceResolver;let Asset=class Asset{static{this.byHash={}}static{this.byUri={}}constructor({name:n,type:l,hash:u=null,uri:d,width:h,height:f}){this.hash=null,this.localUri=null,this.width=null,this.height=null,this.downloading=!1,this.downloaded=!1,this._downloadCallbacks=[],this.name=n,this.type=l,this.hash=u,this.uri=d,"number"==typeof h&&(this.width=h),"number"==typeof f&&(this.height=f),u&&(this.localUri=null,this.localUri&&(this.downloaded=!0)),"web"!==m.Z.OS||(n||(this.name=getFilename(d)),l||(this.type=getFileExtension(d)))}static loadAsync(n){let l=Array.isArray(n)?n:[n];return Promise.all(l.map(n=>Asset.fromModule(n).downloadAsync()))}static fromModule(n){if("string"==typeof n)return Asset.fromURI(n);let l=(0,j.getAssetByID)(n);if(!l)throw Error(`Module "${n}" is missing from the asset registry`);{let{uri:u}=resolveAssetSource(n),d=new Asset({name:l.name,type:l.type,hash:l.hash,uri:u,width:l.width,height:l.height});return"android"===m.Z.OS&&!u.includes(":")&&(l.width||l.height)&&(d.localUri=d.uri,d.downloaded=!0),Asset.byHash[l.hash]=d,d}}static fromMetadata(n){let l=n.hash;if(Asset.byHash[l])return Asset.byHash[l];let{uri:u,hash:d}=function(n){ee&&ee.hasOwnProperty(n.hash)&&(n={...n,...ee[n.hash]});let l=AssetSourceResolver.pickScale(n.scales,$.Z.get()),u=n.scales.findIndex(n=>n===l),d=n.fileHashes?n.fileHashes[u]??n.fileHashes[0]:n.hash,h=n.fileUris?n.fileUris[u]??n.fileUris[0]:n.uri;if(h)return{uri:h,hash:d};let f={}.assetUrlOverride;if(f){let n=function(...n){let l=n.map((n,l)=>0===l?n.trim().replace(/\/*$/,""):n.trim().replace(/(^\/*|\/*$)/g,"")).filter(n=>n.length>0).join("/").split("/"),u=[];for(let n of l)".."===n?u.pop():"."!==n&&u.push(n);return u.join("/")}(f,d);return{uri:n,hash:d}}let g=1===l?"":`@${l}x`,_=n.type?`.${encodeURIComponent(n.type)}`:"",j=`/${encodeURIComponent(n.name)}${g}${_}`,et=new URLSearchParams({platform:m.Z.OS,hash:n.hash});if(/^https?:\/\//.test(n.httpServerLocation)){let l=n.httpServerLocation+j+"?"+et;return{uri:l,hash:d}}let en={},eo=en?.extra?.expoGo?.developer?"http://"+en.extra.expoGo.debuggerHost:({}).developer?({}).bundleUrl:null;if(eo){let l=new URL(n.httpServerLocation+j,eo);return l.searchParams.set("platform",m.Z.OS),l.searchParams.set("hash",n.hash),{uri:l.href,hash:d}}return z.Z.ExponentKernel?{uri:`https://classic-assets.eascdn.net/~assets/${encodeURIComponent(d)}`,hash:d}:{uri:"",hash:d}}(n),h=new Asset({name:n.name,type:n.type,hash:d,uri:u,width:n.width,height:n.height});return Asset.byHash[l]=h,h}static fromURI(n){if(Asset.byUri[n])return Asset.byUri[n];let l="";if(n.indexOf(";base64")>-1)l=n.split(";")[0].split("/")[1];else{let u=getFileExtension(n);l=u.startsWith(".")?u.substring(1):u}let u=new Asset({name:"",type:l,hash:null,uri:n});return Asset.byUri[n]=u,u}async downloadAsync(){if(this.downloaded)return this;if(this.downloading)return await new Promise((n,l)=>{this._downloadCallbacks.push({resolve:n,reject:l})}),this;this.downloading=!0;try{if("web"===m.Z.OS){var n,l;if(n=this.type,/^(jpeg|jpg|gif|png|bmp|webp|heic)$/i.test(n)){let{width:n,height:u,name:d}=await (l=this.uri,m.Z.isDOMAvailable?new Promise((n,u)=>{let d=new Image;d.onerror=u,d.onload=()=>{n({name:getFilename(l),width:d.naturalWidth,height:d.naturalHeight})},d.src=l}):Promise.resolve({name:getFilename(l),width:0,height:0}));this.width=n,this.height=u,this.name=d}else this.name=getFilename(this.uri)}this.localUri=await downloadAsync(this.uri,this.hash,this.type,this.name),this.downloaded=!0,this._downloadCallbacks.forEach(({resolve:n})=>n())}catch(n){throw this._downloadCallbacks.forEach(({reject:l})=>l(n)),n}finally{this.downloading=!1,this._downloadCallbacks=[]}return this}};var en=u(20877);(h=f||(f={}))[h.Low=en.Z&&en.Z.Qualities&&en.Z.Qualities.Low]="Low",h[h.Medium=en.Z&&en.Z.Qualities&&en.Z.Qualities.Medium]="Medium",h[h.High=en.Z&&en.Z.Qualities&&en.Z.Qualities.High]="High";let eo={positionMillis:0,progressUpdateIntervalMillis:500,shouldPlay:!1,rate:1,shouldCorrectPitch:!1,volume:1,audioPan:0,isMuted:!1,isLooping:!1};function _getAssetFromPlaybackSource(n){if(null==n)return null;let l=null;return"number"==typeof n?l=Asset.fromModule(n):n instanceof Asset&&(l=n),l}function assertStatusValuesInBounds(n){if("number"==typeof n.rate&&(n.rate<0||n.rate>32))throw RangeError("Rate value must be between 0.0 and 32.0");if("number"==typeof n.volume&&(n.volume<0||n.volume>1))throw RangeError("Volume value must be between 0.0 and 1.0");if("number"==typeof n.audioPan&&(n.audioPan<-1||n.audioPan>1))throw RangeError("Pan value must be between -1.0 and 1.0")}async function getNativeSourceAndFullInitialStatusForLoadAsync(n,l,u){let d=null==l?eo:{...eo,...l};if(assertStatusValuesInBounds(d),"string"==typeof n&&"web"===m.Z.OS)return{nativeSource:{uri:n,overridingExtension:null},fullInitialStatus:d};let h=_getAssetFromPlaybackSource(n);u&&h&&await h.downloadAsync();let f=function(n){let l,u=null,d=null;if("string"==typeof n&&"web"===m.Z.OS)return{uri:n,overridingExtension:d,headers:l};let h=_getAssetFromPlaybackSource(n);return(null!=h?u=h.localUri||h.uri:null!=n&&"number"!=typeof n&&"uri"in n&&"string"==typeof n.uri&&(u=n.uri),null==u)?null:(null!=n&&"number"!=typeof n&&"overrideFileExtensionAndroid"in n&&"string"==typeof n.overrideFileExtensionAndroid&&(d=n.overrideFileExtensionAndroid),null!=n&&"number"!=typeof n&&"headers"in n&&"object"==typeof n.headers&&(l=n.headers),{uri:u,overridingExtension:d,headers:l})}(n);if(null===f)throw Error("Cannot load an AV asset from a null playback source");return h&&h.localUri&&(f.uri=h.localUri),{nativeSource:f,fullInitialStatus:d}}function getUnloadedStatus(n=null){return{isLoaded:!1,...n?{error:n}:null}}let Sound=class Sound{static{this.create=async(n,l={},u=null,d=!0)=>(console.warn("Sound.create is deprecated in favor of Sound.createAsync with the same API except for the new method name"),Sound.createAsync(n,l,u,d))}static{this.createAsync=async(n,l={},u=null,d=!0)=>{let h=new Sound;h.setOnPlaybackStatusUpdate(u);let f=await h.loadAsync(n,l,d);return{sound:h,status:f}}}_callOnPlaybackStatusUpdateForNewStatus(n){let l=this._lastStatusUpdateTime&&JSON.stringify(n)===this._lastStatusUpdate&&Date.now()-this._lastStatusUpdateTime.getTime()<this._coalesceStatusUpdatesInMillis;null==this._onPlaybackStatusUpdate||l||(this._onPlaybackStatusUpdate(n),this._lastStatusUpdateTime=new Date,this._lastStatusUpdate=JSON.stringify(n))}async _performOperationAndHandleStatusAsync(n){if(this._loaded){let l=await n();return this._callOnPlaybackStatusUpdateForNewStatus(l),l}throw Error("Cannot complete operation because sound is not loaded.")}_updateAudioSampleReceivedCallback(){if(null==globalThis.__EXAV_setOnAudioSampleReceivedCallback){if("ios"===m.Z.OS||"android"===m.Z.OS){console.warn("expo-av: Failed to set up Audio Sample Buffer callback. Do you have 'Remote Debugging' enabled in your app's Developer Menu (https://docs.expo.dev/workflow/debugging)? Audio Sample Buffer callbacks are not supported while using Remote Debugging, you will need to disable it to use them.");return}throw new g.N("expo-av","setOnAudioSampleReceived")}if(null==this._key)throw Error("Cannot set Audio Sample Buffer callback when the Sound instance has not been successfully loaded/initialized!");if("number"!=typeof this._key)throw Error(`Cannot set Audio Sample Buffer callback when Sound instance key is of type ${typeof this._key}! (expected: number)`);globalThis.__EXAV_setOnAudioSampleReceivedCallback(this._key,this._onAudioSampleReceived)}_subscribeToNativeEvents(){this._loaded&&(this._subscriptions.push(this._eventEmitter.addListener("didUpdatePlaybackStatus",this._internalStatusUpdateCallback),this._eventEmitter.addListener("didUpdateMetadata",this._internalMetadataUpdateCallback)),this._subscriptions.push(this._eventEmitter.addListener("ExponentAV.onError",this._internalErrorCallback)))}_clearSubscriptions(){this._subscriptions.forEach(n=>n.remove()),this._subscriptions=[]}setOnPlaybackStatusUpdate(n){this._onPlaybackStatusUpdate=n,this.getStatusAsync()}setOnMetadataUpdate(n){this._onMetadataUpdate=n}setOnAudioSampleReceived(n){this._onAudioSampleReceived=n,null!=this._key&&this._updateAudioSampleReceivedCallback()}async loadAsync(n,l={},u=!0){if(this._loading)throw Error("The Sound is already loading.");if(this._loaded)throw Error("The Sound is already loaded.");{this._loading=!0;let{nativeSource:d,fullInitialStatus:h}=await getNativeSourceAndFullInitialStatusForLoadAsync(n,l,u);return new Promise((n,l)=>{en.Z.loadForSound(d,h).then(l=>{let[u,d]=l;this._key=u,this._loaded=!0,this._loading=!1,this._subscribeToNativeEvents(),this._callOnPlaybackStatusUpdateForNewStatus(d),n(d)}).catch(n=>{this._loading=!1,l(n)})})}}async unloadAsync(){if(!this._loaded)return this.getStatusAsync();{this._loaded=!1;let n=this._key;this._key=null;let l=await en.Z.unloadForSound(n);return this._callOnPlaybackStatusUpdateForNewStatus(l),this._clearSubscriptions(),l}}async setStatusAsync(n){return assertStatusValuesInBounds(n),this._performOperationAndHandleStatusAsync(()=>en.Z.setStatusForSound(this._key,n))}async replayAsync(n={}){if(n.positionMillis&&0!==n.positionMillis)throw Error("Requested position after replay has to be 0.");return this._performOperationAndHandleStatusAsync(()=>en.Z.replaySound(this._key,{...n,positionMillis:0,shouldPlay:!0}))}constructor(){this._loaded=!1,this._loading=!1,this._key=null,this._lastStatusUpdate=null,this._lastStatusUpdateTime=null,this._subscriptions=[],this._eventEmitter=new _.v(en.Z),this._coalesceStatusUpdatesInMillis=100,this._onPlaybackStatusUpdate=null,this._onMetadataUpdate=null,this._onAudioSampleReceived=null,this._internalStatusUpdateCallback=({key:n,status:l})=>{this._key===n&&this._callOnPlaybackStatusUpdateForNewStatus(l)},this._internalMetadataUpdateCallback=({key:n,metadata:l})=>{this._key===n&&this._onMetadataUpdate?.(l)},this._internalErrorCallback=({key:n,error:l})=>{this._key===n&&this._errorCallback(l)},this._errorCallback=n=>{this._clearSubscriptions(),this._loaded=!1,this._key=null,this._callOnPlaybackStatusUpdateForNewStatus(getUnloadedStatus(n))},this.getStatusAsync=async()=>{if(this._loaded)return this._performOperationAndHandleStatusAsync(()=>en.Z.getStatusForSound(this._key));let n=getUnloadedStatus();return this._callOnPlaybackStatusUpdateForNewStatus(n),n}}};Object.assign(Sound.prototype,{async playAsync(){return this.setStatusAsync({shouldPlay:!0})},async playFromPositionAsync(n,l={}){return this.setStatusAsync({positionMillis:n,shouldPlay:!0,seekMillisToleranceAfter:l.toleranceMillisAfter,seekMillisToleranceBefore:l.toleranceMillisBefore})},async pauseAsync(){return this.setStatusAsync({shouldPlay:!1})},async stopAsync(){return this.setStatusAsync({positionMillis:0,shouldPlay:!1})},async setPositionAsync(n,l={}){return this.setStatusAsync({positionMillis:n,seekMillisToleranceAfter:l.toleranceMillisAfter,seekMillisToleranceBefore:l.toleranceMillisBefore})},async setRateAsync(n,l=!1,u=f.Medium){return this.setStatusAsync({rate:n,shouldCorrectPitch:l,pitchCorrectionQuality:u})},async setVolumeAsync(n,l){return this.setStatusAsync({volume:n,audioPan:l})},async setIsMutedAsync(n){return this.setStatusAsync({isMuted:n})},async setIsLoopingAsync(n){return this.setStatusAsync({isLooping:n})},async setProgressUpdateIntervalAsync(n){return this.setStatusAsync({progressUpdateIntervalMillis:n})}})},20877:function(n,l,u){"use strict";u.d(l,{Z:function(){return ef}}),(d=h||(h={})).GRANTED="granted",d.UNDETERMINED="undetermined",d.DENIED="denied";var d,h,f,m,g,_,j,$,z,ee,et,en,eo=u(48968).Z;($=f||(f={}))[$.DEFAULT=0]="DEFAULT",$[$.THREE_GPP=1]="THREE_GPP",$[$.MPEG_4=2]="MPEG_4",$[$.AMR_NB=3]="AMR_NB",$[$.AMR_WB=4]="AMR_WB",$[$.AAC_ADIF=5]="AAC_ADIF",$[$.AAC_ADTS=6]="AAC_ADTS",$[$.RTP_AVP=7]="RTP_AVP",$[$.MPEG2TS=8]="MPEG2TS",$[$.WEBM=9]="WEBM",(z=m||(m={}))[z.DEFAULT=0]="DEFAULT",z[z.AMR_NB=1]="AMR_NB",z[z.AMR_WB=2]="AMR_WB",z[z.AAC=3]="AAC",z[z.HE_AAC=4]="HE_AAC",z[z.AAC_ELD=5]="AAC_ELD",(ee=g||(g={})).LINEARPCM="lpcm",ee.AC3="ac-3",ee["60958AC3"]="cac3",ee.APPLEIMA4="ima4",ee.MPEG4AAC="aac ",ee.MPEG4CELP="celp",ee.MPEG4HVXC="hvxc",ee.MPEG4TWINVQ="twvq",ee.MACE3="MAC3",ee.MACE6="MAC6",ee.ULAW="ulaw",ee.ALAW="alaw",ee.QDESIGN="QDMC",ee.QDESIGN2="QDM2",ee.QUALCOMM="Qclp",ee.MPEGLAYER1=".mp1",ee.MPEGLAYER2=".mp2",ee.MPEGLAYER3=".mp3",ee.APPLELOSSLESS="alac",ee.MPEG4AAC_HE="aach",ee.MPEG4AAC_LD="aacl",ee.MPEG4AAC_ELD="aace",ee.MPEG4AAC_ELD_SBR="aacf",ee.MPEG4AAC_ELD_V2="aacg",ee.MPEG4AAC_HE_V2="aacp",ee.MPEG4AAC_SPATIAL="aacs",ee.AMR="samr",ee.AMR_WB="sawb",ee.AUDIBLE="AUDB",ee.ILBC="ilbc",ee[ee.DVIINTELIMA=1836253201]="DVIINTELIMA",ee[ee.MICROSOFTGSM=1836253233]="MICROSOFTGSM",ee.AES3="aes3",ee.ENHANCEDAC3="ec-3",(et=_||(_={}))[et.MIN=0]="MIN",et[et.LOW=32]="LOW",et[et.MEDIUM=64]="MEDIUM",et[et.HIGH=96]="HIGH",et[et.MAX=127]="MAX",(en=j||(j={}))[en.CONSTANT=0]="CONSTANT",en[en.LONG_TERM_AVERAGE=1]="LONG_TERM_AVERAGE",en[en.VARIABLE_CONSTRAINED=2]="VARIABLE_CONSTRAINED",en[en.VARIABLE=3]="VARIABLE";let es={isMeteringEnabled:!0,android:{extension:".m4a",outputFormat:f.MPEG_4,audioEncoder:m.AAC,sampleRate:44100,numberOfChannels:2,bitRate:128e3},ios:{extension:".m4a",outputFormat:g.MPEG4AAC,audioQuality:_.MAX,sampleRate:44100,numberOfChannels:2,bitRate:128e3,linearPCMBitDepth:16,linearPCMIsBigEndian:!1,linearPCMIsFloat:!1},web:{mimeType:"audio/webm",bitsPerSecond:128e3}},el=(f.THREE_GPP,m.AMR_NB,_.MIN,g.MPEG4AAC,{HIGH_QUALITY:es});async function getPermissionWithQueryAsync(n){if(!navigator||!navigator.permissions||!navigator.permissions.query)return null;try{let{state:l}=await navigator.permissions.query({name:n});switch(l){case"granted":return h.GRANTED;case"denied":return h.DENIED;default:return h.UNDETERMINED}}catch{return h.UNDETERMINED}}function getUserMedia(n){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices.getUserMedia(n);let l=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||function(){let n=Error("Permission unimplemented");throw n.code=0,n.name="NotAllowedError",n};return new Promise((u,d)=>{l.call(navigator,n,u,d)})}function getStatusFromMedia(n){if(!n)return{isLoaded:!1,error:void 0};let l=!!(n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2),u={isLoaded:!0,uri:n.src,progressUpdateIntervalMillis:100,durationMillis:1e3*n.duration,positionMillis:1e3*n.currentTime,shouldPlay:n.autoplay,isPlaying:l,isBuffering:!1,rate:n.playbackRate,shouldCorrectPitch:!1,volume:n.volume,audioPan:0,isMuted:n.muted,isLooping:n.loop,didJustFinish:n.ended};return u}async function setStatusForMedia(n,l){return void 0!==l.positionMillis&&(n.currentTime=l.positionMillis/1e3),void 0!==l.shouldPlay&&(l.shouldPlay?await n.play():await n.pause()),void 0!==l.rate&&(n.playbackRate=l.rate),void 0!==l.volume&&(n.volume=l.volume),void 0!==l.isMuted&&(n.muted=l.isMuted),void 0!==l.isLooping&&(n.loop=l.isLooping),getStatusFromMedia(n)}let eu=null,ec=0,eh=0,ep=!1;function getAudioRecorderDurationMillis(){let n=eh;return ep&&ec>0&&(n+=Date.now()-ec),n}var ef={get name(){return"ExponentAV"},getStatusForVideo:async n=>getStatusFromMedia(n),loadForVideo:async(n,l,u)=>getStatusFromMedia(n),unloadForVideo:async n=>getStatusFromMedia(n),setStatusForVideo:async(n,l)=>setStatusForMedia(n,l),replayVideo:async(n,l)=>setStatusForMedia(n,l),async setAudioMode(){},async setAudioIsEnabled(){},getStatusForSound:async n=>getStatusFromMedia(n),async loadForSound(n,l){let u="string"==typeof n?n:n.uri,d=new Audio(u);d.ontimeupdate=()=>{eo.emit("didUpdatePlaybackStatus",{key:d,status:getStatusFromMedia(d)})},d.onerror=()=>{eo.emit("ExponentAV.onError",{key:d,error:d.error.message})};let h=await setStatusForMedia(d,l);return[d,h]},unloadForSound:async n=>(n.pause(),n.removeAttribute("src"),n.load(),getStatusFromMedia(n)),setStatusForSound:async(n,l)=>setStatusForMedia(n,l),replaySound:async(n,l)=>setStatusForMedia(n,l),getAudioRecordingStatus:async()=>({canRecord:eu?.state==="recording"||eu?.state==="inactive",isRecording:eu?.state==="recording",isDoneRecording:!1,durationMillis:getAudioRecorderDurationMillis(),uri:null}),async prepareAudioRecorder(n){if("undefined"!=typeof navigator&&!navigator.mediaDevices)throw Error("No media devices available");ec=0,eh=0;let l=await getUserMedia({audio:!0});(eu=new window.MediaRecorder(l,n?.web||el.HIGH_QUALITY.web)).addEventListener("pause",()=>{eh=getAudioRecorderDurationMillis(),ep=!1}),eu.addEventListener("resume",()=>{ec=Date.now(),ep=!0}),eu.addEventListener("start",()=>{ec=Date.now(),eh=0,ep=!0}),eu.addEventListener("stop",()=>{eh=getAudioRecorderDurationMillis(),ep=!1,l.getTracks().forEach(n=>n.stop())});let{uri:u,...d}=await this.getAudioRecordingStatus();return{uri:null,status:d}},async startAudioRecording(){if(null===eu)throw Error("Cannot start an audio recording without initializing a MediaRecorder. Run prepareToRecordAsync() before attempting to start an audio recording.");return"paused"===eu.state?eu.resume():eu.start(),this.getAudioRecordingStatus()},async pauseAudioRecording(){if(null===eu)throw Error("Cannot start an audio recording without initializing a MediaRecorder. Run prepareToRecordAsync() before attempting to start an audio recording.");return eu.pause(),this.getAudioRecordingStatus()},async stopAudioRecording(){if(null===eu)throw Error("Cannot start an audio recording without initializing a MediaRecorder. Run prepareToRecordAsync() before attempting to start an audio recording.");if("inactive"===eu.state)return this.getAudioRecordingStatus();let n=new Promise(n=>eu.addEventListener("dataavailable",l=>n(l.data)));eu.stop();let l=await n,u=URL.createObjectURL(l);return{...await this.getAudioRecordingStatus(),uri:u}},async unloadAudioRecorder(){eu=null},async getPermissionsAsync(){let n=await getPermissionWithQueryAsync("microphone");switch(n){case h.GRANTED:return{status:h.GRANTED,expires:"never",canAskAgain:!0,granted:!0};case h.DENIED:return{status:h.DENIED,expires:"never",canAskAgain:!0,granted:!1};default:return await this.requestPermissionsAsync()}},async requestPermissionsAsync(){try{let n=await getUserMedia({audio:!0});return n.getTracks().forEach(n=>n.stop()),{status:h.GRANTED,expires:"never",canAskAgain:!0,granted:!0}}catch{return{status:h.DENIED,expires:"never",canAskAgain:!0,granted:!1}}}}},99347:function(n,l,u){"use strict";u.d(l,{v:function(){return EventEmitter}});var d=u(47677),h=u.n(d),f=u(31368),m=u(88837),g=u(26516);let _="@@nativeEmitterSubscription@@";let EventEmitter=class EventEmitter{constructor(n){this._listenerCount=0,n.__expo_module_name__&&f.Z.EXReactNativeEventEmitter&&(n.addListener=(...l)=>f.Z.EXReactNativeEventEmitter.addProxiedListener(n.__expo_module_name__,...l),n.removeListeners=(...l)=>f.Z.EXReactNativeEventEmitter.removeProxiedListeners(n.__expo_module_name__,...l)),this._nativeModule=n,this._eventEmitter=new m.Z(n)}addListener(n,l){!this._listenerCount&&"ios"!==g.Z.OS&&this._nativeModule.startObserving&&this._nativeModule.startObserving(),this._listenerCount++;let u=this._eventEmitter.addListener(n,l),d={[_]:u,remove:()=>{this.removeSubscription(d)}};return d}removeAllListeners(n){let l=this._eventEmitter.listenerCount?this._eventEmitter.listenerCount(n):this._eventEmitter.listeners(n).length;this._eventEmitter.removeAllListeners(n),this._listenerCount-=l,h()(this._listenerCount>=0,"EventEmitter must have a non-negative number of listeners"),!this._listenerCount&&"ios"!==g.Z.OS&&this._nativeModule.stopObserving&&this._nativeModule.stopObserving()}removeSubscription(n){let l=n[_];l&&("remove"in l&&l.remove(),this._listenerCount--,delete n[_],n.remove=()=>{},!this._listenerCount&&"ios"!==g.Z.OS&&this._nativeModule.stopObserving&&this._nativeModule.stopObserving())}emit(n,...l){this._eventEmitter.emit(n,...l)}}},95062:function(n,l,u){"use strict";u.d(l,{Z:function(){return _}});var d=u(26516);let h=!!window.document?.createElement,f=h&&!!(window.addEventListener||window.attachEvent),m=h&&!!window.screen,g={OS:d.Z.OS,select:d.Z.select,isDOMAvailable:h,canUseEventListeners:f,canUseViewport:m,isAsyncDebugging:!1};var _=g},21675:function(n,l,u){"use strict";u.d(l,{D:function(){return CodedError}});let CodedError=class CodedError extends Error{constructor(n,l){super(l),this.code=n}}},67587:function(n,l,u){"use strict";u.d(l,{N:function(){return UnavailabilityError}});var d=u(21675),h=u(95062);let UnavailabilityError=class UnavailabilityError extends d.D{constructor(n,l){super("ERR_UNAVAILABLE",`The method or property ${n}.${l} is not available on ${h.Z.OS}, are you sure you've linked all the native dependencies properly?`)}}},39540:function(n,l,u){"use strict";u.d(l,{Z:function(){return Dimensions}});var d=u(14983),h=u.n(d),f=u(20008),m={window:{fontScale:1,height:0,scale:1,width:0},screen:{fontScale:1,height:0,scale:1,width:0}},g={},_=f.Z;function update(){if(f.Z){var n,l,u=window;if(u.visualViewport){var d=u.visualViewport;n=Math.round(d.height*d.scale),l=Math.round(d.width*d.scale)}else{var h=u.document.documentElement;n=h.clientHeight,l=h.clientWidth}m.window={fontScale:1,height:n,scale:u.devicePixelRatio||1,width:l},m.screen={fontScale:1,height:u.screen.height,scale:u.devicePixelRatio||1,width:u.screen.width}}}function handleResize(){update(),Array.isArray(g.change)&&g.change.forEach(n=>n(m))}let Dimensions=class Dimensions{static get(n){return _&&(_=!1,update()),h()(m[n],"No dimension set for key "+n),m[n]}static set(n){n&&(f.Z?h()(!1,"Dimensions cannot be set in the browser"):(null!=n.screen&&(m.screen=n.screen),null!=n.window&&(m.window=n.window)))}static addEventListener(n,l){return g[n]=g[n]||[],g[n].push(l),{remove:()=>{this.removeEventListener(n,l)}}}static removeEventListener(n,l){Array.isArray(g[n])&&(g[n]=g[n].filter(n=>n!==l))}};f.Z&&(window.visualViewport?window.visualViewport.addEventListener("resize",handleResize,!1):window.addEventListener("resize",handleResize,!1))},88837:function(n,l,u){"use strict";u.d(l,{Z:function(){return g}});var d=u(26516),h=u(48968),f=u(14983),m=u.n(f),g=class{constructor(n){"ios"===d.Z.OS&&(m()(null!=n,"`new NativeEventEmitter()` requires a non-null argument."),this._nativeModule=n)}addListener(n,l,u){null==(d=this._nativeModule)||d.addListener(n);var d,f=h.Z.addListener(n,l,u);return{remove:()=>{if(null!=f){var n;null==(n=this._nativeModule)||n.removeListeners(1),f.remove(),f=null}}}}removeListener(n,l){var u;null==(u=this._nativeModule)||u.removeListeners(1),h.Z.removeListener(n,l)}emit(n){for(var l=arguments.length,u=Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];h.Z.emit(n,...u)}removeAllListeners(n){var l;m()(null!=n,"`NativeEventEmitter.removeAllListener()` requires a non-null argument."),null==(l=this._nativeModule)||l.removeListeners(this.listenerCount(n)),h.Z.removeAllListeners(n)}listenerCount(n){return h.Z.listenerCount(n)}}},31368:function(n,l,u){"use strict";var d={UIManager:u(49192).Z};l.Z=d},45975:function(n,l,u){"use strict";u.d(l,{Z:function(){return ev}});var d=u(14983),h=u.n(d),f=u(33028),m=class{constructor(n){var l=n.onMoreTasks;this._onMoreTasks=l,this._queueStack=[{tasks:[],popable:!0}]}enqueue(n){this._getCurrentQueue().push(n)}enqueueTasks(n){n.forEach(n=>this.enqueue(n))}cancelTasks(n){this._queueStack=this._queueStack.map(l=>(0,f.Z)((0,f.Z)({},l),{},{tasks:l.tasks.filter(l=>-1===n.indexOf(l))})).filter((n,l)=>n.tasks.length>0||0===l)}hasTasksToProcess(){return this._getCurrentQueue().length>0}processNext(){var n=this._getCurrentQueue();if(n.length){var l=n.shift();try{"object"==typeof l&&l.gen?this._genPromise(l):"object"==typeof l&&l.run?l.run():(h()("function"==typeof l,"Expected Function, SimpleTask, or PromiseTask, but got:\n"+JSON.stringify(l,null,2)),l())}catch(n){throw n.message="TaskQueue: Error with task "+(l.name||"")+": "+n.message,n}}}_getCurrentQueue(){var n=this._queueStack.length-1,l=this._queueStack[n];return l.popable&&0===l.tasks.length&&n>0?(this._queueStack.pop(),this._getCurrentQueue()):l.tasks}_genPromise(n){var l=this._queueStack.push({tasks:[],popable:!1}),u=this._queueStack[l-1];n.gen().then(()=>{u.popable=!0,this.hasTasksToProcess()&&this._onMoreTasks()}).catch(l=>{setTimeout(()=>{throw l.message="TaskQueue: Error resolving Promise in task "+n.name+": "+l.message,l},0)})}},g=u(86575),_=u(20008).Z&&void 0!==window.requestIdleCallback,j=_?window.requestIdleCallback:function(n,l){return setTimeout(()=>{var l=Date.now();n({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-l))})},1)};_&&window.cancelIdleCallback;var $=new g.Z,z={Events:{interactionStart:"interactionStart",interactionComplete:"interactionComplete"},runAfterInteractions(n){var l=[],u=new Promise(u=>{_scheduleUpdate(),n&&l.push(n),l.push({run:u,name:"resolve "+(n&&n.name||"?")}),eo.enqueueTasks(l)});return{then:u.then.bind(u),done:u.then.bind(u),cancel:()=>{eo.cancelTasks(l)}}},createInteractionHandle(){_scheduleUpdate();var n=++el;return et.add(n),n},clearInteractionHandle(n){h()(!!n,"Must provide a handle to clear."),_scheduleUpdate(),et.delete(n),en.add(n)},addListener:$.addListener.bind($),setDeadline(n){eu=n}},ee=new Set,et=new Set,en=new Set,eo=new m({onMoreTasks:_scheduleUpdate}),es=0,el=0,eu=-1;function _scheduleUpdate(){es||(es=eu>0?setTimeout(_processUpdate):j(_processUpdate))}function _processUpdate(){es=0;var n=ee.size;et.forEach(n=>ee.add(n)),en.forEach(n=>ee.delete(n));var l=ee.size;if(0!==n&&0===l?$.emit(z.Events.interactionComplete):0===n&&0!==l&&$.emit(z.Events.interactionStart),0===l){for(var u=Date.now();eo.hasTasksToProcess();)if(eo.processNext(),eu>0&&Date.now()-u>=eu){_scheduleUpdate();break}}et.clear(),en.clear()}var ec={centroidDimension:function(n,l,u,d){var h=n.touchBank,f=0,m=0,g=1===n.numberActiveTouches?n.touchBank[n.indexOfSingleActiveTouch]:null;if(null!==g)g.touchActive&&g.currentTimeStamp>l&&(f+=d&&u?g.currentPageX:d&&!u?g.currentPageY:!d&&u?g.previousPageX:g.previousPageY,m=1);else for(var _=0;_<h.length;_++){var j=h[_];null!=j&&j.touchActive&&j.currentTimeStamp>=l&&(f+=d&&u?j.currentPageX:d&&!u?j.currentPageY:!d&&u?j.previousPageX:j.previousPageY,m++)}return m>0?f/m:ec.noCentroid},currentCentroidXOfTouchesChangedAfter:function(n,l){return ec.centroidDimension(n,l,!0,!0)},currentCentroidYOfTouchesChangedAfter:function(n,l){return ec.centroidDimension(n,l,!1,!0)},previousCentroidXOfTouchesChangedAfter:function(n,l){return ec.centroidDimension(n,l,!0,!1)},previousCentroidYOfTouchesChangedAfter:function(n,l){return ec.centroidDimension(n,l,!1,!1)},currentCentroidX:function(n){return ec.centroidDimension(n,0,!0,!0)},currentCentroidY:function(n){return ec.centroidDimension(n,0,!1,!0)},noCentroid:-1},eh=ec.currentCentroidXOfTouchesChangedAfter,ep=ec.currentCentroidYOfTouchesChangedAfter,ef=ec.previousCentroidXOfTouchesChangedAfter,em=ec.previousCentroidYOfTouchesChangedAfter,eg=ec.currentCentroidX,e_=ec.currentCentroidY,ey={_initializeGestureState(n){n.moveX=0,n.moveY=0,n.x0=0,n.y0=0,n.dx=0,n.dy=0,n.vx=0,n.vy=0,n.numberActiveTouches=0,n._accountsForMovesUpTo=0},_updateGestureStateOnMove(n,l){n.numberActiveTouches=l.numberActiveTouches,n.moveX=eh(l,n._accountsForMovesUpTo),n.moveY=ep(l,n._accountsForMovesUpTo);var u=n._accountsForMovesUpTo,d=ef(l,u),h=eh(l,u),f=em(l,u),m=ep(l,u),g=n.dx+(h-d),_=n.dy+(m-f),j=l.mostRecentTimeStamp-n._accountsForMovesUpTo;n.vx=(g-n.dx)/j,n.vy=(_-n.dy)/j,n.dx=g,n.dy=_,n._accountsForMovesUpTo=l.mostRecentTimeStamp},create(n){var l={handle:null,shouldCancelClick:!1,timeout:null},u={stateID:Math.random(),moveX:0,moveY:0,x0:0,y0:0,dx:0,dy:0,vx:0,vy:0,numberActiveTouches:0,_accountsForMovesUpTo:0};return{panHandlers:{onStartShouldSetResponder:l=>null!=n.onStartShouldSetPanResponder&&n.onStartShouldSetPanResponder(l,u),onMoveShouldSetResponder:l=>null!=n.onMoveShouldSetPanResponder&&n.onMoveShouldSetPanResponder(l,u),onStartShouldSetResponderCapture:l=>(1===l.nativeEvent.touches.length&&ey._initializeGestureState(u),u.numberActiveTouches=l.touchHistory.numberActiveTouches,null!=n.onStartShouldSetPanResponderCapture&&n.onStartShouldSetPanResponderCapture(l,u)),onMoveShouldSetResponderCapture(l){var d=l.touchHistory;return u._accountsForMovesUpTo!==d.mostRecentTimeStamp&&(ey._updateGestureStateOnMove(u,d),!!n.onMoveShouldSetPanResponderCapture&&n.onMoveShouldSetPanResponderCapture(l,u))},onResponderGrant:d=>(l.handle||(l.handle=z.createInteractionHandle()),l.timeout&&clearTimeout(l.timeout),l.shouldCancelClick=!0,u.x0=eg(d.touchHistory),u.y0=e_(d.touchHistory),u.dx=0,u.dy=0,n.onPanResponderGrant&&n.onPanResponderGrant(d,u),null==n.onShouldBlockNativeResponder||n.onShouldBlockNativeResponder(d,u)),onResponderReject(d){clearInteractionHandle(l,n.onPanResponderReject,d,u)},onResponderRelease(d){clearInteractionHandle(l,n.onPanResponderRelease,d,u),setInteractionTimeout(l),ey._initializeGestureState(u)},onResponderStart(l){var d=l.touchHistory;u.numberActiveTouches=d.numberActiveTouches,n.onPanResponderStart&&n.onPanResponderStart(l,u)},onResponderMove(l){var d=l.touchHistory;u._accountsForMovesUpTo!==d.mostRecentTimeStamp&&(ey._updateGestureStateOnMove(u,d),n.onPanResponderMove&&n.onPanResponderMove(l,u))},onResponderEnd(d){var h=d.touchHistory;u.numberActiveTouches=h.numberActiveTouches,clearInteractionHandle(l,n.onPanResponderEnd,d,u)},onResponderTerminate(d){clearInteractionHandle(l,n.onPanResponderTerminate,d,u),setInteractionTimeout(l),ey._initializeGestureState(u)},onResponderTerminationRequest:l=>null==n.onPanResponderTerminationRequest||n.onPanResponderTerminationRequest(l,u),onClickCapture:n=>{!0===l.shouldCancelClick&&(n.stopPropagation(),n.preventDefault())}},getInteractionHandle:()=>l.handle}}};function clearInteractionHandle(n,l,u,d){n.handle&&(z.clearInteractionHandle(n.handle),n.handle=null),l&&l(u,d)}function setInteractionTimeout(n){n.timeout=setTimeout(()=>{n.shouldCancelClick=!1},250)}var ev=ey},18065:function(n,l,u){"use strict";u.d(l,{Z:function(){return PixelRatio}});var d=u(39540);let PixelRatio=class PixelRatio{static get(){return d.Z.get("window").scale}static getFontScale(){return d.Z.get("window").fontScale||PixelRatio.get()}static getPixelSizeForLayoutSize(n){return Math.round(n*PixelRatio.get())}static roundToNearestPixel(n){var l=PixelRatio.get();return Math.round(n*l)/l}}},26516:function(n,l){"use strict";l.Z={OS:"web",select:n=>"web"in n?n.web:n.default,get isTesting(){return!1}}},51811:function(n,l,u){"use strict";var d=u(63158),h=u(20008),f={},m=!h.Z||null!=window.CSS&&null!=window.CSS.supports&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),g='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',_={borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderBlockColor:["borderTopColor","borderBottomColor"],borderInlineColor:["borderRightColor","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderStyle:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderInlineStyle:["borderRightStyle","borderLeftStyle"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderInlineWidth:["borderRightWidth","borderLeftWidth"],insetBlock:["top","bottom"],insetInline:["left","right"],marginBlock:["marginTop","marginBottom"],marginInline:["marginRight","marginLeft"],paddingBlock:["paddingTop","paddingBottom"],paddingInline:["paddingRight","paddingLeft"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],borderBlockStartColor:["borderTopColor"],borderBlockStartStyle:["borderTopStyle"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndColor:["borderBottomColor"],borderBlockEndStyle:["borderBottomStyle"],borderBlockEndWidth:["borderBottomWidth"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],insetBlockEnd:["bottom"],insetBlockStart:["top"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"]};l.Z=(n,l)=>{if(!n)return f;var u={};for(var h in n)if("continue"===function(){var f=n[h];if(null==f)return"continue";if("backgroundClip"===h)"text"===f&&(u.backgroundClip=f,u.WebkitBackgroundClip=f);else if("flex"===h)-1===f?(u.flexGrow=0,u.flexShrink=1,u.flexBasis="auto"):u.flex=f;else if("font"===h)u[h]=f.replace("System",g);else if("fontFamily"===h){if(f.indexOf("System")>-1){var j=f.split(/,\s*/);j[j.indexOf("System")]=g,u[h]=j.join(",")}else"monospace"===f?u[h]="monospace,monospace":u[h]=f}else if("textDecorationLine"===h)m?u.textDecorationLine=f:u.textDecoration=f;else if("writingDirection"===h)u.direction=f;else{var $=(0,d.Z)(n[h],h),z=_[h];l&&"inset"===h?(null==n.insetInline&&(u.left=$,u.right=$),null==n.insetBlock&&(u.top=$,u.bottom=$)):l&&"margin"===h?(null==n.marginInline&&(u.marginLeft=$,u.marginRight=$),null==n.marginBlock&&(u.marginTop=$,u.marginBottom=$)):l&&"padding"===h?(null==n.paddingInline&&(u.paddingLeft=$,u.paddingRight=$),null==n.paddingBlock&&(u.paddingTop=$,u.paddingBottom=$)):z?z.forEach((l,d)=>{null==n[l]&&(u[l]=$)}):u[h]=$}}())continue;return u}},55682:function(n,l,u){"use strict";u.d(l,{Z:function(){return compiler_normalizeColor}});var modules_isWebColor=n=>"currentcolor"===n||"currentColor"===n||"inherit"===n||0===n.indexOf("var("),d=u(32958),h=u.n(d),exports_processColor=n=>{if(null==n)return n;var l=h()(n);if(null!=l)return(l<<24|l>>>8)>>>0},compiler_normalizeColor=function(n,l){if(void 0===l&&(l=1),null!=n){if("string"==typeof n&&modules_isWebColor(n))return n;var u=exports_processColor(n);if(null!=u){var d=((u>>24&255)/255*l).toFixed(2);return"rgba("+(u>>16&255)+","+(u>>8&255)+","+(255&u)+","+d+")"}}}},63158:function(n,l,u){"use strict";u.d(l,{Z:function(){return normalizeValueWithProperty}});var d={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},h=["ms","Moz","O","Webkit"],prefixKey=(n,l)=>n+l.charAt(0).toUpperCase()+l.substring(1);Object.keys(d).forEach(n=>{h.forEach(l=>{d[prefixKey(l,n)]=d[n]})});var f=u(55682),m={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function normalizeValueWithProperty(n,l){var u=n;return null!=l&&d[l]||"number"!=typeof n?null!=l&&m[l]&&(u=(0,f.Z)(n)):u=n+"px",u}},17693:function(n,l,u){"use strict";u.d(l,{Z:function(){return e2}});var d=u(33028),h=u(31461),f=u(51811),compiler_hash=n=>(function(n,l){for(var u,d=n.length,h=1^d,f=0;d>=4;)u=(65535&(u=255&n.charCodeAt(f)|(255&n.charCodeAt(++f))<<8|(255&n.charCodeAt(++f))<<16|(255&n.charCodeAt(++f))<<24))*1540483477+(((u>>>16)*1540483477&65535)<<16),u^=u>>>24,h=(65535&h)*1540483477+(((h>>>16)*1540483477&65535)<<16)^(u=(65535&u)*1540483477+(((u>>>16)*1540483477&65535)<<16)),d-=4,++f;switch(d){case 3:h^=(255&n.charCodeAt(f+2))<<16;case 2:h^=(255&n.charCodeAt(f+1))<<8;case 1:h^=255&n.charCodeAt(f),h=(65535&h)*1540483477+(((h>>>16)*1540483477&65535)<<16)}return h^=h>>>13,h=(65535&h)*1540483477+(((h>>>16)*1540483477&65535)<<16),(h^=h>>>15)>>>0})(n,0).toString(36),m=/[A-Z]/g,g=/^ms-/,_={};function toHyphenLower(n){return"-"+n.toLowerCase()}var compiler_hyphenateStyleName=function(n){if(n in _)return _[n];var l=n.replace(m,toHyphenLower);return _[n]=g.test(l)?"-"+l:l},j=u(63158),$=u(35970),z=u(62204),ee=u(19629),et=u(9270),en=u(69528),eo=u(10876),es=u(14819),el=u(38572),eu=u(70300),ec=u(63132),eh=["Webkit"],ep=["Webkit","ms"],ef={plugins:[z.Z,ee.Z,et.Z,en.Z,eo.Z,es.Z,el.Z,eu.Z,ec.Z],prefixMap:{appearance:["Webkit","Moz","ms"],userSelect:["Webkit","Moz"],textEmphasisPosition:ep,textEmphasis:ep,textEmphasisStyle:ep,textEmphasisColor:ep,boxDecorationBreak:ep,clipPath:eh,maskImage:ep,maskMode:ep,maskRepeat:ep,maskPosition:ep,maskClip:ep,maskOrigin:ep,maskSize:ep,maskComposite:ep,mask:ep,maskBorderSource:ep,maskBorderMode:ep,maskBorderSlice:ep,maskBorderWidth:ep,maskBorderOutset:ep,maskBorderRepeat:ep,maskBorder:ep,maskType:ep,textDecorationStyle:eh,textDecorationSkip:eh,textDecorationLine:eh,textDecorationColor:eh,filter:eh,breakAfter:eh,breakBefore:eh,breakInside:eh,columnCount:eh,columnFill:eh,columnGap:eh,columnRule:eh,columnRuleColor:eh,columnRuleStyle:eh,columnRuleWidth:eh,columns:eh,columnSpan:eh,columnWidth:eh,backdropFilter:eh,hyphens:eh,flowInto:eh,flowFrom:eh,regionFragment:eh,textOrientation:eh,tabSize:["Moz"],fontKerning:eh,textSizeAdjust:eh}},em=(0,$.Z)(ef),eg=["animationKeyframes"],e_=new Map,ey={},ev={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},eE="borderTopLeftRadius",eS="borderTopRightRadius",ew="borderBottomLeftRadius",eT="borderBottomRightRadius",eI="borderLeftColor",eR="borderLeftStyle",eP="borderLeftWidth",eA="borderRightColor",eO="borderRightStyle",eC="borderRightWidth",ek="right",ex="marginLeft",eM="marginRight",eD="paddingLeft",eN="paddingRight",eV="left",eF={[eE]:eS,[eS]:eE,[ew]:eT,[eT]:ew,[eI]:eA,[eR]:eO,[eP]:eC,[eA]:eI,[eO]:eR,[eC]:eP,[eV]:ek,[ex]:eM,[eM]:ex,[eD]:eN,[eN]:eD,[ek]:eV},eL={borderStartStartRadius:eE,borderStartEndRadius:eS,borderEndStartRadius:ew,borderEndEndRadius:eT,borderInlineStartColor:eI,borderInlineStartStyle:eR,borderInlineStartWidth:eP,borderInlineEndColor:eA,borderInlineEndStyle:eO,borderInlineEndWidth:eC,insetInlineEnd:ek,insetInlineStart:eV,marginInlineStart:ex,marginInlineEnd:eM,paddingInlineStart:eD,paddingInlineEnd:eN},ej=["clear","float","textAlign"];function createDeclarationBlock(n){var l=em((0,f.Z)(n));return"{"+Object.keys(l).map(n=>{var u=l[n],d=compiler_hyphenateStyleName(n);return Array.isArray(u)?u.map(n=>d+":"+n).join(";"):d+":"+u}).sort().join(";")+";}"}function processKeyframesValue(n){if("number"==typeof n)throw Error("Invalid CSS keyframes type: "+typeof n);var l=[],u=[];return(Array.isArray(n)?n:[n]).forEach(n=>{if("string"==typeof n)l.push(n);else{var d,h,f,m=(d="r-"+compiler_hash("animation"+JSON.stringify(n)),h="{"+Object.keys(n).map(l=>{var u=createDeclarationBlock(n[l]);return""+l+u}).join("")+"}",f=["-webkit-",""].map(n=>"@"+n+"keyframes "+d+h),[d,f]),g=m[0],_=m[1];l.push(g),u.push(..._)}}),[l,u]}var eU=u(20008);function createCSSStyleSheet(n,l,u){if(!eU.Z)return null;var d=null!=l?l:document,h=d.getElementById(n);if(null==h){if((h=document.createElement("style")).setAttribute("id",n),"string"==typeof u&&h.appendChild(document.createTextNode(u)),d instanceof ShadowRoot)d.insertBefore(h,d.firstChild);else{var f=d.head;f&&f.insertBefore(h,f.firstChild)}}return h.sheet}var eB=Array.prototype.slice;function createOrderedCSSStyleSheet(n){var l,u={},d={};function sheetInsert(n,l,d){var h=getOrderedGroups(u),f=h.indexOf(l)+1,m=h[f],g=null!=m&&null!=u[m].start?u[m].start:n.cssRules.length,_=function(n,l,u){try{return n.insertRule(l,u),!0}catch(n){return!1}}(n,d,g);if(_){null==u[l].start&&(u[l].start=g);for(var j=f;j<h.length;j+=1){var $=h[j],z=u[$].start||0;u[$].start=z+1}}return _}return null!=n&&eB.call(n.cssRules).forEach((n,h)=>{var f=n.cssText;if(f.indexOf("stylesheet-group")>-1)u[l=Number(n.selectorText.split(e$)[1])]={start:h,rules:[f]};else{var m=getSelectorText(f);null!=m&&(d[m]=!0,u[l].rules.push(f))}}),{getTextContent:()=>getOrderedGroups(u).map(n=>{var l=u[n].rules,d=l.shift();return l.sort(),l.unshift(d),l.join("\n")}).join("\n"),insert(l,h){var f=Number(h);if(null==u[f]){var m='[stylesheet-group="'+f+'"]{}';u[f]={start:null,rules:[m]},null!=n&&sheetInsert(n,f,m)}var g=getSelectorText(l);null==g||null!=d[g]||(d[g]=!0,u[f].rules.push(l),null==n||sheetInsert(n,f,l)||u[f].rules.pop())}}}var e$=/["']/g;function getOrderedGroups(n){return Object.keys(n).map(Number).sort((n,l)=>n>l?1:-1)}var eH=/\s*([,])\s*/g;function getSelectorText(n){var l=n.split("{")[0].trim();return""!==l?l.replace(eH,"$1"):null}var eW=new WeakMap,eq=[],ez=["html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}","body{margin:0;}","button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}","input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"],eG=u(73699),eK=u(46195),eX=u(36169),eY=["writingDirection"],eQ=new WeakMap,eJ=function(n,l){if(void 0===l&&(l="react-native-stylesheet"),eU.Z){var u,d=null!=n?n.getRootNode():document;if(0===eq.length)u=createOrderedCSSStyleSheet(createCSSStyleSheet(l)),ez.forEach(n=>{u.insert(n,0)}),eW.set(d,eq.length),eq.push(u);else{var h=eW.get(d);if(null==h){var f=eq[0];u=createOrderedCSSStyleSheet(createCSSStyleSheet(l,d,null!=f?f.getTextContent():"")),eW.set(d,eq.length),eq.push(u)}else u=eq[h]}}else 0===eq.length?(u=createOrderedCSSStyleSheet(createCSSStyleSheet(l)),ez.forEach(n=>{u.insert(n,0)}),eq.push(u)):u=eq[0];return{getTextContent:()=>u.getTextContent(),id:l,insert(n,l){eq.forEach(u=>{u.insert(n,l)})}}}(),eZ={shadow:!0,textShadow:!0};function insertRules(n){n.forEach(n=>{var l=n[0],u=n[1];null!=eJ&&l.forEach(n=>{eJ.insert(n,u)})})}var e0={position:"absolute",left:0,right:0,top:0,bottom:0},e1=create({x:(0,d.Z)({},e0)}).x;function create(n){return Object.keys(n).forEach(l=>{var u,f,m,g,_,$=n[l];null!=$&&!0!==$.$$css&&(l.indexOf("$raw")>-1?(f=(u=function(n,l){var u,f,m={$$css:!0},g=[],_=n.animationKeyframes,j=(0,h.Z)(n,eg),$="css-"+compiler_hash(l+JSON.stringify(n));if(null!=_){var z=processKeyframesValue(_),ee=z[0],et=z[1];f=ee.join(","),g.push(...et)}var en=createDeclarationBlock((0,d.Z)((0,d.Z)({},j),{},{animationName:f}));return g.push("."+$+en),m[$]=$,[m,[[g,1]]]}($,l.split("$raw")[0]))[0],insertRules(u[1]),_=f):(g=(m=function(n){var l={$$css:!0},u=[];function atomicCompile(n,l,d){var h,f,m="string"!=typeof(h=(0,j.Z)(d,l))?JSON.stringify(h||""):h,g=l+m,_=e_.get(g);if(null!=_)f=_[0],u.push(_[1]);else{var $=n!==l?g:m;f="r-"+compiler_hash(n+$);var z=ev[n]||3,ee=[function(n,l,u){var d=[],h="."+n;switch(l){case"animationKeyframes":var f=processKeyframesValue(u),m=f[0],g=f[1],_=createDeclarationBlock({animationName:m.join(",")});d.push(""+h+_,...g);break;case"placeholderTextColor":var j=createDeclarationBlock({color:u,opacity:1});d.push(h+"::-webkit-input-placeholder"+j,h+"::-moz-placeholder"+j,h+":-ms-input-placeholder"+j,h+"::placeholder"+j);break;case"pointerEvents":var $=u;if("auto"===u||"box-only"===u){if($="auto!important","box-only"===u){var z=createDeclarationBlock({pointerEvents:"none"});d.push(h+">*"+z)}}else if(("none"===u||"box-none"===u)&&($="none!important","box-none"===u)){var ee=createDeclarationBlock({pointerEvents:"auto"});d.push(h+">*"+ee)}var et=createDeclarationBlock({pointerEvents:$});d.push(""+h+et);break;case"scrollbarWidth":"none"===u&&d.push(h+"::-webkit-scrollbar{display:none}");var en=createDeclarationBlock({scrollbarWidth:u});d.push(""+h+en);break;default:var eo=createDeclarationBlock({[l]:u});d.push(""+h+eo)}return d}(f,l,d),z];u.push(ee),e_.set(g,[f,ee])}return f}return Object.keys(n).sort().forEach(u=>{var d=n[u];if(null!=d){if(ej.indexOf(u)>-1){var h,f=atomicCompile(u,u,"left"),m=atomicCompile(u,u,"right");"start"===d?h=[f,m]:"end"===d&&(h=[m,f])}var g=eL[u];if(null!=g&&(h=[atomicCompile(u,g,d),atomicCompile(u,eF[g],d)]),"transitionProperty"===u){for(var _=Array.isArray(d)?d:[d],j=[],$=0;$<_.length;$++){var z=_[$];"string"==typeof z&&null!=eL[z]&&j.push($)}if(j.length>0){var ee=[..._],et=[..._];j.forEach(n=>{var l=ee[n];if("string"==typeof l){var d=eL[l],f=eF[d];ee[n]=d,et[n]=f,h=[atomicCompile(u,u,ee),atomicCompile(u,u,et)]}})}}null==h?h=atomicCompile(u,u,d):l.$$css$localize=!0,l[u]=h}}),[l,u]}((0,eK.dj)($,eZ)))[0],insertRules(m[1]),_=g),eQ.set($,_))}),n}function StyleSheet(n,l){void 0===l&&(l={});var u,m,g,_,j,$="rtl"===l.writingDirection,z=(void 0===(u=l)&&(u={}),g=(m=u).writingDirection,_=(0,h.Z)(m,eY),j="rtl"===g,eX.D.factory({transform(n){var l=eQ.get(n);return null!=l?(0,eG.j)(l,j):(0,eK.dj)(n,(0,d.Z)((0,d.Z)({},eZ),_))}})(n));return Array.isArray(z)&&null!=z[1]&&(z[1]=function(n,l){var u=n||ey,d={},h={};for(var m in u)if("continue"===function(){var n=u[m],f=m,g=n;if(!Object.prototype.hasOwnProperty.call(u,m)||null==n)return"continue";ej.indexOf(m)>-1&&("start"===n?g=l?"right":"left":"end"===n&&(g=l?"left":"right"));var _=eL[m];if(null!=_&&(f=l?eF[_]:_),"transitionProperty"===m){var j=Array.isArray(n)?n:[n];j.forEach((n,u)=>{if("string"==typeof n){var d=eL[n];null!=d&&(j[u]=l?eF[d]:d,g=j.join(" "))}})}d[f]||(h[f]=g),f===m&&(d[f]=!0)}())continue;return(0,f.Z)(h,!0)}(z[1],$)),z}StyleSheet.absoluteFill=e1,StyleSheet.absoluteFillObject=e0,StyleSheet.create=create,StyleSheet.compose=function(n,l){return[n,l]},StyleSheet.flatten=function(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];for(var d=l.flat(1/0),h={},f=0;f<d.length;f++){var m=d[f];null!=m&&"object"==typeof m&&Object.assign(h,m)}return h},StyleSheet.getSheet=function(){return{id:eJ.id,textContent:eJ.getTextContent()}},StyleSheet.hairlineWidth=1,eU.Z&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=StyleSheet.flatten);var e2=StyleSheet},46195:function(n,l,u){"use strict";u.d(l,{Lm:function(){return createBoxShadowValue},aO:function(){return createTextShadowValue},dj:function(){return preprocess},t_:function(){return createTransformValue}});var d=u(55682),h=u(63158),f=u(29360),m={},g={height:0,width:0},createBoxShadowValue=n=>{var l=n.shadowColor,u=n.shadowOffset,f=n.shadowOpacity,m=n.shadowRadius,_=u||g,j=_.height,$=_.width,z=(0,h.Z)($),ee=(0,h.Z)(j),et=(0,h.Z)(m||0),en=(0,d.Z)(l||"black",f);if(null!=en&&null!=z&&null!=ee&&null!=et)return z+" "+ee+" "+et+" "+en},createTextShadowValue=n=>{var l=n.textShadowColor,u=n.textShadowOffset,d=n.textShadowRadius,f=u||g,m=f.height,_=f.width,j=d||0,$=(0,h.Z)(_),z=(0,h.Z)(m),ee=(0,h.Z)(j),et=(0,h.Z)(l,"textShadowColor");if(et&&(0!==m||0!==_||0!==j)&&null!=$&&null!=z&&null!=ee)return $+" "+z+" "+ee+" "+et},mapTransform=n=>{var l=Object.keys(n)[0],u=n[l];if("matrix"===l||"matrix3d"===l)return l+"("+u.join(",")+")";var d=(0,h.Z)(u,l);return l+"("+d+")"},createTransformValue=n=>n.map(mapTransform).join(" "),_={borderBottomEndRadius:"borderEndEndRadius",borderBottomStartRadius:"borderEndStartRadius",borderTopEndRadius:"borderStartEndRadius",borderTopStartRadius:"borderStartStartRadius",borderEndColor:"borderInlineEndColor",borderEndStyle:"borderInlineEndStyle",borderEndWidth:"borderInlineEndWidth",borderStartColor:"borderInlineStartColor",borderStartStyle:"borderInlineStartStyle",borderStartWidth:"borderInlineStartWidth",end:"insetInlineEnd",marginEnd:"marginInlineEnd",marginHorizontal:"marginInline",marginStart:"marginInlineStart",marginVertical:"marginBlock",paddingEnd:"paddingInlineEnd",paddingHorizontal:"paddingInline",paddingStart:"paddingInlineStart",paddingVertical:"paddingBlock",start:"insetInlineStart"},j={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},preprocess=function(n,l){void 0===l&&(l={});var u=n||m,d={};if(l.shadow,null!=u.shadowColor||null!=u.shadowOffset||null!=u.shadowOpacity||null!=u.shadowRadius){(0,f.O)("shadowStyles",'"shadow*" style props are deprecated. Use "boxShadow".');var h=createBoxShadowValue(u);if(null!=h&&null==d.boxShadow){var g=u.boxShadow;d.boxShadow=g?g+", "+h:h}}if(l.textShadow,null!=u.textShadowColor||null!=u.textShadowOffset||null!=u.textShadowRadius){(0,f.O)("textShadowStyles",'"textShadow*" style props are deprecated. Use "textShadow".');var $=createTextShadowValue(u);if(null!=$&&null==d.textShadow){var z=u.textShadow;d.textShadow=z?z+", "+$:$}}for(var ee in u)if(null==j[ee]&&"shadowColor"!==ee&&"shadowOffset"!==ee&&"shadowOpacity"!==ee&&"shadowRadius"!==ee&&"textShadowColor"!==ee&&"textShadowOffset"!==ee&&"textShadowRadius"!==ee){var et=u[ee],en=_[ee]||ee,eo=et;Object.prototype.hasOwnProperty.call(u,ee)&&(en===ee||null==u[en])&&("aspectRatio"===en&&"number"==typeof eo?d[en]=eo.toString():"fontVariant"===en?(Array.isArray(eo)&&eo.length>0&&((0,f.O)("fontVariant",'"fontVariant" style array value is deprecated. Use space-separated values.'),eo=eo.join(" ")),d[en]=eo):"textAlignVertical"===en?((0,f.O)("textAlignVertical",'"textAlignVertical" style is deprecated. Use "verticalAlign".'),null==u.verticalAlign&&(d.verticalAlign="center"===eo?"middle":eo)):"transform"===en?(Array.isArray(eo)&&(eo=createTransformValue(eo)),d.transform=eo):d[en]=eo)}return d}},29145:function(n,l,u){"use strict";var d=(0,u(2784).createContext)(!1);l.Z=d},49192:function(n,l,u){"use strict";u.d(l,{Z:function(){return g}});var d=u(30231),h={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},f=["ms","Moz","O","Webkit"],prefixKey=(n,l)=>n+l.charAt(0).toUpperCase()+l.substring(1);Object.keys(h).forEach(n=>{f.forEach(l=>{h[prefixKey(l,n)]=h[n]})});var modules_setValueForStyles=function(n,l){var u=n.style;for(var d in l)if(l.hasOwnProperty(d)){var f,m,g=0===d.indexOf("--"),_=(f=d,null==(m=l[d])||"boolean"==typeof m||""===m?"":g||"number"!=typeof m||0===m||h.hasOwnProperty(f)&&h[f]?(""+m).trim():m+"px");"float"===d&&(d="cssFloat"),g?u.setProperty(d,_):u[d]=_}},getRect=n=>{var l=n.offsetHeight,u=n.offsetWidth,d=n.offsetLeft,h=n.offsetTop;for(n=n.offsetParent;n&&1===n.nodeType;)d+=n.offsetLeft+n.clientLeft-n.scrollLeft,h+=n.offsetTop+n.clientTop-n.scrollTop,n=n.offsetParent;return{width:u,height:l,top:h-=window.scrollY,left:d-=window.scrollX}},measureLayout=(n,l,u)=>{var d=l||n&&n.parentNode;n&&d&&setTimeout(()=>{if(n.isConnected&&d.isConnected){var l=getRect(d),h=getRect(n),f=h.height,m=h.left,g=h.top,_=h.width;u(m-l.left,g-l.top,_,f,m,g)}},0)},m={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},g={blur(n){try{n.blur()}catch(n){}},focus(n){try{var l=n.nodeName;null==n.getAttribute("tabIndex")&&!0!==n.isContentEditable&&null==m[l]&&n.setAttribute("tabIndex","-1"),n.focus()}catch(n){}},measure(n,l){measureLayout(n,null,l)},measureInWindow(n,l){n&&setTimeout(()=>{var u=(0,d.Z)(n),h=u.height;l(u.left,u.top,u.width,h)},0)},measureLayout(n,l,u,d){measureLayout(n,l,d)},updateView(n,l){for(var u in l)if(Object.prototype.hasOwnProperty.call(l,u)){var d=l[u];switch(u){case"style":modules_setValueForStyles(n,d);break;case"class":case"className":n.setAttribute("class",d);break;case"text":case"value":n.value=d;break;default:n.setAttribute(u,d)}}},configureNextLayoutAnimation(n,l){l()},setLayoutAnimationEnabledExperimental(){}}},90605:function(n,l,u){"use strict";var d=u(31461),h=u(2784),f=u(3019),m=u(82980),g=u(77859),_=u(75532),j=u(39838),$=u(12153),z=u(10890),ee=u(17693),et=u(29145),en=u(51756),eo=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],es=Object.assign({},m.lG,m.LO,m._T,m.YB,m.Uy,m.hJ,m.E5,m.vr,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),pickProps=n=>(0,g.Z)(n,es),el=h.forwardRef((n,l)=>{var u=n.hrefAttrs,m=n.onLayout,g=n.onMoveShouldSetResponder,ee=n.onMoveShouldSetResponderCapture,es=n.onResponderEnd,el=n.onResponderGrant,ec=n.onResponderMove,eh=n.onResponderReject,ep=n.onResponderRelease,ef=n.onResponderStart,em=n.onResponderTerminate,eg=n.onResponderTerminationRequest,e_=n.onScrollShouldSetResponder,ey=n.onScrollShouldSetResponderCapture,ev=n.onSelectionChangeShouldSetResponder,eE=n.onSelectionChangeShouldSetResponderCapture,eS=n.onStartShouldSetResponder,ew=n.onStartShouldSetResponderCapture,eT=(0,d.Z)(n,eo),eI=h.useContext(et.Z),eR=h.useRef(null),eP=(0,en.PE)().direction;(0,_.Z)(eR,m),(0,z.Z)(eR,{onMoveShouldSetResponder:g,onMoveShouldSetResponderCapture:ee,onResponderEnd:es,onResponderGrant:el,onResponderMove:ec,onResponderReject:eh,onResponderRelease:ep,onResponderStart:ef,onResponderTerminate:em,onResponderTerminationRequest:eg,onScrollShouldSetResponder:e_,onScrollShouldSetResponderCapture:ey,onSelectionChangeShouldSetResponder:ev,onSelectionChangeShouldSetResponderCapture:eE,onStartShouldSetResponder:eS,onStartShouldSetResponderCapture:ew});var eA="div",eO=null!=n.lang?(0,en.w1)(n.lang):null,eC=n.dir||eO,ek=eC||eP,ex=pickProps(eT);if(ex.dir=eC,ex.style=[eu.view$raw,eI&&eu.inline,n.style],null!=n.href&&(eA="a",null!=u)){var eM=u.download,eD=u.rel,eN=u.target;null!=eM&&(ex.download=eM),null!=eD&&(ex.rel=eD),"string"==typeof eN&&(ex.target="_"!==eN.charAt(0)?"_"+eN:eN)}var eV=(0,$.Z)(ex),eF=(0,j.Z)(eR,eV,l);return ex.ref=eF,(0,f.Z)(eA,ex,{writingDirection:ek})});el.displayName="View";var eu=ee.Z.create({view$raw:{alignItems:"stretch",backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",flexShrink:0,listStyle:"none",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",textDecoration:"none",zIndex:0},inline:{display:"inline-flex"}});l.Z=el},3019:function(n,l,u){"use strict";u.d(l,{Z:function(){return exports_createElement}});var d={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},AccessibilityUtil_propsToAriaRole=n=>{var l=n.accessibilityRole,u=n.role||l;if(u){var h=d[u];if(null!==h)return h||u}},h={article:"article",banner:"header",blockquote:"blockquote",button:"button",code:"code",complementary:"aside",contentinfo:"footer",deletion:"del",emphasis:"em",figure:"figure",insertion:"ins",form:"form",list:"ul",listitem:"li",main:"main",navigation:"nav",paragraph:"p",region:"section",strong:"strong"},f={},m={isDisabled:n=>n.disabled||Array.isArray(n.accessibilityStates)&&n.accessibilityStates.indexOf("disabled")>-1,propsToAccessibilityComponent:function(n){if(void 0===n&&(n=f),"label"===(n.role||n.accessibilityRole))return"label";var l=AccessibilityUtil_propsToAriaRole(n);if(l){if("heading"===l){var u=n.accessibilityLevel||n["aria-level"];return null!=u?"h"+u:"h1"}return h[l]}},propsToAriaRole:AccessibilityUtil_propsToAriaRole},g=u(33028),_=u(31461),j=u(17693),$=u(29360),z=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],ee={},et=Object.prototype.hasOwnProperty,en=Array.isArray,eo=/[A-Z]/g;function toHyphenLower(n){return"-"+n.toLowerCase()}function processIDRefList(n){return en(n)?n.join(" "):n}var es=j.Z.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),modules_createDOMProps=(n,l,u)=>{l||(l=ee);var d=l,h=d["aria-activedescendant"],f=d.accessibilityActiveDescendant,en=d["aria-atomic"],el=d.accessibilityAtomic,eu=d["aria-autocomplete"],ec=d.accessibilityAutoComplete,eh=d["aria-busy"],ep=d.accessibilityBusy,ef=d["aria-checked"],em=d.accessibilityChecked,eg=d["aria-colcount"],e_=d.accessibilityColumnCount,ey=d["aria-colindex"],ev=d.accessibilityColumnIndex,eE=d["aria-colspan"],eS=d.accessibilityColumnSpan,ew=d["aria-controls"],eT=d.accessibilityControls,eI=d["aria-current"],eR=d.accessibilityCurrent,eP=d["aria-describedby"],eA=d.accessibilityDescribedBy,eO=d["aria-details"],eC=d.accessibilityDetails,ek=d["aria-disabled"],ex=d.accessibilityDisabled,eM=d["aria-errormessage"],eD=d.accessibilityErrorMessage,eN=d["aria-expanded"],eV=d.accessibilityExpanded,eF=d["aria-flowto"],eL=d.accessibilityFlowTo,ej=d["aria-haspopup"],eU=d.accessibilityHasPopup,eB=d["aria-hidden"],e$=d.accessibilityHidden,eH=d["aria-invalid"],eW=d.accessibilityInvalid,eq=d["aria-keyshortcuts"],ez=d.accessibilityKeyShortcuts,eG=d["aria-label"],eK=d.accessibilityLabel,eX=d["aria-labelledby"],eY=d.accessibilityLabelledBy,eQ=d["aria-level"],eJ=d.accessibilityLevel,eZ=d["aria-live"],e0=d.accessibilityLiveRegion,e1=d["aria-modal"],e2=d.accessibilityModal,e3=d["aria-multiline"],e5=d.accessibilityMultiline,e4=d["aria-multiselectable"],e9=d.accessibilityMultiSelectable,e6=d["aria-orientation"],e7=d.accessibilityOrientation,e8=d["aria-owns"],te=d.accessibilityOwns,tt=d["aria-placeholder"],tn=d.accessibilityPlaceholder,to=d["aria-posinset"],ts=d.accessibilityPosInSet,ta=d["aria-pressed"],tl=d.accessibilityPressed,tu=d["aria-readonly"],tc=d.accessibilityReadOnly,td=d["aria-required"],th=d.accessibilityRequired,tp=(d.role,d.accessibilityRole),tf=d["aria-roledescription"],tm=d.accessibilityRoleDescription,tg=d["aria-rowcount"],t_=d.accessibilityRowCount,ty=d["aria-rowindex"],tv=d.accessibilityRowIndex,tb=d["aria-rowspan"],tE=d.accessibilityRowSpan,tS=d["aria-selected"],tw=d.accessibilitySelected,tT=d["aria-setsize"],tI=d.accessibilitySetSize,tR=d["aria-sort"],tP=d.accessibilitySort,tA=d["aria-valuemax"],tO=d.accessibilityValueMax,tC=d["aria-valuemin"],tk=d.accessibilityValueMin,tx=d["aria-valuenow"],tM=d.accessibilityValueNow,tD=d["aria-valuetext"],tN=d.accessibilityValueText,tV=d.dataSet,tF=d.focusable,tL=d.id,tj=d.nativeID,tU=d.pointerEvents,tB=d.style,t$=d.tabIndex,tH=d.testID,tW=(0,_.Z)(d,z);null!=ex&&(0,$.O)("accessibilityDisabled","accessibilityDisabled is deprecated.");var tq=m.propsToAriaRole(l);null!=f&&(0,$.O)("accessibilityActiveDescendant","accessibilityActiveDescendant is deprecated. Use aria-activedescendant.");var tz=null!=h?h:f;null!=tz&&(tW["aria-activedescendant"]=tz),null!=el&&(0,$.O)("accessibilityAtomic","accessibilityAtomic is deprecated. Use aria-atomic.");var tG=null!=en?h:el;null!=tG&&(tW["aria-atomic"]=tG),null!=ec&&(0,$.O)("accessibilityAutoComplete","accessibilityAutoComplete is deprecated. Use aria-autocomplete.");var tK=null!=eu?eu:ec;null!=tK&&(tW["aria-autocomplete"]=tK),null!=ep&&(0,$.O)("accessibilityBusy","accessibilityBusy is deprecated. Use aria-busy.");var tX=null!=eh?eh:ep;null!=tX&&(tW["aria-busy"]=tX),null!=em&&(0,$.O)("accessibilityChecked","accessibilityChecked is deprecated. Use aria-checked.");var tY=null!=ef?ef:em;null!=tY&&(tW["aria-checked"]=tY),null!=e_&&(0,$.O)("accessibilityColumnCount","accessibilityColumnCount is deprecated. Use aria-colcount.");var tQ=null!=eg?eg:e_;null!=tQ&&(tW["aria-colcount"]=tQ),null!=ev&&(0,$.O)("accessibilityColumnIndex","accessibilityColumnIndex is deprecated. Use aria-colindex.");var tJ=null!=ey?ey:ev;null!=tJ&&(tW["aria-colindex"]=tJ),null!=eS&&(0,$.O)("accessibilityColumnSpan","accessibilityColumnSpan is deprecated. Use aria-colspan.");var tZ=null!=eE?eE:eS;null!=tZ&&(tW["aria-colspan"]=tZ),null!=eT&&(0,$.O)("accessibilityControls","accessibilityControls is deprecated. Use aria-controls.");var t0=null!=ew?ew:eT;null!=t0&&(tW["aria-controls"]=processIDRefList(t0)),null!=eR&&(0,$.O)("accessibilityCurrent","accessibilityCurrent is deprecated. Use aria-current.");var t1=null!=eI?eI:eR;null!=t1&&(tW["aria-current"]=t1),null!=eA&&(0,$.O)("accessibilityDescribedBy","accessibilityDescribedBy is deprecated. Use aria-describedby.");var t2=null!=eP?eP:eA;null!=t2&&(tW["aria-describedby"]=processIDRefList(t2)),null!=eC&&(0,$.O)("accessibilityDetails","accessibilityDetails is deprecated. Use aria-details.");var t3=null!=eO?eO:eC;null!=t3&&(tW["aria-details"]=t3),!0===(ek||ex)&&(tW["aria-disabled"]=!0,("button"===n||"form"===n||"input"===n||"select"===n||"textarea"===n)&&(tW.disabled=!0)),null!=eD&&(0,$.O)("accessibilityErrorMessage","accessibilityErrorMessage is deprecated. Use aria-errormessage.");var t5=null!=eM?eM:eD;null!=t5&&(tW["aria-errormessage"]=t5),null!=eV&&(0,$.O)("accessibilityExpanded","accessibilityExpanded is deprecated. Use aria-expanded.");var t4=null!=eN?eN:eV;null!=t4&&(tW["aria-expanded"]=t4),null!=eL&&(0,$.O)("accessibilityFlowTo","accessibilityFlowTo is deprecated. Use aria-flowto.");var t9=null!=eF?eF:eL;null!=t9&&(tW["aria-flowto"]=processIDRefList(t9)),null!=eU&&(0,$.O)("accessibilityHasPopup","accessibilityHasPopup is deprecated. Use aria-haspopup.");var t6=null!=ej?ej:eU;null!=t6&&(tW["aria-haspopup"]=t6),null!=e$&&(0,$.O)("accessibilityHidden","accessibilityHidden is deprecated. Use aria-hidden.");var t7=null!=eB?eB:e$;!0===t7&&(tW["aria-hidden"]=t7),null!=eW&&(0,$.O)("accessibilityInvalid","accessibilityInvalid is deprecated. Use aria-invalid.");var t8=null!=eH?eH:eW;null!=t8&&(tW["aria-invalid"]=t8),null!=ez&&(0,$.O)("accessibilityKeyShortcuts","accessibilityKeyShortcuts is deprecated. Use aria-keyshortcuts.");var re=null!=eq?eq:ez;null!=re&&(tW["aria-keyshortcuts"]=processIDRefList(re)),null!=eK&&(0,$.O)("accessibilityLabel","accessibilityLabel is deprecated. Use aria-label.");var rr=null!=eG?eG:eK;null!=rr&&(tW["aria-label"]=rr),null!=eY&&(0,$.O)("accessibilityLabelledBy","accessibilityLabelledBy is deprecated. Use aria-labelledby.");var rn=null!=eX?eX:eY;null!=rn&&(tW["aria-labelledby"]=processIDRefList(rn)),null!=eJ&&(0,$.O)("accessibilityLevel","accessibilityLevel is deprecated. Use aria-level.");var ri=null!=eQ?eQ:eJ;null!=ri&&(tW["aria-level"]=ri),null!=e0&&(0,$.O)("accessibilityLiveRegion","accessibilityLiveRegion is deprecated. Use aria-live.");var ro=null!=eZ?eZ:e0;null!=ro&&(tW["aria-live"]="none"===ro?"off":ro),null!=e2&&(0,$.O)("accessibilityModal","accessibilityModal is deprecated. Use aria-modal.");var rs=null!=e1?e1:e2;null!=rs&&(tW["aria-modal"]=rs),null!=e5&&(0,$.O)("accessibilityMultiline","accessibilityMultiline is deprecated. Use aria-multiline.");var ra=null!=e3?e3:e5;null!=ra&&(tW["aria-multiline"]=ra),null!=e9&&(0,$.O)("accessibilityMultiSelectable","accessibilityMultiSelectable is deprecated. Use aria-multiselectable.");var rl=null!=e4?e4:e9;null!=rl&&(tW["aria-multiselectable"]=rl),null!=e7&&(0,$.O)("accessibilityOrientation","accessibilityOrientation is deprecated. Use aria-orientation.");var ru=null!=e6?e6:e7;null!=ru&&(tW["aria-orientation"]=ru),null!=te&&(0,$.O)("accessibilityOwns","accessibilityOwns is deprecated. Use aria-owns.");var rd=null!=e8?e8:te;null!=rd&&(tW["aria-owns"]=processIDRefList(rd)),null!=tn&&(0,$.O)("accessibilityPlaceholder","accessibilityPlaceholder is deprecated. Use aria-placeholder.");var rh=null!=tt?tt:tn;null!=rh&&(tW["aria-placeholder"]=rh),null!=ts&&(0,$.O)("accessibilityPosInSet","accessibilityPosInSet is deprecated. Use aria-posinset.");var rp=null!=to?to:ts;null!=rp&&(tW["aria-posinset"]=rp),null!=tl&&(0,$.O)("accessibilityPressed","accessibilityPressed is deprecated. Use aria-pressed.");var rf=null!=ta?ta:tl;null!=rf&&(tW["aria-pressed"]=rf),null!=tc&&(0,$.O)("accessibilityReadOnly","accessibilityReadOnly is deprecated. Use aria-readonly.");var rm=null!=tu?tu:tc;null!=rm&&(tW["aria-readonly"]=rm,("input"===n||"select"===n||"textarea"===n)&&(tW.readOnly=!0)),null!=th&&(0,$.O)("accessibilityRequired","accessibilityRequired is deprecated. Use aria-required.");var rg=null!=td?td:th;null!=rg&&(tW["aria-required"]=rg,("input"===n||"select"===n||"textarea"===n)&&(tW.required=th)),null!=tp&&(0,$.O)("accessibilityRole","accessibilityRole is deprecated. Use role."),null!=tq&&(tW.role="none"===tq?"presentation":tq),null!=tm&&(0,$.O)("accessibilityRoleDescription","accessibilityRoleDescription is deprecated. Use aria-roledescription.");var r_=null!=tf?tf:tm;null!=r_&&(tW["aria-roledescription"]=r_),null!=t_&&(0,$.O)("accessibilityRowCount","accessibilityRowCount is deprecated. Use aria-rowcount.");var ry=null!=tg?tg:t_;null!=ry&&(tW["aria-rowcount"]=ry),null!=tv&&(0,$.O)("accessibilityRowIndex","accessibilityRowIndex is deprecated. Use aria-rowindex.");var rv=null!=ty?ty:tv;null!=rv&&(tW["aria-rowindex"]=rv),null!=tE&&(0,$.O)("accessibilityRowSpan","accessibilityRowSpan is deprecated. Use aria-rowspan.");var rb=null!=tb?tb:tE;null!=rb&&(tW["aria-rowspan"]=rb),null!=tw&&(0,$.O)("accessibilitySelected","accessibilitySelected is deprecated. Use aria-selected.");var rE=null!=tS?tS:tw;null!=rE&&(tW["aria-selected"]=rE),null!=tI&&(0,$.O)("accessibilitySetSize","accessibilitySetSize is deprecated. Use aria-setsize.");var rS=null!=tT?tT:tI;null!=rS&&(tW["aria-setsize"]=rS),null!=tP&&(0,$.O)("accessibilitySort","accessibilitySort is deprecated. Use aria-sort.");var rw=null!=tR?tR:tP;null!=rw&&(tW["aria-sort"]=rw),null!=tO&&(0,$.O)("accessibilityValueMax","accessibilityValueMax is deprecated. Use aria-valuemax.");var rT=null!=tA?tA:tO;null!=rT&&(tW["aria-valuemax"]=rT),null!=tk&&(0,$.O)("accessibilityValueMin","accessibilityValueMin is deprecated. Use aria-valuemin.");var rI=null!=tC?tC:tk;null!=rI&&(tW["aria-valuemin"]=rI),null!=tM&&(0,$.O)("accessibilityValueNow","accessibilityValueNow is deprecated. Use aria-valuenow.");var rR=null!=tx?tx:tM;null!=rR&&(tW["aria-valuenow"]=rR),null!=tN&&(0,$.O)("accessibilityValueText","accessibilityValueText is deprecated. Use aria-valuetext.");var rP=null!=tD?tD:tN;if(null!=rP&&(tW["aria-valuetext"]=rP),null!=tV){for(var rA in tV)if(et.call(tV,rA)){var rO=rA.replace(eo,toHyphenLower),rC=tV[rA];null!=rC&&(tW["data-"+rO]=rC)}}0===t$||"0"===t$||-1===t$||"-1"===t$?tW.tabIndex=t$:(null!=tF&&(0,$.O)("focusable","focusable is deprecated."),!1===tF&&(tW.tabIndex="-1"),"a"===n||"button"===n||"input"===n||"select"===n||"textarea"===n?(!1===tF||!0===ex)&&(tW.tabIndex="-1"):"button"===tq||"checkbox"===tq||"link"===tq||"radio"===tq||"textbox"===tq||"switch"===tq?!1!==tF&&(tW.tabIndex="0"):!0===tF&&(tW.tabIndex="0")),null!=tU&&(0,$.O)("pointerEvents","props.pointerEvents is deprecated. Use style.pointerEvents");var rk=(0,j.Z)([tB,tU&&es[tU]],(0,g.Z)({writingDirection:"ltr"},u)),rx=rk[0],rM=rk[1];rx&&(tW.className=rx),rM&&(tW.style=rM),null!=tj&&(0,$.O)("nativeID","nativeID is deprecated. Use id.");var rD=null!=tL?tL:tj;return null!=rD&&(tW.id=rD),null!=tH&&(tW["data-testid"]=tH),null==tW.type&&"button"===n&&(tW.type="button"),tW},el=u(2784),eu=u(51756),exports_createElement=(n,l,u)=>{n&&n.constructor===String&&(d=m.propsToAccessibilityComponent(l));var d,h=d||n,f=modules_createDOMProps(h,l,u),g=el.createElement(h,f);return f.dir?el.createElement(eu.Iw,{children:g,direction:f.dir,locale:f.lang}):g}},20008:function(n,l){"use strict";var u=!!window.document&&!!window.document.createElement;l.Z=u},82980:function(n,l,u){"use strict";u.d(l,{E5:function(){return j},LO:function(){return h},Uy:function(){return g},YB:function(){return m},_T:function(){return f},hJ:function(){return _},lG:function(){return d},vr:function(){return $}});var d={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},h={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},f={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},m={onBlur:!0,onFocus:!0},g={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},_={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},j={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},$={style:!0}},30231:function(n,l){"use strict";l.Z=n=>{if(null!=n&&1===n.nodeType&&"function"==typeof n.getBoundingClientRect)return n.getBoundingClientRect()}},31066:function(n,l,u){"use strict";function mergeRefs(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];return function(n){l.forEach(l=>{if(null!=l){if("function"==typeof l){l(n);return}if("object"==typeof l){l.current=n;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(l))}})}}u.d(l,{Z:function(){return mergeRefs}}),u(2784)},77859:function(n,l,u){"use strict";function pick(n,l){var u={};for(var d in n)n.hasOwnProperty(d)&&!0===l[d]&&(u[d]=n[d]);return u}u.d(l,{Z:function(){return pick}})},75532:function(n,l,u){"use strict";u.d(l,{Z:function(){return useElementLayout}});var d=u(15797),h=u(49192),f=u(20008),m="__reactLayoutHandler",g=(f.Z,null);function useElementLayout(n,l){var u=(f.Z&&void 0!==window.ResizeObserver&&null==g&&(g=new window.ResizeObserver(function(n){n.forEach(n=>{var l=n.target,u=l[m];"function"==typeof u&&h.Z.measure(l,(l,d,h,f,m,g)=>{var _={nativeEvent:{layout:{x:l,y:d,width:h,height:f,left:m,top:g}},timeStamp:Date.now()};Object.defineProperty(_.nativeEvent,"target",{enumerable:!0,get:()=>n.target}),u(_)})})})),g);(0,d.Z)(()=>{var u=n.current;null!=u&&(u[m]=l)},[n,l]),(0,d.Z)(()=>{var l=n.current;return null!=l&&null!=u&&("function"==typeof l[m]?u.observe(l):u.unobserve(l)),()=>{null!=l&&null!=u&&u.unobserve(l)}},[n,u])}},15797:function(n,l,u){"use strict";var d=u(2784),h=u(20008).Z?d.useLayoutEffect:d.useEffect;l.Z=h},51756:function(n,l,u){"use strict";u.d(l,{Iw:function(){return LocaleProvider},w1:function(){return getLocaleDirection},PE:function(){return useLocaleContext}});var d=u(2784),h=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),f=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","far","glk","he","iw","khw","ks","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]),m=new Map,g=(0,d.createContext)({direction:"ltr",locale:"en-US"});function getLocaleDirection(n){return!function(n){var l=m.get(n);if(l)return l;var u=!1;if(Intl.Locale){var d=new Intl.Locale(n).maximize().script;u=h.has(d)}else{var g=n.split("-")[0];u=f.has(g)}return m.set(n,u),u}(n)?"ltr":"rtl"}function LocaleProvider(n){var l=n.direction,u=n.locale,h=n.children;return l||u?d.createElement(g.Provider,{children:h,value:{direction:u?getLocaleDirection(u):l,locale:u}}):h}function useLocaleContext(){return(0,d.useContext)(g)}},39838:function(n,l,u){"use strict";u.d(l,{Z:function(){return useMergeRefs}});var d=u(2784),h=u(31066);function useMergeRefs(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];return d.useMemo(()=>(0,h.Z)(...l),[...l])}},12153:function(n,l,u){"use strict";u.d(l,{Z:function(){return usePlatformMethods}});var d=u(49192),h=u(67265);function usePlatformMethods(n){return n.pointerEvents,n.style,(0,h.Z)(()=>n=>{null!=n&&(n.measure=l=>d.Z.measure(n,l),n.measureLayout=(l,u,h)=>d.Z.measureLayout(n,l,h,u),n.measureInWindow=l=>d.Z.measureInWindow(n,l))})}},10890:function(n,l,u){"use strict";u.d(l,{Z:function(){return useResponderEvents}});var d=u(2784),h=u(30231),emptyFunction=()=>{},f={},m=[];function normalizeIdentifier(n){return n>20?n%20:n}function createResponderEvent(n,l){var u,d,g,_=!1,j=n.changedTouches,$=n.type,z=!0===n.metaKey,ee=!0===n.shiftKey,et=j&&j[0].force||0,en=normalizeIdentifier(j&&j[0].identifier||0),eo=j&&j[0].clientX||n.clientX,es=j&&j[0].clientY||n.clientY,el=j&&j[0].pageX||n.pageX,eu=j&&j[0].pageY||n.pageY,ec="function"==typeof n.preventDefault?n.preventDefault.bind(n):emptyFunction,eh=n.timeStamp;function normalizeTouches(n){return Array.prototype.slice.call(n).map(n=>({force:n.force,identifier:normalizeIdentifier(n.identifier),get locationX(){return locationX(n.clientX)},get locationY(){return locationY(n.clientY)},pageX:n.pageX,pageY:n.pageY,target:n.target,timestamp:eh}))}if(null!=j)d=normalizeTouches(j),g=normalizeTouches(n.touches);else{var ep=[{force:et,identifier:en,get locationX(){return locationX(eo)},get locationY(){return locationY(es)},pageX:el,pageY:eu,target:n.target,timestamp:eh}];d=ep,g="mouseup"===$||"dragstart"===$?m:ep}var ef={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:n.defaultPrevented,dispatchConfig:f,eventPhase:n.eventPhase,isDefaultPrevented:()=>n.defaultPrevented,isPropagationStopped:()=>_,isTrusted:n.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:z,shiftKey:ee,changedTouches:d,force:et,identifier:en,get locationX(){return locationX(eo)},get locationY(){return locationY(es)},pageX:el,pageY:eu,target:n.target,timestamp:eh,touches:g,type:$},persist:emptyFunction,preventDefault:ec,stopPropagation(){_=!0},target:n.target,timeStamp:eh,touchHistory:l.touchHistory};function locationX(n){if(u=u||(0,h.Z)(ef.currentTarget))return n-u.left}function locationY(n){if(u=u||(0,h.Z)(ef.currentTarget))return n-u.top}return ef}function isStartish(n){return"touchstart"===n||"mousedown"===n}function isMoveish(n){return"touchmove"===n||"mousemove"===n}function isEndish(n){return"touchend"===n||"mouseup"===n||isCancelish(n)}function isCancelish(n){return"touchcancel"===n||"dragstart"===n}var g="__reactResponderId";function composedPathFallback(n){for(var l=[];null!=n&&n!==document.body;)l.push(n),n=n.parentNode;return l}function timestampForTouch(n){return n.timeStamp||n.timestamp}function getTouchIdentifier(n){var l=n.identifier;return null==l&&console.error("Touch object is missing identifier."),l}function printTouch(n){return JSON.stringify({identifier:n.identifier,pageX:n.pageX,pageY:n.pageY,timestamp:timestampForTouch(n)})}function printTouchBank(n){var l=n.touchBank,u=JSON.stringify(l.slice(0,20));return l.length>20&&(u+=" (original size: "+l.length+")"),u}var _=u(20008),j={},$=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],z=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],ee={touchstart:$,mousedown:$,touchmove:z,mousemove:z,scroll:["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}]},et={id:null,idPath:null,node:null},en=new Map,eo=!1,es=0,el={id:null,node:null,idPath:null},eu=new class{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(n,l){var u=this._touchHistory;if(isMoveish(n))l.changedTouches.forEach(n=>{var l;(l=u.touchBank[getTouchIdentifier(n)])?(l.touchActive=!0,l.previousPageX=l.currentPageX,l.previousPageY=l.currentPageY,l.previousTimeStamp=l.currentTimeStamp,l.currentPageX=n.pageX,l.currentPageY=n.pageY,l.currentTimeStamp=timestampForTouch(n),u.mostRecentTimeStamp=timestampForTouch(n)):console.warn("Cannot record touch move without a touch start.\n","Touch Move: "+printTouch(n)+"\n","Touch Bank: "+printTouchBank(u))});else if(isStartish(n))l.changedTouches.forEach(n=>{var l,d,h,f;return l=n,d=u,h=getTouchIdentifier(l),void((f=d.touchBank[h])?(f.touchActive=!0,f.startPageX=l.pageX,f.startPageY=l.pageY,f.startTimeStamp=timestampForTouch(l),f.currentPageX=l.pageX,f.currentPageY=l.pageY,f.currentTimeStamp=timestampForTouch(l),f.previousPageX=l.pageX,f.previousPageY=l.pageY,f.previousTimeStamp=timestampForTouch(l)):d.touchBank[h]={touchActive:!0,startPageX:l.pageX,startPageY:l.pageY,startTimeStamp:timestampForTouch(l),currentPageX:l.pageX,currentPageY:l.pageY,currentTimeStamp:timestampForTouch(l),previousPageX:l.pageX,previousPageY:l.pageY,previousTimeStamp:timestampForTouch(l)},d.mostRecentTimeStamp=timestampForTouch(l))}),u.numberActiveTouches=l.touches.length,1===u.numberActiveTouches&&(u.indexOfSingleActiveTouch=l.touches[0].identifier);else if(isEndish(n)&&(l.changedTouches.forEach(n=>{var l;(l=u.touchBank[getTouchIdentifier(n)])?(l.touchActive=!1,l.previousPageX=l.currentPageX,l.previousPageY=l.currentPageY,l.previousTimeStamp=l.currentTimeStamp,l.currentPageX=n.pageX,l.currentPageY=n.pageY,l.currentTimeStamp=timestampForTouch(n),u.mostRecentTimeStamp=timestampForTouch(n)):console.warn("Cannot record touch end without a touch start.\n","Touch End: "+printTouch(n)+"\n","Touch Bank: "+printTouchBank(u))}),u.numberActiveTouches=l.touches.length,1===u.numberActiveTouches))for(var d=u.touchBank,h=0;h<d.length;h++){var f=d[h];if(null!=f&&f.touchActive){u.indexOfSingleActiveTouch=h;break}}}get touchHistory(){return this._touchHistory}};function getResponderConfig(n){var l=en.get(n);return null!=l?l:j}function eventListener(n){var l,u,d,h,f,m,_,j=n.type,$=n.target;if("touchstart"===j&&(eo=!0),("touchmove"===j||es>1)&&(eo=!1),("mousedown"!==j||!eo)&&("mousemove"!==j||!eo)&&("mousemove"!==j||!(es<1))){if(eo&&"mouseup"===j){0===es&&(eo=!1);return}var z=isStartish(j)&&(l=n.altKey,u=n.button,d=n.buttons,h=n.ctrlKey,f=n.type,m=!1===l&&!1===h,"touchstart"===f||"touchmove"===f||"mousedown"===f&&(0===u||1===d)&&!!m||"mousemove"===f&&1===d&&!!m),en=isMoveish(j),ec=isEndish(j),eh="scroll"===j,ep="select"===j||"selectionchange"===j,ef=createResponderEvent(n,eu);(z||en||ec)&&(n.touches?es=n.touches.length:z?es=1:ec&&(es=0),eu.recordTouchTrack(j,ef.nativeEvent));var em=function(n){for(var l=[],u=[],d="selectionchange"===n.type?composedPathFallback(window.getSelection().anchorNode):null!=n.composedPath?n.composedPath():composedPathFallback(n.target),h=0;h<d.length;h++){var f=d[h],m=null!=f?f[g]:null;null!=m&&(l.push(m),u.push(f))}return{idPath:l,nodePath:u}}(n),eg=!1;if(z||en||eh&&es>0){var e_=el.idPath,ey=em.idPath;if(null!=e_&&null!=ey){var ev=function(n,l){var u=n.length,d=l.length;if(0===u||0===d||n[u-1]!==l[d-1])return null;var h=n[0],f=0,m=l[0],g=0;u-d>0&&(h=n[f=u-d],u=d),d-u>0&&(m=l[g=d-u],d=u);for(var _=u;_--;){if(h===m)return h;h=n[f++],m=l[g++]}return null}(e_,ey);if(null!=ev){var eE=ey.indexOf(ev)+(ev===el.id?1:0);em={idPath:ey.slice(eE),nodePath:em.nodePath.slice(eE)}}else em=null}null!=em&&null!=(_=function(n,l,u){var d=ee[l.type];if(null!=d){for(var h=n.idPath,f=n.nodePath,m=d[0],g=d[1],_=d[2].bubbles,check=function(n,l,d){var f=getResponderConfig(n)[d];if(null!=f&&(u.currentTarget=l,!0===f(u)))return{id:n,node:l,idPath:h.slice(h.indexOf(n))}},j=h.length-1;j>=0;j--){var $=check(h[j],f[j],m);if(null!=$)return $;if(!0===u.isPropagationStopped())return}if(_)for(var z=0;z<h.length;z++){var et=check(h[z],f[z],g);if(null!=et)return et;if(!0===u.isPropagationStopped())return}else{var en=h[0],eo=f[0];if(l.target===eo)return check(en,eo,g)}}}(em,n,ef))&&(function(n,l){var u=el,d=u.id,h=u.node,f=l.id,m=l.node,g=getResponderConfig(f),_=g.onResponderGrant,j=g.onResponderReject;if(n.bubbles=!1,n.cancelable=!1,n.currentTarget=m,null==d)null!=_&&(n.currentTarget=m,n.dispatchConfig.registrationName="onResponderGrant",_(n)),el=l;else{var $=getResponderConfig(d),z=$.onResponderTerminate,ee=$.onResponderTerminationRequest,et=!0;(null!=ee&&(n.currentTarget=h,n.dispatchConfig.registrationName="onResponderTerminationRequest",!1===ee(n)&&(et=!1)),et)?(null!=z&&(n.currentTarget=h,n.dispatchConfig.registrationName="onResponderTerminate",z(n)),null!=_&&(n.currentTarget=m,n.dispatchConfig.registrationName="onResponderGrant",_(n)),el=l):null!=j&&(n.currentTarget=m,n.dispatchConfig.registrationName="onResponderReject",j(n))}}(ef,_),eg=!0)}if(null!=el.id&&null!=el.node){var eS=el,ew=eS.id,eT=eS.node,eI=getResponderConfig(ew),eR=eI.onResponderStart,eP=eI.onResponderMove,eA=eI.onResponderEnd,eO=eI.onResponderRelease,eC=eI.onResponderTerminate,ek=eI.onResponderTerminationRequest;if(ef.bubbles=!1,ef.cancelable=!1,ef.currentTarget=eT,z)null!=eR&&(ef.dispatchConfig.registrationName="onResponderStart",eR(ef));else if(en)null!=eP&&(ef.dispatchConfig.registrationName="onResponderMove",eP(ef));else{var ex=isCancelish(j)||"contextmenu"===j||"blur"===j&&$===window||"blur"===j&&$.contains(eT)&&n.relatedTarget!==eT||eh&&0===es||eh&&$.contains(eT)&&$!==eT||ep&&function(n){if("selectionchange"===n.type){var l,u,d,h,f;return u=(l=window.getSelection()).toString(),d=l.anchorNode,h=l.focusNode,f=d&&d.nodeType===window.Node.TEXT_NODE||h&&h.nodeType===window.Node.TEXT_NODE,u.length>=1&&"\n"!==u&&f}return"select"===n.type}(n),eM=ec&&!ex&&!function(n,l){if(!l||0===l.length)return!1;for(var u=0;u<l.length;u++){var d=l[u].target;if(null!=d&&n.contains(d))return!0}return!1}(eT,n.touches);if(ec&&null!=eA&&(ef.dispatchConfig.registrationName="onResponderEnd",eA(ef)),eM&&(null!=eO&&(ef.dispatchConfig.registrationName="onResponderRelease",eO(ef)),el=et),ex){var eD=!0;("contextmenu"===j||"scroll"===j||"selectionchange"===j)&&(eg?eD=!1:null!=ek&&(ef.dispatchConfig.registrationName="onResponderTerminationRequest",!1===ek(ef)&&(eD=!1))),eD&&(null!=eC&&(ef.dispatchConfig.registrationName="onResponderTerminate",eC(ef)),el=et,eo=!1,es=0)}}}}}var ec=["blur","scroll"],eh=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function removeNode(n){el.id===n&&function(){var n=el,l=n.id,u=n.node;if(null!=l&&null!=u){var d=getResponderConfig(l).onResponderTerminate;if(null!=d){var h=createResponderEvent({},eu);h.currentTarget=u,d(h)}el=et}eo=!1,es=0}(),en.has(n)&&en.delete(n)}var ep={},ef=0;function useResponderEvents(n,l){void 0===l&&(l=ep);var u,h=(null==(u=d.useRef(null)).current&&(u.current=ef++),u.current),f=d.useRef(!1);d.useEffect(()=>(_.Z&&null==window.__reactResponderSystemActive&&(window.addEventListener("blur",eventListener),eh.forEach(n=>{document.addEventListener(n,eventListener)}),ec.forEach(n=>{document.addEventListener(n,eventListener,!0)}),window.__reactResponderSystemActive=!0),()=>{removeNode(h)}),[h]),d.useEffect(()=>{var u,d=l,m=d.onMoveShouldSetResponder,_=d.onMoveShouldSetResponderCapture,j=d.onScrollShouldSetResponder,$=d.onScrollShouldSetResponderCapture,z=d.onSelectionChangeShouldSetResponder,ee=d.onSelectionChangeShouldSetResponderCapture,et=d.onStartShouldSetResponder,eo=d.onStartShouldSetResponderCapture,es=n.current;null!=m||null!=_||null!=j||null!=$||null!=z||null!=ee||null!=et||null!=eo?(u=l,null!=es&&(es[g]=h),en.set(h,u),f.current=!0):f.current&&(removeNode(h),f.current=!1)},[l,n,h]),d.useDebugValue({isResponder:n.current===el.node}),d.useDebugValue(l)}},67265:function(n,l,u){"use strict";u.d(l,{Z:function(){return useStable}});var d=u(2784),h="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():Object.freeze({});function useStable(n){var l=d.useRef(h);return l.current===h&&(l.current=n()),l.current}},29360:function(n,l,u){"use strict";function warnOnce(n,l){}u.d(l,{O:function(){return warnOnce}})},48968:function(n,l,u){"use strict";var d=u(86575);l.Z=new d.Z},86575:function(n,l,u){"use strict";u.d(l,{Z:function(){return EventEmitter}});let EventEmitter=class EventEmitter{constructor(){this._registry={}}addListener(n,l,u){var d,h,f=(null==(h=(d=this._registry)[n])&&(h=new Set,d[n]=h),h),m={context:u,listener:l,remove(){f.delete(m)}};return f.add(m),m}emit(n){var l=this._registry[n];if(null!=l){for(var u=arguments.length,d=Array(u>1?u-1:0),h=1;h<u;h++)d[h-1]=arguments[h];for(var f=0,m=[...l];f<m.length;f++){var g=m[f];g.listener.apply(g.context,d)}}}removeAllListeners(n){null==n?this._registry={}:delete this._registry[n]}listenerCount(n){var l=this._registry[n];return null==l?0:l.size}}},32958:function(n){"use strict";let l;function hue2rgb(n,l,u){return(u<0&&(u+=1),u>1&&(u-=1),u<1/6)?n+(l-n)*6*u:u<.5?l:u<2/3?n+(l-n)*(2/3-u)*6:n}function hslToRgb(n,l,u){let d=u<.5?u*(1+l):u+l-u*l,h=2*u-d,f=hue2rgb(h,d,n+1/3),m=hue2rgb(h,d,n),g=hue2rgb(h,d,n-1/3);return Math.round(255*f)<<24|Math.round(255*m)<<16|Math.round(255*g)<<8}let u="[-+]?\\d*\\.?\\d+",d=u+"%";function call(...n){return"\\(\\s*("+n.join(")\\s*,?\\s*(")+")\\s*\\)"}function callWithSlashSeparator(...n){return"\\(\\s*("+n.slice(0,n.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+n[n.length-1]+")\\s*\\)"}function commaSeparatedCall(...n){return"\\(\\s*("+n.join(")\\s*,\\s*(")+")\\s*\\)"}function parse255(n){let l=parseInt(n,10);return l<0?0:l>255?255:l}function parse360(n){let l=parseFloat(n);return(l%360+360)%360/360}function parse1(n){let l=parseFloat(n);return l<0?0:l>1?255:Math.round(255*l)}function parsePercentage(n){let l=parseFloat(n);return l<0?0:l>100?1:l/100}n.exports=function(n){let h;if("number"==typeof n)return n>>>0===n&&n>=0&&n<=4294967295?n:null;if("string"!=typeof n)return null;let f=(void 0===l&&(l={rgb:RegExp("rgb"+call(u,u,u)),rgba:RegExp("rgba("+commaSeparatedCall(u,u,u,u)+"|"+callWithSlashSeparator(u,u,u,u)+")"),hsl:RegExp("hsl"+call(u,d,d)),hsla:RegExp("hsla("+commaSeparatedCall(u,d,d,u)+"|"+callWithSlashSeparator(u,d,d,u)+")"),hwb:RegExp("hwb"+call(u,d,d)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),l);if(h=f.hex6.exec(n))return parseInt(h[1]+"ff",16)>>>0;let m=function(n){switch(n){case"transparent":return 0;case"aliceblue":return 4042850303;case"antiquewhite":return 4209760255;case"aqua":case"cyan":return 16777215;case"aquamarine":return 2147472639;case"azure":return 4043309055;case"beige":return 4126530815;case"bisque":return 4293182719;case"black":return 255;case"blanchedalmond":return 4293643775;case"blue":return 65535;case"blueviolet":return 2318131967;case"brown":return 2771004159;case"burlywood":return 3736635391;case"burntsienna":return 3934150143;case"cadetblue":return 1604231423;case"chartreuse":return 2147418367;case"chocolate":return 3530104575;case"coral":return 4286533887;case"cornflowerblue":return 1687547391;case"cornsilk":return 4294499583;case"crimson":return 3692313855;case"darkblue":return 35839;case"darkcyan":return 9145343;case"darkgoldenrod":return 3095792639;case"darkgray":case"darkgrey":return 2846468607;case"darkgreen":return 6553855;case"darkkhaki":return 3182914559;case"darkmagenta":return 2332068863;case"darkolivegreen":return 1433087999;case"darkorange":return 4287365375;case"darkorchid":return 2570243327;case"darkred":return 2332033279;case"darksalmon":return 3918953215;case"darkseagreen":return 2411499519;case"darkslateblue":return 1211993087;case"darkslategray":case"darkslategrey":return 793726975;case"darkturquoise":return 13554175;case"darkviolet":return 2483082239;case"deeppink":return 4279538687;case"deepskyblue":return 12582911;case"dimgray":case"dimgrey":return 1768516095;case"dodgerblue":return 512819199;case"firebrick":return 2988581631;case"floralwhite":return 4294635775;case"forestgreen":return 579543807;case"fuchsia":case"magenta":return 4278255615;case"gainsboro":return 3705462015;case"ghostwhite":return 4177068031;case"gold":return 4292280575;case"goldenrod":return 3668254975;case"gray":case"grey":return 2155905279;case"green":return 8388863;case"greenyellow":return 2919182335;case"honeydew":return 4043305215;case"hotpink":return 4285117695;case"indianred":return 3445382399;case"indigo":return 1258324735;case"ivory":return 4294963455;case"khaki":return 4041641215;case"lavender":return 3873897215;case"lavenderblush":return 4293981695;case"lawngreen":return 2096890111;case"lemonchiffon":return 4294626815;case"lightblue":return 2916673279;case"lightcoral":return 4034953471;case"lightcyan":return 3774873599;case"lightgoldenrodyellow":return 4210742015;case"lightgray":case"lightgrey":return 3553874943;case"lightgreen":return 2431553791;case"lightpink":return 4290167295;case"lightsalmon":return 4288707327;case"lightseagreen":return 548580095;case"lightskyblue":return 2278488831;case"lightslategray":case"lightslategrey":return 2005441023;case"lightsteelblue":return 2965692159;case"lightyellow":return 4294959359;case"lime":return 16711935;case"limegreen":return 852308735;case"linen":return 4210091775;case"maroon":return 2147483903;case"mediumaquamarine":return 1724754687;case"mediumblue":return 52735;case"mediumorchid":return 3126187007;case"mediumpurple":return 2473647103;case"mediumseagreen":return 1018393087;case"mediumslateblue":return 2070474495;case"mediumspringgreen":return 16423679;case"mediumturquoise":return 1221709055;case"mediumvioletred":return 3340076543;case"midnightblue":return 421097727;case"mintcream":return 4127193855;case"mistyrose":return 4293190143;case"moccasin":return 4293178879;case"navajowhite":return 4292783615;case"navy":return 33023;case"oldlace":return 4260751103;case"olive":return 2155872511;case"olivedrab":return 1804477439;case"orange":return 4289003775;case"orangered":return 4282712319;case"orchid":return 3664828159;case"palegoldenrod":return 4008225535;case"palegreen":return 2566625535;case"paleturquoise":return 2951671551;case"palevioletred":return 3681588223;case"papayawhip":return 4293907967;case"peachpuff":return 4292524543;case"peru":return 3448061951;case"pink":return 4290825215;case"plum":return 3718307327;case"powderblue":return 2967529215;case"purple":return 2147516671;case"rebeccapurple":return 1714657791;case"red":return 4278190335;case"rosybrown":return 3163525119;case"royalblue":return 1097458175;case"saddlebrown":return 2336560127;case"salmon":return 4202722047;case"sandybrown":return 4104413439;case"seagreen":return 780883967;case"seashell":return 4294307583;case"sienna":return 2689740287;case"silver":return 3233857791;case"skyblue":return 2278484991;case"slateblue":return 1784335871;case"slategray":case"slategrey":return 1887473919;case"snow":return 4294638335;case"springgreen":return 16744447;case"steelblue":return 1182971135;case"tan":return 3535047935;case"teal":return 8421631;case"thistle":return 3636451583;case"tomato":return 4284696575;case"turquoise":return 1088475391;case"violet":return 4001558271;case"wheat":return 4125012991;case"white":return 4294967295;case"whitesmoke":return 4126537215;case"yellow":return 4294902015;case"yellowgreen":return 2597139199}return null}(n);return null!=m?m:(h=f.rgb.exec(n))?(parse255(h[1])<<24|parse255(h[2])<<16|parse255(h[3])<<8|255)>>>0:(h=f.rgba.exec(n))?void 0!==h[6]?(parse255(h[6])<<24|parse255(h[7])<<16|parse255(h[8])<<8|parse1(h[9]))>>>0:(parse255(h[2])<<24|parse255(h[3])<<16|parse255(h[4])<<8|parse1(h[5]))>>>0:(h=f.hex3.exec(n))?parseInt(h[1]+h[1]+h[2]+h[2]+h[3]+h[3]+"ff",16)>>>0:(h=f.hex8.exec(n))?parseInt(h[1],16)>>>0:(h=f.hex4.exec(n))?parseInt(h[1]+h[1]+h[2]+h[2]+h[3]+h[3]+h[4]+h[4],16)>>>0:(h=f.hsl.exec(n))?(255|hslToRgb(parse360(h[1]),parsePercentage(h[2]),parsePercentage(h[3])))>>>0:(h=f.hsla.exec(n))?void 0!==h[6]?(hslToRgb(parse360(h[6]),parsePercentage(h[7]),parsePercentage(h[8]))|parse1(h[9]))>>>0:(hslToRgb(parse360(h[2]),parsePercentage(h[3]),parsePercentage(h[4]))|parse1(h[5]))>>>0:(h=f.hwb.exec(n))?(255|function(n,l,u){if(l+u>=1){let n=Math.round(255*l/(l+u));return n<<24|n<<16|n<<8}let d=hue2rgb(0,1,n+1/3)*(1-l-u)+l,h=hue2rgb(0,1,n)*(1-l-u)+l,f=hue2rgb(0,1,n-1/3)*(1-l-u)+l;return Math.round(255*d)<<24|Math.round(255*h)<<16|Math.round(255*f)<<8}(parse360(h[1]),parsePercentage(h[2]),parsePercentage(h[3])))>>>0:null}},55915:function(n,l,u){"use strict";u.d(l,{N8:function(){return useAudioStatus},bC:function(){return useAudioControl},nY:function(){return AudioProvider}});var d=u(52322),h=u(2784),f=u(73986);let m=(0,h.createContext)(void 0),g=(0,h.createContext)(void 0),AudioProvider=({children:n})=>{let l=(0,h.useRef)(null),u=(0,h.useRef)(!1),_=(0,h.useRef)(void 0),j=(0,h.useRef)(1),$=(0,h.useRef)(!1),[z,ee]=(0,h.useState)({isPlaying:!1,positionMillis:0}),et=(0,h.useCallback)(async({uri:n,initialRate:d,shouldPlay:h,endAt:m,startFrom:g})=>{if(!u.current){u.current=!0,_.current=m,$.current=!1,j.current=d;try{l.current&&await l.current.unloadAsync();let{sound:u}=await f.$.createAsync({uri:n},{shouldPlay:h&&(void 0===m||m>1.5),rate:d,shouldCorrectPitch:!0});if(u.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate),l.current=u,g){let n=1e3*g-500*d;u.setPositionAsync(n)}eh(d)}catch(n){}u.current=!1}},[u,l]),onPlaybackStatusUpdate=async n=>{if(n.isLoaded){ee({isPlaying:n.isPlaying,positionMillis:n.positionMillis,durationMillis:n.durationMillis});let l=1e3*(_.current||0);0!==l&&n.positionMillis>=l-2e3-1e3&&n.isPlaying&&en()}},en=(0,h.useCallback)(async()=>{try{if(!l.current||$.current)return;$.current=!0;for(let n=1;n<=10;n++)await l.current?.setVolumeAsync(1-n/10),await new Promise(n=>setTimeout(n,200/j.current));await l.current.pauseAsync(),l.current.setVolumeAsync(1)}catch(n){console.error("Error fading out:",n)}},[l,$]),eo=(0,h.useCallback)(async()=>{try{l.current&&await l.current?.playAsync()}catch(n){console.error("Error playing sound:",n)}},[l]),es=(0,h.useCallback)(async()=>{try{l.current&&await l.current?.pauseAsync()}catch(n){console.error("Error pausing sound:",n)}},[l]),el=(0,h.useCallback)(async()=>{try{if(!l.current)return;await l.current?.setPositionAsync(0),await l.current?.playAsync()}catch(n){console.error("Error starting over:",n)}},[l]),eu=(0,h.useCallback)(async()=>{try{l.current&&await l.current?.unloadAsync(),ee({isPlaying:!1,positionMillis:0,durationMillis:0})}catch(n){console.error("Error unloading sound:",n)}},[l]),ec=(0,h.useCallback)(async()=>{try{l.current&&await l.current?.stopAsync()}catch(n){console.error("Error stopping sound:",n)}},[l]),eh=(0,h.useCallback)(async n=>{try{l.current&&await l.current?.setRateAsync(n,!0),j.current=n}catch(n){console.error("Error setting rate:",n)}},[l]),ep=(0,h.useCallback)(async n=>{try{l.current&&await l.current?.setVolumeAsync(n)}catch(n){console.error("Error setting volume:",n)}},[l]),ef=(0,h.useMemo)(()=>({loadSound:et,play:eo,pause:es,stop:ec,unload:eu,setRate:eh,startOver:el,setVolume:ep}),[et,eo,es,ec,eu,eh,el,ep]),em=(0,h.useMemo)(()=>z,[z]);return(0,d.jsx)(m.Provider,{value:ef,children:(0,d.jsx)(g.Provider,{value:em,children:n})})},useAudioControl=()=>{let n=(0,h.useContext)(m);if(!n)throw Error("useAudioControl must be used within an AudioProvider");return n},useAudioStatus=()=>{let n=(0,h.useContext)(g);if(!n)throw Error("useAudioStatus must be used within an AudioProvider");return n}},90191:function(n,l,u){"use strict";u.d(l,{$O:function(){return z},AE:function(){return eh},AP:function(){return g},Dh:function(){return $},G8:function(){return et},GL:function(){return ep},Hj:function(){return ec},KE:function(){return es},PR:function(){return en},Pr:function(){return eu},Rv:function(){return j},ao:function(){return el},bm:function(){return eo},d:function(){return h},fS:function(){return _},m$:function(){return ef},mP:function(){return f},mw:function(){return m},nW:function(){return ee}});var d=u(34406);let h=760,f=28,m=1.6,g="libraryPaths",_={visit:"recentUserVisit",completion:"recentUserCompletion"},j="Feel smarter.",$="Read books as bite-sized games.",z="Feel smarter reading books as bite-sized games",ee=d.env.CRONE_URI||"https://www.crone.ai",et="https://www.crone.ai",en=5,eo="https://apps.apple.com/app/id6476424527",es="/home",el="/signup",eu="/login",ec="https://discord.gg/RcVCHnnK";d.env.TEST_PUSH_TOKEN;let eh={url:`${et}/start/cc/`,path:"/start/cc/"},ep={url:`${et}/paths/`,path:"/paths/"},ef={url:`${et}/wiki/`,path:"/wiki/"}},66599:function(n,l,u){"use strict";u.d(l,{$6:function(){return eh},eW:function(){return en},I8:function(){return eu},db:function(){return el},Vv:function(){return et},tO:function(){return ec}});var d,h=u(96327);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */(0,h.KN)("firebase","10.7.2","app");var f=u(80855),m=u(98747),g=u(71540);u(83395);var _=u(46387);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ContextProvider=class ContextProvider{constructor(n,l,u){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=n.getImmediate({optional:!0}),this.messaging=l.getImmediate({optional:!0}),this.auth||n.get().then(n=>this.auth=n,()=>{}),this.messaging||l.get().then(n=>this.messaging=n,()=>{}),this.appCheck||u.get().then(n=>this.appCheck=n,()=>{})}async getAuthToken(){if(this.auth)try{let n=await this.auth.getToken();return null==n?void 0:n.accessToken}catch(n){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(n){return}}async getAppCheckToken(n){if(this.appCheck){let l=n?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return l.error?null:l.token}return null}async getContext(n){let l=await this.getAuthToken(),u=await this.getMessagingToken(),d=await this.getAppCheckToken(n);return{authToken:l,messagingToken:u,appCheckToken:d}}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let j="us-central1";let FunctionsService=class FunctionsService{constructor(n,l,u,d,h=j,f){this.app=n,this.fetchImpl=f,this.emulatorOrigin=null,this.contextProvider=new ContextProvider(l,u,d),this.cancelAllRequests=new Promise(n=>{this.deleteService=()=>Promise.resolve(n())});try{let n=new URL(h);this.customDomain=n.origin,this.region=j}catch(n){this.customDomain=null,this.region=h}}_delete(){return this.deleteService()}_url(n){let l=this.app.options.projectId;if(null!==this.emulatorOrigin){let u=this.emulatorOrigin;return`${u}/${l}/${this.region}/${n}`}return null!==this.customDomain?`${this.customDomain}/${n}`:`https://${this.region}-${l}.cloudfunctions.net/${n}`}};let $="@firebase/functions",z="0.11.0";d=fetch.bind(self),(0,h.Xd)(new _.wA("functions",(n,{instanceIdentifier:l})=>{let u=n.getProvider("app").getImmediate(),h=n.getProvider("auth-internal"),f=n.getProvider("messaging-internal"),m=n.getProvider("app-check-internal");return new FunctionsService(u,h,f,m,l,d)},"PUBLIC").setMultipleInstances(!0)),(0,h.KN)($,z,void 0),(0,h.KN)($,z,"esm2017");var ee=u(34406);let et=new f.hJ,en=new f.O4("apple.com"),eo={apiKey:"AIzaSyBk6cl07oOf2jWrrUlFEMWDAj4Vgs50C5o",authDomain:"crone-71cdc.firebaseapp.com",databaseURL:ee.env.NEXT_PUBLIC_FIREBASE_DATABASE_URL,projectId:"crone-71cdc",storageBucket:"crone-71cdc.appspot.com",messagingSenderId:"593691764136",appId:"1:593691764136:web:a59326c758181a4511a99d",measurementId:"G-CW6JQJY9HY"},es=(0,h.ZF)(eo),el=(0,m.ad)(es),eu=(0,f.v0)(),ec=(0,g.cF)(),eh="crone-71cdc.appspot.com"},14675:function(n,l,u){"use strict";u.d(l,{t:function(){return z}});let d="undefined"!=typeof window&&(null===(f=window.document)||void 0===f?void 0:f.createElement)!=null,hasAccessToLocalStorage=()=>{try{return window.localStorage,!0}catch{return!1}},h=new Map,createMMKV=n=>{if(null!=n.encryptionKey)throw Error("MMKV: 'encryptionKey' is not supported on Web!");if(null!=n.path)throw Error("MMKV: 'path' is not supported on Web!");!hasAccessToLocalStorage()&&d&&console.warn("MMKV: LocalStorage has been disabled. Your experience will be limited to in-memory storage!");let storage=()=>{var n,l;if(!d)throw Error("Tried to access storage on the server. Did you forget to call this in useEffect?");if(!hasAccessToLocalStorage())return{getItem:n=>h.get(n)??null,setItem:(n,l)=>h.set(n,l),removeItem:n=>h.delete(n),clear:()=>h.clear(),length:h.size,key:n=>Object.keys(h).at(n)??null};let f=(null===(n=u.g)||void 0===n?void 0:n.localStorage)??(null===(l=window)||void 0===l?void 0:l.localStorage)??localStorage;if(null==f)throw Error("Could not find 'localStorage' instance!");return f},l=null!=u.g.TextEncoder?new u.g.TextEncoder:{encode:()=>{throw Error("TextEncoder is not supported in this environment!")},encodeInto:()=>{throw Error("TextEncoder is not supported in this environment!")},encoding:"utf-8"};if(n.id.includes("\\"))throw Error("MMKV: `id` cannot contain the backslash character (`\\`)!");let f=`${n.id}\\`,prefixedKey=n=>{if(n.includes("\\"))throw Error("MMKV: `key` cannot contain the backslash character (`\\`)!");return`${f}${n}`};return{clearAll:()=>{let n=Object.keys(storage());for(let l of n)l.startsWith(f)&&storage().removeItem(l)},delete:n=>storage().removeItem(prefixedKey(n)),set:(n,l)=>{storage().setItem(prefixedKey(n),l.toString())},getString:n=>storage().getItem(prefixedKey(n))??void 0,getNumber:n=>{let l=storage().getItem(prefixedKey(n));if(null!=l)return Number(l)},getBoolean:n=>{let l=storage().getItem(prefixedKey(n));if(null!=l)return"true"===l},getBuffer:n=>{let u=storage().getItem(prefixedKey(n));if(null!=u)return l.encode(u)},getAllKeys:()=>{let n=Object.keys(storage());return n.filter(n=>n.startsWith(f)).map(n=>n.slice(f.length))},contains:n=>null!=storage().getItem(prefixedKey(n)),recrypt:()=>{throw Error("`recrypt(..)` is not supported on Web!")}}},createMockMMKV=()=>{let n=new Map;return{clearAll:()=>n.clear(),delete:l=>n.delete(l),set:(l,u)=>n.set(l,u),getString:l=>{let u=n.get(l);return"string"==typeof u?u:void 0},getNumber:l=>{let u=n.get(l);return"number"==typeof u?u:void 0},getBoolean:l=>{let u=n.get(l);return"boolean"==typeof u?u:void 0},getBuffer:l=>{let u=n.get(l);return u instanceof Uint8Array?u:void 0},getAllKeys:()=>Array.from(n.keys()),contains:l=>n.has(l),recrypt:()=>{console.warn("Encryption is not supported in mocked MMKV instances!")}}};var f,m=u(34406);let g=new Map;let MMKV_MMKV=class MMKV_MMKV{constructor(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"mmkv.default"};this.id=n.id,this.nativeInstance=null!=u.g.process&&null!=m.env.JEST_WORKER_ID?createMockMMKV():createMMKV(n),this.functionCache={}}get onValueChangedListeners(){return g.has(this.id)||g.set(this.id,[]),g.get(this.id)}getFunctionFromCache(n){return null==this.functionCache[n]&&(this.functionCache[n]=this.nativeInstance[n]),this.functionCache[n]}onValuesChanged(n){if(0!==this.onValueChangedListeners.length)for(let l of n)for(let n of this.onValueChangedListeners)n(l)}set(n,l){let u=this.getFunctionFromCache("set");u(n,l),this.onValuesChanged([n])}getBoolean(n){let l=this.getFunctionFromCache("getBoolean");return l(n)}getString(n){let l=this.getFunctionFromCache("getString");return l(n)}getNumber(n){let l=this.getFunctionFromCache("getNumber");return l(n)}getBuffer(n){let l=this.getFunctionFromCache("getBuffer");return l(n)}contains(n){let l=this.getFunctionFromCache("contains");return l(n)}delete(n){let l=this.getFunctionFromCache("delete");l(n),this.onValuesChanged([n])}getAllKeys(){let n=this.getFunctionFromCache("getAllKeys");return n()}clearAll(){let n=this.getAllKeys(),l=this.getFunctionFromCache("clearAll");l(),this.onValuesChanged(n)}recrypt(n){let l=this.getFunctionFromCache("recrypt");return l(n)}toString(){return`MMKV (${this.id}): [${this.getAllKeys().join(", ")}]`}toJSON(){return{[this.id]:this.getAllKeys()}}addOnValueChangedListener(n){return this.onValueChangedListeners.push(n),{remove:()=>{let l=this.onValueChangedListeners.indexOf(n);-1!==l&&this.onValueChangedListeners.splice(l,1)}}}};var _=u(2784);let j=null;function createMMKVHook(n){return(l,u)=>{let d=u??(null==j&&(j=new MMKV_MMKV),j),[h,f]=(0,_.useState)(0),m=(0,_.useMemo)(()=>n(d,l),[d,l,h]),g=(0,_.useCallback)(u=>{let h="function"==typeof u?u(n(d,l)):u;switch(typeof h){case"number":case"string":case"boolean":d.set(l,h);break;case"undefined":d.delete(l);break;case"object":if(h instanceof Uint8Array){d.set(l,h);break}throw Error(`MMKV: Type object (${h}) is not supported!`);default:throw Error(`MMKV: Type ${typeof h} is not supported!`)}},[l,d]);return(0,_.useEffect)(()=>{let n=d.addOnValueChangedListener(n=>{n===l&&f(n=>n+1)});return()=>n.remove()},[l,d]),[m,g]}}createMMKVHook((n,l)=>n.getString(l)),createMMKVHook((n,l)=>n.getNumber(l)),createMMKVHook((n,l)=>n.getBoolean(l)),createMMKVHook((n,l)=>n.getBuffer(l));let $=new MMKV_MMKV({id:"root"}),z={getString:function(n){try{return $.getString(n)??null}catch{return null}},setString:function(n,l){try{return $.set(n,l),!0}catch{return!1}},getValue:function(n){try{let l=$.getString(n);return JSON.parse(l)??null}catch{return null}},set:function(n,l){try{return $.set(n,JSON.stringify(l)),!0}catch{return!1}},remove:function(n){try{return $.delete(n),!0}catch{return!1}},clearAll:function(){try{return $.clearAll(),!0}catch{return!1}}}},93878:function(n,l,u){"use strict";u.d(l,{Ho:function(){return AuthProvider},aC:function(){return useAuth}});var d=u(52322),h=u(2784),f=u(66599),m=u(93555),g=u(77566),_=u(14675),j=u(35196),$=u(26516);let setAdminCookies=n=>{let l="isAdmin";return"web"===$.Z.OS&&(0,j.setCookie)(l,n?.toString(),{path:"/",sameSite:"lax"}),_.t.set(l,n),n};var z=u(69761),ee=u(12010),et=u(58943),en=u(95840);let eo=(0,h.createContext)({user:null,userProfile:null,isAuthenticated:null,isAdmin:null,isSubscribed:null,authLoading:!0}),AuthProvider=({children:n})=>{let l=useAuthHelper();return(0,d.jsx)(eo.Provider,{value:l,children:n})},useAuth=()=>{let n=(0,h.useContext)(eo);return n},useAuthHelper=()=>{let[n,l]=(0,h.useState)(null),[u,d]=(0,h.useState)(null),[j,$]=(0,h.useState)(null),[eo,es]=(0,h.useState)(null),[el,eu]=(0,h.useState)(!0),{data:ec}=(0,et.a)(["userProfile",eo?.uid],async()=>await m.U2("/api/userProfile/"+eo?.uid),{enabled:!!eo?.uid});return(0,h.useEffect)(()=>{if(ec){let n=ec?.subscribedStatus;(0,z.Y)(n||"NONE");let l=en.c9.includes(n);$(l),(0,ee.O)(ec?.offWaitlist||!1)}},[ec,eo]),(0,h.useEffect)(()=>{let handleTokenAndUserState=async(n,l=2)=>{try{let{claims:{role:l},token:u,expirationTime:d}=await n.getIdTokenResult(),h=u,f=new Date(d),m=new Date;f.getTime()-m.getTime()<12e5&&(h=await n.getIdToken(!0)),_.t.setString("token",h),setUserFirebaseState(n,"admin"===l)}catch(u){"auth/invalid-credential"===u.code&&(l>0?(await new Promise(n=>setTimeout(n,1e3)),await handleTokenAndUserState(n,l-1)):n&&f.I8.signOut()),console.error("Failed to handle token and user state:",u),eu(!1)}},setUserFirebaseState=(n,u)=>{d(!!n),es(n),setAdminCookies(u),l(u),(0,g.D)(!!n),eu(!1)},handleAuthStateChanged=async n=>{if(eu(!0),n)try{await handleTokenAndUserState(n)}catch(n){console.error("Token refresh failed, logging out user.",n),f.I8.signOut(),setUserFirebaseState(null,!1)}else setUserFirebaseState(null,!1);eu(!1)},n=f.I8.onAuthStateChanged(handleAuthStateChanged),u=f.I8.onIdTokenChanged(handleAuthStateChanged);return()=>{n(),u()}},[]),{user:eo,userProfile:ec,isAuthenticated:u,isAdmin:n,isSubscribed:j||n,authLoading:el}}},95840:function(n,l,u){"use strict";u.d(l,{c9:function(){return d}});let d=["TRIAL","SUBSCRIBED","LIFETIME","DEMO"]},77566:function(n,l,u){"use strict";u.d(l,{D:function(){return setLoggedInCookies}});var d=u(14675),h=u(35196),f=u(26516);let setLoggedInCookies=n=>{let l="loggedIn";return"web"===f.Z.OS&&(0,h.setCookie)(l,n?.toString(),{path:"/",sameSite:"lax"}),d.t.set(l,n),n}},69761:function(n,l,u){"use strict";u.d(l,{Y:function(){return setSubscriptionCookies},e:function(){return getSubscriptionCookies}});var d=u(14675);let setSubscriptionCookies=n=>{let l=n?.toString();d.t.set("subscribedStatus",l)},getSubscriptionCookies=()=>{let n=d.t.getString("subscribedStatus");return n}},12010:function(n,l,u){"use strict";u.d(l,{O:function(){return setWaitlistedCookies}});var d=u(14675);let setWaitlistedCookies=n=>n?d.t.set("offWaitlist",n):null},93555:function(n,l,u){"use strict";u.d(l,{IV:function(){return del},U2:function(){return get},v_:function(){return post}});var d=u(89644),h=u.n(d),f=u(28772),m=u(66599),g=u(14675),_=u(26516),j=u(90191);let $="web"===_.Z.OS?j.G8:j.G8?.replace("http://","https://"),z=h().create({baseURL:$,headers:{"Content-Type":"application/json"},maxBodyLength:1e8,maxContentLength:1e8}),refreshToken=async()=>m.I8.currentUser?m.I8.currentUser.getIdToken(!0).then(n=>(g.t.setString("token",n),n)).catch(n=>(console.error("Token refresh failed:",n),(0,f.U)(),Promise.reject("Token refresh failed"))):Promise.reject("No current user for token refresh");z.interceptors.request.use(async n=>{let l=g.t.getString("token");return l&&n&&(n.headers||(n.headers={}),n.headers.Authorization=`Bearer ${l}`),n}),z.interceptors.response.use(void 0,async n=>{let l=n.config;if(n.response?.status===401&&!l._retry){l._retry=!0;try{let n=await refreshToken();return z.defaults.headers.common.Authorization=`Bearer ${n}`,l.headers.Authorization=`Bearer ${n}`,z(l)}catch(n){return console.error("Refresh token error:",n),Promise.reject(n)}}return Promise.reject(n)});var ee=u(74650);let get=async(n,l,u)=>z.get(n,{params:l,headers:u}).then(({data:n})=>n).catch(n=>{let l=(0,ee.x)(n);if(!l.handledError)throw l.error;return l.error}),post=async(n,l,u)=>z.post(n,l,u).then(n=>n?.data).catch(n=>{let l=(0,ee.x)(n);if(!l.handledError)throw l.error;return l.error}),del=async(n,l)=>z.delete(n,{params:l}).then(n=>n?.data).catch(n=>{let l=(0,ee.x)(n);if(!l.handledError)throw l.error;return l.error})},74650:function(n,l,u){"use strict";u.d(l,{x:function(){return handleServerErrors}});var d=u(28772);let handleServerErrors=n=>(console.log("e",n),n.response?.status)?403===n.response.status?((0,d.U)(),{handledError:!0,error:n}):402===n.response.status?((0,d.p)("/pricing"),{handledError:!0,error:n}):429===n.response.status?(alert("Too many requests, please try again later"),{handledError:!0,error:n}):{handledError:!1,error:n}:(console.log("error",n),{handledError:!1,error:n})},28772:function(n,l,u){"use strict";u.d(l,{U:function(){return logoutHelper},p:function(){return redirectHelper}});var d=u(90191);let logoutHelper=()=>{if(window.location){let n="";window.location.pathname&&window.location.pathname?.trim()?.length>1&&(n=encodeURIComponent(window.location.pathname)),window.location.href=`${d.G8}/login?from=${n}`}else window.location.href=`${d.G8}/login`},redirectHelper=n=>{window.location&&(window.location.href=`${window.location.origin}${n}`)}},31403:function(){},40645:function(){},97729:function(n,l,u){n.exports=u(72947)},5632:function(n,l,u){n.exports=u(29870)},45847:function(n,l,u){n.exports=u(69510)},9057:function(n,l,u){var d=u(34406);(function(){var l,u,h,f;"undefined"!=typeof performance&&null!==performance&&performance.now?n.exports=function(){return performance.now()}:null!=d&&d.hrtime?(n.exports=function(){return(l()-f)/1e6},u=d.hrtime,f=(l=function(){var n;return 1e9*(n=u())[0]+n[1]})()-1e9*d.uptime()):Date.now?(n.exports=function(){return Date.now()-h},h=Date.now()):(n.exports=function(){return new Date().getTime()-h},h=new Date().getTime())}).call(this)},63197:function(n,l,u){"use strict";let d,h,f,m,g,_;u.d(l,{ZP:function(){return nr}});let j="undefined"!=typeof window?window:void 0,$="undefined"!=typeof globalThis?globalThis:j,z=Array.prototype,ee=z.forEach,et=z.indexOf,en=null==$?void 0:$.navigator,eo=null==$?void 0:$.document,es=null==$?void 0:$.location,el=null==$?void 0:$.fetch,eu=null!=$&&$.XMLHttpRequest&&"withCredentials"in new $.XMLHttpRequest?$.XMLHttpRequest:void 0,ec=null==$?void 0:$.AbortController,eh=null==en?void 0:en.userAgent,ep=null!=j?j:{},ef={DEBUG:!1,LIB_VERSION:"1.174.2"},em=Array.isArray,eg=Object.prototype,e_=eg.hasOwnProperty,ey=eg.toString,ev=em||function(n){return"[object Array]"===ey.call(n)},b=function(n){return"function"==typeof n},y=function(n){return n===Object(n)&&!ev(n)},w=function(n){if(y(n)){for(let l in n)if(e_.call(n,l))return!1;return!0}return!1},S=function(n){return void 0===n},E=function(n){return"[object String]"==ey.call(n)},x=function(n){return E(n)&&0===n.trim().length},k=function(n){return null===n},I=function(n){return S(n)||k(n)},F=function(n){return"[object Number]"==ey.call(n)},R=function(n){return"[object Boolean]"===ey.call(n)},P=n=>n instanceof FormData,eE="[PostHog.js]",eS={_log:function(n){if(j&&(ef.DEBUG||ep.POSTHOG_DEBUG)&&!S(j.console)&&j.console){let h="__rrweb_original__"in j.console[n]?j.console[n].__rrweb_original__:j.console[n];for(var l=arguments.length,u=Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];h(eE,...u)}},info:function(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];eS._log("log",...l)},warn:function(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];eS._log("warn",...l)},error:function(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];eS._log("error",...l)},critical:function(){for(var n=arguments.length,l=Array(n),u=0;u<n;u++)l[u]=arguments[u];console.error(eE,...l)},uninitializedWarning:n=>{eS.error(`You must initialize PostHog before calling ${n}`)}},C=(n,l,u)=>{if(n.config.disable_external_dependency_loading)return eS.warn(`${l} was requested but loading of external scripts is disabled.`),u("Loading of external scripts is disabled");let s=()=>{var n;if(!eo)return u("document not found");let d=eo.createElement("script");d.type="text/javascript",d.crossOrigin="anonymous",d.src=l,d.onload=n=>u(void 0,n),d.onerror=n=>u(n);let h=eo.querySelectorAll("body > script");h.length>0?null===(n=h[0].parentNode)||void 0===n||n.insertBefore(d,h[0]):eo.body.appendChild(d)};null!=eo&&eo.body?s():null==eo||eo.addEventListener("DOMContentLoaded",s)};ep.__PosthogExtensions__=ep.__PosthogExtensions__||{},ep.__PosthogExtensions__.loadExternalDependency=(n,l,u)=>{let d=`/static/${l}.js?v=${n.version}`;"toolbar"===l&&(d=`${d}?&=${3e5*Math.floor(Date.now()/3e5)}`);let h=n.requestRouter.endpointFor("assets",d);C(n,h,u)},ep.__PosthogExtensions__.loadSiteApp=(n,l,u)=>{let d=n.requestRouter.endpointFor("api",l);C(n,d,u)};let ew={},A=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function L(n,l,u){if(ev(n)){if(ee&&n.forEach===ee)n.forEach(l,u);else if("length"in n&&n.length===+n.length){for(let d=0,h=n.length;d<h;d++)if(d in n&&l.call(u,n[d],d)===ew)return}}}function O(n,l,u){if(!I(n)){if(ev(n))return L(n,l,u);if(P(n)){for(let d of n.entries())if(l.call(u,d[1],d[0])===ew)return}else for(let d in n)if(e_.call(n,d)&&l.call(u,n[d],d)===ew)return}}let D=function(n){for(var l=arguments.length,u=Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];return L(u,function(l){for(let u in l)void 0!==l[u]&&(n[u]=l[u])}),n};function q(n,l){return -1!==n.indexOf(l)}function N(n){let l=Object.keys(n),u=l.length,d=Array(u);for(;u--;)d[u]=[l[u],n[l[u]]];return d}let B=function(n){try{return n()}catch{return}},H=function(n){return function(){try{for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];return n.apply(this,u)}catch(n){eS.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),eS.critical(n)}}},U=function(n){let l={};return O(n,function(n,u){E(n)&&n.length>0&&(l[u]=n)}),l},W=function(n){return n.replace(/^\$/,"")},V=function(n){let l,u,d,h="",f=0;for(l=u=0,f=(n=(n+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,d=0;d<f;d++){let f=n.charCodeAt(d),m=null;f<128?u++:m=f>127&&f<2048?String.fromCharCode(f>>6|192,63&f|128):String.fromCharCode(f>>12|224,f>>6&63|128,63&f|128),k(m)||(u>l&&(h+=n.substring(l,u)),h+=m,l=u=d+1)}return u>l&&(h+=n.substring(l,n.length)),h},eT=function(){function t(n){return n&&(n.preventDefault=t.preventDefault,n.stopPropagation=t.stopPropagation),n}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(n,l,u,d,h){if(n){if(n.addEventListener&&!d)n.addEventListener(l,u,!!h);else{let d="on"+l,h=n[d];n[d]=function(l){if(!(l=l||t(null==j?void 0:j.event)))return;let d,f=!0;b(h)&&(d=h(l));let m=u.call(n,l);return!1!==d&&!1!==m||(f=!1),f}}}else eS.error("No valid element provided to register_event")}}();function Q(n,l){for(let u=0;u<n.length;u++)if(l(n[u]))return n[u]}(ra=d||(d={})).GZipJS="gzip-js",ra.Base64="base64";let eI="$people_distinct_id",eR="__alias",eP="__timers",eA="$autocapture_disabled_server_side",eO="$heatmaps_enabled_server_side",eC="$exception_capture_enabled_server_side",ek="$exception_capture_endpoint_suffix",ex="$web_vitals_enabled_server_side",eM="$web_vitals_allowed_metrics",eD="$session_recording_enabled_server_side",eN="$console_log_recording_enabled_server_side",eV="$session_recording_network_payload_capture",eF="$session_recording_canvas_recording",eL="$replay_sample_rate",ej="$replay_minimum_duration",eU="$sesid",eB="$session_is_sampled",e$="$session_recording_url_trigger_activated_session",eH="$session_recording_url_trigger_status",eW="$enabled_feature_flags",eq="$early_access_features",ez="$stored_person_properties",eG="$stored_group_properties",eK="$surveys",eX="$surveys_activated",eY="$flag_call_reported",eQ="$user_state",eJ="$client_session_props",eZ="$capture_rate_limit",e0="$initial_campaign_params",e1="$initial_referrer_info",e2="$initial_person_info",e3="$epp",e5="__POSTHOG_TOOLBAR__",e4=[eI,eR,"__cmpns",eP,eD,eO,eU,eW,eQ,eq,eG,ez,eK,eY,eJ,eZ,e0,e1,e3],e9="$active_feature_flags",e6="$override_feature_flags",e7="$feature_flag_payloads",Le=n=>{let l={};for(let[u,d]of N(n||{}))d&&(l[u]=d);return l};let Oe=class Oe{constructor(n){this.instance=n,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}getFlags(){return Object.keys(this.getFlagVariants())}getFlagVariants(){let n=this.instance.get_property(eW),l=this.instance.get_property(e6);if(!l)return n||{};let u=D({},n),d=Object.keys(l);for(let n=0;n<d.length;n++)u[d[n]]=l[d[n]];return this._override_warning||(eS.warn(" Overriding feature flags!",{enabledFlags:n,overriddenFlags:l,finalFlags:u}),this._override_warning=!0),u}getFlagPayloads(){return this.instance.get_property(e7)||{}}reloadFeatureFlags(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}setAnonymousDistinctId(n){this.$anon_distinct_id=n}setReloadingPaused(n){this.reloadFeatureFlagsInAction=n}resetRequestQueue(){this.reloadFeatureFlagsQueued=!1}_startReloadTimer(){this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(()=>{!this.reloadFeatureFlagsInAction&&this.reloadFeatureFlagsQueued&&(this.reloadFeatureFlagsQueued=!1,this._reloadFeatureFlagsRequest())},5)}_reloadFeatureFlagsRequest(){if(this.instance.config.advanced_disable_feature_flags)return;this.setReloadingPaused(!0);let n=this.instance.config.token,l=this.instance.get_property(ez),u=this.instance.get_property(eG),h={token:n,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:l,group_properties:u,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:h,compression:this.instance.config.disable_compression?void 0:d.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:n=>{var l;this.setReloadingPaused(!1);let u=!0;200===n.statusCode&&(this.$anon_distinct_id=void 0,u=!1),this.receivedFeatureFlags(null!==(l=n.json)&&void 0!==l?l:{},u),this._startReloadTimer()}})}getFeatureFlag(n){var l;let u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0))return void eS.warn('getFeatureFlag for key "'+n+"\" failed. Feature flags didn't load in time.");let d=this.getFlagVariants()[n],h=`${d}`,f=this.instance.get_property(eY)||{};return!u.send_event&&"send_event"in u||n in f&&f[n].includes(h)||(ev(f[n])?f[n].push(h):f[n]=[h],null===(l=this.instance.persistence)||void 0===l||l.register({[eY]:f}),this.instance.capture("$feature_flag_called",{$feature_flag:n,$feature_flag_response:d})),d}getFeatureFlagPayload(n){return this.getFlagPayloads()[n]}isFeatureEnabled(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(n,l);eS.warn('isFeatureEnabled for key "'+n+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(n){this.featureFlagEventHandlers.push(n)}removeFeatureFlagsHandler(n){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(l=>l!==n)}receivedFeatureFlags(n,l){if(!this.instance.persistence)return;this.instance.decideEndpointWasHit=!0;let u=this.getFlagVariants(),d=this.getFlagPayloads();!function(n,l){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=n.featureFlags,f=n.featureFlagPayloads;if(!h)return;if(ev(h)){let n={};if(h)for(let l=0;l<h.length;l++)n[h[l]]=!0;return void(l&&l.register({[e9]:h,[eW]:n}))}let m=h,g=f;n.errorsWhileComputingFlags&&(m={...u,...m},g={...d,...g}),l&&l.register({[e9]:Object.keys(Le(m)),[eW]:m||{},[e7]:g||{}})}(n,this.instance.persistence,u,d),this._fireFeatureFlagsCallbacks(l)}override(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return eS.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=l,!1===n)this.instance.persistence.unregister(e6);else if(ev(n)){let l={};for(let u=0;u<n.length;u++)l[n[u]]=!0;this.instance.persistence.register({[e6]:l})}else this.instance.persistence.register({[e6]:n})}onFeatureFlags(n){if(this.addFeatureFlagsHandler(n),this.instance.decideEndpointWasHit){let{flags:l,flagVariants:u}=this._prepareFeatureFlagsForCallbacks();n(l,u)}return()=>this.removeFeatureFlagsHandler(n)}updateEarlyAccessFeatureEnrollment(n,l){var u;let d={[`$feature_enrollment/${n}`]:l};this.instance.capture("$feature_enrollment_update",{$feature_flag:n,$feature_enrollment:l,$set:d}),this.setPersonPropertiesForFlags(d,!1);let h={...this.getFlagVariants(),[n]:l};null===(u=this.instance.persistence)||void 0===u||u.register({[e9]:Object.keys(Le(h)),[eW]:h}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=this.instance.get_property(eq);if(u&&!l)return n(u);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api",`/api/early_access_features/?token=${this.instance.config.token}`),method:"GET",callback:l=>{var u;if(!l.json)return;let d=l.json.earlyAccessFeatures;return null===(u=this.instance.persistence)||void 0===u||u.register({[eq]:d}),n(d)}})}_prepareFeatureFlagsForCallbacks(){let n=this.getFlags(),l=this.getFlagVariants();return{flags:n.filter(n=>l[n]),flagVariants:Object.keys(l).filter(n=>l[n]).reduce((n,u)=>(n[u]=l[u],n),{})}}_fireFeatureFlagsCallbacks(n){let{flags:l,flagVariants:u}=this._prepareFeatureFlagsForCallbacks();this.featureFlagEventHandlers.forEach(d=>d(l,u,{errorsLoading:n}))}setPersonPropertiesForFlags(n){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=this.instance.get_property(ez)||{};this.instance.register({[ez]:{...u,...n}}),l&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(ez)}setGroupPropertiesForFlags(n){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=this.instance.get_property(eG)||{};0!==Object.keys(u).length&&Object.keys(u).forEach(l=>{u[l]={...u[l],...n[l]},delete n[l]}),this.instance.register({[eG]:{...u,...n}}),l&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(n){if(n){let l=this.instance.get_property(eG)||{};this.instance.register({[eG]:{...l,[n]:{}}})}else this.instance.unregister(eG)}};/**
 * uuidv7: An experimental implementation of the proposed UUID Version 7
 *
 * @license Apache-2.0
 * @copyright 2021-2023 LiosK
 * @packageDocumentation
 *
 * from https://github.com/LiosK/uuidv7/blob/e501462ea3d23241de13192ceae726956f9b3b7d/src/index.ts
 */Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return F(n)&&isFinite(n)&&Math.floor(n)===n});let e8="0123456789abcdef";let qe=class qe{constructor(n){if(this.bytes=n,16!==n.length)throw TypeError("not 128-bit length")}static fromFieldsV7(n,l,u,d){if(!Number.isInteger(n)||!Number.isInteger(l)||!Number.isInteger(u)||!Number.isInteger(d)||n<0||l<0||u<0||d<0||n>0xffffffffffff||l>4095||u>1073741823||d>4294967295)throw RangeError("invalid field value");let h=new Uint8Array(16);return h[0]=n/1099511627776,h[1]=n/4294967296,h[2]=n/16777216,h[3]=n/65536,h[4]=n/256,h[5]=n,h[6]=112|l>>>8,h[7]=l,h[8]=128|u>>>24,h[9]=u>>>16,h[10]=u>>>8,h[11]=u,h[12]=d>>>24,h[13]=d>>>16,h[14]=d>>>8,h[15]=d,new qe(h)}toString(){let n="";for(let l=0;l<this.bytes.length;l++)n=n+e8.charAt(this.bytes[l]>>>4)+e8.charAt(15&this.bytes[l]),3!==l&&5!==l&&7!==l&&9!==l||(n+="-");if(36!==n.length)throw Error("Invalid UUIDv7 was generated");return n}clone(){return new qe(this.bytes.slice(0))}equals(n){return 0===this.compareTo(n)}compareTo(n){for(let l=0;l<16;l++){let u=this.bytes[l]-n.bytes[l];if(0!==u)return Math.sign(u)}return 0}};let Ne=class Ne{timestamp=0;counter=0;random=new Ue;generate(){let n=this.generateOrAbort();if(S(n)){this.timestamp=0;let n=this.generateOrAbort();if(S(n))throw Error("Could not generate UUID after timestamp reset");return n}return n}generateOrAbort(){let n=Date.now();if(n>this.timestamp)this.timestamp=n,this.resetCounter();else{if(!(n+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return qe.fromFieldsV7(this.timestamp,Math.trunc(this.counter/1073741824),this.counter&1073741824-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}};let te,He=n=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let l=0;l<n.length;l++)n[l]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};j&&!S(j.crypto)&&crypto.getRandomValues&&(He=n=>crypto.getRandomValues(n));let Ue=class Ue{buffer=new Uint32Array(8);cursor=1/0;nextUint32(){return this.cursor>=this.buffer.length&&(He(this.buffer),this.cursor=0),this.buffer[this.cursor++]}};let We=()=>ze().toString(),ze=()=>(te||(te=new Ne)).generate(),tt="",tn=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,to={is_supported:()=>!!eo,error:function(n){eS.error("cookieStore error: "+n)},get:function(n){if(eo){try{let l=n+"=",u=eo.cookie.split(";").filter(n=>n.length);for(let n=0;n<u.length;n++){let d=u[n];for(;" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(l))return decodeURIComponent(d.substring(l.length,d.length))}}catch{}return null}},parse:function(n){let l;try{l=JSON.parse(to.get(n))||{}}catch{}return l},set:function(n,l,u,d,h){if(eo)try{let f="",m="",g=function(n,l){if(l){let l=function(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eo;if(tt)return tt;if(!l||["localhost","127.0.0.1"].includes(n))return"";let u=n.split("."),d=Math.min(u.length,8),h="dmn_chk_"+We(),f=RegExp("(^|;)\\s*"+h+"=1");for(;!tt&&d--;){let n=u.slice(d).join("."),m=h+"=1;domain=."+n;l.cookie=m,f.test(l.cookie)&&(l.cookie=m+";expires=Thu, 01 Jan 1970 00:00:00 GMT",tt=n)}return tt}(n);if(!l){let u=(n=>{let l=n.match(tn);return l?l[0]:""})(n);u!==l&&eS.info("Warning: cookie subdomain discovery mismatch",u,l),l=u}return l?"; domain=."+l:""}return""}(eo.location.hostname,d);if(u){let n=new Date;n.setTime(n.getTime()+24*u*36e5),f="; expires="+n.toUTCString()}h&&(m="; secure");let _=n+"="+encodeURIComponent(JSON.stringify(l))+f+"; SameSite=Lax; path=/"+g+m;return _.length>3686.4&&eS.warn("cookieStore warning: large cookie, len="+_.length),eo.cookie=_,_}catch{return}},remove:function(n,l){try{to.set(n,"",-1,l)}catch{return}}},ts=null,ta={is_supported:function(){if(!k(ts))return ts;let n=!0;if(S(j))n=!1;else try{let l="__mplssupport__";ta.set(l,"xyz"),'"xyz"'!==ta.get(l)&&(n=!1),ta.remove(l)}catch{n=!1}return n||eS.error("localStorage unsupported; falling back to cookie store"),ts=n,n},error:function(n){eS.error("localStorage error: "+n)},get:function(n){try{return null==j?void 0:j.localStorage.getItem(n)}catch(n){ta.error(n)}return null},parse:function(n){try{return JSON.parse(ta.get(n))||{}}catch{}return null},set:function(n,l){try{null==j||j.localStorage.setItem(n,JSON.stringify(l))}catch(n){ta.error(n)}},remove:function(n){try{null==j||j.localStorage.removeItem(n)}catch(n){ta.error(n)}}},tl=["distinct_id",eU,eB,e3],tu={...ta,parse:function(n){try{let l={};try{l=to.parse(n)||{}}catch{}let u=D(l,JSON.parse(ta.get(n)||"{}"));return ta.set(n,u),u}catch{}return null},set:function(n,l,u,d,h,f){try{ta.set(n,l,void 0,void 0,f);let m={};tl.forEach(n=>{l[n]&&(m[n]=l[n])}),Object.keys(m).length&&to.set(n,m,u,d,h,f)}catch(n){ta.error(n)}},remove:function(n,l){try{null==j||j.localStorage.removeItem(n),to.remove(n,l)}catch(n){ta.error(n)}}},tc={},td={is_supported:function(){return!0},error:function(n){eS.error("memoryStorage error: "+n)},get:function(n){return tc[n]||null},parse:function(n){return tc[n]||null},set:function(n,l){tc[n]=l},remove:function(n){delete tc[n]}},th=null,tp={is_supported:function(){if(!k(th))return th;if(th=!0,S(j))th=!1;else try{let n="__support__";tp.set(n,"xyz"),'"xyz"'!==tp.get(n)&&(th=!1),tp.remove(n)}catch{th=!1}return th},error:function(n){eS.error("sessionStorage error: ",n)},get:function(n){try{return null==j?void 0:j.sessionStorage.getItem(n)}catch(n){tp.error(n)}return null},parse:function(n){try{return JSON.parse(tp.get(n))||null}catch{}return null},set:function(n,l){try{null==j||j.sessionStorage.setItem(n,JSON.stringify(l))}catch(n){tp.error(n)}},remove:function(n){try{null==j||j.sessionStorage.removeItem(n)}catch(n){tp.error(n)}}},tf=["localhost","127.0.0.1"],rt=n=>{let l=null==eo?void 0:eo.createElement("a");return S(l)?null:(l.href=n,l)},ot=function(n,l){return!!function(n){try{new RegExp(n)}catch{return!1}return!0}(l)&&new RegExp(l).test(n)},at=function(n){let l,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",h=[];return O(n,function(n,d){S(n)||S(d)||"undefined"===d||(l=encodeURIComponent(n instanceof File?n.name:n.toString()),u=encodeURIComponent(d),h[h.length]=u+"="+l)}),h.join(d)},lt=function(n,l){let u;let d=((n.split("#")[0]||"").split("?")[1]||"").split("&");for(let n=0;n<d.length;n++){let h=d[n].split("=");if(h[0]===l){u=h;break}}if(!ev(u)||u.length<2)return"";{let n=u[1];try{n=decodeURIComponent(n)}catch{eS.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")}},ct=function(n,l){let u=n.match(RegExp(l+"=([^&]*)"));return u?u[1]:null},tm="Mobile",tg="Android",t_="Tablet",ty=tg+" "+t_,tv="iPad",tb="Apple",tE=tb+" Watch",tS="Safari",tw="BlackBerry",tT="Samsung",tI=tT+"Browser",tR=tT+" Internet",tP="Chrome",tA=tP+" OS",tO=tP+" iOS",tC="Internet Explorer",tk=tC+" "+tm,tx="Opera",tM=tx+" Mini",tD="Edge",tN="Microsoft "+tD,tV="Firefox",tF=tV+" iOS",tL="Nintendo",tj="PlayStation",tU="Xbox",tB=tg+" "+tm,t$=tm+" "+tS,tH="Windows",tW=tH+" Phone",tq="Nokia",tz="Ouya",tG="Generic",tK=tG+" "+tm.toLowerCase(),tX=tG+" "+t_.toLowerCase(),tY="Konqueror",tQ="(\\d+(\\.\\d+)?)",tJ=RegExp("Version/"+tQ),tZ=RegExp(tU,"i"),t0=RegExp(tj+" \\w+","i"),t1=RegExp(tL+" \\w+","i"),t2=RegExp(tw+"|PlayBook|BB10","i"),t3={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ei=(n,l)=>l&&q(l,tb)||q(n,tS)&&!q(n,tP)&&!q(n,tg),ti=function(n,l){return l=l||"",q(n," OPR/")&&q(n,"Mini")?tM:q(n," OPR/")?tx:t2.test(n)?tw:q(n,"IE"+tm)||q(n,"WPDesktop")?tk:q(n,tI)?tR:q(n,tD)||q(n,"Edg/")?tN:q(n,"FBIOS")?"Facebook "+tm:q(n,"UCWEB")||q(n,"UCBrowser")?"UC Browser":q(n,"CriOS")?tO:q(n,"CrMo")?tP:q(n,tg)&&q(n,tS)?tB:q(n,tP)?tP:q(n,"FxiOS")?tF:q(n.toLowerCase(),tY.toLowerCase())?tY:ei(n,l)?q(n,tm)?t$:tS:q(n,tV)?tV:q(n,"MSIE")||q(n,"Trident/")?tC:q(n,"Gecko")?tV:""},t5={[tk]:[RegExp("rv:"+tQ)],[tN]:[RegExp(tD+"?\\/"+tQ)],[tP]:[RegExp("("+tP+"|CrMo)\\/"+tQ)],[tO]:[RegExp("CriOS\\/"+tQ)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+tQ)],[tS]:[tJ],[t$]:[tJ],[tx]:[RegExp("(Opera|OPR)\\/"+tQ)],[tV]:[RegExp(tV+"\\/"+tQ)],[tF]:[RegExp("FxiOS\\/"+tQ)],[tY]:[RegExp("Konqueror[:/]?"+tQ,"i")],[tw]:[RegExp(tw+" "+tQ),tJ],[tB]:[RegExp("android\\s"+tQ,"i")],[tR]:[RegExp(tI+"\\/"+tQ)],[tC]:[RegExp("(rv:|MSIE )"+tQ)],Mozilla:[RegExp("rv:"+tQ)]},t4=[[RegExp(tU+"; "+tU+" (.*?)[);]","i"),n=>[tU,n&&n[1]||""]],[RegExp(tL,"i"),[tL,""]],[RegExp(tj,"i"),[tj,""]],[t2,[tw,""]],[RegExp(tH,"i"),(n,l)=>{if(/Phone/.test(l)||/WPDesktop/.test(l))return[tW,""];if(new RegExp(tm).test(l)&&!/IEMobile\b/.test(l))return[tH+" "+tm,""];let u=/Windows NT ([0-9.]+)/i.exec(l);if(u&&u[1]){let n=u[1],d=t3[n]||"";return/arm/i.test(l)&&(d="RT"),[tH,d]}return[tH,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,n=>{if(n&&n[3]){let l=[n[3],n[4],n[5]||"0"];return["iOS",l.join(".")]}return["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,n=>{let l="";return n&&n.length>=3&&(l=S(n[2])?n[3]:n[2]),["watchOS",l]}],[RegExp("("+tg+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tg+")","i"),n=>{if(n&&n[2]){let l=[n[2],n[3],n[4]||"0"];return[tg,l.join(".")]}return[tg,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,n=>{let l=["Mac OS X",""];if(n&&n[1]){let u=[n[1],n[2],n[3]||"0"];l[1]=u.join(".")}return l}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tA,""]],[/Linux|debian/i,["Linux",""]]],ni=function(n){return t1.test(n)?tL:t0.test(n)?tj:tZ.test(n)?tU:RegExp(tz,"i").test(n)?tz:RegExp("("+tW+"|WPDesktop)","i").test(n)?tW:/iPad/.test(n)?tv:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?tE:t2.test(n)?tw:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":RegExp(tq,"i").test(n)?tq:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(tm).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?tg:ty:tg:RegExp("(pda|"+tm+")","i").test(n)?tK:RegExp(t_,"i").test(n)&&!RegExp(t_+" pc","i").test(n)?tX:""},t9="https?://(.*)",t6=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],t7={campaignParams:function(n){return eo?this._campaignParamsFromUrl(eo.URL,n):{}},_campaignParamsFromUrl:function(n,l){let u=t6.concat(l||[]),d={};return O(u,function(l){let u=lt(n,l);d[l]=u||null}),d},_searchEngine:function(n){return n?0===n.search(t9+"google.([^/?]*)")?"google":0===n.search(t9+"bing.com")?"bing":0===n.search(t9+"yahoo.com")?"yahoo":0===n.search(t9+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){let l=t7._searchEngine(n),u="yahoo"!=l?"q":"p",d={};if(!k(l)){d.$search_engine=l;let n=eo?lt(eo.referrer,u):"";n.length&&(d.ph_keyword=n)}return d},searchInfo:function(){let n=null==eo?void 0:eo.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:ti,browserVersion:function(n,l){let u=ti(n,l),d=t5[u];if(S(d))return null;for(let l=0;l<d.length;l++){let u=d[l],h=n.match(u);if(h)return parseFloat(h[h.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(let l=0;l<t4.length;l++){let[u,d]=t4[l],h=u.exec(n),f=h&&(b(d)?d(h,n):d);if(f)return f}return["",""]},device:ni,deviceType:function(n){let l=ni(n);return l===tv||l===ty||"Kobo"===l||"Kindle Fire"===l||l===tX?t_:l===tL||l===tU||l===tj||l===tz?"Console":l===tE?"Wearable":l?tm:"Desktop"},referrer:function(){return(null==eo?void 0:eo.referrer)||"$direct"},referringDomain:function(){var n;return null!=eo&&eo.referrer&&(null===(n=rt(eo.referrer))||void 0===n?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==es?void 0:es.href}},initialPersonPropsFromInfo:function(n){var l;let{r:u,u:d}=n,h={$initial_referrer:u,$initial_referring_domain:null==u?void 0:"$direct"==u?"$direct":null===(l=rt(u))||void 0===l?void 0:l.host};if(d){h.$initial_current_url=d;let n=rt(d);h.$initial_host=null==n?void 0:n.host,h.$initial_pathname=null==n?void 0:n.pathname,O(this._campaignParamsFromUrl(d),function(n,l){h["$initial_"+W(l)]=n})}return u&&O(this._searchInfoFromReferrer(u),function(n,l){h["$initial_"+W(l)]=n}),h},properties:function(){if(!eh)return{};let[n,l]=t7.os(eh);return D(U({$os:n,$os_version:l,$browser:t7.browser(eh,navigator.vendor),$device:t7.device(eh),$device_type:t7.deviceType(eh)}),{$current_url:null==es?void 0:es.href,$host:null==es?void 0:es.host,$pathname:null==es?void 0:es.pathname,$raw_user_agent:eh.length>1e3?eh.substring(0,997)+"...":eh,$browser_version:t7.browserVersion(eh,navigator.vendor),$browser_language:t7.browserLanguage(),$screen_height:null==j?void 0:j.screen.height,$screen_width:null==j?void 0:j.screen.width,$viewport_height:null==j?void 0:j.innerHeight,$viewport_width:null==j?void 0:j.innerWidth,$lib:"web",$lib_version:ef.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!eh)return{};let[n,l]=t7.os(eh);return D(U({$os:n,$os_version:l,$browser:t7.browser(eh,navigator.vendor)}),{$browser_version:t7.browserVersion(eh,navigator.vendor)})}},t8=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];let ci=class ci{constructor(n){let l;this.config=n,this.props={},this.campaign_params_saved=!1,this.name=(l="",n.token&&(l=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+l+"_posthog"),this.storage=this.buildStorage(n),this.load(),n.debug&&eS.info("Persistence loaded",n.persistence,{...this.props}),this.update_config(n,n),this.save()}buildStorage(n){-1===t8.indexOf(n.persistence.toLowerCase())&&(eS.critical("Unknown persistence type "+n.persistence+"; falling back to localStorage+cookie"),n.persistence="localStorage+cookie");let l=n.persistence.toLowerCase();return"localstorage"===l&&ta.is_supported()?ta:"localstorage+cookie"===l&&tu.is_supported()?tu:"sessionstorage"===l&&tp.is_supported()?tp:"memory"===l?td:"cookie"===l?to:tu.is_supported()?tu:to}properties(){let n={};return O(this.props,function(l,u){if(u===eW&&y(l)){let u=Object.keys(l);for(let d=0;d<u.length;d++)n[`$feature/${u[d]}`]=l[u[d]]}else{let d;d=!1,(k(e4)?d:et&&e4.indexOf===et?-1!=e4.indexOf(u):(O(e4,function(n){if(d||(d=n===u))return ew}),d))||(n[u]=l)}}),n}load(){if(this.disabled)return;let n=this.storage.parse(this.name);n&&(this.props=D({},n))}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(n,l,u){if(y(n)){S(l)&&(l="None"),this.expire_days=S(u)?this.default_expiry:u;let d=!1;if(O(n,(n,u)=>{this.props.hasOwnProperty(u)&&this.props[u]!==l||(this.props[u]=n,d=!0)}),d)return this.save(),!0}return!1}register(n,l){if(y(n)){this.expire_days=S(l)?this.default_expiry:l;let u=!1;if(O(n,(l,d)=>{n.hasOwnProperty(d)&&this.props[d]!==l&&(this.props[d]=l,u=!0)}),u)return this.save(),!0}return!1}unregister(n){n in this.props&&(delete this.props[n],this.save())}update_campaign_params(){this.campaign_params_saved||(this.register(t7.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}update_search_keyword(){this.register(t7.searchInfo())}update_referrer_info(){this.register_once(t7.referrerInfo(),void 0)}set_initial_person_info(){this.props[e0]||this.props[e1]||this.register_once({[e2]:t7.initialPersonInfo()},void 0)}get_referrer_info(){return U({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){let n={};O([e1,e0],l=>{let u=this.props[l];u&&O(u,function(l,u){n["$initial_"+W(u)]=l})});let l=this.props[e2];if(l){let u=t7.initialPersonPropsFromInfo(l);D(n,u)}return n}safe_merge(n){return O(this.props,function(l,u){u in n||(n[u]=l)}),n}update_config(n,l){if(this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie),n.persistence!==l.persistence){let l=this.buildStorage(n),u=this.props;this.clear(),this.storage=l,this.props=u,this.save()}}set_disabled(n){this.disabled=n,this.disabled?this.remove():this.save()}set_cross_subdomain(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())}get_cross_subdomain(){return!!this.cross_subdomain}set_secure(n){n!==this.secure&&(this.secure=n,this.remove(),this.save())}set_event_timer(n,l){let u=this.props[eP]||{};u[n]=l,this.props[eP]=u,this.save()}remove_event_timer(n){let l=(this.props[eP]||{})[n];return S(l)||(delete this.props[eP][n],this.save()),l}get_property(n){return this.props[n]}set_property(n,l){this.props[n]=l,this.save()}};function ui(n){var l;return(null===(l=JSON.stringify(n,function(){let n=[];return function(l,u){if(y(u)){for(;n.length>0&&n.at(-1)!==this;)n.pop();return n.includes(u)?"[Circular]":(n.push(u),u)}return u}}()))||void 0===l?void 0:l.length)||0}var re,rr,rn,ri,ro,rs,ra,rl,ru,rd,rh=((rl=rh||{})[rl.DomContentLoaded=0]="DomContentLoaded",rl[rl.Load=1]="Load",rl[rl.FullSnapshot=2]="FullSnapshot",rl[rl.IncrementalSnapshot=3]="IncrementalSnapshot",rl[rl.Meta=4]="Meta",rl[rl.Custom=5]="Custom",rl[rl.Plugin=6]="Plugin",rl),rp=((ru=rp||{})[ru.Mutation=0]="Mutation",ru[ru.MouseMove=1]="MouseMove",ru[ru.MouseInteraction=2]="MouseInteraction",ru[ru.Scroll=3]="Scroll",ru[ru.ViewportResize=4]="ViewportResize",ru[ru.Input=5]="Input",ru[ru.TouchMove=6]="TouchMove",ru[ru.MediaInteraction=7]="MediaInteraction",ru[ru.StyleSheetRule=8]="StyleSheetRule",ru[ru.CanvasMutation=9]="CanvasMutation",ru[ru.Font=10]="Font",ru[ru.Log=11]="Log",ru[ru.Drag=12]="Drag",ru[ru.StyleDeclaration=13]="StyleDeclaration",ru[ru.Selection=14]="Selection",ru[ru.AdoptedStyleSheet=15]="AdoptedStyleSheet",ru[ru.CustomElement=16]="CustomElement",ru);function gi(n){return n?A(n).split(/\s+/):[]}function _i(n){let l=null==j?void 0:j.location.href;return!!(l&&n&&n.some(n=>l.match(n)))}function fi(n){let l="";switch(typeof n.className){case"string":l=n.className;break;case"object":l=(n.className&&"baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:l=""}return gi(l)}function vi(n){return I(n)?null:A(n).split(/(\s+)/).filter(n=>Li(n)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function mi(n){let l="";return Fi(n)&&!Ri(n)&&n.childNodes&&n.childNodes.length&&O(n.childNodes,function(n){var u;Si(n)&&n.textContent&&(l+=null!==(u=vi(n.textContent))&&void 0!==u?u:"")}),A(l)}function bi(n){var l;return S(n.target)?n.srcElement||null:null!==(l=n.target)&&void 0!==l&&l.shadowRoot?n.composedPath()[0]||null:n.target||null}function yi(n){return!!n&&1===n.nodeType}function wi(n,l){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===l.toLowerCase()}function Si(n){return!!n&&3===n.nodeType}function Ei(n){return!!n&&11===n.nodeType}let rf=["a","button","form","input","select","textarea","label"];function ki(n){let l=n.parentNode;return!(!l||!yi(l))&&l}function Fi(n){for(let l=n;l.parentNode&&!wi(l,"body");l=l.parentNode){let n=fi(l);if(q(n,"ph-sensitive")||q(n,"ph-no-capture"))return!1}if(q(fi(n),"ph-include"))return!0;let l=n.type||"";if(E(l))switch(l.toLowerCase()){case"hidden":case"password":return!1}let u=n.name||n.id||"";return!(E(u)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(u.replace(/[^a-zA-Z0-9]/g,"")))}function Ri(n){return!!(wi(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||wi(n,"select")||wi(n,"textarea")||"true"===n.getAttribute("contenteditable"))}let rm="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",rg=RegExp(`^(?:${rm})$`),r_=new RegExp(rm),ry="\\d{3}-?\\d{2}-?\\d{4}",rv=RegExp(`^(${ry})$`),rb=RegExp(`(${ry})`);function Li(n){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(I(n)||E(n)&&(n=A(n),(l?rg:r_).test((n||"").replace(/[- ]/g,""))||(l?rv:rb).test(n)))}function Oi(n){let l=mi(n);return Li(l=`${l} ${(function Di(n){let l="";return n&&n.childNodes&&n.childNodes.length&&O(n.childNodes,function(n){var u;if(n&&"span"===(null===(u=n.tagName)||void 0===u?void 0:u.toLowerCase()))try{let u=mi(n);l=`${l} ${u}`.trim(),n.childNodes&&n.childNodes.length&&(l=`${l} ${Di(n)}`.trim())}catch(n){eS.error(n)}}),l})(n)}`.trim())?l:""}function Ni(n){return n.replace(/"|\\"/g,'\\"')}let rE="[SessionRecording]",rS="redacted",rw={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:n=>n,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},rT=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],rI=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],rR=["/s/","/e/","/i/"];function ji(n,l,u,d){if(I(n))return n;let h=(null==l?void 0:l["content-length"])||new Blob([n]).size;return E(h)&&(h=parseInt(h)),h>u?rE+` ${d} body too large to record (${h} bytes)`:n}function Qi(n,l){if(I(n))return n;let u=n;return Li(u,!1)||(u=rE+" "+l+" body "+rS),O(rI,n=>{var d,h;null!==(d=u)&&void 0!==d&&d.length&&-1!==(null===(h=u)||void 0===h?void 0:h.indexOf(n))&&(u=rE+" "+l+" body "+rS+" as might contain: "+n)}),u}let Ji=(n,l)=>{let u={payloadSizeLimitBytes:rw.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...rw.performanceEntryTypeToObserve],payloadHostDenyList:[...l.payloadHostDenyList||[],...rw.payloadHostDenyList]},d=!1!==n.session_recording.recordHeaders&&l.recordHeaders,h=!1!==n.session_recording.recordBody&&l.recordBody,f=!1!==n.capture_performance&&l.recordPerformance,m=(n=>{var l;let u=Math.min(1e6,null!==(l=n.payloadSizeLimitBytes)&&void 0!==l?l:1e6);return n=>(null!=n&&n.requestBody&&(n.requestBody=ji(n.requestBody,n.requestHeaders,u,"Request")),null!=n&&n.responseBody&&(n.responseBody=ji(n.responseBody,n.responseHeaders,u,"Response")),n)})(u),a=n=>m((n=>{let l=rt(n.name);if(!(l&&l.pathname&&rR.some(n=>0===l.pathname.indexOf(n))))return n})((n=>{let l=n.requestHeaders;return I(l)||O(Object.keys(null!=l?l:{}),n=>{rT.includes(n.toLowerCase())&&(l[n]=rS)}),n})(n))),g=b(n.session_recording.maskNetworkRequestFn);return g&&b(n.session_recording.maskCapturedNetworkRequestFn)&&eS.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),g&&(n.session_recording.maskCapturedNetworkRequestFn=l=>{let u=n.session_recording.maskNetworkRequestFn({url:l.name});return{...l,name:null==u?void 0:u.url}}),u.maskRequestFn=b(n.session_recording.maskCapturedNetworkRequestFn)?l=>{var u,d,h;let f=a(l);return f&&null!==(u=null===(d=(h=n.session_recording).maskCapturedNetworkRequestFn)||void 0===d?void 0:d.call(h,f))&&void 0!==u?u:void 0}:n=>(function(n){if(!S(n))return n.requestBody=Qi(n.requestBody,"Request"),n.responseBody=Qi(n.responseBody,"Response"),n})(a(n)),{...rw,...u,recordHeaders:d,recordBody:h,recordPerformance:f,recordInitialRequests:f}};let Yi=class Yi{bucketSize=100;refillRate=10;mutationBuckets={};loggedTracker={};constructor(n){var l,u;let d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.rrweb=n,this.options=d,this.refillRate=null!==(l=this.options.refillRate)&&void 0!==l?l:this.refillRate,this.bucketSize=null!==(u=this.options.bucketSize)&&void 0!==u?u:this.bucketSize,setInterval(()=>{this.refillBuckets()},1e3)}refillBuckets=()=>{Object.keys(this.mutationBuckets).forEach(n=>{this.mutationBuckets[n]=this.mutationBuckets[n]+this.refillRate,this.mutationBuckets[n]>=this.bucketSize&&delete this.mutationBuckets[n]})};getNodeOrRelevantParent=n=>{let l=this.rrweb.mirror.getNode(n);if("svg"!==(null==l?void 0:l.nodeName)&&l instanceof Element){let n=l.closest("svg");if(n)return[this.rrweb.mirror.getId(n),n]}return[n,l]};numberOfChanges=n=>{var l,u,d,h,f,m,g,_;return(null!==(l=null===(u=n.removes)||void 0===u?void 0:u.length)&&void 0!==l?l:0)+(null!==(d=null===(h=n.attributes)||void 0===h?void 0:h.length)&&void 0!==d?d:0)+(null!==(f=null===(m=n.texts)||void 0===m?void 0:m.length)&&void 0!==f?f:0)+(null!==(g=null===(_=n.adds)||void 0===_?void 0:_.length)&&void 0!==g?g:0)};throttleMutations=n=>{if(3!==n.type||0!==n.data.source)return n;let l=n.data,u=this.numberOfChanges(l);l.attributes&&(l.attributes=l.attributes.filter(n=>{var l,u,d;let[h,f]=this.getNodeOrRelevantParent(n.id);return 0!==this.mutationBuckets[h]&&(this.mutationBuckets[h]=null!==(l=this.mutationBuckets[h])&&void 0!==l?l:this.bucketSize,this.mutationBuckets[h]=Math.max(this.mutationBuckets[h]-1,0),0===this.mutationBuckets[h]&&(this.loggedTracker[h]||(this.loggedTracker[h]=!0,null===(u=(d=this.options).onBlockedNode)||void 0===u||u.call(d,h,f))),n)}));let d=this.numberOfChanges(l);return 0!==d||u===d?n:void 0}};var rP=Uint8Array,rA=Uint16Array,rO=Uint32Array,rC=new rP([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]),rk=new rP([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]),rx=new rP([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ss=function(n,l){for(var u=new rA(31),d=0;d<31;++d)u[d]=l+=1<<n[d-1];var h=new rO(u[30]);for(d=1;d<30;++d)for(var f=u[d];f<u[d+1];++f)h[f]=f-u[d]<<5|d;return[u,h]},rM=ss(rC,2),rD=rM[0],rN=rM[1];rD[28]=258,rN[258]=28;for(var rV=ss(rk,0)[1],rF=new rA(32768),rL=0;rL<32768;++rL){var rj=(43690&rL)>>>1|(21845&rL)<<1;rj=(61680&(rj=(52428&rj)>>>2|(13107&rj)<<2))>>>4|(3855&rj)<<4,rF[rL]=((65280&rj)>>>8|(255&rj)<<8)>>>1}var ds=function(n,l,u){for(var d=n.length,h=0,f=new rA(l);h<d;++h)++f[n[h]-1];var m,g=new rA(l);for(h=0;h<l;++h)g[h]=g[h-1]+f[h-1]<<1;if(u){m=new rA(1<<l);var _=15-l;for(h=0;h<d;++h)if(n[h])for(var j=h<<4|n[h],$=l-n[h],z=g[n[h]-1]++<<$,ee=z|(1<<$)-1;z<=ee;++z)m[rF[z]>>>_]=j}else for(m=new rA(d),h=0;h<d;++h)m[h]=rF[g[n[h]-1]++]>>>15-n[h];return m},rU=new rP(288);for(rL=0;rL<144;++rL)rU[rL]=8;for(rL=144;rL<256;++rL)rU[rL]=9;for(rL=256;rL<280;++rL)rU[rL]=7;for(rL=280;rL<288;++rL)rU[rL]=8;var rB=new rP(32);for(rL=0;rL<32;++rL)rB[rL]=5;var r$=ds(rU,9,0),rH=ds(rB,5,0),fs=function(n){return(n/8>>0)+(7&n&&1)},vs=function(n,l,u){(null==u||u>n.length)&&(u=n.length);var d=new(n instanceof rA?rA:n instanceof rO?rO:rP)(u-l);return d.set(n.subarray(l,u)),d},ms=function(n,l,u){u<<=7&l;var d=l/8>>0;n[d]|=u,n[d+1]|=u>>>8},bs=function(n,l,u){u<<=7&l;var d=l/8>>0;n[d]|=u,n[d+1]|=u>>>8,n[d+2]|=u>>>16},ys=function(n,l){for(var u=[],d=0;d<n.length;++d)n[d]&&u.push({s:d,f:n[d]});var h=u.length,f=u.slice();if(!h)return[new rP(0),0];if(1==h){var m=new rP(u[0].s+1);return m[u[0].s]=1,[m,1]}u.sort(function(n,l){return n.f-l.f}),u.push({s:-1,f:25001});var g=u[0],_=u[1],j=0,$=1,z=2;for(u[0]={s:-1,f:g.f+_.f,l:g,r:_};$!=h-1;)g=u[u[j].f<u[z].f?j++:z++],_=u[j!=$&&u[j].f<u[z].f?j++:z++],u[$++]={s:-1,f:g.f+_.f,l:g,r:_};var ee=f[0].s;for(d=1;d<h;++d)f[d].s>ee&&(ee=f[d].s);var et=new rA(ee+1),en=ws(u[$-1],et,0);if(en>l){d=0;var eo=0,es=en-l,el=1<<es;for(f.sort(function(n,l){return et[l.s]-et[n.s]||n.f-l.f});d<h;++d){var eu=f[d].s;if(!(et[eu]>l))break;eo+=el-(1<<en-et[eu]),et[eu]=l}for(eo>>>=es;eo>0;){var ec=f[d].s;et[ec]<l?eo-=1<<l-et[ec]++-1:++d}for(;d>=0&&eo;--d){var eh=f[d].s;et[eh]==l&&(--et[eh],++eo)}en=l}return[new rP(et),en]},ws=function(n,l,u){return -1==n.s?Math.max(ws(n.l,l,u+1),ws(n.r,l,u+1)):l[n.s]=u},Ss=function(n){for(var l=n.length;l&&!n[--l];);for(var u=new rA(++l),d=0,h=n[0],f=1,o=function(n){u[d++]=n},m=1;m<=l;++m)if(n[m]==h&&m!=l)++f;else{if(!h&&f>2){for(;f>138;f-=138)o(32754);f>2&&(o(f>10?f-11<<5|28690:f-3<<5|12305),f=0)}else if(f>3){for(o(h),--f;f>6;f-=6)o(8304);f>2&&(o(f-3<<5|8208),f=0)}for(;f--;)o(h);f=1,h=n[m]}return[u.subarray(0,d),l]},Es=function(n,l){for(var u=0,d=0;d<l.length;++d)u+=n[d]*l[d];return u},xs=function(n,l,u){var d=u.length,h=fs(l+2);n[h]=255&d,n[h+1]=d>>>8,n[h+2]=255^n[h],n[h+3]=255^n[h+1];for(var f=0;f<d;++f)n[h+f+4]=u[f];return 8*(h+4+d)},ks=function(n,l,u,d,h,f,m,g,_,j,$){ms(l,$++,u),++h[256];for(var z=ys(h,15),ee=z[0],et=z[1],en=ys(f,15),eo=en[0],es=en[1],el=Ss(ee),eu=el[0],ec=el[1],eh=Ss(eo),ep=eh[0],ef=eh[1],em=new rA(19),eg=0;eg<eu.length;++eg)em[31&eu[eg]]++;for(eg=0;eg<ep.length;++eg)em[31&ep[eg]]++;for(var e_=ys(em,7),ey=e_[0],ev=e_[1],eE=19;eE>4&&!ey[rx[eE-1]];--eE);var eS,ew,eT,eI,eR=j+5<<3,eP=Es(h,rU)+Es(f,rB)+m,eA=Es(h,ee)+Es(f,eo)+m+14+3*eE+Es(em,ey)+(2*em[16]+3*em[17]+7*em[18]);if(eR<=eP&&eR<=eA)return xs(l,$,n.subarray(_,_+j));if(ms(l,$,1+(eA<eP)),$+=2,eA<eP){eS=ds(ee,et,0),ew=ee,eT=ds(eo,es,0),eI=eo;var eO=ds(ey,ev,0);for(ms(l,$,ec-257),ms(l,$+5,ef-1),ms(l,$+10,eE-4),$+=14,eg=0;eg<eE;++eg)ms(l,$+3*eg,ey[rx[eg]]);$+=3*eE;for(var eC=[eu,ep],ek=0;ek<2;++ek){var ex=eC[ek];for(eg=0;eg<ex.length;++eg){var eM=31&ex[eg];ms(l,$,eO[eM]),$+=ey[eM],eM>15&&(ms(l,$,ex[eg]>>>5&127),$+=ex[eg]>>>12)}}}else eS=r$,ew=rU,eT=rH,eI=rB;for(eg=0;eg<g;++eg)if(d[eg]>255){bs(l,$,eS[(eM=d[eg]>>>18&31)+257]),$+=ew[eM+257],eM>7&&(ms(l,$,d[eg]>>>23&31),$+=rC[eM]);var eD=31&d[eg];bs(l,$,eT[eD]),$+=eI[eD],eD>3&&(bs(l,$,d[eg]>>>5&8191),$+=rk[eD])}else bs(l,$,eS[d[eg]]),$+=ew[d[eg]];return bs(l,$,eS[256]),$+ew[256]},rW=new rO([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rq=function(){for(var n=new rO(256),l=0;l<256;++l){for(var u=l,d=9;--d;)u=(1&u&&3988292384)^u>>>1;n[l]=u}return n}(),Rs=function(){var n=4294967295;return{p:function(l){for(var u=n,d=0;d<l.length;++d)u=rq[255&u^l[d]]^u>>>8;n=u},d:function(){return 4294967295^n}}},$s=function(n,l,u){for(;u;++l)n[l]=u,u>>>=8},Ts=function(n,l){var u=l.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=l.level<2?4:9==l.level?2:0,n[9]=3,0!=l.mtime&&$s(n,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){n[3]=8;for(var d=0;d<=u.length;++d)n[d+10]=u.charCodeAt(d)}};function Ms(n,l){void 0===l&&(l={});var u,d,h,f=Rs(),m=n.length;f.p(n);var g=(d=l,h=10+((u=l).filename&&u.filename.length+1||0),function(n,l,u,d,h,f){var m=n.length,g=new rP(d+m+5*(1+Math.floor(m/7e3))+h),_=g.subarray(d,g.length-h),j=0;if(!l||m<8)for(var $=0;$<=m;$+=65535){var z=$+65535;z<m?j=xs(_,j,n.subarray($,z)):(_[$]=f,j=xs(_,j,n.subarray($,m)))}else{for(var ee=rW[l-1],et=ee>>>13,en=8191&ee,eo=(1<<u)-1,es=new rA(32768),el=new rA(eo+1),eu=Math.ceil(u/3),ec=2*eu,y=function(l){return(n[l]^n[l+1]<<eu^n[l+2]<<ec)&eo},eh=new rO(25e3),ep=new rA(288),ef=new rA(32),em=0,eg=0,e_=($=0,0),ey=0,ev=0;$<m;++$){var eE=y($),eS=32767&$,ew=el[eE];if(es[eS]=ew,el[eE]=eS,ey<=$){var eT=m-$;if((em>7e3||e_>24576)&&eT>423){j=ks(n,_,0,eh,ep,ef,eg,e_,ev,$-ev,j),e_=em=eg=0,ev=$;for(var eI=0;eI<286;++eI)ep[eI]=0;for(eI=0;eI<30;++eI)ef[eI]=0}var eR=2,eP=0,eA=en,eO=eS-ew&32767;if(eT>2&&eE==y($-eO))for(var eC=Math.min(et,eT)-1,ek=Math.min(32767,$),ex=Math.min(258,eT);eO<=ek&&--eA&&eS!=ew;){if(n[$+eR]==n[$+eR-eO]){for(var eM=0;eM<ex&&n[$+eM]==n[$+eM-eO];++eM);if(eM>eR){if(eR=eM,eP=eO,eM>eC)break;var eD=Math.min(eO,eM-2),eN=0;for(eI=0;eI<eD;++eI){var eV=$-eO+eI+32768&32767,eF=eV-es[eV]+32768&32767;eF>eN&&(eN=eF,ew=eV)}}}eO+=(eS=ew)-(ew=es[eS])+32768&32767}if(eP){eh[e_++]=268435456|rN[eR]<<18|rV[eP];var eL=31&rN[eR],ej=31&rV[eP];eg+=rC[eL]+rk[ej],++ep[257+eL],++ef[ej],ey=$+eR,++em}else eh[e_++]=n[$],++ep[n[$]]}}j=ks(n,_,f,eh,ep,ef,eg,e_,ev,$-ev,j)}return vs(g,0,d+fs(j)+h)}(n,null==d.level?6:d.level,null==d.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+d.mem,h,8,!0)),_=g.length;return Ts(g,l),$s(g,_-8,f.d()),$s(g,_-4,m),g}function As(n,l){var u=n.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(n);for(var d=new rP(n.length+(n.length>>>1)),h=0,r=function(n){d[h++]=n},f=0;f<u;++f){if(h+5>d.length){var m=new rP(h+8+(u-f<<1));m.set(d),d=m}var g=n.charCodeAt(f);g<128||l?r(g):(g<2048?r(192|g>>>6):(g>55295&&g<57344?(r(240|(g=65536+(1047552&g)|1023&n.charCodeAt(++f))>>>18),r(128|g>>>12&63)):r(224|g>>>12),r(128|g>>>6&63)),r(128|63&g))}return vs(d,0,h)}let rz=[rp.MouseMove,rp.MouseInteraction,rp.Scroll,rp.ViewportResize,rp.Input,rp.TouchMove,rp.MediaInteraction,rp.Drag],rG=["trigger_activated","trigger_pending","trigger_disabled"],qs=n=>({rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}),rK="[SessionRecording]";function Bs(n){return function(n,l){for(var u="",d=0;d<n.length;){var h=n[d++];h<128||l?u+=String.fromCharCode(h):h<224?u+=String.fromCharCode((31&h)<<6|63&n[d++]):h<240?u+=String.fromCharCode((15&h)<<12|(63&n[d++])<<6|63&n[d++]):u+=String.fromCharCode(55296|(h=((15&h)<<18|(63&n[d++])<<12|(63&n[d++])<<6|63&n[d++])-65536)>>10,56320|1023&h)}return u}(Ms(As(JSON.stringify(n))),!0)}function Hs(n){return n.type===rh.Custom&&"sessionIdle"===n.data.tag}let Us=class Us{queuedRRWebEvents=[];isIdle=!1;_linkedFlagSeen=!1;_lastActivityTimestamp=Date.now();_linkedFlag=null;_removePageViewCaptureHook=void 0;_onSessionIdListener=void 0;_persistDecideOnSessionListener=void 0;_samplingSessionListener=void 0;_urlTriggers=[];_forceAllowLocalhostNetworkCapture=!1;get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get rrwebRecord(){var n,l;return null==ep||null===(n=ep.__PosthogExtensions__)||void 0===n||null===(l=n.rrweb)||void 0===l?void 0:l.record}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw Error(rK+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var n,l;return"trigger_pending"===this.urlTriggerStatus?6e4:null!==(n=null===(l=this.instance.config.session_recording)||void 0===l?void 0:l.full_snapshot_interval_millis)&&void 0!==n?n:3e5}get isSampled(){let n=this.instance.get_property(eB);return R(n)?n:null}get sessionDuration(){var n,l;let u=null===(n=this.buffer)||void 0===n?void 0:n.data[(null===(l=this.buffer)||void 0===l?void 0:l.data.length)-1],{sessionStartTimestamp:d}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return u?u.timestamp-d:null}get isRecordingEnabled(){let n=!!this.instance.get_property(eD),l=!this.instance.config.disable_session_recording;return j&&n&&l}get isConsoleLogCaptureEnabled(){let n=!!this.instance.get_property(eN),l=this.instance.config.enable_recording_console_log;return null!=l?l:n}get canvasRecording(){let n=this.instance.get_property(eF);return n&&n.fps&&n.quality?{enabled:n.enabled,fps:n.fps,quality:n.quality}:void 0}get networkPayloadCapture(){var n,l;let u=this.instance.get_property(eV),d={recordHeaders:null===(n=this.instance.config.session_recording)||void 0===n?void 0:n.recordHeaders,recordBody:null===(l=this.instance.config.session_recording)||void 0===l?void 0:l.recordBody},h=(null==d?void 0:d.recordHeaders)||(null==u?void 0:u.recordHeaders),f=(null==d?void 0:d.recordBody)||(null==u?void 0:u.recordBody),m=y(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,g=!!(R(m)?m:null==u?void 0:u.capturePerformance);return h||f||g?{recordHeaders:h,recordBody:f,recordPerformance:g}:void 0}get sampleRate(){let n=this.instance.get_property(eL);return F(n)?n:null}get minimumDuration(){let n=this.instance.get_property(ej);return F(n)?n:null}get status(){return this.receivedDecide?this.isRecordingEnabled?I(this._linkedFlag)||this._linkedFlagSeen?"trigger_pending"===this.urlTriggerStatus?"buffering":R(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var n,l,u,d,h,f;if(this.receivedDecide&&0===this._urlTriggers.length)return"trigger_disabled";let m=null===(n=this.instance)||void 0===n?void 0:n.get_property(eH);return(null===(l=this.instance)||void 0===l?void 0:l.get_property(e$))!==this.sessionId?(null===(u=this.instance)||void 0===u||null===(d=u.persistence)||void 0===d||d.unregister(e$),null===(h=this.instance)||void 0===h||null===(f=h.persistence)||void 0===f||f.unregister(eH),"trigger_pending"):rG.includes(m)?m:"trigger_pending"}set urlTriggerStatus(n){var l,u;null===(l=this.instance)||void 0===l||null===(u=l.persistence)||void 0===u||u.register({[e$]:this.sessionId,[eH]:n})}constructor(n){if(this.instance=n,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw eS.error(rK+" started without valid sessionManager"),Error(rK+" started without valid sessionManager. This is a bug.");let{sessionId:l,windowId:u}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=l,this.windowId=u,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&eS.warn(rK+` session_idle_threshold_ms (${this.sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this.sessionManager.sessionTimeoutMs}). Session will never be detected as idle`)}_onBeforeUnload=()=>{this._flushBuffer()};_onOffline=()=>{this._tryAddCustomEvent("browser offline",{})};_onOnline=()=>{this._tryAddCustomEvent("browser online",{})};_onVisibilityChange=()=>{if(null!=eo&&eo.visibilityState){let n="window "+eo.visibilityState;this._tryAddCustomEvent(n,{})}};startIfEnabledOrStop(n){this.isRecordingEnabled?(this._startCapture(n),null==j||j.addEventListener("beforeunload",this._onBeforeUnload),null==j||j.addEventListener("offline",this._onOffline),null==j||j.addEventListener("online",this._onOnline),null==j||j.addEventListener("visibilitychange",this._onVisibilityChange),this._setupSampling(),I(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(n=>{try{if("$pageview"===n){let n=j?this._maskUrl(j.location.href):"";if(!n)return;this._tryAddCustomEvent("$pageview",{href:n})}}catch(n){eS.error("Could not add $pageview to rrweb session",n)}})),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId((n,l,u)=>{var d,h,f,m;u&&(this._tryAddCustomEvent("$session_id_change",{sessionId:n,windowId:l,changeReason:u}),null===(d=this.instance)||void 0===d||null===(h=d.persistence)||void 0===h||h.unregister(e$),null===(f=this.instance)||void 0===f||null===(m=f.persistence)||void 0===m||m.unregister(eH))}))):this.stopRecording()}stopRecording(){var n,l,u;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==j||j.removeEventListener("beforeunload",this._onBeforeUnload),null==j||j.removeEventListener("offline",this._onOffline),null==j||j.removeEventListener("online",this._onOnline),null==j||j.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(n=this._removePageViewCaptureHook)||void 0===n||n.call(this),this._removePageViewCaptureHook=void 0,null===(l=this._onSessionIdListener)||void 0===l||l.call(this),this._onSessionIdListener=void 0,null===(u=this._samplingSessionListener)||void 0===u||u.call(this),this._samplingSessionListener=void 0,eS.info(rK+" stopped"))}makeSamplingDecision(n){var l,u;let d;let h=this.sessionId!==n,f=this.sampleRate;if(!F(f))return void(null===(u=this.instance.persistence)||void 0===u||u.register({[eB]:null}));let m=this.isSampled,g=h||!R(m);d=g?Math.random()<f:m,g&&(d?this._reportStarted("sampling"):eS.warn(rK+` Sample rate (${f}) has determined that this sessionId (${n}) will not be sent to the server.`),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:f,isSampled:d})),null===(l=this.instance.persistence)||void 0===l||l.register({[eB]:d})}afterDecideResponse(n){var l,u,d,h;if(this._persistDecideResponse(n),this._linkedFlag=(null===(l=n.sessionRecording)||void 0===l?void 0:l.linkedFlag)||null,null!==(u=n.sessionRecording)&&void 0!==u&&u.endpoint&&(this._endpoint=null===(h=n.sessionRecording)||void 0===h?void 0:h.endpoint),this._setupSampling(),!I(this._linkedFlag)&&!this._linkedFlagSeen){let n=E(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=E(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((u,d)=>{let h=y(d)&&n in d,f=l?d[n]===l:h;if(f){let u={linkedFlag:n,linkedVariant:l},d="linked flag matched";eS.info(rK+" "+d,u),this._tryAddCustomEvent(d,u),this._reportStarted("linked_flag_match")}this._linkedFlagSeen=f})}null!==(d=n.sessionRecording)&&void 0!==d&&d.urlTriggers&&(this._urlTriggers=n.sessionRecording.urlTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){F(this.sampleRate)&&I(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(n=>{this.makeSamplingDecision(n)}))}_persistDecideResponse(n){if(this.instance.persistence){var l;let u=this.instance.persistence,s=()=>{var l,d,h,f,m,g,_;let j=null===(l=n.sessionRecording)||void 0===l?void 0:l.sampleRate,$=I(j)?null:parseFloat(j),z=null===(d=n.sessionRecording)||void 0===d?void 0:d.minimumDurationMilliseconds;u.register({[eD]:!!n.sessionRecording,[eN]:null===(h=n.sessionRecording)||void 0===h?void 0:h.consoleLogRecordingEnabled,[eV]:{capturePerformance:n.capturePerformance,...null===(f=n.sessionRecording)||void 0===f?void 0:f.networkPayloadCapture},[eF]:{enabled:null===(m=n.sessionRecording)||void 0===m?void 0:m.recordCanvas,fps:null===(g=n.sessionRecording)||void 0===g?void 0:g.canvasFps,quality:null===(_=n.sessionRecording)||void 0===_?void 0:_.canvasQuality},[eL]:$,[ej]:S(z)?null:z})};s(),null===(l=this._persistDecideOnSessionListener)||void 0===l||l.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(s)}}log(n){var l;let u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(l=this.instance.sessionRecording)||void 0===l||l.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:u,trace:[],payload:[JSON.stringify(n)]}},timestamp:Date.now()})}_startCapture(n){if(!S(Object.assign)&&!S(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var l,u;(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord)?this._onScriptLoaded():null===(l=ep.__PosthogExtensions__)||void 0===l||null===(u=l.loadExternalDependency)||void 0===u||u.call(l,this.instance,"recorder",n=>{if(n)return eS.error(rK+" could not load recorder",n);this._onScriptLoaded()}),eS.info(rK+" starting"),"active"===this.status&&this._reportStarted(n||"recording_initialized")}}isInteractiveEvent(n){var l;return 3===n.type&&-1!==rz.indexOf(null===(l=n.data)||void 0===l?void 0:l.source)}_updateWindowAndSessionIds(n){let l=this.isInteractiveEvent(n);l||this.isIdle||!(n.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds)||(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:n.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());let u=!1;if(l&&(this._lastActivityTimestamp=n.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:n.type}),u=!0)),this.isIdle)return;let{windowId:d,sessionId:h}=this.sessionManager.checkAndGetSessionAndWindowId(!l,n.timestamp),f=this.sessionId!==h,m=this.windowId!==d;this.windowId=d,this.sessionId=h,f||m?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):u&&this._scheduleFullSnapshot()}_tryRRWebMethod(n){try{return n.rrwebMethod(),!0}catch(l){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:n.enqueuedAt||Date.now(),attempt:n.attempt++,rrwebMethod:n.rrwebMethod}):eS.warn(rK+" could not emit queued rrweb event.",l,n),!1}}_tryAddCustomEvent(n,l){return this._tryRRWebMethod(qs(()=>this.rrwebRecord.addCustomEvent(n,l)))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(qs(()=>this.rrwebRecord.takeFullSnapshot()))}_onScriptLoaded(){var n;let l={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},u=this.instance.config.session_recording;for(let[n,d]of Object.entries(u||{}))n in l&&("maskInputOptions"===n?l.maskInputOptions={password:!0,...d}:l[n]=d);if(this.canvasRecording&&this.canvasRecording.enabled&&(l.recordCanvas=!0,l.sampling={canvas:this.canvasRecording.fps},l.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),!this.rrwebRecord)return void eS.error(rK+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");this.mutationRateLimiter=null!==(n=this.mutationRateLimiter)&&void 0!==n?n:new Yi(this.rrwebRecord,{onBlockedNode:(n,l)=>{let u=`Too many mutations on node '${n}'. Rate limiting. This could be due to SVG animations or something similar`;eS.info(u,{node:l}),this.log(rK+" "+u,"warn")}});let d=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord({emit:n=>{this.onRRwebEmit(n)},plugins:d,...l}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:l,activePlugins:d.map(n=>null==n?void 0:n.name)}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle)return;let n=this.fullSnapshotIntervalMillis;n&&(this._fullSnapshotTimer=setInterval(()=>{this._tryTakeFullSnapshot()},n))}_gatherRRWebPlugins(){var n,l,u,d;let h=[],f=null===(n=ep.__PosthogExtensions__)||void 0===n||null===(l=n.rrwebPlugins)||void 0===l?void 0:l.getRecordConsolePlugin;f&&this.isConsoleLogCaptureEnabled&&h.push(f());let m=null===(u=ep.__PosthogExtensions__)||void 0===u||null===(d=u.rrwebPlugins)||void 0===d?void 0:d.getRecordNetworkPlugin;return this.networkPayloadCapture&&b(m)&&(!tf.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?h.push(m(Ji(this.instance.config,this.networkPayloadCapture))):eS.info(rK+" NetworkCapture not started because we are on localhost.")),h}onRRwebEmit(n){var l;if(this._processQueuedEvents(),!n||!y(n))return;if(n.type===rh.Meta){let l=this._maskUrl(n.data.href);if(this._lastHref=l,!l)return;n.data.href=l}else this._pageViewFallBack();this._checkUrlTrigger(),n.type===rh.FullSnapshot&&this._scheduleFullSnapshot(),n.type===rh.FullSnapshot&&"trigger_pending"===this.urlTriggerStatus&&this.clearBuffer();let u=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(n):n;if(!u)return;let d=function(n){if(n&&y(n)&&6===n.type&&y(n.data)&&"rrweb/console@1"===n.data.plugin){n.data.payload.payload.length>10&&(n.data.payload.payload=n.data.payload.payload.slice(0,10),n.data.payload.payload.push("...[truncated]"));let l=[];for(let u=0;u<n.data.payload.payload.length;u++)n.data.payload.payload[u]&&n.data.payload.payload[u].length>2e3?l.push(n.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):l.push(n.data.payload.payload[u]);return n.data.payload.payload=l,n}return n}(u);if(this._updateWindowAndSessionIds(d),this.isIdle&&!Hs(d))return;if(Hs(d)){let n=d.data.payload;if(n){let l=n.lastActivityTimestamp,u=n.threshold;d.timestamp=l+u}}let h=null===(l=this.instance.config.session_recording.compress_events)||void 0===l||l?function(n){if(1024>ui(n))return n;try{if(n.type===rh.FullSnapshot)return{...n,data:Bs(n.data),cv:"2024-10"};if(n.type===rh.IncrementalSnapshot&&n.data.source===rp.Mutation)return{...n,cv:"2024-10",data:{...n.data,texts:Bs(n.data.texts),attributes:Bs(n.data.attributes),removes:Bs(n.data.removes),adds:Bs(n.data.adds)}};if(n.type===rh.IncrementalSnapshot&&n.data.source===rp.StyleSheetRule)return{...n,cv:"2024-10",data:{...n.data,adds:Bs(n.data.adds),removes:Bs(n.data.removes)}}}catch(n){eS.error(rK+" could not compress event - will use uncompressed event",n)}return n}(d):d,f={$snapshot_bytes:ui(h),$snapshot_data:h,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(f):this.clearBuffer()}_pageViewFallBack(){if(this.instance.config.capture_pageview||!j)return;let n=this._maskUrl(j.location.href);this._lastHref!==n&&(this._tryAddCustomEvent("$url_changed",{href:n}),this._lastHref=n)}_processQueuedEvents(){if(this.queuedRRWebEvents.length){let n=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],n.forEach(n=>{Date.now()-n.enqueuedAt<=2e3&&this._tryRRWebMethod(n)})}}_maskUrl(n){let l=this.instance.config.session_recording;if(l.maskNetworkRequestFn){var u;let d={url:n};return null===(u=d=l.maskNetworkRequestFn(d))||void 0===u?void 0:u.url}return n}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);let n=this.minimumDuration,l=this.sessionDuration,u=F(l)&&l>=0,d=F(n)&&u&&l<n;return"buffering"===this.status||d?(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&(function di(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(n.size>=l&&n.data.length>1){let l=Math.floor(n.data.length/2),u=n.data.slice(0,l),d=n.data.slice(l);return[di({size:ui(u),data:u,sessionId:n.sessionId,windowId:n.windowId}),di({size:ui(d),data:d,sessionId:n.sessionId,windowId:n.windowId})].flatMap(n=>n)}return[n]})(this.buffer).forEach(n=>{this._captureSnapshot({$snapshot_bytes:n.size,$snapshot_data:n.data,$session_id:n.sessionId,$window_id:n.windowId})}),this.clearBuffer())}_captureSnapshotBuffered(n){var l;let u=2+((null===(l=this.buffer)||void 0===l?void 0:l.data.length)||0);!this.isIdle&&(this.buffer.size+n.$snapshot_bytes+u>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=n.$snapshot_bytes,this.buffer.data.push(n.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout(()=>{this._flushBuffer()},2e3))}_captureSnapshot(n){this.instance.capture("$snapshot",n,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTrigger(){if(void 0===j||!j.location.href)return;let n=j.location.href;this._urlTriggers.some(l=>"regex"===l.matching&&new RegExp(l.url).test(n))&&this._activateUrlTrigger()}_activateUrlTrigger(){"trigger_pending"===this.urlTriggerStatus&&(this.urlTriggerStatus="trigger_activated",this._tryAddCustomEvent("url trigger activated",{}),this._flushBuffer(),eS.info(rK+" recording triggered by URL pattern match"))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._reportStarted("linked_flag_override")}overrideSampling(){var n;null===(n=this.instance.persistence)||void 0===n||n.register({[eB]:!0}),this._reportStarted("sampling_override")}_reportStarted(n){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0)()&&this.instance.register_for_session({$session_recording_start_reason:n})}};let Ws=class Ws{constructor(n){this.instance=n,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}call(){let n={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(ez),group_properties:this.instance.get_property(eG),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:n,compression:this.instance.config.disable_compression?void 0:d.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:n=>this.parseDecideResponse(n.json)})}parseDecideResponse(n){this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();let l=!n;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=n?n:{},l),l)eS.error("Failed to fetch feature flags from PostHog.");else{if(!eo||!eo.body)return eS.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.parseDecideResponse(n)},500);if(this.instance._afterDecideResponse(n),n.siteApps){if(this.instance.config.opt_in_site_apps)for(let{id:l,url:f}of n.siteApps){var u,d,h;ep[`__$$ph_site_app_${l}`]=this.instance,null===(u=ep.__PosthogExtensions__)||void 0===u||null===(d=(h=u).loadSiteApp)||void 0===d||d.call(h,this.instance,f,n=>{if(n)return eS.error(`Error while initializing PostHog app with config id ${l}`,n)})}else n.siteApps.length>0&&eS.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}};let rX=null!=j&&j.location?ct(j.location.hash,"__posthog")||ct(location.hash,"state"):null,rY="_postHogToolbarParams";(re=rd||(rd={}))[re.UNINITIALIZED=0]="UNINITIALIZED",re[re.LOADING=1]="LOADING",re[re.LOADED=2]="LOADED";let js=class js{constructor(n){this.instance=n}setToolbarState(n){ep.ph_toolbar_state=n}getToolbarState(){var n;return null!==(n=ep.ph_toolbar_state)&&void 0!==n?n:rd.UNINITIALIZED}maybeLoadToolbar(){var n,l;let u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!j||!eo)return!1;u=null!==(n=u)&&void 0!==n?n:j.location,h=null!==(l=h)&&void 0!==l?l:j.history;try{let n;if(!d){try{j.localStorage.setItem("test","test"),j.localStorage.removeItem("test")}catch{return!1}d=null==j?void 0:j.localStorage}let l=rX||ct(u.hash,"__posthog")||ct(u.hash,"state"),f=l?B(()=>JSON.parse(atob(decodeURIComponent(l))))||B(()=>JSON.parse(decodeURIComponent(l))):null;return f&&"ph_authorize"===f.action?((n=f).source="url",n&&Object.keys(n).length>0&&(f.desiredHash?u.hash=f.desiredHash:h?h.replaceState(h.state,"",u.pathname+u.search):u.hash="")):((n=JSON.parse(d.getItem(rY)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token)&&(this.loadToolbar(n),!0)}catch{return!1}}_callLoadToolbar(n){(ep.ph_load_toolbar||ep.ph_load_editor)(n,this.instance)}loadToolbar(n){let l=!(null==eo||!eo.getElementById(e5));if(!j||l)return!1;let u="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,d={token:this.instance.config.token,...n,apiURL:this.instance.requestRouter.endpointFor("ui"),...u?{instrument:!1}:{}};if(j.localStorage.setItem(rY,JSON.stringify({...d,source:void 0})),this.getToolbarState()===rd.LOADED)this._callLoadToolbar(d);else if(this.getToolbarState()===rd.UNINITIALIZED){var h,f;this.setToolbarState(rd.LOADING),null===(h=ep.__PosthogExtensions__)||void 0===h||null===(f=h.loadExternalDependency)||void 0===f||f.call(h,this.instance,"toolbar",n=>{if(n)return eS.error("Failed to load toolbar",n),void this.setToolbarState(rd.UNINITIALIZED);this.setToolbarState(rd.LOADED),this._callLoadToolbar(d)}),eT(j,"turbolinks:load",()=>{this.setToolbarState(rd.UNINITIALIZED),this.loadToolbar(d)})}return!0}_loadEditor(n){return this.loadToolbar(n)}maybeLoadEditor(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(n,l,u)}};let Qs=class Qs{isPaused=!0;queue=[];flushTimeoutMs=3e3;constructor(n){this.sendRequest=n}enqueue(n){this.queue.push(n),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();let n=this.queue.length>0?this.formatQueue():{},l=Object.values(n);[...l.filter(n=>0===n.url.indexOf("/e")),...l.filter(n=>0!==n.url.indexOf("/e"))].map(n=>{this.sendRequest({...n,transport:"sendBeacon"})})}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){this.isPaused||(this.flushTimeout=setTimeout(()=>{if(this.clearFlushTimeout(),this.queue.length>0){let n=this.formatQueue();for(let l in n){let u=n[l],d=(new Date).getTime();u.data&&ev(u.data)&&O(u.data,n=>{n.offset=Math.abs(n.timestamp-d),delete n.timestamp}),this.sendRequest(u)}}},this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){let n={};return O(this.queue,l=>{var u;let d=(l?l.batchKey:null)||l.url;S(n[d])&&(n[d]={...l,data:[]}),null===(u=n[d].data)||void 0===u||u.push(l.data)}),this.queue=[],n}};let rQ=!!eu||!!el,rJ="text/plain",Xs=(n,l)=>{let[u,d]=n.split("?"),h={...l};null==d||d.split("&").forEach(n=>{let[l]=n.split("=");delete h[l]});let f=at(h);return f=f?(d?d+"&":"")+f:d,`${u}?${f}`},Ks=n=>{let{data:l,compression:u}=n;if(!l)return;if(u===d.GZipJS){let n=Ms(As(JSON.stringify(l)),{mtime:0}),u=new Blob([n],{type:rJ});return{contentType:rJ,body:u,estimatedSize:u.size}}if(u===d.Base64){let n=function(n){let l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u,d,h,f,m,g=0,_=0,j="",$=[];if(!n)return n;n=V(n);do u=(m=n.charCodeAt(g++)<<16|n.charCodeAt(g++)<<8|n.charCodeAt(g++))>>18&63,d=m>>12&63,h=m>>6&63,f=63&m,$[_++]=l.charAt(u)+l.charAt(d)+l.charAt(h)+l.charAt(f);while(g<n.length);switch(j=$.join(""),n.length%3){case 1:j=j.slice(0,-2)+"==";break;case 2:j=j.slice(0,-1)+"="}return j}(JSON.stringify(l)),u="data="+encodeURIComponent("string"==typeof n?n:JSON.stringify(n));return{contentType:"application/x-www-form-urlencoded",body:u,estimatedSize:new Blob([u]).size}}let h=JSON.stringify(l);return{contentType:"application/json",body:h,estimatedSize:new Blob([h]).size}},rZ=[];eu&&rZ.push({transport:"XHR",method:n=>{var l;let u=new eu;u.open(n.method||"GET",n.url,!0);let{contentType:d,body:h}=null!==(l=Ks(n))&&void 0!==l?l:{};O(n.headers,function(n,l){u.setRequestHeader(l,n)}),d&&u.setRequestHeader("Content-Type",d),n.timeout&&(u.timeout=n.timeout),u.withCredentials=!0,u.onreadystatechange=()=>{if(4===u.readyState){var l;let d={statusCode:u.status,text:u.responseText};if(200===u.status)try{d.json=JSON.parse(u.responseText)}catch{}null===(l=n.callback)||void 0===l||l.call(n,d)}},u.send(h)}}),el&&rZ.push({transport:"fetch",method:n=>{var l,u;let{contentType:d,body:h,estimatedSize:f}=null!==(l=Ks(n))&&void 0!==l?l:{},m=new Headers;O(n.headers,function(n,l){m.append(l,n)}),d&&m.append("Content-Type",d);let g=n.url,_=null;if(ec){let l=new ec;_={signal:l.signal,timeout:setTimeout(()=>l.abort(),n.timeout)}}el(g,{method:(null==n?void 0:n.method)||"GET",headers:m,keepalive:"POST"===n.method&&65536>(f||0),body:h,signal:null===(u=_)||void 0===u?void 0:u.signal}).then(l=>l.text().then(u=>{var d;let h={statusCode:l.status,text:u};if(200===l.status)try{h.json=JSON.parse(u)}catch(n){eS.error(n)}null===(d=n.callback)||void 0===d||d.call(n,h)})).catch(l=>{var u;eS.error(l),null===(u=n.callback)||void 0===u||u.call(n,{statusCode:0,text:l})}).finally(()=>_?clearTimeout(_.timeout):null)}}),null!=en&&en.sendBeacon&&rZ.push({transport:"sendBeacon",method:n=>{let l=Xs(n.url,{beacon:"1"});try{var u;let{contentType:d,body:h}=null!==(u=Ks(n))&&void 0!==u?u:{},f="string"==typeof h?new Blob([h],{type:d}):h;en.sendBeacon(l,f)}catch{}}});let nn=class nn{isPolling=!1;pollIntervalMs=3e3;queue=[];constructor(n){this.instance=n,this.queue=[],this.areWeOnline=!0,!S(j)&&"onLine"in j.navigator&&(this.areWeOnline=j.navigator.onLine,j.addEventListener("online",()=>{this.areWeOnline=!0,this.flush()}),j.addEventListener("offline",()=>{this.areWeOnline=!1}))}retriableRequest(n){let{retriesPerformedSoFar:l,...u}=n;F(l)&&l>0&&(u.url=Xs(u.url,{retry_count:l})),this.instance._send_request({...u,callback:n=>{var d;200!==n.statusCode&&(n.statusCode<400||n.statusCode>=500)&&(null!=l?l:0)<10?this.enqueue({retriesPerformedSoFar:l,...u}):null===(d=u.callback)||void 0===d||d.call(u,n)}})}enqueue(n){let l=n.retriesPerformedSoFar||0;n.retriesPerformedSoFar=l+1;let u=function(n){let l=3e3*2**n,u=Math.min(18e5,l),d=(Math.random()-.5)*(u-l/2);return Math.ceil(u+d)}(l),d=Date.now()+u;this.queue.push({retryAt:d,requestOptions:n});let h=`Enqueued failed request for retry in ${u}`;navigator.onLine||(h+=" (Browser is offline)"),eS.warn(h),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout(()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()},this.pollIntervalMs)}flush(){let n=Date.now(),l=[],u=this.queue.filter(u=>u.retryAt<n||(l.push(u),!1));if(this.queue=l,u.length>0)for(let{requestOptions:n}of u)this.retriableRequest(n)}unload(){for(let{requestOptions:n}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request({...n,transport:"sendBeacon"})}catch(n){eS.error(n)}this.queue=[]}};let on=class on{_sessionIdChangedHandlers=[];constructor(n,l,u,d){var h;this.config=n,this.persistence=l,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=u||We,this._windowIdGenerator=d||We;let f=n.persistence_name||n.token,m=n.session_idle_timeout_seconds||1800;if(F(m)?m>1800?eS.warn("session_idle_timeout_seconds cannot be  greater than 30 minutes. Using 30 minutes instead."):m<60&&eS.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(eS.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),m=1800),this._sessionTimeoutMs=1e3*Math.min(Math.max(m,60),1800),this._window_id_storage_key="ph_"+f+"_window_id",this._primary_window_exists_storage_key="ph_"+f+"_primary_window_exists",this._canUseSessionStorage()){let n=tp.parse(this._window_id_storage_key),l=tp.parse(this._primary_window_exists_storage_key);n&&!l?this._windowId=n:tp.remove(this._window_id_storage_key),tp.set(this._primary_window_exists_storage_key,!0)}if(null!==(h=this.config.bootstrap)&&void 0!==h&&h.sessionID)try{let n=(n=>{let l=n.replace(/-/g,"");if(32!==l.length)throw Error("Not a valid UUID");if("7"!==l[12])throw Error("Not a UUIDv7");return parseInt(l.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),n)}catch(n){eS.error("Invalid sessionID in bootstrap",n)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(n){return S(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(n),this._sessionId&&n(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter(l=>l!==n)}}_canUseSessionStorage(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&tp.is_supported()}_setWindowId(n){n!==this._windowId&&(this._windowId=n,this._canUseSessionStorage()&&tp.set(this._window_id_storage_key,n))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?tp.parse(this._window_id_storage_key):null}_setSessionId(n,l,u){n===this._sessionId&&l===this._sessionActivityTimestamp&&u===this._sessionStartTimestamp||(this._sessionStartTimestamp=u,this._sessionActivityTimestamp=l,this._sessionId=n,this.persistence.register({[eU]:[l,n,u]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];let n=this.persistence.props[eU];return ev(n)&&2===n.length&&n.push(n[0]),n||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){null==j||j.addEventListener("beforeunload",()=>{this._canUseSessionStorage()&&tp.remove(this._primary_window_exists_storage_key)})}checkAndGetSessionAndWindowId(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),[u,d,h]=this._getSessionId(),f=this._getWindowId(),m=F(h)&&h>0&&Math.abs(l-h)>864e5,g=!1,_=!d,j=!n&&Math.abs(l-u)>this.sessionTimeoutMs;_||j||m?(d=this._sessionIdGenerator(),f=this._windowIdGenerator(),eS.info("[SessionId] new session ID generated",{sessionId:d,windowId:f,changeReason:{noSessionId:_,activityTimeout:j,sessionPastMaximumLength:m}}),h=l,g=!0):f||(f=this._windowIdGenerator(),g=!0);let $=0===u||!n||m?l:u,z=0===h?(new Date).getTime():h;return this._setWindowId(f),this._setSessionId(d,$,z),g&&this._sessionIdChangedHandlers.forEach(n=>n(d,f,g?{noSessionId:_,activityTimeout:j,sessionPastMaximumLength:m}:void 0)),{sessionId:d,windowId:f,sessionStartTimestamp:z,changeReason:g?{noSessionId:_,activityTimeout:j,sessionPastMaximumLength:m}:void 0}}};(rr=h||(h={})).US="us",rr.EU="eu",rr.CUSTOM="custom";let r0="i.posthog.com";let cn=class cn{_regionCache={};constructor(n){this.instance=n}get apiHost(){let n=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===n?"https://us.i.posthog.com":n}get uiHost(){var n;let l=null===(n=this.instance.config.ui_host)||void 0===n?void 0:n.replace(/\/$/,"");return l||(l=this.apiHost.replace(`.${r0}`,".posthog.com")),"https://app.posthog.com"===l?"https://us.posthog.com":l}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=h.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=h.EU:this._regionCache[this.apiHost]=h.CUSTOM),this._regionCache[this.apiHost]}endpointFor(n){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(l&&(l="/"===l[0]?l:`/${l}`),"ui"===n)return this.uiHost+l;if(this.region===h.CUSTOM)return this.apiHost+l;let u=r0+l;switch(n){case"assets":return`https://${this.region}-assets.${u}`;case"api":return`https://${this.region}.${u}`}}};let r1="posthog-js";function dn(n){let{organization:l,projectId:u,prefix:d,severityAllowList:h=["error"]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f=>{var m,g,_,j,$;if(!("*"===h||h.includes(f.level))||!n.__loaded)return f;f.tags||(f.tags={});let z=n.requestRouter.endpointFor("ui",`/project/${n.config.token}/person/${n.get_distinct_id()}`);f.tags["PostHog Person URL"]=z,n.sessionRecordingStarted()&&(f.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));let ee=(null===(m=f.exception)||void 0===m?void 0:m.values)||[],et={$exception_message:(null===(g=ee[0])||void 0===g?void 0:g.value)||f.message,$exception_type:null===(_=ee[0])||void 0===_?void 0:_.type,$exception_personURL:z,$exception_level:f.level,$exception_list:ee,$sentry_event_id:f.event_id,$sentry_exception:f.exception,$sentry_exception_message:(null===(j=ee[0])||void 0===j?void 0:j.value)||f.message,$sentry_exception_type:null===($=ee[0])||void 0===$?void 0:$.type,$sentry_tags:f.tags,$level:f.level};return l&&u&&(et.$sentry_url=(d||"https://sentry.io/organizations/")+l+"/issues/?project="+u+"&query="+f.event_id),n.exceptions.sendExceptionEvent(et),f}}let hn=class hn{constructor(n,l,u,d,h){this.name=r1,this.setupOnce=function(f){f(dn(n,{organization:l,projectId:u,prefix:d,severityAllowList:h}))}}};let gn=class gn{constructor(n){this._instance=n}doPageView(n){var l;let u=this._previousPageViewProperties(n);return this._currentPath=null!==(l=null==j?void 0:j.location.pathname)&&void 0!==l?l:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=n,u}doPageLeave(n){return this._previousPageViewProperties(n)}_previousPageViewProperties(n){let l=this._currentPath,u=this._prevPageviewTimestamp,d=this._instance.scrollManager.getContext();if(!u)return{};let h={};if(d){let{maxScrollHeight:n,lastScrollY:l,maxScrollY:u,maxContentHeight:f,lastContentY:m,maxContentY:g}=d;S(n)||S(l)||S(u)||S(f)||S(m)||S(g)||(n=Math.ceil(n),l=Math.ceil(l),u=Math.ceil(u),f=Math.ceil(f),m=Math.ceil(m),g=Math.ceil(g),h={$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:n<=1?1:_n(l/n,0,1),$prev_pageview_max_scroll:u,$prev_pageview_max_scroll_percentage:n<=1?1:_n(u/n,0,1),$prev_pageview_last_content:m,$prev_pageview_last_content_percentage:f<=1?1:_n(m/f,0,1),$prev_pageview_max_content:g,$prev_pageview_max_content_percentage:f<=1?1:_n(g/f,0,1)})}return l&&(h.$prev_pageview_pathname=l),u&&(h.$prev_pageview_duration=(n.getTime()-u.getTime())/1e3),h}};function _n(n,l,u){return Math.max(l,Math.min(n,u))}(rn=f||(f={})).Popover="popover",rn.API="api",rn.Widget="widget",(ri=m||(m={})).Open="open",ri.MultipleChoice="multiple_choice",ri.SingleChoice="single_choice",ri.Rating="rating",ri.Link="link",(ro=g||(g={})).NextQuestion="next_question",ro.End="end",ro.ResponseBased="response_based",ro.SpecificQuestion="specific_question";let bn=class bn{events={};constructor(){this.events={}}on(n,l){return this.events[n]||(this.events[n]=[]),this.events[n].push(l),()=>{this.events[n]=this.events[n].filter(n=>n!==l)}}emit(n,l){for(let u of this.events[n]||[])u(l);for(let u of this.events["*"]||[])u(n,l)}};let yn=class yn{_debugEventEmitter=new bn;constructor(n){this.instance=n,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var n,l;S(null===(n=this.instance)||void 0===n?void 0:n._addCaptureHook)||null===(l=this.instance)||void 0===l||l._addCaptureHook((n,l)=>{this.on(n,l)})}register(n){var l,u,d;if(!S(null===(l=this.instance)||void 0===l?void 0:l._addCaptureHook)&&(n.forEach(n=>{var l,u;null===(l=this.actionRegistry)||void 0===l||l.add(n),null===(u=n.steps)||void 0===u||u.forEach(n=>{var l;null===(l=this.actionEvents)||void 0===l||l.add((null==n?void 0:n.event)||"")})}),null!==(u=this.instance)&&void 0!==u&&u.autocapture)){let l=new Set;n.forEach(n=>{var u;null===(u=n.steps)||void 0===u||u.forEach(n=>{null!=n&&n.selector&&l.add(null==n?void 0:n.selector)})}),null===(d=this.instance)||void 0===d||d.autocapture.setElementSelectors(l)}}on(n,l){var u;null!=l&&0!=n.length&&(this.actionEvents.has(n)||this.actionEvents.has(null==l?void 0:l.event))&&this.actionRegistry&&(null===(u=this.actionRegistry)||void 0===u?void 0:u.size)>0&&this.actionRegistry.forEach(n=>{this.checkAction(l,n)&&this._debugEventEmitter.emit("actionCaptured",n.name)})}_addActionHook(n){this.onAction("actionCaptured",l=>n(l))}checkAction(n,l){if(null==(null==l?void 0:l.steps))return!1;for(let u of l.steps)if(this.checkStep(n,u))return!0;return!1}onAction(n,l){return this._debugEventEmitter.on(n,l)}checkStep=(n,l)=>this.checkStepEvent(n,l)&&this.checkStepUrl(n,l)&&this.checkStepElement(n,l);checkStepEvent=(n,l)=>null==l||!l.event||(null==n?void 0:n.event)===(null==l?void 0:l.event);checkStepUrl(n,l){if(null!=l&&l.url){var u;let d=null==n||null===(u=n.properties)||void 0===u?void 0:u.$current_url;if(!d||"string"!=typeof d||!yn.matchString(d,null==l?void 0:l.url,(null==l?void 0:l.url_matching)||"contains"))return!1}return!0}static matchString(n,l,u){switch(u){case"regex":return!!j&&ot(n,l);case"exact":return l===n;case"contains":let d=yn.escapeStringRegexp(l).replace(/_/g,".").replace(/%/g,".*");return ot(n,d);default:return!1}}static escapeStringRegexp(n){return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(n,l){if((null!=l&&l.href||null!=l&&l.tag_name||null!=l&&l.text)&&!this.getElementsList(n).some(n=>!(null!=l&&l.href&&!yn.matchString(n.href||"",null==l?void 0:l.href,(null==l?void 0:l.href_matching)||"exact"))&&(null==l||!l.tag_name||n.tag_name===(null==l?void 0:l.tag_name))&&!(null!=l&&l.text&&!yn.matchString(n.text||"",null==l?void 0:l.text,(null==l?void 0:l.text_matching)||"exact")&&!yn.matchString(n.$el_text||"",null==l?void 0:l.text,(null==l?void 0:l.text_matching)||"exact"))))return!1;if(null!=l&&l.selector){var u;let d=null==n||null===(u=n.properties)||void 0===u?void 0:u.$element_selectors;if(!d||!d.includes(null==l?void 0:l.selector))return!1}return!0}getElementsList(n){return null==(null==n?void 0:n.properties.$elements)?[]:null==n?void 0:n.properties.$elements}};let wn=class wn{static SURVEY_SHOWN_EVENT_NAME="survey shown";constructor(n){this.instance=n,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(n){var l;S(null===(l=this.instance)||void 0===l?void 0:l._addCaptureHook)||(this.setupEventBasedSurveys(n),this.setupActionBasedSurveys(n))}setupActionBasedSurveys(n){let l=n.filter(n=>{var l,u,d,h;return(null===(l=n.conditions)||void 0===l?void 0:l.actions)&&(null===(u=n.conditions)||void 0===u||null===(d=u.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0});0!==l.length&&(null==this.actionMatcher&&(this.actionMatcher=new yn(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(n=>{this.onAction(n)})),l.forEach(n=>{var l,u,d,h,f,m,g,_,j,$;n.conditions&&null!==(l=n.conditions)&&void 0!==l&&l.actions&&null!==(u=n.conditions)&&void 0!==u&&null!==(d=u.actions)&&void 0!==d&&d.values&&(null===(h=n.conditions)||void 0===h||null===(f=h.actions)||void 0===f||null===(m=f.values)||void 0===m?void 0:m.length)>0&&(null===(g=this.actionMatcher)||void 0===g||g.register(n.conditions.actions.values),null===(_=n.conditions)||void 0===_||null===(j=_.actions)||void 0===j||null===($=j.values)||void 0===$||$.forEach(l=>{if(l&&l.name){let u=this.actionToSurveys.get(l.name);u&&u.push(n.id),this.actionToSurveys.set(l.name,u||[n.id])}}))}))}setupEventBasedSurveys(n){var l;0!==n.filter(n=>{var l,u,d,h;return(null===(l=n.conditions)||void 0===l?void 0:l.events)&&(null===(u=n.conditions)||void 0===u||null===(d=u.events)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0}).length&&(null===(l=this.instance)||void 0===l||l._addCaptureHook((n,l)=>{this.onEvent(n,l)}),n.forEach(n=>{var l,u,d;null===(l=n.conditions)||void 0===l||null===(u=l.events)||void 0===u||null===(d=u.values)||void 0===d||d.forEach(l=>{if(l&&l.name){let u=this.eventToSurveys.get(l.name);u&&u.push(n.id),this.eventToSurveys.set(l.name,u||[n.id])}})}))}onEvent(n,l){var u,d,h;let f=(null===(u=this.instance)||void 0===u||null===(d=u.persistence)||void 0===d?void 0:d.props[eX])||[];if(wn.SURVEY_SHOWN_EVENT_NAME==n&&l&&f.length>0){let n=null==l||null===(h=l.properties)||void 0===h?void 0:h.$survey_id;if(n){let l=f.indexOf(n);l>=0&&(f.splice(l,1),this._updateActivatedSurveys(f))}}else this.eventToSurveys.has(n)&&this._updateActivatedSurveys(f.concat(this.eventToSurveys.get(n)||[]))}onAction(n){var l,u;let d=(null===(l=this.instance)||void 0===l||null===(u=l.persistence)||void 0===u?void 0:u.props[eX])||[];this.actionToSurveys.has(n)&&this._updateActivatedSurveys(d.concat(this.actionToSurveys.get(n)||[]))}_updateActivatedSurveys(n){var l,u;null===(l=this.instance)||void 0===l||null===(u=l.persistence)||void 0===u||u.register({[eX]:[...new Set(n)]})}getSurveys(){var n,l;let u=null===(n=this.instance)||void 0===n||null===(l=n.persistence)||void 0===l?void 0:l.props[eX];return u||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}};let r2="[Surveys]",r3={icontains:n=>!!j&&j.location.href.toLowerCase().indexOf(n.toLowerCase())>-1,not_icontains:n=>!!j&&-1===j.location.href.toLowerCase().indexOf(n.toLowerCase()),regex:n=>!!j&&ot(j.location.href,n),not_regex:n=>!!j&&!ot(j.location.href,n),exact:n=>(null==j?void 0:j.location.href)===n,is_not:n=>(null==j?void 0:j.location.href)!==n};let xn=class xn{constructor(n){this.instance=n,this._surveyEventReceiver=null}afterDecideResponse(n){this._decideServerResponse=!!n.surveys,this.loadIfEnabled()}loadIfEnabled(){var n,l,u;let d=null==ep||null===(n=ep.__PosthogExtensions__)||void 0===n?void 0:n.generateSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||d||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new wn(this.instance)),null===(l=ep.__PosthogExtensions__)||void 0===l||null===(u=l.loadExternalDependency)||void 0===u||u.call(l,this.instance,"surveys",n=>{var l,u;if(n)return eS.error(r2,"Could not load surveys script",n);this._surveyManager=null===(l=ep.__PosthogExtensions__)||void 0===l||null===(u=l.generateSurveys)||void 0===u?void 0:u.call(l,this.instance)}))}getSurveys(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return n([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new wn(this.instance));let u=this.instance.get_property(eK);if(u&&!l)return n(u);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/surveys/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:l=>{var u,d;if(200!==l.statusCode||!l.json)return n([]);let h=l.json.surveys||[],f=h.filter(n=>{var l,u,d,h,f,m,g,_,j,$,z,ee;return(null===(l=n.conditions)||void 0===l?void 0:l.events)&&(null===(u=n.conditions)||void 0===u||null===(d=u.events)||void 0===d?void 0:d.values)&&(null===(h=n.conditions)||void 0===h||null===(f=h.events)||void 0===f||null===(m=f.values)||void 0===m?void 0:m.length)>0||(null===(g=n.conditions)||void 0===g?void 0:g.actions)&&(null===(_=n.conditions)||void 0===_||null===(j=_.actions)||void 0===j?void 0:j.values)&&(null===($=n.conditions)||void 0===$||null===(z=$.actions)||void 0===z||null===(ee=z.values)||void 0===ee?void 0:ee.length)>0});return f.length>0&&(null===(d=this._surveyEventReceiver)||void 0===d||d.register(f)),null===(u=this.instance.persistence)||void 0===u||u.register({[eK]:h}),n(h)}})}getActiveMatchingSurveys(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(l=>{var u;let d=l.filter(n=>!(!n.start_date||n.end_date)).filter(n=>{var l,u,d,h;if(!n.conditions)return!0;let f=null===(l=n.conditions)||void 0===l||!l.url||r3[null!==(u=null===(d=n.conditions)||void 0===d?void 0:d.urlMatchType)&&void 0!==u?u:"icontains"](n.conditions.url),m=null===(h=n.conditions)||void 0===h||!h.selector||(null==eo?void 0:eo.querySelector(n.conditions.selector));return f&&m}),h=null===(u=this._surveyEventReceiver)||void 0===u?void 0:u.getSurveys(),f=d.filter(n=>{var l,u,d,f,m,g,_,j,$,z;if(!n.linked_flag_key&&!n.targeting_flag_key&&!n.internal_targeting_flag_key)return!0;let ee=!n.linked_flag_key||this.instance.featureFlags.isFeatureEnabled(n.linked_flag_key),et=!n.targeting_flag_key||this.instance.featureFlags.isFeatureEnabled(n.targeting_flag_key),en=(null===(l=n.conditions)||void 0===l?void 0:l.events)&&(null===(u=n.conditions)||void 0===u||null===(d=u.events)||void 0===d?void 0:d.values)&&(null===(f=n.conditions)||void 0===f||null===(m=f.events)||void 0===m?void 0:m.values.length)>0,eo=(null===(g=n.conditions)||void 0===g?void 0:g.actions)&&(null===(_=n.conditions)||void 0===_||null===(j=_.actions)||void 0===j?void 0:j.values)&&(null===($=n.conditions)||void 0===$||null===(z=$.actions)||void 0===z?void 0:z.values.length)>0,es=!en&&!eo||(null==h?void 0:h.includes(n.id)),el=this._canActivateRepeatedly(n),eu=!(n.internal_targeting_flag_key&&!el)||this.instance.featureFlags.isFeatureEnabled(n.internal_targeting_flag_key);return ee&&et&&eu&&es});return n(f)},l)}getNextSurveyStep(n,l,u){var d,h,f,_,j;let $=n.questions[l],z=l+1;if(null===(d=$.branching)||void 0===d||!d.type)return l===n.questions.length-1?g.End:z;if($.branching.type===g.End)return g.End;if($.branching.type===g.SpecificQuestion){if(Number.isInteger($.branching.index))return $.branching.index}else if($.branching.type===g.ResponseBased){if($.type===m.SingleChoice){let n=$.choices.indexOf(`${u}`);if(null!==(h=$.branching)&&void 0!==h&&null!==(f=h.responseValues)&&void 0!==f&&f.hasOwnProperty(n)){let l=$.branching.responseValues[n];return Number.isInteger(l)?l:l===g.End?g.End:z}}else if($.type===m.Rating){if("number"!=typeof u||!Number.isInteger(u))throw Error("The response type must be an integer");let n=function(n,l){if(3===l){if(n<1||n>3)throw Error("The response must be in range 1-3");return 1===n?"negative":2===n?"neutral":"positive"}if(5===l){if(n<1||n>5)throw Error("The response must be in range 1-5");return n<=2?"negative":3===n?"neutral":"positive"}if(7===l){if(n<1||n>7)throw Error("The response must be in range 1-7");return n<=3?"negative":4===n?"neutral":"positive"}if(10===l){if(n<0||n>10)throw Error("The response must be in range 0-10");return n<=6?"detractors":n<=8?"passives":"promoters"}throw Error("The scale must be one of: 3, 5, 7, 10")}(u,$.scale);if(null!==(_=$.branching)&&void 0!==_&&null!==(j=_.responseValues)&&void 0!==j&&j.hasOwnProperty(n)){let l=$.branching.responseValues[n];return Number.isInteger(l)?l:l===g.End?g.End:z}}return z}return eS.warn(r2,"Falling back to next question index due to unexpected branching type"),z}_canActivateRepeatedly(n){var l;return I(null===(l=ep.__PosthogExtensions__)||void 0===l?void 0:l.canActivateRepeatedly)?(eS.warn(r2,"canActivateRepeatedly is not defined, must init before calling"),!1):ep.__PosthogExtensions__.canActivateRepeatedly(n)}canRenderSurvey(n){I(this._surveyManager)?eS.warn(r2,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(l=>{let u=l.filter(l=>l.id===n)[0];this._surveyManager.canRenderSurvey(u)})}renderSurvey(n,l){I(this._surveyManager)?eS.warn(r2,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(u=>{let d=u.filter(l=>l.id===n)[0];this._surveyManager.renderSurvey(d,null==eo?void 0:eo.querySelector(l))})}};let kn=class kn{serverLimits={};lastEventRateLimited=!1;constructor(n){var l,u;this.instance=n,this.captureEventsPerSecond=(null===(l=n.config.rate_limiting)||void 0===l?void 0:l.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(u=n.config.rate_limiting)||void 0===u?void 0:u.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var n,l,u;let d=arguments.length>0&&void 0!==arguments[0]&&arguments[0],h=(new Date).getTime(),f=null!==(n=null===(l=this.instance.persistence)||void 0===l?void 0:l.get_property(eZ))&&void 0!==n?n:{tokens:this.captureEventsBurstLimit,last:h};f.tokens+=(h-f.last)/1e3*this.captureEventsPerSecond,f.last=h,f.tokens>this.captureEventsBurstLimit&&(f.tokens=this.captureEventsBurstLimit);let m=f.tokens<1;return m||d||(f.tokens=Math.max(0,f.tokens-1)),!m||this.lastEventRateLimited||d||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited. Config is set to ${this.captureEventsPerSecond} events per second and ${this.captureEventsBurstLimit} events burst limit.`},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=m,null===(u=this.instance.persistence)||void 0===u||u.set_property(eZ,f),{isRateLimited:m,remainingTokens:f.tokens}}isServerRateLimited(n){let l=this.serverLimits[n||"events"]||!1;return!1!==l&&(new Date).getTime()<l}checkForLimiting=n=>{let l=n.text;if(l&&l.length)try{let n=JSON.parse(l);(n.quota_limited||[]).forEach(n=>{eS.info(`[RateLimiter] ${n||"events"} is quota limited.`),this.serverLimits[n]=(new Date).getTime()+6e4})}catch(n){return void eS.warn(`[RateLimiter] could not rate limit - continuing. Error: "${null==n?void 0:n.message}"`,{text:l})}}};let In=()=>({initialPathName:(null==es?void 0:es.pathname)||"",referringDomain:t7.referringDomain(),...t7.campaignParams()});let Fn=class Fn{constructor(n,l,u){this._sessionIdManager=n,this._persistence=l,this._sessionSourceParamGenerator=u||In,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStoredProps(){return this._persistence.props[eJ]}_onSessionIdCallback=n=>{let l=this._getStoredProps();if(l&&l.sessionId===n)return;let u={sessionId:n,props:this._sessionSourceParamGenerator()};this._persistence.register({[eJ]:u})};getSessionProps(){var n;let l=null===(n=this._getStoredProps())||void 0===n?void 0:n.props;return l?{$client_session_initial_referring_host:l.referringDomain,$client_session_initial_pathname:l.initialPathName,$client_session_initial_utm_source:l.utm_source,$client_session_initial_utm_campaign:l.utm_campaign,$client_session_initial_utm_medium:l.utm_medium,$client_session_initial_utm_content:l.utm_content,$client_session_initial_utm_term:l.utm_term}:{}}};let r5=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Pn=function(n,l){if(!n)return!1;let u=n.toLowerCase();return r5.concat(l||[]).some(n=>{let l=n.toLowerCase();return -1!==u.indexOf(l)})},$n=function(n,l){if(!n)return!1;let u=n.userAgent;if(u&&Pn(u,l))return!0;try{let u=null==n?void 0:n.userAgentData;if(null!=u&&u.brands&&u.brands.some(n=>Pn(null==n?void 0:n.brand,l)))return!0}catch{}return!!n.webdriver};let Tn=class Tn{constructor(){this.clicks=[]}isRageClick(n,l,u){let d=this.clicks[this.clicks.length-1];if(d&&Math.abs(n-d.x)+Math.abs(l-d.y)<30&&u-d.timestamp<1e3){if(this.clicks.push({x:n,y:l,timestamp:u}),3===this.clicks.length)return!0}else this.clicks=[{x:n,y:l,timestamp:u}];return!1}};function Cn(n){var l;return n.id===e5||!(null===(l=n.closest)||void 0===l||!l.call(n,"#"+e5))}let Mn=class Mn{rageclicks=new Tn;_enabledServerSide=!1;_initialized=!1;_flushInterval=null;constructor(n){var l;this.instance=n,this._enabledServerSide=!(null===(l=this.instance.persistence)||void 0===l||!l.props[eO]),null==j||j.addEventListener("beforeunload",()=>{this.flush()})}get flushIntervalMilliseconds(){let n=5e3;return y(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(n=this.instance.config.capture_heatmaps.flush_interval_milliseconds),n}get isEnabled(){return S(this.instance.config.capture_heatmaps)?S(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this._initialized||(eS.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds));else{var n;clearInterval(null!==(n=this._flushInterval)&&void 0!==n?n:void 0),this.getAndClearBuffer()}}afterDecideResponse(n){let l=!!n.heatmaps;this.instance.persistence&&this.instance.persistence.register({[eO]:l}),this._enabledServerSide=l,this.startIfEnabled()}getAndClearBuffer(){let n=this.buffer;return this.buffer=void 0,n}_setupListeners(){j&&eo&&(eT(eo,"click",n=>this._onClick(n||(null==j?void 0:j.event)),!1,!0),eT(eo,"mousemove",n=>this._onMouseMove(n||(null==j?void 0:j.event)),!1,!0),this._initialized=!0)}_getProperties(n,l){let u=this.instance.scrollManager.scrollY(),d=this.instance.scrollManager.scrollX(),h=this.instance.scrollManager.scrollElement(),f=function(n,l,u){let d=n;for(;d&&yi(d)&&!wi(d,"body")&&d!==u;){if(q(l,null==j?void 0:j.getComputedStyle(d).position))return!0;d=ki(d)}return!1}(bi(n),["fixed","sticky"],h);return{x:n.clientX+(f?0:d),y:n.clientY+(f?0:u),target_fixed:f,type:l}}_onClick(n){var l;if(Cn(n.target))return;let u=this._getProperties(n,"click");null!==(l=this.rageclicks)&&void 0!==l&&l.isRageClick(n.clientX,n.clientY,(new Date).getTime())&&this._capture({...u,type:"rageclick"}),this._capture(u)}_onMouseMove(n){Cn(n.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(()=>{this._capture(this._getProperties(n,"mousemove"))},500))}_capture(n){if(!j)return;let l=j.location.href;this.buffer=this.buffer||{},this.buffer[l]||(this.buffer[l]=[]),this.buffer[l].push(n)}flush(){this.buffer&&!w(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}};let An=class An{constructor(n){this.instance=n}getContext(){return this.context}resetContext(){let n=this.context;return setTimeout(this._updateScrollData,0),n}_updateScrollData=()=>{var n,l,u,d;this.context||(this.context={});let h=this.scrollElement(),f=this.scrollY(),m=h?Math.max(0,h.scrollHeight-h.clientHeight):0,g=f+((null==h?void 0:h.clientHeight)||0),_=(null==h?void 0:h.scrollHeight)||0;this.context.lastScrollY=Math.ceil(f),this.context.maxScrollY=Math.max(f,null!==(n=this.context.maxScrollY)&&void 0!==n?n:0),this.context.maxScrollHeight=Math.max(m,null!==(l=this.context.maxScrollHeight)&&void 0!==l?l:0),this.context.lastContentY=g,this.context.maxContentY=Math.max(g,null!==(u=this.context.maxContentY)&&void 0!==u?u:0),this.context.maxContentHeight=Math.max(_,null!==(d=this.context.maxContentHeight)&&void 0!==d?d:0)};startMeasuringScrollPosition(){null==j||j.addEventListener("scroll",this._updateScrollData,!0),null==j||j.addEventListener("scrollend",this._updateScrollData,!0),null==j||j.addEventListener("resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return null==j?void 0:j.document.documentElement;{let n=ev(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(let l of n){let n=null==j?void 0:j.document.querySelector(l);if(n)return n}}}scrollY(){if(this.instance.config.scroll_root_selector){let n=this.scrollElement();return n&&n.scrollTop||0}return j&&(j.scrollY||j.pageYOffset||j.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){let n=this.scrollElement();return n&&n.scrollLeft||0}return j&&(j.scrollX||j.pageXOffset||j.document.documentElement.scrollLeft)||0}};let r4="$copy_autocapture";function On(n,l){return l.length>n?l.slice(0,n)+"...":l}let Dn=class Dn{_initialized=!1;_isDisabledServerSide=null;rageclicks=new Tn;_elementsChainAsString=!1;constructor(n){this.instance=n,this._elementSelectors=null}get config(){var n,l;let u=y(this.instance.config.autocapture)?this.instance.config.autocapture:{};return u.url_allowlist=null===(n=u.url_allowlist)||void 0===n?void 0:n.map(n=>new RegExp(n)),u.url_ignorelist=null===(l=u.url_ignorelist)||void 0===l?void 0:l.map(n=>new RegExp(n)),u}_addDomEventHandlers(){if(!this.isBrowserSupported())return void eS.info("Disabling Automatic Event Collection because this browser is not supported");if(!j||!eo)return;let t=n=>{n=n||(null==j?void 0:j.event);try{this._captureEvent(n)}catch(n){eS.error("Failed to capture event",n)}},i=n=>{n=n||(null==j?void 0:j.event),this._captureEvent(n,r4)};eT(eo,"submit",t,!1,!0),eT(eo,"change",t,!1,!0),eT(eo,"click",t,!1,!0),this.config.capture_copied_text&&(eT(eo,"copy",i,!1,!0),eT(eo,"cut",i,!1,!0))}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}afterDecideResponse(n){n.elementsChainAsString&&(this._elementsChainAsString=n.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[eA]:!!n.autocapture_opt_out}),this._isDisabledServerSide=!!n.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(n){this._elementSelectors=n}getElementSelectors(n){var l;let u=[];return null===(l=this._elementSelectors)||void 0===l||l.forEach(l=>{let d=null==eo?void 0:eo.querySelectorAll(l);null==d||d.forEach(d=>{n===d&&u.push(l)})}),u}get isEnabled(){var n,l;let u=null===(n=this.instance.persistence)||void 0===n?void 0:n.props[eA],d=this._isDisabledServerSide;if(k(d)&&!R(u)&&!this.instance.config.advanced_disable_decide)return!1;let h=null!==(l=this._isDisabledServerSide)&&void 0!==l?l:!!u;return!!this.instance.config.autocapture&&!h}_previousElementSibling(n){if(n.previousElementSibling)return n.previousElementSibling;let l=n;do l=l.previousSibling;while(l&&!yi(l));return l}_getAugmentPropertiesFromElement(n){if(!Fi(n))return{};let l={};return O(n.attributes,function(n){if(n.name&&0===n.name.indexOf("data-ph-capture-attribute")){let u=n.name.replace("data-ph-capture-attribute-",""),d=n.value;u&&d&&Li(d)&&(l[u]=d)}}),l}_getPropertiesFromElement(n,l,u){var d;let h=n.tagName.toLowerCase(),f={tag_name:h};rf.indexOf(h)>-1&&!u&&("a"===h.toLowerCase()||"button"===h.toLowerCase()?f.$el_text=On(1024,Oi(n)):f.$el_text=On(1024,mi(n)));let m=fi(n);m.length>0&&(f.classes=m.filter(function(n){return""!==n}));let g=null===(d=this.config)||void 0===d?void 0:d.element_attribute_ignorelist;O(n.attributes,function(u){var d;if((!Ri(n)||-1!==["name","id","class","aria-label"].indexOf(u.name))&&(null==g||!g.includes(u.name))&&!l&&Li(u.value)&&(!E(d=u.name)||"_ngcontent"!==d.substring(0,10)&&"_nghost"!==d.substring(0,7))){let n=u.value;"class"===u.name&&(n=gi(n).join(" ")),f["attr__"+u.name]=On(1024,n)}});let _=1,j=1,$=n;for(;$=this._previousElementSibling($);)_++,$.tagName===n.tagName&&j++;return f.nth_child=_,f.nth_of_type=j,f}_getDefaultProperties(n){return{$event_type:n,$ce_version:1}}_captureEvent(n){var l,u,d,h,f,m;let g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(!this.isEnabled)return;let _=bi(n);Si(_)&&(_=_.parentNode||null),"$autocapture"===g&&"click"===n.type&&n instanceof MouseEvent&&this.instance.config.rageclick&&null!==(l=this.rageclicks)&&void 0!==l&&l.isRageClick(n.clientX,n.clientY,(new Date).getTime())&&this._captureEvent(n,"$rageclick");let $=g===r4;if(_&&function(n,l){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,d=arguments.length>3?arguments[3]:void 0,h=arguments.length>4?arguments[4]:void 0;if(!j||!n||wi(n,"html")||!yi(n)||null!=u&&u.url_allowlist&&!_i(u.url_allowlist)||null!=u&&u.url_ignorelist&&_i(u.url_ignorelist))return!1;if(null!=u&&u.dom_event_allowlist){let n=u.dom_event_allowlist;if(n&&!n.some(n=>l.type===n))return!1}let f=!1,m=[n],g=!0,_=n;for(;_.parentNode&&!wi(_,"body");)if(Ei(_.parentNode))m.push(_.parentNode.host),_=_.parentNode.host;else{if(!(g=ki(_)))break;if(d||rf.indexOf(g.tagName.toLowerCase())>-1)f=!0;else{let n=j.getComputedStyle(g);n&&"pointer"===n.getPropertyValue("cursor")&&(f=!0)}m.push(g),_=g}if(!function(n,l){let u=null==l?void 0:l.element_allowlist;if(S(u))return!0;for(let l of n)if(u.some(n=>l.tagName.toLowerCase()===n))return!0;return!1}(m,u)||!function(n,l){let u=null==l?void 0:l.css_selector_allowlist;if(S(u))return!0;for(let l of n)if(u.some(n=>l.matches(n)))return!0;return!1}(m,u))return!1;let $=j.getComputedStyle(n);if($&&"pointer"===$.getPropertyValue("cursor")&&"click"===l.type)return!0;let z=n.tagName.toLowerCase();switch(z){case"html":return!1;case"form":return(h||["submit"]).indexOf(l.type)>=0;case"input":case"select":case"textarea":return(h||["change","click"]).indexOf(l.type)>=0;default:return f?(h||["click"]).indexOf(l.type)>=0:(h||["click"]).indexOf(l.type)>=0&&(rf.indexOf(z)>-1||"true"===n.getAttribute("contenteditable"))}}(_,n,this.config,$,$?["copy","cut"]:void 0)){let l=[_],$=_;for(;$.parentNode&&!wi($,"body");)Ei($.parentNode)?(l.push($.parentNode.host),$=$.parentNode.host):(l.push($.parentNode),$=$.parentNode);let z=[],ee={},et,en,eo=!1;if(O(l,n=>{let l=Fi(n);"a"===n.tagName.toLowerCase()&&(et=n.getAttribute("href"),et=l&&Li(et)&&et),q(fi(n),"ph-no-capture")&&(eo=!0),z.push(this._getPropertiesFromElement(n,this.instance.config.mask_all_element_attributes,this.instance.config.mask_all_text));let u=this._getAugmentPropertiesFromElement(n);D(ee,u)}),this.instance.config.mask_all_text||("a"===_.tagName.toLowerCase()||"button"===_.tagName.toLowerCase()?z[0].$el_text=Oi(_):z[0].$el_text=mi(_)),et){z[0].attr__href=et;let n=null===(h=rt(et))||void 0===h?void 0:h.host,l=null==j||null===(f=j.location)||void 0===f?void 0:f.host;n&&l&&n!==l&&(en=et)}if(eo)return!1;let es=D(this._getDefaultProperties(n.type),this._elementsChainAsString?{$elements_chain:function(n){let l=n.map(n=>{var l,u;let d="";if(n.tag_name&&(d+=n.tag_name),n.attr_class)for(let l of(n.attr_class.sort(),n.attr_class))d+=`.${l.replace(/"/g,"")}`;let h={...n.text?{text:n.text}:{},"nth-child":null!==(l=n.nth_child)&&void 0!==l?l:0,"nth-of-type":null!==(u=n.nth_of_type)&&void 0!==u?u:0,...n.href?{href:n.href}:{},...n.attr_id?{attr_id:n.attr_id}:{},...n.attributes},f={};return N(h).sort((n,l)=>{let[u]=n,[d]=l;return u.localeCompare(d)}).forEach(n=>{let[l,u]=n;return f[Ni(l.toString())]=Ni(u.toString())}),d+=":"+N(h).map(n=>{let[l,u]=n;return`${l}="${u}"`}).join("")});return l.join(";")}(z.map(n=>{var l,u;let d={text:null===(l=n.$el_text)||void 0===l?void 0:l.slice(0,400),tag_name:n.tag_name,href:null===(u=n.attr__href)||void 0===u?void 0:u.slice(0,2048),attr_class:function(n){let l=n.attr__class;return l?ev(l)?l:gi(l):void 0}(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return N(n).filter(n=>{let[l]=n;return 0===l.indexOf("attr__")}).forEach(n=>{let[l,u]=n;return d.attributes[l]=u}),d}))}:{$elements:z},null!==(u=z[0])&&void 0!==u&&u.$el_text?{$el_text:null===(d=z[0])||void 0===d?void 0:d.$el_text}:{},en&&"click"===n.type?{$external_click_url:en}:{},ee),el=this.getElementSelectors(_);if(el&&el.length>0&&(es.$element_selectors=el),g===r4){let l=vi(null==j||null===(m=j.getSelection())||void 0===m?void 0:m.toString()),u=n.type||"clipboard";if(!l)return!1;es.$selected_content=l,es.$copy_type=u}return this.instance.capture(g,es),!0}}isBrowserSupported(){return b(null==eo?void 0:eo.querySelectorAll)}};let qn=class qn{_restoreXHRPatch=void 0;_restoreFetchPatch=void 0;constructor(n){this.instance=n}_loadScript(n){var l,u,d;null!==(l=ep.__PosthogExtensions__)&&void 0!==l&&l.tracingHeadersPatchFns&&n(),null===(u=ep.__PosthogExtensions__)||void 0===u||null===(d=u.loadExternalDependency)||void 0===d||d.call(u,this.instance,"tracing-headers",l=>{if(l)return eS.error("[TRACING-HEADERS] failed to load script",l);n()})}startIfEnabledOrStop(){var n,l;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(n=this._restoreXHRPatch)||void 0===n||n.call(this),null===(l=this._restoreFetchPatch)||void 0===l||l.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}_startCapturing=()=>{var n,l,u,d;S(this._restoreXHRPatch)&&(null===(n=ep.__PosthogExtensions__)||void 0===n||null===(l=n.tracingHeadersPatchFns)||void 0===l||l._patchXHR(this.instance.sessionManager)),S(this._restoreFetchPatch)&&(null===(u=ep.__PosthogExtensions__)||void 0===u||null===(d=u.tracingHeadersPatchFns)||void 0===d||d._patchFetch(this.instance.sessionManager))}};(rs=_||(_={}))[rs.PENDING=-1]="PENDING",rs[rs.DENIED=0]="DENIED",rs[rs.GRANTED=1]="GRANTED";let Bn=class Bn{constructor(n){this.instance=n}get config(){return this.instance.config}get consent(){return this.getDnt()?_.DENIED:this.storedConsent}isOptedOut(){return this.consent===_.DENIED||this.consent===_.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(n){this.storage.set(this.storageKey,n?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){let{token:n,opt_out_capturing_cookie_prefix:l}=this.instance.config;return(l||"__ph_opt_in_out_")+n}get storedConsent(){let n=this.storage.get(this.storageKey);return"1"===n?_.GRANTED:"0"===n?_.DENIED:_.PENDING}get storage(){if(!this._storage){let n=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===n?ta:to;let l="localStorage"===n?to:ta;l.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===l.get(this.storageKey)),l.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!Q([null==en?void 0:en.doNotTrack,null==en?void 0:en.msDoNotTrack,ep.doNotTrack],n=>q([!0,1,"1","yes"],n))}};let r9="[Exception Autocapture]";let Un=class Un{originalOnUnhandledRejectionHandler=void 0;constructor(n){var l;this.instance=n,this.remoteEnabled=!(null===(l=this.instance.persistence)||void 0===l||!l.props[eC]),this.startIfEnabled()}get isEnabled(){var n;return null!==(n=this.remoteEnabled)&&void 0!==n&&n}get isCapturing(){var n;return!(null==j||null===(n=j.onerror)||void 0===n||!n.__POSTHOG_INSTRUMENTED__)}get hasHandlers(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}startIfEnabled(){this.isEnabled&&!this.isCapturing&&(eS.info(r9+" enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(n){var l,u;this.hasHandlers&&n(),null===(l=ep.__PosthogExtensions__)||void 0===l||null===(u=l.loadExternalDependency)||void 0===u||u.call(l,this.instance,"exception-autocapture",l=>{if(l)return eS.error(r9+" failed to load script",l);n()})}startCapturing=()=>{var n,l,u,d;if(!j||!this.isEnabled||this.hasHandlers||this.isCapturing)return;let h=null===(n=ep.__PosthogExtensions__)||void 0===n||null===(l=n.errorWrappingFunctions)||void 0===l?void 0:l.wrapOnError,f=null===(u=ep.__PosthogExtensions__)||void 0===u||null===(d=u.errorWrappingFunctions)||void 0===d?void 0:d.wrapUnhandledRejection;if(h&&f)try{this.unwrapOnError=h(this.captureException.bind(this)),this.unwrapUnhandledRejection=f(this.captureException.bind(this))}catch(n){eS.error(r9+" failed to start",n),this.stopCapturing()}else eS.error(r9+" failed to load error wrapping functions - cannot start")};stopCapturing(){var n,l;null===(n=this.unwrapOnError)||void 0===n||n.call(this),null===(l=this.unwrapUnhandledRejection)||void 0===l||l.call(this)}afterDecideResponse(n){let l=n.autocaptureExceptions;this.remoteEnabled=!!l,this.instance.persistence&&this.instance.persistence.register({[eC]:this.remoteEnabled}),this.startIfEnabled()}captureException(n){let l=this.instance.requestRouter.endpointFor("ui");n.$exception_personURL=`${l}/project/${this.instance.config.token}/person/${this.instance.get_distinct_id()}`,this.instance.exceptions.sendExceptionEvent(n)}};let r6="[Web Vitals]";let Vn=class Vn{_enabledServerSide=!1;_initialized=!1;buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0};constructor(n){var l;this.instance=n,this._enabledServerSide=!(null===(l=this.instance.persistence)||void 0===l||!l.props[ex]),this.startIfEnabled()}get allowedMetrics(){var n,l;let u=y(this.instance.config.capture_performance)?null===(n=this.instance.config.capture_performance)||void 0===n?void 0:n.web_vitals_allowed_metrics:void 0;return S(u)?(null===(l=this.instance.persistence)||void 0===l?void 0:l.props[eM])||["CLS","FCP","INP","LCP"]:u}get flushToCaptureTimeoutMs(){return(y(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){let n=y(this.instance.config.capture_performance)&&F(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<n&&n<=6e4?9e5:n}get isEnabled(){let n=y(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return R(n)?n:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(eS.info(r6+" enabled, starting..."),this.loadScript(this._startCapturing))}afterDecideResponse(n){let l=y(n.capturePerformance)&&!!n.capturePerformance.web_vitals,u=y(n.capturePerformance)?n.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[ex]:l}),this.instance.persistence.register({[eM]:u})),this._enabledServerSide=l,this.startIfEnabled()}loadScript(n){var l,u,d;null!==(l=ep.__PosthogExtensions__)&&void 0!==l&&l.postHogWebVitalsCallbacks&&n(),null===(u=ep.__PosthogExtensions__)||void 0===u||null===(d=u.loadExternalDependency)||void 0===d||d.call(u,this.instance,"web-vitals",l=>{l?eS.error(r6+" failed to load script",l):n()})}_currentURL(){let n=j?j.location.href:void 0;return n||eS.error(r6+"Could not determine current URL"),n}_flushToCapture=()=>{clearTimeout(this._delayedFlushTimer),0!==this.buffer.metrics.length&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce((n,l)=>({...n,[`$web_vitals_${l.name}_event`]:{...l},[`$web_vitals_${l.name}_value`]:l.value}),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})};_addToBuffer=n=>{var l;let u=null===(l=this.instance.sessionManager)||void 0===l?void 0:l.checkAndGetSessionAndWindowId(!0);if(S(u))return void eS.error(r6+"Could not read session ID. Dropping metrics!");this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};let d=this._currentURL();if(!S(d)){if(I(null==n?void 0:n.name)||I(null==n?void 0:n.value))return void eS.error(r6+"Invalid metric received",n);if(this._maxAllowedValue&&n.value>=this._maxAllowedValue)return void eS.error(r6+"Ignoring metric with value >= "+this._maxAllowedValue,n);this.buffer.url!==d&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),S(this.buffer.url)&&(this.buffer.url=d),this.buffer.firstMetricTimestamp=S(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.buffer.metrics.push({...n,$current_url:d,$session_id:u.sessionId,$window_id:u.windowId,timestamp:Date.now()}),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()}};_startCapturing=()=>{let n,l,u,d;let h=ep.__PosthogExtensions__;S(h)||S(h.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:l,onFCP:u,onINP:d}=h.postHogWebVitalsCallbacks),n&&l&&u&&d?(this.allowedMetrics.indexOf("LCP")>-1&&n(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&l(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&u(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&d(this._addToBuffer.bind(this)),this._initialized=!0):eS.error(r6+"web vitals callbacks not loaded - not starting")}};let r7={icontains:(n,l)=>!!j&&l.href.toLowerCase().indexOf(n.toLowerCase())>-1,not_icontains:(n,l)=>!!j&&-1===l.href.toLowerCase().indexOf(n.toLowerCase()),regex:(n,l)=>!!j&&ot(l.href,n),not_regex:(n,l)=>!!j&&!ot(l.href,n),exact:(n,l)=>l.href===n,is_not:(n,l)=>l.href!==n};let jn=class jn{constructor(n){this.instance=n,this.instance.onFeatureFlags&&this.instance.onFeatureFlags(n=>{this.applyFeatureFlagChanges(n)}),this._flagToExperiments=new Map}applyFeatureFlagChanges(n){I(this._flagToExperiments)||this.instance.config.disable_web_experiments||(jn.logInfo("applying feature flags",n),n.forEach(n=>{var l,u;if(this._flagToExperiments&&null!==(l=this._flagToExperiments)&&void 0!==l&&l.has(n)){let l=this.instance.getFeatureFlag(n),d=null===(u=this._flagToExperiments)||void 0===u?void 0:u.get(n);l&&null!=d&&d.variants[l]&&this.applyTransforms(d.name,l,d.variants[l].transforms)}}))}afterDecideResponse(n){this._is_bot()?jn.logInfo("Refusing to render web experiment since the viewer is a likely bot"):(this._featureFlags=n.featureFlags,this.loadIfEnabled(),this.previewWebExperiment())}previewWebExperiment(){let n=jn.getWindowLocation();if(null!=n&&n.search){let l=lt(null==n?void 0:n.search,"__experiment_id"),u=lt(null==n?void 0:n.search,"__experiment_variant");l&&u&&(jn.logInfo(`previewing web experiments ${l} && ${u}`),this.getWebExperiments(n=>{this.showPreviewWebExperiment(parseInt(l),u,n)},!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperimentsAndEvaluateDisplayLogic=(()=>{var n=this;return function(){let l=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.getWebExperiments(l=>{jn.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,l.forEach(l=>{if(l.feature_flag_key&&n._featureFlags&&n._featureFlags[l.feature_flag_key]){var u;n._flagToExperiments&&(jn.logInfo("setting flag key ",l.feature_flag_key," to web experiment ",l),null===(u=n._flagToExperiments)||void 0===u||u.set(l.feature_flag_key,l));let d=n._featureFlags[l.feature_flag_key];d&&l.variants[d]&&n.applyTransforms(l.name,d,l.variants[d].transforms)}else if(l.variants)for(let u in l.variants){let d=l.variants[u];jn.matchesTestVariant(d)&&n.applyTransforms(l.name,u,d.transforms)}})},l)}})();getWebExperiments(n,l,u){if(this.instance.config.disable_web_experiments&&!u)return n([]);let d=this.instance.get_property("$web_experiments");if(d&&!l)return n(d);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.instance.config.token}`),method:"GET",transport:"XHR",callback:l=>{if(200!==l.statusCode||!l.json)return n([]);let u=l.json.experiments||[];return n(u)}})}showPreviewWebExperiment(n,l,u){let d=u.filter(l=>l.id===n);d&&d.length>0&&(jn.logInfo(`Previewing web experiment [${d[0].name}] with variant [${l}]`),this.applyTransforms(d[0].name,l,d[0].variants[l].transforms,!0))}static matchesTestVariant(n){return!I(n.conditions)&&jn.matchUrlConditions(n)&&jn.matchUTMConditions(n)}static matchUrlConditions(n){var l,u,d,h;if(I(n.conditions)||I(null===(l=n.conditions)||void 0===l?void 0:l.url))return!0;let f=jn.getWindowLocation();return!!f&&(null===(u=n.conditions)||void 0===u||!u.url||r7[null!==(d=null===(h=n.conditions)||void 0===h?void 0:h.urlMatchType)&&void 0!==d?d:"icontains"](n.conditions.url,f))}static getWindowLocation(){return null==j?void 0:j.location}static matchUTMConditions(n){var l,u,d,h,f,m,g,_,j,$,z,ee,et,en,eo,es,el;if(I(n.conditions)||I(null===(l=n.conditions)||void 0===l?void 0:l.utm))return!0;let eu=t7.campaignParams();if(eu.utm_source){let l=null===(u=n.conditions)||void 0===u||null===(d=u.utm)||void 0===d||!d.utm_campaign||(null===(h=n.conditions)||void 0===h||null===(f=h.utm)||void 0===f?void 0:f.utm_campaign)==eu.utm_campaign,ec=null===(m=n.conditions)||void 0===m||null===(g=m.utm)||void 0===g||!g.utm_source||(null===(_=n.conditions)||void 0===_||null===(j=_.utm)||void 0===j?void 0:j.utm_source)==eu.utm_source,eh=null===($=n.conditions)||void 0===$||null===(z=$.utm)||void 0===z||!z.utm_medium||(null===(ee=n.conditions)||void 0===ee||null===(et=ee.utm)||void 0===et?void 0:et.utm_medium)==eu.utm_medium,ep=null===(en=n.conditions)||void 0===en||null===(eo=en.utm)||void 0===eo||!eo.utm_term||(null===(es=n.conditions)||void 0===es||null===(el=es.utm)||void 0===el?void 0:el.utm_term)==eu.utm_term;return l&&eh&&ep&&ec}return!1}static logInfo(n){for(var l=arguments.length,u=Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];eS.info(`[WebExperiments] ${n}`,u)}applyTransforms(n,l,u,d){var h;this._is_bot()?jn.logInfo("Refusing to render web experiment since the viewer is a likely bot"):"control"!==l?u.forEach(u=>{if(u.selector){var h,f;jn.logInfo(`applying transform of variant ${l} for experiment ${n} `,u);let m=0,g=null===(h=document)||void 0===h?void 0:h.querySelectorAll(u.selector);null==g||g.forEach(n=>{m+=1,u.attributes&&u.attributes.forEach(l=>{switch(l.name){case"text":n.innerText=l.value;break;case"html":n.innerHTML=l.value;break;case"cssClass":n.className=l.value;break;default:n.setAttribute(l.name,l.value)}}),u.text&&(n.innerText=u.text),u.html&&(n.parentElement?n.parentElement.innerHTML=u.html:n.innerHTML=u.html),u.css&&n.setAttribute("style",u.css)}),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:n,$web_experiment_variant:l,$web_experiment_preview:d,$web_experiment_document_url:null===(f=jn.getWindowLocation())||void 0===f?void 0:f.href,$web_experiment_elements_modified:m})}}):(jn.logInfo("Control variants leave the page unmodified."),this.instance&&this.instance.capture&&this.instance.capture("$web_experiment_applied",{$web_experiment_name:n,$web_experiment_preview:d,$web_experiment_variant:l,$web_experiment_document_url:null===(h=jn.getWindowLocation())||void 0===h?void 0:h.href,$web_experiment_elements_modified:0}))}_is_bot(){return en&&this.instance?$n(en,this.instance.config.custom_blocked_useragents):void 0}};let Jn=class Jn{constructor(n){var l;this.instance=n,this._endpointSuffix=(null===(l=this.instance.persistence)||void 0===l?void 0:l.props[ek])||"/e/"}get endpoint(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}afterDecideResponse(n){let l=n.autocaptureExceptions;this._endpointSuffix=y(l)&&l.endpoint||"/e/",this.instance.persistence&&this.instance.persistence.register({[ek]:this._endpointSuffix})}sendExceptionEvent(n){this.instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}};let r8={},Xn=()=>{},ne="posthog",nt=!rQ&&-1===(null==eh?void 0:eh.indexOf("MSIE"))&&-1===(null==eh?void 0:eh.indexOf("Mozilla")),er=()=>{var n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(n){let l=null==n?void 0:n.hostname;return!!E(l)&&"herokuapp.com"!==l.split(".").slice(-2).join(".")}(null==eo?void 0:eo.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Xn,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:es&&E(null==es?void 0:es.search)&&-1!==es.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==j||null===(n=j.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:n=>{let l="Bad HTTP status: "+n.statusCode+" "+n.text;eS.error(l)},get_device_id:n=>n,_onCapture:Xn,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",__add_tracing_headers:!1}},tr=n=>{let l={};S(n.process_person)||(l.person_profiles=n.process_person),S(n.xhr_headers)||(l.request_headers=n.xhr_headers),S(n.cookie_name)||(l.persistence_name=n.cookie_name),S(n.disable_cookie)||(l.disable_persistence=n.disable_cookie);let u=D({},l,n);return ev(n.property_blacklist)&&(S(n.property_denylist)?u.property_denylist=n.property_blacklist:ev(n.property_denylist)?u.property_denylist=[...n.property_blacklist,...n.property_denylist]:eS.error("Invalid value for property_denylist config: "+n.property_denylist)),u};let ir=class ir{get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(n){eS.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=n}__forceAllowLocalhost=!1};let sr=class sr{webPerformance=new ir;version=ef.LIB_VERSION;_internalEventEmitter=new bn;constructor(){this.config=er(),this.decideEndpointWasHit=!1,this.SentryIntegration=hn,this.sentryIntegration=n=>(function(n,l){let u=dn(n,l);return{name:r1,processEvent:n=>u(n)}})(this,n),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this.featureFlags=new Oe(this),this.toolbar=new js(this),this.scrollManager=new An(this),this.pageViewManager=new gn(this),this.surveys=new xn(this),this.experiments=new jn(this),this.exceptions=new Jn(this),this.rateLimiter=new kn(this),this.requestRouter=new cn(this),this.consent=new Bn(this),this.people={set:(n,l,u)=>{let d=E(n)?{[n]:l}:n;this.setPersonProperties(d),null==u||u({})},set_once:(n,l,u)=>{let d=E(n)?{[n]:l}:n;this.setPersonProperties(void 0,d),null==u||u({})}},this.on("eventCaptured",n=>eS.info(`send "${null==n?void 0:n.event}"`,n))}init(n,l,u){if(u&&u!==ne){var d;let h=null!==(d=r8[u])&&void 0!==d?d:new sr;return h._init(n,l,u),r8[u]=h,r8[ne][u]=h,h}return this._init(n,l,u)}_init(n){var l,u,h,f,m,g;let _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},$=arguments.length>2?arguments[2]:void 0;if(S(n)||x(n))return eS.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return eS.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],_.person_profiles&&(this._initialPersonProfilesConfig=_.person_profiles),this.set_config(D({},er(),tr(_),{name:$,token:n})),this.config.on_xhr_error&&eS.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=_.disable_compression?void 0:d.GZipJS,this.persistence=new ci(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new ci({...this.config,persistence:"sessionStorage"});let z={...this.persistence.props},ee={...this.sessionPersistence.props};if(this._requestQueue=new Qs(n=>this._send_retriable_request(n)),this._retryQueue=new nn(this),this.__request_queue=[],this.sessionManager=new on(this.config,this.persistence),this.sessionPropsManager=new Fn(this.sessionManager,this.persistence),new qn(this).startIfEnabledOrStop(),this.sessionRecording=new Us(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Dn(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Mn(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Vn(this),this.exceptionObserver=new Un(this),this.exceptionObserver.startIfEnabled(),ef.DEBUG=ef.DEBUG||this.config.debug,ef.DEBUG&&eS.info("Starting in debug mode",{this:this,config:_,thisC:{...this.config},p:z,s:ee}),this._sync_opt_out_with_persistence(),void 0!==(null===(l=_.bootstrap)||void 0===l?void 0:l.distinctID)){let n=this.config.get_device_id(We()),l=null!==(h=_.bootstrap)&&void 0!==h&&h.isIdentifiedID?n:_.bootstrap.distinctID;this.persistence.set_property(eQ,null!==(f=_.bootstrap)&&void 0!==f&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:_.bootstrap.distinctID,$device_id:l})}if(this._hasBootstrappedFeatureFlags()){let n=Object.keys((null===(m=_.bootstrap)||void 0===m?void 0:m.featureFlags)||{}).filter(n=>{var l,u;return!(null===(l=_.bootstrap)||void 0===l||null===(u=l.featureFlags)||void 0===u||!u[n])}).reduce((n,l)=>{var u,d;return n[l]=(null===(u=_.bootstrap)||void 0===u||null===(d=u.featureFlags)||void 0===d?void 0:d[l])||!1,n},{}),l=Object.keys((null===(g=_.bootstrap)||void 0===g?void 0:g.featureFlagPayloads)||{}).filter(l=>n[l]).reduce((n,l)=>{var u,d,h,f;return null!==(u=_.bootstrap)&&void 0!==u&&null!==(d=u.featureFlagPayloads)&&void 0!==d&&d[l]&&(n[l]=null===(h=_.bootstrap)||void 0===h||null===(f=h.featureFlagPayloads)||void 0===f?void 0:f[l]),n},{});this.featureFlags.receivedFeatureFlags({featureFlags:n,featureFlagPayloads:l})}if(!this.get_distinct_id()){let n=this.config.get_device_id(We());this.register_once({distinct_id:n,$device_id:n},""),this.persistence.set_property(eQ,"anonymous")}return null==j||null===(u=j.addEventListener)||void 0===u||u.call(j,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),_.segment?function(n,l){let u=n.config.segment;if(!u)return l();!function(n,l){let u=n.config.segment;if(!u)return l();let s=u=>{let s=()=>u.anonymousId()||We();n.config.get_device_id=s,u.id()&&(n.register({distinct_id:u.id(),$device_id:s()}),n.persistence.set_property(eQ,"identified")),l()},d=u.user();"then"in d&&b(d.then)?d.then(n=>s(n)):s(d)}(n,()=>{u.register((n=>{Promise&&Promise.resolve||eS.warn("This browser does not have Promise support, and can not use the segment integration");let t=(l,u)=>{var d;if(!u)return l;l.event.userId||l.event.anonymousId===n.get_distinct_id()||(eS.info("Segment integration does not have a userId set, resetting PostHog"),n.reset()),l.event.userId&&l.event.userId!==n.get_distinct_id()&&(eS.info("Segment integration has a userId set, identifying with PostHog"),n.identify(l.event.userId));let h=n._calculate_event_properties(u,null!==(d=l.event.properties)&&void 0!==d?d:{},new Date);return l.event.properties=Object.assign({},h,l.event.properties),l};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>t(n,n.event.event),page:n=>t(n,"$pageview"),identify:n=>t(n,"$identify"),screen:n=>t(n,"$screen")}})(n)).then(()=>{l()})})}(this,()=>this._loaded()):this._loaded(),b(this.config._onCapture)&&this.on("eventCaptured",n=>this.config._onCapture(n.event,n)),this}_afterDecideResponse(n){var l,u,h,f,m,g,_,j,$;this.compression=void 0,n.supportedCompression&&!this.config.disable_compression&&(this.compression=q(n.supportedCompression,d.GZipJS)?d.GZipJS:q(n.supportedCompression,d.Base64)?d.Base64:void 0),null!==(l=n.analytics)&&void 0!==l&&l.endpoint&&(this.analyticsDefaultEndpoint=n.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:n.defaultIdentifiedOnly?"identified_only":"always"}),null===(u=this.sessionRecording)||void 0===u||u.afterDecideResponse(n),null===(h=this.autocapture)||void 0===h||h.afterDecideResponse(n),null===(f=this.heatmaps)||void 0===f||f.afterDecideResponse(n),null===(m=this.experiments)||void 0===m||m.afterDecideResponse(n),null===(g=this.surveys)||void 0===g||g.afterDecideResponse(n),null===(_=this.webVitalsAutocapture)||void 0===_||_.afterDecideResponse(n),null===(j=this.exceptions)||void 0===j||j.afterDecideResponse(n),null===($=this.exceptionObserver)||void 0===$||$.afterDecideResponse(n)}_loaded(){let n=this.config.advanced_disable_decide;n||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(n){eS.critical("`loaded` function failed",n)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this._captureInitialPageview()},1),n||(new Ws(this).call(),this.featureFlags.resetRequestQueue())}_start_queue_if_opted_in(){var n;this.has_opted_out_capturing()||this.config.request_batching&&(null===(n=this._requestQueue)||void 0===n||n.enable())}_dom_loaded(){this.has_opted_out_capturing()||L(this.__request_queue,n=>this._send_retriable_request(n)),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var n,l;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(n=this._requestQueue)||void 0===n||n.unload(),null===(l=this._retryQueue)||void 0===l||l.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(n){this.__loaded&&(nt?this.__request_queue.push(n):this.rateLimiter.isServerRateLimited(n.batchKey)||(n.transport=n.transport||this.config.api_transport,n.url=Xs(n.url,{ip:this.config.ip?1:0}),n.headers={...this.config.request_headers},n.compression="best-available"===n.compression?this.compression:n.compression,(n=>{var l,u,d;let h={...n};h.timeout=h.timeout||6e4,h.url=Xs(h.url,{_:(new Date).getTime().toString(),ver:ef.LIB_VERSION,compression:h.compression});let f=null!==(l=h.transport)&&void 0!==l?l:"XHR",m=null!==(u=null===(d=Q(rZ,n=>n.transport===f))||void 0===d?void 0:d.method)&&void 0!==u?u:rZ[0].method;if(!m)throw Error("No available transport method");m(h)})({...n,callback:l=>{var u,d,h;this.rateLimiter.checkForLimiting(l),l.statusCode>=400&&(null===(d=(h=this.config).on_request_error)||void 0===d||d.call(h,l)),null===(u=n.callback)||void 0===u||u.call(n,l)}})))}_send_retriable_request(n){this._retryQueue?this._retryQueue.retriableRequest(n):this._send_request(n)}_execute_array(n){let l;let u=[],d=[],h=[];L(n,n=>{n&&(ev(l=n[0])?h.push(n):b(n)?n.call(this):ev(n)&&"alias"===l?u.push(n):ev(n)&&-1!==l.indexOf("capture")&&b(this[l])?h.push(n):d.push(n))});let r=function(n,l){L(n,function(n){if(ev(n[0])){let u=l;O(n,function(n){u=u[n[0]].apply(u,n.slice(1))})}else this[n[0]].apply(this,n.slice(1))},l)};r(u,this),r(d,this),r(h,this)}_hasBootstrappedFeatureFlags(){var n,l;return(null===(n=this.config.bootstrap)||void 0===n?void 0:n.featureFlags)&&Object.keys(null===(l=this.config.bootstrap)||void 0===l?void 0:l.featureFlags).length>0||!1}push(n){this._execute_array([n])}capture(n,l,u){var d,h,f;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return void eS.uninitializedWarning("posthog.capture");if(this.consent.isOptedOut())return;if(S(n)||!E(n))return void eS.error("No event name provided to posthog.capture");if(!this.config.opt_out_useragent_filter&&this._is_bot())return;let m=null!=u&&u.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=m&&m.isRateLimited)return void eS.critical("This capture call is ignored due to client rate limiting.");this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();let g=new Date,_=(null==u?void 0:u.timestamp)||g,j={uuid:We(),event:n,properties:this._calculate_event_properties(n,l||{},_)};m&&(j.properties.$lib_rate_limit_remaining_tokens=m.remainingTokens),(null==u?void 0:u.$set)&&(j.$set=null==u?void 0:u.$set);let $=this._calculate_set_once_properties(null==u?void 0:u.$set_once);$&&(j.$set_once=$),h=j,f=null!=u&&u._noTruncate?null:this.config.properties_string_max_length,(j=function(n,l){let u=new Set;return function e(n,d){let h;return n!==Object(n)?l?l(n,d):n:u.has(n)?void 0:(u.add(n),ev(n)?(h=[],L(n,n=>{h.push(e(n))})):(h={},O(n,(n,l)=>{u.has(n)||(h[l]=e(n,l))})),h)}(n)}(h,n=>E(n)&&!k(f)?n.slice(0,f):n)).timestamp=_,S(null==u?void 0:u.timestamp)||(j.properties.$event_time_override_provided=!0,j.properties.$event_time_override_system_time=g);let z={...j.properties.$set,...j.$set};w(z)||this.setPersonPropertiesForFlags(z),this._internalEventEmitter.emit("eventCaptured",j);let ee={method:"POST",url:null!==(d=null==u?void 0:u._url)&&void 0!==d?d:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:j,compression:"best-available",batchKey:null==u?void 0:u._batchKey};return!this.config.request_batching||u&&(null==u||!u._batchKey)||null!=u&&u.send_instantly?this._send_retriable_request(ee):this._requestQueue.enqueue(ee),j}_addCaptureHook(n){return this.on("eventCaptured",l=>n(l.event,l))}_calculate_event_properties(n,l,u){if(u=u||new Date,!this.persistence||!this.sessionPersistence)return l;let d=this.persistence.remove_event_timer(n),f={...l};if(f.token=this.config.token,"$snapshot"===n){let n={...this.persistence.properties(),...this.sessionPersistence.properties()};return f.distinct_id=n.distinct_id,(!E(f.distinct_id)&&!F(f.distinct_id)||x(f.distinct_id))&&eS.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),f}let m=t7.properties();if(this.sessionManager){let{sessionId:n,windowId:l}=this.sessionManager.checkAndGetSessionAndWindowId();f.$session_id=n,f.$window_id=l}if(this.requestRouter.region===h.CUSTOM&&(f.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===n||"$pageleave"===n||"$autocapture"===n)){let n=this.sessionPropsManager.getSessionProps();f=D(f,n)}if(!this.config.disable_scroll_properties){let l={};"$pageview"===n?l=this.pageViewManager.doPageView(u):"$pageleave"===n&&(l=this.pageViewManager.doPageLeave(u)),f=D(f,l)}if("$pageview"===n&&eo&&(f.title=eo.title),!S(d)){let n=u.getTime()-d;f.$duration=parseFloat((n/1e3).toFixed(3))}eh&&this.config.opt_out_useragent_filter&&(f.$browser_type=this._is_bot()?"bot":"browser"),(f=D({},m,this.persistence.properties(),this.sessionPersistence.properties(),f)).$is_identified=this._isIdentified(),ev(this.config.property_denylist)?O(this.config.property_denylist,function(n){delete f[n]}):eS.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let g=this.config.sanitize_properties;g&&(f=g(f,n));let _=this._hasPersonProcessing();return f.$process_person_profile=_,_&&this._requirePersonProcessing("_calculate_event_properties"),f}_calculate_set_once_properties(n){if(!this.persistence||!this._hasPersonProcessing())return n;let l=D({},this.persistence.get_initial_props(),n||{}),u=this.config.sanitize_properties;return u&&(l=u(l,"$set_once")),w(l)?void 0:l}register(n,l){var u;null===(u=this.persistence)||void 0===u||u.register(n,l)}register_once(n,l,u){var d;null===(d=this.persistence)||void 0===d||d.register_once(n,l,u)}register_for_session(n){var l;null===(l=this.sessionPersistence)||void 0===l||l.register(n)}unregister(n){var l;null===(l=this.persistence)||void 0===l||l.unregister(n)}unregister_for_session(n){var l;null===(l=this.sessionPersistence)||void 0===l||l.unregister(n)}_register_single(n,l){this.register({[n]:l})}getFeatureFlag(n,l){return this.featureFlags.getFeatureFlag(n,l)}getFeatureFlagPayload(n){let l=this.featureFlags.getFeatureFlagPayload(n);try{return JSON.parse(l)}catch{return l}}isFeatureEnabled(n,l){return this.featureFlags.isFeatureEnabled(n,l)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(n,l){this.featureFlags.updateEarlyAccessFeatureEnrollment(n,l)}getEarlyAccessFeatures(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(n,l)}on(n,l){return this._internalEventEmitter.on(n,l)}onFeatureFlags(n){return this.featureFlags.onFeatureFlags(n)}onSessionId(n){var l,u;return null!==(l=null===(u=this.sessionManager)||void 0===u?void 0:u.onSessionId(n))&&void 0!==l?l:()=>{}}getSurveys(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(n,l)}getActiveMatchingSurveys(n){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(n,l)}renderSurvey(n,l){this.surveys.renderSurvey(n,l)}canRenderSurvey(n){this.surveys.canRenderSurvey(n)}getNextSurveyStep(n,l,u){return this.surveys.getNextSurveyStep(n,l,u)}identify(n,l,u){if(!this.__loaded||!this.persistence)return eS.uninitializedWarning("posthog.identify");if(F(n)&&(n=n.toString(),eS.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!n)return void eS.error("Unique user id has not been set in posthog.identify");if(["distinct_id","distinctid"].includes(n.toLowerCase()))return void eS.critical(`The string "${n}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`);if(!this._requirePersonProcessing("posthog.identify"))return;let d=this.get_distinct_id();this.register({$user_id:n}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:d},""),n!==d&&n!==this.get_property(eR)&&(this.unregister(eR),this.register({distinct_id:n}));let h="anonymous"===(this.persistence.get_property(eQ)||"anonymous");n!==d&&h?(this.persistence.set_property(eQ,"identified"),this.setPersonPropertiesForFlags(l||{},!1),this.capture("$identify",{distinct_id:n,$anon_distinct_id:d},{$set:l||{},$set_once:u||{}}),this.featureFlags.setAnonymousDistinctId(d)):(l||u)&&this.setPersonProperties(l,u),n!==d&&(this.reloadFeatureFlags(),this.unregister(eY))}setPersonProperties(n,l){(n||l)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(n||{}),this.capture("$set",{$set:n||{},$set_once:l||{}}))}group(n,l,u){if(!n||!l)return void eS.error("posthog.group requires a group type and group key");if(!this._requirePersonProcessing("posthog.group"))return;let d=this.getGroups();d[n]!==l&&this.resetGroupPropertiesForFlags(n),this.register({$groups:{...d,[n]:l}}),u&&(this.capture("$groupidentify",{$group_type:n,$group_key:l,$group_set:u}),this.setGroupPropertiesForFlags({[n]:u})),d[n]===l||u||this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(n){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(n,l)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(n){let l=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(n,l)}resetGroupPropertiesForFlags(n){this.featureFlags.resetGroupPropertiesForFlags(n)}reset(n){var l,u,d,h;if(eS.info("reset"),!this.__loaded)return eS.uninitializedWarning("posthog.reset");let f=this.get_property("$device_id");this.consent.reset(),null===(l=this.persistence)||void 0===l||l.clear(),null===(u=this.sessionPersistence)||void 0===u||u.clear(),null===(d=this.persistence)||void 0===d||d.set_property(eQ,"anonymous"),null===(h=this.sessionManager)||void 0===h||h.resetSessionId();let m=this.config.get_device_id(We());this.register_once({distinct_id:m,$device_id:n?m:f},"")}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var n,l;return null!==(n=null===(l=this.sessionManager)||void 0===l?void 0:l.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==n?n:""}get_session_replay_url(n){if(!this.sessionManager)return"";let{sessionId:l,sessionStartTimestamp:u}=this.sessionManager.checkAndGetSessionAndWindowId(!0),d=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${l}`);if(null!=n&&n.withTimestamp&&u){var h;let l=null!==(h=n.timestampLookBack)&&void 0!==h?h:10;if(!u)return d;d+=`?t=${Math.max(Math.floor(((new Date).getTime()-u)/1e3)-l,0)}`}return d}alias(n,l){return n===this.get_property(eI)?(eS.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(S(l)&&(l=this.get_distinct_id()),n!==l?(this._register_single(eR,n),this.capture("$create_alias",{alias:n,distinct_id:l})):(eS.warn("alias matches current distinct_id - skipping api call."),this.identify(n),-1)):void 0}set_config(n){var l,u,d,h;let f={...this.config};y(n)&&(D(this.config,tr(n)),null===(l=this.persistence)||void 0===l||l.update_config(this.config,f),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new ci({...this.config,persistence:"sessionStorage"}),ta.is_supported()&&"true"===ta.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(ef.DEBUG=!0,eS.info("set_config",{config:n,oldConfig:f,newConfig:{...this.config}})),null===(u=this.sessionRecording)||void 0===u||u.startIfEnabledOrStop(),null===(d=this.autocapture)||void 0===d||d.startIfEnabled(),null===(h=this.heatmaps)||void 0===h||h.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}startSessionRecording(n){let l=R(n)&&n;if(l||null!=n&&n.sampling||null!=n&&n.linked_flag){var u,d,h;let f=null===(u=this.sessionManager)||void 0===u?void 0:u.checkAndGetSessionAndWindowId();(l||null!=n&&n.sampling)&&(null===(d=this.sessionRecording)||void 0===d||d.overrideSampling(),eS.info("Session recording started with sampling override for session: ",null==f?void 0:f.sessionId)),(l||null!=n&&n.linked_flag)&&(null===(h=this.sessionRecording)||void 0===h||h.overrideLinkedFlag(),eS.info("Session recording started with linked_flags override"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var n;return!(null===(n=this.sessionRecording)||void 0===n||!n.started)}captureException(n,l){var u;let d=Error("PostHog syntheticException"),h=b(null===(u=ep.__PosthogExtensions__)||void 0===u?void 0:u.parseErrorAsProperties)?ep.__PosthogExtensions__.parseErrorAsProperties([n.message,void 0,void 0,void 0,n],{syntheticException:d}):{$exception_level:"error",$exception_list:[{type:n.name,value:n.message,mechanism:{handled:!0,synthetic:!1}}],...l};this.exceptions.sendExceptionEvent(h)}loadToolbar(n){return this.toolbar.loadToolbar(n)}get_property(n){var l;return null===(l=this.persistence)||void 0===l?void 0:l.props[n]}getSessionProperty(n){var l;return null===(l=this.sessionPersistence)||void 0===l?void 0:l.props[n]}toString(){var n;let l=null!==(n=this.config.name)&&void 0!==n?n:ne;return l!==ne&&(l=ne+"."+l),l}_isIdentified(){var n,l;return"identified"===(null===(n=this.persistence)||void 0===n?void 0:n.get_property(eQ))||"identified"===(null===(l=this.sessionPersistence)||void 0===l?void 0:l.get_property(eQ))}_hasPersonProcessing(){var n,l,u,d;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&w(this.getGroups())&&(null===(n=this.persistence)||void 0===n||null===(l=n.props)||void 0===l||!l[eR])&&(null===(u=this.persistence)||void 0===u||null===(d=u.props)||void 0===d||!d[e3]))}_shouldCapturePageleave(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(n){return"never"===this.config.person_profiles?(eS.error(n+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(e3,!0),!0)}_sync_opt_out_with_persistence(){var n,l,u,d;let h=this.consent.isOptedOut(),f=this.config.opt_out_persistence_by_default,m=this.config.disable_persistence||h&&!!f;(null===(n=this.persistence)||void 0===n?void 0:n.disabled)!==m&&(null===(u=this.persistence)||void 0===u||u.set_disabled(m)),(null===(l=this.sessionPersistence)||void 0===l?void 0:l.disabled)!==m&&(null===(d=this.sessionPersistence)||void 0===d||d.set_disabled(m))}opt_in_capturing(n){var l;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(S(null==n?void 0:n.captureEventName)||null!=n&&n.captureEventName)&&this.capture(null!==(l=null==n?void 0:n.captureEventName)&&void 0!==l?l:"$opt_in",null==n?void 0:n.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return en?$n(en,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){eo&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:eo.title},{send_instantly:!0}))}debug(n){!1===n?(null==j||j.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==j||j.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}};!function(n,l){for(let u=0;u<l.length;u++)n.prototype[l[u]]=H(n.prototype[l[u]])}(sr,["identify"]);let nr=function(){let n=r8[ne]=new sr;return function(){function t(){t.done||(t.done=!0,nt=!1,O(r8,function(n){n._dom_loaded()}))}null!=eo&&eo.addEventListener&&("complete"===eo.readyState?t():eo.addEventListener("DOMContentLoaded",t,!1)),j&&eT(j,"load",t,!0)}(),n}()},20908:function(n,l,u){"use strict";u.d(l,{U0:function(){return usePostHog},zf:function(){return PostHogProvider}});var d=u(63197),h=u(2784),f=(0,h.createContext)({client:d.ZP});function PostHogProvider(n){var l=n.children,u=n.client,m=n.apiKey,g=n.options,_=(0,h.useMemo)(function(){return(u&&m&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),u&&g&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),u)?u:(m&&(d.ZP.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),d.ZP.init(m,g)),d.ZP)},[u,m]);return h.createElement(f.Provider,{value:{client:_}},l)}var usePostHog=function(){return(0,h.useContext)(f).client}},34406:function(n){var l,u,d,h=n.exports={};function defaultSetTimout(){throw Error("setTimeout has not been defined")}function defaultClearTimeout(){throw Error("clearTimeout has not been defined")}function runTimeout(n){if(l===setTimeout)return setTimeout(n,0);if((l===defaultSetTimout||!l)&&setTimeout)return l=setTimeout,setTimeout(n,0);try{return l(n,0)}catch(u){try{return l.call(null,n,0)}catch(u){return l.call(this,n,0)}}}!function(){try{l="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(n){l=defaultSetTimout}try{u="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(n){u=defaultClearTimeout}}();var f=[],m=!1,g=-1;function cleanUpNextTick(){m&&d&&(m=!1,d.length?f=d.concat(f):g=-1,f.length&&drainQueue())}function drainQueue(){if(!m){var n=runTimeout(cleanUpNextTick);m=!0;for(var l=f.length;l;){for(d=f,f=[];++g<l;)d&&d[g].run();g=-1,l=f.length}d=null,m=!1,function(n){if(u===clearTimeout)return clearTimeout(n);if((u===defaultClearTimeout||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(n);try{u(n)}catch(l){try{return u.call(null,n)}catch(l){return u.call(this,n)}}}(n)}}function Item(n,l){this.fun=n,this.array=l}function noop(){}h.nextTick=function(n){var l=Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)l[u-1]=arguments[u];f.push(new Item(n,l)),1!==f.length||m||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=noop,h.addListener=noop,h.once=noop,h.off=noop,h.removeListener=noop,h.removeAllListeners=noop,h.emit=noop,h.prependListener=noop,h.prependOnceListener=noop,h.listeners=function(n){return[]},h.binding=function(n){throw Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(n){throw Error("process.chdir is not supported")},h.umask=function(){return 0}},23493:function(n,l,u){for(var d=u(9057),h="undefined"==typeof window?u.g:window,f=["moz","webkit"],m="AnimationFrame",g=h["request"+m],_=h["cancel"+m]||h["cancelRequest"+m],j=0;!g&&j<f.length;j++)g=h[f[j]+"Request"+m],_=h[f[j]+"Cancel"+m]||h[f[j]+"CancelRequest"+m];if(!g||!_){var $=0,z=0,ee=[],et=1e3/60;g=function(n){if(0===ee.length){var l=d(),u=Math.max(0,et-(l-$));$=u+l,setTimeout(function(){var n=ee.slice(0);ee.length=0;for(var l=0;l<n.length;l++)if(!n[l].cancelled)try{n[l].callback($)}catch(n){setTimeout(function(){throw n},0)}},Math.round(u))}return ee.push({handle:++z,callback:n,cancelled:!1}),z},_=function(n){for(var l=0;l<ee.length;l++)ee[l].handle===n&&(ee[l].cancelled=!0)}}n.exports=function(n){return g.call(h,n)},n.exports.cancel=function(){_.apply(h,arguments)},n.exports.polyfill=function(n){n||(n=h),n.requestAnimationFrame=g,n.cancelAnimationFrame=_}},98728:function(n,l,u){u(23493).polyfill()},63366:function(n){"use strict";n.exports=null},11274:function(n,l,u){"use strict";u.d(l,{PK:function(){return SafeAreaProvider},HB:function(){return useSafeAreaInsets}});var d=u(2784),h=u(39540),f=u(17693),m=u(90605);let g={WebkitTransition:"webkitTransitionEnd",Transition:"transitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd"};function NativeSafeAreaProvider({children:n,style:l,onInsetsChange:u}){return d.useEffect(()=>{if("undefined"==typeof document)return;let n=function(){let n=document.createElement("div"),{style:l}=n;return l.position="fixed",l.left="0",l.top="0",l.width="0",l.height="0",l.zIndex="-1",l.overflow="hidden",l.visibility="hidden",l.transitionDuration="0.05s",l.transitionProperty="padding",l.transitionDelay="0s",l.paddingTop=getInset("top"),l.paddingBottom=getInset("bottom"),l.paddingLeft=getInset("left"),l.paddingRight=getInset("right"),n}();document.body.appendChild(n);let onEnd=()=>{let{paddingTop:l,paddingBottom:d,paddingLeft:h,paddingRight:f}=window.getComputedStyle(n),m={top:l?parseInt(l,10):0,bottom:d?parseInt(d,10):0,left:h?parseInt(h,10):0,right:f?parseInt(f,10):0},g={x:0,y:0,width:document.documentElement.offsetWidth,height:document.documentElement.offsetHeight};u({nativeEvent:{insets:m,frame:g}})};return n.addEventListener(getSupportedTransitionEvent(),onEnd),onEnd(),()=>{document.body.removeChild(n),n.removeEventListener(getSupportedTransitionEvent(),onEnd)}},[u]),d.createElement(m.Z,{style:l},n)}let _=null;function getSupportedTransitionEvent(){if(null!=_)return _;let n=document.createElement("invalidtype");for(let l in _=g.Transition,g)if(void 0!==n.style[l]){_=g[l];break}return _}let j=null;function getInset(n){return`${function(){if(null!==j)return j;let{CSS:n}=window;return j=n&&n.supports&&n.supports("top: constant(safe-area-inset-top)")?"constant":"env"}()}(safe-area-inset-${n})`}function _extends(){return(_extends=Object.assign?Object.assign.bind():function(n){for(var l=1;l<arguments.length;l++){var u=arguments[l];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(n[d]=u[d])}return n}).apply(this,arguments)}let $=d.createContext(null),z=d.createContext(null);function SafeAreaProvider({children:n,initialMetrics:l,initialSafeAreaInsets:u,style:f,...m}){let g=d.useContext($),_=d.useContext(z),[j,et]=d.useState(l?.insets??u??g??null),[en,eo]=d.useState(l?.frame??_??{x:0,y:0,width:h.Z.get("window").width,height:h.Z.get("window").height}),es=d.useCallback(n=>{let{nativeEvent:{frame:l,insets:u}}=n;eo(n=>l&&(l.height!==n.height||l.width!==n.width||l.x!==n.x||l.y!==n.y)?l:n),et(n=>n&&u.bottom===n.bottom&&u.left===n.left&&u.right===n.right&&u.top===n.top?n:u)},[]);return d.createElement(NativeSafeAreaProvider,_extends({style:[ee.fill,f],onInsetsChange:es},m),null!=j?d.createElement(z.Provider,{value:en},d.createElement($.Provider,{value:j},n)):null)}let ee=f.Z.create({fill:{flex:1}});function useSafeAreaInsets(){let n=d.useContext($);if(null==n)throw Error("No safe area value available. Make sure you are rendering `<SafeAreaProvider>` at the top of your app.");return n}$.Consumer},36169:function(n,l){"use strict";l.D=void 0;var u=new WeakMap;function createStyleq(n){var l,d,h;return null!=n&&(l=!0===n.disableCache,d=!0===n.disableMix,h=n.transform),function(){for(var n=[],f="",m=null,g=l?null:u,_=Array(arguments.length),j=0;j<arguments.length;j++)_[j]=arguments[j];for(;_.length>0;){var $=_.pop();if(null!=$&&!1!==$){if(Array.isArray($)){for(var z=0;z<$.length;z++)_.push($[z]);continue}var ee=null!=h?h($):$;if(ee.$$css){var et="";if(null!=g&&g.has(ee)){var en=g.get(ee);null!=en&&(et=en[0],n.push.apply(n,en[1]),g=en[2])}else{var eo=[];for(var es in ee){var el=ee[es];"$$css"===es||("string"==typeof el||null===el?n.includes(es)||(n.push(es),null!=g&&eo.push(es),"string"==typeof el&&(et+=et?" "+el:el)):console.error("styleq: ".concat(es," typeof ").concat(String(el),' is not "string" or "null".')))}if(null!=g){var eu=new WeakMap;g.set(ee,[et,eo,eu]),g=eu}}et&&(f=f?et+" "+f:et)}else if(d)null==m&&(m={}),m=Object.assign({},ee,m);else{var ec=null;for(var eh in ee){var ep=ee[eh];void 0===ep||n.includes(eh)||(null!=ep&&(null==m&&(m={}),null==ec&&(ec={}),ec[eh]=ep),n.push(eh),g=null)}null!=ec&&(m=Object.assign(ec,m))}}}return[f,m]}}var d=createStyleq();l.D=d,d.factory=createStyleq},73699:function(n,l){"use strict";l.j=function(n,l){if(null!=n[d]){var h=l?1:0;if(u.has(n)){var f=u.get(n),m=f[h];return null==m&&(m=compileStyle(n,l),f[h]=m,u.set(n,f)),m}var g=compileStyle(n,l),_=[,,];return _[h]=g,u.set(n,_),g}return n};var u=new WeakMap,d="$$css$localize";function compileStyle(n,l){var u={};for(var h in n)if(h!==d){var f=n[h];Array.isArray(f)?u[h]=l?f[1]:f[0]:u[h]=f}return u}},89565:function(n,l,u){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.YouTubeEmbed=l.GoogleMapsEmbed=l.GoogleAnalytics=void 0;var d=u(77386);Object.defineProperty(l,"GoogleAnalytics",{enumerable:!0,get:function(){return d.GoogleAnalytics}});var h=u(75377);Object.defineProperty(l,"GoogleMapsEmbed",{enumerable:!0,get:function(){return h.GoogleMapsEmbed}});var f=u(82415);Object.defineProperty(l,"YouTubeEmbed",{enumerable:!0,get:function(){return f.YouTubeEmbed}})},77386:function(n,l,u){"use strict";var d=this&&this.__rest||function(n,l){var u={};for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&0>l.indexOf(d)&&(u[d]=n[d]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var h=0,d=Object.getOwnPropertySymbols(n);h<d.length;h++)0>l.indexOf(d[h])&&Object.prototype.propertyIsEnumerable.call(n,d[h])&&(u[d[h]]=n[d[h]]);return u},h=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0}),l.GoogleAnalytics=void 0;let f=h(u(48847)),m=u(35539);l.GoogleAnalytics=n=>{var l=d(n,[]);return(0,m.formatData)(f.default,l)}},75377:function(n,l,u){"use strict";var d=this&&this.__rest||function(n,l){var u={};for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&0>l.indexOf(d)&&(u[d]=n[d]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var h=0,d=Object.getOwnPropertySymbols(n);h<d.length;h++)0>l.indexOf(d[h])&&Object.prototype.propertyIsEnumerable.call(n,d[h])&&(u[d[h]]=n[d[h]]);return u},h=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0}),l.GoogleMapsEmbed=void 0;let f=h(u(13240)),m=u(35539);l.GoogleMapsEmbed=n=>{var l=d(n,[]);return(0,m.formatData)(f.default,l)}},82415:function(n,l,u){"use strict";var d=this&&this.__rest||function(n,l){var u={};for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&0>l.indexOf(d)&&(u[d]=n[d]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var h=0,d=Object.getOwnPropertySymbols(n);h<d.length;h++)0>l.indexOf(d[h])&&Object.prototype.propertyIsEnumerable.call(n,d[h])&&(u[d[h]]=n[d[h]]);return u},h=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(l,"__esModule",{value:!0}),l.YouTubeEmbed=void 0;let f=h(u(51991)),m=u(35539);l.YouTubeEmbed=n=>{var l=d(n,[]);return(0,m.formatData)(f.default,l)}},35539:function(n,l){"use strict";function filterArgs(n,l,u=!1){return l?Object.keys(n).filter(n=>u?!l.includes(n):l.includes(n)).reduce((l,u)=>(l[u]=n[u],l),{}):{}}function formatUrl(n,l,u,d){let h=d&&Object.keys(d).length>0?new URL(Object.values(d)[0],n):new URL(n);return l&&u&&l.forEach(n=>{u[n]&&h.searchParams.set(n,u[n])}),h.toString()}function createHtml(n,l,u,d,h){var f;if(!l)return`<${n}></${n}>`;let m=(null===(f=l.src)||void 0===f?void 0:f.url)?Object.assign(Object.assign({},l),{src:formatUrl(l.src.url,l.src.params,d,h)}):l,g=Object.keys(Object.assign(Object.assign({},m),u)).reduce((n,l)=>{let d=null==u?void 0:u[l],h=m[l],f=null!=d?d:h,g=!0===f?l:`${l}="${f}"`;return f?n+` ${g}`:n},"");return`<${n}${g}></${n}>`}Object.defineProperty(l,"__esModule",{value:!0}),l.formatData=l.createHtml=l.formatUrl=void 0,l.formatUrl=formatUrl,l.createHtml=createHtml,l.formatData=function(n,l){var u,d,h,f,m;let g=null===(u=n.scripts)||void 0===u?void 0:u.reduce((n,l)=>[...n,...Array.isArray(l.params)?l.params:[]],[]),_=filterArgs(l,g),j=filterArgs(l,null===(h=null===(d=n.html)||void 0===d?void 0:d.attributes.src)||void 0===h?void 0:h.params),$=filterArgs(l,[null===(m=null===(f=n.html)||void 0===f?void 0:f.attributes.src)||void 0===m?void 0:m.slugParam]),z=filterArgs(l,[...Object.keys(_),...Object.keys(j),...Object.keys($)],!0);return Object.assign(Object.assign({},n),{html:n.html?createHtml(n.html.element,n.html.attributes,z,j,$):null,scripts:n.scripts?n.scripts.map(n=>Object.assign(Object.assign({},n),{url:formatUrl(n.url,n.params,_)})):null})}},20452:function(n,l,u){"use strict";/**
 * @license React
 * use-sync-external-store-shim.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var d=u(2784),h="function"==typeof Object.is?Object.is:function(n,l){return n===l&&(0!==n||1/n==1/l)||n!=n&&l!=l},f=d.useState,m=d.useEffect,g=d.useLayoutEffect,_=d.useDebugValue;function r(n){var l=n.getSnapshot;n=n.value;try{var u=l();return!h(n,u)}catch(n){return!0}}var j="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(n,l){return l()}:function(n,l){var u=l(),d=f({inst:{value:u,getSnapshot:l}}),h=d[0].inst,j=d[1];return g(function(){h.value=u,h.getSnapshot=l,r(h)&&j({inst:h})},[n,u,l]),m(function(){return r(h)&&j({inst:h}),n(function(){r(h)&&j({inst:h})})},[n]),_(u),u};l.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:j},43100:function(n,l,u){"use strict";n.exports=u(20452)},56666:function(n,l,u){"use strict";u.d(l,{Z:function(){return _defineProperty}});var d=u(32802);function _defineProperty(n,l,u){return(l=(0,d.Z)(l))in n?Object.defineProperty(n,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):n[l]=u,n}},33028:function(n,l,u){"use strict";u.d(l,{Z:function(){return _objectSpread2}});var d=u(56666);function ownKeys(n,l){var u=Object.keys(n);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(n);l&&(d=d.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),u.push.apply(u,d)}return u}function _objectSpread2(n){for(var l=1;l<arguments.length;l++){var u=null!=arguments[l]?arguments[l]:{};l%2?ownKeys(Object(u),!0).forEach(function(l){(0,d.Z)(n,l,u[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(u)):ownKeys(Object(u)).forEach(function(l){Object.defineProperty(n,l,Object.getOwnPropertyDescriptor(u,l))})}return n}},31461:function(n,l,u){"use strict";function _objectWithoutPropertiesLoose(n,l){if(null==n)return{};var u={};for(var d in n)if(({}).hasOwnProperty.call(n,d)){if(l.includes(d))continue;u[d]=n[d]}return u}u.d(l,{Z:function(){return _objectWithoutPropertiesLoose}})},32802:function(n,l,u){"use strict";u.d(l,{Z:function(){return toPropertyKey}});var d=u(86522);function toPropertyKey(n){var l=function(n,l){if("object"!=(0,d.Z)(n)||!n)return n;var u=n[Symbol.toPrimitive];if(void 0!==u){var h=u.call(n,l||"default");if("object"!=(0,d.Z)(h))return h;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===l?String:Number)(n)}(n,"string");return"symbol"==(0,d.Z)(l)?l:l+""}},86522:function(n,l,u){"use strict";function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}u.d(l,{Z:function(){return _typeof}})},96327:function(n,l,u){"use strict";let d,h;u.d(l,{Jn:function(){return ey},qX:function(){return _getProvider},Xd:function(){return _registerComponent},Mq:function(){return getApp},ZF:function(){return initializeApp},KN:function(){return registerVersion}});var f,m=u(46387),g=u(68207),_=u(83395);let instanceOfAny=(n,l)=>l.some(l=>n instanceof l),j=new WeakMap,$=new WeakMap,z=new WeakMap,ee=new WeakMap,et=new WeakMap,en={get(n,l,u){if(n instanceof IDBTransaction){if("done"===l)return $.get(n);if("objectStoreNames"===l)return n.objectStoreNames||z.get(n);if("store"===l)return u.objectStoreNames[1]?void 0:u.objectStore(u.objectStoreNames[0])}return wrap_idb_value_wrap(n[l])},set:(n,l,u)=>(n[l]=u,!0),has:(n,l)=>n instanceof IDBTransaction&&("done"===l||"store"===l)||l in n};function wrap_idb_value_wrap(n){var l;if(n instanceof IDBRequest)return function(n){let l=new Promise((l,u)=>{let unlisten=()=>{n.removeEventListener("success",success),n.removeEventListener("error",error)},success=()=>{l(wrap_idb_value_wrap(n.result)),unlisten()},error=()=>{u(n.error),unlisten()};n.addEventListener("success",success),n.addEventListener("error",error)});return l.then(l=>{l instanceof IDBCursor&&j.set(l,n)}).catch(()=>{}),et.set(l,n),l}(n);if(ee.has(n))return ee.get(n);let u="function"==typeof(l=n)?l!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(h||(h=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(l)?function(...n){return l.apply(unwrap(this),n),wrap_idb_value_wrap(j.get(this))}:function(...n){return wrap_idb_value_wrap(l.apply(unwrap(this),n))}:function(n,...u){let d=l.call(unwrap(this),n,...u);return z.set(d,n.sort?n.sort():[n]),wrap_idb_value_wrap(d)}:(l instanceof IDBTransaction&&function(n){if($.has(n))return;let l=new Promise((l,u)=>{let unlisten=()=>{n.removeEventListener("complete",complete),n.removeEventListener("error",error),n.removeEventListener("abort",error)},complete=()=>{l(),unlisten()},error=()=>{u(n.error||new DOMException("AbortError","AbortError")),unlisten()};n.addEventListener("complete",complete),n.addEventListener("error",error),n.addEventListener("abort",error)});$.set(n,l)}(l),instanceOfAny(l,d||(d=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(l,en):l;return u!==n&&(ee.set(n,u),et.set(u,n)),u}let unwrap=n=>et.get(n),eo=["get","getKey","getAll","getAllKeys","count"],es=["put","add","delete","clear"],el=new Map;function getMethod(n,l){if(!(n instanceof IDBDatabase&&!(l in n)&&"string"==typeof l))return;if(el.get(l))return el.get(l);let u=l.replace(/FromIndex$/,""),d=l!==u,h=es.includes(u);if(!(u in(d?IDBIndex:IDBObjectStore).prototype)||!(h||eo.includes(u)))return;let method=async function(n,...l){let f=this.transaction(n,h?"readwrite":"readonly"),m=f.store;return d&&(m=m.index(l.shift())),(await Promise.all([m[u](...l),h&&f.done]))[0]};return el.set(l,method),method}en={...f=en,get:(n,l,u)=>getMethod(n,l)||f.get(n,l,u),has:(n,l)=>!!getMethod(n,l)||f.has(n,l)};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let PlatformLoggerServiceImpl=class PlatformLoggerServiceImpl{constructor(n){this.container=n}getPlatformInfoString(){let n=this.container.getProviders();return n.map(n=>{if(!function(n){let l=n.getComponent();return(null==l?void 0:l.type)==="VERSION"}(n))return null;{let l=n.getImmediate();return`${l.library}/${l.version}`}}).filter(n=>n).join(" ")}};let eu="@firebase/app",ec="0.9.26",eh=new g.Yd("@firebase/app"),ep="[DEFAULT]",ef={[eu]:"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"},em=new Map,eg=new Map;function _registerComponent(n){let l=n.name;if(eg.has(l))return eh.debug(`There were multiple attempts to register component ${l}.`),!1;for(let u of(eg.set(l,n),em.values()))!function(n,l){try{n.container.addComponent(l)}catch(u){eh.debug(`Component ${l.name} failed to register with FirebaseApp ${n.name}`,u)}}(u,n);return!0}function _getProvider(n,l){let u=n.container.getProvider("heartbeat").getImmediate({optional:!0});return u&&u.triggerHeartbeat(),n.container.getProvider(l)}let e_=new _.LL("app","Firebase",{"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.","invalid-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}."});/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FirebaseAppImpl=class FirebaseAppImpl{constructor(n,l,u){this._isDeleted=!1,this._options=Object.assign({},n),this._config=Object.assign({},l),this._name=l.name,this._automaticDataCollectionEnabled=l.automaticDataCollectionEnabled,this._container=u,this.container.addComponent(new m.wA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(n){this.checkDestroyed(),this._automaticDataCollectionEnabled=n}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(n){this._isDeleted=n}checkDestroyed(){if(this.isDeleted)throw e_.create("app-deleted",{appName:this._name})}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ey="10.7.2";function initializeApp(n,l={}){let u=n;if("object"!=typeof l){let n=l;l={name:n}}let d=Object.assign({name:ep,automaticDataCollectionEnabled:!1},l),h=d.name;if("string"!=typeof h||!h)throw e_.create("bad-app-name",{appName:String(h)});if(u||(u=(0,_.aH)()),!u)throw e_.create("no-options");let f=em.get(h);if(f){if((0,_.vZ)(u,f.options)&&(0,_.vZ)(d,f.config))return f;throw e_.create("duplicate-app",{appName:h})}let g=new m.H0(h);for(let n of eg.values())g.addComponent(n);let j=new FirebaseAppImpl(u,d,g);return em.set(h,j),j}function getApp(n=ep){let l=em.get(n);if(!l&&n===ep&&(0,_.aH)())return initializeApp();if(!l)throw e_.create("no-app",{appName:n});return l}function registerVersion(n,l,u){var d;let h=null!==(d=ef[n])&&void 0!==d?d:n;u&&(h+=`-${u}`);let f=h.match(/\s|\//),g=l.match(/\s|\//);if(f||g){let n=[`Unable to register library "${h}" with version "${l}":`];f&&n.push(`library name "${h}" contains illegal characters (whitespace or "/")`),f&&g&&n.push("and"),g&&n.push(`version name "${l}" contains illegal characters (whitespace or "/")`),eh.warn(n.join(" "));return}_registerComponent(new m.wA(`${h}-version`,()=>({library:h,version:l}),"VERSION"))}let ev="firebase-heartbeat-store",eE=null;function getDbPromise(){return eE||(eE=(function(n,l,{blocked:u,upgrade:d,blocking:h,terminated:f}={}){let m=indexedDB.open(n,1),g=wrap_idb_value_wrap(m);return d&&m.addEventListener("upgradeneeded",n=>{d(wrap_idb_value_wrap(m.result),n.oldVersion,n.newVersion,wrap_idb_value_wrap(m.transaction),n)}),u&&m.addEventListener("blocked",n=>u(n.oldVersion,n.newVersion,n)),g.then(n=>{f&&n.addEventListener("close",()=>f()),h&&n.addEventListener("versionchange",n=>h(n.oldVersion,n.newVersion,n))}).catch(()=>{}),g})("firebase-heartbeat-database",0,{upgrade:(n,l)=>{if(0===l)try{n.createObjectStore(ev)}catch(n){console.warn(n)}}}).catch(n=>{throw e_.create("idb-open",{originalErrorMessage:n.message})})),eE}async function readHeartbeatsFromIndexedDB(n){try{let l=await getDbPromise(),u=await l.transaction(ev).objectStore(ev).get(computeKey(n));return u}catch(n){if(n instanceof _.ZR)eh.warn(n.message);else{let l=e_.create("idb-get",{originalErrorMessage:null==n?void 0:n.message});eh.warn(l.message)}}}async function writeHeartbeatsToIndexedDB(n,l){try{let u=await getDbPromise(),d=u.transaction(ev,"readwrite"),h=d.objectStore(ev);await h.put(l,computeKey(n)),await d.done}catch(n){if(n instanceof _.ZR)eh.warn(n.message);else{let l=e_.create("idb-set",{originalErrorMessage:null==n?void 0:n.message});eh.warn(l.message)}}}function computeKey(n){return`${n.name}!${n.options.appId}`}let HeartbeatServiceImpl=class HeartbeatServiceImpl{constructor(n){this.container=n,this._heartbeatsCache=null;let l=this.container.getProvider("app").getImmediate();this._storage=new HeartbeatStorageImpl(l),this._heartbeatsCachePromise=this._storage.read().then(n=>(this._heartbeatsCache=n,n))}async triggerHeartbeat(){var n,l;let u=this.container.getProvider("platform-logger").getImmediate(),d=u.getPlatformInfoString(),h=getUTCDateString();return(null===(n=this._heartbeatsCache)||void 0===n?void 0:n.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,(null===(l=this._heartbeatsCache)||void 0===l?void 0:l.heartbeats)==null)?void 0:this._heartbeatsCache.lastSentHeartbeatDate===h||this._heartbeatsCache.heartbeats.some(n=>n.date===h)?void 0:(this._heartbeatsCache.heartbeats.push({date:h,agent:d}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(n=>{let l=new Date(n.date).valueOf(),u=Date.now();return u-l<=2592e6}),this._storage.overwrite(this._heartbeatsCache))}async getHeartbeatsHeader(){var n;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,(null===(n=this._heartbeatsCache)||void 0===n?void 0:n.heartbeats)==null||0===this._heartbeatsCache.heartbeats.length)return"";let l=getUTCDateString(),{heartbeatsToSend:u,unsentEntries:d}=function(n,l=1024){let u=[],d=n.slice();for(let h of n){let n=u.find(n=>n.agent===h.agent);if(n){if(n.dates.push(h.date),countBytes(u)>l){n.dates.pop();break}}else if(u.push({agent:h.agent,dates:[h.date]}),countBytes(u)>l){u.pop();break}d=d.slice(1)}return{heartbeatsToSend:u,unsentEntries:d}}(this._heartbeatsCache.heartbeats),h=(0,_.L)(JSON.stringify({version:2,heartbeats:u}));return this._heartbeatsCache.lastSentHeartbeatDate=l,d.length>0?(this._heartbeatsCache.heartbeats=d,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),h}};function getUTCDateString(){let n=new Date;return n.toISOString().substring(0,10)}let HeartbeatStorageImpl=class HeartbeatStorageImpl{constructor(n){this.app=n,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,_.hl)()&&(0,_.eu)().then(()=>!0).catch(()=>!1)}async read(){let n=await this._canUseIndexedDBPromise;if(!n)return{heartbeats:[]};{let n=await readHeartbeatsFromIndexedDB(this.app);return(null==n?void 0:n.heartbeats)?n:{heartbeats:[]}}}async overwrite(n){var l;let u=await this._canUseIndexedDBPromise;if(u){let u=await this.read();return writeHeartbeatsToIndexedDB(this.app,{lastSentHeartbeatDate:null!==(l=n.lastSentHeartbeatDate)&&void 0!==l?l:u.lastSentHeartbeatDate,heartbeats:n.heartbeats})}}async add(n){var l;let u=await this._canUseIndexedDBPromise;if(u){let u=await this.read();return writeHeartbeatsToIndexedDB(this.app,{lastSentHeartbeatDate:null!==(l=n.lastSentHeartbeatDate)&&void 0!==l?l:u.lastSentHeartbeatDate,heartbeats:[...u.heartbeats,...n.heartbeats]})}}};function countBytes(n){return(0,_.L)(JSON.stringify({version:2,heartbeats:n})).length}_registerComponent(new m.wA("platform-logger",n=>new PlatformLoggerServiceImpl(n),"PRIVATE")),_registerComponent(new m.wA("heartbeat",n=>new HeartbeatServiceImpl(n),"PRIVATE")),registerVersion(eu,ec,""),registerVersion(eu,ec,"esm2017"),registerVersion("fire-js","")},46387:function(n,l,u){"use strict";u.d(l,{H0:function(){return ComponentContainer},wA:function(){return Component}});var d=u(83395);let Component=class Component{constructor(n,l,u){this.name=n,this.instanceFactory=l,this.type=u,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(n){return this.instantiationMode=n,this}setMultipleInstances(n){return this.multipleInstances=n,this}setServiceProps(n){return this.serviceProps=n,this}setInstanceCreatedCallback(n){return this.onInstanceCreated=n,this}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let h="[DEFAULT]";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Provider=class Provider{constructor(n,l){this.name=n,this.container=l,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(n){let l=this.normalizeInstanceIdentifier(n);if(!this.instancesDeferred.has(l)){let n=new d.BH;if(this.instancesDeferred.set(l,n),this.isInitialized(l)||this.shouldAutoInitialize())try{let u=this.getOrInitializeService({instanceIdentifier:l});u&&n.resolve(u)}catch(n){}}return this.instancesDeferred.get(l).promise}getImmediate(n){var l;let u=this.normalizeInstanceIdentifier(null==n?void 0:n.identifier),d=null!==(l=null==n?void 0:n.optional)&&void 0!==l&&l;if(this.isInitialized(u)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:u})}catch(n){if(d)return null;throw n}else{if(d)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(n){if(n.name!==this.name)throw Error(`Mismatching Component ${n.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=n,this.shouldAutoInitialize()){if("EAGER"===n.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:h})}catch(n){}for(let[n,l]of this.instancesDeferred.entries()){let u=this.normalizeInstanceIdentifier(n);try{let n=this.getOrInitializeService({instanceIdentifier:u});l.resolve(n)}catch(n){}}}}clearInstance(n=h){this.instancesDeferred.delete(n),this.instancesOptions.delete(n),this.instances.delete(n)}async delete(){let n=Array.from(this.instances.values());await Promise.all([...n.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...n.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return null!=this.component}isInitialized(n=h){return this.instances.has(n)}getOptions(n=h){return this.instancesOptions.get(n)||{}}initialize(n={}){let{options:l={}}=n,u=this.normalizeInstanceIdentifier(n.instanceIdentifier);if(this.isInitialized(u))throw Error(`${this.name}(${u}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let d=this.getOrInitializeService({instanceIdentifier:u,options:l});for(let[n,l]of this.instancesDeferred.entries()){let h=this.normalizeInstanceIdentifier(n);u===h&&l.resolve(d)}return d}onInit(n,l){var u;let d=this.normalizeInstanceIdentifier(l),h=null!==(u=this.onInitCallbacks.get(d))&&void 0!==u?u:new Set;h.add(n),this.onInitCallbacks.set(d,h);let f=this.instances.get(d);return f&&n(f,d),()=>{h.delete(n)}}invokeOnInitCallbacks(n,l){let u=this.onInitCallbacks.get(l);if(u)for(let d of u)try{d(n,l)}catch(n){}}getOrInitializeService({instanceIdentifier:n,options:l={}}){let u=this.instances.get(n);if(!u&&this.component&&(u=this.component.instanceFactory(this.container,{instanceIdentifier:n===h?void 0:n,options:l}),this.instances.set(n,u),this.instancesOptions.set(n,l),this.invokeOnInitCallbacks(u,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,u)}catch(n){}return u||null}normalizeInstanceIdentifier(n=h){return this.component?this.component.multipleInstances?n:h:n}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ComponentContainer=class ComponentContainer{constructor(n){this.name=n,this.providers=new Map}addComponent(n){let l=this.getProvider(n.name);if(l.isComponentSet())throw Error(`Component ${n.name} has already been registered with ${this.name}`);l.setComponent(n)}addOrOverwriteComponent(n){let l=this.getProvider(n.name);l.isComponentSet()&&this.providers.delete(n.name),this.addComponent(n)}getProvider(n){if(this.providers.has(n))return this.providers.get(n);let l=new Provider(n,this);return this.providers.set(n,l),l}getProviders(){return Array.from(this.providers.values())}}},68207:function(n,l,u){"use strict";var d,h;u.d(l,{Yd:function(){return Logger},in:function(){return d}});/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let f=[];(h=d||(d={}))[h.DEBUG=0]="DEBUG",h[h.VERBOSE=1]="VERBOSE",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.SILENT=5]="SILENT";let m={debug:d.DEBUG,verbose:d.VERBOSE,info:d.INFO,warn:d.WARN,error:d.ERROR,silent:d.SILENT},g=d.INFO,_={[d.DEBUG]:"log",[d.VERBOSE]:"log",[d.INFO]:"info",[d.WARN]:"warn",[d.ERROR]:"error"},defaultLogHandler=(n,l,...u)=>{if(l<n.logLevel)return;let d=new Date().toISOString(),h=_[l];if(h)console[h](`[${d}]  ${n.name}:`,...u);else throw Error(`Attempted to log a message with an invalid logType (value: ${l})`)};let Logger=class Logger{constructor(n){this.name=n,this._logLevel=g,this._logHandler=defaultLogHandler,this._userLogHandler=null,f.push(this)}get logLevel(){return this._logLevel}set logLevel(n){if(!(n in d))throw TypeError(`Invalid value "${n}" assigned to \`logLevel\``);this._logLevel=n}setLogLevel(n){this._logLevel="string"==typeof n?m[n]:n}get logHandler(){return this._logHandler}set logHandler(n){if("function"!=typeof n)throw TypeError("Value assigned to `logHandler` must be a function");this._logHandler=n}get userLogHandler(){return this._userLogHandler}set userLogHandler(n){this._userLogHandler=n}debug(...n){this._userLogHandler&&this._userLogHandler(this,d.DEBUG,...n),this._logHandler(this,d.DEBUG,...n)}log(...n){this._userLogHandler&&this._userLogHandler(this,d.VERBOSE,...n),this._logHandler(this,d.VERBOSE,...n)}info(...n){this._userLogHandler&&this._userLogHandler(this,d.INFO,...n),this._logHandler(this,d.INFO,...n)}warn(...n){this._userLogHandler&&this._userLogHandler(this,d.WARN,...n),this._logHandler(this,d.WARN,...n)}error(...n){this._userLogHandler&&this._userLogHandler(this,d.ERROR,...n),this._logHandler(this,d.ERROR,...n)}}},27318:function(n,l,u){"use strict";u.d(l,{M:function(){return AnimatePresence}});var d=u(2784);let h=typeof window>"u",idFn=()=>{},f=(0,d.createContext)({});var m=u(46268),g=u(52322);let getChildKey=n=>n.key||"",AnimatePresence=({children:n,enterVariant:l,exitVariant:u,enterExitVariant:_,initial:j=!0,onExitComplete:$,exitBeforeEnter:z,presenceAffectsLayout:ee=!0,custom:et})=>{let en=(0,d.useContext)(f).forceRender??(h?idFn:(0,d.useReducer)(n=>Math.random(),0)[1]),eo=function(n){let l=[];return d.Children.forEach(n,n=>{(0,d.isValidElement)(n)&&l.push(n)}),l}(n),es=(0,d.useRef)(eo),el=(0,d.useRef)(new Map).current,eu=(0,d.useRef)(new Set).current;!function(n,l){n.forEach(n=>{let u=getChildKey(n);l.set(u,n)})}(eo,el);let ec=(0,d.useRef)(!0);if(ec.current)return ec.current=!1,(0,g.jsx)(g.Fragment,{children:eo.map(n=>(0,g.jsx)(m.g,{isPresent:!0,enterExitVariant:_,exitVariant:u,enterVariant:l,initial:!!j&&void 0,presenceAffectsLayout:ee,custom:et,children:n},getChildKey(n)))});let eh=[...eo],ep=es.current.map(getChildKey),ef=eo.map(getChildKey),em=ep.length;for(let n=0;n<em;n++){let l=ep[n];-1===ef.indexOf(l)?eu.add(l):eu.delete(l)}return z&&eu.size&&(eh=[]),eu.forEach(n=>{if(-1!==ef.indexOf(n))return;let d=el.get(n);if(!d)return;let h=ep.indexOf(n),f=(0,g.jsx)(m.g,{isPresent:!1,onExitComplete:()=>{el.delete(n),eu.delete(n);let l=es.current.findIndex(l=>l.key===n);es.current.splice(l,1),eu.size||(es.current=eo,en(),$?.())},presenceAffectsLayout:ee,enterExitVariant:_,enterVariant:l,exitVariant:u,custom:et,children:d},getChildKey(d));eh.splice(h,0,f)}),eh=eh.map(n=>{let d=n.key;return eu.has(d)?n:(0,g.jsx)(m.g,{isPresent:!0,exitVariant:u,enterVariant:l,enterExitVariant:_,presenceAffectsLayout:ee,custom:et,children:n},getChildKey(n))}),es.current=eh,(0,g.jsx)(g.Fragment,{children:eu.size?eh:eh.map(n=>(0,d.cloneElement)(n))})};AnimatePresence.displayName="AnimatePresence"},46268:function(n,l,u){"use strict";u.d(l,{g:function(){return g}});var d=u(65536),h=u(43397),f=u(2784),m=u(52322);let g=f.memo(({children:n,initial:l,isPresent:u,onExitComplete:g,exitVariant:_,enterVariant:j,enterExitVariant:$,presenceAffectsLayout:z,custom:ee})=>{let et=(0,d.h)(newChildrenMap),en=(0,f.useId)()||"",eo=f.useMemo(()=>({id:en,initial:l,isPresent:u,custom:ee,exitVariant:_,enterVariant:j,enterExitVariant:$,onExitComplete:()=>{for(let n of(et.set(en,!0),et.values()))if(!n)return;g?.()},register:()=>(et.set(en,!1),()=>et.delete(en))}),z?void 0:[u,_,j]);return f.useMemo(()=>{et.forEach((n,l)=>et.set(l,!1))},[u]),f.useEffect(()=>{u||et.size||g?.()},[u]),(0,m.jsx)(h.Oy.Provider,{value:eo,children:n})});function newChildrenMap(){return new Map}},86230:function(n,l,u){"use strict";u.d(l,{B:function(){return createCollection}});var d=u(37751),h=u(99810),f=u(52026),m=u(2784),g=u(52322);function createCollection(n){let{Provider:l,useStyledContext:u}=(0,f.createStyledContext)({collectionRef:{current:null},itemMap:new Map}),CollectionProvider=n=>{let{__scopeCollection:u,children:d}=n,h=m.useRef(null),f=m.useRef(new Map).current;return(0,g.jsx)(l,{scope:u,itemMap:f,collectionRef:h,children:d})};CollectionProvider.displayName="CollectionProvider";let _=m.forwardRef((n,l)=>{let{__scopeCollection:h,children:m}=n,_=u(h),j=(0,d.ex)(l,_.collectionRef);return(0,g.jsx)(f.Slot,{ref:j,children:m})});_.displayName=n+"CollectionSlot";let j="data-collection-item",$=m.forwardRef((n,l)=>{let{__scopeCollection:h,children:_,...$}=n,z=m.useRef(null),ee=(0,d.ex)(l,z),et=u(h);return m.useEffect(()=>(et.itemMap.set(z,{ref:z,...$}),()=>void et.itemMap.delete(z))),(0,g.jsx)(f.Slot,{[j]:"",ref:ee,children:_})});return $.displayName=n+"CollectionItemSlot",[{Provider:CollectionProvider,Slot:_,ItemSlot:$},function(n){let l=u(n);return m.useCallback(()=>{if(!h.$L)return[];let n=l.collectionRef.current;if(!n)return[];let u=Array.from(n.querySelectorAll(`[${j}]`));return Array.from(l.itemMap.values()).sort((n,l)=>u.indexOf(n.ref.current)-u.indexOf(l.ref.current))},[l.collectionRef,l.itemMap])}]}},37751:function(n,l,u){"use strict";u.d(l,{FE:function(){return composeRefs},ex:function(){return useComposedRefs}});var d=u(2784);function composeRefs(...n){return l=>n.forEach(n=>{"function"==typeof n?n(l):n&&(n.current=l)})}function useComposedRefs(...n){return d.useCallback(composeRefs(...n),n)}},99810:function(n,l,u){"use strict";u.d(l,{Dt:function(){return $},s:function(){return z},sk:function(){return m},wT:function(){return j},$L:function(){return h},LI:function(){return g}});var d=u(2784);let h=!0,f="u">typeof window,m=h&&!f,g=m?d.useEffect:d.useLayoutEffect,_=("u">typeof navigator&&/Chrome/.test(navigator.userAgent||""),h&&f&&("ontouchstart"in window||navigator.maxTouchPoints>0)),j=!h||_,$=!1,z=!1},31159:function(n,l,u){"use strict";let d;u.d(l,{XA:function(){return ee}});var h=u(37751),f=u(37809),m=u(2784),g=u(41678),_=u(28316),j=u(52322);let $="dismissable.update",z=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ee=m.forwardRef((n,l)=>{let{disableOutsidePointerEvents:u=!1,forceUnmount:_,onEscapeKeyDown:ee,onPointerDownOutside:et,onFocusOutside:en,onInteractOutside:eo,onDismiss:es,...el}=n,eu=m.useContext(z),[ec,eh]=m.useState(null),[,ep]=m.useState({}),ef=(0,h.ex)(l,n=>eh(n)),em=Array.from(eu.layers),[eg]=[...eu.layersWithOutsidePointerEventsDisabled].slice(-1),e_=em.indexOf(eg),ey=ec?em.indexOf(ec):-1,ev=eu.layersWithOutsidePointerEventsDisabled.size>0,eE=ey>=e_,eS=function(n){let l=(0,g.z)(n),u=m.useRef(!1),d=m.useRef(()=>{});return m.useEffect(()=>{let handlePointerDown=n=>{if(n.target&&!u.current){let handleAndDispatchPointerDownOutsideEvent=function(){handleAndDispatchCustomEvent("dismissable.pointerDownOutside",l,u,{discrete:!0})},u={originalEvent:n};"touch"===n.pointerType?(document.removeEventListener("click",d.current),d.current=handleAndDispatchPointerDownOutsideEvent,document.addEventListener("click",d.current,{once:!0})):handleAndDispatchPointerDownOutsideEvent()}u.current=!1},n=setTimeout(()=>{document.addEventListener("pointerdown",handlePointerDown)},0);return()=>{window.clearTimeout(n),document.removeEventListener("pointerdown",handlePointerDown),document.removeEventListener("click",d.current)}},[l]),{onPointerDownCapture:()=>{u.current=!0}}}(n=>{let l=n.target,u=[...eu.branches].some(n=>n.contains(l));!eE||u||(et?.(n),eo?.(n),n.defaultPrevented||es?.())}),ew=function(n){let l=(0,g.z)(n),u=m.useRef(!1);return m.useEffect(()=>{let handleFocus=n=>{n.target&&!u.current&&handleAndDispatchCustomEvent("dismissable.focusOutside",l,{originalEvent:n},{discrete:!1})};return document.addEventListener("focusin",handleFocus),()=>document.removeEventListener("focusin",handleFocus)},[l]),{onFocusCapture:()=>{u.current=!0},onBlurCapture:()=>{u.current=!1}}}(n=>{let l=n.target;[...eu.branches].some(n=>n.contains(l))||(en?.(n),eo?.(n),n.defaultPrevented||es?.())});return function(n,l=globalThis?.document){let u=function(n){let l=m.useRef(n);return m.useEffect(()=>{l.current=n}),m.useMemo(()=>(...n)=>l.current?.(...n),[])}(n);(0,m.useEffect)(()=>{let handleKeyDown=n=>{"Escape"===n.key&&u(n)};return l.addEventListener("keydown",handleKeyDown),()=>{l.removeEventListener("keydown",handleKeyDown)}},[u,l])}(n=>{ey===eu.layers.size-1&&(ee?.(n),!n.defaultPrevented&&es&&(n.preventDefault(),es()))}),m.useEffect(()=>{if(ec)return u&&(0===eu.layersWithOutsidePointerEventsDisabled.size&&(d=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),eu.layersWithOutsidePointerEventsDisabled.add(ec)),eu.layers.add(ec),dispatchUpdate(),()=>{u&&1===eu.layersWithOutsidePointerEventsDisabled.size&&(document.body.style.pointerEvents=d)}},[ec,u,eu]),m.useEffect(()=>{if(!_)return()=>{ec&&(eu.layers.delete(ec),eu.layersWithOutsidePointerEventsDisabled.delete(ec),dispatchUpdate())}},[ec,eu,_]),m.useEffect(()=>{let handleUpdate=()=>{ep({})};return document.addEventListener($,handleUpdate),()=>document.removeEventListener($,handleUpdate)},[]),(0,j.jsx)("div",{...el,ref:ef,style:{display:"contents",pointerEvents:ev?eE?"auto":"none":void 0,...n.style},onFocusCapture:(0,f.Mj)(n.onFocusCapture,ew.onFocusCapture),onBlurCapture:(0,f.Mj)(n.onBlurCapture,ew.onBlurCapture),onPointerDownCapture:(0,f.Mj)(n.onPointerDownCapture,eS.onPointerDownCapture)})});ee.displayName="Dismissable";let et=m.forwardRef((n,l)=>{let u=m.useContext(z),d=m.useRef(null),f=(0,h.ex)(l,d);return m.useEffect(()=>{let n=d.current;if(n)return u.branches.add(n),()=>{u.branches.delete(n)}},[u.branches]),(0,j.jsx)("div",{style:{display:"contents"},...n,ref:f})});function dispatchUpdate(){let n=new CustomEvent($);document.dispatchEvent(n)}function handleAndDispatchCustomEvent(n,l,u,{discrete:d}){let h=u.originalEvent.target,f=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:u});l&&h.addEventListener(n,l,{once:!0}),d?h&&_.flushSync(()=>h.dispatchEvent(f)):h.dispatchEvent(f)}et.displayName="DismissableBranch"},87453:function(n,l,u){"use strict";u.d(l,{H:function(){return getFontSized}});var d=u(52026);let getFontSized=(n="$true",{font:l,fontFamily:u,props:f})=>{if(!l)return;let m="$true"===n?function(n){if("object"==typeof n&&h.has(n))return h.get(n);let l="$true"in n.size?n.size:(0,d.getTokens)().size,u=l.$true,f=u?Object.keys(l).find(n=>"$true"!==n&&l[n].val===u.val):null;return u&&f?(h.set(n,f),f):Object.keys(n.size)[3]}(l):n,g=l.size[m],_=l.lineHeight?.[m],j=l.weight?.[m],$=l.letterSpacing?.[m],z=l.transform?.[m],ee=f.fontStyle??l.style?.[m],et={color:f.color??l.color?.[m],fontStyle:ee,textTransform:z,fontFamily:u,fontWeight:j,letterSpacing:$,fontSize:g,lineHeight:_};return et},h=new WeakMap},37809:function(n,l,u){"use strict";function composeEventHandlers(n,l,{checkDefaultPrevented:u=!0}={}){return n&&l?d=>{if(n?.(d),!d||!(u&&"defaultPrevented"in d)||"defaultPrevented"in d&&!d.defaultPrevented)return l?.(d)}:l||n||void 0}u.d(l,{Mj:function(){return composeEventHandlers},$e:function(){return withStaticProperties}});var d=u(99810);let h={radius:{borderRadius:!0,borderTopLeftRadius:!0,borderTopRightRadius:!0,borderBottomLeftRadius:!0,borderBottomRightRadius:!0,borderStartStartRadius:!0,borderStartEndRadius:!0,borderEndStartRadius:!0,borderEndEndRadius:!0},size:{width:!0,height:!0,minWidth:!0,minHeight:!0,maxWidth:!0,maxHeight:!0,blockSize:!0,minBlockSize:!0,maxBlockSize:!0,inlineSize:!0,minInlineSize:!0,maxInlineSize:!0},zIndex:{zIndex:!0},color:{backgroundColor:!0,borderColor:!0,borderBlockStartColor:!0,borderBlockEndColor:!0,borderBlockColor:!0,borderBottomColor:!0,borderInlineColor:!0,borderInlineStartColor:!0,borderInlineEndColor:!0,borderTopColor:!0,borderLeftColor:!0,borderRightColor:!0,borderEndColor:!0,borderStartColor:!0,shadowColor:!0,color:!0,textDecorationColor:!0,textShadowColor:!0,outlineColor:!0,caretColor:!0}};h.color,h.radius,h.size,h.radius,d.Dt;var f=u(2784);let m=Symbol(),withStaticProperties=(n,l)=>{let u=(()=>{if(n[m]){let l=(0,f.forwardRef)((l,u)=>(0,f.createElement)(n,{...l,ref:u}));for(let u in n){let d=n[u];l[u]=d&&"object"==typeof d?{...d}:d}}return n})();return Object.assign(u,l),u[m]=!0,u}},23650:function(n,l,u){"use strict";u.d(l,{h_:function(){return $},$2:function(){return el},b5:function(){return eu},Xp:function(){return es}}),u(85360);var d,h=u(99810),f=u(37288),m=u(2784),g=u(28316),_=u(73516),j=u(52322);let $=m.memo(({host:n=globalThis.document?.body,...l})=>{if(h.sk)return null;let u=(0,_.SZ)(),d=(0,j.jsx)(f.FA,{contain:"strict",fullscreen:!0,position:"fixed",maxWidth:"100vw",maxHeight:"100vh",pointerEvents:"none",...l});return(0,g.createPortal)(u?d:null,n)});var z=u(52026),ee=((d=ee||{})[d.REGISTER_HOST=0]="REGISTER_HOST",d[d.DEREGISTER_HOST=1]="DEREGISTER_HOST",d[d.ADD_UPDATE_PORTAL=2]="ADD_UPDATE_PORTAL",d[d.REMOVE_PORTAL=3]="REMOVE_PORTAL",d);let et={},registerHost=(n,l)=>(l in n||(n[l]=[]),n),deregisterHost=(n,l)=>(delete n[l],n),addUpdatePortal=(n,l,u,d)=>{l in n||(n=registerHost(n,l));let h=n[l].findIndex(n=>n.name===u);return -1!==h?n[l][h].node=d:n[l].push({name:u,node:d}),n},removePortal=(n,l,u)=>{if(!(l in n))return console.info(`Failed to remove portal '${u}', '${l}' was not registered!`),n;let d=n[l].findIndex(n=>n.name===u);return -1!==d&&n[l].splice(d,1),n},reducer=(n,l)=>{let{type:u}=l;switch(u){case 0:return registerHost({...n},l.hostName);case 1:return deregisterHost({...n},l.hostName);case 2:return addUpdatePortal({...n},l.hostName,l.portalName,l.node);case 3:return removePortal({...n},l.hostName,l.portalName);default:return n}},en=(0,m.createContext)(null),eo=(0,m.createContext)(null),usePortalState=n=>{let l=(0,m.useContext)(en);if(null===l)throw Error("'PortalStateContext' cannot be null, please add 'PortalProvider' to the root component.");return l[n]||[]},usePortal=(n="root")=>{let l=(0,m.useContext)(eo);if(null===l)throw Error("'PortalDispatchContext' cannot be null, please add 'PortalProvider' to the root component.");let u=(0,m.useCallback)(()=>{l({type:0,hostName:n})},[]),d=(0,m.useCallback)(()=>{l({type:1,hostName:n})},[]),h=(0,m.useCallback)((u,d)=>{l({type:2,hostName:n,portalName:u,node:d})},[]),f=(0,m.useCallback)(u=>{l({type:3,hostName:n,portalName:u})},[]);return{registerHost:u,deregisterHost:d,addPortal:h,updatePortal:h,removePortal:f}},es=(0,m.memo)(({rootHostName:n="root",shouldAddRootHost:l=!0,children:u})=>{let[d,h]=(0,m.useReducer)(reducer,et),f=(0,m.useMemo)(()=>n=>{(0,m.startTransition)(()=>{h(n)})},[h]);return(0,j.jsx)(eo.Provider,{value:f,children:(0,j.jsxs)(en.Provider,{value:d,children:[u,l&&(0,j.jsx)(el,{name:n})]})})});es.displayName="PortalProvider";let defaultRenderer=n=>(0,j.jsx)(j.Fragment,{children:n}),el=(0,m.memo)(n=>{let{name:l,forwardProps:u,render:d=defaultRenderer}=n,h=usePortalState(l),{registerHost:f,deregisterHost:g}=usePortal(n.name);return(0,m.useEffect)(()=>{if(!(typeof window>"u"))return f(),()=>{g()}},[]),d(u?h.map(n=>{let l=n.node;return u?m.Children.map(l,n=>m.isValidElement(n)?m.cloneElement(n,{key:n.key,...u}):n):l}):h.map(n=>n.node))});el.displayName="PortalHost";let eu=(0,m.memo)(n=>{let{name:l,hostName:u,handleOnMount:d,handleOnUnmount:f,handleOnUpdate:g,children:_}=n,{addPortal:j,removePortal:$}=usePortal(u),ee=(0,m.useId)(),et=l||ee,en=(0,z.useEvent)(()=>{d?d(()=>j(et,_)):j(et,_)}),eo=(0,z.useEvent)(()=>{f?f(()=>$(et)):$(et)}),es=(0,z.useEvent)(()=>{g?g(()=>j(et,_)):j(et,_)});return(0,h.LI)(()=>(en(),()=>{eo()}),[]),(0,m.useEffect)(()=>{es()},[_]),null});eu.displayName="Portal"},37288:function(n,l,u){"use strict";u.d(l,{FA:function(){return g},Xu:function(){return f},sL:function(){return _}});var d=u(52026),h=u(53541);let f={position:"absolute",top:0,left:0,right:0,bottom:0},m={fullscreen:{true:f},elevation:{"...size":h.y,":number":h.y},inset:n=>n&&"object"==typeof n?n:{top:n,left:n,bottom:n,right:n}},g=(0,d.styled)(d.View,{flexDirection:"column",variants:m});g.displayName="YStack";let _=(0,d.styled)(d.View,{flexDirection:"row",variants:m});_.displayName="XStack";let j=(0,d.styled)(g,{position:"relative"},{neverFlatten:!0,isZStack:!0});j.displayName="ZStack"},71083:function(n,l,u){"use strict";u.d(l,{K:function(){return j}});var d=u(52026),h=u(37288),f=u(53541);let m={borderRadius:1e5,padding:0},g={backgroundColor:"transparent",borderColor:"transparent",shadowColor:"transparent",hoverStyle:{borderColor:"transparent"}},_={backgrounded:{true:{backgroundColor:"$background"}},radiused:{true:(n,l)=>{let{tokens:u,props:d}=l;return{borderRadius:u.radius[d.size]||u.radius.$true}}},hoverTheme:{true:{hoverStyle:{backgroundColor:"$backgroundHover",borderColor:"$borderColorHover"}},false:{}},pressTheme:{true:{cursor:"pointer",pressStyle:{backgroundColor:"$backgroundPress",borderColor:"$borderColorPress"}},false:{}},focusTheme:{true:{focusStyle:{backgroundColor:"$backgroundFocus",borderColor:"$borderColorFocus"}},false:{}},circular:{true:(n,{props:l,tokens:u})=>{if(!("size"in l))return m;let d="number"==typeof l.size?l.size:u.size[l.size];return{...m,width:d,height:d,maxWidth:d,maxHeight:d,minWidth:d,minHeight:d}}},padded:{true:(n,l)=>{let{tokens:u,props:d}=l;return{padding:u.space[d.size]||u.space.$true}}},elevate:{true:(n,l)=>(0,f.y)(l.props.size,l)},bordered:(n,{props:l})=>({borderWidth:"number"==typeof n?n:1,borderColor:"$borderColor",...l.hoverTheme&&{hoverStyle:{borderColor:"$borderColorHover"}},...l.pressTheme&&{pressStyle:{borderColor:"$borderColorPress"}},...l.focusTheme&&{focusStyle:{borderColor:"$borderColorFocus"}}}),transparent:{true:{backgroundColor:"transparent"}},chromeless:{true:g,all:{...g,hoverStyle:g,pressStyle:g,focusStyle:g}}},j=(0,d.styled)(h.FA,{variants:_})},53541:function(n,l,u){"use strict";u.d(l,{y:function(){return getElevation}});var d=u(52026);let getElevation=(n,l)=>{if(!n)return;let{tokens:u}=l,h=u.size[n],f=(0,d.isVariable)(h)?+h.val:n;return getSizedElevation(f,l)},getSizedElevation=(n,{theme:l,tokens:u})=>{let h=0;if(!0===n){let n=(0,d.getVariableValue)(u.size.true);h="number"==typeof n?n:10}else h=+n;if(0===h)return;let[f,m]=[Math.round(h/4+1),Math.round(h/2+2)];return{shadowColor:l.shadowColor,shadowRadius:m,shadowOffset:{height:f,width:0},...d.isAndroid?{elevationAndroid:2*f}:{}}}},59213:function(n,l,u){"use strict";u.d(l,{J:function(){return m}});var d=u(87453),h=u(11444),f=u(34406);let m=(0,h.styled)(h.Text,{name:"SizableText",fontFamily:"$body",variants:{unstyled:{false:{size:"$true",color:"$color"}},size:d.H},defaultVariants:{unstyled:"1"===f.env.TAMAGUI_HEADLESS}});m.staticConfig.variants.fontFamily={"...":(n,l)=>{let u=l.props.size||"$true";return(0,d.H)(u,l)}}},14503:function(n,l,u){"use strict";u.d(l,{e7:function(){return ToastImperativeProvider},Py:function(){return useToastController},JW:function(){return useToastState}});var d=u(52026),h=u(2784),f=u(26516);let createNativeToast=(n,{message:l,notificationOptions:u})=>{if(!("Notification"in window))return console.error("This browser does not support notifications"),!1;Notification.permission;let showNotification=()=>new Notification(n,{body:l,...u});return"granted"===Notification.permission?{nativeToastRef:showNotification()}:(Notification.requestPermission().then(n=>{if("granted"===n)return{nativeToastRef:showNotification()}}),!0)};var m=u(52322);let g=(0,h.createContext)({}),_=(0,h.createContext)(null),useToastController=()=>(0,h.useContext)(g),useToastState=()=>(0,h.useContext)(_),ToastImperativeProvider=({children:n,options:l})=>{let u=(0,h.useRef)(0),[j,$]=h.useState(null),[z,ee]=h.useState(null),et=h.useCallback((n,h)=>{let m=h?.native??l.native,g=Array.isArray(m)?m.includes("web"):"web"===m,_=Array.isArray(m)?m.includes("mobile"):"mobile"===m,j=_||(Array.isArray(m)?m.includes("android"):"android"===m),z=_||(Array.isArray(m)?m.includes("ios"):"ios"===m),et=!0===m||d.isWeb&&g||!d.isWeb&&_||"android"===f.Z.OS&&j||"ios"===f.Z.OS&&z;if(et){let l=createNativeToast(n,h??{});"object"==typeof l&&l.nativeToastRef&&ee(l.nativeToastRef)}return u.current++,$({...h?.customData,...h,viewportName:h?.viewportName??"default",title:n,id:u.current.toString(),isHandledNatively:et}),!0},[$,l.native]),en=h.useCallback(()=>{z?.close(),$(null)},[$,z]),eo=(0,h.useMemo)(()=>({show:et,hide:en,nativeToast:z,options:l}),[et,en,z,JSON.stringify(l||null)]);return(0,m.jsx)(g.Provider,{value:eo,children:(0,m.jsx)(_.Provider,{value:j,children:n})})}},65536:function(n,l,u){"use strict";u.d(l,{h:function(){return useConstant}});var d=u(2784);function useConstant(n){if(typeof document>"u")return(0,d.useMemo)(()=>n(),[]);let l=(0,d.useRef)();return l.current||(l.current={v:n()}),l.current.v}},42474:function(n,l,u){"use strict";u.d(l,{T:function(){return useControllableState}});var d=u(41678),h=u(2784);let emptyCallbackFn=n=>n();function useControllableState({prop:n,defaultProp:l,onChange:u,strategy:f="prop-wins",preventUpdate:m,transition:g}){let[_,j]=(0,h.useState)(n??l),$=(0,h.useRef)(_),z="prop-wins"===f&&void 0!==n,ee=z?n:_,et=(0,d.z)(u||idFn),en=g?h.startTransition:emptyCallbackFn;(0,h.useEffect)(()=>{void 0!==n&&($.current=n,en(()=>{j(n)}))},[n]),(0,h.useEffect)(()=>{z||_!==$.current&&($.current=_,et(_))},[et,_,z]);let eo=(0,d.z)(n=>{if(!m){if(z){let l="function"==typeof n?n($.current):n;et(l)}else en(()=>{j(n)})}});return[ee,eo]}let idFn=()=>{}},73516:function(n,l,u){"use strict";u.d(l,{SZ:function(){return useDidFinishSSR}});var d=u(2784);let emptyFn=()=>{},emptyFnFn=()=>emptyFn;function useDidFinishSSR(n,l){if(l?.sync)return(0,d.useSyncExternalStore)(emptyFnFn,()=>n??!0,()=>!1);let[u,h]=(0,d.useState)(n);return(0,d.useEffect)(()=>{h(n??!0)},[]),u??!1}},41678:function(n,l,u){"use strict";u.d(l,{z:function(){return useEvent}});var d=u(99810),h=u(2784);function useEvent(n){return function(n,l,u){let f=(0,h.useRef)(l??n);return(0,d.LI)(()=>{f.current=n}),(0,h.useCallback)(u?(...n)=>f.current?.apply(null,n):()=>f.current,[])}(n,defaultValue,!0)}let defaultValue=()=>{throw Error("Cannot call an event handler while rendering.")}},43397:function(n,l,u){"use strict";u.d(l,{Oy:function(){return f},il:function(){return ResetPresence},hO:function(){return useIsPresent},oO:function(){return usePresence}});var d=u(2784),h=u(52322);let f=(0,d.createContext)(null),ResetPresence=n=>(0,h.jsx)(f.Provider,{value:null,children:n.children});function usePresence(){let n=(0,d.useContext)(f);if(!n)return[!0,null,n];let{id:l,isPresent:u,onExitComplete:h,register:m}=n;return(0,d.useEffect)(()=>m(l),[]),!u&&h?[!1,()=>h?.(l),n]:[!0,void 0,n]}function useIsPresent(){var n;return null===(n=(0,d.useContext)(f))||n.isPresent}},17860:function(n,l,u){"use strict";u.d(l,{T:function(){return h}});var d=u(11444);let h=(0,d.styled)(d.Text,{position:"absolute",width:1,height:1,margin:-1,zIndex:-1e4,overflow:"hidden",opacity:1e-8,pointerEvents:"none",variants:{preserveDimensions:{true:{position:"relative",width:"auto",height:"auto"}},visible:{true:{position:"relative",width:"auto",height:"auto",margin:0,zIndex:1,overflow:"visible",opacity:1,pointerEvents:"auto"}}}});h.isVisuallyHidden=!0},85289:function(n,l,u){"use strict";u.d(l,{j:function(){return f}});var d=u(22436),h=u(36370);let FocusManager=class FocusManager extends d.l{constructor(){super(),this.setup=n=>{if(!h.sk&&window.addEventListener){let listener=()=>n();return window.addEventListener("visibilitychange",listener,!1),window.addEventListener("focus",listener,!1),()=>{window.removeEventListener("visibilitychange",listener),window.removeEventListener("focus",listener)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var n;null==(n=this.cleanup)||n.call(this),this.cleanup=void 0}}setEventListener(n){var l;this.setup=n,null==(l=this.cleanup)||l.call(this),this.cleanup=n(n=>{"boolean"==typeof n?this.setFocused(n):this.onFocus()})}setFocused(n){let l=this.focused!==n;l&&(this.focused=n,this.onFocus())}onFocus(){this.listeners.forEach(({listener:n})=>{n()})}isFocused(){return"boolean"==typeof this.focused?this.focused:"undefined"==typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}};let f=new FocusManager},54388:function(n,l,u){"use strict";function infiniteQueryBehavior(){return{onFetch:n=>{n.fetchFn=()=>{var l,u,d,h,f,m;let g;let _=null==(l=n.fetchOptions)?void 0:null==(u=l.meta)?void 0:u.refetchPage,j=null==(d=n.fetchOptions)?void 0:null==(h=d.meta)?void 0:h.fetchMore,$=null==j?void 0:j.pageParam,z=(null==j?void 0:j.direction)==="forward",ee=(null==j?void 0:j.direction)==="backward",et=(null==(f=n.state.data)?void 0:f.pages)||[],en=(null==(m=n.state.data)?void 0:m.pageParams)||[],eo=en,es=!1,addSignalProperty=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>{var l,u;return null!=(l=n.signal)&&l.aborted?es=!0:null==(u=n.signal)||u.addEventListener("abort",()=>{es=!0}),n.signal}})},el=n.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+n.options.queryHash+"'")),buildNewPages=(n,l,u,d)=>(eo=d?[l,...eo]:[...eo,l],d?[u,...n]:[...n,u]),fetchPage=(l,u,d,h)=>{if(es)return Promise.reject("Cancelled");if(void 0===d&&!u&&l.length)return Promise.resolve(l);let f={queryKey:n.queryKey,pageParam:d,meta:n.options.meta};addSignalProperty(f);let m=el(f),g=Promise.resolve(m).then(n=>buildNewPages(l,d,n,h));return g};if(et.length){if(z){let l=void 0!==$,u=l?$:getNextPageParam(n.options,et);g=fetchPage(et,l,u)}else if(ee){let l=void 0!==$,u=l?$:getPreviousPageParam(n.options,et);g=fetchPage(et,l,u,!0)}else{eo=[];let l=void 0===n.options.getNextPageParam,u=!_||!et[0]||_(et[0],0,et);g=u?fetchPage([],l,en[0]):Promise.resolve(buildNewPages([],en[0],et[0]));for(let u=1;u<et.length;u++)g=g.then(d=>{let h=!_||!et[u]||_(et[u],u,et);if(h){let h=l?en[u]:getNextPageParam(n.options,d);return fetchPage(d,l,h)}return Promise.resolve(buildNewPages(d,en[u],et[u]))})}}else g=fetchPage([]);let eu=g.then(n=>({pages:n,pageParams:eo}));return eu}}}}function getNextPageParam(n,l){return null==n.getNextPageParam?void 0:n.getNextPageParam(l[l.length-1],l)}function getPreviousPageParam(n,l){return null==n.getPreviousPageParam?void 0:n.getPreviousPageParam(l[0],l)}function hasNextPage(n,l){if(n.getNextPageParam&&Array.isArray(l)){let u=getNextPageParam(n,l);return null!=u&&!1!==u}}function hasPreviousPage(n,l){if(n.getPreviousPageParam&&Array.isArray(l)){let u=getPreviousPageParam(n,l);return null!=u&&!1!==u}}u.d(l,{Gm:function(){return infiniteQueryBehavior},Qy:function(){return hasNextPage},ZF:function(){return hasPreviousPage}})},714:function(n,l,u){"use strict";u.d(l,{_:function(){return d}});let d=console},96278:function(n,l,u){"use strict";u.d(l,{R:function(){return getDefaultState},m:function(){return Mutation}});var d=u(714),h=u(3709),f=u(53429),m=u(3241);let Mutation=class Mutation extends f.F{constructor(n){super(),this.defaultOptions=n.defaultOptions,this.mutationId=n.mutationId,this.mutationCache=n.mutationCache,this.logger=n.logger||d._,this.observers=[],this.state=n.state||getDefaultState(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options={...this.defaultOptions,...n},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(n){this.dispatch({type:"setState",state:n})}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.observers=this.observers.filter(l=>l!==n),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.observers.length||("loading"===this.state.status?this.scheduleGc():this.mutationCache.remove(this))}continue(){var n,l;return null!=(n=null==(l=this.retryer)?void 0:l.continue())?n:this.execute()}async execute(){var n,l,u,d,h,f,g,_,j,$,z,ee,et,en,eo,es,el,eu,ec,eh;let ep="loading"===this.state.status;try{if(!ep){this.dispatch({type:"loading",variables:this.options.variables}),await (null==(j=($=this.mutationCache.config).onMutate)?void 0:j.call($,this.state.variables,this));let n=await (null==(z=(ee=this.options).onMutate)?void 0:z.call(ee,this.state.variables));n!==this.state.context&&this.dispatch({type:"loading",context:n,variables:this.state.variables})}let et=await (()=>{var n;return this.retryer=(0,m.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(n,l)=>{this.dispatch({type:"failed",failureCount:n,error:l})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:null!=(n=this.options.retry)?n:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise})();return await (null==(n=(l=this.mutationCache.config).onSuccess)?void 0:n.call(l,et,this.state.variables,this.state.context,this)),await (null==(u=(d=this.options).onSuccess)?void 0:u.call(d,et,this.state.variables,this.state.context)),await (null==(h=(f=this.mutationCache.config).onSettled)?void 0:h.call(f,et,null,this.state.variables,this.state.context,this)),await (null==(g=(_=this.options).onSettled)?void 0:g.call(_,et,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:et}),et}catch(n){try{throw await (null==(et=(en=this.mutationCache.config).onError)?void 0:et.call(en,n,this.state.variables,this.state.context,this)),await (null==(eo=(es=this.options).onError)?void 0:eo.call(es,n,this.state.variables,this.state.context)),await (null==(el=(eu=this.mutationCache.config).onSettled)?void 0:el.call(eu,void 0,n,this.state.variables,this.state.context,this)),await (null==(ec=(eh=this.options).onSettled)?void 0:ec.call(eh,void 0,n,this.state.variables,this.state.context)),n}finally{this.dispatch({type:"error",error:n})}}}dispatch(n){this.state=(l=>{switch(n.type){case"failed":return{...l,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"loading":return{...l,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!(0,m.Kw)(this.options.networkMode),status:"loading",variables:n.variables};case"success":return{...l,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:n.error,failureCount:l.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"};case"setState":return{...l,...n.state}}})(this.state),h.V.batch(()=>{this.observers.forEach(l=>{l.onMutationUpdate(n)}),this.mutationCache.notify({mutation:this,type:"updated",action:n})})}};function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}},3709:function(n,l,u){"use strict";u.d(l,{V:function(){return h}});var d=u(36370);let h=function(){let n=[],l=0,notifyFn=n=>{n()},batchNotifyFn=n=>{n()},schedule=u=>{l?n.push(u):(0,d.A4)(()=>{notifyFn(u)})},flush=()=>{let l=n;n=[],l.length&&(0,d.A4)(()=>{batchNotifyFn(()=>{l.forEach(n=>{notifyFn(n)})})})};return{batch:n=>{let u;l++;try{u=n()}finally{--l||flush()}return u},batchCalls:n=>(...l)=>{schedule(()=>{n(...l)})},schedule,setNotifyFunction:n=>{notifyFn=n},setBatchNotifyFunction:n=>{batchNotifyFn=n}}}()},63240:function(n,l,u){"use strict";u.d(l,{N:function(){return m}});var d=u(22436),h=u(36370);let f=["online","offline"];let OnlineManager=class OnlineManager extends d.l{constructor(){super(),this.setup=n=>{if(!h.sk&&window.addEventListener){let listener=()=>n();return f.forEach(n=>{window.addEventListener(n,listener,!1)}),()=>{f.forEach(n=>{window.removeEventListener(n,listener)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var n;null==(n=this.cleanup)||n.call(this),this.cleanup=void 0}}setEventListener(n){var l;this.setup=n,null==(l=this.cleanup)||l.call(this),this.cleanup=n(n=>{"boolean"==typeof n?this.setOnline(n):this.onOnline()})}setOnline(n){let l=this.online!==n;l&&(this.online=n,this.onOnline())}onOnline(){this.listeners.forEach(({listener:n})=>{n()})}isOnline(){return"boolean"==typeof this.online?this.online:"undefined"==typeof navigator||void 0===navigator.onLine||navigator.onLine}};let m=new OnlineManager},91578:function(n,l,u){"use strict";u.d(l,{z:function(){return QueryObserver}});var d=u(36370),h=u(3709),f=u(85289),m=u(22436),g=u(3241);let QueryObserver=class QueryObserver extends m.l{constructor(n,l){super(),this.client=n,this.options=l,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(l)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.currentQuery.addObserver(this),shouldFetchOnMount(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(n,l){let u=this.options,h=this.currentQuery;if(this.options=this.client.defaultQueryOptions(n),(0,d.VS)(u,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled)throw Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=u.queryKey),this.updateQuery();let f=this.hasListeners();f&&shouldFetchOptionally(this.currentQuery,h,this.options,u)&&this.executeFetch(),this.updateResult(l),f&&(this.currentQuery!==h||this.options.enabled!==u.enabled||this.options.staleTime!==u.staleTime)&&this.updateStaleTimeout();let m=this.computeRefetchInterval();f&&(this.currentQuery!==h||this.options.enabled!==u.enabled||m!==this.currentRefetchInterval)&&this.updateRefetchInterval(m)}getOptimisticResult(n){let l=this.client.getQueryCache().build(this.client,n),u=this.createResult(l,n);return n.keepPreviousData||(void 0!==n.placeholderData?!u.isPlaceholderData:(0,d.VS)(this.getCurrentResult(),u))||(this.currentResult=u,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),u}getCurrentResult(){return this.currentResult}trackResult(n){let l={};return Object.keys(n).forEach(u=>{Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(u),n[u])})}),l}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:n,...l}={}){return this.fetch({...l,meta:{refetchPage:n}})}fetchOptimistic(n){let l=this.client.defaultQueryOptions(n),u=this.client.getQueryCache().build(this.client,l);return u.isFetchingOptimistic=!0,u.fetch().then(()=>this.createResult(u,l))}fetch(n){var l;return this.executeFetch({...n,cancelRefetch:null==(l=n.cancelRefetch)||l}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(n){this.updateQuery();let l=this.currentQuery.fetch(this.options,n);return null!=n&&n.throwOnError||(l=l.catch(d.ZT)),l}updateStaleTimeout(){if(this.clearStaleTimeout(),d.sk||this.currentResult.isStale||!(0,d.PN)(this.options.staleTime))return;let n=(0,d.Kp)(this.currentResult.dataUpdatedAt,this.options.staleTime);this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n+1)}computeRefetchInterval(){var n;return"function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.currentResult.data,this.currentQuery):null!=(n=this.options.refetchInterval)&&n}updateRefetchInterval(n){this.clearRefetchInterval(),this.currentRefetchInterval=n,!d.sk&&!1!==this.options.enabled&&(0,d.PN)(this.currentRefetchInterval)&&0!==this.currentRefetchInterval&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||f.j.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(n,l){let u;let h=this.currentQuery,f=this.options,m=this.currentResult,_=this.currentResultState,j=this.currentResultOptions,$=n!==h,z=$?n.state:this.currentQueryInitialState,ee=$?this.currentResult:this.previousQueryResult,{state:et}=n,{dataUpdatedAt:en,error:eo,errorUpdatedAt:es,fetchStatus:el,status:eu}=et,ec=!1,eh=!1;if(l._optimisticResults){let u=this.hasListeners(),d=!u&&shouldFetchOnMount(n,l),m=u&&shouldFetchOptionally(n,h,l,f);(d||m)&&(el=(0,g.Kw)(n.options.networkMode)?"fetching":"paused",en||(eu="loading")),"isRestoring"===l._optimisticResults&&(el="idle")}if(l.keepPreviousData&&!et.dataUpdatedAt&&null!=ee&&ee.isSuccess&&"error"!==eu)u=ee.data,en=ee.dataUpdatedAt,eu=ee.status,ec=!0;else if(l.select&&void 0!==et.data){if(m&&et.data===(null==_?void 0:_.data)&&l.select===this.selectFn)u=this.selectResult;else try{this.selectFn=l.select,u=l.select(et.data),u=(0,d.oE)(null==m?void 0:m.data,u,l),this.selectResult=u,this.selectError=null}catch(n){this.selectError=n}}else u=et.data;if(void 0!==l.placeholderData&&void 0===u&&"loading"===eu){let n;if(null!=m&&m.isPlaceholderData&&l.placeholderData===(null==j?void 0:j.placeholderData))n=m.data;else if(n="function"==typeof l.placeholderData?l.placeholderData():l.placeholderData,l.select&&void 0!==n)try{n=l.select(n),this.selectError=null}catch(n){this.selectError=n}void 0!==n&&(eu="success",u=(0,d.oE)(null==m?void 0:m.data,n,l),eh=!0)}this.selectError&&(eo=this.selectError,u=this.selectResult,es=Date.now(),eu="error");let ep="fetching"===el,ef="loading"===eu,em="error"===eu,eg={status:eu,fetchStatus:el,isLoading:ef,isSuccess:"success"===eu,isError:em,isInitialLoading:ef&&ep,data:u,dataUpdatedAt:en,error:eo,errorUpdatedAt:es,failureCount:et.fetchFailureCount,failureReason:et.fetchFailureReason,errorUpdateCount:et.errorUpdateCount,isFetched:et.dataUpdateCount>0||et.errorUpdateCount>0,isFetchedAfterMount:et.dataUpdateCount>z.dataUpdateCount||et.errorUpdateCount>z.errorUpdateCount,isFetching:ep,isRefetching:ep&&!ef,isLoadingError:em&&0===et.dataUpdatedAt,isPaused:"paused"===el,isPlaceholderData:eh,isPreviousData:ec,isRefetchError:em&&0!==et.dataUpdatedAt,isStale:isStale(n,l),refetch:this.refetch,remove:this.remove};return eg}updateResult(n){let l=this.currentResult,u=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,(0,d.VS)(u,l))return;this.currentResult=u;let h={cache:!0};(null==n?void 0:n.listeners)!==!1&&(()=>{if(!l)return!0;let{notifyOnChangeProps:n}=this.options,u="function"==typeof n?n():n;if("all"===u||!u&&!this.trackedProps.size)return!0;let d=new Set(null!=u?u:this.trackedProps);return this.options.useErrorBoundary&&d.add("error"),Object.keys(this.currentResult).some(n=>{let u=this.currentResult[n]!==l[n];return u&&d.has(n)})})()&&(h.listeners=!0),this.notify({...h,...n})}updateQuery(){let n=this.client.getQueryCache().build(this.client,this.options);if(n===this.currentQuery)return;let l=this.currentQuery;this.currentQuery=n,this.currentQueryInitialState=n.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(null==l||l.removeObserver(this),n.addObserver(this))}onQueryUpdate(n){let l={};"success"===n.type?l.onSuccess=!n.manual:"error"!==n.type||(0,g.DV)(n.error)||(l.onError=!0),this.updateResult(l),this.hasListeners()&&this.updateTimers()}notify(n){h.V.batch(()=>{var l,u,d,h,f,m,g,_;n.onSuccess?(null==(l=(u=this.options).onSuccess)||l.call(u,this.currentResult.data),null==(d=(h=this.options).onSettled)||d.call(h,this.currentResult.data,null)):n.onError&&(null==(f=(m=this.options).onError)||f.call(m,this.currentResult.error),null==(g=(_=this.options).onSettled)||g.call(_,void 0,this.currentResult.error)),n.listeners&&this.listeners.forEach(({listener:n})=>{n(this.currentResult)}),n.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}};function shouldFetchOnMount(n,l){return!1!==l.enabled&&!n.state.dataUpdatedAt&&!("error"===n.state.status&&!1===l.retryOnMount)||n.state.dataUpdatedAt>0&&shouldFetchOn(n,l,l.refetchOnMount)}function shouldFetchOn(n,l,u){if(!1!==l.enabled){let d="function"==typeof u?u(n):u;return"always"===d||!1!==d&&isStale(n,l)}return!1}function shouldFetchOptionally(n,l,u,d){return!1!==u.enabled&&(n!==l||!1===d.enabled)&&(!u.suspense||"error"!==n.state.status)&&isStale(n,u)}function isStale(n,l){return n.isStaleByTime(l.staleTime)}},53429:function(n,l,u){"use strict";u.d(l,{F:function(){return Removable}});var d=u(36370);let Removable=class Removable{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,d.PN)(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(n){this.cacheTime=Math.max(this.cacheTime||0,null!=n?n:d.sk?1/0:3e5)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}},3241:function(n,l,u){"use strict";u.d(l,{DV:function(){return isCancelledError},Kw:function(){return canFetch},Mz:function(){return createRetryer}});var d=u(85289),h=u(63240),f=u(36370);function defaultRetryDelay(n){return Math.min(1e3*2**n,3e4)}function canFetch(n){return(null!=n?n:"online")!=="online"||h.N.isOnline()}let CancelledError=class CancelledError{constructor(n){this.revert=null==n?void 0:n.revert,this.silent=null==n?void 0:n.silent}};function isCancelledError(n){return n instanceof CancelledError}function createRetryer(n){let l,u,m,g=!1,_=0,j=!1,$=new Promise((n,l)=>{u=n,m=l}),shouldPause=()=>!d.j.isFocused()||"always"!==n.networkMode&&!h.N.isOnline(),resolve=d=>{j||(j=!0,null==n.onSuccess||n.onSuccess(d),null==l||l(),u(d))},reject=u=>{j||(j=!0,null==n.onError||n.onError(u),null==l||l(),m(u))},pause=()=>new Promise(u=>{l=n=>{let l=j||!shouldPause();return l&&u(n),l},null==n.onPause||n.onPause()}).then(()=>{l=void 0,j||null==n.onContinue||n.onContinue()}),run=()=>{let l;if(!j){try{l=n.fn()}catch(n){l=Promise.reject(n)}Promise.resolve(l).then(resolve).catch(l=>{var u,d;if(j)return;let h=null!=(u=n.retry)?u:3,m=null!=(d=n.retryDelay)?d:defaultRetryDelay,$="function"==typeof m?m(_,l):m,z=!0===h||"number"==typeof h&&_<h||"function"==typeof h&&h(_,l);if(g||!z){reject(l);return}_++,null==n.onFail||n.onFail(_,l),(0,f.Gh)($).then(()=>{if(shouldPause())return pause()}).then(()=>{g?reject(l):run()})})}};return canFetch(n.networkMode)?run():pause().then(run),{promise:$,cancel:l=>{j||(reject(new CancelledError(l)),null==n.abort||n.abort())},continue:()=>{let n=null==l?void 0:l();return n?$:Promise.resolve()},cancelRetry:()=>{g=!0},continueRetry:()=>{g=!1}}}},22436:function(n,l,u){"use strict";u.d(l,{l:function(){return Subscribable}});let Subscribable=class Subscribable{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){let l={listener:n};return this.listeners.add(l),this.onSubscribe(),()=>{this.listeners.delete(l),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},36370:function(n,l,u){"use strict";u.d(l,{A4:function(){return scheduleMicrotask},G9:function(){return getAbortController},Gh:function(){return sleep},I6:function(){return parseFilterArgs},Kp:function(){return timeUntilStale},PN:function(){return isValidTimeout},Rm:function(){return hashQueryKeyByOptions},SE:function(){return functionalUpdate},VS:function(){return shallowEqualObjects},X7:function(){return matchMutation},ZT:function(){return noop},_v:function(){return parseQueryArgs},_x:function(){return matchQuery},lV:function(){return parseMutationArgs},oE:function(){return replaceData},sk:function(){return d},to:function(){return partialMatchKey},yF:function(){return hashQueryKey}});let d="undefined"==typeof window||"Deno"in window;function noop(){}function functionalUpdate(n,l){return"function"==typeof n?n(l):n}function isValidTimeout(n){return"number"==typeof n&&n>=0&&n!==1/0}function timeUntilStale(n,l){return Math.max(n+(l||0)-Date.now(),0)}function parseQueryArgs(n,l,u){return isQueryKey(n)?"function"==typeof l?{...u,queryKey:n,queryFn:l}:{...l,queryKey:n}:n}function parseMutationArgs(n,l,u){return isQueryKey(n)?"function"==typeof l?{...u,mutationKey:n,mutationFn:l}:{...l,mutationKey:n}:"function"==typeof n?{...l,mutationFn:n}:{...n}}function parseFilterArgs(n,l,u){return isQueryKey(n)?[{...l,queryKey:n},u]:[n||{},l]}function matchQuery(n,l){let{type:u="all",exact:d,fetchStatus:h,predicate:f,queryKey:m,stale:g}=n;if(isQueryKey(m)){if(d){if(l.queryHash!==hashQueryKeyByOptions(m,l.options))return!1}else{if(!partialDeepEqual(l.queryKey,m))return!1}}if("all"!==u){let n=l.isActive();if("active"===u&&!n||"inactive"===u&&n)return!1}return("boolean"!=typeof g||l.isStale()===g)&&(void 0===h||h===l.state.fetchStatus)&&(!f||!!f(l))}function matchMutation(n,l){let{exact:u,fetching:d,predicate:h,mutationKey:f}=n;if(isQueryKey(f)){if(!l.options.mutationKey)return!1;if(u){if(hashQueryKey(l.options.mutationKey)!==hashQueryKey(f))return!1}else{if(!partialDeepEqual(l.options.mutationKey,f))return!1}}return("boolean"!=typeof d||"loading"===l.state.status===d)&&(!h||!!h(l))}function hashQueryKeyByOptions(n,l){let u=(null==l?void 0:l.queryKeyHashFn)||hashQueryKey;return u(n)}function hashQueryKey(n){return JSON.stringify(n,(n,l)=>isPlainObject(l)?Object.keys(l).sort().reduce((n,u)=>(n[u]=l[u],n),{}):l)}function partialMatchKey(n,l){return partialDeepEqual(n,l)}function partialDeepEqual(n,l){return n===l||typeof n==typeof l&&!!n&&!!l&&"object"==typeof n&&"object"==typeof l&&!Object.keys(l).some(u=>!partialDeepEqual(n[u],l[u]))}function shallowEqualObjects(n,l){if(n&&!l||l&&!n)return!1;for(let u in n)if(n[u]!==l[u])return!1;return!0}function isPlainArray(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function isPlainObject(n){if(!hasObjectPrototype(n))return!1;let l=n.constructor;if(void 0===l)return!0;let u=l.prototype;return!!(hasObjectPrototype(u)&&u.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(n){return"[object Object]"===Object.prototype.toString.call(n)}function isQueryKey(n){return Array.isArray(n)}function sleep(n){return new Promise(l=>{setTimeout(l,n)})}function scheduleMicrotask(n){sleep(0).then(n)}function getAbortController(){if("function"==typeof AbortController)return new AbortController}function replaceData(n,l,u){return null!=u.isDataEqual&&u.isDataEqual(n,l)?n:"function"==typeof u.structuralSharing?u.structuralSharing(n,l):!1!==u.structuralSharing?function replaceEqualDeep(n,l){if(n===l)return n;let u=isPlainArray(n)&&isPlainArray(l);if(u||isPlainObject(n)&&isPlainObject(l)){let d=u?n.length:Object.keys(n).length,h=u?l:Object.keys(l),f=h.length,m=u?[]:{},g=0;for(let d=0;d<f;d++){let f=u?d:h[d];m[f]=replaceEqualDeep(n[f],l[f]),m[f]===n[f]&&g++}return d===f&&g===d?n:m}return l}(n,l):l}},55830:function(n,l,u){"use strict";u.d(l,{NL:function(){return useQueryClient},aH:function(){return QueryClientProvider}});var d=u(2784);let h=d.createContext(void 0),f=d.createContext(!1);function getQueryClientContext(n,l){return n||(l&&"undefined"!=typeof window?(window.ReactQueryClientContext||(window.ReactQueryClientContext=h),window.ReactQueryClientContext):h)}let useQueryClient=({context:n}={})=>{let l=d.useContext(getQueryClientContext(n,d.useContext(f)));if(!l)throw Error("No QueryClient set, use QueryClientProvider to set one");return l},QueryClientProvider=({client:n,children:l,context:u,contextSharing:h=!1})=>{d.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]);let m=getQueryClientContext(u,h);return d.createElement(f.Provider,{value:!u&&h},d.createElement(m.Provider,{value:n},l))}},68158:function(n,l,u){"use strict";let d;u.d(l,{r:function(){return useBaseQuery}});var h=u(2784),f=u(3709),m=u(29930);let g=h.createContext((d=!1,{clearReset:()=>{d=!1},reset:()=>{d=!0},isReset:()=>d})),useQueryErrorResetBoundary=()=>h.useContext(g);var _=u(55830);let j=h.createContext(!1),useIsRestoring=()=>h.useContext(j);j.Provider;var $=u(99189);let ensurePreventErrorBoundaryRetry=(n,l)=>{(n.suspense||n.useErrorBoundary)&&!l.isReset()&&(n.retryOnMount=!1)},useClearResetErrorBoundary=n=>{h.useEffect(()=>{n.clearReset()},[n])},getHasError=({result:n,errorResetBoundary:l,useErrorBoundary:u,query:d})=>n.isError&&!l.isReset()&&!n.isFetching&&(0,$.L)(u,[n.error,d]),ensureStaleTime=n=>{n.suspense&&"number"!=typeof n.staleTime&&(n.staleTime=1e3)},willFetch=(n,l)=>n.isLoading&&n.isFetching&&!l,shouldSuspend=(n,l,u)=>(null==n?void 0:n.suspense)&&willFetch(l,u),fetchOptimistic=(n,l,u)=>l.fetchOptimistic(n).then(({data:l})=>{null==n.onSuccess||n.onSuccess(l),null==n.onSettled||n.onSettled(l,null)}).catch(l=>{u.clearReset(),null==n.onError||n.onError(l),null==n.onSettled||n.onSettled(void 0,l)});function useBaseQuery(n,l){let u=(0,_.NL)({context:n.context}),d=useIsRestoring(),g=useQueryErrorResetBoundary(),j=u.defaultQueryOptions(n);j._optimisticResults=d?"isRestoring":"optimistic",j.onError&&(j.onError=f.V.batchCalls(j.onError)),j.onSuccess&&(j.onSuccess=f.V.batchCalls(j.onSuccess)),j.onSettled&&(j.onSettled=f.V.batchCalls(j.onSettled)),ensureStaleTime(j),ensurePreventErrorBoundaryRetry(j,g),useClearResetErrorBoundary(g);let[$]=h.useState(()=>new l(u,j)),z=$.getOptimisticResult(j);if((0,m.$)(h.useCallback(n=>{let l=d?()=>void 0:$.subscribe(f.V.batchCalls(n));return $.updateResult(),l},[$,d]),()=>$.getCurrentResult(),()=>$.getCurrentResult()),h.useEffect(()=>{$.setOptions(j,{listeners:!1})},[j,$]),shouldSuspend(j,z,d))throw fetchOptimistic(j,$,g);if(getHasError({result:z,errorResetBoundary:g,useErrorBoundary:j.useErrorBoundary,query:$.getCurrentQuery()}))throw z.error;return j.notifyOnChangeProps?z:$.trackResult(z)}},58943:function(n,l,u){"use strict";u.d(l,{a:function(){return useQuery}});var d=u(36370),h=u(91578),f=u(68158);function useQuery(n,l,u){let m=(0,d._v)(n,l,u);return(0,f.r)(m,h.z)}},29930:function(n,l,u){"use strict";u.d(l,{$:function(){return h}});var d=u(43100);let h=d.useSyncExternalStore},99189:function(n,l,u){"use strict";function shouldThrowError(n,l){return"function"==typeof n?n(...l):!!n}u.d(l,{L:function(){return shouldThrowError}})},80855:function(n,l,u){"use strict";u.d(l,{w9:function(){return EmailAuthProvider},hJ:function(){return GoogleAuthProvider},O4:function(){return OAuthProvider},Xb:function(){return createUserWithEmailAndPassword},Nr:function(){return fetchSignInMethodsForEmail},gK:function(){return getAdditionalUserInfo},v0:function(){return getAuth},ZJ:function(){return linkWithCredential},k9:function(){return linkWithPopup},XB:function(){return signInAnonymously},e5:function(){return signInWithEmailAndPassword},rh:function(){return signInWithPopup}});var d,h=u(83395),f=u(96327),m=u(68207),g=u(22970),_=u(46387);function _prodErrorMap(){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."}}let j=new h.LL("auth","Firebase",_prodErrorMap()),$=new m.Yd("@firebase/auth");function _logError(n,...l){$.logLevel<=m.in.ERROR&&$.error(`Auth (${f.Jn}): ${n}`,...l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _fail(n,...l){throw createErrorInternal(n,...l)}function _createError(n,...l){return createErrorInternal(n,...l)}function _errorWithCustomMessage(n,l,u){let d=Object.assign(Object.assign({},_prodErrorMap()),{[l]:u}),f=new h.LL("auth","Firebase",d);return f.create(l,{appName:n.name})}function _assertInstanceOf(n,l,u){if(!(l instanceof u))throw u.name!==l.constructor.name&&_fail(n,"argument-error"),_errorWithCustomMessage(n,"argument-error",`Type of ${l.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function createErrorInternal(n,...l){if("string"!=typeof n){let u=l[0],d=[...l.slice(1)];return d[0]&&(d[0].appName=n.name),n._errorFactory.create(u,...d)}return j.create(n,...l)}function _assert(n,l,...u){if(!n)throw createErrorInternal(l,...u)}function debugFail(n){let l="INTERNAL ASSERTION FAILED: "+n;throw _logError(l),Error(l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _getCurrentUrl(){var n;return"undefined"!=typeof self&&(null===(n=self.location)||void 0===n?void 0:n.href)||""}function _isHttpOrHttps(){return"http:"===_getCurrentScheme()||"https:"===_getCurrentScheme()}function _getCurrentScheme(){var n;return"undefined"!=typeof self&&(null===(n=self.location)||void 0===n?void 0:n.protocol)||null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Delay=class Delay{constructor(n,l){this.shortDelay=n,this.longDelay=l,l>n||debugFail("Short delay should be less than long delay!"),this.isMobile=(0,h.uI)()||(0,h.b$)()}get(){return!("undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(_isHttpOrHttps()||(0,h.ru)()||"connection"in navigator))||navigator.onLine?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _emulatorUrl(n,l){n.emulator||debugFail("Emulator should always be set here");let{url:u}=n.emulator;return l?`${u}${l.startsWith("/")?l.slice(1):l}`:u}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FetchProvider=class FetchProvider{static initialize(n,l,u){this.fetchImpl=n,l&&(this.headersImpl=l),u&&(this.responseImpl=u)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:"undefined"!=typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!=typeof fetch?fetch:void debugFail("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:"undefined"!=typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!=typeof Headers?Headers:void debugFail("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:"undefined"!=typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!=typeof Response?Response:void debugFail("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let z={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",INVALID_LOGIN_CREDENTIALS:"invalid-credential",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",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",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"},ee=new Delay(3e4,6e4);function _addTidIfNecessary(n,l){return n.tenantId&&!l.tenantId?Object.assign(Object.assign({},l),{tenantId:n.tenantId}):l}async function _performApiRequest(n,l,u,d,f={}){return _performFetchWithErrorHandling(n,f,async()=>{let f={},m={};d&&("GET"===l?m=d:f={body:JSON.stringify(d)});let g=(0,h.xO)(Object.assign({key:n.config.apiKey},m)).slice(1),_=await n._getAdditionalHeaders();return _["Content-Type"]="application/json",n.languageCode&&(_["X-Firebase-Locale"]=n.languageCode),FetchProvider.fetch()(_getFinalTarget(n,n.config.apiHost,u,g),Object.assign({method:l,headers:_,referrerPolicy:"no-referrer"},f))})}async function _performFetchWithErrorHandling(n,l,u){n._canInitEmulator=!1;let d=Object.assign(Object.assign({},z),l);try{let l=new NetworkTimeout(n),h=await Promise.race([u(),l.promise]);l.clearNetworkTimeout();let f=await h.json();if("needConfirmation"in f)throw _makeTaggedError(n,"account-exists-with-different-credential",f);if(h.ok&&!("errorMessage"in f))return f;{let l=h.ok?f.errorMessage:f.error.message,[u,m]=l.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===u)throw _makeTaggedError(n,"credential-already-in-use",f);if("EMAIL_EXISTS"===u)throw _makeTaggedError(n,"email-already-in-use",f);if("USER_DISABLED"===u)throw _makeTaggedError(n,"user-disabled",f);let g=d[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(m)throw _errorWithCustomMessage(n,g,m);_fail(n,g)}}catch(l){if(l instanceof h.ZR)throw l;_fail(n,"network-request-failed",{message:String(l)})}}async function _performSignInRequest(n,l,u,d,h={}){let f=await _performApiRequest(n,l,u,d,h);return"mfaPendingCredential"in f&&_fail(n,"multi-factor-auth-required",{_serverResponse:f}),f}function _getFinalTarget(n,l,u,d){let h=`${l}${u}?${d}`;return n.config.emulator?_emulatorUrl(n.config,h):`${n.config.apiScheme}://${h}`}let NetworkTimeout=class NetworkTimeout{constructor(n){this.auth=n,this.timer=null,this.promise=new Promise((n,l)=>{this.timer=setTimeout(()=>l(_createError(this.auth,"network-request-failed")),ee.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}};function _makeTaggedError(n,l,u){let d={appName:n.name};u.email&&(d.email=u.email),u.phoneNumber&&(d.phoneNumber=u.phoneNumber);let h=_createError(n,l,d);return h.customData._tokenResponse=u,h}function isEnterprise(n){return void 0!==n&&void 0!==n.enterprise}let RecaptchaConfig=class RecaptchaConfig{constructor(n){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===n.recaptchaKey)throw Error("recaptchaKey undefined");this.siteKey=n.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=n.recaptchaEnforcementState}getProviderEnforcementState(n){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(let l of this.recaptchaEnforcementState)if(l.provider&&l.provider===n)return function(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}(l.enforcementState);return null}isProviderEnabled(n){return"ENFORCE"===this.getProviderEnforcementState(n)||"AUDIT"===this.getProviderEnforcementState(n)}};async function getRecaptchaConfig(n,l){return _performApiRequest(n,"GET","/v2/recaptchaConfig",_addTidIfNecessary(n,l))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function deleteAccount(n,l){return _performApiRequest(n,"POST","/v1/accounts:delete",l)}async function getAccountInfo(n,l){return _performApiRequest(n,"POST","/v1/accounts:lookup",l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function utcTimestampToDateString(n){if(n)try{let l=new Date(Number(n));if(!isNaN(l.getTime()))return l.toUTCString()}catch(n){}}async function getIdTokenResult(n,l=!1){let u=(0,h.m9)(n),d=await u.getIdToken(l),f=_parseToken(d);_assert(f&&f.exp&&f.auth_time&&f.iat,u.auth,"internal-error");let m="object"==typeof f.firebase?f.firebase:void 0,g=null==m?void 0:m.sign_in_provider;return{claims:f,token:d,authTime:utcTimestampToDateString(secondsStringToMilliseconds(f.auth_time)),issuedAtTime:utcTimestampToDateString(secondsStringToMilliseconds(f.iat)),expirationTime:utcTimestampToDateString(secondsStringToMilliseconds(f.exp)),signInProvider:g||null,signInSecondFactor:(null==m?void 0:m.sign_in_second_factor)||null}}function secondsStringToMilliseconds(n){return 1e3*Number(n)}function _parseToken(n){let[l,u,d]=n.split(".");if(void 0===l||void 0===u||void 0===d)return _logError("JWT malformed, contained fewer than 3 sections"),null;try{let n=(0,h.tV)(u);if(!n)return _logError("Failed to decode base64 JWT payload"),null;return JSON.parse(n)}catch(n){return _logError("Caught error parsing JWT payload as JSON",null==n?void 0:n.toString()),null}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function _logoutIfInvalidated(n,l,u=!1){if(u)return l;try{return await l}catch(l){throw l instanceof h.ZR&&function({code:n}){return"auth/user-disabled"===n||"auth/user-token-expired"===n}(l)&&n.auth.currentUser===n&&await n.auth.signOut(),l}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ProactiveRefresh=class ProactiveRefresh{constructor(n){this.user=n,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(n){var l;if(n){let n=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),n}{this.errorBackoff=3e4;let n=null!==(l=this.user.stsTokenManager.expirationTime)&&void 0!==l?l:0,u=n-Date.now()-3e5;return Math.max(0,u)}}schedule(n=!1){if(!this.isRunning)return;let l=this.getInterval(n);this.timerId=setTimeout(async()=>{await this.iteration()},l)}async iteration(){try{await this.user.getIdToken(!0)}catch(n){(null==n?void 0:n.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let UserMetadata=class UserMetadata{constructor(n,l){this.createdAt=n,this.lastLoginAt=l,this._initializeTime()}_initializeTime(){this.lastSignInTime=utcTimestampToDateString(this.lastLoginAt),this.creationTime=utcTimestampToDateString(this.createdAt)}_copy(n){this.createdAt=n.createdAt,this.lastLoginAt=n.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function _reloadWithoutSaving(n){var l;let u=n.auth,d=await n.getIdToken(),h=await _logoutIfInvalidated(n,getAccountInfo(u,{idToken:d}));_assert(null==h?void 0:h.users.length,u,"internal-error");let f=h.users[0];n._notifyReloadListener(f);let m=(null===(l=f.providerUserInfo)||void 0===l?void 0:l.length)?f.providerUserInfo.map(n=>{var{providerId:l}=n,u=(0,g._T)(n,["providerId"]);return{providerId:l,uid:u.rawId||"",displayName:u.displayName||null,email:u.email||null,phoneNumber:u.phoneNumber||null,photoURL:u.photoUrl||null}}):[],_=function(n,l){let u=n.filter(n=>!l.some(l=>l.providerId===n.providerId));return[...u,...l]}(n.providerData,m),j=n.isAnonymous,$=!(n.email&&f.passwordHash)&&!(null==_?void 0:_.length),z={uid:f.localId,displayName:f.displayName||null,photoURL:f.photoUrl||null,email:f.email||null,emailVerified:f.emailVerified||!1,phoneNumber:f.phoneNumber||null,tenantId:f.tenantId||null,providerData:_,metadata:new UserMetadata(f.createdAt,f.lastLoginAt),isAnonymous:!!j&&$};Object.assign(n,z)}async function reload(n){let l=(0,h.m9)(n);await _reloadWithoutSaving(l),await l.auth._persistUserIfCurrent(l),l.auth._notifyListenersIfCurrent(l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function requestStsToken(n,l){let u=await _performFetchWithErrorHandling(n,{},async()=>{let u=(0,h.xO)({grant_type:"refresh_token",refresh_token:l}).slice(1),{tokenApiHost:d,apiKey:f}=n.config,m=_getFinalTarget(n,d,"/v1/token",`key=${f}`),g=await n._getAdditionalHeaders();return g["Content-Type"]="application/x-www-form-urlencoded",FetchProvider.fetch()(m,{method:"POST",headers:g,body:u})});return{accessToken:u.access_token,expiresIn:u.expires_in,refreshToken:u.refresh_token}}async function revokeToken(n,l){return _performApiRequest(n,"POST","/v2/accounts:revokeToken",_addTidIfNecessary(n,l))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let StsTokenManager=class StsTokenManager{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(n){_assert(n.idToken,"internal-error"),_assert(void 0!==n.idToken,"internal-error"),_assert(void 0!==n.refreshToken,"internal-error");let l="expiresIn"in n&&void 0!==n.expiresIn?Number(n.expiresIn):function(n){let l=_parseToken(n);return _assert(l,"internal-error"),_assert(void 0!==l.exp,"internal-error"),_assert(void 0!==l.iat,"internal-error"),Number(l.exp)-Number(l.iat)}(n.idToken);this.updateTokensAndExpiration(n.idToken,n.refreshToken,l)}async getToken(n,l=!1){return(_assert(!this.accessToken||this.refreshToken,n,"user-token-expired"),l||!this.accessToken||this.isExpired)?this.refreshToken?(await this.refresh(n,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(n,l){let{accessToken:u,refreshToken:d,expiresIn:h}=await requestStsToken(n,l);this.updateTokensAndExpiration(u,d,Number(h))}updateTokensAndExpiration(n,l,u){this.refreshToken=l||null,this.accessToken=n||null,this.expirationTime=Date.now()+1e3*u}static fromJSON(n,l){let{refreshToken:u,accessToken:d,expirationTime:h}=l,f=new StsTokenManager;return u&&(_assert("string"==typeof u,"internal-error",{appName:n}),f.refreshToken=u),d&&(_assert("string"==typeof d,"internal-error",{appName:n}),f.accessToken=d),h&&(_assert("number"==typeof h,"internal-error",{appName:n}),f.expirationTime=h),f}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(n){this.accessToken=n.accessToken,this.refreshToken=n.refreshToken,this.expirationTime=n.expirationTime}_clone(){return Object.assign(new StsTokenManager,this.toJSON())}_performRefresh(){return debugFail("not implemented")}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function assertStringOrUndefined(n,l){_assert("string"==typeof n||void 0===n,"internal-error",{appName:l})}let UserImpl=class UserImpl{constructor(n){var{uid:l,auth:u,stsTokenManager:d}=n,h=(0,g._T)(n,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new ProactiveRefresh(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=l,this.auth=u,this.stsTokenManager=d,this.accessToken=d.accessToken,this.displayName=h.displayName||null,this.email=h.email||null,this.emailVerified=h.emailVerified||!1,this.phoneNumber=h.phoneNumber||null,this.photoURL=h.photoURL||null,this.isAnonymous=h.isAnonymous||!1,this.tenantId=h.tenantId||null,this.providerData=h.providerData?[...h.providerData]:[],this.metadata=new UserMetadata(h.createdAt||void 0,h.lastLoginAt||void 0)}async getIdToken(n){let l=await _logoutIfInvalidated(this,this.stsTokenManager.getToken(this.auth,n));return _assert(l,this.auth,"internal-error"),this.accessToken!==l&&(this.accessToken=l,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),l}getIdTokenResult(n){return getIdTokenResult(this,n)}reload(){return reload(this)}_assign(n){this!==n&&(_assert(this.uid===n.uid,this.auth,"internal-error"),this.displayName=n.displayName,this.photoURL=n.photoURL,this.email=n.email,this.emailVerified=n.emailVerified,this.phoneNumber=n.phoneNumber,this.isAnonymous=n.isAnonymous,this.tenantId=n.tenantId,this.providerData=n.providerData.map(n=>Object.assign({},n)),this.metadata._copy(n.metadata),this.stsTokenManager._assign(n.stsTokenManager))}_clone(n){let l=new UserImpl(Object.assign(Object.assign({},this),{auth:n,stsTokenManager:this.stsTokenManager._clone()}));return l.metadata._copy(this.metadata),l}_onReload(n){_assert(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=n,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(n){this.reloadListener?this.reloadListener(n):this.reloadUserInfo=n}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(n,l=!1){let u=!1;n.idToken&&n.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(n),u=!0),l&&await _reloadWithoutSaving(this),await this.auth._persistUserIfCurrent(this),u&&this.auth._notifyListenersIfCurrent(this)}async delete(){let n=await this.getIdToken();return await _logoutIfInvalidated(this,deleteAccount(this.auth,{idToken:n})),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(n=>Object.assign({},n)),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(n,l){var u,d,h,f,m,g,_,j;let $=null!==(u=l.displayName)&&void 0!==u?u:void 0,z=null!==(d=l.email)&&void 0!==d?d:void 0,ee=null!==(h=l.phoneNumber)&&void 0!==h?h:void 0,et=null!==(f=l.photoURL)&&void 0!==f?f:void 0,en=null!==(m=l.tenantId)&&void 0!==m?m:void 0,eo=null!==(g=l._redirectEventId)&&void 0!==g?g:void 0,es=null!==(_=l.createdAt)&&void 0!==_?_:void 0,el=null!==(j=l.lastLoginAt)&&void 0!==j?j:void 0,{uid:eu,emailVerified:ec,isAnonymous:eh,providerData:ep,stsTokenManager:ef}=l;_assert(eu&&ef,n,"internal-error");let em=StsTokenManager.fromJSON(this.name,ef);_assert("string"==typeof eu,n,"internal-error"),assertStringOrUndefined($,n.name),assertStringOrUndefined(z,n.name),_assert("boolean"==typeof ec,n,"internal-error"),_assert("boolean"==typeof eh,n,"internal-error"),assertStringOrUndefined(ee,n.name),assertStringOrUndefined(et,n.name),assertStringOrUndefined(en,n.name),assertStringOrUndefined(eo,n.name),assertStringOrUndefined(es,n.name),assertStringOrUndefined(el,n.name);let eg=new UserImpl({uid:eu,auth:n,email:z,emailVerified:ec,displayName:$,isAnonymous:eh,photoURL:et,phoneNumber:ee,tenantId:en,stsTokenManager:em,createdAt:es,lastLoginAt:el});return ep&&Array.isArray(ep)&&(eg.providerData=ep.map(n=>Object.assign({},n))),eo&&(eg._redirectEventId=eo),eg}static async _fromIdTokenResponse(n,l,u=!1){let d=new StsTokenManager;d.updateFromServerResponse(l);let h=new UserImpl({uid:l.localId,auth:n,stsTokenManager:d,isAnonymous:u});return await _reloadWithoutSaving(h),h}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let et=new Map;function _getInstance(n){n instanceof Function||debugFail("Expected a class definition");let l=et.get(n);return l?l instanceof n||debugFail("Instance stored in cache mismatched with class"):(l=new n,et.set(n,l)),l}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let InMemoryPersistence=class InMemoryPersistence{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(n,l){this.storage[n]=l}async _get(n){let l=this.storage[n];return void 0===l?null:l}async _remove(n){delete this.storage[n]}_addListener(n,l){}_removeListener(n,l){}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _persistenceKeyName(n,l,u){return`firebase:${n}:${l}:${u}`}InMemoryPersistence.type="NONE";let PersistenceUserManager=class PersistenceUserManager{constructor(n,l,u){this.persistence=n,this.auth=l,this.userKey=u;let{config:d,name:h}=this.auth;this.fullUserKey=_persistenceKeyName(this.userKey,d.apiKey,h),this.fullPersistenceKey=_persistenceKeyName("persistence",d.apiKey,h),this.boundEventHandler=l._onStorageEvent.bind(l),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(n){return this.persistence._set(this.fullUserKey,n.toJSON())}async getCurrentUser(){let n=await this.persistence._get(this.fullUserKey);return n?UserImpl._fromJSON(this.auth,n):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(n){if(this.persistence===n)return;let l=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=n,l)return this.setCurrentUser(l)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(n,l,u="authUser"){if(!l.length)return new PersistenceUserManager(_getInstance(InMemoryPersistence),n,u);let d=(await Promise.all(l.map(async n=>{if(await n._isAvailable())return n}))).filter(n=>n),h=d[0]||_getInstance(InMemoryPersistence),f=_persistenceKeyName(u,n.config.apiKey,n.name),m=null;for(let u of l)try{let l=await u._get(f);if(l){let d=UserImpl._fromJSON(n,l);u!==h&&(m=d),h=u;break}}catch(n){}let g=d.filter(n=>n._shouldAllowMigration);return h._shouldAllowMigration&&g.length&&(h=g[0],m&&await h._set(f,m.toJSON()),await Promise.all(l.map(async n=>{if(n!==h)try{await n._remove(f)}catch(n){}}))),new PersistenceUserManager(h,n,u)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _getBrowserName(n){let l=n.toLowerCase();if(l.includes("opera/")||l.includes("opr/")||l.includes("opios/"))return"Opera";if(_isIEMobile(l))return"IEMobile";if(l.includes("msie")||l.includes("trident/"))return"IE";{if(l.includes("edge/"))return"Edge";if(_isFirefox(l))return"Firefox";if(l.includes("silk/"))return"Silk";if(_isBlackBerry(l))return"Blackberry";if(_isWebOS(l))return"Webos";if(_isSafari(l))return"Safari";if((l.includes("chrome/")||_isChromeIOS(l))&&!l.includes("edge/"))return"Chrome";if(_isAndroid(l))return"Android";let u=n.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if((null==u?void 0:u.length)===2)return u[1]}return"Other"}function _isFirefox(n=(0,h.z$)()){return/firefox\//i.test(n)}function _isSafari(n=(0,h.z$)()){let l=n.toLowerCase();return l.includes("safari/")&&!l.includes("chrome/")&&!l.includes("crios/")&&!l.includes("android")}function _isChromeIOS(n=(0,h.z$)()){return/crios\//i.test(n)}function _isIEMobile(n=(0,h.z$)()){return/iemobile/i.test(n)}function _isAndroid(n=(0,h.z$)()){return/android/i.test(n)}function _isBlackBerry(n=(0,h.z$)()){return/blackberry/i.test(n)}function _isWebOS(n=(0,h.z$)()){return/webos/i.test(n)}function _isIOS(n=(0,h.z$)()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function _isMobileBrowser(n=(0,h.z$)()){return _isIOS(n)||_isAndroid(n)||_isWebOS(n)||_isBlackBerry(n)||/windows phone/i.test(n)||_isIEMobile(n)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _getClientVersion(n,l=[]){let u;switch(n){case"Browser":u=_getBrowserName((0,h.z$)());break;case"Worker":u=`${_getBrowserName((0,h.z$)())}-${n}`;break;default:u=n}let d=l.length?l.join(","):"FirebaseCore-web";return`${u}/JsCore/${f.Jn}/${d}`}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let AuthMiddlewareQueue=class AuthMiddlewareQueue{constructor(n){this.auth=n,this.queue=[]}pushCallback(n,l){let wrappedCallback=l=>new Promise((u,d)=>{try{let d=n(l);u(d)}catch(n){d(n)}});wrappedCallback.onAbort=l,this.queue.push(wrappedCallback);let u=this.queue.length-1;return()=>{this.queue[u]=()=>Promise.resolve()}}async runMiddleware(n){if(this.auth.currentUser===n)return;let l=[];try{for(let u of this.queue)await u(n),u.onAbort&&l.push(u.onAbort)}catch(n){for(let n of(l.reverse(),l))try{n()}catch(n){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==n?void 0:n.message})}}};/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function _getPasswordPolicy(n,l={}){return _performApiRequest(n,"GET","/v2/passwordPolicy",_addTidIfNecessary(n,l))}let PasswordPolicyImpl=class PasswordPolicyImpl{constructor(n){var l,u,d,h;let f=n.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(l=f.minPasswordLength)&&void 0!==l?l:6,f.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=f.maxPasswordLength),void 0!==f.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=f.containsLowercaseCharacter),void 0!==f.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=f.containsUppercaseCharacter),void 0!==f.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=f.containsNumericCharacter),void 0!==f.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=f.containsNonAlphanumericCharacter),this.enforcementState=n.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(d=null===(u=n.allowedNonAlphanumericCharacters)||void 0===u?void 0:u.join(""))&&void 0!==d?d:"",this.forceUpgradeOnSignin=null!==(h=n.forceUpgradeOnSignin)&&void 0!==h&&h,this.schemaVersion=n.schemaVersion}validatePassword(n){var l,u,d,h,f,m;let g={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(n,g),this.validatePasswordCharacterOptions(n,g),g.isValid&&(g.isValid=null===(l=g.meetsMinPasswordLength)||void 0===l||l),g.isValid&&(g.isValid=null===(u=g.meetsMaxPasswordLength)||void 0===u||u),g.isValid&&(g.isValid=null===(d=g.containsLowercaseLetter)||void 0===d||d),g.isValid&&(g.isValid=null===(h=g.containsUppercaseLetter)||void 0===h||h),g.isValid&&(g.isValid=null===(f=g.containsNumericCharacter)||void 0===f||f),g.isValid&&(g.isValid=null===(m=g.containsNonAlphanumericCharacter)||void 0===m||m),g}validatePasswordLengthOptions(n,l){let u=this.customStrengthOptions.minPasswordLength,d=this.customStrengthOptions.maxPasswordLength;u&&(l.meetsMinPasswordLength=n.length>=u),d&&(l.meetsMaxPasswordLength=n.length<=d)}validatePasswordCharacterOptions(n,l){let u;this.updatePasswordCharacterOptionsStatuses(l,!1,!1,!1,!1);for(let d=0;d<n.length;d++)u=n.charAt(d),this.updatePasswordCharacterOptionsStatuses(l,u>="a"&&u<="z",u>="A"&&u<="Z",u>="0"&&u<="9",this.allowedNonAlphanumericCharacters.includes(u))}updatePasswordCharacterOptionsStatuses(n,l,u,d,h){this.customStrengthOptions.containsLowercaseLetter&&(n.containsLowercaseLetter||(n.containsLowercaseLetter=l)),this.customStrengthOptions.containsUppercaseLetter&&(n.containsUppercaseLetter||(n.containsUppercaseLetter=u)),this.customStrengthOptions.containsNumericCharacter&&(n.containsNumericCharacter||(n.containsNumericCharacter=d)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(n.containsNonAlphanumericCharacter||(n.containsNonAlphanumericCharacter=h))}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let AuthImpl=class AuthImpl{constructor(n,l,u,d){this.app=n,this.heartbeatServiceProvider=l,this.appCheckServiceProvider=u,this.config=d,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Subscription(this),this.idTokenSubscription=new Subscription(this),this.beforeStateQueue=new AuthMiddlewareQueue(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=j,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=n.name,this.clientVersion=d.sdkClientVersion}_initializeWithPersistence(n,l){return l&&(this._popupRedirectResolver=_getInstance(l)),this._initializationPromise=this.queue(async()=>{var u,d;if(!this._deleted&&(this.persistenceManager=await PersistenceUserManager.create(this,n),!this._deleted)){if(null===(u=this._popupRedirectResolver)||void 0===u?void 0:u._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(n){}await this.initializeCurrentUser(l),this.lastNotifiedUid=(null===(d=this.currentUser)||void 0===d?void 0:d.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;let n=await this.assertedPersistence.getCurrentUser();if(this.currentUser||n){if(this.currentUser&&n&&this.currentUser.uid===n.uid){this._currentUser._assign(n),await this.currentUser.getIdToken();return}await this._updateCurrentUser(n,!0)}}async initializeCurrentUser(n){var l;let u=await this.assertedPersistence.getCurrentUser(),d=u,h=!1;if(n&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();let u=null===(l=this.redirectUser)||void 0===l?void 0:l._redirectEventId,f=null==d?void 0:d._redirectEventId,m=await this.tryRedirectSignIn(n);(!u||u===f)&&(null==m?void 0:m.user)&&(d=m.user,h=!0)}if(!d)return this.directlySetCurrentUser(null);if(!d._redirectEventId){if(h)try{await this.beforeStateQueue.runMiddleware(d)}catch(n){d=u,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(n))}return d?this.reloadAndSetCurrentUserOrClear(d):this.directlySetCurrentUser(null)}return(_assert(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===d._redirectEventId)?this.directlySetCurrentUser(d):this.reloadAndSetCurrentUserOrClear(d)}async tryRedirectSignIn(n){let l=null;try{l=await this._popupRedirectResolver._completeRedirectFn(this,n,!0)}catch(n){await this._setRedirectUser(null)}return l}async reloadAndSetCurrentUserOrClear(n){try{await _reloadWithoutSaving(n)}catch(n){if((null==n?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(n)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;let n=navigator;return n.languages&&n.languages[0]||n.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(n){let l=n?(0,h.m9)(n):null;return l&&_assert(l.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(l&&l._clone(this))}async _updateCurrentUser(n,l=!1){if(!this._deleted)return n&&_assert(this.tenantId===n.tenantId,this,"tenant-id-mismatch"),l||await this.beforeStateQueue.runMiddleware(n),this.queue(async()=>{await this.directlySetCurrentUser(n),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(n){return this.queue(async()=>{await this.assertedPersistence.setPersistence(_getInstance(n))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(n){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();let l=this._getPasswordPolicyInternal();return l.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):l.validatePassword(n)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){let n=await _getPasswordPolicy(this),l=new PasswordPolicyImpl(n);null===this.tenantId?this._projectPasswordPolicy=l:this._tenantPasswordPolicies[this.tenantId]=l}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(n){this._errorFactory=new h.LL("auth","Firebase",n())}onAuthStateChanged(n,l,u){return this.registerStateListener(this.authStateSubscription,n,l,u)}beforeAuthStateChanged(n,l){return this.beforeStateQueue.pushCallback(n,l)}onIdTokenChanged(n,l,u){return this.registerStateListener(this.idTokenSubscription,n,l,u)}authStateReady(){return new Promise((n,l)=>{if(this.currentUser)n();else{let u=this.onAuthStateChanged(()=>{u(),n()},l)}})}async revokeAccessToken(n){if(this.currentUser){let l=await this.currentUser.getIdToken(),u={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:n,idToken:l};null!=this.tenantId&&(u.tenantId=this.tenantId),await revokeToken(this,u)}}toJSON(){var n;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(n=this._currentUser)||void 0===n?void 0:n.toJSON()}}async _setRedirectUser(n,l){let u=await this.getOrInitRedirectPersistenceManager(l);return null===n?u.removeCurrentUser():u.setCurrentUser(n)}async getOrInitRedirectPersistenceManager(n){if(!this.redirectPersistenceManager){let l=n&&_getInstance(n)||this._popupRedirectResolver;_assert(l,this,"argument-error"),this.redirectPersistenceManager=await PersistenceUserManager.create(this,[_getInstance(l._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(n){var l,u;return(this._isInitialized&&await this.queue(async()=>{}),(null===(l=this._currentUser)||void 0===l?void 0:l._redirectEventId)===n)?this._currentUser:(null===(u=this.redirectUser)||void 0===u?void 0:u._redirectEventId)===n?this.redirectUser:null}async _persistUserIfCurrent(n){if(n===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(n))}_notifyListenersIfCurrent(n){n===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 n,l;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);let u=null!==(l=null===(n=this.currentUser)||void 0===n?void 0:n.uid)&&void 0!==l?l:null;this.lastNotifiedUid!==u&&(this.lastNotifiedUid=u,this.authStateSubscription.next(this.currentUser))}registerStateListener(n,l,u,d){if(this._deleted)return()=>{};let h="function"==typeof l?l:l.next.bind(l),f=!1,m=this._isInitialized?Promise.resolve():this._initializationPromise;if(_assert(m,this,"internal-error"),m.then(()=>{f||h(this.currentUser)}),"function"==typeof l){let h=n.addObserver(l,u,d);return()=>{f=!0,h()}}{let u=n.addObserver(l);return()=>{f=!0,u()}}}async directlySetCurrentUser(n){this.currentUser&&this.currentUser!==n&&this._currentUser._stopProactiveRefresh(),n&&this.isProactiveRefreshEnabled&&n._startProactiveRefresh(),this.currentUser=n,n?await this.assertedPersistence.setCurrentUser(n):await this.assertedPersistence.removeCurrentUser()}queue(n){return this.operations=this.operations.then(n,n),this.operations}get assertedPersistence(){return _assert(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(n){!n||this.frameworks.includes(n)||(this.frameworks.push(n),this.frameworks.sort(),this.clientVersion=_getClientVersion(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var n;let l={"X-Client-Version":this.clientVersion};this.app.options.appId&&(l["X-Firebase-gmpid"]=this.app.options.appId);let u=await (null===(n=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===n?void 0:n.getHeartbeatsHeader());u&&(l["X-Firebase-Client"]=u);let d=await this._getAppCheckToken();return d&&(l["X-Firebase-AppCheck"]=d),l}async _getAppCheckToken(){var n;let l=await (null===(n=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===n?void 0:n.getToken());return(null==l?void 0:l.error)&&function(n,...l){$.logLevel<=m.in.WARN&&$.warn(`Auth (${f.Jn}): ${n}`,...l)}(`Error while retrieving App Check token: ${l.error}`),null==l?void 0:l.token}};function _castAuth(n){return(0,h.m9)(n)}let Subscription=class Subscription{constructor(n){this.auth=n,this.observer=null,this.addObserver=(0,h.ne)(n=>this.observer=n)}get next(){return _assert(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}};function _loadJS(n){return new Promise((l,u)=>{var d,h;let f=document.createElement("script");f.setAttribute("src",n),f.onload=l,f.onerror=n=>{let l=_createError("internal-error");l.customData=n,u(l)},f.type="text/javascript",f.charset="UTF-8",(null!==(h=null===(d=document.getElementsByTagName("head"))||void 0===d?void 0:d[0])&&void 0!==h?h:document).appendChild(f)})}function _generateCallbackName(n){return`__${n}${Math.floor(1e6*Math.random())}`}let RecaptchaEnterpriseVerifier=class RecaptchaEnterpriseVerifier{constructor(n){this.type="recaptcha-enterprise",this.auth=_castAuth(n)}async verify(n="verify",l=!1){async function retrieveSiteKey(n){if(!l){if(null==n.tenantId&&null!=n._agentRecaptchaConfig)return n._agentRecaptchaConfig.siteKey;if(null!=n.tenantId&&void 0!==n._tenantRecaptchaConfigs[n.tenantId])return n._tenantRecaptchaConfigs[n.tenantId].siteKey}return new Promise(async(l,u)=>{getRecaptchaConfig(n,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(d=>{if(void 0===d.recaptchaKey)u(Error("recaptcha Enterprise site key undefined"));else{let u=new RecaptchaConfig(d);return null==n.tenantId?n._agentRecaptchaConfig=u:n._tenantRecaptchaConfigs[n.tenantId]=u,l(u.siteKey)}}).catch(n=>{u(n)})})}function retrieveRecaptchaToken(l,u,d){let h=window.grecaptcha;isEnterprise(h)?h.enterprise.ready(()=>{h.enterprise.execute(l,{action:n}).then(n=>{u(n)}).catch(()=>{u("NO_RECAPTCHA")})}):d(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((n,u)=>{retrieveSiteKey(this.auth).then(d=>{if(!l&&isEnterprise(window.grecaptcha))retrieveRecaptchaToken(d,n,u);else{if("undefined"==typeof window){u(Error("RecaptchaVerifier is only supported in browser"));return}_loadJS("https://www.google.com/recaptcha/enterprise.js?render="+d).then(()=>{retrieveRecaptchaToken(d,n,u)}).catch(n=>{u(n)})}}).catch(n=>{u(n)})})}};async function injectRecaptchaFields(n,l,u,d=!1){let h;let f=new RecaptchaEnterpriseVerifier(n);try{h=await f.verify(u)}catch(n){h=await f.verify(u,!0)}let m=Object.assign({},l);return d?Object.assign(m,{captchaResp:h}):Object.assign(m,{captchaResponse:h}),Object.assign(m,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(m,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),m}async function handleRecaptchaFlow(n,l,u,d){var h;if(null===(h=n._getRecaptchaConfig())||void 0===h||!h.isProviderEnabled("EMAIL_PASSWORD_PROVIDER"))return d(n,l).catch(async h=>{if("auth/missing-recaptcha-token"!==h.code)return Promise.reject(h);{console.log(`${u} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);let h=await injectRecaptchaFields(n,l,u,"getOobCode"===u);return d(n,h)}});{let h=await injectRecaptchaFields(n,l,u,"getOobCode"===u);return d(n,h)}}function extractProtocol(n){let l=n.indexOf(":");return l<0?"":n.substr(0,l+1)}function parsePort(n){if(!n)return null;let l=Number(n);return isNaN(l)?null:l}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let AuthCredential=class AuthCredential{constructor(n,l){this.providerId=n,this.signInMethod=l}toJSON(){return debugFail("not implemented")}_getIdTokenResponse(n){return debugFail("not implemented")}_linkToIdToken(n,l){return debugFail("not implemented")}_getReauthenticationResolver(n){return debugFail("not implemented")}};async function linkEmailPassword(n,l){return _performApiRequest(n,"POST","/v1/accounts:signUp",l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function signInWithPassword(n,l){return _performSignInRequest(n,"POST","/v1/accounts:signInWithPassword",_addTidIfNecessary(n,l))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function signInWithEmailLink$1(n,l){return _performSignInRequest(n,"POST","/v1/accounts:signInWithEmailLink",_addTidIfNecessary(n,l))}async function signInWithEmailLinkForLinking(n,l){return _performSignInRequest(n,"POST","/v1/accounts:signInWithEmailLink",_addTidIfNecessary(n,l))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let EmailAuthCredential=class EmailAuthCredential extends AuthCredential{constructor(n,l,u,d=null){super("password",u),this._email=n,this._password=l,this._tenantId=d}static _fromEmailAndPassword(n,l){return new EmailAuthCredential(n,l,"password")}static _fromEmailAndCode(n,l,u=null){return new EmailAuthCredential(n,l,"emailLink",u)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(n){let l="string"==typeof n?JSON.parse(n):n;if((null==l?void 0:l.email)&&(null==l?void 0:l.password)){if("password"===l.signInMethod)return this._fromEmailAndPassword(l.email,l.password);if("emailLink"===l.signInMethod)return this._fromEmailAndCode(l.email,l.password,l.tenantId)}return null}async _getIdTokenResponse(n){switch(this.signInMethod){case"password":let l={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return handleRecaptchaFlow(n,l,"signInWithPassword",signInWithPassword);case"emailLink":return signInWithEmailLink$1(n,{email:this._email,oobCode:this._password});default:_fail(n,"internal-error")}}async _linkToIdToken(n,l){switch(this.signInMethod){case"password":let u={idToken:l,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return handleRecaptchaFlow(n,u,"signUpPassword",linkEmailPassword);case"emailLink":return signInWithEmailLinkForLinking(n,{idToken:l,email:this._email,oobCode:this._password});default:_fail(n,"internal-error")}}_getReauthenticationResolver(n){return this._getIdTokenResponse(n)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function signInWithIdp(n,l){return _performSignInRequest(n,"POST","/v1/accounts:signInWithIdp",_addTidIfNecessary(n,l))}let OAuthCredential=class OAuthCredential extends AuthCredential{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(n){let l=new OAuthCredential(n.providerId,n.signInMethod);return n.idToken||n.accessToken?(n.idToken&&(l.idToken=n.idToken),n.accessToken&&(l.accessToken=n.accessToken),n.nonce&&!n.pendingToken&&(l.nonce=n.nonce),n.pendingToken&&(l.pendingToken=n.pendingToken)):n.oauthToken&&n.oauthTokenSecret?(l.accessToken=n.oauthToken,l.secret=n.oauthTokenSecret):_fail("argument-error"),l}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(n){let l="string"==typeof n?JSON.parse(n):n,{providerId:u,signInMethod:d}=l,h=(0,g._T)(l,["providerId","signInMethod"]);if(!u||!d)return null;let f=new OAuthCredential(u,d);return f.idToken=h.idToken||void 0,f.accessToken=h.accessToken||void 0,f.secret=h.secret,f.nonce=h.nonce,f.pendingToken=h.pendingToken||null,f}_getIdTokenResponse(n){let l=this.buildRequest();return signInWithIdp(n,l)}_linkToIdToken(n,l){let u=this.buildRequest();return u.idToken=l,signInWithIdp(n,u)}_getReauthenticationResolver(n){let l=this.buildRequest();return l.autoCreate=!1,signInWithIdp(n,l)}buildRequest(){let n={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)n.pendingToken=this.pendingToken;else{let l={};this.idToken&&(l.id_token=this.idToken),this.accessToken&&(l.access_token=this.accessToken),this.secret&&(l.oauth_token_secret=this.secret),l.providerId=this.providerId,this.nonce&&!this.pendingToken&&(l.nonce=this.nonce),n.postBody=(0,h.xO)(l)}return n}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function sendPhoneVerificationCode(n,l){return _performApiRequest(n,"POST","/v1/accounts:sendVerificationCode",_addTidIfNecessary(n,l))}async function signInWithPhoneNumber$1(n,l){return _performSignInRequest(n,"POST","/v1/accounts:signInWithPhoneNumber",_addTidIfNecessary(n,l))}async function linkWithPhoneNumber$1(n,l){let u=await _performSignInRequest(n,"POST","/v1/accounts:signInWithPhoneNumber",_addTidIfNecessary(n,l));if(u.temporaryProof)throw _makeTaggedError(n,"account-exists-with-different-credential",u);return u}let en={USER_NOT_FOUND:"user-not-found"};async function verifyPhoneNumberForExisting(n,l){let u=Object.assign(Object.assign({},l),{operation:"REAUTH"});return _performSignInRequest(n,"POST","/v1/accounts:signInWithPhoneNumber",_addTidIfNecessary(n,u),en)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let PhoneAuthCredential=class PhoneAuthCredential extends AuthCredential{constructor(n){super("phone","phone"),this.params=n}static _fromVerification(n,l){return new PhoneAuthCredential({verificationId:n,verificationCode:l})}static _fromTokenResponse(n,l){return new PhoneAuthCredential({phoneNumber:n,temporaryProof:l})}_getIdTokenResponse(n){return signInWithPhoneNumber$1(n,this._makeVerificationRequest())}_linkToIdToken(n,l){return linkWithPhoneNumber$1(n,Object.assign({idToken:l},this._makeVerificationRequest()))}_getReauthenticationResolver(n){return verifyPhoneNumberForExisting(n,this._makeVerificationRequest())}_makeVerificationRequest(){let{temporaryProof:n,phoneNumber:l,verificationId:u,verificationCode:d}=this.params;return n&&l?{temporaryProof:n,phoneNumber:l}:{sessionInfo:u,code:d}}toJSON(){let n={providerId:this.providerId};return this.params.phoneNumber&&(n.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(n.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(n.verificationCode=this.params.verificationCode),this.params.verificationId&&(n.verificationId=this.params.verificationId),n}static fromJSON(n){"string"==typeof n&&(n=JSON.parse(n));let{verificationId:l,verificationCode:u,phoneNumber:d,temporaryProof:h}=n;return u||l||d||h?new PhoneAuthCredential({verificationId:l,verificationCode:u,phoneNumber:d,temporaryProof:h}):null}};let ActionCodeURL=class ActionCodeURL{constructor(n){var l,u,d,f,m,g;let _=(0,h.zd)((0,h.pd)(n)),j=null!==(l=_.apiKey)&&void 0!==l?l:null,$=null!==(u=_.oobCode)&&void 0!==u?u:null,z=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){switch(n){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!==(d=_.mode)&&void 0!==d?d:null);_assert(j&&$&&z,"argument-error"),this.apiKey=j,this.operation=z,this.code=$,this.continueUrl=null!==(f=_.continueUrl)&&void 0!==f?f:null,this.languageCode=null!==(m=_.languageCode)&&void 0!==m?m:null,this.tenantId=null!==(g=_.tenantId)&&void 0!==g?g:null}static parseLink(n){let l=function(n){let l=(0,h.zd)((0,h.pd)(n)).link,u=l?(0,h.zd)((0,h.pd)(l)).deep_link_id:null,d=(0,h.zd)((0,h.pd)(n)).deep_link_id,f=d?(0,h.zd)((0,h.pd)(d)).link:null;return f||d||u||l||n}(n);try{return new ActionCodeURL(l)}catch(n){return null}}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let EmailAuthProvider=class EmailAuthProvider{constructor(){this.providerId=EmailAuthProvider.PROVIDER_ID}static credential(n,l){return EmailAuthCredential._fromEmailAndPassword(n,l)}static credentialWithLink(n,l){let u=ActionCodeURL.parseLink(l);return _assert(u,"argument-error"),EmailAuthCredential._fromEmailAndCode(n,u.code,u.tenantId)}};EmailAuthProvider.PROVIDER_ID="password",EmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD="password",EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FederatedAuthProvider=class FederatedAuthProvider{constructor(n){this.providerId=n,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(n){this.defaultLanguageCode=n}setCustomParameters(n){return this.customParameters=n,this}getCustomParameters(){return this.customParameters}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let BaseOAuthProvider=class BaseOAuthProvider extends FederatedAuthProvider{constructor(){super(...arguments),this.scopes=[]}addScope(n){return this.scopes.includes(n)||this.scopes.push(n),this}getScopes(){return[...this.scopes]}};let OAuthProvider=class OAuthProvider extends BaseOAuthProvider{static credentialFromJSON(n){let l="string"==typeof n?JSON.parse(n):n;return _assert("providerId"in l&&"signInMethod"in l,"argument-error"),OAuthCredential._fromParams(l)}credential(n){return this._credential(Object.assign(Object.assign({},n),{nonce:n.rawNonce}))}_credential(n){return _assert(n.idToken||n.accessToken,"argument-error"),OAuthCredential._fromParams(Object.assign(Object.assign({},n),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(n){return OAuthProvider.oauthCredentialFromTaggedObject(n)}static credentialFromError(n){return OAuthProvider.oauthCredentialFromTaggedObject(n.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:n}){if(!n)return null;let{oauthIdToken:l,oauthAccessToken:u,oauthTokenSecret:d,pendingToken:h,nonce:f,providerId:m}=n;if(!u&&!d&&!l&&!h||!m)return null;try{return new OAuthProvider(m)._credential({idToken:l,accessToken:u,nonce:f,pendingToken:h})}catch(n){return null}}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FacebookAuthProvider=class FacebookAuthProvider extends BaseOAuthProvider{constructor(){super("facebook.com")}static credential(n){return OAuthCredential._fromParams({providerId:FacebookAuthProvider.PROVIDER_ID,signInMethod:FacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD,accessToken:n})}static credentialFromResult(n){return FacebookAuthProvider.credentialFromTaggedObject(n)}static credentialFromError(n){return FacebookAuthProvider.credentialFromTaggedObject(n.customData||{})}static credentialFromTaggedObject({_tokenResponse:n}){if(!n||!("oauthAccessToken"in n)||!n.oauthAccessToken)return null;try{return FacebookAuthProvider.credential(n.oauthAccessToken)}catch(n){return null}}};FacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD="facebook.com",FacebookAuthProvider.PROVIDER_ID="facebook.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let GoogleAuthProvider=class GoogleAuthProvider extends BaseOAuthProvider{constructor(){super("google.com"),this.addScope("profile")}static credential(n,l){return OAuthCredential._fromParams({providerId:GoogleAuthProvider.PROVIDER_ID,signInMethod:GoogleAuthProvider.GOOGLE_SIGN_IN_METHOD,idToken:n,accessToken:l})}static credentialFromResult(n){return GoogleAuthProvider.credentialFromTaggedObject(n)}static credentialFromError(n){return GoogleAuthProvider.credentialFromTaggedObject(n.customData||{})}static credentialFromTaggedObject({_tokenResponse:n}){if(!n)return null;let{oauthIdToken:l,oauthAccessToken:u}=n;if(!l&&!u)return null;try{return GoogleAuthProvider.credential(l,u)}catch(n){return null}}};GoogleAuthProvider.GOOGLE_SIGN_IN_METHOD="google.com",GoogleAuthProvider.PROVIDER_ID="google.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let GithubAuthProvider=class GithubAuthProvider extends BaseOAuthProvider{constructor(){super("github.com")}static credential(n){return OAuthCredential._fromParams({providerId:GithubAuthProvider.PROVIDER_ID,signInMethod:GithubAuthProvider.GITHUB_SIGN_IN_METHOD,accessToken:n})}static credentialFromResult(n){return GithubAuthProvider.credentialFromTaggedObject(n)}static credentialFromError(n){return GithubAuthProvider.credentialFromTaggedObject(n.customData||{})}static credentialFromTaggedObject({_tokenResponse:n}){if(!n||!("oauthAccessToken"in n)||!n.oauthAccessToken)return null;try{return GithubAuthProvider.credential(n.oauthAccessToken)}catch(n){return null}}};GithubAuthProvider.GITHUB_SIGN_IN_METHOD="github.com",GithubAuthProvider.PROVIDER_ID="github.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let TwitterAuthProvider=class TwitterAuthProvider extends BaseOAuthProvider{constructor(){super("twitter.com")}static credential(n,l){return OAuthCredential._fromParams({providerId:TwitterAuthProvider.PROVIDER_ID,signInMethod:TwitterAuthProvider.TWITTER_SIGN_IN_METHOD,oauthToken:n,oauthTokenSecret:l})}static credentialFromResult(n){return TwitterAuthProvider.credentialFromTaggedObject(n)}static credentialFromError(n){return TwitterAuthProvider.credentialFromTaggedObject(n.customData||{})}static credentialFromTaggedObject({_tokenResponse:n}){if(!n)return null;let{oauthAccessToken:l,oauthTokenSecret:u}=n;if(!l||!u)return null;try{return TwitterAuthProvider.credential(l,u)}catch(n){return null}}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function signUp(n,l){return _performSignInRequest(n,"POST","/v1/accounts:signUp",_addTidIfNecessary(n,l))}TwitterAuthProvider.TWITTER_SIGN_IN_METHOD="twitter.com",TwitterAuthProvider.PROVIDER_ID="twitter.com";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let UserCredentialImpl=class UserCredentialImpl{constructor(n){this.user=n.user,this.providerId=n.providerId,this._tokenResponse=n._tokenResponse,this.operationType=n.operationType}static async _fromIdTokenResponse(n,l,u,d=!1){let h=await UserImpl._fromIdTokenResponse(n,u,d),f=providerIdForResponse(u),m=new UserCredentialImpl({user:h,providerId:f,_tokenResponse:u,operationType:l});return m}static async _forOperation(n,l,u){await n._updateTokensIfNecessary(u,!0);let d=providerIdForResponse(u);return new UserCredentialImpl({user:n,providerId:d,_tokenResponse:u,operationType:l})}};function providerIdForResponse(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function signInAnonymously(n){var l;let u=_castAuth(n);if(await u._initializationPromise,null===(l=u.currentUser)||void 0===l?void 0:l.isAnonymous)return new UserCredentialImpl({user:u.currentUser,providerId:null,operationType:"signIn"});let d=await signUp(u,{returnSecureToken:!0}),h=await UserCredentialImpl._fromIdTokenResponse(u,"signIn",d,!0);return await u._updateCurrentUser(h.user),h}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let MultiFactorError=class MultiFactorError extends h.ZR{constructor(n,l,u,d){var h;super(l.code,l.message),this.operationType=u,this.user=d,Object.setPrototypeOf(this,MultiFactorError.prototype),this.customData={appName:n.name,tenantId:null!==(h=n.tenantId)&&void 0!==h?h:void 0,_serverResponse:l.customData._serverResponse,operationType:u}}static _fromErrorAndOperation(n,l,u,d){return new MultiFactorError(n,l,u,d)}};function _processCredentialSavingMfaContextIfNecessary(n,l,u,d){let h="reauthenticate"===l?u._getReauthenticationResolver(n):u._getIdTokenResponse(n);return h.catch(u=>{if("auth/multi-factor-auth-required"===u.code)throw MultiFactorError._fromErrorAndOperation(n,u,l,d);throw u})}async function _link$1(n,l,u=!1){let d=await _logoutIfInvalidated(n,l._linkToIdToken(n.auth,await n.getIdToken()),u);return UserCredentialImpl._forOperation(n,"link",d)}async function _assertLinkedStatus(n,l,u){var d;await _reloadWithoutSaving(l);let h=(d=l.providerData,new Set(d.map(({providerId:n})=>n).filter(n=>!!n))),f=!1===n?"provider-already-linked":"no-such-provider";_assert(h.has(u)===n,l.auth,f)}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function _reauthenticate(n,l,u=!1){let{auth:d}=n,h="reauthenticate";try{let f=await _logoutIfInvalidated(n,_processCredentialSavingMfaContextIfNecessary(d,h,l,n),u);_assert(f.idToken,d,"internal-error");let m=_parseToken(f.idToken);_assert(m,d,"internal-error");let{sub:g}=m;return _assert(n.uid===g,d,"user-mismatch"),UserCredentialImpl._forOperation(n,h,f)}catch(n){throw(null==n?void 0:n.code)==="auth/user-not-found"&&_fail(d,"user-mismatch"),n}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function _signInWithCredential(n,l,u=!1){let d="signIn",h=await _processCredentialSavingMfaContextIfNecessary(n,d,l),f=await UserCredentialImpl._fromIdTokenResponse(n,d,h);return u||await n._updateCurrentUser(f.user),f}async function signInWithCredential(n,l){return _signInWithCredential(_castAuth(n),l)}async function linkWithCredential(n,l){let u=(0,h.m9)(n);return await _assertLinkedStatus(!1,u,l.providerId),_link$1(u,l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function recachePasswordPolicy(n){let l=_castAuth(n);l._getPasswordPolicyInternal()&&await l._updatePasswordPolicy()}async function createUserWithEmailAndPassword(n,l,u){let d=_castAuth(n),h=handleRecaptchaFlow(d,{returnSecureToken:!0,email:l,password:u,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",signUp),f=await h.catch(l=>{throw"auth/password-does-not-meet-requirements"===l.code&&recachePasswordPolicy(n),l}),m=await UserCredentialImpl._fromIdTokenResponse(d,"signIn",f);return await d._updateCurrentUser(m.user),m}function signInWithEmailAndPassword(n,l,u){return signInWithCredential((0,h.m9)(n),EmailAuthProvider.credential(l,u)).catch(async l=>{throw"auth/password-does-not-meet-requirements"===l.code&&recachePasswordPolicy(n),l})}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function createAuthUri(n,l){return _performApiRequest(n,"POST","/v1/accounts:createAuthUri",_addTidIfNecessary(n,l))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function fetchSignInMethodsForEmail(n,l){let u=_isHttpOrHttps()?_getCurrentUrl():"http://localhost",{signinMethods:d}=await createAuthUri((0,h.m9)(n),{identifier:l,continueUri:u});return d||[]}let GenericAdditionalUserInfo=class GenericAdditionalUserInfo{constructor(n,l,u={}){this.isNewUser=n,this.providerId=l,this.profile=u}};let FederatedAdditionalUserInfoWithUsername=class FederatedAdditionalUserInfoWithUsername extends GenericAdditionalUserInfo{constructor(n,l,u,d){super(n,l,u),this.username=d}};let FacebookAdditionalUserInfo=class FacebookAdditionalUserInfo extends GenericAdditionalUserInfo{constructor(n,l){super(n,"facebook.com",l)}};let GithubAdditionalUserInfo=class GithubAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername{constructor(n,l){super(n,"github.com",l,"string"==typeof(null==l?void 0:l.login)?null==l?void 0:l.login:null)}};let GoogleAdditionalUserInfo=class GoogleAdditionalUserInfo extends GenericAdditionalUserInfo{constructor(n,l){super(n,"google.com",l)}};let TwitterAdditionalUserInfo=class TwitterAdditionalUserInfo extends FederatedAdditionalUserInfoWithUsername{constructor(n,l,u){super(n,"twitter.com",l,u)}};function getAdditionalUserInfo(n){let{user:l,_tokenResponse:u}=n;return l.isAnonymous&&!u?{providerId:null,isNewUser:!1,profile:null}:/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){var l,u;if(!n)return null;let{providerId:d}=n,h=n.rawUserInfo?JSON.parse(n.rawUserInfo):{},f=n.isNewUser||"identitytoolkit#SignupNewUserResponse"===n.kind;if(!d&&(null==n?void 0:n.idToken)){let d=null===(u=null===(l=_parseToken(n.idToken))||void 0===l?void 0:l.firebase)||void 0===u?void 0:u.sign_in_provider;if(d){let n="anonymous"!==d&&"custom"!==d?d:null;return new GenericAdditionalUserInfo(f,n)}}if(!d)return null;switch(d){case"facebook.com":return new FacebookAdditionalUserInfo(f,h);case"github.com":return new GithubAdditionalUserInfo(f,h);case"google.com":return new GoogleAdditionalUserInfo(f,h);case"twitter.com":return new TwitterAdditionalUserInfo(f,h,n.screenName||null);case"custom":case"anonymous":return new GenericAdditionalUserInfo(f,null);default:return new GenericAdditionalUserInfo(f,d,h)}}(u)}new WeakMap;let eo="__sak";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let BrowserPersistenceClass=class BrowserPersistenceClass{constructor(n,l){this.storageRetriever=n,this.type=l}_isAvailable(){try{if(!this.storage)return Promise.resolve(!1);return this.storage.setItem(eo,"1"),this.storage.removeItem(eo),Promise.resolve(!0)}catch(n){return Promise.resolve(!1)}}_set(n,l){return this.storage.setItem(n,JSON.stringify(l)),Promise.resolve()}_get(n){let l=this.storage.getItem(n);return Promise.resolve(l?JSON.parse(l):null)}_remove(n){return this.storage.removeItem(n),Promise.resolve()}get storage(){return this.storageRetriever()}};let BrowserLocalPersistence=class BrowserLocalPersistence extends BrowserPersistenceClass{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(n,l)=>this.onStorageEvent(n,l),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(){let n=(0,h.z$)();return _isSafari(n)||_isIOS(n)}()&&function(){try{return!!(window&&window!==window.top)}catch(n){return!1}}(),this.fallbackToPolling=_isMobileBrowser(),this._shouldAllowMigration=!0}forAllChangedKeys(n){for(let l of Object.keys(this.listeners)){let u=this.storage.getItem(l),d=this.localCache[l];u!==d&&n(l,d,u)}}onStorageEvent(n,l=!1){if(!n.key){this.forAllChangedKeys((n,l,u)=>{this.notifyListeners(n,u)});return}let u=n.key;if(l?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){let d=this.storage.getItem(u);if(n.newValue!==d)null!==n.newValue?this.storage.setItem(u,n.newValue):this.storage.removeItem(u);else if(this.localCache[u]===n.newValue&&!l)return}let triggerListeners=()=>{let n=this.storage.getItem(u);(l||this.localCache[u]!==n)&&this.notifyListeners(u,n)},d=this.storage.getItem(u);(0,h.w1)()&&10===document.documentMode&&d!==n.newValue&&n.newValue!==n.oldValue?setTimeout(triggerListeners,10):triggerListeners()}notifyListeners(n,l){this.localCache[n]=l;let u=this.listeners[n];if(u)for(let n of Array.from(u))n(l?JSON.parse(l):l)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((n,l,u)=>{this.onStorageEvent(new StorageEvent("storage",{key:n,oldValue:l,newValue:u}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(n,l){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[n]||(this.listeners[n]=new Set,this.localCache[n]=this.storage.getItem(n)),this.listeners[n].add(l)}_removeListener(n,l){this.listeners[n]&&(this.listeners[n].delete(l),0===this.listeners[n].size&&delete this.listeners[n]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(n,l){await super._set(n,l),this.localCache[n]=JSON.stringify(l)}async _get(n){let l=await super._get(n);return this.localCache[n]=JSON.stringify(l),l}async _remove(n){await super._remove(n),delete this.localCache[n]}};BrowserLocalPersistence.type="LOCAL";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let BrowserSessionPersistence=class BrowserSessionPersistence extends BrowserPersistenceClass{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(n,l){}_removeListener(n,l){}};BrowserSessionPersistence.type="SESSION";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Receiver=class Receiver{constructor(n){this.eventTarget=n,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(n){let l=this.receivers.find(l=>l.isListeningto(n));if(l)return l;let u=new Receiver(n);return this.receivers.push(u),u}isListeningto(n){return this.eventTarget===n}async handleEvent(n){let{eventId:l,eventType:u,data:d}=n.data,h=this.handlersMap[u];if(!(null==h?void 0:h.size))return;n.ports[0].postMessage({status:"ack",eventId:l,eventType:u});let f=Array.from(h).map(async l=>l(n.origin,d)),m=await Promise.all(f.map(async n=>{try{let l=await n;return{fulfilled:!0,value:l}}catch(n){return{fulfilled:!1,reason:n}}}));n.ports[0].postMessage({status:"done",eventId:l,eventType:u,response:m})}_subscribe(n,l){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[n]||(this.handlersMap[n]=new Set),this.handlersMap[n].add(l)}_unsubscribe(n,l){this.handlersMap[n]&&l&&this.handlersMap[n].delete(l),l&&0!==this.handlersMap[n].size||delete this.handlersMap[n],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _generateEventId(n="",l=10){let u="";for(let n=0;n<l;n++)u+=Math.floor(10*Math.random());return n+u}Receiver.receivers=[];/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Sender=class Sender{constructor(n){this.target=n,this.handlers=new Set}removeMessageHandler(n){n.messageChannel&&(n.messageChannel.port1.removeEventListener("message",n.onMessage),n.messageChannel.port1.close()),this.handlers.delete(n)}async _send(n,l,u=50){let d,h;let f="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!f)throw Error("connection_unavailable");return new Promise((m,g)=>{let _=_generateEventId("",20);f.port1.start();let j=setTimeout(()=>{g(Error("unsupported_event"))},u);h={messageChannel:f,onMessage(n){if(n.data.eventId===_)switch(n.data.status){case"ack":clearTimeout(j),d=setTimeout(()=>{g(Error("timeout"))},3e3);break;case"done":clearTimeout(d),m(n.data.response);break;default:clearTimeout(j),clearTimeout(d),g(Error("invalid_response"))}}},this.handlers.add(h),f.port1.addEventListener("message",h.onMessage),this.target.postMessage({eventType:n,eventId:_,data:l},[f.port2])}).finally(()=>{h&&this.removeMessageHandler(h)})}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _window(){return window}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _isWorker(){return void 0!==_window().WorkerGlobalScope&&"function"==typeof _window().importScripts}async function _getActiveServiceWorker(){if(!(null==navigator?void 0:navigator.serviceWorker))return null;try{let n=await navigator.serviceWorker.ready;return n.active}catch(n){return null}}/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let es="firebaseLocalStorageDb",el="firebaseLocalStorage",eu="fbase_key";let DBPromise=class DBPromise{constructor(n){this.request=n}toPromise(){return new Promise((n,l)=>{this.request.addEventListener("success",()=>{n(this.request.result)}),this.request.addEventListener("error",()=>{l(this.request.error)})})}};function getObjectStore(n,l){return n.transaction([el],l?"readwrite":"readonly").objectStore(el)}function _openDatabase(){let n=indexedDB.open(es,1);return new Promise((l,u)=>{n.addEventListener("error",()=>{u(n.error)}),n.addEventListener("upgradeneeded",()=>{let l=n.result;try{l.createObjectStore(el,{keyPath:eu})}catch(n){u(n)}}),n.addEventListener("success",async()=>{let u=n.result;u.objectStoreNames.contains(el)?l(u):(u.close(),await function(){let n=indexedDB.deleteDatabase(es);return new DBPromise(n).toPromise()}(),l(await _openDatabase()))})})}async function _putObject(n,l,u){let d=getObjectStore(n,!0).put({[eu]:l,value:u});return new DBPromise(d).toPromise()}async function getObject(n,l){let u=getObjectStore(n,!1).get(l),d=await new DBPromise(u).toPromise();return void 0===d?null:d.value}function _deleteObject(n,l){let u=getObjectStore(n,!0).delete(l);return new DBPromise(u).toPromise()}let IndexedDBLocalPersistence=class IndexedDBLocalPersistence{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 _openDatabase()),this.db}async _withRetries(n){let l=0;for(;;)try{let l=await this._openDb();return await n(l)}catch(n){if(l++>3)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return _isWorker()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Receiver._getInstance(_isWorker()?self:null),this.receiver._subscribe("keyChanged",async(n,l)=>{let u=await this._poll();return{keyProcessed:u.includes(l.key)}}),this.receiver._subscribe("ping",async(n,l)=>["keyChanged"])}async initializeSender(){var n,l;if(this.activeServiceWorker=await _getActiveServiceWorker(),!this.activeServiceWorker)return;this.sender=new Sender(this.activeServiceWorker);let u=await this.sender._send("ping",{},800);u&&(null===(n=u[0])||void 0===n?void 0:n.fulfilled)&&(null===(l=u[0])||void 0===l?void 0:l.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(n){var l;if(this.sender&&this.activeServiceWorker&&((null===(l=null==navigator?void 0:navigator.serviceWorker)||void 0===l?void 0:l.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:n},this.serviceWorkerReceiverAvailable?800:50)}catch(n){}}async _isAvailable(){try{if(!indexedDB)return!1;let n=await _openDatabase();return await _putObject(n,eo,"1"),await _deleteObject(n,eo),!0}catch(n){}return!1}async _withPendingWrite(n){this.pendingWrites++;try{await n()}finally{this.pendingWrites--}}async _set(n,l){return this._withPendingWrite(async()=>(await this._withRetries(u=>_putObject(u,n,l)),this.localCache[n]=l,this.notifyServiceWorker(n)))}async _get(n){let l=await this._withRetries(l=>getObject(l,n));return this.localCache[n]=l,l}async _remove(n){return this._withPendingWrite(async()=>(await this._withRetries(l=>_deleteObject(l,n)),delete this.localCache[n],this.notifyServiceWorker(n)))}async _poll(){let n=await this._withRetries(n=>{let l=getObjectStore(n,!1).getAll();return new DBPromise(l).toPromise()});if(!n||0!==this.pendingWrites)return[];let l=[],u=new Set;if(0!==n.length)for(let{fbase_key:d,value:h}of n)u.add(d),JSON.stringify(this.localCache[d])!==JSON.stringify(h)&&(this.notifyListeners(d,h),l.push(d));for(let n of Object.keys(this.localCache))this.localCache[n]&&!u.has(n)&&(this.notifyListeners(n,null),l.push(n));return l}notifyListeners(n,l){this.localCache[n]=l;let u=this.listeners[n];if(u)for(let n of Array.from(u))n(l)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(n,l){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[n]||(this.listeners[n]=new Set,this._get(n)),this.listeners[n].add(l)}_removeListener(n,l){this.listeners[n]&&(this.listeners[n].delete(l),0===this.listeners[n].size&&delete this.listeners[n]),0===Object.keys(this.listeners).length&&this.stopPolling()}};async function _verifyPhoneNumber(n,l,u){var d,h,f;let m=await u.verify();try{let g;if(_assert("string"==typeof m,n,"argument-error"),_assert("recaptcha"===u.type,n,"argument-error"),g="string"==typeof l?{phoneNumber:l}:l,"session"in g){let l=g.session;if("phoneNumber"in g){_assert("enroll"===l.type,n,"internal-error");let u=await (h={idToken:l.credential,phoneEnrollmentInfo:{phoneNumber:g.phoneNumber,recaptchaToken:m}},_performApiRequest(n,"POST","/v2/accounts/mfaEnrollment:start",_addTidIfNecessary(n,h)));return u.phoneSessionInfo.sessionInfo}{_assert("signin"===l.type,n,"internal-error");let u=(null===(d=g.multiFactorHint)||void 0===d?void 0:d.uid)||g.multiFactorUid;_assert(u,n,"missing-multi-factor-info");let h=await (f={mfaPendingCredential:l.credential,mfaEnrollmentId:u,phoneSignInInfo:{recaptchaToken:m}},_performApiRequest(n,"POST","/v2/accounts/mfaSignIn:start",_addTidIfNecessary(n,f)));return h.phoneResponseInfo.sessionInfo}}{let{sessionInfo:l}=await sendPhoneVerificationCode(n,{phoneNumber:g.phoneNumber,recaptchaToken:m});return l}}finally{u._reset()}}IndexedDBLocalPersistence.type="LOCAL",_generateCallbackName("rcb"),new Delay(3e4,6e4);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let PhoneAuthProvider=class PhoneAuthProvider{constructor(n){this.providerId=PhoneAuthProvider.PROVIDER_ID,this.auth=_castAuth(n)}verifyPhoneNumber(n,l){return _verifyPhoneNumber(this.auth,n,(0,h.m9)(l))}static credential(n,l){return PhoneAuthCredential._fromVerification(n,l)}static credentialFromResult(n){return PhoneAuthProvider.credentialFromTaggedObject(n)}static credentialFromError(n){return PhoneAuthProvider.credentialFromTaggedObject(n.customData||{})}static credentialFromTaggedObject({_tokenResponse:n}){if(!n)return null;let{phoneNumber:l,temporaryProof:u}=n;return l&&u?PhoneAuthCredential._fromTokenResponse(l,u):null}};/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function _withDefaultResolver(n,l){return l?_getInstance(l):(_assert(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}PhoneAuthProvider.PROVIDER_ID="phone",PhoneAuthProvider.PHONE_SIGN_IN_METHOD="phone";/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let IdpCredential=class IdpCredential extends AuthCredential{constructor(n){super("custom","custom"),this.params=n}_getIdTokenResponse(n){return signInWithIdp(n,this._buildIdpRequest())}_linkToIdToken(n,l){return signInWithIdp(n,this._buildIdpRequest(l))}_getReauthenticationResolver(n){return signInWithIdp(n,this._buildIdpRequest())}_buildIdpRequest(n){let l={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 n&&(l.idToken=n),l}};function _signIn(n){return _signInWithCredential(n.auth,new IdpCredential(n),n.bypassAuthState)}function _reauth(n){let{auth:l,user:u}=n;return _assert(u,l,"internal-error"),_reauthenticate(u,new IdpCredential(n),n.bypassAuthState)}async function _link(n){let{auth:l,user:u}=n;return _assert(u,l,"internal-error"),_link$1(u,new IdpCredential(n),n.bypassAuthState)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let AbstractPopupRedirectOperation=class AbstractPopupRedirectOperation{constructor(n,l,u,d,h=!1){this.auth=n,this.resolver=u,this.user=d,this.bypassAuthState=h,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(l)?l:[l]}execute(){return new Promise(async(n,l)=>{this.pendingPromise={resolve:n,reject:l};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(n){let{urlResponse:l,sessionId:u,postBody:d,tenantId:h,error:f,type:m}=n;if(f){this.reject(f);return}let g={auth:this.auth,requestUri:l,sessionId:u,tenantId:h||void 0,postBody:d||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(m)(g))}catch(n){this.reject(n)}}onError(n){this.reject(n)}getIdpTask(n){switch(n){case"signInViaPopup":case"signInViaRedirect":return _signIn;case"linkViaPopup":case"linkViaRedirect":return _link;case"reauthViaPopup":case"reauthViaRedirect":return _reauth;default:_fail(this.auth,"internal-error")}}resolve(n){this.pendingPromise||debugFail("Pending promise was never set"),this.pendingPromise.resolve(n),this.unregisterAndCleanUp()}reject(n){this.pendingPromise||debugFail("Pending promise was never set"),this.pendingPromise.reject(n),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ec=new Delay(2e3,1e4);async function signInWithPopup(n,l,u){let d=_castAuth(n);_assertInstanceOf(n,l,FederatedAuthProvider);let h=_withDefaultResolver(d,u),f=new PopupOperation(d,"signInViaPopup",l,h);return f.executeNotNull()}async function linkWithPopup(n,l,u){let d=(0,h.m9)(n);_assertInstanceOf(d.auth,l,FederatedAuthProvider);let f=_withDefaultResolver(d.auth,u),m=new PopupOperation(d.auth,"linkViaPopup",l,f,d);return m.executeNotNull()}let PopupOperation=class PopupOperation extends AbstractPopupRedirectOperation{constructor(n,l,u,d,h){super(n,l,d,h),this.provider=u,this.authWindow=null,this.pollId=null,PopupOperation.currentPopupAction&&PopupOperation.currentPopupAction.cancel(),PopupOperation.currentPopupAction=this}async executeNotNull(){let n=await this.execute();return _assert(n,this.auth,"internal-error"),n}async onExecution(){1===this.filter.length||debugFail("Popup operations only handle one event");let n=_generateEventId();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],n),this.authWindow.associatedEvent=n,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(_createError(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var n;return(null===(n=this.authWindow)||void 0===n?void 0:n.associatedEvent)||null}cancel(){this.reject(_createError(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,PopupOperation.currentPopupAction=null}pollUserCancellation(){let poll=()=>{var n,l;if(null===(l=null===(n=this.authWindow)||void 0===n?void 0:n.window)||void 0===l?void 0:l.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(_createError(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(poll,ec.get())};poll()}};PopupOperation.currentPopupAction=null;let eh=new Map;let RedirectAction=class RedirectAction extends AbstractPopupRedirectOperation{constructor(n,l,u=!1){super(n,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],l,void 0,u),this.eventId=null}async execute(){let n=eh.get(this.auth._key());if(!n){try{let l=await _getAndClearPendingRedirectStatus(this.resolver,this.auth),u=l?await super.execute():null;n=()=>Promise.resolve(u)}catch(l){n=()=>Promise.reject(l)}eh.set(this.auth._key(),n)}return this.bypassAuthState||eh.set(this.auth._key(),()=>Promise.resolve(null)),n()}async onAuthEvent(n){if("signInViaRedirect"===n.type)return super.onAuthEvent(n);if("unknown"===n.type){this.resolve(null);return}if(n.eventId){let l=await this.auth._redirectUserForId(n.eventId);if(l)return this.user=l,super.onAuthEvent(n);this.resolve(null)}}async onExecution(){}cleanUp(){}};async function _getAndClearPendingRedirectStatus(n,l){let u=_persistenceKeyName("pendingRedirect",l.config.apiKey,l.name),d=_getInstance(n._redirectPersistence);if(!await d._isAvailable())return!1;let h=await d._get(u)==="true";return await d._remove(u),h}function _overrideRedirectResult(n,l){eh.set(n._key(),l)}async function _getRedirectResult(n,l,u=!1){let d=_castAuth(n),h=_withDefaultResolver(d,l),f=new RedirectAction(d,h,u),m=await f.execute();return m&&!u&&(delete m.user._redirectEventId,await d._persistUserIfCurrent(m.user),await d._setRedirectUser(null,l)),m}let AuthEventManager=class AuthEventManager{constructor(n){this.auth=n,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(n){this.consumers.add(n),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,n)&&(this.sendToConsumer(this.queuedRedirectEvent,n),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(n){this.consumers.delete(n)}onEvent(n){if(this.hasEventBeenHandled(n))return!1;let l=!1;return this.consumers.forEach(u=>{this.isEventForConsumer(n,u)&&(l=!0,this.sendToConsumer(n,u),this.saveEventToCache(n))}),this.hasHandledPotentialRedirect||!function(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return isNullRedirectEvent(n);default:return!1}}(n)||(this.hasHandledPotentialRedirect=!0,l||(this.queuedRedirectEvent=n,l=!0)),l}sendToConsumer(n,l){var u;if(n.error&&!isNullRedirectEvent(n)){let d=(null===(u=n.error.code)||void 0===u?void 0:u.split("auth/")[1])||"internal-error";l.onError(_createError(this.auth,d))}else l.onAuthEvent(n)}isEventForConsumer(n,l){let u=null===l.eventId||!!n.eventId&&n.eventId===l.eventId;return l.filter.includes(n.type)&&u}hasEventBeenHandled(n){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(eventUid(n))}saveEventToCache(n){this.cachedEventUids.add(eventUid(n)),this.lastProcessedEventTime=Date.now()}};function eventUid(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(n=>n).join("-")}function isNullRedirectEvent({type:n,error:l}){return"unknown"===n&&(null==l?void 0:l.code)==="auth/no-auth-event"}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function _getProjectConfig(n,l={}){return _performApiRequest(n,"GET","/v1/projects",l)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ep=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,ef=/^https?/;async function _validateOrigin(n){if(n.config.emulator)return;let{authorizedDomains:l}=await _getProjectConfig(n);for(let n of l)try{if(function(n){let l=_getCurrentUrl(),{protocol:u,hostname:d}=new URL(l);if(n.startsWith("chrome-extension://")){let h=new URL(n);return""===h.hostname&&""===d?"chrome-extension:"===u&&n.replace("chrome-extension://","")===l.replace("chrome-extension://",""):"chrome-extension:"===u&&h.hostname===d}if(!ef.test(u))return!1;if(ep.test(n))return d===n;let h=n.replace(/\./g,"\\."),f=RegExp("^(.+\\."+h+"|"+h+")$","i");return f.test(d)}(n))return}catch(n){}_fail(n,"unauthorized-domain")}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let em=new Delay(3e4,6e4);function resetUnloadedGapiModules(){let n=_window().___jsl;if(null==n?void 0:n.H){for(let l of Object.keys(n.H))if(n.H[l].r=n.H[l].r||[],n.H[l].L=n.H[l].L||[],n.H[l].r=[...n.H[l].L],n.CP)for(let l=0;l<n.CP.length;l++)n.CP[l]=null}}let eg=null,e_=new Delay(5e3,15e3),ey={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ev=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);async function _openIframe(n){let l=await (eg=eg||new Promise((l,u)=>{var d,h,f;function loadGapiIframe(){resetUnloadedGapiModules(),gapi.load("gapi.iframes",{callback:()=>{l(gapi.iframes.getContext())},ontimeout:()=>{resetUnloadedGapiModules(),u(_createError(n,"network-request-failed"))},timeout:em.get()})}if(null===(h=null===(d=_window().gapi)||void 0===d?void 0:d.iframes)||void 0===h?void 0:h.Iframe)l(gapi.iframes.getContext());else if(null===(f=_window().gapi)||void 0===f?void 0:f.load)loadGapiIframe();else{let l=_generateCallbackName("iframefcb");return _window()[l]=()=>{gapi.load?loadGapiIframe():u(_createError(n,"network-request-failed"))},_loadJS(`https://apis.google.com/js/api.js?onload=${l}`).catch(n=>u(n))}}).catch(n=>{throw eg=null,n})),u=_window().gapi;return _assert(u,n,"internal-error"),l.open({where:document.body,url:function(n){let l=n.config;_assert(l.authDomain,n,"auth-domain-config-required");let u=l.emulator?_emulatorUrl(l,"emulator/auth/iframe"):`https://${n.config.authDomain}/__/auth/iframe`,d={apiKey:l.apiKey,appName:n.name,v:f.Jn},m=ev.get(n.config.apiHost);m&&(d.eid=m);let g=n._getFrameworks();return g.length&&(d.fw=g.join(",")),`${u}?${(0,h.xO)(d).slice(1)}`}(n),messageHandlersFilter:u.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:ey,dontclear:!0},l=>new Promise(async(u,d)=>{await l.restyle({setHideOnLeave:!1});let h=_createError(n,"network-request-failed"),f=_window().setTimeout(()=>{d(h)},e_.get());function clearTimerAndResolve(){_window().clearTimeout(f),u(l)}l.ping(clearTimerAndResolve).then(clearTimerAndResolve,()=>{d(h)})}))}/**
 * @license
 * Copyright 2020 Google LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let eE={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};let AuthPopup=class AuthPopup{constructor(n){this.window=n,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(n){}}};let eS=encodeURIComponent("fac");async function _getRedirectUrl(n,l,u,d,m,g){_assert(n.config.authDomain,n,"auth-domain-config-required"),_assert(n.config.apiKey,n,"invalid-api-key");let _={apiKey:n.config.apiKey,appName:n.name,authType:u,redirectUrl:d,v:f.Jn,eventId:m};if(l instanceof FederatedAuthProvider)for(let[u,d]of(l.setDefaultLanguage(n.languageCode),_.providerId=l.providerId||"",(0,h.xb)(l.getCustomParameters())||(_.customParameters=JSON.stringify(l.getCustomParameters())),Object.entries(g||{})))_[u]=d;if(l instanceof BaseOAuthProvider){let n=l.getScopes().filter(n=>""!==n);n.length>0&&(_.scopes=n.join(","))}for(let l of(n.tenantId&&(_.tid=n.tenantId),Object.keys(_)))void 0===_[l]&&delete _[l];let j=await n._getAppCheckToken(),$=j?`#${eS}=${encodeURIComponent(j)}`:"";return`${function({config:n}){return n.emulator?_emulatorUrl(n,"emulator/auth/handler"):`https://${n.authDomain}/__/auth/handler`}(n)}?${(0,h.xO)(_).slice(1)}${$}`}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ew="webStorageSupport",eT=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=BrowserSessionPersistence,this._completeRedirectFn=_getRedirectResult,this._overrideRedirectResult=_overrideRedirectResult}async _openPopup(n,l,u,d){var f;(null===(f=this.eventManagers[n._key()])||void 0===f?void 0:f.manager)||debugFail("_initialize() not called before _openPopup()");let m=await _getRedirectUrl(n,l,u,_getCurrentUrl(),d);return function(n,l,u,d=500,f=600){let m=Math.max((window.screen.availHeight-f)/2,0).toString(),g=Math.max((window.screen.availWidth-d)/2,0).toString(),_="",j=Object.assign(Object.assign({},eE),{width:d.toString(),height:f.toString(),top:m,left:g}),$=(0,h.z$)().toLowerCase();u&&(_=_isChromeIOS($)?"_blank":u),_isFirefox($)&&(l=l||"http://localhost",j.scrollbars="yes");let z=Object.entries(j).reduce((n,[l,u])=>`${n}${l}=${u},`,"");if(function(n=(0,h.z$)()){var l;return _isIOS(n)&&!!(null===(l=window.navigator)||void 0===l?void 0:l.standalone)}($)&&"_self"!==_)return function(n,l){let u=document.createElement("a");u.href=n,u.target=l;let d=document.createEvent("MouseEvent");d.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),u.dispatchEvent(d)}(l||"",_),new AuthPopup(null);let ee=window.open(l||"",_,z);_assert(ee,n,"popup-blocked");try{ee.focus()}catch(n){}return new AuthPopup(ee)}(n,m,_generateEventId())}async _openRedirect(n,l,u,d){await this._originValidation(n);let h=await _getRedirectUrl(n,l,u,_getCurrentUrl(),d);return _window().location.href=h,new Promise(()=>{})}_initialize(n){let l=n._key();if(this.eventManagers[l]){let{manager:n,promise:u}=this.eventManagers[l];return n?Promise.resolve(n):(u||debugFail("If manager is not set, promise should be"),u)}let u=this.initAndGetManager(n);return this.eventManagers[l]={promise:u},u.catch(()=>{delete this.eventManagers[l]}),u}async initAndGetManager(n){let l=await _openIframe(n),u=new AuthEventManager(n);return l.register("authEvent",l=>{_assert(null==l?void 0:l.authEvent,n,"invalid-auth-event");let d=u.onEvent(l.authEvent);return{status:d?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[n._key()]={manager:u},this.iframes[n._key()]=l,u}_isIframeWebStorageSupported(n,l){let u=this.iframes[n._key()];u.send(ew,{type:ew},u=>{var d;let h=null===(d=null==u?void 0:u[0])||void 0===d?void 0:d[ew];void 0!==h&&l(!!h),_fail(n,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(n){let l=n._key();return this.originValidationPromises[l]||(this.originValidationPromises[l]=_validateOrigin(n)),this.originValidationPromises[l]}get _shouldInitProactively(){return _isMobileBrowser()||_isSafari()||_isIOS()}};let MultiFactorAssertionImpl=class MultiFactorAssertionImpl{constructor(n){this.factorId=n}_process(n,l,u){switch(l.type){case"enroll":return this._finalizeEnroll(n,l.credential,u);case"signin":return this._finalizeSignIn(n,l.credential);default:return debugFail("unexpected MultiFactorSessionType")}}};let PhoneMultiFactorAssertionImpl=class PhoneMultiFactorAssertionImpl extends MultiFactorAssertionImpl{constructor(n){super("phone"),this.credential=n}static _fromCredential(n){return new PhoneMultiFactorAssertionImpl(n)}_finalizeEnroll(n,l,u){return _performApiRequest(n,"POST","/v2/accounts/mfaEnrollment:finalize",_addTidIfNecessary(n,{idToken:l,displayName:u,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(n,l){return _performApiRequest(n,"POST","/v2/accounts/mfaSignIn:finalize",_addTidIfNecessary(n,{mfaPendingCredential:l,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}};let TotpMultiFactorAssertionImpl=class TotpMultiFactorAssertionImpl extends MultiFactorAssertionImpl{constructor(n,l,u){super("totp"),this.otp=n,this.enrollmentId=l,this.secret=u}static _fromSecret(n,l){return new TotpMultiFactorAssertionImpl(l,void 0,n)}static _fromEnrollmentId(n,l){return new TotpMultiFactorAssertionImpl(l,n)}async _finalizeEnroll(n,l,u){return _assert(void 0!==this.secret,n,"argument-error"),_performApiRequest(n,"POST","/v2/accounts/mfaEnrollment:finalize",_addTidIfNecessary(n,{idToken:l,displayName:u,totpVerificationInfo:this.secret._makeTotpVerificationInfo(this.otp)}))}async _finalizeSignIn(n,l){_assert(void 0!==this.enrollmentId&&void 0!==this.otp,n,"argument-error");let u={verificationCode:this.otp};return _performApiRequest(n,"POST","/v2/accounts/mfaSignIn:finalize",_addTidIfNecessary(n,{mfaPendingCredential:l,mfaEnrollmentId:this.enrollmentId,totpVerificationInfo:u}))}};let TotpSecret=class TotpSecret{constructor(n,l,u,d,h,f,m){this.sessionInfo=f,this.auth=m,this.secretKey=n,this.hashingAlgorithm=l,this.codeLength=u,this.codeIntervalSeconds=d,this.enrollmentCompletionDeadline=h}static _fromStartTotpMfaEnrollmentResponse(n,l){return new TotpSecret(n.totpSessionInfo.sharedSecretKey,n.totpSessionInfo.hashingAlgorithm,n.totpSessionInfo.verificationCodeLength,n.totpSessionInfo.periodSec,new Date(n.totpSessionInfo.finalizeEnrollmentTime).toUTCString(),n.totpSessionInfo.sessionInfo,l)}_makeTotpVerificationInfo(n){return{sessionInfo:this.sessionInfo,verificationCode:n}}generateQrCodeUrl(n,l){var u;let d=!1;return(_isEmptyString(n)||_isEmptyString(l))&&(d=!0),d&&(_isEmptyString(n)&&(n=(null===(u=this.auth.currentUser)||void 0===u?void 0:u.email)||"unknownuser"),_isEmptyString(l)&&(l=this.auth.name)),`otpauth://totp/${l}:${n}?secret=${this.secretKey}&issuer=${l}&algorithm=${this.hashingAlgorithm}&digits=${this.codeLength}`}};function _isEmptyString(n){return void 0===n||(null==n?void 0:n.length)===0}var eI="@firebase/auth",eR="1.5.1";/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let AuthInterop=class AuthInterop{constructor(n){this.auth=n,this.internalListeners=new Map}getUid(){var n;return this.assertAuthConfigured(),(null===(n=this.auth.currentUser)||void 0===n?void 0:n.uid)||null}async getToken(n){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;let l=await this.auth.currentUser.getIdToken(n);return{accessToken:l}}addAuthTokenListener(n){if(this.assertAuthConfigured(),this.internalListeners.has(n))return;let l=this.auth.onIdTokenChanged(l=>{n((null==l?void 0:l.stsTokenManager.accessToken)||null)});this.internalListeners.set(n,l),this.updateProactiveRefresh()}removeAuthTokenListener(n){this.assertAuthConfigured();let l=this.internalListeners.get(n);l&&(this.internalListeners.delete(n),l(),this.updateProactiveRefresh())}assertAuthConfigured(){_assert(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}};let eP=(0,h.Pz)("authIdTokenMaxAge")||300,eA=null,mintCookieFactory=n=>async l=>{let u=l&&await l.getIdTokenResult(),d=u&&(new Date().getTime()-Date.parse(u.issuedAtTime))/1e3;if(d&&d>eP)return;let h=null==u?void 0:u.token;eA!==h&&(eA=h,await fetch(n,{method:h?"POST":"DELETE",headers:h?{Authorization:`Bearer ${h}`}:{}}))};function getAuth(n=(0,f.Mq)()){let l=(0,f.qX)(n,"auth");if(l.isInitialized())return l.getImmediate();let u=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n,l){let u=(0,f.qX)(n,"auth");if(u.isInitialized()){let n=u.getImmediate(),d=u.getOptions();if((0,h.vZ)(d,null!=l?l:{}))return n;_fail(n,"already-initialized")}let d=u.initialize({options:l});return d}(n,{popupRedirectResolver:eT,persistence:[IndexedDBLocalPersistence,BrowserLocalPersistence,BrowserSessionPersistence]}),d=(0,h.Pz)("authTokenSyncURL");if(d){let n=mintCookieFactory(d);(0,h.m9)(u).beforeAuthStateChanged(n,()=>n(u.currentUser)),(0,h.m9)(u).onIdTokenChanged(l=>n(l),void 0,void 0)}let m=(0,h.q4)("auth");return m&&function(n,l,u){let d=_castAuth(n);_assert(d._canInitEmulator,d,"emulator-config-failed"),_assert(/^https?:\/\//.test(l),d,"invalid-emulator-scheme");let h=!!(null==u?void 0:u.disableWarnings),f=extractProtocol(l),{host:m,port:g}=function(n){let l=extractProtocol(n),u=/(\/\/)?([^?#/]+)/.exec(n.substr(l.length));if(!u)return{host:"",port:null};let d=u[2].split("@").pop()||"",h=/^(\[[^\]]+\])(:|$)/.exec(d);if(h){let n=h[1];return{host:n,port:parsePort(d.substr(n.length+1))}}{let[n,l]=d.split(":");return{host:n,port:parsePort(l)}}}(l),_=null===g?"":`:${g}`;d.config.emulator={url:`${f}//${m}${_}/`},d.settings.appVerificationDisabledForTesting=!0,d.emulatorConfig=Object.freeze({host:m,port:g,protocol:f.replace(":",""),options:Object.freeze({disableWarnings:h})}),h||function(){function attachBanner(){let n=document.createElement("p"),l=n.style;n.innerText="Running in emulator mode. Do not use with production credentials.",l.position="fixed",l.width="100%",l.backgroundColor="#ffffff",l.border=".1em solid #000000",l.color="#b50000",l.bottom="0px",l.left="0px",l.margin="0px",l.zIndex="10000",l.textAlign="center",n.classList.add("firebase-emulator-warning"),document.body.appendChild(n)}"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",attachBanner):attachBanner())}()}(u,`http://${m}`),u}d="Browser",(0,f.Xd)(new _.wA("auth",(n,{options:l})=>{let u=n.getProvider("app").getImmediate(),h=n.getProvider("heartbeat"),f=n.getProvider("app-check-internal"),{apiKey:m,authDomain:g}=u.options;_assert(m&&!m.includes(":"),"invalid-api-key",{appName:u.name});let _={apiKey:m,authDomain:g,clientPlatform:d,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:_getClientVersion(d)},j=new AuthImpl(u,h,f,_);return function(n,l){let u=(null==l?void 0:l.persistence)||[],d=(Array.isArray(u)?u:[u]).map(_getInstance);(null==l?void 0:l.errorMap)&&n._updateErrorMap(l.errorMap),n._initializeWithPersistence(d,null==l?void 0:l.popupRedirectResolver)}(j,l),j},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((n,l,u)=>{let d=n.getProvider("auth-internal");d.initialize()})),(0,f.Xd)(new _.wA("auth-internal",n=>{let l=_castAuth(n.getProvider("auth").getImmediate());return new AuthInterop(l)},"PRIVATE").setInstantiationMode("EXPLICIT")),(0,f.KN)(eI,eR,/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(d)),(0,f.KN)(eI,eR,"esm2017")},98747:function(n,l,u){"use strict";u.d(l,{vr:function(){return arrayUnion},JU:function(){return doc},QT:function(){return getDoc},ad:function(){return getFirestore},cf:function(){return onSnapshot},i3:function(){return runTransaction},pl:function(){return setDoc}});var d,h,f,m,g,_,j,$=u(96327),z=u(46387),ee=u(68207),et=u(83395),en="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eo={},es=es||{},el=en||self;function aa(n){var l=typeof n;return"array"==(l="object"!=l?l:n?Array.isArray(n)?"array":l:"null")||"object"==l&&"number"==typeof n.length}function p(n){var l=typeof n;return"object"==l&&null!=n||"function"==l}function ea(n,l,u){return n.call.apply(n.bind,arguments)}function fa(n,l,u){if(!n)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var u=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(u,d),n.apply(l,u)}}return function(){return n.apply(l,arguments)}}function q(n,l,u){return(q=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea:fa).apply(null,arguments)}function ha(n,l){var u=Array.prototype.slice.call(arguments,1);return function(){var l=u.slice();return l.push.apply(l,arguments),n.apply(this,l)}}function r(n,l){function c(){}c.prototype=l.prototype,n.$=l.prototype,n.prototype=new c,n.prototype.constructor=n,n.ac=function(n,u,d){for(var h=Array(arguments.length-2),f=2;f<arguments.length;f++)h[f-2]=arguments[f];return l.prototype[u].apply(n,h)}}function v(){this.s=this.s,this.o=this.o}v.prototype.s=!1,v.prototype.sa=function(){this.s||(this.s=!0,this.N())},v.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};let eu=Array.prototype.indexOf?function(n,l){return Array.prototype.indexOf.call(n,l,void 0)}:function(n,l){if("string"==typeof n)return"string"!=typeof l||1!=l.length?-1:n.indexOf(l,0);for(let u=0;u<n.length;u++)if(u in n&&n[u]===l)return u;return -1};function ma(n){let l=n.length;if(0<l){let u=Array(l);for(let d=0;d<l;d++)u[d]=n[d];return u}return[]}function na(n,l){for(let l=1;l<arguments.length;l++){let u=arguments[l];if(aa(u)){let l=n.length||0,d=u.length||0;n.length=l+d;for(let h=0;h<d;h++)n[l+h]=u[h]}else n.push(u)}}function w(n,l){this.type=n,this.g=this.target=l,this.defaultPrevented=!1}w.prototype.h=function(){this.defaultPrevented=!0};var ec=function(){if(!el.addEventListener||!Object.defineProperty)return!1;var n=!1,l=Object.defineProperty({},"passive",{get:function(){n=!0}});try{let c=()=>{};el.addEventListener("test",c,l),el.removeEventListener("test",c,l)}catch(n){}return n}();function x(n){return/^[\s\xa0]*$/.test(n)}function pa(){var n=el.navigator;return n&&(n=n.userAgent)?n:""}function y(n){return -1!=pa().indexOf(n)}function qa(n){return qa[" "](n),n}qa[" "]=function(){};var eh=y("Opera"),ep=y("Trident")||y("MSIE"),ef=y("Edge"),em=ef||ep,eg=y("Gecko")&&!(-1!=pa().toLowerCase().indexOf("webkit")&&!y("Edge"))&&!(y("Trident")||y("MSIE"))&&!y("Edge"),e_=-1!=pa().toLowerCase().indexOf("webkit")&&!y("Edge");function ya(){var n=el.document;return n?n.documentMode:void 0}e:{var ey,ev="",eE=(ey=pa(),eg?/rv:([^\);]+)(\)|;)/.exec(ey):ef?/Edge\/([\d\.]+)/.exec(ey):ep?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(ey):e_?/WebKit\/(\S+)/.exec(ey):eh?/(?:Version)[ \/]?(\S+)/.exec(ey):void 0);if(eE&&(ev=eE?eE[1]:""),ep){var eS=ya();if(null!=eS&&eS>parseFloat(ev)){h=String(eS);break e}}h=ev}var ew=el.document&&ep&&(ya()||parseInt(h,10))||void 0;function A(n,l){if(w.call(this,n?n.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,n){var u=this.type=n.type,d=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:null;if(this.target=n.target||n.srcElement,this.g=l,l=n.relatedTarget){if(eg){e:{try{qa(l.nodeName);var h=!0;break e}catch(n){}h=!1}h||(l=null)}}else"mouseover"==u?l=n.fromElement:"mouseout"==u&&(l=n.toElement);this.relatedTarget=l,d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||0):(this.clientX=void 0!==n.clientX?n.clientX:n.pageX,this.clientY=void 0!==n.clientY?n.clientY:n.pageY,this.screenX=n.screenX||0,this.screenY=n.screenY||0),this.button=n.button,this.key=n.key||"",this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.pointerId=n.pointerId||0,this.pointerType="string"==typeof n.pointerType?n.pointerType:eT[n.pointerType]||"",this.state=n.state,this.i=n,n.defaultPrevented&&A.$.h.call(this)}}r(A,w);var eT={2:"touch",3:"pen",4:"mouse"};A.prototype.h=function(){A.$.h.call(this);var n=this.i;n.preventDefault?n.preventDefault():n.returnValue=!1};var eI="closure_listenable_"+(1e6*Math.random()|0),eR=0;function Ja(n,l,u,d,h){this.listener=n,this.proxy=null,this.src=l,this.type=u,this.capture=!!d,this.la=h,this.key=++eR,this.fa=this.ia=!1}function Ma(n){n.fa=!0,n.listener=null,n.proxy=null,n.src=null,n.la=null}function Na(n,l,u){for(let d in n)l.call(u,n[d],d,n)}function Pa(n){let l={};for(let u in n)l[u]=n[u];return l}let eP="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ra(n,l){let u,d;for(let l=1;l<arguments.length;l++){for(u in d=arguments[l])n[u]=d[u];for(let l=0;l<eP.length;l++)u=eP[l],Object.prototype.hasOwnProperty.call(d,u)&&(n[u]=d[u])}}function Sa(n){this.src=n,this.g={},this.h=0}function Ua(n,l){var u=l.type;if(u in n.g){var d,h=n.g[u],f=eu(h,l);(d=0<=f)&&Array.prototype.splice.call(h,f,1),d&&(Ma(l),0==n.g[u].length&&(delete n.g[u],n.h--))}}function Ta(n,l,u,d){for(var h=0;h<n.length;++h){var f=n[h];if(!f.fa&&f.listener==l&&!!u==f.capture&&f.la==d)return h}return -1}Sa.prototype.add=function(n,l,u,d,h){var f=n.toString();(n=this.g[f])||(n=this.g[f]=[],this.h++);var m=Ta(n,l,d,h);return -1<m?(l=n[m],u||(l.ia=!1)):((l=new Ja(l,this.src,f,!!d,h)).ia=u,n.push(l)),l};var eA="closure_lm_"+(1e6*Math.random()|0),eO={};function ab(n,l,u,d,h,f){if(!l)throw Error("Invalid event type");var m=p(h)?!!h.capture:!!h,g=bb(n);if(g||(n[eA]=g=new Sa(n)),(u=g.add(l,u,d,m,f)).proxy)return u;if(d=function a(n){return eb.call(a.src,a.listener,n)},u.proxy=d,d.src=n,d.listener=u,n.addEventListener)ec||(h=m),void 0===h&&(h=!1),n.addEventListener(l.toString(),d,h);else if(n.attachEvent)n.attachEvent(db(l.toString()),d);else if(n.addListener&&n.removeListener)n.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");return u}function gb(n){if("number"!=typeof n&&n&&!n.fa){var l=n.src;if(l&&l[eI])Ua(l.i,n);else{var u=n.type,d=n.proxy;l.removeEventListener?l.removeEventListener(u,d,n.capture):l.detachEvent?l.detachEvent(db(u),d):l.addListener&&l.removeListener&&l.removeListener(d),(u=bb(l))?(Ua(u,n),0==u.h&&(u.src=null,l[eA]=null)):Ma(n)}}}function db(n){return n in eO?eO[n]:eO[n]="on"+n}function eb(n,l){if(n.fa)n=!0;else{l=new A(l,this);var u=n.listener,d=n.la||n.src;n.ia&&gb(n),n=u.call(d,l)}return n}function bb(n){return(n=n[eA])instanceof Sa?n:null}var eC="__closure_events_fn_"+(1e9*Math.random()>>>0);function $a(n){return"function"==typeof n?n:(n[eC]||(n[eC]=function(l){return n.handleEvent(l)}),n[eC])}function B(){v.call(this),this.i=new Sa(this),this.S=this,this.J=null}function C(n,l){var u,d=n.J;if(d)for(u=[];d;d=d.J)u.push(d);if(n=n.S,d=l.type||l,"string"==typeof l)l=new w(l,n);else if(l instanceof w)l.target=l.target||n;else{var h=l;Ra(l=new w(d,n),h)}if(h=!0,u)for(var f=u.length-1;0<=f;f--){var m=l.g=u[f];h=ib(m,d,!0,l)&&h}if(h=ib(m=l.g=n,d,!0,l)&&h,h=ib(m,d,!1,l)&&h,u)for(f=0;f<u.length;f++)h=ib(m=l.g=u[f],d,!1,l)&&h}function ib(n,l,u,d){if(!(l=n.i.g[String(l)]))return!0;l=l.concat();for(var h=!0,f=0;f<l.length;++f){var m=l[f];if(m&&!m.fa&&m.capture==u){var g=m.listener,_=m.la||m.src;m.ia&&Ua(n.i,m),h=!1!==g.call(_,d)&&h}}return h&&!d.defaultPrevented}r(B,v),B.prototype[eI]=!0,B.prototype.removeEventListener=function(n,l,u,d){!function fb(n,l,u,d,h){if(Array.isArray(l))for(var f=0;f<l.length;f++)fb(n,l[f],u,d,h);else(d=p(d)?!!d.capture:!!d,u=$a(u),n&&n[eI])?(n=n.i,(l=String(l).toString())in n.g&&-1<(u=Ta(f=n.g[l],u,d,h))&&(Ma(f[u]),Array.prototype.splice.call(f,u,1),0==f.length&&(delete n.g[l],n.h--))):n&&(n=bb(n))&&(l=n.g[l.toString()],n=-1,l&&(n=Ta(l,u,d,h)),(u=-1<n?l[n]:null)&&gb(u))}(this,n,l,u,d)},B.prototype.N=function(){if(B.$.N.call(this),this.i){var n,l=this.i;for(n in l.g){for(var u=l.g[n],d=0;d<u.length;d++)Ma(u[d]);delete l.g[n],l.h--}}this.J=null},B.prototype.O=function(n,l,u,d){return this.i.add(String(n),l,!1,u,d)},B.prototype.P=function(n,l,u,d){return this.i.add(String(n),l,!0,u,d)};var ek=el.JSON.stringify,ex=new class{constructor(n,l){this.i=n,this.j=l,this.h=0,this.g=null}get(){let n;return 0<this.h?(this.h--,n=this.g,this.g=n.next,n.next=null):n=this.i(),n}}(()=>new pb,n=>n.reset());let pb=class pb{constructor(){this.next=this.g=this.h=null}set(n,l){this.h=n,this.g=l,this.next=null}reset(){this.next=this.g=this.h=null}};let eM,eD=!1,eN=new class{constructor(){this.h=this.g=null}add(n,l){let u=ex.get();u.set(n,l),this.h?this.h.next=u:this.g=u,this.h=u}},vb=()=>{let n=el.Promise.resolve(void 0);eM=()=>{n.then(ub)}};var ub=()=>{let n;for(var l;n=null,eN.g&&(n=eN.g,eN.g=eN.g.next,eN.g||(eN.h=null),n.next=null),l=n;){try{l.h.call(l.g)}catch(n){!function(n){el.setTimeout(()=>{throw n},0)}(n)}ex.j(l),100>ex.h&&(ex.h++,l.next=ex.g,ex.g=l)}eD=!1};function wb(n,l){B.call(this),this.h=n||1,this.g=l||el,this.j=q(this.qb,this),this.l=Date.now()}function xb(n){n.ga=!1,n.T&&(n.g.clearTimeout(n.T),n.T=null)}function yb(n,l,u){if("function"==typeof n)u&&(n=q(n,u));else if(n&&"function"==typeof n.handleEvent)n=q(n.handleEvent,n);else throw Error("Invalid listener argument");return 2147483647<Number(l)?-1:el.setTimeout(n,l||0)}r(wb,B),(j=wb.prototype).ga=!1,j.T=null,j.qb=function(){if(this.ga){var n=Date.now()-this.l;0<n&&n<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-n):(this.T&&(this.g.clearTimeout(this.T),this.T=null),C(this,"tick"),this.ga&&(xb(this),this.start()))}},j.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())},j.N=function(){wb.$.N.call(this),xb(this),delete this.g};let Ab=class Ab extends v{constructor(n,l){super(),this.m=n,this.j=l,this.h=null,this.i=!1,this.g=null}l(n){this.h=arguments,this.g?this.i=!0:function zb(n){n.g=yb(()=>{n.g=null,n.i&&(n.i=!1,zb(n))},n.j);let l=n.h;n.h=null,n.m.apply(null,l)}(this)}N(){super.N(),this.g&&(el.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}};function Bb(n){v.call(this),this.h=n,this.g={}}r(Bb,v);var eV=[];function Eb(n,l,u,d){Array.isArray(u)||(u&&(eV[0]=u.toString()),u=eV);for(var h=0;h<u.length;h++){var f=function Ya(n,l,u,d,h){if(d&&d.once)return function Za(n,l,u,d,h){if(Array.isArray(l)){for(var f=0;f<l.length;f++)Za(n,l[f],u,d,h);return null}return u=$a(u),n&&n[eI]?n.P(l,u,p(d)?!!d.capture:!!d,h):ab(n,l,u,!0,d,h)}(n,l,u,d,h);if(Array.isArray(l)){for(var f=0;f<l.length;f++)Ya(n,l[f],u,d,h);return null}return u=$a(u),n&&n[eI]?n.O(l,u,p(d)?!!d.capture:!!d,h):ab(n,l,u,!1,d,h)}(l,u[h],d||n.handleEvent,!1,n.h||n);if(!f)break;n.g[f.key]=f}}function Fb(n){Na(n.g,function(n,l){this.g.hasOwnProperty(l)&&gb(n)},n),n.g={}}function Gb(){this.g=!0}function D(n,l,u,d){n.info(function(){return"XMLHTTP TEXT ("+l+"): "+function(n,l){if(!n.g)return l;if(!l)return null;try{var u=JSON.parse(l);if(u){for(n=0;n<u.length;n++)if(Array.isArray(u[n])){var d=u[n];if(!(2>d.length)){var h=d[1];if(Array.isArray(h)&&!(1>h.length)){var f=h[0];if("noop"!=f&&"stop"!=f&&"close"!=f)for(var m=1;m<h.length;m++)h[m]=""}}}}return ek(u)}catch(n){return l}}(n,u)+(d?" "+d:"")})}Bb.prototype.N=function(){Bb.$.N.call(this),Fb(this)},Bb.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Gb.prototype.Ea=function(){this.g=!1},Gb.prototype.info=function(){};var eF={},eL=null;function Mb(){return eL=eL||new B}function Nb(n){w.call(this,eF.Ta,n)}function Ob(n){let l=Mb();C(l,new Nb(l))}function Pb(n,l){w.call(this,eF.STAT_EVENT,n),this.stat=l}function F(n){let l=Mb();C(l,new Pb(l,n))}function Qb(n,l){w.call(this,eF.Ua,n),this.size=l}function Rb(n,l){if("function"!=typeof n)throw Error("Fn must not be null and must be a function");return el.setTimeout(function(){n()},l)}eF.Ta="serverreachability",r(Nb,w),eF.STAT_EVENT="statevent",r(Pb,w),eF.Ua="timingevent",r(Qb,w);var ej={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},eU={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function Ub(){}function Vb(n){return n.h||(n.h=n.i())}function Wb(){}Ub.prototype.h=null;var eB={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function Yb(){w.call(this,"d")}function Zb(){w.call(this,"c")}function ac(){}function bc(n,l,u,d){this.l=n,this.j=l,this.m=u,this.W=d||1,this.U=new Bb(this),this.P=e$,n=em?125:void 0,this.V=new wb(n),this.I=null,this.i=!1,this.u=this.B=this.A=this.L=this.G=this.Y=this.C=null,this.F=[],this.g=null,this.o=0,this.s=this.v=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 dc}function dc(){this.i=null,this.g="",this.h=!1}r(Yb,w),r(Zb,w),r(ac,Ub),ac.prototype.g=function(){return new XMLHttpRequest},ac.prototype.i=function(){return{}},m=new ac;var e$=45e3,eH={},eW={};function gc(n,l,u){n.L=1,n.A=hc(G(l)),n.u=u,n.S=!0,ic(n,null)}function ic(n,l){n.G=Date.now(),jc(n),n.B=G(n.A);var u=n.B,d=n.W;Array.isArray(d)||(d=[String(d)]),kc(u.i,"t",d),n.o=0,u=n.l.J,n.h=new dc,n.g=lc(n.l,u?l:null,!n.u),0<n.O&&(n.M=new Ab(q(n.Pa,n,n.g),n.O)),Eb(n.U,n.g,"readystatechange",n.nb),l=n.I?Pa(n.I):{},n.u?(n.v||(n.v="POST"),l["Content-Type"]="application/x-www-form-urlencoded",n.g.ha(n.B,n.v,n.u,l)):(n.v="GET",n.g.ha(n.B,n.v,null,l)),Ob(),function(n,l,u,d,h,f){n.info(function(){if(n.g){if(f)for(var m="",g=f.split("&"),_=0;_<g.length;_++){var j=g[_].split("=");if(1<j.length){var $=j[0];j=j[1];var z=$.split("_");m=2<=z.length&&"type"==z[1]?m+($+"=")+j+"&":m+($+"=redacted&")}}else m=null}else m=f;return"XMLHTTP REQ ("+d+") [attempt "+h+"]: "+l+"\n"+u+"\n"+m})}(n.j,n.v,n.B,n.m,n.W,n.u)}function oc(n){return!!n.g&&"GET"==n.v&&2!=n.L&&n.l.Ha}function rc(n,l,u){let d=!0,h;for(;!n.J&&n.o<u.length;)if((h=function(n,l){var u=n.o,d=l.indexOf("\n",u);return -1==d?eW:isNaN(u=Number(l.substring(u,d)))?eH:(d+=1)+u>l.length?eW:(l=l.slice(d,d+u),n.o=d+u,l)}(n,u))==eW){4==l&&(n.s=4,F(14),d=!1),D(n.j,n.m,null,"[Incomplete Response]");break}else if(h==eH){n.s=4,F(15),D(n.j,n.m,u,"[Invalid Chunk]"),d=!1;break}else D(n.j,n.m,h,null),qc(n,h);oc(n)&&0!=n.o&&(n.h.g=n.h.g.slice(n.o),n.o=0),4!=l||0!=u.length||n.h.h||(n.s=1,F(16),d=!1),n.i=n.i&&d,d?0<u.length&&!n.ba&&(n.ba=!0,(l=n.l).g==n&&l.ca&&!l.M&&(l.l.info("Great, no buffering proxy detected. Bytes received: "+u.length),vc(l),l.M=!0,F(11))):(D(n.j,n.m,u,"[Invalid Chunked Response]"),I(n),pc(n))}function jc(n){n.Y=Date.now()+n.P,wc(n,n.P)}function wc(n,l){if(null!=n.C)throw Error("WatchDog timer not null");n.C=Rb(q(n.lb,n),l)}function nc(n){n.C&&(el.clearTimeout(n.C),n.C=null)}function pc(n){0==n.l.H||n.J||sc(n.l,n)}function I(n){nc(n);var l=n.M;l&&"function"==typeof l.sa&&l.sa(),n.M=null,xb(n.V),Fb(n.U),n.g&&(l=n.g,n.g=null,l.abort(),l.sa())}function qc(n,l){try{var u=n.l;if(0!=u.H&&(u.g==n||xc(u.i,n))){if(!n.K&&xc(u.i,n)&&3==u.H){try{var d=u.Ja.g.parse(l)}catch(n){d=null}if(Array.isArray(d)&&3==d.length){var h=d;if(0==h[0]){e:if(!u.u){if(u.g){if(u.g.G+3e3<n.G)yc(u),zc(u);else break e}Ac(u),F(18)}}else u.Fa=h[1],0<u.Fa-u.V&&37500>h[2]&&u.G&&0==u.A&&!u.v&&(u.v=Rb(q(u.ib,u),6e3));if(1>=Bc(u.i)&&u.oa){try{u.oa()}catch(n){}u.oa=void 0}}else J(u,11)}else if((n.K||u.g==n)&&yc(u),!x(l))for(h=u.Ja.g.parse(l),l=0;l<h.length;l++){let g=h[l];if(u.V=g[0],g=g[1],2==u.H){if("c"==g[0]){u.K=g[1],u.pa=g[2];let l=g[3];null!=l&&(u.ra=l,u.l.info("VER="+u.ra));let h=g[4];null!=h&&(u.Ga=h,u.l.info("SVER="+u.Ga));let _=g[5];null!=_&&"number"==typeof _&&0<_&&(d=1.5*_,u.L=d,u.l.info("backChannelRequestTimeoutMs_="+d)),d=u;let j=n.g;if(j){let n=j.g?j.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(n){var f=d.i;f.g||-1==n.indexOf("spdy")&&-1==n.indexOf("quic")&&-1==n.indexOf("h2")||(f.j=f.l,f.g=new Set,f.h&&(Cc(f,f.h),f.h=null))}if(d.F){let n=j.g?j.g.getResponseHeader("X-HTTP-Session-Id"):null;n&&(d.Da=n,K(d.I,d.F,n))}}if(u.H=3,u.h&&u.h.Ba(),u.ca&&(u.S=Date.now()-n.G,u.l.info("Handshake RTT: "+u.S+"ms")),(d=u).wa=Dc(d,d.J?d.pa:null,d.Y),n.K){Ec(d.i,n);var m=d.L;m&&n.setTimeout(m),n.C&&(nc(n),jc(n)),d.g=n}else Fc(d);0<u.j.length&&Gc(u)}else"stop"!=g[0]&&"close"!=g[0]||J(u,7)}else 3==u.H&&("stop"==g[0]||"close"==g[0]?"stop"==g[0]?J(u,7):Hc(u):"noop"!=g[0]&&u.h&&u.h.Aa(g),u.A=0)}}Ob(4)}catch(n){}}function Kc(n,l){if(n.forEach&&"function"==typeof n.forEach)n.forEach(l,void 0);else if(aa(n)||"string"==typeof n)Array.prototype.forEach.call(n,l,void 0);else for(var u=function(n){if(n.ta&&"function"==typeof n.ta)return n.ta();if(!n.Z||"function"!=typeof n.Z){if("undefined"!=typeof Map&&n instanceof Map)return Array.from(n.keys());if(!("undefined"!=typeof Set&&n instanceof Set)){if(aa(n)||"string"==typeof n){var l=[];n=n.length;for(var u=0;u<n;u++)l.push(u);return l}for(let d in l=[],u=0,n)l[u++]=d;return l}}}(n),d=function(n){if(n.Z&&"function"==typeof n.Z)return n.Z();if("undefined"!=typeof Map&&n instanceof Map||"undefined"!=typeof Set&&n instanceof Set)return Array.from(n.values());if("string"==typeof n)return n.split("");if(aa(n)){for(var l=[],u=n.length,d=0;d<u;d++)l.push(n[d]);return l}for(d in l=[],u=0,n)l[u++]=n[d];return l}(n),h=d.length,f=0;f<h;f++)l.call(void 0,d[f],u&&u[f],n)}(j=bc.prototype).setTimeout=function(n){this.P=n},j.nb=function(n){n=n.target;let l=this.M;l&&3==H(n)?l.l():this.Pa(n)},j.Pa=function(n){try{if(n==this.g)e:{let $=H(this.g);var l=this.g.Ia();let z=this.g.da();if(!(3>$)&&(3!=$||em||this.g&&(this.h.h||this.g.ja()||mc(this.g)))){this.J||4!=$||7==l||(8==l||0>=z?Ob(3):Ob(2)),nc(this);var u=this.g.da();this.ca=u;t:if(oc(this)){var d=mc(this.g);n="";var h=d.length,f=4==H(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){I(this),pc(this);var m="";break t}this.h.i=new el.TextDecoder}for(l=0;l<h;l++)this.h.h=!0,n+=this.h.i.decode(d[l],{stream:f&&l==h-1});d.length=0,this.h.g+=n,this.o=0,m=this.h.g}else m=this.g.ja();if(this.i=200==u,function(n,l,u,d,h,f,m){n.info(function(){return"XMLHTTP RESP ("+d+") [ attempt "+h+"]: "+l+"\n"+u+"\n"+f+" "+m})}(this.j,this.v,this.B,this.m,this.W,$,u),this.i){if(this.aa&&!this.K){t:{if(this.g){var g,_=this.g;if((g=_.g?_.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!x(g)){var j=g;break t}}j=null}if(u=j)D(this.j,this.m,u,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,qc(this,u);else{this.i=!1,this.s=3,F(12),I(this),pc(this);break e}}this.S?(rc(this,$,m),em&&this.i&&3==$&&(Eb(this.U,this.V,"tick",this.mb),this.V.start())):(D(this.j,this.m,m,null),qc(this,m)),4==$&&I(this),this.i&&!this.J&&(4==$?sc(this.l,this):(this.i=!1,jc(this)))}else(function(n){let l={};n=(n.g&&2<=H(n)&&n.g.getAllResponseHeaders()||"").split("\r\n");for(let d=0;d<n.length;d++){if(x(n[d]))continue;var u=function(n){var l=1;n=n.split(":");let u=[];for(;0<l&&n.length;)u.push(n.shift()),l--;return n.length&&u.push(n.join(":")),u}(n[d]);let h=u[0];if("string"!=typeof(u=u[1]))continue;u=u.trim();let f=l[h]||[];l[h]=f,f.push(u)}!function(n,l){for(let u in n)l.call(void 0,n[u],u,n)}(l,function(n){return n.join(", ")})})(this.g),400==u&&0<m.indexOf("Unknown SID")?(this.s=3,F(12)):(this.s=0,F(13)),I(this),pc(this)}}}catch(n){}finally{}},j.mb=function(){if(this.g){var n=H(this.g),l=this.g.ja();this.o<l.length&&(nc(this),rc(this,n,l),this.i&&4!=n&&jc(this))}},j.cancel=function(){this.J=!0,I(this)},j.lb=function(){this.C=null;let n=Date.now();0<=n-this.Y?(function(n,l){n.info(function(){return"TIMEOUT: "+l})}(this.j,this.B),2!=this.L&&(Ob(),F(17)),I(this),this.s=2,pc(this)):wc(this,this.Y-n)};var eq=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function M(n){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,n instanceof M){this.h=n.h,Nc(this,n.j),this.s=n.s,this.g=n.g,Oc(this,n.m),this.l=n.l;var l=n.i,u=new Pc;u.i=l.i,l.g&&(u.g=new Map(l.g),u.h=l.h),Qc(this,u),this.o=n.o}else n&&(l=String(n).match(eq))?(this.h=!1,Nc(this,l[1]||"",!0),this.s=Rc(l[2]||""),this.g=Rc(l[3]||"",!0),Oc(this,l[4]),this.l=Rc(l[5]||"",!0),Qc(this,l[6]||"",!0),this.o=Rc(l[7]||"")):(this.h=!1,this.i=new Pc(null,this.h))}function G(n){return new M(n)}function Nc(n,l,u){n.j=u?Rc(l,!0):l,n.j&&(n.j=n.j.replace(/:$/,""))}function Oc(n,l){if(l){if(isNaN(l=Number(l))||0>l)throw Error("Bad port number "+l);n.m=l}else n.m=null}function Qc(n,l,u){var d,h;l instanceof Pc?(n.i=l,d=n.i,(h=n.h)&&!d.j&&(N(d),d.i=null,d.g.forEach(function(n,l){var u=l.toLowerCase();l!=u&&($c(this,l),kc(this,u,n))},d)),d.j=h):(u||(l=Sc(l,eX)),n.i=new Pc(l,n.h))}function K(n,l,u){n.i.set(l,u)}function hc(n){return K(n,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),n}function Rc(n,l){return n?l?decodeURI(n.replace(/%25/g,"%2525")):decodeURIComponent(n):""}function Sc(n,l,u){return"string"==typeof n?(n=encodeURI(n).replace(l,Zc),u&&(n=n.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n):null}function Zc(n){return"%"+((n=n.charCodeAt(0))>>4&15).toString(16)+(15&n).toString(16)}M.prototype.toString=function(){var n=[],l=this.j;l&&n.push(Sc(l,ez,!0),":");var u=this.g;return(u||"file"==l)&&(n.push("//"),(l=this.s)&&n.push(Sc(l,ez,!0),"@"),n.push(encodeURIComponent(String(u)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(u=this.m)&&n.push(":",String(u))),(u=this.l)&&(this.g&&"/"!=u.charAt(0)&&n.push("/"),n.push(Sc(u,"/"==u.charAt(0)?eK:eG,!0))),(u=this.i.toString())&&n.push("?",u),(u=this.o)&&n.push("#",Sc(u,eY)),n.join("")};var ez=/[#\/\?@]/g,eG=/[#\?:]/g,eK=/[#\?]/g,eX=/[#\?@]/g,eY=/#/g;function Pc(n,l){this.h=this.g=null,this.i=n||null,this.j=!!l}function N(n){n.g||(n.g=new Map,n.h=0,n.i&&function(n,l){if(n){n=n.split("&");for(var u=0;u<n.length;u++){var d=n[u].indexOf("="),h=null;if(0<=d){var f=n[u].substring(0,d);h=n[u].substring(d+1)}else f=n[u];l(f,h?decodeURIComponent(h.replace(/\+/g," ")):"")}}}(n.i,function(l,u){n.add(decodeURIComponent(l.replace(/\+/g," ")),u)}))}function $c(n,l){N(n),l=O(n,l),n.g.has(l)&&(n.i=null,n.h-=n.g.get(l).length,n.g.delete(l))}function ad(n,l){return N(n),l=O(n,l),n.g.has(l)}function kc(n,l,u){$c(n,l),0<u.length&&(n.i=null,n.g.set(O(n,l),ma(u)),n.h+=u.length)}function O(n,l){return l=String(l),n.j&&(l=l.toLowerCase()),l}(j=Pc.prototype).add=function(n,l){N(this),this.i=null,n=O(this,n);var u=this.g.get(n);return u||this.g.set(n,u=[]),u.push(l),this.h+=1,this},j.forEach=function(n,l){N(this),this.g.forEach(function(u,d){u.forEach(function(u){n.call(l,u,d,this)},this)},this)},j.ta=function(){N(this);let n=Array.from(this.g.values()),l=Array.from(this.g.keys()),u=[];for(let d=0;d<l.length;d++){let h=n[d];for(let n=0;n<h.length;n++)u.push(l[d])}return u},j.Z=function(n){N(this);let l=[];if("string"==typeof n)ad(this,n)&&(l=l.concat(this.g.get(O(this,n))));else{n=Array.from(this.g.values());for(let u=0;u<n.length;u++)l=l.concat(n[u])}return l},j.set=function(n,l){return N(this),this.i=null,ad(this,n=O(this,n))&&(this.h-=this.g.get(n).length),this.g.set(n,[l]),this.h+=1,this},j.get=function(n,l){return n&&0<(n=this.Z(n)).length?String(n[0]):l},j.toString=function(){if(this.i)return this.i;if(!this.g)return"";let n=[],l=Array.from(this.g.keys());for(var u=0;u<l.length;u++){var d=l[u];let f=encodeURIComponent(String(d)),m=this.Z(d);for(d=0;d<m.length;d++){var h=f;""!==m[d]&&(h+="="+encodeURIComponent(String(m[d]))),n.push(h)}}return this.i=n.join("&")};var eQ=class{constructor(n,l){this.g=n,this.map=l}};function cd(n){this.l=n||eJ,n=el.PerformanceNavigationTiming?0<(n=el.performance.getEntriesByType("navigation")).length&&("hq"==n[0].nextHopProtocol||"h2"==n[0].nextHopProtocol):!!(el.g&&el.g.Ka&&el.g.Ka()&&el.g.Ka().dc),this.j=n?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var eJ=10;function ed(n){return!!n.h||!!n.g&&n.g.size>=n.j}function Bc(n){return n.h?1:n.g?n.g.size:0}function xc(n,l){return n.h?n.h==l:!!n.g&&n.g.has(l)}function Cc(n,l){n.g?n.g.add(l):n.h=l}function Ec(n,l){n.h&&n.h==l?n.h=null:n.g&&n.g.has(l)&&n.g.delete(l)}function fd(n){if(null!=n.h)return n.i.concat(n.h.F);if(null!=n.g&&0!==n.g.size){let l=n.i;for(let u of n.g.values())l=l.concat(u.F);return l}return ma(n.i)}cd.prototype.cancel=function(){if(this.i=fd(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(let n of this.g.values())n.cancel();this.g.clear()}};var eZ=class{stringify(n){return el.JSON.stringify(n,void 0)}parse(n){return el.JSON.parse(n,void 0)}};function hd(){this.g=new eZ}function kd(n,l,u,d,h){try{l.onload=null,l.onerror=null,l.onabort=null,l.ontimeout=null,h(d)}catch(n){}}function ld(n){this.l=n.ec||null,this.j=n.ob||!1}function md(n,l){B.call(this),this.F=n,this.u=l,this.m=void 0,this.readyState=e0,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}r(ld,Ub),ld.prototype.g=function(){return new md(this.l,this.j)},ld.prototype.i=(d={},function(){return d}),r(md,B);var e0=0;function qd(n){n.j.read().then(n.Xa.bind(n)).catch(n.ka.bind(n))}function pd(n){n.readyState=4,n.l=null,n.j=null,n.A=null,od(n)}function od(n){n.onreadystatechange&&n.onreadystatechange.call(n)}(j=md.prototype).open=function(n,l){if(this.readyState!=e0)throw this.abort(),Error("Error reopening a connection");this.C=n,this.B=l,this.readyState=1,od(this)},j.send=function(n){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;let l={headers:this.v,method:this.C,credentials:this.m,cache:void 0};n&&(l.body=n),(this.F||el).fetch(new Request(this.B,l)).then(this.$a.bind(this),this.ka.bind(this))},j.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,pd(this)),this.readyState=e0},j.$a=function(n){if(this.g&&(this.l=n,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=n.headers,this.readyState=2,od(this)),this.g&&(this.readyState=3,od(this),this.g))){if("arraybuffer"===this.responseType)n.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(void 0!==el.ReadableStream&&"body"in n){if(this.j=n.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;qd(this)}else n.text().then(this.Za.bind(this),this.ka.bind(this))}},j.Xa=function(n){if(this.g){if(this.u&&n.value)this.response.push(n.value);else if(!this.u){var l=n.value?n.value:new Uint8Array(0);(l=this.A.decode(l,{stream:!n.done}))&&(this.response=this.responseText+=l)}n.done?pd(this):od(this),3==this.readyState&&qd(this)}},j.Za=function(n){this.g&&(this.response=this.responseText=n,pd(this))},j.Ya=function(n){this.g&&(this.response=n,pd(this))},j.ka=function(){this.g&&pd(this)},j.setRequestHeader=function(n,l){this.v.append(n,l)},j.getResponseHeader=function(n){return this.h&&this.h.get(n.toLowerCase())||""},j.getAllResponseHeaders=function(){if(!this.h)return"";let n=[],l=this.h.entries();for(var u=l.next();!u.done;)n.push((u=u.value)[0]+": "+u[1]),u=l.next();return n.join("\r\n")},Object.defineProperty(md.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(n){this.m=n?"include":"same-origin"}});var e1=el.JSON.parse;function P(n){B.call(this),this.headers=new Map,this.u=n||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=e2,this.L=this.M=!1}r(P,B);var e2="",e3=/^https?$/i,e5=["POST","PUT"];function vd(n,l){n.h=!1,n.g&&(n.l=!0,n.g.abort(),n.l=!1),n.j=l,n.m=5,yd(n),zd(n)}function yd(n){n.F||(n.F=!0,C(n,"complete"),C(n,"error"))}function Ad(n){if(n.h&&void 0!==es&&(!n.C[1]||4!=H(n)||2!=n.da())){if(n.v&&4==H(n))yb(n.La,0,n);else if(C(n,"readystatechange"),4==H(n)){n.h=!1;try{let m=n.da();switch(m){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var l,u,d=!0;break;default:d=!1}if(!(l=d)){if(u=0===m){var h=String(n.I).match(eq)[1]||null;!h&&el.self&&el.self.location&&(h=el.self.location.protocol.slice(0,-1)),u=!e3.test(h?h.toLowerCase():"")}l=u}if(l)C(n,"complete"),C(n,"success");else{n.m=6;try{var f=2<H(n)?n.g.statusText:""}catch(n){f=""}n.j=f+" ["+n.da()+"]",yd(n)}}finally{zd(n)}}}}function zd(n,l){if(n.g){wd(n);let u=n.g,d=n.C[0]?()=>{}:null;n.g=null,n.C=null,l||C(n,"ready");try{u.onreadystatechange=d}catch(n){}}}function wd(n){n.g&&n.L&&(n.g.ontimeout=null),n.A&&(el.clearTimeout(n.A),n.A=null)}function H(n){return n.g?n.g.readyState:0}function mc(n){try{if(!n.g)return null;if("response"in n.g)return n.g.response;switch(n.K){case e2:case"text":return n.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in n.g)return n.g.mozResponseArrayBuffer}return null}catch(n){return null}}function Bd(n){let l="";return Na(n,function(n,u){l+=u+":"+n+"\r\n"}),l}function Cd(n,l,u){e:{for(d in u){var d=!1;break e}d=!0}d||(u=Bd(u),"string"==typeof n?null!=u&&encodeURIComponent(String(u)):K(n,l,u))}function Dd(n,l,u){return u&&u.internalChannelParams&&u.internalChannelParams[n]||l}function Ed(n){this.Ga=0,this.j=[],this.l=new Gb,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=Dd("failFast",!1,n),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=Dd("baseRetryDelayMs",5e3,n),this.hb=Dd("retryDelaySeedMs",1e4,n),this.eb=Dd("forwardChannelMaxRetries",2,n),this.xa=Dd("forwardChannelRequestTimeoutMs",2e4,n),this.va=n&&n.xmlHttpFactory||void 0,this.Ha=n&&n.useFetchStreams||!1,this.L=void 0,this.J=n&&n.supportsCrossDomainXhr||!1,this.K="",this.i=new cd(n&&n.concurrentRequestLimit),this.Ja=new hd,this.P=n&&n.fastHandshake||!1,this.O=n&&n.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=n&&n.bc||!1,n&&n.Ea&&this.l.Ea(),n&&n.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&n&&n.detectBufferingProxy||!1,this.qa=void 0,n&&n.longPollingTimeout&&0<n.longPollingTimeout&&(this.qa=n.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}function Hc(n){if(Fd(n),3==n.H){var l=n.W++,u=G(n.I);if(K(u,"SID",n.K),K(u,"RID",l),K(u,"TYPE","terminate"),Gd(n,u),(l=new bc(n,n.l,l)).L=2,l.A=hc(G(u)),u=!1,el.navigator&&el.navigator.sendBeacon)try{u=el.navigator.sendBeacon(l.A.toString(),"")}catch(n){}!u&&el.Image&&((new Image).src=l.A,u=!0),u||(l.g=lc(l.l,null),l.g.ha(l.A)),l.G=Date.now(),jc(l)}Hd(n)}function zc(n){n.g&&(vc(n),n.g.cancel(),n.g=null)}function Fd(n){zc(n),n.u&&(el.clearTimeout(n.u),n.u=null),yc(n),n.i.cancel(),n.m&&("number"==typeof n.m&&el.clearTimeout(n.m),n.m=null)}function Gc(n){if(!ed(n.i)&&!n.m){n.m=!0;var l=n.Na;eM||vb(),eD||(eM(),eD=!0),eN.add(l,n),n.C=0}}function Ld(n,l){var u;u=l?l.m:n.W++;let d=G(n.I);K(d,"SID",n.K),K(d,"RID",u),K(d,"AID",n.V),Gd(n,d),n.o&&n.s&&Cd(d,n.o,n.s),u=new bc(n,n.l,u,n.C+1),null===n.o&&(u.I=n.s),l&&(n.j=l.F.concat(n.j)),l=Kd(n,u,1e3),u.setTimeout(Math.round(.5*n.xa)+Math.round(.5*n.xa*Math.random())),Cc(n.i,u),gc(u,d,l)}function Gd(n,l){n.na&&Na(n.na,function(n,u){K(l,u,n)}),n.h&&Kc({},function(n,u){K(l,u,n)})}function Kd(n,l,u){u=Math.min(n.j.length,u);var d=n.h?q(n.h.Va,n.h,n):null;e:{var h=n.j;let l=-1;for(;;){let n=["count="+u];-1==l?0<u?(l=h[0].g,n.push("ofs="+l)):l=0:n.push("ofs="+l);let f=!0;for(let m=0;m<u;m++){let u=h[m].g,g=h[m].map;if(0>(u-=l))l=Math.max(0,h[m].g-100),f=!1;else try{!function(n,l,u){let d=u||"";try{Kc(n,function(n,u){let h=n;p(n)&&(h=ek(n)),l.push(d+u+"="+encodeURIComponent(h))})}catch(n){throw l.push(d+"type="+encodeURIComponent("_badmap")),n}}(g,n,"req"+u+"_")}catch(n){d&&d(g)}}if(f){d=n.join("&");break e}}}return n=n.j.splice(0,u),l.F=n,d}function Fc(n){if(!n.g&&!n.u){n.ba=1;var l=n.Ma;eM||vb(),eD||(eM(),eD=!0),eN.add(l,n),n.A=0}}function Ac(n){return!n.g&&!n.u&&!(3<=n.A)&&(n.ba++,n.u=Rb(q(n.Ma,n),Jd(n,n.A)),n.A++,!0)}function vc(n){null!=n.B&&(el.clearTimeout(n.B),n.B=null)}function Md(n){n.g=new bc(n,n.l,"rpc",n.ba),null===n.o&&(n.g.I=n.s),n.g.O=0;var l=G(n.wa);K(l,"RID","rpc"),K(l,"SID",n.K),K(l,"AID",n.V),K(l,"CI",n.G?"0":"1"),!n.G&&n.qa&&K(l,"TO",n.qa),K(l,"TYPE","xmlhttp"),Gd(n,l),n.o&&n.s&&Cd(l,n.o,n.s),n.L&&n.g.setTimeout(n.L);var u=n.g;n=n.pa,u.L=1,u.A=hc(G(l)),u.u=null,u.S=!0,ic(u,n)}function yc(n){null!=n.v&&(el.clearTimeout(n.v),n.v=null)}function sc(n,l){var u=null;if(n.g==l){yc(n),vc(n),n.g=null;var d=2}else{if(!xc(n.i,l))return;u=l.F,Ec(n.i,l),d=1}if(0!=n.H){if(l.i){if(1==d){u=l.u?l.u.length:0,l=Date.now()-l.G;var h,f=n.C;C(d=Mb(),new Qb(d,u)),Gc(n)}else Fc(n)}else if(3==(f=l.s)||0==f&&0<l.ca||!(1==d&&(h=l,!(Bc(n.i)>=n.i.j-(n.m?1:0))&&(n.m?(n.j=h.F.concat(n.j),!0):1!=n.H&&2!=n.H&&!(n.C>=(n.cb?0:n.eb))&&(n.m=Rb(q(n.Na,n,h),Jd(n,n.C)),n.C++,!0)))||2==d&&Ac(n)))switch(u&&0<u.length&&((l=n.i).i=l.i.concat(u)),f){case 1:J(n,5);break;case 4:J(n,10);break;case 3:J(n,6);break;default:J(n,2)}}}function Jd(n,l){let u=n.ab+Math.floor(Math.random()*n.hb);return n.isActive()||(u*=2),u*l}function J(n,l){if(n.l.info("Error code "+l),2==l){var u=null;n.h&&(u=null);var d=q(n.pb,n);u||(u=new M("//www.google.com/images/cleardot.gif"),el.location&&"http"==el.location.protocol||Nc(u,"https"),hc(u)),function(n,l){let u=new Gb;if(el.Image){let d=new Image;d.onload=ha(kd,u,d,"TestLoadImage: loaded",!0,l),d.onerror=ha(kd,u,d,"TestLoadImage: error",!1,l),d.onabort=ha(kd,u,d,"TestLoadImage: abort",!1,l),d.ontimeout=ha(kd,u,d,"TestLoadImage: timeout",!1,l),el.setTimeout(function(){d.ontimeout&&d.ontimeout()},1e4),d.src=n}else l(!1)}(u.toString(),d)}else F(2);n.H=0,n.h&&n.h.za(l),Hd(n),Fd(n)}function Hd(n){if(n.H=0,n.ma=[],n.h){let l=fd(n.i);(0!=l.length||0!=n.j.length)&&(na(n.ma,l),na(n.ma,n.j),n.i.i.length=0,ma(n.j),n.j.length=0),n.h.ya()}}function Dc(n,l,u){var d=u instanceof M?G(u):new M(u);if(""!=d.g)l&&(d.g=l+"."+d.g),Oc(d,d.m);else{var h=el.location;d=h.protocol,l=l?l+"."+h.hostname:h.hostname,h=+h.port;var f=new M(null);d&&Nc(f,d),l&&(f.g=l),h&&Oc(f,h),u&&(f.l=u),d=f}return u=n.F,l=n.Da,u&&l&&K(d,u,l),K(d,"VER",n.ra),Gd(n,d),d}function lc(n,l,u){if(l&&!n.J)throw Error("Can't create secondary domain capable XhrIo object.");return(l=new P(n.Ha&&!n.va?new ld({ob:u}):n.va)).Oa(n.J),l}function Nd(){}function Od(){if(ep&&!(10<=Number(ew)))throw Error("Environmental error: no available transport.")}function Q(n,l){B.call(this),this.g=new Ed(l),this.l=n,this.h=l&&l.messageUrlParams||null,n=l&&l.messageHeaders||null,l&&l.clientProtocolHeaderRequired&&(n?n["X-Client-Protocol"]="webchannel":n={"X-Client-Protocol":"webchannel"}),this.g.s=n,n=l&&l.initMessageHeaders||null,l&&l.messageContentType&&(n?n["X-WebChannel-Content-Type"]=l.messageContentType:n={"X-WebChannel-Content-Type":l.messageContentType}),l&&l.Ca&&(n?n["X-WebChannel-Client-Profile"]=l.Ca:n={"X-WebChannel-Client-Profile":l.Ca}),this.g.U=n,(n=l&&l.cc)&&!x(n)&&(this.g.o=n),this.A=l&&l.supportsCrossDomainXhr||!1,this.v=l&&l.sendRawJson||!1,(l=l&&l.httpSessionIdParam)&&!x(l)&&(this.g.F=l,null!==(n=this.h)&&l in n&&l in(n=this.h)&&delete n[l]),this.j=new R(this)}function Pd(n){Yb.call(this),n.__headers__&&(this.headers=n.__headers__,this.statusCode=n.__status__,delete n.__headers__,delete n.__status__);var l=n.__sm__;if(l){e:{for(let u in l){n=u;break e}n=void 0}(this.i=n)&&(n=this.i,l=null!==l&&n in l?l[n]:void 0),this.data=l}else this.data=n}function Qd(){Zb.call(this),this.status=1}function R(n){this.g=n}function S(){this.blockSize=-1,this.blockSize=64,this.g=[,,,,],this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}function Sd(n,l,u){u||(u=0);var d=Array(16);if("string"==typeof l)for(var h=0;16>h;++h)d[h]=l.charCodeAt(u++)|l.charCodeAt(u++)<<8|l.charCodeAt(u++)<<16|l.charCodeAt(u++)<<24;else for(h=0;16>h;++h)d[h]=l[u++]|l[u++]<<8|l[u++]<<16|l[u++]<<24;l=n.g[0],u=n.g[1],h=n.g[2];var f=n.g[3],m=l+(f^u&(h^f))+d[0]+3614090360&4294967295;m=f+(h^(l=u+(m<<7&4294967295|m>>>25))&(u^h))+d[1]+3905402710&4294967295,m=h+(u^(f=l+(m<<12&4294967295|m>>>20))&(l^u))+d[2]+606105819&4294967295,m=u+(l^(h=f+(m<<17&4294967295|m>>>15))&(f^l))+d[3]+3250441966&4294967295,m=l+(f^(u=h+(m<<22&4294967295|m>>>10))&(h^f))+d[4]+4118548399&4294967295,m=f+(h^(l=u+(m<<7&4294967295|m>>>25))&(u^h))+d[5]+1200080426&4294967295,m=h+(u^(f=l+(m<<12&4294967295|m>>>20))&(l^u))+d[6]+2821735955&4294967295,m=u+(l^(h=f+(m<<17&4294967295|m>>>15))&(f^l))+d[7]+4249261313&4294967295,m=l+(f^(u=h+(m<<22&4294967295|m>>>10))&(h^f))+d[8]+1770035416&4294967295,m=f+(h^(l=u+(m<<7&4294967295|m>>>25))&(u^h))+d[9]+2336552879&4294967295,m=h+(u^(f=l+(m<<12&4294967295|m>>>20))&(l^u))+d[10]+4294925233&4294967295,m=u+(l^(h=f+(m<<17&4294967295|m>>>15))&(f^l))+d[11]+2304563134&4294967295,m=l+(f^(u=h+(m<<22&4294967295|m>>>10))&(h^f))+d[12]+1804603682&4294967295,m=f+(h^(l=u+(m<<7&4294967295|m>>>25))&(u^h))+d[13]+4254626195&4294967295,m=h+(u^(f=l+(m<<12&4294967295|m>>>20))&(l^u))+d[14]+2792965006&4294967295,m=u+(l^(h=f+(m<<17&4294967295|m>>>15))&(f^l))+d[15]+1236535329&4294967295,u=h+(m<<22&4294967295|m>>>10),m=l+(h^f&(u^h))+d[1]+4129170786&4294967295,l=u+(m<<5&4294967295|m>>>27),m=f+(u^h&(l^u))+d[6]+3225465664&4294967295,f=l+(m<<9&4294967295|m>>>23),m=h+(l^u&(f^l))+d[11]+643717713&4294967295,h=f+(m<<14&4294967295|m>>>18),m=u+(f^l&(h^f))+d[0]+3921069994&4294967295,u=h+(m<<20&4294967295|m>>>12),m=l+(h^f&(u^h))+d[5]+3593408605&4294967295,l=u+(m<<5&4294967295|m>>>27),m=f+(u^h&(l^u))+d[10]+38016083&4294967295,f=l+(m<<9&4294967295|m>>>23),m=h+(l^u&(f^l))+d[15]+3634488961&4294967295,h=f+(m<<14&4294967295|m>>>18),m=u+(f^l&(h^f))+d[4]+3889429448&4294967295,u=h+(m<<20&4294967295|m>>>12),m=l+(h^f&(u^h))+d[9]+568446438&4294967295,l=u+(m<<5&4294967295|m>>>27),m=f+(u^h&(l^u))+d[14]+3275163606&4294967295,f=l+(m<<9&4294967295|m>>>23),m=h+(l^u&(f^l))+d[3]+4107603335&4294967295,h=f+(m<<14&4294967295|m>>>18),m=u+(f^l&(h^f))+d[8]+1163531501&4294967295,u=h+(m<<20&4294967295|m>>>12),m=l+(h^f&(u^h))+d[13]+2850285829&4294967295,l=u+(m<<5&4294967295|m>>>27),m=f+(u^h&(l^u))+d[2]+4243563512&4294967295,f=l+(m<<9&4294967295|m>>>23),m=h+(l^u&(f^l))+d[7]+1735328473&4294967295,h=f+(m<<14&4294967295|m>>>18),m=u+(f^l&(h^f))+d[12]+2368359562&4294967295,m=l+((u=h+(m<<20&4294967295|m>>>12))^h^f)+d[5]+4294588738&4294967295,m=f+((l=u+(m<<4&4294967295|m>>>28))^u^h)+d[8]+2272392833&4294967295,m=h+((f=l+(m<<11&4294967295|m>>>21))^l^u)+d[11]+1839030562&4294967295,m=u+((h=f+(m<<16&4294967295|m>>>16))^f^l)+d[14]+4259657740&4294967295,m=l+((u=h+(m<<23&4294967295|m>>>9))^h^f)+d[1]+2763975236&4294967295,m=f+((l=u+(m<<4&4294967295|m>>>28))^u^h)+d[4]+1272893353&4294967295,m=h+((f=l+(m<<11&4294967295|m>>>21))^l^u)+d[7]+4139469664&4294967295,m=u+((h=f+(m<<16&4294967295|m>>>16))^f^l)+d[10]+3200236656&4294967295,m=l+((u=h+(m<<23&4294967295|m>>>9))^h^f)+d[13]+681279174&4294967295,m=f+((l=u+(m<<4&4294967295|m>>>28))^u^h)+d[0]+3936430074&4294967295,m=h+((f=l+(m<<11&4294967295|m>>>21))^l^u)+d[3]+3572445317&4294967295,m=u+((h=f+(m<<16&4294967295|m>>>16))^f^l)+d[6]+76029189&4294967295,m=l+((u=h+(m<<23&4294967295|m>>>9))^h^f)+d[9]+3654602809&4294967295,m=f+((l=u+(m<<4&4294967295|m>>>28))^u^h)+d[12]+3873151461&4294967295,m=h+((f=l+(m<<11&4294967295|m>>>21))^l^u)+d[15]+530742520&4294967295,m=u+((h=f+(m<<16&4294967295|m>>>16))^f^l)+d[2]+3299628645&4294967295,u=h+(m<<23&4294967295|m>>>9),m=l+(h^(u|~f))+d[0]+4096336452&4294967295,l=u+(m<<6&4294967295|m>>>26),m=f+(u^(l|~h))+d[7]+1126891415&4294967295,f=l+(m<<10&4294967295|m>>>22),m=h+(l^(f|~u))+d[14]+2878612391&4294967295,h=f+(m<<15&4294967295|m>>>17),m=u+(f^(h|~l))+d[5]+4237533241&4294967295,u=h+(m<<21&4294967295|m>>>11),m=l+(h^(u|~f))+d[12]+1700485571&4294967295,l=u+(m<<6&4294967295|m>>>26),m=f+(u^(l|~h))+d[3]+2399980690&4294967295,f=l+(m<<10&4294967295|m>>>22),m=h+(l^(f|~u))+d[10]+4293915773&4294967295,h=f+(m<<15&4294967295|m>>>17),m=u+(f^(h|~l))+d[1]+2240044497&4294967295,u=h+(m<<21&4294967295|m>>>11),m=l+(h^(u|~f))+d[8]+1873313359&4294967295,l=u+(m<<6&4294967295|m>>>26),m=f+(u^(l|~h))+d[15]+4264355552&4294967295,f=l+(m<<10&4294967295|m>>>22),m=h+(l^(f|~u))+d[6]+2734768916&4294967295,h=f+(m<<15&4294967295|m>>>17),m=u+(f^(h|~l))+d[13]+1309151649&4294967295,u=h+(m<<21&4294967295|m>>>11),m=l+(h^(u|~f))+d[4]+4149444226&4294967295,l=u+(m<<6&4294967295|m>>>26),m=f+(u^(l|~h))+d[11]+3174756917&4294967295,f=l+(m<<10&4294967295|m>>>22),m=h+(l^(f|~u))+d[2]+718787259&4294967295,h=f+(m<<15&4294967295|m>>>17),m=u+(f^(h|~l))+d[9]+3951481745&4294967295,n.g[0]=n.g[0]+l&4294967295,n.g[1]=n.g[1]+(h+(m<<21&4294967295|m>>>11))&4294967295,n.g[2]=n.g[2]+h&4294967295,n.g[3]=n.g[3]+f&4294967295}function T(n,l){this.h=l;for(var u=[],d=!0,h=n.length-1;0<=h;h--){var f=0|n[h];d&&f==l||(u[h]=f,d=!1)}this.g=u}(j=P.prototype).Oa=function(n){this.M=n},j.ha=function(n,l,u,d){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+n);l=l?l.toUpperCase():"GET",this.I=n,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():m.g(),this.C=this.u?Vb(this.u):Vb(m),this.g.onreadystatechange=q(this.La,this);try{this.G=!0,this.g.open(l,String(n),!0),this.G=!1}catch(n){vd(this,n);return}if(n=u||"",u=new Map(this.headers),d){if(Object.getPrototypeOf(d)===Object.prototype)for(var h in d)u.set(h,d[h]);else if("function"==typeof d.keys&&"function"==typeof d.get)for(let n of d.keys())u.set(n,d.get(n));else throw Error("Unknown input type for opt_headers: "+String(d))}for(let[f,m]of(d=Array.from(u.keys()).find(n=>"content-type"==n.toLowerCase()),h=el.FormData&&n instanceof el.FormData,!(0<=eu(e5,l))||d||h||u.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),u))this.g.setRequestHeader(f,m);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{var f;wd(this),0<this.B&&((this.L=(f=this.g,ep&&"number"==typeof f.timeout&&void 0!==f.ontimeout))?(this.g.timeout=this.B,this.g.ontimeout=q(this.ua,this)):this.A=yb(this.ua,this.B,this)),this.v=!0,this.g.send(n),this.v=!1}catch(n){vd(this,n)}},j.ua=function(){void 0!==es&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,C(this,"timeout"),this.abort(8))},j.abort=function(n){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=n||7,C(this,"complete"),C(this,"abort"),zd(this))},j.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),zd(this,!0)),P.$.N.call(this)},j.La=function(){this.s||(this.G||this.v||this.l?Ad(this):this.kb())},j.kb=function(){Ad(this)},j.isActive=function(){return!!this.g},j.da=function(){try{return 2<H(this)?this.g.status:-1}catch(n){return -1}},j.ja=function(){try{return this.g?this.g.responseText:""}catch(n){return""}},j.Wa=function(n){if(this.g){var l=this.g.responseText;return n&&0==l.indexOf(n)&&(l=l.substring(n.length)),e1(l)}},j.Ia=function(){return this.m},j.Sa=function(){return"string"==typeof this.j?this.j:String(this.j)},(j=Ed.prototype).ra=8,j.H=1,j.Na=function(n){if(this.m){if(this.m=null,1==this.H){if(!n){this.W=Math.floor(1e5*Math.random()),n=this.W++;let h=new bc(this,this.l,n),f=this.s;if(this.U&&(f?Ra(f=Pa(f),this.U):f=this.U),null!==this.o||this.O||(h.I=f,f=null),this.P)e:{for(var l=0,u=0;u<this.j.length;u++){t:{var d=this.j[u];if("__data__"in d.map&&"string"==typeof(d=d.map.__data__)){d=d.length;break t}d=void 0}if(void 0===d)break;if(4096<(l+=d)){l=u;break e}if(4096===l||u===this.j.length-1){l=u+1;break e}}l=1e3}else l=1e3;l=Kd(this,h,l),K(u=G(this.I),"RID",n),K(u,"CVER",22),this.F&&K(u,"X-HTTP-Session-Id",this.F),Gd(this,u),f&&(this.O?l="headers="+encodeURIComponent(String(Bd(f)))+"&"+l:this.o&&Cd(u,this.o,f)),Cc(this.i,h),this.bb&&K(u,"TYPE","init"),this.P?(K(u,"$req",l),K(u,"SID","null"),h.aa=!0,gc(h,u,null)):gc(h,u,l),this.H=2}}else 3==this.H&&(n?Ld(this,n):0==this.j.length||ed(this.i)||Ld(this))}},j.Ma=function(){if(this.u=null,Md(this),this.ca&&!(this.M||null==this.g||0>=this.S)){var n=2*this.S;this.l.info("BP detection timer enabled: "+n),this.B=Rb(q(this.jb,this),n)}},j.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,F(10),zc(this),Md(this))},j.ib=function(){null!=this.v&&(this.v=null,zc(this),Ac(this),F(19))},j.pb=function(n){n?(this.l.info("Successfully pinged google.com"),F(2)):(this.l.info("Failed to ping google.com"),F(1))},j.isActive=function(){return!!this.h&&this.h.isActive(this)},(j=Nd.prototype).Ba=function(){},j.Aa=function(){},j.za=function(){},j.ya=function(){},j.isActive=function(){return!0},j.Va=function(){},Od.prototype.g=function(n,l){return new Q(n,l)},r(Q,B),Q.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var n=this.g,l=this.l,u=this.h||void 0;F(0),n.Y=l,n.na=u||{},n.G=n.aa,n.I=Dc(n,null,n.Y),Gc(n)},Q.prototype.close=function(){Hc(this.g)},Q.prototype.u=function(n){var l=this.g;if("string"==typeof n){var u={};u.__data__=n,n=u}else this.v&&((u={}).__data__=ek(n),n=u);l.j.push(new eQ(l.fb++,n)),3==l.H&&Gc(l)},Q.prototype.N=function(){this.g.h=null,delete this.j,Hc(this.g),delete this.g,Q.$.N.call(this)},r(Pd,Yb),r(Qd,Zb),r(R,Nd),R.prototype.Ba=function(){C(this.g,"a")},R.prototype.Aa=function(n){C(this.g,new Pd(n))},R.prototype.za=function(n){C(this.g,new Qd)},R.prototype.ya=function(){C(this.g,"b")},r(S,function(){this.blockSize=-1}),S.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0},S.prototype.j=function(n,l){void 0===l&&(l=n.length);for(var u=l-this.blockSize,d=this.m,h=this.h,f=0;f<l;){if(0==h)for(;f<=u;)Sd(this,n,f),f+=this.blockSize;if("string"==typeof n){for(;f<l;)if(d[h++]=n.charCodeAt(f++),h==this.blockSize){Sd(this,d),h=0;break}}else for(;f<l;)if(d[h++]=n[f++],h==this.blockSize){Sd(this,d),h=0;break}}this.h=h,this.i+=l},S.prototype.l=function(){var n=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);n[0]=128;for(var l=1;l<n.length-8;++l)n[l]=0;var u=8*this.i;for(l=n.length-8;l<n.length;++l)n[l]=255&u,u/=256;for(this.j(n),n=Array(16),l=u=0;4>l;++l)for(var d=0;32>d;d+=8)n[u++]=this.g[l]>>>d&255;return n};var e4={};function Td(n){return -128<=n&&128>n?Object.prototype.hasOwnProperty.call(e4,n)?e4[n]:e4[n]=new T([0|n],0>n?-1:0):new T([0|n],0>n?-1:0)}function U(n){if(isNaN(n)||!isFinite(n))return e6;if(0>n)return W(U(-n));for(var l=[],u=1,d=0;n>=u;d++)l[d]=n/u|0,u*=e9;return new T(l,0)}var e9=4294967296,e6=Td(0),e7=Td(1),e8=Td(16777216);function Y(n){if(0!=n.h)return!1;for(var l=0;l<n.g.length;l++)if(0!=n.g[l])return!1;return!0}function X(n){return -1==n.h}function W(n){for(var l=n.g.length,u=[],d=0;d<l;d++)u[d]=~n.g[d];return new T(u,~n.h).add(e7)}function Zd(n,l){return n.add(W(l))}function $d(n,l){for(;(65535&n[l])!=n[l];)n[l+1]+=n[l]>>>16,n[l]&=65535,l++}function ae(n,l){this.g=n,this.h=l}function Yd(n,l){if(Y(l))throw Error("division by zero");if(Y(n))return new ae(e6,e6);if(X(n))return l=Yd(W(n),l),new ae(W(l.g),W(l.h));if(X(l))return l=Yd(n,W(l)),new ae(W(l.g),l.h);if(30<n.g.length){if(X(n)||X(l))throw Error("slowDivide_ only works with positive integers.");for(var u=e7,d=l;0>=d.X(n);)u=be(u),d=be(d);var h=Z(u,1),f=Z(d,1);for(d=Z(d,2),u=Z(u,2);!Y(d);){var m=f.add(d);0>=m.X(n)&&(h=h.add(u),f=m),d=Z(d,1),u=Z(u,1)}return l=Zd(n,h.R(l)),new ae(h,l)}for(h=e6;0<=n.X(l);){for(d=48>=(d=Math.ceil(Math.log(u=Math.max(1,Math.floor(n.ea()/l.ea())))/Math.LN2))?1:Math.pow(2,d-48),m=(f=U(u)).R(l);X(m)||0<m.X(n);)u-=d,m=(f=U(u)).R(l);Y(f)&&(f=e7),h=h.add(f),n=Zd(n,m)}return new ae(h,n)}function be(n){for(var l=n.g.length+1,u=[],d=0;d<l;d++)u[d]=n.D(d)<<1|n.D(d-1)>>>31;return new T(u,n.h)}function Z(n,l){var u=l>>5;l%=32;for(var d=n.g.length-u,h=[],f=0;f<d;f++)h[f]=0<l?n.D(f+u)>>>l|n.D(f+u+1)<<32-l:n.D(f+u);return new T(h,n.h)}(j=T.prototype).ea=function(){if(X(this))return-W(this).ea();for(var n=0,l=1,u=0;u<this.g.length;u++){var d=this.D(u);n+=(0<=d?d:e9+d)*l,l*=e9}return n},j.toString=function(n){if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);if(Y(this))return"0";if(X(this))return"-"+W(this).toString(n);for(var l=U(Math.pow(n,6)),u=this,d="";;){var h=Yd(u,l).g,f=((0<(u=Zd(u,h.R(l))).g.length?u.g[0]:u.h)>>>0).toString(n);if(Y(u=h))return f+d;for(;6>f.length;)f="0"+f;d=f+d}},j.D=function(n){return 0>n?0:n<this.g.length?this.g[n]:this.h},j.X=function(n){return X(n=Zd(this,n))?-1:Y(n)?0:1},j.abs=function(){return X(this)?W(this):this},j.add=function(n){for(var l=Math.max(this.g.length,n.g.length),u=[],d=0,h=0;h<=l;h++){var f=d+(65535&this.D(h))+(65535&n.D(h)),m=(f>>>16)+(this.D(h)>>>16)+(n.D(h)>>>16);d=m>>>16,f&=65535,m&=65535,u[h]=m<<16|f}return new T(u,-2147483648&u[u.length-1]?-1:0)},j.R=function(n){if(Y(this)||Y(n))return e6;if(X(this))return X(n)?W(this).R(W(n)):W(W(this).R(n));if(X(n))return W(this.R(W(n)));if(0>this.X(e8)&&0>n.X(e8))return U(this.ea()*n.ea());for(var l=this.g.length+n.g.length,u=[],d=0;d<2*l;d++)u[d]=0;for(d=0;d<this.g.length;d++)for(var h=0;h<n.g.length;h++){var f=this.D(d)>>>16,m=65535&this.D(d),g=n.D(h)>>>16,_=65535&n.D(h);u[2*d+2*h]+=m*_,$d(u,2*d+2*h),u[2*d+2*h+1]+=f*_,$d(u,2*d+2*h+1),u[2*d+2*h+1]+=m*g,$d(u,2*d+2*h+1),u[2*d+2*h+2]+=f*g,$d(u,2*d+2*h+2)}for(d=0;d<l;d++)u[d]=u[2*d+1]<<16|u[2*d];for(d=l;d<2*l;d++)u[d]=0;return new T(u,0)},j.gb=function(n){return Yd(this,n).h},j.and=function(n){for(var l=Math.max(this.g.length,n.g.length),u=[],d=0;d<l;d++)u[d]=this.D(d)&n.D(d);return new T(u,this.h&n.h)},j.or=function(n){for(var l=Math.max(this.g.length,n.g.length),u=[],d=0;d<l;d++)u[d]=this.D(d)|n.D(d);return new T(u,this.h|n.h)},j.xor=function(n){for(var l=Math.max(this.g.length,n.g.length),u=[],d=0;d<l;d++)u[d]=this.D(d)^n.D(d);return new T(u,this.h^n.h)},Od.prototype.createWebChannel=Od.prototype.g,Q.prototype.send=Q.prototype.u,Q.prototype.open=Q.prototype.m,Q.prototype.close=Q.prototype.close,ej.NO_ERROR=0,ej.TIMEOUT=8,ej.HTTP_ERROR=6,eU.COMPLETE="complete",Wb.EventType=eB,eB.OPEN="a",eB.CLOSE="b",eB.ERROR="c",eB.MESSAGE="d",B.prototype.listen=B.prototype.O,P.prototype.listenOnce=P.prototype.P,P.prototype.getLastError=P.prototype.Sa,P.prototype.getLastErrorCode=P.prototype.Ia,P.prototype.getStatus=P.prototype.da,P.prototype.getResponseJson=P.prototype.Wa,P.prototype.getResponseText=P.prototype.ja,P.prototype.send=P.prototype.ha,P.prototype.setWithCredentials=P.prototype.Oa,S.prototype.digest=S.prototype.l,S.prototype.reset=S.prototype.reset,S.prototype.update=S.prototype.j,T.prototype.add=T.prototype.add,T.prototype.multiply=T.prototype.R,T.prototype.modulo=T.prototype.gb,T.prototype.compare=T.prototype.X,T.prototype.toNumber=T.prototype.ea,T.prototype.toString=T.prototype.toString,T.prototype.getBits=T.prototype.D,T.fromNumber=U,T.fromString=function Vd(n,l){if(0==n.length)throw Error("number format error: empty string");if(2>(l=l||10)||36<l)throw Error("radix out of range: "+l);if("-"==n.charAt(0))return W(Vd(n.substring(1),l));if(0<=n.indexOf("-"))throw Error('number format error: interior "-" character');for(var u=U(Math.pow(l,8)),d=e6,h=0;h<n.length;h+=8){var f=Math.min(8,n.length-h),m=parseInt(n.substring(h,h+f),l);8>f?(f=U(Math.pow(l,f)),d=d.R(f).add(U(m))):d=(d=d.R(u)).add(U(m))}return d};var te=eo.createWebChannelTransport=function(){return new Od},tt=eo.getStatEventTarget=function(){return Mb()},tn=eo.ErrorCode=ej,to=eo.EventType=eU,ts=eo.Event=eF,ta=eo.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};eo.FetchXmlHttpFactory=ld;var tl=eo.WebChannel=Wb,tu=eo.XhrIo=P,tc=eo.Md5=S,td=eo.Integer=T,th=u(34406);let tp="@firebase/firestore";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let User=class User{constructor(n){this.uid=n}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(n){return n.uid===this.uid}};User.UNAUTHENTICATED=new User(null),User.GOOGLE_CREDENTIALS=new User("google-credentials-uid"),User.FIRST_PARTY=new User("first-party-uid"),User.MOCK_USER=new User("mock-user");/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tf="10.7.2",tm=new ee.Yd("@firebase/firestore");function __PRIVATE_getLogLevel(){return tm.logLevel}function __PRIVATE_logDebug(n,...l){if(tm.logLevel<=ee.in.DEBUG){let u=l.map(__PRIVATE_argToString);tm.debug(`Firestore (${tf}): ${n}`,...u)}}function __PRIVATE_logError(n,...l){if(tm.logLevel<=ee.in.ERROR){let u=l.map(__PRIVATE_argToString);tm.error(`Firestore (${tf}): ${n}`,...u)}}function __PRIVATE_logWarn(n,...l){if(tm.logLevel<=ee.in.WARN){let u=l.map(__PRIVATE_argToString);tm.warn(`Firestore (${tf}): ${n}`,...u)}}function __PRIVATE_argToString(n){if("string"==typeof n)return n;try{/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */return JSON.stringify(n)}catch(l){return n}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function fail(n="Unexpected state"){let l=`FIRESTORE (${tf}) INTERNAL ASSERTION FAILED: `+n;throw __PRIVATE_logError(l),Error(l)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tg={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};let FirestoreError=class FirestoreError extends et.ZR{constructor(n,l){super(n,l),this.code=n,this.message=l,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_Deferred=class __PRIVATE_Deferred{constructor(){this.promise=new Promise((n,l)=>{this.resolve=n,this.reject=l})}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_OAuthToken=class __PRIVATE_OAuthToken{constructor(n,l){this.user=l,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${n}`)}};let __PRIVATE_EmptyAuthCredentialsProvider=class __PRIVATE_EmptyAuthCredentialsProvider{getToken(){return Promise.resolve(null)}invalidateToken(){}start(n,l){n.enqueueRetryable(()=>l(User.UNAUTHENTICATED))}shutdown(){}};let __PRIVATE_EmulatorAuthCredentialsProvider=class __PRIVATE_EmulatorAuthCredentialsProvider{constructor(n){this.token=n,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(n,l){this.changeListener=l,n.enqueueRetryable(()=>l(this.token.user))}shutdown(){this.changeListener=null}};let __PRIVATE_FirebaseAuthCredentialsProvider=class __PRIVATE_FirebaseAuthCredentialsProvider{constructor(n){this.t=n,this.currentUser=User.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(n,l){let u=this.i,__PRIVATE_guardedChangeListener=n=>this.i!==u?(u=this.i,l(n)):Promise.resolve(),d=new __PRIVATE_Deferred;this.o=()=>{this.i++,this.currentUser=this.u(),d.resolve(),d=new __PRIVATE_Deferred,n.enqueueRetryable(()=>__PRIVATE_guardedChangeListener(this.currentUser))};let __PRIVATE_awaitNextToken=()=>{let l=d;n.enqueueRetryable(async()=>{await l.promise,await __PRIVATE_guardedChangeListener(this.currentUser)})},__PRIVATE_registerAuth=n=>{__PRIVATE_logDebug("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=n,this.auth.addAuthTokenListener(this.o),__PRIVATE_awaitNextToken()};this.t.onInit(n=>__PRIVATE_registerAuth(n)),setTimeout(()=>{if(!this.auth){let n=this.t.getImmediate({optional:!0});n?__PRIVATE_registerAuth(n):(__PRIVATE_logDebug("FirebaseAuthCredentialsProvider","Auth not yet detected"),d.resolve(),d=new __PRIVATE_Deferred)}},0),__PRIVATE_awaitNextToken()}getToken(){let n=this.i,l=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(l).then(l=>this.i!==n?(__PRIVATE_logDebug("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):l?("string"==typeof l.accessToken||fail(),new __PRIVATE_OAuthToken(l.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let n=this.auth&&this.auth.getUid();return null===n||"string"==typeof n||fail(),new User(n)}};let __PRIVATE_FirstPartyToken=class __PRIVATE_FirstPartyToken{constructor(n,l,u){this.l=n,this.h=l,this.P=u,this.type="FirstParty",this.user=User.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);let n=this.T();return n&&this.I.set("Authorization",n),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}};let __PRIVATE_FirstPartyAuthCredentialsProvider=class __PRIVATE_FirstPartyAuthCredentialsProvider{constructor(n,l,u){this.l=n,this.h=l,this.P=u}getToken(){return Promise.resolve(new __PRIVATE_FirstPartyToken(this.l,this.h,this.P))}start(n,l){n.enqueueRetryable(()=>l(User.FIRST_PARTY))}shutdown(){}invalidateToken(){}};let AppCheckToken=class AppCheckToken{constructor(n){this.value=n,this.type="AppCheck",this.headers=new Map,n&&n.length>0&&this.headers.set("x-firebase-appcheck",this.value)}};let __PRIVATE_FirebaseAppCheckTokenProvider=class __PRIVATE_FirebaseAppCheckTokenProvider{constructor(n){this.A=n,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(n,l){let onTokenChanged=n=>{null!=n.error&&__PRIVATE_logDebug("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${n.error.message}`);let u=n.token!==this.R;return this.R=n.token,__PRIVATE_logDebug("FirebaseAppCheckTokenProvider",`Received ${u?"new":"existing"} token.`),u?l(n.token):Promise.resolve()};this.o=l=>{n.enqueueRetryable(()=>onTokenChanged(l))};let __PRIVATE_registerAppCheck=n=>{__PRIVATE_logDebug("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=n,this.appCheck.addTokenListener(this.o)};this.A.onInit(n=>__PRIVATE_registerAppCheck(n)),setTimeout(()=>{if(!this.appCheck){let n=this.A.getImmediate({optional:!0});n?__PRIVATE_registerAppCheck(n):__PRIVATE_logDebug("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let n=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(n).then(n=>n?("string"==typeof n.token||fail(),this.R=n.token,new AppCheckToken(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_AutoId=class __PRIVATE_AutoId{static newId(){let n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=Math.floor(256/n.length)*n.length,u="";for(;u.length<20;){let d=/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){let l="undefined"!=typeof self&&(self.crypto||self.msCrypto),u=new Uint8Array(n);if(l&&"function"==typeof l.getRandomValues)l.getRandomValues(u);else for(let l=0;l<n;l++)u[l]=Math.floor(256*Math.random());return u}(40);for(let h=0;h<d.length;++h)u.length<20&&d[h]<l&&(u+=n.charAt(d[h]%n.length))}return u}};function __PRIVATE_primitiveComparator(n,l){return n<l?-1:n>l?1:0}function __PRIVATE_arrayEquals(n,l,u){return n.length===l.length&&n.every((n,d)=>u(n,l[d]))}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Timestamp=class Timestamp{constructor(n,l){if(this.seconds=n,this.nanoseconds=l,l<0||l>=1e9)throw new FirestoreError(tg.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+l);if(n<-62135596800||n>=253402300800)throw new FirestoreError(tg.INVALID_ARGUMENT,"Timestamp seconds out of range: "+n)}static now(){return Timestamp.fromMillis(Date.now())}static fromDate(n){return Timestamp.fromMillis(n.getTime())}static fromMillis(n){let l=Math.floor(n/1e3),u=Math.floor(1e6*(n-1e3*l));return new Timestamp(l,u)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(n){return this.seconds===n.seconds?__PRIVATE_primitiveComparator(this.nanoseconds,n.nanoseconds):__PRIVATE_primitiveComparator(this.seconds,n.seconds)}isEqual(n){return n.seconds===this.seconds&&n.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){let n=this.seconds- -62135596800;return String(n).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let SnapshotVersion=class SnapshotVersion{constructor(n){this.timestamp=n}static fromTimestamp(n){return new SnapshotVersion(n)}static min(){return new SnapshotVersion(new Timestamp(0,0))}static max(){return new SnapshotVersion(new Timestamp(253402300799,999999999))}compareTo(n){return this.timestamp._compareTo(n.timestamp)}isEqual(n){return this.timestamp.isEqual(n.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let BasePath=class BasePath{constructor(n,l,u){void 0===l?l=0:l>n.length&&fail(),void 0===u?u=n.length-l:u>n.length-l&&fail(),this.segments=n,this.offset=l,this.len=u}get length(){return this.len}isEqual(n){return 0===BasePath.comparator(this,n)}child(n){let l=this.segments.slice(this.offset,this.limit());return n instanceof BasePath?n.forEach(n=>{l.push(n)}):l.push(n),this.construct(l)}limit(){return this.offset+this.length}popFirst(n){return n=void 0===n?1:n,this.construct(this.segments,this.offset+n,this.length-n)}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(n){return this.segments[this.offset+n]}isEmpty(){return 0===this.length}isPrefixOf(n){if(n.length<this.length)return!1;for(let l=0;l<this.length;l++)if(this.get(l)!==n.get(l))return!1;return!0}isImmediateParentOf(n){if(this.length+1!==n.length)return!1;for(let l=0;l<this.length;l++)if(this.get(l)!==n.get(l))return!1;return!0}forEach(n){for(let l=this.offset,u=this.limit();l<u;l++)n(this.segments[l])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(n,l){let u=Math.min(n.length,l.length);for(let d=0;d<u;d++){let u=n.get(d),h=l.get(d);if(u<h)return -1;if(u>h)return 1}return n.length<l.length?-1:n.length>l.length?1:0}};let ResourcePath=class ResourcePath extends BasePath{construct(n,l,u){return new ResourcePath(n,l,u)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...n){let l=[];for(let u of n){if(u.indexOf("//")>=0)throw new FirestoreError(tg.INVALID_ARGUMENT,`Invalid segment (${u}). Paths must not contain // in them.`);l.push(...u.split("/").filter(n=>n.length>0))}return new ResourcePath(l)}static emptyPath(){return new ResourcePath([])}};let t_=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let FieldPath$1=class FieldPath$1 extends BasePath{construct(n,l,u){return new FieldPath$1(n,l,u)}static isValidIdentifier(n){return t_.test(n)}canonicalString(){return this.toArray().map(n=>(n=n.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),FieldPath$1.isValidIdentifier(n)||(n="`"+n+"`"),n)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new FieldPath$1(["__name__"])}static fromServerFormat(n){let l=[],u="",d=0,__PRIVATE_addCurrentSegment=()=>{if(0===u.length)throw new FirestoreError(tg.INVALID_ARGUMENT,`Invalid field path (${n}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);l.push(u),u=""},h=!1;for(;d<n.length;){let l=n[d];if("\\"===l){if(d+1===n.length)throw new FirestoreError(tg.INVALID_ARGUMENT,"Path has trailing escape character: "+n);let l=n[d+1];if("\\"!==l&&"."!==l&&"`"!==l)throw new FirestoreError(tg.INVALID_ARGUMENT,"Path has invalid escape sequence: "+n);u+=l,d+=2}else"`"===l?h=!h:"."!==l||h?u+=l:__PRIVATE_addCurrentSegment(),d++}if(__PRIVATE_addCurrentSegment(),h)throw new FirestoreError(tg.INVALID_ARGUMENT,"Unterminated ` in path: "+n);return new FieldPath$1(l)}static emptyPath(){return new FieldPath$1([])}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let DocumentKey=class DocumentKey{constructor(n){this.path=n}static fromPath(n){return new DocumentKey(ResourcePath.fromString(n))}static fromName(n){return new DocumentKey(ResourcePath.fromString(n).popFirst(5))}static empty(){return new DocumentKey(ResourcePath.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(n){return this.path.length>=2&&this.path.get(this.path.length-2)===n}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(n){return null!==n&&0===ResourcePath.comparator(this.path,n.path)}toString(){return this.path.toString()}static comparator(n,l){return ResourcePath.comparator(n.path,l.path)}static isDocumentKey(n){return n.length%2==0}static fromSegments(n){return new DocumentKey(new ResourcePath(n.slice()))}};let IndexOffset=class IndexOffset{constructor(n,l,u){this.readTime=n,this.documentKey=l,this.largestBatchId=u}static min(){return new IndexOffset(SnapshotVersion.min(),DocumentKey.empty(),-1)}static max(){return new IndexOffset(SnapshotVersion.max(),DocumentKey.empty(),-1)}};let PersistenceTransaction=class PersistenceTransaction{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(n){this.onCommittedListeners.push(n)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(n=>n())}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */async function __PRIVATE_ignoreIfPrimaryLeaseLoss(n){if(n.code!==tg.FAILED_PRECONDITION||"The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab."!==n.message)throw n;__PRIVATE_logDebug("LocalStore","Unexpectedly lost primary lease")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let PersistencePromise=class PersistencePromise{constructor(n){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,n(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(n){return this.next(void 0,n)}next(n,l){return this.callbackAttached&&fail(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(l,this.error):this.wrapSuccess(n,this.result):new PersistencePromise((u,d)=>{this.nextCallback=l=>{this.wrapSuccess(n,l).next(u,d)},this.catchCallback=n=>{this.wrapFailure(l,n).next(u,d)}})}toPromise(){return new Promise((n,l)=>{this.next(n,l)})}wrapUserFunction(n){try{let l=n();return l instanceof PersistencePromise?l:PersistencePromise.resolve(l)}catch(n){return PersistencePromise.reject(n)}}wrapSuccess(n,l){return n?this.wrapUserFunction(()=>n(l)):PersistencePromise.resolve(l)}wrapFailure(n,l){return n?this.wrapUserFunction(()=>n(l)):PersistencePromise.reject(l)}static resolve(n){return new PersistencePromise((l,u)=>{l(n)})}static reject(n){return new PersistencePromise((l,u)=>{u(n)})}static waitFor(n){return new PersistencePromise((l,u)=>{let d=0,h=0,f=!1;n.forEach(n=>{++d,n.next(()=>{++h,f&&h===d&&l()},n=>u(n))}),f=!0,h===d&&l()})}static or(n){let l=PersistencePromise.resolve(!1);for(let u of n)l=l.next(n=>n?PersistencePromise.resolve(n):u());return l}static forEach(n,l){let u=[];return n.forEach((n,d)=>{u.push(l.call(this,n,d))}),this.waitFor(u)}static mapArray(n,l){return new PersistencePromise((u,d)=>{let h=n.length,f=Array(h),m=0;for(let g=0;g<h;g++){let _=g;l(n[_]).next(n=>{f[_]=n,++m===h&&u(f)},n=>d(n))}})}static doWhile(n,l){return new PersistencePromise((u,d)=>{let process=()=>{!0===n()?l().next(()=>{process()},d):u()};process()})}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_SimpleDbTransaction=class __PRIVATE_SimpleDbTransaction{constructor(n,l){this.action=n,this.transaction=l,this.aborted=!1,this.V=new __PRIVATE_Deferred,this.transaction.oncomplete=()=>{this.V.resolve()},this.transaction.onabort=()=>{l.error?this.V.reject(new __PRIVATE_IndexedDbTransactionError(n,l.error)):this.V.resolve()},this.transaction.onerror=l=>{let u=__PRIVATE_checkForAndReportiOSError(l.target.error);this.V.reject(new __PRIVATE_IndexedDbTransactionError(n,u))}}static open(n,l,u,d){try{return new __PRIVATE_SimpleDbTransaction(l,n.transaction(d,u))}catch(n){throw new __PRIVATE_IndexedDbTransactionError(l,n)}}get m(){return this.V.promise}abort(n){n&&this.V.reject(n),this.aborted||(__PRIVATE_logDebug("SimpleDb","Aborting transaction:",n?n.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}g(){let n=this.transaction;this.aborted||"function"!=typeof n.commit||n.commit()}store(n){let l=this.transaction.objectStore(n);return new __PRIVATE_SimpleDbStore(l)}};let __PRIVATE_SimpleDb=class __PRIVATE_SimpleDb{constructor(n,l,u){this.name=n,this.version=l,this.p=u,12.2===__PRIVATE_SimpleDb.S((0,et.z$)())&&__PRIVATE_logError("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(n){return __PRIVATE_logDebug("SimpleDb","Removing database:",n),__PRIVATE_wrapRequest(window.indexedDB.deleteDatabase(n)).toPromise()}static D(){if(!(0,et.hl)())return!1;if(__PRIVATE_SimpleDb.C())return!0;let n=(0,et.z$)(),l=__PRIVATE_SimpleDb.S(n),u=__PRIVATE_SimpleDb.v(n);return!(n.indexOf("MSIE ")>0||n.indexOf("Trident/")>0||n.indexOf("Edge/")>0||0<l&&l<10||0<u&&u<4.5)}static C(){var n;return void 0!==th&&"YES"===(null===(n=th.__PRIVATE_env)||void 0===n?void 0:n.F)}static M(n,l){return n.store(l)}static S(n){let l=n.match(/i(?:phone|pad|pod) os ([\d_]+)/i),u=l?l[1].split("_").slice(0,2).join("."):"-1";return Number(u)}static v(n){let l=n.match(/Android ([\d.]+)/i),u=l?l[1].split(".").slice(0,2).join("."):"-1";return Number(u)}async O(n){return this.db||(__PRIVATE_logDebug("SimpleDb","Opening database:",this.name),this.db=await new Promise((l,u)=>{let d=indexedDB.open(this.name,this.version);d.onsuccess=n=>{let u=n.target.result;l(u)},d.onblocked=()=>{u(new __PRIVATE_IndexedDbTransactionError(n,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},d.onerror=l=>{let d=l.target.error;"VersionError"===d.name?u(new FirestoreError(tg.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"===d.name?u(new FirestoreError(tg.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: "+d)):u(new __PRIVATE_IndexedDbTransactionError(n,d))},d.onupgradeneeded=n=>{__PRIVATE_logDebug("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',n.oldVersion);let l=n.target.result;this.p.N(l,d.transaction,n.oldVersion,this.version).next(()=>{__PRIVATE_logDebug("SimpleDb","Database upgrade to version "+this.version+" complete")})}})),this.B&&(this.db.onversionchange=n=>this.B(n)),this.db}L(n){this.B=n,this.db&&(this.db.onversionchange=l=>n(l))}async runTransaction(n,l,u,d){let h="readonly"===l,f=0;for(;;){++f;try{this.db=await this.O(n);let l=__PRIVATE_SimpleDbTransaction.open(this.db,n,h?"readonly":"readwrite",u),f=d(l).next(n=>(l.g(),n)).catch(n=>(l.abort(n),PersistencePromise.reject(n))).toPromise();return f.catch(()=>{}),await l.m,f}catch(l){let n="FirebaseError"!==l.name&&f<3;if(__PRIVATE_logDebug("SimpleDb","Transaction failed with error:",l.message,"Retrying:",n),this.close(),!n)return Promise.reject(l)}}}close(){this.db&&this.db.close(),this.db=void 0}};let __PRIVATE_IterationController=class __PRIVATE_IterationController{constructor(n){this.k=n,this.q=!1,this.K=null}get isDone(){return this.q}get $(){return this.K}set cursor(n){this.k=n}done(){this.q=!0}U(n){this.K=n}delete(){return __PRIVATE_wrapRequest(this.k.delete())}};let __PRIVATE_IndexedDbTransactionError=class __PRIVATE_IndexedDbTransactionError extends FirestoreError{constructor(n,l){super(tg.UNAVAILABLE,`IndexedDB transaction '${n}' failed: ${l}`),this.name="IndexedDbTransactionError"}};function __PRIVATE_isIndexedDbTransactionError(n){return"IndexedDbTransactionError"===n.name}let __PRIVATE_SimpleDbStore=class __PRIVATE_SimpleDbStore{constructor(n){this.store=n}put(n,l){let u;return void 0!==l?(__PRIVATE_logDebug("SimpleDb","PUT",this.store.name,n,l),u=this.store.put(l,n)):(__PRIVATE_logDebug("SimpleDb","PUT",this.store.name,"<auto-key>",n),u=this.store.put(n)),__PRIVATE_wrapRequest(u)}add(n){return __PRIVATE_logDebug("SimpleDb","ADD",this.store.name,n,n),__PRIVATE_wrapRequest(this.store.add(n))}get(n){return __PRIVATE_wrapRequest(this.store.get(n)).next(l=>(void 0===l&&(l=null),__PRIVATE_logDebug("SimpleDb","GET",this.store.name,n,l),l))}delete(n){return __PRIVATE_logDebug("SimpleDb","DELETE",this.store.name,n),__PRIVATE_wrapRequest(this.store.delete(n))}count(){return __PRIVATE_logDebug("SimpleDb","COUNT",this.store.name),__PRIVATE_wrapRequest(this.store.count())}W(n,l){let u=this.options(n,l),d=u.index?this.store.index(u.index):this.store;if("function"==typeof d.getAll){let n=d.getAll(u.range);return new PersistencePromise((l,u)=>{n.onerror=n=>{u(n.target.error)},n.onsuccess=n=>{l(n.target.result)}})}{let n=this.cursor(u),l=[];return this.G(n,(n,u)=>{l.push(u)}).next(()=>l)}}j(n,l){let u=this.store.getAll(n,null===l?void 0:l);return new PersistencePromise((n,l)=>{u.onerror=n=>{l(n.target.error)},u.onsuccess=l=>{n(l.target.result)}})}H(n,l){__PRIVATE_logDebug("SimpleDb","DELETE ALL",this.store.name);let u=this.options(n,l);u.J=!1;let d=this.cursor(u);return this.G(d,(n,l,u)=>u.delete())}Y(n,l){let u;l?u=n:(u={},l=n);let d=this.cursor(u);return this.G(d,l)}Z(n){let l=this.cursor({});return new PersistencePromise((u,d)=>{l.onerror=n=>{let l=__PRIVATE_checkForAndReportiOSError(n.target.error);d(l)},l.onsuccess=l=>{let d=l.target.result;d?n(d.primaryKey,d.value).next(n=>{n?d.continue():u()}):u()}})}G(n,l){let u=[];return new PersistencePromise((d,h)=>{n.onerror=n=>{h(n.target.error)},n.onsuccess=n=>{let h=n.target.result;if(!h)return void d();let f=new __PRIVATE_IterationController(h),m=l(h.primaryKey,h.value,f);if(m instanceof PersistencePromise){let n=m.catch(n=>(f.done(),PersistencePromise.reject(n)));u.push(n)}f.isDone?d():null===f.$?h.continue():h.continue(f.$)}}).next(()=>PersistencePromise.waitFor(u))}options(n,l){let u;return void 0!==n&&("string"==typeof n?u=n:l=n),{index:u,range:l}}cursor(n){let l="next";if(n.reverse&&(l="prev"),n.index){let u=this.store.index(n.index);return n.J?u.openKeyCursor(n.range,l):u.openCursor(n.range,l)}return this.store.openCursor(n.range,l)}};function __PRIVATE_wrapRequest(n){return new PersistencePromise((l,u)=>{n.onsuccess=n=>{let u=n.target.result;l(u)},n.onerror=n=>{let l=__PRIVATE_checkForAndReportiOSError(n.target.error);u(l)}})}let ty=!1;function __PRIVATE_checkForAndReportiOSError(n){let l=__PRIVATE_SimpleDb.S((0,et.z$)());if(l>=12.2&&l<13){let l="An internal error was encountered in the Indexed Database server";if(n.message.indexOf(l)>=0){let n=new FirestoreError("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${l}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return ty||(ty=!0,setTimeout(()=>{throw n},0)),n}}return n}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_ListenSequence=class __PRIVATE_ListenSequence{constructor(n,l){this.previousValue=n,l&&(l.sequenceNumberHandler=n=>this.se(n),this.oe=n=>l.writeSequenceNumber(n))}se(n){return this.previousValue=Math.max(n,this.previousValue),this.previousValue}next(){let n=++this.previousValue;return this.oe&&this.oe(n),n}};function __PRIVATE_isNullOrUndefined(n){return null==n}function __PRIVATE_isNegativeZero(n){return 0===n&&1/n==-1/0}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function __PRIVATE_objectSize(n){let l=0;for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&l++;return l}function forEach(n,l){for(let u in n)Object.prototype.hasOwnProperty.call(n,u)&&l(u,n[u])}function isEmpty(n){for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l))return!1;return!0}__PRIVATE_ListenSequence._e=-1;/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let SortedMap=class SortedMap{constructor(n,l){this.comparator=n,this.root=l||LLRBNode.EMPTY}insert(n,l){return new SortedMap(this.comparator,this.root.insert(n,l,this.comparator).copy(null,null,LLRBNode.BLACK,null,null))}remove(n){return new SortedMap(this.comparator,this.root.remove(n,this.comparator).copy(null,null,LLRBNode.BLACK,null,null))}get(n){let l=this.root;for(;!l.isEmpty();){let u=this.comparator(n,l.key);if(0===u)return l.value;u<0?l=l.left:u>0&&(l=l.right)}return null}indexOf(n){let l=0,u=this.root;for(;!u.isEmpty();){let d=this.comparator(n,u.key);if(0===d)return l+u.left.size;d<0?u=u.left:(l+=u.left.size+1,u=u.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(n){return this.root.inorderTraversal(n)}forEach(n){this.inorderTraversal((l,u)=>(n(l,u),!1))}toString(){let n=[];return this.inorderTraversal((l,u)=>(n.push(`${l}:${u}`),!1)),`{${n.join(", ")}}`}reverseTraversal(n){return this.root.reverseTraversal(n)}getIterator(){return new SortedMapIterator(this.root,null,this.comparator,!1)}getIteratorFrom(n){return new SortedMapIterator(this.root,n,this.comparator,!1)}getReverseIterator(){return new SortedMapIterator(this.root,null,this.comparator,!0)}getReverseIteratorFrom(n){return new SortedMapIterator(this.root,n,this.comparator,!0)}};let SortedMapIterator=class SortedMapIterator{constructor(n,l,u,d){this.isReverse=d,this.nodeStack=[];let h=1;for(;!n.isEmpty();)if(h=l?u(n.key,l):1,l&&d&&(h*=-1),h<0)n=this.isReverse?n.left:n.right;else{if(0===h){this.nodeStack.push(n);break}this.nodeStack.push(n),n=this.isReverse?n.right:n.left}}getNext(){let n=this.nodeStack.pop(),l={key:n.key,value:n.value};if(this.isReverse)for(n=n.left;!n.isEmpty();)this.nodeStack.push(n),n=n.right;else for(n=n.right;!n.isEmpty();)this.nodeStack.push(n),n=n.left;return l}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;let n=this.nodeStack[this.nodeStack.length-1];return{key:n.key,value:n.value}}};let LLRBNode=class LLRBNode{constructor(n,l,u,d,h){this.key=n,this.value=l,this.color=null!=u?u:LLRBNode.RED,this.left=null!=d?d:LLRBNode.EMPTY,this.right=null!=h?h:LLRBNode.EMPTY,this.size=this.left.size+1+this.right.size}copy(n,l,u,d,h){return new LLRBNode(null!=n?n:this.key,null!=l?l:this.value,null!=u?u:this.color,null!=d?d:this.left,null!=h?h:this.right)}isEmpty(){return!1}inorderTraversal(n){return this.left.inorderTraversal(n)||n(this.key,this.value)||this.right.inorderTraversal(n)}reverseTraversal(n){return this.right.reverseTraversal(n)||n(this.key,this.value)||this.left.reverseTraversal(n)}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(n,l,u){let d=this,h=u(n,d.key);return(d=h<0?d.copy(null,null,null,d.left.insert(n,l,u),null):0===h?d.copy(null,l,null,null,null):d.copy(null,null,null,null,d.right.insert(n,l,u))).fixUp()}removeMin(){if(this.left.isEmpty())return LLRBNode.EMPTY;let n=this;return n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),(n=n.copy(null,null,null,n.left.removeMin(),null)).fixUp()}remove(n,l){let u,d=this;if(0>l(n,d.key))d.left.isEmpty()||d.left.isRed()||d.left.left.isRed()||(d=d.moveRedLeft()),d=d.copy(null,null,null,d.left.remove(n,l),null);else{if(d.left.isRed()&&(d=d.rotateRight()),d.right.isEmpty()||d.right.isRed()||d.right.left.isRed()||(d=d.moveRedRight()),0===l(n,d.key)){if(d.right.isEmpty())return LLRBNode.EMPTY;u=d.right.min(),d=d.copy(u.key,u.value,null,null,d.right.removeMin())}d=d.copy(null,null,null,null,d.right.remove(n,l))}return d.fixUp()}isRed(){return this.color}fixUp(){let n=this;return n.right.isRed()&&!n.left.isRed()&&(n=n.rotateLeft()),n.left.isRed()&&n.left.left.isRed()&&(n=n.rotateRight()),n.left.isRed()&&n.right.isRed()&&(n=n.colorFlip()),n}moveRedLeft(){let n=this.colorFlip();return n.right.left.isRed()&&(n=(n=(n=n.copy(null,null,null,null,n.right.rotateRight())).rotateLeft()).colorFlip()),n}moveRedRight(){let n=this.colorFlip();return n.left.left.isRed()&&(n=(n=n.rotateRight()).colorFlip()),n}rotateLeft(){let n=this.copy(null,null,LLRBNode.RED,null,this.right.left);return this.right.copy(null,null,this.color,n,null)}rotateRight(){let n=this.copy(null,null,LLRBNode.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,n)}colorFlip(){let n=this.left.copy(null,null,!this.left.color,null,null),l=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,n,l)}checkMaxDepth(){let n=this.check();return Math.pow(2,n)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw fail();let n=this.left.check();if(n!==this.right.check())throw fail();return n+(this.isRed()?0:1)}};LLRBNode.EMPTY=null,LLRBNode.RED=!0,LLRBNode.BLACK=!1,LLRBNode.EMPTY=new class{constructor(){this.size=0}get key(){throw fail()}get value(){throw fail()}get color(){throw fail()}get left(){throw fail()}get right(){throw fail()}copy(n,l,u,d,h){return this}insert(n,l,u){return new LLRBNode(n,l)}remove(n,l){return this}isEmpty(){return!0}inorderTraversal(n){return!1}reverseTraversal(n){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let SortedSet=class SortedSet{constructor(n){this.comparator=n,this.data=new SortedMap(this.comparator)}has(n){return null!==this.data.get(n)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(n){return this.data.indexOf(n)}forEach(n){this.data.inorderTraversal((l,u)=>(n(l),!1))}forEachInRange(n,l){let u=this.data.getIteratorFrom(n[0]);for(;u.hasNext();){let d=u.getNext();if(this.comparator(d.key,n[1])>=0)return;l(d.key)}}forEachWhile(n,l){let u;for(u=void 0!==l?this.data.getIteratorFrom(l):this.data.getIterator();u.hasNext();)if(!n(u.getNext().key))return}firstAfterOrEqual(n){let l=this.data.getIteratorFrom(n);return l.hasNext()?l.getNext().key:null}getIterator(){return new SortedSetIterator(this.data.getIterator())}getIteratorFrom(n){return new SortedSetIterator(this.data.getIteratorFrom(n))}add(n){return this.copy(this.data.remove(n).insert(n,!0))}delete(n){return this.has(n)?this.copy(this.data.remove(n)):this}isEmpty(){return this.data.isEmpty()}unionWith(n){let l=this;return l.size<n.size&&(l=n,n=this),n.forEach(n=>{l=l.add(n)}),l}isEqual(n){if(!(n instanceof SortedSet)||this.size!==n.size)return!1;let l=this.data.getIterator(),u=n.data.getIterator();for(;l.hasNext();){let n=l.getNext().key,d=u.getNext().key;if(0!==this.comparator(n,d))return!1}return!0}toArray(){let n=[];return this.forEach(l=>{n.push(l)}),n}toString(){let n=[];return this.forEach(l=>n.push(l)),"SortedSet("+n.toString()+")"}copy(n){let l=new SortedSet(this.comparator);return l.data=n,l}};let SortedSetIterator=class SortedSetIterator{constructor(n){this.iter=n}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FieldMask=class FieldMask{constructor(n){this.fields=n,n.sort(FieldPath$1.comparator)}static empty(){return new FieldMask([])}unionWith(n){let l=new SortedSet(FieldPath$1.comparator);for(let n of this.fields)l=l.add(n);for(let u of n)l=l.add(u);return new FieldMask(l.toArray())}covers(n){for(let l of this.fields)if(l.isPrefixOf(n))return!0;return!1}isEqual(n){return __PRIVATE_arrayEquals(this.fields,n.fields,(n,l)=>n.isEqual(l))}};/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_Base64DecodeError=class __PRIVATE_Base64DecodeError extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ByteString=class ByteString{constructor(n){this.binaryString=n}static fromBase64String(n){let l=function(n){try{return atob(n)}catch(n){throw"undefined"!=typeof DOMException&&n instanceof DOMException?new __PRIVATE_Base64DecodeError("Invalid base64 string: "+n):n}}(n);return new ByteString(l)}static fromUint8Array(n){let l=function(n){let l="";for(let u=0;u<n.length;++u)l+=String.fromCharCode(n[u]);return l}(n);return new ByteString(l)}[Symbol.iterator](){let n=0;return{next:()=>n<this.binaryString.length?{value:this.binaryString.charCodeAt(n++),done:!1}:{value:void 0,done:!0}}}toBase64(){return btoa(this.binaryString)}toUint8Array(){return function(n){let l=new Uint8Array(n.length);for(let u=0;u<n.length;u++)l[u]=n.charCodeAt(u);return l}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(n){return __PRIVATE_primitiveComparator(this.binaryString,n.binaryString)}isEqual(n){return this.binaryString===n.binaryString}};ByteString.EMPTY_BYTE_STRING=new ByteString("");let tv=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function __PRIVATE_normalizeTimestamp(n){if(n||fail(),"string"==typeof n){let l=0,u=tv.exec(n);if(u||fail(),u[1]){let n=u[1];l=Number(n=(n+"000000000").substr(0,9))}let d=new Date(n);return{seconds:Math.floor(d.getTime()/1e3),nanos:l}}return{seconds:__PRIVATE_normalizeNumber(n.seconds),nanos:__PRIVATE_normalizeNumber(n.nanos)}}function __PRIVATE_normalizeNumber(n){return"number"==typeof n?n:"string"==typeof n?Number(n):0}function __PRIVATE_normalizeByteString(n){return"string"==typeof n?ByteString.fromBase64String(n):ByteString.fromUint8Array(n)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function __PRIVATE_isServerTimestamp(n){var l,u;return"server_timestamp"===(null===(u=((null===(l=null==n?void 0:n.mapValue)||void 0===l?void 0:l.fields)||{}).__type__)||void 0===u?void 0:u.stringValue)}function __PRIVATE_getPreviousValue(n){let l=n.mapValue.fields.__previous_value__;return __PRIVATE_isServerTimestamp(l)?__PRIVATE_getPreviousValue(l):l}function __PRIVATE_getLocalWriteTime(n){let l=__PRIVATE_normalizeTimestamp(n.mapValue.fields.__local_write_time__.timestampValue);return new Timestamp(l.seconds,l.nanos)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let DatabaseInfo=class DatabaseInfo{constructor(n,l,u,d,h,f,m,g,_){this.databaseId=n,this.appId=l,this.persistenceKey=u,this.host=d,this.ssl=h,this.forceLongPolling=f,this.autoDetectLongPolling=m,this.longPollingOptions=g,this.useFetchStreams=_}};let DatabaseId=class DatabaseId{constructor(n,l){this.projectId=n,this.database=l||"(default)"}static empty(){return new DatabaseId("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(n){return n instanceof DatabaseId&&n.projectId===this.projectId&&n.database===this.database}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tb={mapValue:{fields:{__type__:{stringValue:"__max__"}}}};function __PRIVATE_typeOrder(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?__PRIVATE_isServerTimestamp(n)?4:__PRIVATE_isMaxValue(n)?9007199254740991:10:fail()}function __PRIVATE_valueEquals(n,l){if(n===l)return!0;let u=__PRIVATE_typeOrder(n);if(u!==__PRIVATE_typeOrder(l))return!1;switch(u){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===l.booleanValue;case 4:return __PRIVATE_getLocalWriteTime(n).isEqual(__PRIVATE_getLocalWriteTime(l));case 3:return function(n,l){if("string"==typeof n.timestampValue&&"string"==typeof l.timestampValue&&n.timestampValue.length===l.timestampValue.length)return n.timestampValue===l.timestampValue;let u=__PRIVATE_normalizeTimestamp(n.timestampValue),d=__PRIVATE_normalizeTimestamp(l.timestampValue);return u.seconds===d.seconds&&u.nanos===d.nanos}(n,l);case 5:return n.stringValue===l.stringValue;case 6:return __PRIVATE_normalizeByteString(n.bytesValue).isEqual(__PRIVATE_normalizeByteString(l.bytesValue));case 7:return n.referenceValue===l.referenceValue;case 8:return __PRIVATE_normalizeNumber(n.geoPointValue.latitude)===__PRIVATE_normalizeNumber(l.geoPointValue.latitude)&&__PRIVATE_normalizeNumber(n.geoPointValue.longitude)===__PRIVATE_normalizeNumber(l.geoPointValue.longitude);case 2:return function(n,l){if("integerValue"in n&&"integerValue"in l)return __PRIVATE_normalizeNumber(n.integerValue)===__PRIVATE_normalizeNumber(l.integerValue);if("doubleValue"in n&&"doubleValue"in l){let u=__PRIVATE_normalizeNumber(n.doubleValue),d=__PRIVATE_normalizeNumber(l.doubleValue);return u===d?__PRIVATE_isNegativeZero(u)===__PRIVATE_isNegativeZero(d):isNaN(u)&&isNaN(d)}return!1}(n,l);case 9:return __PRIVATE_arrayEquals(n.arrayValue.values||[],l.arrayValue.values||[],__PRIVATE_valueEquals);case 10:return function(n,l){let u=n.mapValue.fields||{},d=l.mapValue.fields||{};if(__PRIVATE_objectSize(u)!==__PRIVATE_objectSize(d))return!1;for(let n in u)if(u.hasOwnProperty(n)&&(void 0===d[n]||!__PRIVATE_valueEquals(u[n],d[n])))return!1;return!0}(n,l);default:return fail()}}function __PRIVATE_arrayValueContains(n,l){return void 0!==(n.values||[]).find(n=>__PRIVATE_valueEquals(n,l))}function __PRIVATE_valueCompare(n,l){if(n===l)return 0;let u=__PRIVATE_typeOrder(n),d=__PRIVATE_typeOrder(l);if(u!==d)return __PRIVATE_primitiveComparator(u,d);switch(u){case 0:case 9007199254740991:return 0;case 1:return __PRIVATE_primitiveComparator(n.booleanValue,l.booleanValue);case 2:return function(n,l){let u=__PRIVATE_normalizeNumber(n.integerValue||n.doubleValue),d=__PRIVATE_normalizeNumber(l.integerValue||l.doubleValue);return u<d?-1:u>d?1:u===d?0:isNaN(u)?isNaN(d)?0:-1:1}(n,l);case 3:return __PRIVATE_compareTimestamps(n.timestampValue,l.timestampValue);case 4:return __PRIVATE_compareTimestamps(__PRIVATE_getLocalWriteTime(n),__PRIVATE_getLocalWriteTime(l));case 5:return __PRIVATE_primitiveComparator(n.stringValue,l.stringValue);case 6:return function(n,l){let u=__PRIVATE_normalizeByteString(n),d=__PRIVATE_normalizeByteString(l);return u.compareTo(d)}(n.bytesValue,l.bytesValue);case 7:return function(n,l){let u=n.split("/"),d=l.split("/");for(let n=0;n<u.length&&n<d.length;n++){let l=__PRIVATE_primitiveComparator(u[n],d[n]);if(0!==l)return l}return __PRIVATE_primitiveComparator(u.length,d.length)}(n.referenceValue,l.referenceValue);case 8:return function(n,l){let u=__PRIVATE_primitiveComparator(__PRIVATE_normalizeNumber(n.latitude),__PRIVATE_normalizeNumber(l.latitude));return 0!==u?u:__PRIVATE_primitiveComparator(__PRIVATE_normalizeNumber(n.longitude),__PRIVATE_normalizeNumber(l.longitude))}(n.geoPointValue,l.geoPointValue);case 9:return function(n,l){let u=n.values||[],d=l.values||[];for(let n=0;n<u.length&&n<d.length;++n){let l=__PRIVATE_valueCompare(u[n],d[n]);if(l)return l}return __PRIVATE_primitiveComparator(u.length,d.length)}(n.arrayValue,l.arrayValue);case 10:return function(n,l){if(n===tb.mapValue&&l===tb.mapValue)return 0;if(n===tb.mapValue)return 1;if(l===tb.mapValue)return -1;let u=n.fields||{},d=Object.keys(u),h=l.fields||{},f=Object.keys(h);d.sort(),f.sort();for(let n=0;n<d.length&&n<f.length;++n){let l=__PRIVATE_primitiveComparator(d[n],f[n]);if(0!==l)return l;let m=__PRIVATE_valueCompare(u[d[n]],h[f[n]]);if(0!==m)return m}return __PRIVATE_primitiveComparator(d.length,f.length)}(n.mapValue,l.mapValue);default:throw fail()}}function __PRIVATE_compareTimestamps(n,l){if("string"==typeof n&&"string"==typeof l&&n.length===l.length)return __PRIVATE_primitiveComparator(n,l);let u=__PRIVATE_normalizeTimestamp(n),d=__PRIVATE_normalizeTimestamp(l),h=__PRIVATE_primitiveComparator(u.seconds,d.seconds);return 0!==h?h:__PRIVATE_primitiveComparator(u.nanos,d.nanos)}function __PRIVATE_canonifyValue(n){var l,u;return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?function(n){let l=__PRIVATE_normalizeTimestamp(n);return`time(${l.seconds},${l.nanos})`}(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?__PRIVATE_normalizeByteString(n.bytesValue).toBase64():"referenceValue"in n?(l=n.referenceValue,DocumentKey.fromName(l).toString()):"geoPointValue"in n?(u=n.geoPointValue,`geo(${u.latitude},${u.longitude})`):"arrayValue"in n?function(n){let l="[",u=!0;for(let d of n.values||[])u?u=!1:l+=",",l+=__PRIVATE_canonifyValue(d);return l+"]"}(n.arrayValue):"mapValue"in n?function(n){let l=Object.keys(n.fields||{}).sort(),u="{",d=!0;for(let h of l)d?d=!1:u+=",",u+=`${h}:${__PRIVATE_canonifyValue(n.fields[h])}`;return u+"}"}(n.mapValue):fail()}function isInteger(n){return!!n&&"integerValue"in n}function isArray(n){return!!n&&"arrayValue"in n}function __PRIVATE_isNullValue(n){return!!n&&"nullValue"in n}function __PRIVATE_isNanValue(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function __PRIVATE_isMapValue(n){return!!n&&"mapValue"in n}function __PRIVATE_deepClone(n){if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue&&"object"==typeof n.timestampValue)return{timestampValue:Object.assign({},n.timestampValue)};if(n.mapValue){let l={mapValue:{fields:{}}};return forEach(n.mapValue.fields,(n,u)=>l.mapValue.fields[n]=__PRIVATE_deepClone(u)),l}if(n.arrayValue){let l={arrayValue:{values:[]}};for(let u=0;u<(n.arrayValue.values||[]).length;++u)l.arrayValue.values[u]=__PRIVATE_deepClone(n.arrayValue.values[u]);return l}return Object.assign({},n)}function __PRIVATE_isMaxValue(n){return"__max__"===(((n.mapValue||{}).fields||{}).__type__||{}).stringValue}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ObjectValue=class ObjectValue{constructor(n){this.value=n}static empty(){return new ObjectValue({mapValue:{}})}field(n){if(n.isEmpty())return this.value;{let l=this.value;for(let u=0;u<n.length-1;++u)if(!__PRIVATE_isMapValue(l=(l.mapValue.fields||{})[n.get(u)]))return null;return(l=(l.mapValue.fields||{})[n.lastSegment()])||null}}set(n,l){this.getFieldsMap(n.popLast())[n.lastSegment()]=__PRIVATE_deepClone(l)}setAll(n){let l=FieldPath$1.emptyPath(),u={},d=[];n.forEach((n,h)=>{if(!l.isImmediateParentOf(h)){let n=this.getFieldsMap(l);this.applyChanges(n,u,d),u={},d=[],l=h.popLast()}n?u[h.lastSegment()]=__PRIVATE_deepClone(n):d.push(h.lastSegment())});let h=this.getFieldsMap(l);this.applyChanges(h,u,d)}delete(n){let l=this.field(n.popLast());__PRIVATE_isMapValue(l)&&l.mapValue.fields&&delete l.mapValue.fields[n.lastSegment()]}isEqual(n){return __PRIVATE_valueEquals(this.value,n.value)}getFieldsMap(n){let l=this.value;l.mapValue.fields||(l.mapValue={fields:{}});for(let u=0;u<n.length;++u){let d=l.mapValue.fields[n.get(u)];__PRIVATE_isMapValue(d)&&d.mapValue.fields||(d={mapValue:{fields:{}}},l.mapValue.fields[n.get(u)]=d),l=d}return l.mapValue.fields}applyChanges(n,l,u){for(let d of(forEach(l,(l,u)=>n[l]=u),u))delete n[d]}clone(){return new ObjectValue(__PRIVATE_deepClone(this.value))}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let MutableDocument=class MutableDocument{constructor(n,l,u,d,h,f,m){this.key=n,this.documentType=l,this.version=u,this.readTime=d,this.createTime=h,this.data=f,this.documentState=m}static newInvalidDocument(n){return new MutableDocument(n,0,SnapshotVersion.min(),SnapshotVersion.min(),SnapshotVersion.min(),ObjectValue.empty(),0)}static newFoundDocument(n,l,u,d){return new MutableDocument(n,1,l,SnapshotVersion.min(),u,d,0)}static newNoDocument(n,l){return new MutableDocument(n,2,l,SnapshotVersion.min(),SnapshotVersion.min(),ObjectValue.empty(),0)}static newUnknownDocument(n,l){return new MutableDocument(n,3,l,SnapshotVersion.min(),SnapshotVersion.min(),ObjectValue.empty(),2)}convertToFoundDocument(n,l){return this.createTime.isEqual(SnapshotVersion.min())&&(2===this.documentType||0===this.documentType)&&(this.createTime=n),this.version=n,this.documentType=1,this.data=l,this.documentState=0,this}convertToNoDocument(n){return this.version=n,this.documentType=2,this.data=ObjectValue.empty(),this.documentState=0,this}convertToUnknownDocument(n){return this.version=n,this.documentType=3,this.data=ObjectValue.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=SnapshotVersion.min(),this}setReadTime(n){return this.readTime=n,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(n){return n instanceof MutableDocument&&this.key.isEqual(n.key)&&this.version.isEqual(n.version)&&this.documentType===n.documentType&&this.documentState===n.documentState&&this.data.isEqual(n.data)}mutableCopy(){return new MutableDocument(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}})`}};/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Bound=class Bound{constructor(n,l){this.position=n,this.inclusive=l}};function __PRIVATE_boundCompareToDocument(n,l,u){let d=0;for(let h=0;h<n.position.length;h++){let f=l[h],m=n.position[h];if(d=f.field.isKeyField()?DocumentKey.comparator(DocumentKey.fromName(m.referenceValue),u.key):__PRIVATE_valueCompare(m,u.data.field(f.field)),"desc"===f.dir&&(d*=-1),0!==d)break}return d}function __PRIVATE_boundEquals(n,l){if(null===n)return null===l;if(null===l||n.inclusive!==l.inclusive||n.position.length!==l.position.length)return!1;for(let u=0;u<n.position.length;u++)if(!__PRIVATE_valueEquals(n.position[u],l.position[u]))return!1;return!0}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let OrderBy=class OrderBy{constructor(n,l="asc"){this.field=n,this.dir=l}};/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Filter=class Filter{};let FieldFilter=class FieldFilter extends Filter{constructor(n,l,u){super(),this.field=n,this.op=l,this.value=u}static create(n,l,u){return n.isKeyField()?"in"===l||"not-in"===l?this.createKeyFieldInFilter(n,l,u):new __PRIVATE_KeyFieldFilter(n,l,u):"array-contains"===l?new __PRIVATE_ArrayContainsFilter(n,u):"in"===l?new __PRIVATE_InFilter(n,u):"not-in"===l?new __PRIVATE_NotInFilter(n,u):"array-contains-any"===l?new __PRIVATE_ArrayContainsAnyFilter(n,u):new FieldFilter(n,l,u)}static createKeyFieldInFilter(n,l,u){return"in"===l?new __PRIVATE_KeyFieldInFilter(n,u):new __PRIVATE_KeyFieldNotInFilter(n,u)}matches(n){let l=n.data.field(this.field);return"!="===this.op?null!==l&&this.matchesComparison(__PRIVATE_valueCompare(l,this.value)):null!==l&&__PRIVATE_typeOrder(this.value)===__PRIVATE_typeOrder(l)&&this.matchesComparison(__PRIVATE_valueCompare(l,this.value))}matchesComparison(n){switch(this.op){case"<":return n<0;case"<=":return n<=0;case"==":return 0===n;case"!=":return 0!==n;case">":return n>0;case">=":return n>=0;default:return fail()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}};let CompositeFilter=class CompositeFilter extends Filter{constructor(n,l){super(),this.filters=n,this.op=l,this.ue=null}static create(n,l){return new CompositeFilter(n,l)}matches(n){return __PRIVATE_compositeFilterIsConjunction(this)?void 0===this.filters.find(l=>!l.matches(n)):void 0!==this.filters.find(l=>l.matches(n))}getFlattenedFilters(){return null!==this.ue||(this.ue=this.filters.reduce((n,l)=>n.concat(l.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}};function __PRIVATE_compositeFilterIsConjunction(n){return"and"===n.op}function __PRIVATE_compositeFilterIsFlat(n){for(let l of n.filters)if(l instanceof CompositeFilter)return!1;return!0}let __PRIVATE_KeyFieldFilter=class __PRIVATE_KeyFieldFilter extends FieldFilter{constructor(n,l,u){super(n,l,u),this.key=DocumentKey.fromName(u.referenceValue)}matches(n){let l=DocumentKey.comparator(n.key,this.key);return this.matchesComparison(l)}};let __PRIVATE_KeyFieldInFilter=class __PRIVATE_KeyFieldInFilter extends FieldFilter{constructor(n,l){super(n,"in",l),this.keys=__PRIVATE_extractDocumentKeysFromArrayValue("in",l)}matches(n){return this.keys.some(l=>l.isEqual(n.key))}};let __PRIVATE_KeyFieldNotInFilter=class __PRIVATE_KeyFieldNotInFilter extends FieldFilter{constructor(n,l){super(n,"not-in",l),this.keys=__PRIVATE_extractDocumentKeysFromArrayValue("not-in",l)}matches(n){return!this.keys.some(l=>l.isEqual(n.key))}};function __PRIVATE_extractDocumentKeysFromArrayValue(n,l){var u;return((null===(u=l.arrayValue)||void 0===u?void 0:u.values)||[]).map(n=>DocumentKey.fromName(n.referenceValue))}let __PRIVATE_ArrayContainsFilter=class __PRIVATE_ArrayContainsFilter extends FieldFilter{constructor(n,l){super(n,"array-contains",l)}matches(n){let l=n.data.field(this.field);return isArray(l)&&__PRIVATE_arrayValueContains(l.arrayValue,this.value)}};let __PRIVATE_InFilter=class __PRIVATE_InFilter extends FieldFilter{constructor(n,l){super(n,"in",l)}matches(n){let l=n.data.field(this.field);return null!==l&&__PRIVATE_arrayValueContains(this.value.arrayValue,l)}};let __PRIVATE_NotInFilter=class __PRIVATE_NotInFilter extends FieldFilter{constructor(n,l){super(n,"not-in",l)}matches(n){if(__PRIVATE_arrayValueContains(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let l=n.data.field(this.field);return null!==l&&!__PRIVATE_arrayValueContains(this.value.arrayValue,l)}};let __PRIVATE_ArrayContainsAnyFilter=class __PRIVATE_ArrayContainsAnyFilter extends FieldFilter{constructor(n,l){super(n,"array-contains-any",l)}matches(n){let l=n.data.field(this.field);return!(!isArray(l)||!l.arrayValue.values)&&l.arrayValue.values.some(n=>__PRIVATE_arrayValueContains(this.value.arrayValue,n))}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_TargetImpl=class __PRIVATE_TargetImpl{constructor(n,l=null,u=[],d=[],h=null,f=null,m=null){this.path=n,this.collectionGroup=l,this.orderBy=u,this.filters=d,this.limit=h,this.startAt=f,this.endAt=m,this.ce=null}};function __PRIVATE_newTarget(n,l=null,u=[],d=[],h=null,f=null,m=null){return new __PRIVATE_TargetImpl(n,l,u,d,h,f,m)}function __PRIVATE_canonifyTarget(n){if(null===n.ce){let l=n.path.canonicalString();null!==n.collectionGroup&&(l+="|cg:"+n.collectionGroup),l+="|f:"+n.filters.map(n=>(function __PRIVATE_canonifyFilter(n){if(n instanceof FieldFilter)return n.field.canonicalString()+n.op.toString()+__PRIVATE_canonifyValue(n.value);if(__PRIVATE_compositeFilterIsFlat(n)&&__PRIVATE_compositeFilterIsConjunction(n))return n.filters.map(n=>__PRIVATE_canonifyFilter(n)).join(",");{let l=n.filters.map(n=>__PRIVATE_canonifyFilter(n)).join(",");return`${n.op}(${l})`}})(n)).join(",")+"|ob:"+n.orderBy.map(n=>n.field.canonicalString()+n.dir).join(","),__PRIVATE_isNullOrUndefined(n.limit)||(l+="|l:"+n.limit),n.startAt&&(l+="|lb:"+(n.startAt.inclusive?"b:":"a:")+n.startAt.position.map(n=>__PRIVATE_canonifyValue(n)).join(",")),n.endAt&&(l+="|ub:"+(n.endAt.inclusive?"a:":"b:")+n.endAt.position.map(n=>__PRIVATE_canonifyValue(n)).join(",")),n.ce=l}return n.ce}function __PRIVATE_targetEquals(n,l){if(n.limit!==l.limit||n.orderBy.length!==l.orderBy.length)return!1;for(let h=0;h<n.orderBy.length;h++){var u,d;if(u=n.orderBy[h],d=l.orderBy[h],!(u.dir===d.dir&&u.field.isEqual(d.field)))return!1}if(n.filters.length!==l.filters.length)return!1;for(let u=0;u<n.filters.length;u++)if(!function __PRIVATE_filterEquals(n,l){return n instanceof FieldFilter?l instanceof FieldFilter&&n.op===l.op&&n.field.isEqual(l.field)&&__PRIVATE_valueEquals(n.value,l.value):n instanceof CompositeFilter?l instanceof CompositeFilter&&n.op===l.op&&n.filters.length===l.filters.length&&n.filters.reduce((n,u,d)=>n&&__PRIVATE_filterEquals(u,l.filters[d]),!0):void fail()}(n.filters[u],l.filters[u]))return!1;return n.collectionGroup===l.collectionGroup&&!!n.path.isEqual(l.path)&&!!__PRIVATE_boundEquals(n.startAt,l.startAt)&&__PRIVATE_boundEquals(n.endAt,l.endAt)}function __PRIVATE_targetIsDocumentTarget(n){return DocumentKey.isDocumentKey(n.path)&&null===n.collectionGroup&&0===n.filters.length}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_QueryImpl=class __PRIVATE_QueryImpl{constructor(n,l=null,u=[],d=[],h=null,f="F",m=null,g=null){this.path=n,this.collectionGroup=l,this.explicitOrderBy=u,this.filters=d,this.limit=h,this.limitType=f,this.startAt=m,this.endAt=g,this.le=null,this.he=null,this.Pe=null,this.startAt,this.endAt}};function __PRIVATE_newQueryForPath(n){return new __PRIVATE_QueryImpl(n)}function __PRIVATE_queryMatchesAllDocuments(n){return 0===n.filters.length&&null===n.limit&&null==n.startAt&&null==n.endAt&&(0===n.explicitOrderBy.length||1===n.explicitOrderBy.length&&n.explicitOrderBy[0].field.isKeyField())}function __PRIVATE_queryNormalizedOrderBy(n){if(null===n.le){let l;n.le=[];let u=new Set;for(let l of n.explicitOrderBy)n.le.push(l),u.add(l.field.canonicalString());let d=n.explicitOrderBy.length>0?n.explicitOrderBy[n.explicitOrderBy.length-1].dir:"asc",h=(l=new SortedSet(FieldPath$1.comparator),n.filters.forEach(n=>{n.getFlattenedFilters().forEach(n=>{n.isInequality()&&(l=l.add(n.field))})}),l);h.forEach(l=>{u.has(l.canonicalString())||l.isKeyField()||n.le.push(new OrderBy(l,d))}),u.has(FieldPath$1.keyField().canonicalString())||n.le.push(new OrderBy(FieldPath$1.keyField(),d))}return n.le}function __PRIVATE_queryToTarget(n){return n.he||(n.he=function(n,l){if("F"===n.limitType)return __PRIVATE_newTarget(n.path,n.collectionGroup,l,n.filters,n.limit,n.startAt,n.endAt);{l=l.map(n=>{let l="desc"===n.dir?"asc":"desc";return new OrderBy(n.field,l)});let u=n.endAt?new Bound(n.endAt.position,n.endAt.inclusive):null,d=n.startAt?new Bound(n.startAt.position,n.startAt.inclusive):null;return __PRIVATE_newTarget(n.path,n.collectionGroup,l,n.filters,n.limit,u,d)}}(n,__PRIVATE_queryNormalizedOrderBy(n))),n.he}function __PRIVATE_queryWithLimit(n,l,u){return new __PRIVATE_QueryImpl(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),l,u,n.startAt,n.endAt)}function __PRIVATE_queryEquals(n,l){return __PRIVATE_targetEquals(__PRIVATE_queryToTarget(n),__PRIVATE_queryToTarget(l))&&n.limitType===l.limitType}function __PRIVATE_canonifyQuery(n){return`${__PRIVATE_canonifyTarget(__PRIVATE_queryToTarget(n))}|lt:${n.limitType}`}function __PRIVATE_stringifyQuery(n){var l;let u;return`Query(target=${u=(l=__PRIVATE_queryToTarget(n)).path.canonicalString(),null!==l.collectionGroup&&(u+=" collectionGroup="+l.collectionGroup),l.filters.length>0&&(u+=`, filters: [${l.filters.map(n=>(function __PRIVATE_stringifyFilter(n){return n instanceof FieldFilter?`${n.field.canonicalString()} ${n.op} ${__PRIVATE_canonifyValue(n.value)}`:n instanceof CompositeFilter?n.op.toString()+" {"+n.getFilters().map(__PRIVATE_stringifyFilter).join(" ,")+"}":"Filter"})(n)).join(", ")}]`),__PRIVATE_isNullOrUndefined(l.limit)||(u+=", limit: "+l.limit),l.orderBy.length>0&&(u+=`, orderBy: [${l.orderBy.map(n=>`${n.field.canonicalString()} (${n.dir})`).join(", ")}]`),l.startAt&&(u+=", startAt: "+(l.startAt.inclusive?"b:":"a:")+l.startAt.position.map(n=>__PRIVATE_canonifyValue(n)).join(",")),l.endAt&&(u+=", endAt: "+(l.endAt.inclusive?"a:":"b:")+l.endAt.position.map(n=>__PRIVATE_canonifyValue(n)).join(",")),`Target(${u})`}; limitType=${n.limitType})`}function __PRIVATE_queryMatches(n,l){return l.isFoundDocument()&&function(n,l){let u=l.key.path;return null!==n.collectionGroup?l.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(u):DocumentKey.isDocumentKey(n.path)?n.path.isEqual(u):n.path.isImmediateParentOf(u)}(n,l)&&function(n,l){for(let u of __PRIVATE_queryNormalizedOrderBy(n))if(!u.field.isKeyField()&&null===l.data.field(u.field))return!1;return!0}(n,l)&&function(n,l){for(let u of n.filters)if(!u.matches(l))return!1;return!0}(n,l)&&(!n.startAt||!!function(n,l,u){let d=__PRIVATE_boundCompareToDocument(n,l,u);return n.inclusive?d<=0:d<0}(n.startAt,__PRIVATE_queryNormalizedOrderBy(n),l))&&(!n.endAt||!!function(n,l,u){let d=__PRIVATE_boundCompareToDocument(n,l,u);return n.inclusive?d>=0:d>0}(n.endAt,__PRIVATE_queryNormalizedOrderBy(n),l))}function __PRIVATE_newQueryComparator(n){return(l,u)=>{let d=!1;for(let h of __PRIVATE_queryNormalizedOrderBy(n)){let n=function(n,l,u){let d=n.field.isKeyField()?DocumentKey.comparator(l.key,u.key):function(n,l,u){let d=l.data.field(n),h=u.data.field(n);return null!==d&&null!==h?__PRIVATE_valueCompare(d,h):fail()}(n.field,l,u);switch(n.dir){case"asc":return d;case"desc":return -1*d;default:return fail()}}(h,l,u);if(0!==n)return n;d=d||h.field.isKeyField()}return 0}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ObjectMap=class ObjectMap{constructor(n,l){this.mapKeyFn=n,this.equalsFn=l,this.inner={},this.innerSize=0}get(n){let l=this.mapKeyFn(n),u=this.inner[l];if(void 0!==u){for(let[l,d]of u)if(this.equalsFn(l,n))return d}}has(n){return void 0!==this.get(n)}set(n,l){let u=this.mapKeyFn(n),d=this.inner[u];if(void 0===d)return this.inner[u]=[[n,l]],void this.innerSize++;for(let u=0;u<d.length;u++)if(this.equalsFn(d[u][0],n))return void(d[u]=[n,l]);d.push([n,l]),this.innerSize++}delete(n){let l=this.mapKeyFn(n),u=this.inner[l];if(void 0===u)return!1;for(let d=0;d<u.length;d++)if(this.equalsFn(u[d][0],n))return 1===u.length?delete this.inner[l]:u.splice(d,1),this.innerSize--,!0;return!1}forEach(n){forEach(this.inner,(l,u)=>{for(let[l,d]of u)n(l,d)})}isEmpty(){return isEmpty(this.inner)}size(){return this.innerSize}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tE=new SortedMap(DocumentKey.comparator),tS=new SortedMap(DocumentKey.comparator);function documentMap(...n){let l=tS;for(let u of n)l=l.insert(u.key,u);return l}function __PRIVATE_convertOverlayedDocumentMapToDocumentMap(n){let l=tS;return n.forEach((n,u)=>l=l.insert(n,u.overlayedDocument)),l}function __PRIVATE_newDocumentKeyMap(){return new ObjectMap(n=>n.toString(),(n,l)=>n.isEqual(l))}let tw=new SortedMap(DocumentKey.comparator),tT=new SortedSet(DocumentKey.comparator);function __PRIVATE_documentKeySet(...n){let l=tT;for(let u of n)l=l.add(u);return l}let tI=new SortedSet(__PRIVATE_primitiveComparator);/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function __PRIVATE_toDouble(n,l){if(n.useProto3Json){if(isNaN(l))return{doubleValue:"NaN"};if(l===1/0)return{doubleValue:"Infinity"};if(l===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:__PRIVATE_isNegativeZero(l)?"-0":l}}function __PRIVATE_toInteger(n){return{integerValue:""+n}}/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let TransformOperation=class TransformOperation{constructor(){this._=void 0}};function __PRIVATE_computeTransformOperationBaseValue(n,l){return n instanceof __PRIVATE_NumericIncrementTransformOperation?isInteger(l)||l&&"doubleValue"in l?l:{integerValue:0}:null}let __PRIVATE_ServerTimestampTransform=class __PRIVATE_ServerTimestampTransform extends TransformOperation{};let __PRIVATE_ArrayUnionTransformOperation=class __PRIVATE_ArrayUnionTransformOperation extends TransformOperation{constructor(n){super(),this.elements=n}};function __PRIVATE_applyArrayUnionTransformOperation(n,l){let u=__PRIVATE_coercedFieldValuesArray(l);for(let l of n.elements)u.some(n=>__PRIVATE_valueEquals(n,l))||u.push(l);return{arrayValue:{values:u}}}let __PRIVATE_ArrayRemoveTransformOperation=class __PRIVATE_ArrayRemoveTransformOperation extends TransformOperation{constructor(n){super(),this.elements=n}};function __PRIVATE_applyArrayRemoveTransformOperation(n,l){let u=__PRIVATE_coercedFieldValuesArray(l);for(let l of n.elements)u=u.filter(n=>!__PRIVATE_valueEquals(n,l));return{arrayValue:{values:u}}}let __PRIVATE_NumericIncrementTransformOperation=class __PRIVATE_NumericIncrementTransformOperation extends TransformOperation{constructor(n,l){super(),this.serializer=n,this.Ie=l}};function asNumber(n){return __PRIVATE_normalizeNumber(n.integerValue||n.doubleValue)}function __PRIVATE_coercedFieldValuesArray(n){return isArray(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FieldTransform=class FieldTransform{constructor(n,l){this.field=n,this.transform=l}};let MutationResult=class MutationResult{constructor(n,l){this.version=n,this.transformResults=l}};let Precondition=class Precondition{constructor(n,l){this.updateTime=n,this.exists=l}static none(){return new Precondition}static exists(n){return new Precondition(void 0,n)}static updateTime(n){return new Precondition(n)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(n){return this.exists===n.exists&&(this.updateTime?!!n.updateTime&&this.updateTime.isEqual(n.updateTime):!n.updateTime)}};function __PRIVATE_preconditionIsValidForDocument(n,l){return void 0!==n.updateTime?l.isFoundDocument()&&l.version.isEqual(n.updateTime):void 0===n.exists||n.exists===l.isFoundDocument()}let Mutation=class Mutation{};function __PRIVATE_calculateOverlayMutation(n,l){if(!n.hasLocalMutations||l&&0===l.fields.length)return null;if(null===l)return n.isNoDocument()?new __PRIVATE_DeleteMutation(n.key,Precondition.none()):new __PRIVATE_SetMutation(n.key,n.data,Precondition.none());{let u=n.data,d=ObjectValue.empty(),h=new SortedSet(FieldPath$1.comparator);for(let n of l.fields)if(!h.has(n)){let l=u.field(n);null===l&&n.length>1&&(n=n.popLast(),l=u.field(n)),null===l?d.delete(n):d.set(n,l),h=h.add(n)}return new __PRIVATE_PatchMutation(n.key,d,new FieldMask(h.toArray()),Precondition.none())}}function __PRIVATE_mutationApplyToLocalView(n,l,u,d){return n instanceof __PRIVATE_SetMutation?function(n,l,u,d){if(!__PRIVATE_preconditionIsValidForDocument(n.precondition,l))return u;let h=n.value.clone(),f=__PRIVATE_localTransformResults(n.fieldTransforms,d,l);return h.setAll(f),l.convertToFoundDocument(l.version,h).setHasLocalMutations(),null}(n,l,u,d):n instanceof __PRIVATE_PatchMutation?function(n,l,u,d){if(!__PRIVATE_preconditionIsValidForDocument(n.precondition,l))return u;let h=__PRIVATE_localTransformResults(n.fieldTransforms,d,l),f=l.data;return(f.setAll(__PRIVATE_getPatch(n)),f.setAll(h),l.convertToFoundDocument(l.version,f).setHasLocalMutations(),null===u)?null:u.unionWith(n.fieldMask.fields).unionWith(n.fieldTransforms.map(n=>n.field))}(n,l,u,d):__PRIVATE_preconditionIsValidForDocument(n.precondition,l)?(l.convertToNoDocument(l.version).setHasLocalMutations(),null):u}function __PRIVATE_mutationEquals(n,l){var u,d;return n.type===l.type&&!!n.key.isEqual(l.key)&&!!n.precondition.isEqual(l.precondition)&&(u=n.fieldTransforms,d=l.fieldTransforms,!!(void 0===u&&void 0===d||!(!u||!d)&&__PRIVATE_arrayEquals(u,d,(n,l)=>{var u,d;return n.field.isEqual(l.field)&&(u=n.transform,d=l.transform,u instanceof __PRIVATE_ArrayUnionTransformOperation&&d instanceof __PRIVATE_ArrayUnionTransformOperation||u instanceof __PRIVATE_ArrayRemoveTransformOperation&&d instanceof __PRIVATE_ArrayRemoveTransformOperation?__PRIVATE_arrayEquals(u.elements,d.elements,__PRIVATE_valueEquals):u instanceof __PRIVATE_NumericIncrementTransformOperation&&d instanceof __PRIVATE_NumericIncrementTransformOperation?__PRIVATE_valueEquals(u.Ie,d.Ie):u instanceof __PRIVATE_ServerTimestampTransform&&d instanceof __PRIVATE_ServerTimestampTransform)})))&&(0===n.type?n.value.isEqual(l.value):1!==n.type||n.data.isEqual(l.data)&&n.fieldMask.isEqual(l.fieldMask))}let __PRIVATE_SetMutation=class __PRIVATE_SetMutation extends Mutation{constructor(n,l,u,d=[]){super(),this.key=n,this.value=l,this.precondition=u,this.fieldTransforms=d,this.type=0}getFieldMask(){return null}};let __PRIVATE_PatchMutation=class __PRIVATE_PatchMutation extends Mutation{constructor(n,l,u,d,h=[]){super(),this.key=n,this.data=l,this.fieldMask=u,this.precondition=d,this.fieldTransforms=h,this.type=1}getFieldMask(){return this.fieldMask}};function __PRIVATE_getPatch(n){let l=new Map;return n.fieldMask.fields.forEach(u=>{if(!u.isEmpty()){let d=n.data.field(u);l.set(u,d)}}),l}function __PRIVATE_serverTransformResults(n,l,u){var d;let h=new Map;n.length===u.length||fail();for(let f=0;f<u.length;f++){let m=n[f],g=m.transform,_=l.data.field(m.field);h.set(m.field,(d=u[f],g instanceof __PRIVATE_ArrayUnionTransformOperation?__PRIVATE_applyArrayUnionTransformOperation(g,_):g instanceof __PRIVATE_ArrayRemoveTransformOperation?__PRIVATE_applyArrayRemoveTransformOperation(g,_):d))}return h}function __PRIVATE_localTransformResults(n,l,u){let d=new Map;for(let h of n){let n=h.transform,f=u.data.field(h.field);d.set(h.field,n instanceof __PRIVATE_ServerTimestampTransform?function(n,l){let u={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:n.seconds,nanos:n.nanoseconds}}}};return l&&__PRIVATE_isServerTimestamp(l)&&(l=__PRIVATE_getPreviousValue(l)),l&&(u.fields.__previous_value__=l),{mapValue:u}}(l,f):n instanceof __PRIVATE_ArrayUnionTransformOperation?__PRIVATE_applyArrayUnionTransformOperation(n,f):n instanceof __PRIVATE_ArrayRemoveTransformOperation?__PRIVATE_applyArrayRemoveTransformOperation(n,f):function(n,l){let u=__PRIVATE_computeTransformOperationBaseValue(n,l),d=asNumber(u)+asNumber(n.Ie);return isInteger(u)&&isInteger(n.Ie)?__PRIVATE_toInteger(d):__PRIVATE_toDouble(n.serializer,d)}(n,f))}return d}let __PRIVATE_DeleteMutation=class __PRIVATE_DeleteMutation extends Mutation{constructor(n,l){super(),this.key=n,this.precondition=l,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}};let __PRIVATE_VerifyMutation=class __PRIVATE_VerifyMutation extends Mutation{constructor(n,l){super(),this.key=n,this.precondition=l,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let MutationBatch=class MutationBatch{constructor(n,l,u,d){this.batchId=n,this.localWriteTime=l,this.baseMutations=u,this.mutations=d}applyToRemoteDocument(n,l){let u=l.mutationResults;for(let l=0;l<this.mutations.length;l++){let h=this.mutations[l];if(h.key.isEqual(n.key)){var d;d=u[l],h instanceof __PRIVATE_SetMutation?function(n,l,u){let d=n.value.clone(),h=__PRIVATE_serverTransformResults(n.fieldTransforms,l,u.transformResults);d.setAll(h),l.convertToFoundDocument(u.version,d).setHasCommittedMutations()}(h,n,d):h instanceof __PRIVATE_PatchMutation?function(n,l,u){if(!__PRIVATE_preconditionIsValidForDocument(n.precondition,l))return void l.convertToUnknownDocument(u.version);let d=__PRIVATE_serverTransformResults(n.fieldTransforms,l,u.transformResults),h=l.data;h.setAll(__PRIVATE_getPatch(n)),h.setAll(d),l.convertToFoundDocument(u.version,h).setHasCommittedMutations()}(h,n,d):function(n,l,u){l.convertToNoDocument(u.version).setHasCommittedMutations()}(0,n,d)}}}applyToLocalView(n,l){for(let u of this.baseMutations)u.key.isEqual(n.key)&&(l=__PRIVATE_mutationApplyToLocalView(u,n,l,this.localWriteTime));for(let u of this.mutations)u.key.isEqual(n.key)&&(l=__PRIVATE_mutationApplyToLocalView(u,n,l,this.localWriteTime));return l}applyToLocalDocumentSet(n,l){let u=__PRIVATE_newDocumentKeyMap();return this.mutations.forEach(d=>{let h=n.get(d.key),f=h.overlayedDocument,m=this.applyToLocalView(f,h.mutatedFields);m=l.has(d.key)?null:m;let g=__PRIVATE_calculateOverlayMutation(f,m);null!==g&&u.set(d.key,g),f.isValidDocument()||f.convertToNoDocument(SnapshotVersion.min())}),u}keys(){return this.mutations.reduce((n,l)=>n.add(l.key),__PRIVATE_documentKeySet())}isEqual(n){return this.batchId===n.batchId&&__PRIVATE_arrayEquals(this.mutations,n.mutations,(n,l)=>__PRIVATE_mutationEquals(n,l))&&__PRIVATE_arrayEquals(this.baseMutations,n.baseMutations,(n,l)=>__PRIVATE_mutationEquals(n,l))}};let MutationBatchResult=class MutationBatchResult{constructor(n,l,u,d){this.batch=n,this.commitVersion=l,this.mutationResults=u,this.docVersions=d}static from(n,l,u){n.mutations.length===u.length||fail();let d=tw,h=n.mutations;for(let n=0;n<h.length;n++)d=d.insert(h[n].key,u[n].version);return new MutationBatchResult(n,l,u,d)}};/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Overlay=class Overlay{constructor(n,l){this.largestBatchId=n,this.mutation=l}getKey(){return this.mutation.key}isEqual(n){return null!==n&&this.mutation===n.mutation}toString(){return`Overlay{
      largestBatchId: ${this.largestBatchId},
      mutation: ${this.mutation.toString()}
    }`}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ExistenceFilter=class ExistenceFilter{constructor(n,l){this.count=n,this.unchangedNames=l}};function __PRIVATE_isPermanentError(n){switch(n){default:return fail();case tg.CANCELLED:case tg.UNKNOWN:case tg.DEADLINE_EXCEEDED:case tg.RESOURCE_EXHAUSTED:case tg.INTERNAL:case tg.UNAVAILABLE:case tg.UNAUTHENTICATED:return!1;case tg.INVALID_ARGUMENT:case tg.NOT_FOUND:case tg.ALREADY_EXISTS:case tg.PERMISSION_DENIED:case tg.FAILED_PRECONDITION:case tg.ABORTED:case tg.OUT_OF_RANGE:case tg.UNIMPLEMENTED:case tg.DATA_LOSS:return!0}}function __PRIVATE_mapCodeFromRpcCode(n){if(void 0===n)return __PRIVATE_logError("GRPC error has no .code"),tg.UNKNOWN;switch(n){case g.OK:return tg.OK;case g.CANCELLED:return tg.CANCELLED;case g.UNKNOWN:return tg.UNKNOWN;case g.DEADLINE_EXCEEDED:return tg.DEADLINE_EXCEEDED;case g.RESOURCE_EXHAUSTED:return tg.RESOURCE_EXHAUSTED;case g.INTERNAL:return tg.INTERNAL;case g.UNAVAILABLE:return tg.UNAVAILABLE;case g.UNAUTHENTICATED:return tg.UNAUTHENTICATED;case g.INVALID_ARGUMENT:return tg.INVALID_ARGUMENT;case g.NOT_FOUND:return tg.NOT_FOUND;case g.ALREADY_EXISTS:return tg.ALREADY_EXISTS;case g.PERMISSION_DENIED:return tg.PERMISSION_DENIED;case g.FAILED_PRECONDITION:return tg.FAILED_PRECONDITION;case g.ABORTED:return tg.ABORTED;case g.OUT_OF_RANGE:return tg.OUT_OF_RANGE;case g.UNIMPLEMENTED:return tg.UNIMPLEMENTED;case g.DATA_LOSS:return tg.DATA_LOSS;default:return fail()}}(_=g||(g={}))[_.OK=0]="OK",_[_.CANCELLED=1]="CANCELLED",_[_.UNKNOWN=2]="UNKNOWN",_[_.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",_[_.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",_[_.NOT_FOUND=5]="NOT_FOUND",_[_.ALREADY_EXISTS=6]="ALREADY_EXISTS",_[_.PERMISSION_DENIED=7]="PERMISSION_DENIED",_[_.UNAUTHENTICATED=16]="UNAUTHENTICATED",_[_.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",_[_.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",_[_.ABORTED=10]="ABORTED",_[_.OUT_OF_RANGE=11]="OUT_OF_RANGE",_[_.UNIMPLEMENTED=12]="UNIMPLEMENTED",_[_.INTERNAL=13]="INTERNAL",_[_.UNAVAILABLE=14]="UNAVAILABLE",_[_.DATA_LOSS=15]="DATA_LOSS";/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tR=new td([4294967295,4294967295],0);function __PRIVATE_getMd5HashValue(n){let l=(new TextEncoder).encode(n),u=new tc;return u.update(l),new Uint8Array(u.digest())}function __PRIVATE_get64BitUints(n){let l=new DataView(n.buffer),u=l.getUint32(0,!0),d=l.getUint32(4,!0),h=l.getUint32(8,!0),f=l.getUint32(12,!0);return[new td([u,d],0),new td([h,f],0)]}let BloomFilter=class BloomFilter{constructor(n,l,u){if(this.bitmap=n,this.padding=l,this.hashCount=u,l<0||l>=8)throw new __PRIVATE_BloomFilterError(`Invalid padding: ${l}`);if(u<0||n.length>0&&0===this.hashCount)throw new __PRIVATE_BloomFilterError(`Invalid hash count: ${u}`);if(0===n.length&&0!==l)throw new __PRIVATE_BloomFilterError(`Invalid padding when bitmap length is 0: ${l}`);this.Te=8*n.length-l,this.Ee=td.fromNumber(this.Te)}de(n,l,u){let d=n.add(l.multiply(td.fromNumber(u)));return 1===d.compare(tR)&&(d=new td([d.getBits(0),d.getBits(1)],0)),d.modulo(this.Ee).toNumber()}Ae(n){return 0!=(this.bitmap[Math.floor(n/8)]&1<<n%8)}mightContain(n){if(0===this.Te)return!1;let l=__PRIVATE_getMd5HashValue(n),[u,d]=__PRIVATE_get64BitUints(l);for(let n=0;n<this.hashCount;n++){let l=this.de(u,d,n);if(!this.Ae(l))return!1}return!0}static create(n,l,u){let d=new Uint8Array(Math.ceil(n/8)),h=new BloomFilter(d,n%8==0?0:8-n%8,l);return u.forEach(n=>h.insert(n)),h}insert(n){if(0===this.Te)return;let l=__PRIVATE_getMd5HashValue(n),[u,d]=__PRIVATE_get64BitUints(l);for(let n=0;n<this.hashCount;n++){let l=this.de(u,d,n);this.Re(l)}}Re(n){let l=Math.floor(n/8);this.bitmap[l]|=1<<n%8}};let __PRIVATE_BloomFilterError=class __PRIVATE_BloomFilterError extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let RemoteEvent=class RemoteEvent{constructor(n,l,u,d,h){this.snapshotVersion=n,this.targetChanges=l,this.targetMismatches=u,this.documentUpdates=d,this.resolvedLimboDocuments=h}static createSynthesizedRemoteEventForCurrentChange(n,l,u){let d=new Map;return d.set(n,TargetChange.createSynthesizedTargetChangeForCurrentChange(n,l,u)),new RemoteEvent(SnapshotVersion.min(),d,new SortedMap(__PRIVATE_primitiveComparator),tE,__PRIVATE_documentKeySet())}};let TargetChange=class TargetChange{constructor(n,l,u,d,h){this.resumeToken=n,this.current=l,this.addedDocuments=u,this.modifiedDocuments=d,this.removedDocuments=h}static createSynthesizedTargetChangeForCurrentChange(n,l,u){return new TargetChange(u,l,__PRIVATE_documentKeySet(),__PRIVATE_documentKeySet(),__PRIVATE_documentKeySet())}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_DocumentWatchChange=class __PRIVATE_DocumentWatchChange{constructor(n,l,u,d){this.Ve=n,this.removedTargetIds=l,this.key=u,this.me=d}};let __PRIVATE_ExistenceFilterChange=class __PRIVATE_ExistenceFilterChange{constructor(n,l){this.targetId=n,this.fe=l}};let __PRIVATE_WatchTargetChange=class __PRIVATE_WatchTargetChange{constructor(n,l,u=ByteString.EMPTY_BYTE_STRING,d=null){this.state=n,this.targetIds=l,this.resumeToken=u,this.cause=d}};let __PRIVATE_TargetState=class __PRIVATE_TargetState{constructor(){this.ge=0,this.pe=__PRIVATE_snapshotChangesMap(),this.ye=ByteString.EMPTY_BYTE_STRING,this.we=!1,this.Se=!0}get current(){return this.we}get resumeToken(){return this.ye}get be(){return 0!==this.ge}get De(){return this.Se}Ce(n){n.approximateByteSize()>0&&(this.Se=!0,this.ye=n)}ve(){let n=__PRIVATE_documentKeySet(),l=__PRIVATE_documentKeySet(),u=__PRIVATE_documentKeySet();return this.pe.forEach((d,h)=>{switch(h){case 0:n=n.add(d);break;case 2:l=l.add(d);break;case 1:u=u.add(d);break;default:fail()}}),new TargetChange(this.ye,this.we,n,l,u)}Fe(){this.Se=!1,this.pe=__PRIVATE_snapshotChangesMap()}Me(n,l){this.Se=!0,this.pe=this.pe.insert(n,l)}xe(n){this.Se=!0,this.pe=this.pe.remove(n)}Oe(){this.ge+=1}Ne(){this.ge-=1,this.ge>=0||fail()}Be(){this.Se=!0,this.we=!0}};let __PRIVATE_WatchChangeAggregator=class __PRIVATE_WatchChangeAggregator{constructor(n){this.Le=n,this.ke=new Map,this.qe=tE,this.Qe=__PRIVATE_documentTargetMap(),this.Ke=new SortedMap(__PRIVATE_primitiveComparator)}$e(n){for(let l of n.Ve)n.me&&n.me.isFoundDocument()?this.Ue(l,n.me):this.We(l,n.key,n.me);for(let l of n.removedTargetIds)this.We(l,n.key,n.me)}Ge(n){this.forEachTarget(n,l=>{let u=this.ze(l);switch(n.state){case 0:this.je(l)&&u.Ce(n.resumeToken);break;case 1:u.Ne(),u.be||u.Fe(),u.Ce(n.resumeToken);break;case 2:u.Ne(),u.be||this.removeTarget(l);break;case 3:this.je(l)&&(u.Be(),u.Ce(n.resumeToken));break;case 4:this.je(l)&&(this.He(l),u.Ce(n.resumeToken));break;default:fail()}})}forEachTarget(n,l){n.targetIds.length>0?n.targetIds.forEach(l):this.ke.forEach((n,u)=>{this.je(u)&&l(u)})}Je(n){let l=n.targetId,u=n.fe.count,d=this.Ye(l);if(d){let h=d.target;if(__PRIVATE_targetIsDocumentTarget(h)){if(0===u){let n=new DocumentKey(h.path);this.We(l,n,MutableDocument.newNoDocument(n,SnapshotVersion.min()))}else 1===u||fail()}else{let d=this.Ze(l);if(d!==u){let u=this.Xe(n),h=u?this.et(u,n,d):1;0!==h&&(this.He(l),this.Ke=this.Ke.insert(l,2===h?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch"))}}}}Xe(n){let l,u;let d=n.fe.unchangedNames;if(!d||!d.bits)return null;let{bits:{bitmap:h="",padding:f=0},hashCount:m=0}=d;try{l=__PRIVATE_normalizeByteString(h).toUint8Array()}catch(n){if(n instanceof __PRIVATE_Base64DecodeError)return __PRIVATE_logWarn("Decoding the base64 bloom filter in existence filter failed ("+n.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw n}try{u=new BloomFilter(l,f,m)}catch(n){return __PRIVATE_logWarn(n instanceof __PRIVATE_BloomFilterError?"BloomFilter error: ":"Applying bloom filter failed: ",n),null}return 0===u.Te?null:u}et(n,l,u){return l.fe.count===u-this.rt(n,l.targetId)?0:2}rt(n,l){let u=this.Le.getRemoteKeysForTarget(l),d=0;return u.forEach(u=>{let h=this.Le.nt(),f=`projects/${h.projectId}/databases/${h.database}/documents/${u.path.canonicalString()}`;n.mightContain(f)||(this.We(l,u,null),d++)}),d}it(n){let l=new Map;this.ke.forEach((u,d)=>{let h=this.Ye(d);if(h){if(u.current&&__PRIVATE_targetIsDocumentTarget(h.target)){let l=new DocumentKey(h.target.path);null!==this.qe.get(l)||this.st(d,l)||this.We(d,l,MutableDocument.newNoDocument(l,n))}u.De&&(l.set(d,u.ve()),u.Fe())}});let u=__PRIVATE_documentKeySet();this.Qe.forEach((n,l)=>{let d=!0;l.forEachWhile(n=>{let l=this.Ye(n);return!l||"TargetPurposeLimboResolution"===l.purpose||(d=!1,!1)}),d&&(u=u.add(n))}),this.qe.forEach((l,u)=>u.setReadTime(n));let d=new RemoteEvent(n,l,this.Ke,this.qe,u);return this.qe=tE,this.Qe=__PRIVATE_documentTargetMap(),this.Ke=new SortedMap(__PRIVATE_primitiveComparator),d}Ue(n,l){if(!this.je(n))return;let u=this.st(n,l.key)?2:0;this.ze(n).Me(l.key,u),this.qe=this.qe.insert(l.key,l),this.Qe=this.Qe.insert(l.key,this.ot(l.key).add(n))}We(n,l,u){if(!this.je(n))return;let d=this.ze(n);this.st(n,l)?d.Me(l,1):d.xe(l),this.Qe=this.Qe.insert(l,this.ot(l).delete(n)),u&&(this.qe=this.qe.insert(l,u))}removeTarget(n){this.ke.delete(n)}Ze(n){let l=this.ze(n).ve();return this.Le.getRemoteKeysForTarget(n).size+l.addedDocuments.size-l.removedDocuments.size}Oe(n){this.ze(n).Oe()}ze(n){let l=this.ke.get(n);return l||(l=new __PRIVATE_TargetState,this.ke.set(n,l)),l}ot(n){let l=this.Qe.get(n);return l||(l=new SortedSet(__PRIVATE_primitiveComparator),this.Qe=this.Qe.insert(n,l)),l}je(n){let l=null!==this.Ye(n);return l||__PRIVATE_logDebug("WatchChangeAggregator","Detected inactive target",n),l}Ye(n){let l=this.ke.get(n);return l&&l.be?null:this.Le._t(n)}He(n){this.ke.set(n,new __PRIVATE_TargetState),this.Le.getRemoteKeysForTarget(n).forEach(l=>{this.We(n,l,null)})}st(n,l){return this.Le.getRemoteKeysForTarget(n).has(l)}};function __PRIVATE_documentTargetMap(){return new SortedMap(DocumentKey.comparator)}function __PRIVATE_snapshotChangesMap(){return new SortedMap(DocumentKey.comparator)}let tP={asc:"ASCENDING",desc:"DESCENDING"},tA={"<":"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"},tO={and:"AND",or:"OR"};let JsonProtoSerializer=class JsonProtoSerializer{constructor(n,l){this.databaseId=n,this.useProto3Json=l}};function __PRIVATE_toInt32Proto(n,l){return n.useProto3Json||__PRIVATE_isNullOrUndefined(l)?l:{value:l}}function toTimestamp(n,l){return n.useProto3Json?`${new Date(1e3*l.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+l.nanoseconds).slice(-9)}Z`:{seconds:""+l.seconds,nanos:l.nanoseconds}}function __PRIVATE_toBytes(n,l){return n.useProto3Json?l.toBase64():l.toUint8Array()}function __PRIVATE_fromVersion(n){return n||fail(),SnapshotVersion.fromTimestamp(function(n){let l=__PRIVATE_normalizeTimestamp(n);return new Timestamp(l.seconds,l.nanos)}(n))}function __PRIVATE_toResourceName(n,l){return __PRIVATE_toResourcePath(n,l).canonicalString()}function __PRIVATE_toResourcePath(n,l){let u=new ResourcePath(["projects",n.projectId,"databases",n.database]).child("documents");return void 0===l?u:u.child(l)}function __PRIVATE_fromResourceName(n){let l=ResourcePath.fromString(n);return __PRIVATE_isValidResourceName(l)||fail(),l}function __PRIVATE_toName(n,l){return __PRIVATE_toResourceName(n.databaseId,l.path)}function fromName(n,l){let u=__PRIVATE_fromResourceName(l);if(u.get(1)!==n.databaseId.projectId)throw new FirestoreError(tg.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+u.get(1)+" vs "+n.databaseId.projectId);if(u.get(3)!==n.databaseId.database)throw new FirestoreError(tg.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+u.get(3)+" vs "+n.databaseId.database);return new DocumentKey(__PRIVATE_extractLocalPathFromResourceName(u))}function __PRIVATE_toQueryPath(n,l){return __PRIVATE_toResourceName(n.databaseId,l)}function __PRIVATE_getEncodedDatabaseId(n){return new ResourcePath(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function __PRIVATE_extractLocalPathFromResourceName(n){return n.length>4&&"documents"===n.get(4)||fail(),n.popFirst(5)}function __PRIVATE_toMutationDocument(n,l,u){return{name:__PRIVATE_toName(n,l),fields:u.value.mapValue.fields}}function toMutation(n,l){var u;let d;if(l instanceof __PRIVATE_SetMutation)d={update:__PRIVATE_toMutationDocument(n,l.key,l.value)};else if(l instanceof __PRIVATE_DeleteMutation)d={delete:__PRIVATE_toName(n,l.key)};else if(l instanceof __PRIVATE_PatchMutation)d={update:__PRIVATE_toMutationDocument(n,l.key,l.data),updateMask:function(n){let l=[];return n.fields.forEach(n=>l.push(n.canonicalString())),{fieldPaths:l}}(l.fieldMask)};else{if(!(l instanceof __PRIVATE_VerifyMutation))return fail();d={verify:__PRIVATE_toName(n,l.key)}}return l.fieldTransforms.length>0&&(d.updateTransforms=l.fieldTransforms.map(n=>(function(n,l){let u=l.transform;if(u instanceof __PRIVATE_ServerTimestampTransform)return{fieldPath:l.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(u instanceof __PRIVATE_ArrayUnionTransformOperation)return{fieldPath:l.field.canonicalString(),appendMissingElements:{values:u.elements}};if(u instanceof __PRIVATE_ArrayRemoveTransformOperation)return{fieldPath:l.field.canonicalString(),removeAllFromArray:{values:u.elements}};if(u instanceof __PRIVATE_NumericIncrementTransformOperation)return{fieldPath:l.field.canonicalString(),increment:u.Ie};throw fail()})(0,n))),l.precondition.isNone||(d.currentDocument=void 0!==(u=l.precondition).updateTime?{updateTime:toTimestamp(n,u.updateTime.toTimestamp())}:void 0!==u.exists?{exists:u.exists}:fail()),d}function __PRIVATE_toFieldPathReference(n){return{fieldPath:n.canonicalString()}}function __PRIVATE_fromFieldPathReference(n){return FieldPath$1.fromServerFormat(n.fieldPath)}function __PRIVATE_isValidResourceName(n){return n.length>=4&&"projects"===n.get(0)&&"databases"===n.get(2)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let TargetData=class TargetData{constructor(n,l,u,d,h=SnapshotVersion.min(),f=SnapshotVersion.min(),m=ByteString.EMPTY_BYTE_STRING,g=null){this.target=n,this.targetId=l,this.purpose=u,this.sequenceNumber=d,this.snapshotVersion=h,this.lastLimboFreeSnapshotVersion=f,this.resumeToken=m,this.expectedCount=g}withSequenceNumber(n){return new TargetData(this.target,this.targetId,this.purpose,n,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(n,l){return new TargetData(this.target,this.targetId,this.purpose,this.sequenceNumber,l,this.lastLimboFreeSnapshotVersion,n,null)}withExpectedCount(n){return new TargetData(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,n)}withLastLimboFreeSnapshotVersion(n){return new TargetData(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,n,this.resumeToken,this.expectedCount)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_LocalSerializer=class __PRIVATE_LocalSerializer{constructor(n){this.ct=n}};/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_FirestoreIndexValueWriter=class __PRIVATE_FirestoreIndexValueWriter{constructor(){}Pt(n,l){this.It(n,l),l.Tt()}It(n,l){if("nullValue"in n)this.Et(l,5);else if("booleanValue"in n)this.Et(l,10),l.dt(n.booleanValue?1:0);else if("integerValue"in n)this.Et(l,15),l.dt(__PRIVATE_normalizeNumber(n.integerValue));else if("doubleValue"in n){let u=__PRIVATE_normalizeNumber(n.doubleValue);isNaN(u)?this.Et(l,13):(this.Et(l,15),__PRIVATE_isNegativeZero(u)?l.dt(0):l.dt(u))}else if("timestampValue"in n){let u=n.timestampValue;this.Et(l,20),"string"==typeof u?l.At(u):(l.At(`${u.seconds||""}`),l.dt(u.nanos||0))}else if("stringValue"in n)this.Rt(n.stringValue,l),this.Vt(l);else if("bytesValue"in n)this.Et(l,30),l.ft(__PRIVATE_normalizeByteString(n.bytesValue)),this.Vt(l);else if("referenceValue"in n)this.gt(n.referenceValue,l);else if("geoPointValue"in n){let u=n.geoPointValue;this.Et(l,45),l.dt(u.latitude||0),l.dt(u.longitude||0)}else"mapValue"in n?__PRIVATE_isMaxValue(n)?this.Et(l,Number.MAX_SAFE_INTEGER):(this.yt(n.mapValue,l),this.Vt(l)):"arrayValue"in n?(this.wt(n.arrayValue,l),this.Vt(l)):fail()}Rt(n,l){this.Et(l,25),this.St(n,l)}St(n,l){l.At(n)}yt(n,l){let u=n.fields||{};for(let n of(this.Et(l,55),Object.keys(u)))this.Rt(n,l),this.It(u[n],l)}wt(n,l){let u=n.values||[];for(let n of(this.Et(l,50),u))this.It(n,l)}gt(n,l){this.Et(l,37),DocumentKey.fromName(n).path.forEach(n=>{this.Et(l,60),this.St(n,l)})}Et(n,l){n.dt(l)}Vt(n){n.dt(2)}};__PRIVATE_FirestoreIndexValueWriter.bt=new __PRIVATE_FirestoreIndexValueWriter;/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryIndexManager=class __PRIVATE_MemoryIndexManager{constructor(){this._n=new __PRIVATE_MemoryCollectionParentIndex}addToCollectionParentIndex(n,l){return this._n.add(l),PersistencePromise.resolve()}getCollectionParents(n,l){return PersistencePromise.resolve(this._n.getEntries(l))}addFieldIndex(n,l){return PersistencePromise.resolve()}deleteFieldIndex(n,l){return PersistencePromise.resolve()}deleteAllFieldIndexes(n){return PersistencePromise.resolve()}createTargetIndexes(n,l){return PersistencePromise.resolve()}getDocumentsMatchingTarget(n,l){return PersistencePromise.resolve(null)}getIndexType(n,l){return PersistencePromise.resolve(0)}getFieldIndexes(n,l){return PersistencePromise.resolve([])}getNextCollectionGroupToUpdate(n){return PersistencePromise.resolve(null)}getMinOffset(n,l){return PersistencePromise.resolve(IndexOffset.min())}getMinOffsetFromCollectionGroup(n,l){return PersistencePromise.resolve(IndexOffset.min())}updateCollectionGroup(n,l,u){return PersistencePromise.resolve()}updateIndexEntries(n,l){return PersistencePromise.resolve()}};let __PRIVATE_MemoryCollectionParentIndex=class __PRIVATE_MemoryCollectionParentIndex{constructor(){this.index={}}add(n){let l=n.lastSegment(),u=n.popLast(),d=this.index[l]||new SortedSet(ResourcePath.comparator),h=!d.has(u);return this.index[l]=d.add(u),h}has(n){let l=n.lastSegment(),u=n.popLast(),d=this.index[l];return d&&d.has(u)}getEntries(n){return(this.index[n]||new SortedSet(ResourcePath.comparator)).toArray()}};new Uint8Array(0);let LruParams=class LruParams{constructor(n,l,u){this.cacheSizeCollectionThreshold=n,this.percentileToCollect=l,this.maximumSequenceNumbersToCollect=u}static withCacheSize(n){return new LruParams(n,LruParams.DEFAULT_COLLECTION_PERCENTILE,LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */LruParams.DEFAULT_COLLECTION_PERCENTILE=10,LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,LruParams.DEFAULT=new LruParams(41943040,LruParams.DEFAULT_COLLECTION_PERCENTILE,LruParams.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),LruParams.DISABLED=new LruParams(-1,0,0);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_TargetIdGenerator=class __PRIVATE_TargetIdGenerator{constructor(n){this.On=n}next(){return this.On+=2,this.On}static Nn(){return new __PRIVATE_TargetIdGenerator(0)}static Bn(){return new __PRIVATE_TargetIdGenerator(-1)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let RemoteDocumentChangeBuffer=class RemoteDocumentChangeBuffer{constructor(){this.changes=new ObjectMap(n=>n.toString(),(n,l)=>n.isEqual(l)),this.changesApplied=!1}addEntry(n){this.assertNotApplied(),this.changes.set(n.key,n)}removeEntry(n,l){this.assertNotApplied(),this.changes.set(n,MutableDocument.newInvalidDocument(n).setReadTime(l))}getEntry(n,l){this.assertNotApplied();let u=this.changes.get(l);return void 0!==u?PersistencePromise.resolve(u):this.getFromCache(n,l)}getEntries(n,l){return this.getAllFromCache(n,l)}apply(n){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(n)}assertNotApplied(){}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let OverlayedDocument=class OverlayedDocument{constructor(n,l){this.overlayedDocument=n,this.mutatedFields=l}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let LocalDocumentsView=class LocalDocumentsView{constructor(n,l,u,d){this.remoteDocumentCache=n,this.mutationQueue=l,this.documentOverlayCache=u,this.indexManager=d}getDocument(n,l){let u=null;return this.documentOverlayCache.getOverlay(n,l).next(d=>(u=d,this.remoteDocumentCache.getEntry(n,l))).next(n=>(null!==u&&__PRIVATE_mutationApplyToLocalView(u.mutation,n,FieldMask.empty(),Timestamp.now()),n))}getDocuments(n,l){return this.remoteDocumentCache.getEntries(n,l).next(l=>this.getLocalViewOfDocuments(n,l,__PRIVATE_documentKeySet()).next(()=>l))}getLocalViewOfDocuments(n,l,u=__PRIVATE_documentKeySet()){let d=__PRIVATE_newDocumentKeyMap();return this.populateOverlays(n,d,l).next(()=>this.computeViews(n,l,d,u).next(n=>{let l=documentMap();return n.forEach((n,u)=>{l=l.insert(n,u.overlayedDocument)}),l}))}getOverlayedDocuments(n,l){let u=__PRIVATE_newDocumentKeyMap();return this.populateOverlays(n,u,l).next(()=>this.computeViews(n,l,u,__PRIVATE_documentKeySet()))}populateOverlays(n,l,u){let d=[];return u.forEach(n=>{l.has(n)||d.push(n)}),this.documentOverlayCache.getOverlays(n,d).next(n=>{n.forEach((n,u)=>{l.set(n,u)})})}computeViews(n,l,u,d){let h=tE,f=__PRIVATE_newDocumentKeyMap(),m=__PRIVATE_newDocumentKeyMap();return l.forEach((n,l)=>{let m=u.get(l.key);d.has(l.key)&&(void 0===m||m.mutation instanceof __PRIVATE_PatchMutation)?h=h.insert(l.key,l):void 0!==m?(f.set(l.key,m.mutation.getFieldMask()),__PRIVATE_mutationApplyToLocalView(m.mutation,l,m.mutation.getFieldMask(),Timestamp.now())):f.set(l.key,FieldMask.empty())}),this.recalculateAndSaveOverlays(n,h).next(n=>(n.forEach((n,l)=>f.set(n,l)),l.forEach((n,l)=>{var u;return m.set(n,new OverlayedDocument(l,null!==(u=f.get(n))&&void 0!==u?u:null))}),m))}recalculateAndSaveOverlays(n,l){let u=__PRIVATE_newDocumentKeyMap(),d=new SortedMap((n,l)=>n-l),h=__PRIVATE_documentKeySet();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(n,l).next(n=>{for(let h of n)h.keys().forEach(n=>{let f=l.get(n);if(null===f)return;let m=u.get(n)||FieldMask.empty();m=h.applyToLocalView(f,m),u.set(n,m);let g=(d.get(h.batchId)||__PRIVATE_documentKeySet()).add(n);d=d.insert(h.batchId,g)})}).next(()=>{let f=[],m=d.getReverseIterator();for(;m.hasNext();){let d=m.getNext(),g=d.key,_=d.value,j=__PRIVATE_newDocumentKeyMap();_.forEach(n=>{if(!h.has(n)){let d=__PRIVATE_calculateOverlayMutation(l.get(n),u.get(n));null!==d&&j.set(n,d),h=h.add(n)}}),f.push(this.documentOverlayCache.saveOverlays(n,g,j))}return PersistencePromise.waitFor(f)}).next(()=>u)}recalculateAndSaveOverlaysForDocumentKeys(n,l){return this.remoteDocumentCache.getEntries(n,l).next(l=>this.recalculateAndSaveOverlays(n,l))}getDocumentsMatchingQuery(n,l,u,d){return DocumentKey.isDocumentKey(l.path)&&null===l.collectionGroup&&0===l.filters.length?this.getDocumentsMatchingDocumentQuery(n,l.path):null!==l.collectionGroup?this.getDocumentsMatchingCollectionGroupQuery(n,l,u,d):this.getDocumentsMatchingCollectionQuery(n,l,u,d)}getNextDocuments(n,l,u,d){return this.remoteDocumentCache.getAllFromCollectionGroup(n,l,u,d).next(h=>{let f=d-h.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(n,l,u.largestBatchId,d-h.size):PersistencePromise.resolve(__PRIVATE_newDocumentKeyMap()),m=-1,g=h;return f.next(l=>PersistencePromise.forEach(l,(l,u)=>(m<u.largestBatchId&&(m=u.largestBatchId),h.get(l)?PersistencePromise.resolve():this.remoteDocumentCache.getEntry(n,l).next(n=>{g=g.insert(l,n)}))).next(()=>this.populateOverlays(n,l,h)).next(()=>this.computeViews(n,g,l,__PRIVATE_documentKeySet())).next(n=>({batchId:m,changes:__PRIVATE_convertOverlayedDocumentMapToDocumentMap(n)})))})}getDocumentsMatchingDocumentQuery(n,l){return this.getDocument(n,new DocumentKey(l)).next(n=>{let l=documentMap();return n.isFoundDocument()&&(l=l.insert(n.key,n)),l})}getDocumentsMatchingCollectionGroupQuery(n,l,u,d){let h=l.collectionGroup,f=documentMap();return this.indexManager.getCollectionParents(n,h).next(m=>PersistencePromise.forEach(m,m=>{var g;let _=(g=m.child(h),new __PRIVATE_QueryImpl(g,null,l.explicitOrderBy.slice(),l.filters.slice(),l.limit,l.limitType,l.startAt,l.endAt));return this.getDocumentsMatchingCollectionQuery(n,_,u,d).next(n=>{n.forEach((n,l)=>{f=f.insert(n,l)})})}).next(()=>f))}getDocumentsMatchingCollectionQuery(n,l,u,d){let h;return this.documentOverlayCache.getOverlaysForCollection(n,l.path,u.largestBatchId).next(f=>(h=f,this.remoteDocumentCache.getDocumentsMatchingQuery(n,l,u,h,d))).next(n=>{h.forEach((l,u)=>{let d=u.getKey();null===n.get(d)&&(n=n.insert(d,MutableDocument.newInvalidDocument(d)))});let u=documentMap();return n.forEach((n,d)=>{let f=h.get(n);void 0!==f&&__PRIVATE_mutationApplyToLocalView(f.mutation,d,FieldMask.empty(),Timestamp.now()),__PRIVATE_queryMatches(l,d)&&(u=u.insert(n,d))}),u})}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryBundleCache=class __PRIVATE_MemoryBundleCache{constructor(n){this.serializer=n,this.cr=new Map,this.lr=new Map}getBundleMetadata(n,l){return PersistencePromise.resolve(this.cr.get(l))}saveBundleMetadata(n,l){return this.cr.set(l.id,{id:l.id,version:l.version,createTime:__PRIVATE_fromVersion(l.createTime)}),PersistencePromise.resolve()}getNamedQuery(n,l){return PersistencePromise.resolve(this.lr.get(l))}saveNamedQuery(n,l){return this.lr.set(l.name,{name:l.name,query:function(n){let l=function(n){var l,u,d,h,f,m,g,_;let j,$=function(n){let l=__PRIVATE_fromResourceName(n);return 4===l.length?ResourcePath.emptyPath():__PRIVATE_extractLocalPathFromResourceName(l)}(n.parent),z=n.structuredQuery,ee=z.from?z.from.length:0,et=null;if(ee>0){1===ee||fail();let n=z.from[0];n.allDescendants?et=n.collectionId:$=$.child(n.collectionId)}let en=[];z.where&&(en=function(n){var l;let u=function __PRIVATE_fromFilter(n){return void 0!==n.unaryFilter?function(n){switch(n.unaryFilter.op){case"IS_NAN":let l=__PRIVATE_fromFieldPathReference(n.unaryFilter.field);return FieldFilter.create(l,"==",{doubleValue:NaN});case"IS_NULL":let u=__PRIVATE_fromFieldPathReference(n.unaryFilter.field);return FieldFilter.create(u,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let d=__PRIVATE_fromFieldPathReference(n.unaryFilter.field);return FieldFilter.create(d,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let h=__PRIVATE_fromFieldPathReference(n.unaryFilter.field);return FieldFilter.create(h,"!=",{nullValue:"NULL_VALUE"});default:return fail()}}(n):void 0!==n.fieldFilter?FieldFilter.create(__PRIVATE_fromFieldPathReference(n.fieldFilter.field),function(n){switch(n){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 fail()}}(n.fieldFilter.op),n.fieldFilter.value):void 0!==n.compositeFilter?CompositeFilter.create(n.compositeFilter.filters.map(n=>__PRIVATE_fromFilter(n)),function(n){switch(n){case"AND":return"and";case"OR":return"or";default:return fail()}}(n.compositeFilter.op)):fail()}(n);return u instanceof CompositeFilter&&__PRIVATE_compositeFilterIsFlat(l=u)&&__PRIVATE_compositeFilterIsConjunction(l)?u.getFilters():[u]}(z.where));let eo=[];z.orderBy&&(eo=z.orderBy.map(n=>new OrderBy(__PRIVATE_fromFieldPathReference(n.field),function(n){switch(n){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(n.direction))));let es=null;z.limit&&(es=__PRIVATE_isNullOrUndefined(j="object"==typeof(l=z.limit)?l.value:l)?null:j);let el=null;z.startAt&&(el=function(n){let l=!!n.before,u=n.values||[];return new Bound(u,l)}(z.startAt));let eu=null;return z.endAt&&(eu=function(n){let l=!n.before,u=n.values||[];return new Bound(u,l)}(z.endAt)),u=$,d=et,h=eo,f=en,m=es,g=el,_=eu,new __PRIVATE_QueryImpl(u,d,h,f,m,"F",g,_)}({parent:n.parent,structuredQuery:n.structuredQuery});return"LAST"===n.limitType?__PRIVATE_queryWithLimit(l,l.limit,"L"):l}(l.bundledQuery),readTime:__PRIVATE_fromVersion(l.readTime)}),PersistencePromise.resolve()}};/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryDocumentOverlayCache=class __PRIVATE_MemoryDocumentOverlayCache{constructor(){this.overlays=new SortedMap(DocumentKey.comparator),this.hr=new Map}getOverlay(n,l){return PersistencePromise.resolve(this.overlays.get(l))}getOverlays(n,l){let u=__PRIVATE_newDocumentKeyMap();return PersistencePromise.forEach(l,l=>this.getOverlay(n,l).next(n=>{null!==n&&u.set(l,n)})).next(()=>u)}saveOverlays(n,l,u){return u.forEach((u,d)=>{this.ht(n,l,d)}),PersistencePromise.resolve()}removeOverlaysForBatchId(n,l,u){let d=this.hr.get(u);return void 0!==d&&(d.forEach(n=>this.overlays=this.overlays.remove(n)),this.hr.delete(u)),PersistencePromise.resolve()}getOverlaysForCollection(n,l,u){let d=__PRIVATE_newDocumentKeyMap(),h=l.length+1,f=new DocumentKey(l.child("")),m=this.overlays.getIteratorFrom(f);for(;m.hasNext();){let n=m.getNext().value,f=n.getKey();if(!l.isPrefixOf(f.path))break;f.path.length===h&&n.largestBatchId>u&&d.set(n.getKey(),n)}return PersistencePromise.resolve(d)}getOverlaysForCollectionGroup(n,l,u,d){let h=new SortedMap((n,l)=>n-l),f=this.overlays.getIterator();for(;f.hasNext();){let n=f.getNext().value;if(n.getKey().getCollectionGroup()===l&&n.largestBatchId>u){let l=h.get(n.largestBatchId);null===l&&(l=__PRIVATE_newDocumentKeyMap(),h=h.insert(n.largestBatchId,l)),l.set(n.getKey(),n)}}let m=__PRIVATE_newDocumentKeyMap(),g=h.getIterator();for(;g.hasNext()&&(g.getNext().value.forEach((n,l)=>m.set(n,l)),!(m.size()>=d)););return PersistencePromise.resolve(m)}ht(n,l,u){let d=this.overlays.get(u.key);if(null!==d){let n=this.hr.get(d.largestBatchId).delete(u.key);this.hr.set(d.largestBatchId,n)}this.overlays=this.overlays.insert(u.key,new Overlay(l,u));let h=this.hr.get(l);void 0===h&&(h=__PRIVATE_documentKeySet(),this.hr.set(l,h)),this.hr.set(l,h.add(u.key))}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_ReferenceSet=class __PRIVATE_ReferenceSet{constructor(){this.Pr=new SortedSet(__PRIVATE_DocReference.Ir),this.Tr=new SortedSet(__PRIVATE_DocReference.Er)}isEmpty(){return this.Pr.isEmpty()}addReference(n,l){let u=new __PRIVATE_DocReference(n,l);this.Pr=this.Pr.add(u),this.Tr=this.Tr.add(u)}dr(n,l){n.forEach(n=>this.addReference(n,l))}removeReference(n,l){this.Ar(new __PRIVATE_DocReference(n,l))}Rr(n,l){n.forEach(n=>this.removeReference(n,l))}Vr(n){let l=new DocumentKey(new ResourcePath([])),u=new __PRIVATE_DocReference(l,n),d=new __PRIVATE_DocReference(l,n+1),h=[];return this.Tr.forEachInRange([u,d],n=>{this.Ar(n),h.push(n.key)}),h}mr(){this.Pr.forEach(n=>this.Ar(n))}Ar(n){this.Pr=this.Pr.delete(n),this.Tr=this.Tr.delete(n)}gr(n){let l=new DocumentKey(new ResourcePath([])),u=new __PRIVATE_DocReference(l,n),d=new __PRIVATE_DocReference(l,n+1),h=__PRIVATE_documentKeySet();return this.Tr.forEachInRange([u,d],n=>{h=h.add(n.key)}),h}containsKey(n){let l=new __PRIVATE_DocReference(n,0),u=this.Pr.firstAfterOrEqual(l);return null!==u&&n.isEqual(u.key)}};let __PRIVATE_DocReference=class __PRIVATE_DocReference{constructor(n,l){this.key=n,this.pr=l}static Ir(n,l){return DocumentKey.comparator(n.key,l.key)||__PRIVATE_primitiveComparator(n.pr,l.pr)}static Er(n,l){return __PRIVATE_primitiveComparator(n.pr,l.pr)||DocumentKey.comparator(n.key,l.key)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryMutationQueue=class __PRIVATE_MemoryMutationQueue{constructor(n,l){this.indexManager=n,this.referenceDelegate=l,this.mutationQueue=[],this.yr=1,this.wr=new SortedSet(__PRIVATE_DocReference.Ir)}checkEmpty(n){return PersistencePromise.resolve(0===this.mutationQueue.length)}addMutationBatch(n,l,u,d){let h=this.yr;this.yr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let f=new MutationBatch(h,l,u,d);for(let l of(this.mutationQueue.push(f),d))this.wr=this.wr.add(new __PRIVATE_DocReference(l.key,h)),this.indexManager.addToCollectionParentIndex(n,l.key.path.popLast());return PersistencePromise.resolve(f)}lookupMutationBatch(n,l){return PersistencePromise.resolve(this.Sr(l))}getNextMutationBatchAfterBatchId(n,l){let u=this.br(l+1),d=u<0?0:u;return PersistencePromise.resolve(this.mutationQueue.length>d?this.mutationQueue[d]:null)}getHighestUnacknowledgedBatchId(){return PersistencePromise.resolve(0===this.mutationQueue.length?-1:this.yr-1)}getAllMutationBatches(n){return PersistencePromise.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(n,l){let u=new __PRIVATE_DocReference(l,0),d=new __PRIVATE_DocReference(l,Number.POSITIVE_INFINITY),h=[];return this.wr.forEachInRange([u,d],n=>{let l=this.Sr(n.pr);h.push(l)}),PersistencePromise.resolve(h)}getAllMutationBatchesAffectingDocumentKeys(n,l){let u=new SortedSet(__PRIVATE_primitiveComparator);return l.forEach(n=>{let l=new __PRIVATE_DocReference(n,0),d=new __PRIVATE_DocReference(n,Number.POSITIVE_INFINITY);this.wr.forEachInRange([l,d],n=>{u=u.add(n.pr)})}),PersistencePromise.resolve(this.Dr(u))}getAllMutationBatchesAffectingQuery(n,l){let u=l.path,d=u.length+1,h=u;DocumentKey.isDocumentKey(h)||(h=h.child(""));let f=new __PRIVATE_DocReference(new DocumentKey(h),0),m=new SortedSet(__PRIVATE_primitiveComparator);return this.wr.forEachWhile(n=>{let l=n.key.path;return!!u.isPrefixOf(l)&&(l.length===d&&(m=m.add(n.pr)),!0)},f),PersistencePromise.resolve(this.Dr(m))}Dr(n){let l=[];return n.forEach(n=>{let u=this.Sr(n);null!==u&&l.push(u)}),l}removeMutationBatch(n,l){0===this.Cr(l.batchId,"removed")||fail(),this.mutationQueue.shift();let u=this.wr;return PersistencePromise.forEach(l.mutations,d=>{let h=new __PRIVATE_DocReference(d.key,l.batchId);return u=u.delete(h),this.referenceDelegate.markPotentiallyOrphaned(n,d.key)}).next(()=>{this.wr=u})}Mn(n){}containsKey(n,l){let u=new __PRIVATE_DocReference(l,0),d=this.wr.firstAfterOrEqual(u);return PersistencePromise.resolve(l.isEqual(d&&d.key))}performConsistencyCheck(n){return this.mutationQueue.length,PersistencePromise.resolve()}Cr(n,l){return this.br(n)}br(n){return 0===this.mutationQueue.length?0:n-this.mutationQueue[0].batchId}Sr(n){let l=this.br(n);return l<0||l>=this.mutationQueue.length?null:this.mutationQueue[l]}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryRemoteDocumentCacheImpl=class __PRIVATE_MemoryRemoteDocumentCacheImpl{constructor(n){this.vr=n,this.docs=new SortedMap(DocumentKey.comparator),this.size=0}setIndexManager(n){this.indexManager=n}addEntry(n,l){let u=l.key,d=this.docs.get(u),h=d?d.size:0,f=this.vr(l);return this.docs=this.docs.insert(u,{document:l.mutableCopy(),size:f}),this.size+=f-h,this.indexManager.addToCollectionParentIndex(n,u.path.popLast())}removeEntry(n){let l=this.docs.get(n);l&&(this.docs=this.docs.remove(n),this.size-=l.size)}getEntry(n,l){let u=this.docs.get(l);return PersistencePromise.resolve(u?u.document.mutableCopy():MutableDocument.newInvalidDocument(l))}getEntries(n,l){let u=tE;return l.forEach(n=>{let l=this.docs.get(n);u=u.insert(n,l?l.document.mutableCopy():MutableDocument.newInvalidDocument(n))}),PersistencePromise.resolve(u)}getDocumentsMatchingQuery(n,l,u,d){let h=tE,f=l.path,m=new DocumentKey(f.child("")),g=this.docs.getIteratorFrom(m);for(;g.hasNext();){let{key:n,value:{document:m}}=g.getNext();if(!f.isPrefixOf(n.path))break;n.path.length>f.length+1||0>=function(n,l){let u=n.readTime.compareTo(l.readTime);return 0!==u?u:0!==(u=DocumentKey.comparator(n.documentKey,l.documentKey))?u:__PRIVATE_primitiveComparator(n.largestBatchId,l.largestBatchId)}(new IndexOffset(m.readTime,m.key,-1),u)||(d.has(m.key)||__PRIVATE_queryMatches(l,m))&&(h=h.insert(m.key,m.mutableCopy()))}return PersistencePromise.resolve(h)}getAllFromCollectionGroup(n,l,u,d){fail()}Fr(n,l){return PersistencePromise.forEach(this.docs,n=>l(n))}newChangeBuffer(n){return new __PRIVATE_MemoryRemoteDocumentChangeBuffer(this)}getSize(n){return PersistencePromise.resolve(this.size)}};let __PRIVATE_MemoryRemoteDocumentChangeBuffer=class __PRIVATE_MemoryRemoteDocumentChangeBuffer extends RemoteDocumentChangeBuffer{constructor(n){super(),this.ar=n}applyChanges(n){let l=[];return this.changes.forEach((u,d)=>{d.isValidDocument()?l.push(this.ar.addEntry(n,d)):this.ar.removeEntry(u)}),PersistencePromise.waitFor(l)}getFromCache(n,l){return this.ar.getEntry(n,l)}getAllFromCache(n,l){return this.ar.getEntries(n,l)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryTargetCache=class __PRIVATE_MemoryTargetCache{constructor(n){this.persistence=n,this.Mr=new ObjectMap(n=>__PRIVATE_canonifyTarget(n),__PRIVATE_targetEquals),this.lastRemoteSnapshotVersion=SnapshotVersion.min(),this.highestTargetId=0,this.Or=0,this.Nr=new __PRIVATE_ReferenceSet,this.targetCount=0,this.Br=__PRIVATE_TargetIdGenerator.Nn()}forEachTarget(n,l){return this.Mr.forEach((n,u)=>l(u)),PersistencePromise.resolve()}getLastRemoteSnapshotVersion(n){return PersistencePromise.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(n){return PersistencePromise.resolve(this.Or)}allocateTargetId(n){return this.highestTargetId=this.Br.next(),PersistencePromise.resolve(this.highestTargetId)}setTargetsMetadata(n,l,u){return u&&(this.lastRemoteSnapshotVersion=u),l>this.Or&&(this.Or=l),PersistencePromise.resolve()}qn(n){this.Mr.set(n.target,n);let l=n.targetId;l>this.highestTargetId&&(this.Br=new __PRIVATE_TargetIdGenerator(l),this.highestTargetId=l),n.sequenceNumber>this.Or&&(this.Or=n.sequenceNumber)}addTargetData(n,l){return this.qn(l),this.targetCount+=1,PersistencePromise.resolve()}updateTargetData(n,l){return this.qn(l),PersistencePromise.resolve()}removeTargetData(n,l){return this.Mr.delete(l.target),this.Nr.Vr(l.targetId),this.targetCount-=1,PersistencePromise.resolve()}removeTargets(n,l,u){let d=0,h=[];return this.Mr.forEach((f,m)=>{m.sequenceNumber<=l&&null===u.get(m.targetId)&&(this.Mr.delete(f),h.push(this.removeMatchingKeysForTargetId(n,m.targetId)),d++)}),PersistencePromise.waitFor(h).next(()=>d)}getTargetCount(n){return PersistencePromise.resolve(this.targetCount)}getTargetData(n,l){let u=this.Mr.get(l)||null;return PersistencePromise.resolve(u)}addMatchingKeys(n,l,u){return this.Nr.dr(l,u),PersistencePromise.resolve()}removeMatchingKeys(n,l,u){this.Nr.Rr(l,u);let d=this.persistence.referenceDelegate,h=[];return d&&l.forEach(l=>{h.push(d.markPotentiallyOrphaned(n,l))}),PersistencePromise.waitFor(h)}removeMatchingKeysForTargetId(n,l){return this.Nr.Vr(l),PersistencePromise.resolve()}getMatchingKeysForTargetId(n,l){let u=this.Nr.gr(l);return PersistencePromise.resolve(u)}containsKey(n,l){return PersistencePromise.resolve(this.Nr.containsKey(l))}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_MemoryPersistence=class __PRIVATE_MemoryPersistence{constructor(n,l){this.Lr={},this.overlays={},this.kr=new __PRIVATE_ListenSequence(0),this.qr=!1,this.qr=!0,this.referenceDelegate=n(this),this.Qr=new __PRIVATE_MemoryTargetCache(this),this.indexManager=new __PRIVATE_MemoryIndexManager,this.remoteDocumentCache=new __PRIVATE_MemoryRemoteDocumentCacheImpl(n=>this.referenceDelegate.Kr(n)),this.serializer=new __PRIVATE_LocalSerializer(l),this.$r=new __PRIVATE_MemoryBundleCache(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.qr=!1,Promise.resolve()}get started(){return this.qr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(n){return this.indexManager}getDocumentOverlayCache(n){let l=this.overlays[n.toKey()];return l||(l=new __PRIVATE_MemoryDocumentOverlayCache,this.overlays[n.toKey()]=l),l}getMutationQueue(n,l){let u=this.Lr[n.toKey()];return u||(u=new __PRIVATE_MemoryMutationQueue(l,this.referenceDelegate),this.Lr[n.toKey()]=u),u}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.$r}runTransaction(n,l,u){__PRIVATE_logDebug("MemoryPersistence","Starting transaction:",n);let d=new __PRIVATE_MemoryTransaction(this.kr.next());return this.referenceDelegate.Ur(),u(d).next(n=>this.referenceDelegate.Wr(d).next(()=>n)).toPromise().then(n=>(d.raiseOnCommittedEvent(),n))}Gr(n,l){return PersistencePromise.or(Object.values(this.Lr).map(u=>()=>u.containsKey(n,l)))}};let __PRIVATE_MemoryTransaction=class __PRIVATE_MemoryTransaction extends PersistenceTransaction{constructor(n){super(),this.currentSequenceNumber=n}};let __PRIVATE_MemoryEagerDelegate=class __PRIVATE_MemoryEagerDelegate{constructor(n){this.persistence=n,this.zr=new __PRIVATE_ReferenceSet,this.jr=null}static Hr(n){return new __PRIVATE_MemoryEagerDelegate(n)}get Jr(){if(this.jr)return this.jr;throw fail()}addReference(n,l,u){return this.zr.addReference(u,l),this.Jr.delete(u.toString()),PersistencePromise.resolve()}removeReference(n,l,u){return this.zr.removeReference(u,l),this.Jr.add(u.toString()),PersistencePromise.resolve()}markPotentiallyOrphaned(n,l){return this.Jr.add(l.toString()),PersistencePromise.resolve()}removeTarget(n,l){this.zr.Vr(l.targetId).forEach(n=>this.Jr.add(n.toString()));let u=this.persistence.getTargetCache();return u.getMatchingKeysForTargetId(n,l.targetId).next(n=>{n.forEach(n=>this.Jr.add(n.toString()))}).next(()=>u.removeTargetData(n,l))}Ur(){this.jr=new Set}Wr(n){let l=this.persistence.getRemoteDocumentCache().newChangeBuffer();return PersistencePromise.forEach(this.Jr,u=>{let d=DocumentKey.fromPath(u);return this.Yr(n,d).next(n=>{n||l.removeEntry(d,SnapshotVersion.min())})}).next(()=>(this.jr=null,l.apply(n)))}updateLimboDocument(n,l){return this.Yr(n,l).next(n=>{n?this.Jr.delete(l.toString()):this.Jr.add(l.toString())})}Kr(n){return 0}Yr(n,l){return PersistencePromise.or([()=>PersistencePromise.resolve(this.zr.containsKey(l)),()=>this.persistence.getTargetCache().containsKey(n,l),()=>this.persistence.Gr(n,l)])}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_LocalViewChanges=class __PRIVATE_LocalViewChanges{constructor(n,l,u,d){this.targetId=n,this.fromCache=l,this.qi=u,this.Qi=d}static Ki(n,l){let u=__PRIVATE_documentKeySet(),d=__PRIVATE_documentKeySet();for(let n of l.docChanges)switch(n.type){case 0:u=u.add(n.doc.key);break;case 1:d=d.add(n.doc.key)}return new __PRIVATE_LocalViewChanges(n,l.fromCache,u,d)}};/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let QueryContext=class QueryContext{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(n){this._documentReadCount+=n}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_QueryEngine=class __PRIVATE_QueryEngine{constructor(){this.$i=!1,this.Ui=!1,this.Wi=100,this.Gi=(0,et.G6)()?8:__PRIVATE_SimpleDb.v((0,et.z$)())>0?6:4}initialize(n,l){this.zi=n,this.indexManager=l,this.$i=!0}getDocumentsMatchingQuery(n,l,u,d){let h={result:null};return this.ji(n,l).next(n=>{h.result=n}).next(()=>{if(!h.result)return this.Hi(n,l,d,u).next(n=>{h.result=n})}).next(()=>{if(h.result)return;let u=new QueryContext;return this.Ji(n,l,u).next(d=>{if(h.result=d,this.Ui)return this.Yi(n,l,u,d.size)})}).next(()=>h.result)}Yi(n,l,u,d){return u.documentReadCount<this.Wi?(__PRIVATE_getLogLevel()<=ee.in.DEBUG&&__PRIVATE_logDebug("QueryEngine","SDK will not create cache indexes for query:",__PRIVATE_stringifyQuery(l),"since it only creates cache indexes for collection contains","more than or equal to",this.Wi,"documents"),PersistencePromise.resolve()):(__PRIVATE_getLogLevel()<=ee.in.DEBUG&&__PRIVATE_logDebug("QueryEngine","Query:",__PRIVATE_stringifyQuery(l),"scans",u.documentReadCount,"local documents and returns",d,"documents as results."),u.documentReadCount>this.Gi*d?(__PRIVATE_getLogLevel()<=ee.in.DEBUG&&__PRIVATE_logDebug("QueryEngine","The SDK decides to create cache indexes for query:",__PRIVATE_stringifyQuery(l),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(n,__PRIVATE_queryToTarget(l))):PersistencePromise.resolve())}ji(n,l){if(__PRIVATE_queryMatchesAllDocuments(l))return PersistencePromise.resolve(null);let u=__PRIVATE_queryToTarget(l);return this.indexManager.getIndexType(n,u).next(d=>0===d?null:(null!==l.limit&&1===d&&(u=__PRIVATE_queryToTarget(l=__PRIVATE_queryWithLimit(l,null,"F"))),this.indexManager.getDocumentsMatchingTarget(n,u).next(d=>{let h=__PRIVATE_documentKeySet(...d);return this.zi.getDocuments(n,h).next(d=>this.indexManager.getMinOffset(n,u).next(u=>{let f=this.Zi(l,d);return this.Xi(l,f,h,u.readTime)?this.ji(n,__PRIVATE_queryWithLimit(l,null,"F")):this.es(n,f,l,u)}))})))}Hi(n,l,u,d){return __PRIVATE_queryMatchesAllDocuments(l)||d.isEqual(SnapshotVersion.min())?PersistencePromise.resolve(null):this.zi.getDocuments(n,u).next(h=>{let f=this.Zi(l,h);return this.Xi(l,f,u,d)?PersistencePromise.resolve(null):(__PRIVATE_getLogLevel()<=ee.in.DEBUG&&__PRIVATE_logDebug("QueryEngine","Re-using previous result from %s to execute query: %s",d.toString(),__PRIVATE_stringifyQuery(l)),this.es(n,f,l,function(n,l){let u=n.toTimestamp().seconds,d=n.toTimestamp().nanoseconds+1,h=SnapshotVersion.fromTimestamp(1e9===d?new Timestamp(u+1,0):new Timestamp(u,d));return new IndexOffset(h,DocumentKey.empty(),-1)}(d,0)).next(n=>n))})}Zi(n,l){let u=new SortedSet(__PRIVATE_newQueryComparator(n));return l.forEach((l,d)=>{__PRIVATE_queryMatches(n,d)&&(u=u.add(d))}),u}Xi(n,l,u,d){if(null===n.limit)return!1;if(u.size!==l.size)return!0;let h="F"===n.limitType?l.last():l.first();return!!h&&(h.hasPendingWrites||h.version.compareTo(d)>0)}Ji(n,l,u){return __PRIVATE_getLogLevel()<=ee.in.DEBUG&&__PRIVATE_logDebug("QueryEngine","Using full collection scan to execute query:",__PRIVATE_stringifyQuery(l)),this.zi.getDocumentsMatchingQuery(n,l,IndexOffset.min(),u)}es(n,l,u,d){return this.zi.getDocumentsMatchingQuery(n,u,d).next(n=>(l.forEach(l=>{n=n.insert(l.key,l)}),n))}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_LocalStoreImpl=class __PRIVATE_LocalStoreImpl{constructor(n,l,u,d){this.persistence=n,this.ts=l,this.serializer=d,this.ns=new SortedMap(__PRIVATE_primitiveComparator),this.rs=new ObjectMap(n=>__PRIVATE_canonifyTarget(n),__PRIVATE_targetEquals),this.ss=new Map,this.os=n.getRemoteDocumentCache(),this.Qr=n.getTargetCache(),this.$r=n.getBundleCache(),this._s(u)}_s(n){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(n),this.indexManager=this.persistence.getIndexManager(n),this.mutationQueue=this.persistence.getMutationQueue(n,this.indexManager),this.localDocuments=new LocalDocumentsView(this.os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.os.setIndexManager(this.indexManager),this.ts.initialize(this.localDocuments,this.indexManager)}collectGarbage(n){return this.persistence.runTransaction("Collect garbage","readwrite-primary",l=>n.collect(l,this.ns))}};async function __PRIVATE_localStoreHandleUserChange(n,l){return await n.persistence.runTransaction("Handle user change","readonly",u=>{let d;return n.mutationQueue.getAllMutationBatches(u).next(h=>(d=h,n._s(l),n.mutationQueue.getAllMutationBatches(u))).next(l=>{let h=[],f=[],m=__PRIVATE_documentKeySet();for(let n of d)for(let l of(h.push(n.batchId),n.mutations))m=m.add(l.key);for(let n of l)for(let l of(f.push(n.batchId),n.mutations))m=m.add(l.key);return n.localDocuments.getDocuments(u,m).next(n=>({us:n,removedBatchIds:h,addedBatchIds:f}))})})}function __PRIVATE_localStoreGetLastRemoteSnapshotVersion(n){return n.persistence.runTransaction("Get last remote snapshot version","readonly",l=>n.Qr.getLastRemoteSnapshotVersion(l))}async function __PRIVATE_localStoreReleaseTarget(n,l,u){let d=n.ns.get(l);try{u||await n.persistence.runTransaction("Release target",u?"readwrite":"readwrite-primary",l=>n.persistence.referenceDelegate.removeTarget(l,d))}catch(n){if(!__PRIVATE_isIndexedDbTransactionError(n))throw n;__PRIVATE_logDebug("LocalStore",`Failed to update sequence numbers for target ${l}: ${n}`)}n.ns=n.ns.remove(l),n.rs.delete(d.target)}function __PRIVATE_localStoreExecuteQuery(n,l,u){let d=SnapshotVersion.min(),h=__PRIVATE_documentKeySet();return n.persistence.runTransaction("Execute query","readwrite",f=>(function(n,l,u){let d=n.rs.get(u);return void 0!==d?PersistencePromise.resolve(n.ns.get(d)):n.Qr.getTargetData(l,u)})(n,f,__PRIVATE_queryToTarget(l)).next(l=>{if(l)return d=l.lastLimboFreeSnapshotVersion,n.Qr.getMatchingKeysForTargetId(f,l.targetId).next(n=>{h=n})}).next(()=>n.ts.getDocumentsMatchingQuery(f,l,u?d:SnapshotVersion.min(),u?h:__PRIVATE_documentKeySet())).next(u=>{var d;let f;return d=l.collectionGroup||(l.path.length%2==1?l.path.lastSegment():l.path.get(l.path.length-2)),f=n.ss.get(d)||SnapshotVersion.min(),u.forEach((n,l)=>{l.readTime.compareTo(f)>0&&(f=l.readTime)}),n.ss.set(d,f),{documents:u,hs:h}}))}let __PRIVATE_LocalClientState=class __PRIVATE_LocalClientState{constructor(){this.activeTargetIds=tI}As(n){this.activeTargetIds=this.activeTargetIds.add(n)}Rs(n){this.activeTargetIds=this.activeTargetIds.delete(n)}ds(){let n={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(n)}};let __PRIVATE_MemorySharedClientState=class __PRIVATE_MemorySharedClientState{constructor(){this.no=new __PRIVATE_LocalClientState,this.ro={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(n){}updateMutationState(n,l,u){}addLocalQueryTarget(n){return this.no.As(n),this.ro[n]||"not-current"}updateQueryState(n,l,u){this.ro[n]=l}removeLocalQueryTarget(n){this.no.Rs(n)}isLocalQueryTarget(n){return this.no.activeTargetIds.has(n)}clearQueryState(n){delete this.ro[n]}getAllActiveQueryTargets(){return this.no.activeTargetIds}isActiveQueryTarget(n){return this.no.activeTargetIds.has(n)}start(){return this.no=new __PRIVATE_LocalClientState,Promise.resolve()}handleUserChange(n,l,u){}setOnlineState(n){}shutdown(){}writeSequenceNumber(n){}notifyBundleLoaded(n){}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_NoopConnectivityMonitor=class __PRIVATE_NoopConnectivityMonitor{io(n){}shutdown(){}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_BrowserConnectivityMonitor=class __PRIVATE_BrowserConnectivityMonitor{constructor(){this.so=()=>this.oo(),this._o=()=>this.ao(),this.uo=[],this.co()}io(n){this.uo.push(n)}shutdown(){window.removeEventListener("online",this.so),window.removeEventListener("offline",this._o)}co(){window.addEventListener("online",this.so),window.addEventListener("offline",this._o)}oo(){for(let n of(__PRIVATE_logDebug("ConnectivityMonitor","Network connectivity changed: AVAILABLE"),this.uo))n(0)}ao(){for(let n of(__PRIVATE_logDebug("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE"),this.uo))n(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}};/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tC=null;function __PRIVATE_generateUniqueDebugId(){return null===tC?tC=268435456+Math.round(2147483648*Math.random()):tC++,"0x"+tC.toString(16)}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tk={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_StreamBridge=class __PRIVATE_StreamBridge{constructor(n){this.lo=n.lo,this.ho=n.ho}Po(n){this.Io=n}To(n){this.Eo=n}onMessage(n){this.Ao=n}close(){this.ho()}send(n){this.lo(n)}Ro(){this.Io()}Vo(n){this.Eo(n)}mo(n){this.Ao(n)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tx="WebChannelConnection";let __PRIVATE_WebChannelConnection=class __PRIVATE_WebChannelConnection extends class{constructor(n){this.databaseInfo=n,this.databaseId=n.databaseId;let l=n.ssl?"https":"http",u=encodeURIComponent(this.databaseId.projectId),d=encodeURIComponent(this.databaseId.database);this.fo=l+"://"+n.host,this.po=`projects/${u}/databases/${d}`,this.yo="(default)"===this.databaseId.database?`project_id=${u}`:`project_id=${u}&database_id=${d}`}get wo(){return!1}So(n,l,u,d,h){let f=__PRIVATE_generateUniqueDebugId(),m=this.bo(n,l.toUriEncodedString());__PRIVATE_logDebug("RestConnection",`Sending RPC '${n}' ${f}:`,m,u);let g={"google-cloud-resource-prefix":this.po,"x-goog-request-params":this.yo};return this.Do(g,d,h),this.Co(n,m,g,u).then(l=>(__PRIVATE_logDebug("RestConnection",`Received RPC '${n}' ${f}: `,l),l),l=>{throw __PRIVATE_logWarn("RestConnection",`RPC '${n}' ${f} failed with error: `,l,"url: ",m,"request:",u),l})}vo(n,l,u,d,h,f){return this.So(n,l,u,d,h)}Do(n,l,u){n["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+tf}(),n["Content-Type"]="text/plain",this.databaseInfo.appId&&(n["X-Firebase-GMPID"]=this.databaseInfo.appId),l&&l.headers.forEach((l,u)=>n[u]=l),u&&u.headers.forEach((l,u)=>n[u]=l)}bo(n,l){let u=tk[n];return`${this.fo}/v1/${l}:${u}`}terminate(){}}{constructor(n){super(n),this.forceLongPolling=n.forceLongPolling,this.autoDetectLongPolling=n.autoDetectLongPolling,this.useFetchStreams=n.useFetchStreams,this.longPollingOptions=n.longPollingOptions}Co(n,l,u,d){let h=__PRIVATE_generateUniqueDebugId();return new Promise((f,m)=>{let g=new tu;g.setWithCredentials(!0),g.listenOnce(to.COMPLETE,()=>{try{switch(g.getLastErrorCode()){case tn.NO_ERROR:let l=g.getResponseJson();__PRIVATE_logDebug(tx,`XHR for RPC '${n}' ${h} received:`,JSON.stringify(l)),f(l);break;case tn.TIMEOUT:__PRIVATE_logDebug(tx,`RPC '${n}' ${h} timed out`),m(new FirestoreError(tg.DEADLINE_EXCEEDED,"Request time out"));break;case tn.HTTP_ERROR:let u=g.getStatus();if(__PRIVATE_logDebug(tx,`RPC '${n}' ${h} failed with status:`,u,"response text:",g.getResponseText()),u>0){let n=g.getResponseJson();Array.isArray(n)&&(n=n[0]);let l=null==n?void 0:n.error;if(l&&l.status&&l.message){let n=function(n){let l=n.toLowerCase().replace(/_/g,"-");return Object.values(tg).indexOf(l)>=0?l:tg.UNKNOWN}(l.status);m(new FirestoreError(n,l.message))}else m(new FirestoreError(tg.UNKNOWN,"Server responded with status "+g.getStatus()))}else m(new FirestoreError(tg.UNAVAILABLE,"Connection failed."));break;default:fail()}}finally{__PRIVATE_logDebug(tx,`RPC '${n}' ${h} completed.`)}});let _=JSON.stringify(d);__PRIVATE_logDebug(tx,`RPC '${n}' ${h} sending request:`,d),g.send(l,"POST",_,u,15)})}Fo(n,l,u){let d=__PRIVATE_generateUniqueDebugId(),h=[this.fo,"/","google.firestore.v1.Firestore","/",n,"/channel"],f=te(),m=tt(),_={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},j=this.longPollingOptions.timeoutSeconds;void 0!==j&&(_.longPollingTimeout=Math.round(1e3*j)),this.useFetchStreams&&(_.useFetchStreams=!0),this.Do(_.initMessageHeaders,l,u),_.encodeInitMessageHeaders=!0;let $=h.join("");__PRIVATE_logDebug(tx,`Creating RPC '${n}' stream ${d}: ${$}`,_);let z=f.createWebChannel($,_),ee=!1,et=!1,en=new __PRIVATE_StreamBridge({lo:l=>{et?__PRIVATE_logDebug(tx,`Not sending because RPC '${n}' stream ${d} is closed:`,l):(ee||(__PRIVATE_logDebug(tx,`Opening RPC '${n}' stream ${d} transport.`),z.open(),ee=!0),__PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} sending:`,l),z.send(l))},ho:()=>z.close()}),__PRIVATE_unguardedEventListen=(n,l,u)=>{n.listen(l,n=>{try{u(n)}catch(n){setTimeout(()=>{throw n},0)}})};return __PRIVATE_unguardedEventListen(z,tl.EventType.OPEN,()=>{et||__PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} transport opened.`)}),__PRIVATE_unguardedEventListen(z,tl.EventType.CLOSE,()=>{et||(et=!0,__PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} transport closed`),en.Vo())}),__PRIVATE_unguardedEventListen(z,tl.EventType.ERROR,l=>{et||(et=!0,__PRIVATE_logWarn(tx,`RPC '${n}' stream ${d} transport errored:`,l),en.Vo(new FirestoreError(tg.UNAVAILABLE,"The operation could not be completed")))}),__PRIVATE_unguardedEventListen(z,tl.EventType.MESSAGE,l=>{var u;if(!et){let h=l.data[0];h||fail();let f=h.error||(null===(u=h[0])||void 0===u?void 0:u.error);if(f){__PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} received error:`,f);let l=f.status,u=function(n){let l=g[n];if(void 0!==l)return __PRIVATE_mapCodeFromRpcCode(l)}(l),h=f.message;void 0===u&&(u=tg.INTERNAL,h="Unknown error status: "+l+" with message "+f.message),et=!0,en.Vo(new FirestoreError(u,h)),z.close()}else __PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} received:`,h),en.mo(h)}}),__PRIVATE_unguardedEventListen(m,ts.STAT_EVENT,l=>{l.stat===ta.PROXY?__PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} detected buffering proxy`):l.stat===ta.NOPROXY&&__PRIVATE_logDebug(tx,`RPC '${n}' stream ${d} detected no buffering proxy`)}),setTimeout(()=>{en.Ro()},0),en}};function getDocument(){return"undefined"!=typeof document?document:null}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function __PRIVATE_newSerializer(n){return new JsonProtoSerializer(n,!0)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_ExponentialBackoff=class __PRIVATE_ExponentialBackoff{constructor(n,l,u=1e3,d=1.5,h=6e4){this.oi=n,this.timerId=l,this.Mo=u,this.xo=d,this.Oo=h,this.No=0,this.Bo=null,this.Lo=Date.now(),this.reset()}reset(){this.No=0}ko(){this.No=this.Oo}qo(n){this.cancel();let l=Math.floor(this.No+this.Qo()),u=Math.max(0,Date.now()-this.Lo),d=Math.max(0,l-u);d>0&&__PRIVATE_logDebug("ExponentialBackoff",`Backing off for ${d} ms (base delay: ${this.No} ms, delay with jitter: ${l} ms, last attempt: ${u} ms ago)`),this.Bo=this.oi.enqueueAfterDelay(this.timerId,d,()=>(this.Lo=Date.now(),n())),this.No*=this.xo,this.No<this.Mo&&(this.No=this.Mo),this.No>this.Oo&&(this.No=this.Oo)}Ko(){null!==this.Bo&&(this.Bo.skipDelay(),this.Bo=null)}cancel(){null!==this.Bo&&(this.Bo.cancel(),this.Bo=null)}Qo(){return(Math.random()-.5)*this.No}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_PersistentStream=class __PRIVATE_PersistentStream{constructor(n,l,u,d,h,f,m,g){this.oi=n,this.$o=u,this.Uo=d,this.connection=h,this.authCredentialsProvider=f,this.appCheckCredentialsProvider=m,this.listener=g,this.state=0,this.Wo=0,this.Go=null,this.zo=null,this.stream=null,this.jo=new __PRIVATE_ExponentialBackoff(n,l)}Ho(){return 1===this.state||5===this.state||this.Jo()}Jo(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Yo()}async stop(){this.Ho()&&await this.close(0)}Zo(){this.state=0,this.jo.reset()}Xo(){this.Jo()&&null===this.Go&&(this.Go=this.oi.enqueueAfterDelay(this.$o,6e4,()=>this.e_()))}t_(n){this.n_(),this.stream.send(n)}async e_(){if(this.Jo())return this.close(0)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}r_(){this.zo&&(this.zo.cancel(),this.zo=null)}async close(n,l){this.n_(),this.r_(),this.jo.cancel(),this.Wo++,4!==n?this.jo.reset():l&&l.code===tg.RESOURCE_EXHAUSTED?(__PRIVATE_logError(l.toString()),__PRIVATE_logError("Using maximum backoff delay to prevent overloading the backend."),this.jo.ko()):l&&l.code===tg.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.i_(),this.stream.close(),this.stream=null),this.state=n,await this.listener.To(l)}i_(){}auth(){this.state=1;let n=this.s_(this.Wo),l=this.Wo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([n,u])=>{this.Wo===l&&this.o_(n,u)},l=>{n(()=>{let n=new FirestoreError(tg.UNKNOWN,"Fetching auth token failed: "+l.message);return this.__(n)})})}o_(n,l){let u=this.s_(this.Wo);this.stream=this.a_(n,l),this.stream.Po(()=>{u(()=>(this.state=2,this.zo=this.oi.enqueueAfterDelay(this.Uo,1e4,()=>(this.Jo()&&(this.state=3),Promise.resolve())),this.listener.Po()))}),this.stream.To(n=>{u(()=>this.__(n))}),this.stream.onMessage(n=>{u(()=>this.onMessage(n))})}Yo(){this.state=5,this.jo.qo(async()=>{this.state=0,this.start()})}__(n){return __PRIVATE_logDebug("PersistentStream",`close with error: ${n}`),this.stream=null,this.close(4,n)}s_(n){return l=>{this.oi.enqueueAndForget(()=>this.Wo===n?l():(__PRIVATE_logDebug("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}};let __PRIVATE_PersistentListenStream=class __PRIVATE_PersistentListenStream extends __PRIVATE_PersistentStream{constructor(n,l,u,d,h,f){super(n,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",l,u,d,f),this.serializer=h}a_(n,l){return this.connection.Fo("Listen",n,l)}onMessage(n){this.jo.reset();let l=function(n,l){let u;if("targetChange"in l){var d,h;l.targetChange;let f="NO_CHANGE"===(d=l.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===d?1:"REMOVE"===d?2:"CURRENT"===d?3:"RESET"===d?4:fail(),m=l.targetChange.targetIds||[],g=(h=l.targetChange.resumeToken,n.useProto3Json?(void 0===h||"string"==typeof h||fail(),ByteString.fromBase64String(h||"")):(void 0===h||h instanceof Uint8Array||fail(),ByteString.fromUint8Array(h||new Uint8Array))),_=l.targetChange.cause,j=_&&function(n){let l=void 0===n.code?tg.UNKNOWN:__PRIVATE_mapCodeFromRpcCode(n.code);return new FirestoreError(l,n.message||"")}(_);u=new __PRIVATE_WatchTargetChange(f,m,g,j||null)}else if("documentChange"in l){l.documentChange;let d=l.documentChange;d.document,d.document.name,d.document.updateTime;let h=fromName(n,d.document.name),f=__PRIVATE_fromVersion(d.document.updateTime),m=d.document.createTime?__PRIVATE_fromVersion(d.document.createTime):SnapshotVersion.min(),g=new ObjectValue({mapValue:{fields:d.document.fields}}),_=MutableDocument.newFoundDocument(h,f,m,g),j=d.targetIds||[],$=d.removedTargetIds||[];u=new __PRIVATE_DocumentWatchChange(j,$,_.key,_)}else if("documentDelete"in l){l.documentDelete;let d=l.documentDelete;d.document;let h=fromName(n,d.document),f=d.readTime?__PRIVATE_fromVersion(d.readTime):SnapshotVersion.min(),m=MutableDocument.newNoDocument(h,f),g=d.removedTargetIds||[];u=new __PRIVATE_DocumentWatchChange([],g,m.key,m)}else if("documentRemove"in l){l.documentRemove;let d=l.documentRemove;d.document;let h=fromName(n,d.document),f=d.removedTargetIds||[];u=new __PRIVATE_DocumentWatchChange([],f,h,null)}else{if(!("filter"in l))return fail();{l.filter;let n=l.filter;n.targetId;let{count:d=0,unchangedNames:h}=n,f=new ExistenceFilter(d,h),m=n.targetId;u=new __PRIVATE_ExistenceFilterChange(m,f)}}return u}(this.serializer,n),u=function(n){if(!("targetChange"in n))return SnapshotVersion.min();let l=n.targetChange;return l.targetIds&&l.targetIds.length?SnapshotVersion.min():l.readTime?__PRIVATE_fromVersion(l.readTime):SnapshotVersion.min()}(n);return this.listener.u_(l,u)}c_(n){let l={};l.database=__PRIVATE_getEncodedDatabaseId(this.serializer),l.addTarget=function(n,l){let u;let d=l.target;if((u=__PRIVATE_targetIsDocumentTarget(d)?{documents:{documents:[__PRIVATE_toQueryPath(n,d.path)]}}:{query:function(n,l){var u,d;let h;let f={structuredQuery:{}},m=l.path;null!==l.collectionGroup?(h=m,f.structuredQuery.from=[{collectionId:l.collectionGroup,allDescendants:!0}]):(h=m.popLast(),f.structuredQuery.from=[{collectionId:m.lastSegment()}]),f.parent=__PRIVATE_toQueryPath(n,h);let g=function(n){if(0!==n.length)return function __PRIVATE_toFilter(n){return n instanceof FieldFilter?function(n){if("=="===n.op){if(__PRIVATE_isNanValue(n.value))return{unaryFilter:{field:__PRIVATE_toFieldPathReference(n.field),op:"IS_NAN"}};if(__PRIVATE_isNullValue(n.value))return{unaryFilter:{field:__PRIVATE_toFieldPathReference(n.field),op:"IS_NULL"}}}else if("!="===n.op){if(__PRIVATE_isNanValue(n.value))return{unaryFilter:{field:__PRIVATE_toFieldPathReference(n.field),op:"IS_NOT_NAN"}};if(__PRIVATE_isNullValue(n.value))return{unaryFilter:{field:__PRIVATE_toFieldPathReference(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:__PRIVATE_toFieldPathReference(n.field),op:tA[n.op],value:n.value}}}(n):n instanceof CompositeFilter?function(n){let l=n.getFilters().map(n=>__PRIVATE_toFilter(n));return 1===l.length?l[0]:{compositeFilter:{op:tO[n.op],filters:l}}}(n):fail()}(CompositeFilter.create(n,"and"))}(l.filters);g&&(f.structuredQuery.where=g);let _=function(n){if(0!==n.length)return n.map(n=>({field:__PRIVATE_toFieldPathReference(n.field),direction:tP[n.dir]}))}(l.orderBy);_&&(f.structuredQuery.orderBy=_);let j=__PRIVATE_toInt32Proto(n,l.limit);return null!==j&&(f.structuredQuery.limit=j),l.startAt&&(f.structuredQuery.startAt={before:(u=l.startAt).inclusive,values:u.position}),l.endAt&&(f.structuredQuery.endAt={before:!(d=l.endAt).inclusive,values:d.position}),{ut:f,parent:h}}(n,d).ut}).targetId=l.targetId,l.resumeToken.approximateByteSize()>0){u.resumeToken=__PRIVATE_toBytes(n,l.resumeToken);let d=__PRIVATE_toInt32Proto(n,l.expectedCount);null!==d&&(u.expectedCount=d)}else if(l.snapshotVersion.compareTo(SnapshotVersion.min())>0){u.readTime=toTimestamp(n,l.snapshotVersion.toTimestamp());let d=__PRIVATE_toInt32Proto(n,l.expectedCount);null!==d&&(u.expectedCount=d)}return u}(this.serializer,n);let u=function(n,l){let u=function(n){switch(n){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return fail()}}(l.purpose);return null==u?null:{"goog-listen-tags":u}}(this.serializer,n);u&&(l.labels=u),this.t_(l)}l_(n){let l={};l.database=__PRIVATE_getEncodedDatabaseId(this.serializer),l.removeTarget=n,this.t_(l)}};let __PRIVATE_PersistentWriteStream=class __PRIVATE_PersistentWriteStream extends __PRIVATE_PersistentStream{constructor(n,l,u,d,h,f){super(n,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",l,u,d,f),this.serializer=h,this.h_=!1}get P_(){return this.h_}start(){this.h_=!1,this.lastStreamToken=void 0,super.start()}i_(){this.h_&&this.I_([])}a_(n,l){return this.connection.Fo("Write",n,l)}onMessage(n){var l,u;if(n.streamToken||fail(),this.lastStreamToken=n.streamToken,this.h_){this.jo.reset();let d=(l=n.writeResults,u=n.commitTime,l&&l.length>0?(void 0!==u||fail(),l.map(n=>{let l;return(l=n.updateTime?__PRIVATE_fromVersion(n.updateTime):__PRIVATE_fromVersion(u)).isEqual(SnapshotVersion.min())&&(l=__PRIVATE_fromVersion(u)),new MutationResult(l,n.transformResults||[])})):[]),h=__PRIVATE_fromVersion(n.commitTime);return this.listener.T_(h,d)}return n.writeResults&&0!==n.writeResults.length&&fail(),this.h_=!0,this.listener.E_()}d_(){let n={};n.database=__PRIVATE_getEncodedDatabaseId(this.serializer),this.t_(n)}I_(n){let l={streamToken:this.lastStreamToken,writes:n.map(n=>toMutation(this.serializer,n))};this.t_(l)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_DatastoreImpl=class __PRIVATE_DatastoreImpl extends class{}{constructor(n,l,u,d){super(),this.authCredentials=n,this.appCheckCredentials=l,this.connection=u,this.serializer=d,this.A_=!1}R_(){if(this.A_)throw new FirestoreError(tg.FAILED_PRECONDITION,"The client has already been terminated.")}So(n,l,u,d){return this.R_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([h,f])=>this.connection.So(n,__PRIVATE_toResourcePath(l,u),d,h,f)).catch(n=>{throw"FirebaseError"===n.name?(n.code===tg.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),n):new FirestoreError(tg.UNKNOWN,n.toString())})}vo(n,l,u,d,h){return this.R_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([f,m])=>this.connection.vo(n,__PRIVATE_toResourcePath(l,u),d,f,m,h)).catch(n=>{throw"FirebaseError"===n.name?(n.code===tg.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),n):new FirestoreError(tg.UNKNOWN,n.toString())})}terminate(){this.A_=!0,this.connection.terminate()}};let __PRIVATE_OnlineStateTracker=class __PRIVATE_OnlineStateTracker{constructor(n,l){this.asyncQueue=n,this.onlineStateHandler=l,this.state="Unknown",this.m_=0,this.f_=null,this.g_=!0}p_(){0===this.m_&&(this.y_("Unknown"),this.f_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.f_=null,this.w_("Backend didn't respond within 10 seconds."),this.y_("Offline"),Promise.resolve())))}S_(n){"Online"===this.state?this.y_("Unknown"):(this.m_++,this.m_>=1&&(this.b_(),this.w_(`Connection failed 1 times. Most recent error: ${n.toString()}`),this.y_("Offline")))}set(n){this.b_(),this.m_=0,"Online"===n&&(this.g_=!1),this.y_(n)}y_(n){n!==this.state&&(this.state=n,this.onlineStateHandler(n))}w_(n){let l=`Could not reach Cloud Firestore backend. ${n}
This 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.g_?(__PRIVATE_logError(l),this.g_=!1):__PRIVATE_logDebug("OnlineStateTracker",l)}b_(){null!==this.f_&&(this.f_.cancel(),this.f_=null)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_RemoteStoreImpl=class __PRIVATE_RemoteStoreImpl{constructor(n,l,u,d,h){this.localStore=n,this.datastore=l,this.asyncQueue=u,this.remoteSyncer={},this.D_=[],this.C_=new Map,this.v_=new Set,this.F_=[],this.M_=h,this.M_.io(n=>{u.enqueueAndForget(async()=>{__PRIVATE_canUseNetwork(this)&&(__PRIVATE_logDebug("RemoteStore","Restarting streams for network reachability change."),await async function(n){n.v_.add(4),await __PRIVATE_disableNetworkInternal(n),n.x_.set("Unknown"),n.v_.delete(4),await __PRIVATE_enableNetworkInternal(n)}(this))})}),this.x_=new __PRIVATE_OnlineStateTracker(u,d)}};async function __PRIVATE_enableNetworkInternal(n){if(__PRIVATE_canUseNetwork(n))for(let l of n.F_)await l(!0)}async function __PRIVATE_disableNetworkInternal(n){for(let l of n.F_)await l(!1)}function __PRIVATE_remoteStoreListen(n,l){n.C_.has(l.targetId)||(n.C_.set(l.targetId,l),__PRIVATE_shouldStartWatchStream(n)?__PRIVATE_startWatchStream(n):__PRIVATE_ensureWatchStream(n).Jo()&&__PRIVATE_sendWatchRequest(n,l))}function __PRIVATE_remoteStoreUnlisten(n,l){let u=__PRIVATE_ensureWatchStream(n);n.C_.delete(l),u.Jo()&&__PRIVATE_sendUnwatchRequest(n,l),0===n.C_.size&&(u.Jo()?u.Xo():__PRIVATE_canUseNetwork(n)&&n.x_.set("Unknown"))}function __PRIVATE_sendWatchRequest(n,l){if(n.O_.Oe(l.targetId),l.resumeToken.approximateByteSize()>0||l.snapshotVersion.compareTo(SnapshotVersion.min())>0){let u=n.remoteSyncer.getRemoteKeysForTarget(l.targetId).size;l=l.withExpectedCount(u)}__PRIVATE_ensureWatchStream(n).c_(l)}function __PRIVATE_sendUnwatchRequest(n,l){n.O_.Oe(l),__PRIVATE_ensureWatchStream(n).l_(l)}function __PRIVATE_startWatchStream(n){n.O_=new __PRIVATE_WatchChangeAggregator({getRemoteKeysForTarget:l=>n.remoteSyncer.getRemoteKeysForTarget(l),_t:l=>n.C_.get(l)||null,nt:()=>n.datastore.serializer.databaseId}),__PRIVATE_ensureWatchStream(n).start(),n.x_.p_()}function __PRIVATE_shouldStartWatchStream(n){return __PRIVATE_canUseNetwork(n)&&!__PRIVATE_ensureWatchStream(n).Ho()&&n.C_.size>0}function __PRIVATE_canUseNetwork(n){return 0===n.v_.size}async function __PRIVATE_onWatchStreamOpen(n){n.C_.forEach((l,u)=>{__PRIVATE_sendWatchRequest(n,l)})}async function __PRIVATE_onWatchStreamClose(n,l){n.O_=void 0,__PRIVATE_shouldStartWatchStream(n)?(n.x_.S_(l),__PRIVATE_startWatchStream(n)):n.x_.set("Unknown")}async function __PRIVATE_onWatchStreamChange(n,l,u){if(n.x_.set("Online"),l instanceof __PRIVATE_WatchTargetChange&&2===l.state&&l.cause)try{await async function(n,l){let u=l.cause;for(let d of l.targetIds)n.C_.has(d)&&(await n.remoteSyncer.rejectListen(d,u),n.C_.delete(d),n.O_.removeTarget(d))}(n,l)}catch(u){__PRIVATE_logDebug("RemoteStore","Failed to remove targets %s: %s ",l.targetIds.join(","),u),await __PRIVATE_disableNetworkUntilRecovery(n,u)}else if(l instanceof __PRIVATE_DocumentWatchChange?n.O_.$e(l):l instanceof __PRIVATE_ExistenceFilterChange?n.O_.Je(l):n.O_.Ge(l),!u.isEqual(SnapshotVersion.min()))try{let l=await __PRIVATE_localStoreGetLastRemoteSnapshotVersion(n.localStore);u.compareTo(l)>=0&&await function(n,l){let u=n.O_.it(l);return u.targetChanges.forEach((u,d)=>{if(u.resumeToken.approximateByteSize()>0){let h=n.C_.get(d);h&&n.C_.set(d,h.withResumeToken(u.resumeToken,l))}}),u.targetMismatches.forEach((l,u)=>{let d=n.C_.get(l);if(!d)return;n.C_.set(l,d.withResumeToken(ByteString.EMPTY_BYTE_STRING,d.snapshotVersion)),__PRIVATE_sendUnwatchRequest(n,l);let h=new TargetData(d.target,l,u,d.sequenceNumber);__PRIVATE_sendWatchRequest(n,h)}),n.remoteSyncer.applyRemoteEvent(u)}(n,u)}catch(l){__PRIVATE_logDebug("RemoteStore","Failed to raise snapshot:",l),await __PRIVATE_disableNetworkUntilRecovery(n,l)}}async function __PRIVATE_disableNetworkUntilRecovery(n,l,u){if(!__PRIVATE_isIndexedDbTransactionError(l))throw l;n.v_.add(1),await __PRIVATE_disableNetworkInternal(n),n.x_.set("Offline"),u||(u=()=>__PRIVATE_localStoreGetLastRemoteSnapshotVersion(n.localStore)),n.asyncQueue.enqueueRetryable(async()=>{__PRIVATE_logDebug("RemoteStore","Retrying IndexedDB access"),await u(),n.v_.delete(1),await __PRIVATE_enableNetworkInternal(n)})}function __PRIVATE_executeWithRecovery(n,l){return l().catch(u=>__PRIVATE_disableNetworkUntilRecovery(n,u,l))}async function __PRIVATE_fillWritePipeline(n){let l=__PRIVATE_ensureWriteStream(n),u=n.D_.length>0?n.D_[n.D_.length-1].batchId:-1;for(;__PRIVATE_canUseNetwork(n)&&n.D_.length<10;)try{let d=await function(n,l){return n.persistence.runTransaction("Get next mutation batch","readonly",u=>(void 0===l&&(l=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(u,l)))}(n.localStore,u);if(null===d){0===n.D_.length&&l.Xo();break}u=d.batchId,function(n,l){n.D_.push(l);let u=__PRIVATE_ensureWriteStream(n);u.Jo()&&u.P_&&u.I_(l.mutations)}(n,d)}catch(l){await __PRIVATE_disableNetworkUntilRecovery(n,l)}__PRIVATE_shouldStartWriteStream(n)&&__PRIVATE_startWriteStream(n)}function __PRIVATE_shouldStartWriteStream(n){return __PRIVATE_canUseNetwork(n)&&!__PRIVATE_ensureWriteStream(n).Ho()&&n.D_.length>0}function __PRIVATE_startWriteStream(n){__PRIVATE_ensureWriteStream(n).start()}async function __PRIVATE_onWriteStreamOpen(n){__PRIVATE_ensureWriteStream(n).d_()}async function __PRIVATE_onWriteHandshakeComplete(n){let l=__PRIVATE_ensureWriteStream(n);for(let u of n.D_)l.I_(u.mutations)}async function __PRIVATE_onMutationResult(n,l,u){let d=n.D_.shift(),h=MutationBatchResult.from(d,l,u);await __PRIVATE_executeWithRecovery(n,()=>n.remoteSyncer.applySuccessfulWrite(h)),await __PRIVATE_fillWritePipeline(n)}async function __PRIVATE_onWriteStreamClose(n,l){l&&__PRIVATE_ensureWriteStream(n).P_&&await async function(n,l){var u;if(__PRIVATE_isPermanentError(u=l.code)&&u!==tg.ABORTED){let u=n.D_.shift();__PRIVATE_ensureWriteStream(n).Zo(),await __PRIVATE_executeWithRecovery(n,()=>n.remoteSyncer.rejectFailedWrite(u.batchId,l)),await __PRIVATE_fillWritePipeline(n)}}(n,l),__PRIVATE_shouldStartWriteStream(n)&&__PRIVATE_startWriteStream(n)}async function __PRIVATE_remoteStoreHandleCredentialChange(n,l){n.asyncQueue.verifyOperationInProgress(),__PRIVATE_logDebug("RemoteStore","RemoteStore received new credentials");let u=__PRIVATE_canUseNetwork(n);n.v_.add(3),await __PRIVATE_disableNetworkInternal(n),u&&n.x_.set("Unknown"),await n.remoteSyncer.handleCredentialChange(l),n.v_.delete(3),await __PRIVATE_enableNetworkInternal(n)}async function __PRIVATE_remoteStoreApplyPrimaryState(n,l){l?(n.v_.delete(2),await __PRIVATE_enableNetworkInternal(n)):l||(n.v_.add(2),await __PRIVATE_disableNetworkInternal(n),n.x_.set("Unknown"))}function __PRIVATE_ensureWatchStream(n){var l,u,d;return n.N_||(n.N_=(l=n.datastore,u=n.asyncQueue,d={Po:__PRIVATE_onWatchStreamOpen.bind(null,n),To:__PRIVATE_onWatchStreamClose.bind(null,n),u_:__PRIVATE_onWatchStreamChange.bind(null,n)},l.R_(),new __PRIVATE_PersistentListenStream(u,l.connection,l.authCredentials,l.appCheckCredentials,l.serializer,d)),n.F_.push(async l=>{l?(n.N_.Zo(),__PRIVATE_shouldStartWatchStream(n)?__PRIVATE_startWatchStream(n):n.x_.set("Unknown")):(await n.N_.stop(),n.O_=void 0)})),n.N_}function __PRIVATE_ensureWriteStream(n){var l,u,d;return n.B_||(n.B_=(l=n.datastore,u=n.asyncQueue,d={Po:__PRIVATE_onWriteStreamOpen.bind(null,n),To:__PRIVATE_onWriteStreamClose.bind(null,n),E_:__PRIVATE_onWriteHandshakeComplete.bind(null,n),T_:__PRIVATE_onMutationResult.bind(null,n)},l.R_(),new __PRIVATE_PersistentWriteStream(u,l.connection,l.authCredentials,l.appCheckCredentials,l.serializer,d)),n.F_.push(async l=>{l?(n.B_.Zo(),await __PRIVATE_fillWritePipeline(n)):(await n.B_.stop(),n.D_.length>0&&(__PRIVATE_logDebug("RemoteStore",`Stopping write stream with ${n.D_.length} pending writes`),n.D_=[]))})),n.B_}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let DelayedOperation=class DelayedOperation{constructor(n,l,u,d,h){this.asyncQueue=n,this.timerId=l,this.targetTimeMs=u,this.op=d,this.removalCallback=h,this.deferred=new __PRIVATE_Deferred,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(n=>{})}get promise(){return this.deferred.promise}static createAndSchedule(n,l,u,d,h){let f=Date.now()+u,m=new DelayedOperation(n,l,f,d,h);return m.start(u),m}start(n){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),n)}skipDelay(){return this.handleDelayElapsed()}cancel(n){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new FirestoreError(tg.CANCELLED,"Operation cancelled"+(n?": "+n:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(n=>this.deferred.resolve(n))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}};function __PRIVATE_wrapInUserErrorIfRecoverable(n,l){if(__PRIVATE_logError("AsyncQueue",`${l}: ${n}`),__PRIVATE_isIndexedDbTransactionError(n))return new FirestoreError(tg.UNAVAILABLE,`${l}: ${n}`);throw n}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let DocumentSet=class DocumentSet{constructor(n){this.comparator=n?(l,u)=>n(l,u)||DocumentKey.comparator(l.key,u.key):(n,l)=>DocumentKey.comparator(n.key,l.key),this.keyedMap=documentMap(),this.sortedSet=new SortedMap(this.comparator)}static emptySet(n){return new DocumentSet(n.comparator)}has(n){return null!=this.keyedMap.get(n)}get(n){return this.keyedMap.get(n)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(n){let l=this.keyedMap.get(n);return l?this.sortedSet.indexOf(l):-1}get size(){return this.sortedSet.size}forEach(n){this.sortedSet.inorderTraversal((l,u)=>(n(l),!1))}add(n){let l=this.delete(n.key);return l.copy(l.keyedMap.insert(n.key,n),l.sortedSet.insert(n,null))}delete(n){let l=this.get(n);return l?this.copy(this.keyedMap.remove(n),this.sortedSet.remove(l)):this}isEqual(n){if(!(n instanceof DocumentSet)||this.size!==n.size)return!1;let l=this.sortedSet.getIterator(),u=n.sortedSet.getIterator();for(;l.hasNext();){let n=l.getNext().key,d=u.getNext().key;if(!n.isEqual(d))return!1}return!0}toString(){let n=[];return this.forEach(l=>{n.push(l.toString())}),0===n.length?"DocumentSet ()":"DocumentSet (\n  "+n.join("  \n")+"\n)"}copy(n,l){let u=new DocumentSet;return u.comparator=this.comparator,u.keyedMap=n,u.sortedSet=l,u}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_DocumentChangeSet=class __PRIVATE_DocumentChangeSet{constructor(){this.L_=new SortedMap(DocumentKey.comparator)}track(n){let l=n.doc.key,u=this.L_.get(l);u?0!==n.type&&3===u.type?this.L_=this.L_.insert(l,n):3===n.type&&1!==u.type?this.L_=this.L_.insert(l,{type:u.type,doc:n.doc}):2===n.type&&2===u.type?this.L_=this.L_.insert(l,{type:2,doc:n.doc}):2===n.type&&0===u.type?this.L_=this.L_.insert(l,{type:0,doc:n.doc}):1===n.type&&0===u.type?this.L_=this.L_.remove(l):1===n.type&&2===u.type?this.L_=this.L_.insert(l,{type:1,doc:u.doc}):0===n.type&&1===u.type?this.L_=this.L_.insert(l,{type:2,doc:n.doc}):fail():this.L_=this.L_.insert(l,n)}k_(){let n=[];return this.L_.inorderTraversal((l,u)=>{n.push(u)}),n}};let ViewSnapshot=class ViewSnapshot{constructor(n,l,u,d,h,f,m,g,_){this.query=n,this.docs=l,this.oldDocs=u,this.docChanges=d,this.mutatedKeys=h,this.fromCache=f,this.syncStateChanged=m,this.excludesMetadataChanges=g,this.hasCachedResults=_}static fromInitialDocuments(n,l,u,d,h){let f=[];return l.forEach(n=>{f.push({type:0,doc:n})}),new ViewSnapshot(n,l,DocumentSet.emptySet(l),f,u,d,!0,!1,h)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(n){if(!(this.fromCache===n.fromCache&&this.hasCachedResults===n.hasCachedResults&&this.syncStateChanged===n.syncStateChanged&&this.mutatedKeys.isEqual(n.mutatedKeys)&&__PRIVATE_queryEquals(this.query,n.query)&&this.docs.isEqual(n.docs)&&this.oldDocs.isEqual(n.oldDocs)))return!1;let l=this.docChanges,u=n.docChanges;if(l.length!==u.length)return!1;for(let n=0;n<l.length;n++)if(l[n].type!==u[n].type||!l[n].doc.isEqual(u[n].doc))return!1;return!0}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_QueryListenersInfo=class __PRIVATE_QueryListenersInfo{constructor(){this.q_=void 0,this.Q_=[]}};let __PRIVATE_EventManagerImpl=class __PRIVATE_EventManagerImpl{constructor(){this.queries=new ObjectMap(n=>__PRIVATE_canonifyQuery(n),__PRIVATE_queryEquals),this.onlineState="Unknown",this.K_=new Set}};async function __PRIVATE_eventManagerListen(n,l){let u=l.query,d=!1,h=n.queries.get(u);if(h||(d=!0,h=new __PRIVATE_QueryListenersInfo),d)try{h.q_=await n.onListen(u)}catch(u){let n=__PRIVATE_wrapInUserErrorIfRecoverable(u,`Initialization of query '${__PRIVATE_stringifyQuery(l.query)}' failed`);return void l.onError(n)}n.queries.set(u,h),h.Q_.push(l),l.U_(n.onlineState),h.q_&&l.W_(h.q_)&&__PRIVATE_raiseSnapshotsInSyncEvent(n)}async function __PRIVATE_eventManagerUnlisten(n,l){let u=l.query,d=!1,h=n.queries.get(u);if(h){let n=h.Q_.indexOf(l);n>=0&&(h.Q_.splice(n,1),d=0===h.Q_.length)}if(d)return n.queries.delete(u),n.onUnlisten(u)}function __PRIVATE_eventManagerOnWatchChange(n,l){let u=!1;for(let d of l){let l=d.query,h=n.queries.get(l);if(h){for(let n of h.Q_)n.W_(d)&&(u=!0);h.q_=d}}u&&__PRIVATE_raiseSnapshotsInSyncEvent(n)}function __PRIVATE_eventManagerOnWatchError(n,l,u){let d=n.queries.get(l);if(d)for(let n of d.Q_)n.onError(u);n.queries.delete(l)}function __PRIVATE_raiseSnapshotsInSyncEvent(n){n.K_.forEach(n=>{n.next()})}let __PRIVATE_QueryListener=class __PRIVATE_QueryListener{constructor(n,l,u){this.query=n,this.G_=l,this.z_=!1,this.j_=null,this.onlineState="Unknown",this.options=u||{}}W_(n){if(!this.options.includeMetadataChanges){let l=[];for(let u of n.docChanges)3!==u.type&&l.push(u);n=new ViewSnapshot(n.query,n.docs,n.oldDocs,l,n.mutatedKeys,n.fromCache,n.syncStateChanged,!0,n.hasCachedResults)}let l=!1;return this.z_?this.H_(n)&&(this.G_.next(n),l=!0):this.J_(n,this.onlineState)&&(this.Y_(n),l=!0),this.j_=n,l}onError(n){this.G_.error(n)}U_(n){this.onlineState=n;let l=!1;return this.j_&&!this.z_&&this.J_(this.j_,n)&&(this.Y_(this.j_),l=!0),l}J_(n,l){return!n.fromCache||(!this.options.Z_||!("Offline"!==l))&&(!n.docs.isEmpty()||n.hasCachedResults||"Offline"===l)}H_(n){if(n.docChanges.length>0)return!0;let l=this.j_&&this.j_.hasPendingWrites!==n.hasPendingWrites;return!(!n.syncStateChanged&&!l)&&!0===this.options.includeMetadataChanges}Y_(n){n=ViewSnapshot.fromInitialDocuments(n.query,n.docs,n.mutatedKeys,n.fromCache,n.hasCachedResults),this.z_=!0,this.G_.next(n)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_AddedLimboDocument=class __PRIVATE_AddedLimboDocument{constructor(n){this.key=n}};let __PRIVATE_RemovedLimboDocument=class __PRIVATE_RemovedLimboDocument{constructor(n){this.key=n}};let __PRIVATE_View=class __PRIVATE_View{constructor(n,l){this.query=n,this.oa=l,this._a=null,this.hasCachedResults=!1,this.current=!1,this.aa=__PRIVATE_documentKeySet(),this.mutatedKeys=__PRIVATE_documentKeySet(),this.ua=__PRIVATE_newQueryComparator(n),this.ca=new DocumentSet(this.ua)}get la(){return this.oa}ha(n,l){let u=l?l.Pa:new __PRIVATE_DocumentChangeSet,d=l?l.ca:this.ca,h=l?l.mutatedKeys:this.mutatedKeys,f=d,m=!1,g="F"===this.query.limitType&&d.size===this.query.limit?d.last():null,_="L"===this.query.limitType&&d.size===this.query.limit?d.first():null;if(n.inorderTraversal((n,l)=>{let j=d.get(n),$=__PRIVATE_queryMatches(this.query,l)?l:null,z=!!j&&this.mutatedKeys.has(j.key),ee=!!$&&($.hasLocalMutations||this.mutatedKeys.has($.key)&&$.hasCommittedMutations),et=!1;j&&$?j.data.isEqual($.data)?z!==ee&&(u.track({type:3,doc:$}),et=!0):this.Ia(j,$)||(u.track({type:2,doc:$}),et=!0,(g&&this.ua($,g)>0||_&&0>this.ua($,_))&&(m=!0)):!j&&$?(u.track({type:0,doc:$}),et=!0):j&&!$&&(u.track({type:1,doc:j}),et=!0,(g||_)&&(m=!0)),et&&($?(f=f.add($),h=ee?h.add(n):h.delete(n)):(f=f.delete(n),h=h.delete(n)))}),null!==this.query.limit)for(;f.size>this.query.limit;){let n="F"===this.query.limitType?f.last():f.first();f=f.delete(n.key),h=h.delete(n.key),u.track({type:1,doc:n})}return{ca:f,Pa:u,Xi:m,mutatedKeys:h}}Ia(n,l){return n.hasLocalMutations&&l.hasCommittedMutations&&!l.hasLocalMutations}applyChanges(n,l,u,d){let h=this.ca;this.ca=n.ca,this.mutatedKeys=n.mutatedKeys;let f=n.Pa.k_();f.sort((n,l)=>(function(n,l){let order=n=>{switch(n){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return fail()}};return order(n)-order(l)})(n.type,l.type)||this.ua(n.doc,l.doc)),this.Ta(u),d=null!=d&&d;let m=l&&!d?this.Ea():[],g=0===this.aa.size&&this.current&&!d?1:0,_=g!==this._a;return(this._a=g,0!==f.length||_)?{snapshot:new ViewSnapshot(this.query,n.ca,h,f,n.mutatedKeys,0===g,_,!1,!!u&&u.resumeToken.approximateByteSize()>0),da:m}:{da:m}}U_(n){return this.current&&"Offline"===n?(this.current=!1,this.applyChanges({ca:this.ca,Pa:new __PRIVATE_DocumentChangeSet,mutatedKeys:this.mutatedKeys,Xi:!1},!1)):{da:[]}}Aa(n){return!this.oa.has(n)&&!!this.ca.has(n)&&!this.ca.get(n).hasLocalMutations}Ta(n){n&&(n.addedDocuments.forEach(n=>this.oa=this.oa.add(n)),n.modifiedDocuments.forEach(n=>{}),n.removedDocuments.forEach(n=>this.oa=this.oa.delete(n)),this.current=n.current)}Ea(){if(!this.current)return[];let n=this.aa;this.aa=__PRIVATE_documentKeySet(),this.ca.forEach(n=>{this.Aa(n.key)&&(this.aa=this.aa.add(n.key))});let l=[];return n.forEach(n=>{this.aa.has(n)||l.push(new __PRIVATE_RemovedLimboDocument(n))}),this.aa.forEach(u=>{n.has(u)||l.push(new __PRIVATE_AddedLimboDocument(u))}),l}Ra(n){this.oa=n.hs,this.aa=__PRIVATE_documentKeySet();let l=this.ha(n.documents);return this.applyChanges(l,!0)}Va(){return ViewSnapshot.fromInitialDocuments(this.query,this.ca,this.mutatedKeys,0===this._a,this.hasCachedResults)}};let __PRIVATE_QueryView=class __PRIVATE_QueryView{constructor(n,l,u){this.query=n,this.targetId=l,this.view=u}};let LimboResolution=class LimboResolution{constructor(n){this.key=n,this.ma=!1}};let __PRIVATE_SyncEngineImpl=class __PRIVATE_SyncEngineImpl{constructor(n,l,u,d,h,f){this.localStore=n,this.remoteStore=l,this.eventManager=u,this.sharedClientState=d,this.currentUser=h,this.maxConcurrentLimboResolutions=f,this.fa={},this.ga=new ObjectMap(n=>__PRIVATE_canonifyQuery(n),__PRIVATE_queryEquals),this.pa=new Map,this.ya=new Set,this.wa=new SortedMap(DocumentKey.comparator),this.Sa=new Map,this.ba=new __PRIVATE_ReferenceSet,this.Da={},this.Ca=new Map,this.va=__PRIVATE_TargetIdGenerator.Bn(),this.onlineState="Unknown",this.Fa=void 0}get isPrimaryClient(){return!0===this.Fa}};async function __PRIVATE_syncEngineListen(n,l){var u,d;let h,f;let m=(n.remoteStore.remoteSyncer.applyRemoteEvent=__PRIVATE_syncEngineApplyRemoteEvent.bind(null,n),n.remoteStore.remoteSyncer.getRemoteKeysForTarget=__PRIVATE_syncEngineGetRemoteKeysForTarget.bind(null,n),n.remoteStore.remoteSyncer.rejectListen=__PRIVATE_syncEngineRejectListen.bind(null,n),n.fa.u_=__PRIVATE_eventManagerOnWatchChange.bind(null,n.eventManager),n.fa.xa=__PRIVATE_eventManagerOnWatchError.bind(null,n.eventManager),n),g=m.ga.get(l);if(g)h=g.targetId,m.sharedClientState.addLocalQueryTarget(h),f=g.view.Va();else{let n=await (u=m.localStore,d=__PRIVATE_queryToTarget(l),u.persistence.runTransaction("Allocate target","readwrite",n=>{let l;return u.Qr.getTargetData(n,d).next(h=>h?(l=h,PersistencePromise.resolve(l)):u.Qr.allocateTargetId(n).next(h=>(l=new TargetData(d,h,"TargetPurposeListen",n.currentSequenceNumber),u.Qr.addTargetData(n,l).next(()=>l))))}).then(n=>{let l=u.ns.get(n.targetId);return(null===l||n.snapshotVersion.compareTo(l.snapshotVersion)>0)&&(u.ns=u.ns.insert(n.targetId,n),u.rs.set(d,n.targetId)),n})),g=m.sharedClientState.addLocalQueryTarget(n.targetId);h=n.targetId,f=await __PRIVATE_initializeViewAndComputeSnapshot(m,l,h,"current"===g,n.resumeToken),m.isPrimaryClient&&__PRIVATE_remoteStoreListen(m.remoteStore,n)}return f}async function __PRIVATE_initializeViewAndComputeSnapshot(n,l,u,d,h){n.Ma=(l,u,d)=>(async function(n,l,u,d){let h=l.view.ha(u);h.Xi&&(h=await __PRIVATE_localStoreExecuteQuery(n.localStore,l.query,!1).then(({documents:n})=>l.view.ha(n,h)));let f=d&&d.targetChanges.get(l.targetId),m=d&&null!=d.targetMismatches.get(l.targetId),g=l.view.applyChanges(h,n.isPrimaryClient,f,m);return __PRIVATE_updateTrackedLimbos(n,l.targetId,g.da),g.snapshot})(n,l,u,d);let f=await __PRIVATE_localStoreExecuteQuery(n.localStore,l,!0),m=new __PRIVATE_View(l,f.hs),g=m.ha(f.documents),_=TargetChange.createSynthesizedTargetChangeForCurrentChange(u,d&&"Offline"!==n.onlineState,h),j=m.applyChanges(g,n.isPrimaryClient,_);__PRIVATE_updateTrackedLimbos(n,u,j.da);let $=new __PRIVATE_QueryView(l,u,m);return n.ga.set(l,$),n.pa.has(u)?n.pa.get(u).push(l):n.pa.set(u,[l]),j.snapshot}async function __PRIVATE_syncEngineUnlisten(n,l){let u=n.ga.get(l),d=n.pa.get(u.targetId);if(d.length>1)return n.pa.set(u.targetId,d.filter(n=>!__PRIVATE_queryEquals(n,l))),void n.ga.delete(l);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(u.targetId),n.sharedClientState.isActiveQueryTarget(u.targetId)||await __PRIVATE_localStoreReleaseTarget(n.localStore,u.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(u.targetId),__PRIVATE_remoteStoreUnlisten(n.remoteStore,u.targetId),__PRIVATE_removeAndCleanupTarget(n,u.targetId)}).catch(__PRIVATE_ignoreIfPrimaryLeaseLoss)):(__PRIVATE_removeAndCleanupTarget(n,u.targetId),await __PRIVATE_localStoreReleaseTarget(n.localStore,u.targetId,!0))}async function __PRIVATE_syncEngineWrite(n,l,u){var d;let h=(n.remoteStore.remoteSyncer.applySuccessfulWrite=__PRIVATE_syncEngineApplySuccessfulWrite.bind(null,n),n.remoteStore.remoteSyncer.rejectFailedWrite=__PRIVATE_syncEngineRejectFailedWrite.bind(null,n),n);try{let n;let f=await function(n,l){let u,d;let h=Timestamp.now(),f=l.reduce((n,l)=>n.add(l.key),__PRIVATE_documentKeySet());return n.persistence.runTransaction("Locally write mutations","readwrite",m=>{let g=tE,_=__PRIVATE_documentKeySet();return n.os.getEntries(m,f).next(n=>{(g=n).forEach((n,l)=>{l.isValidDocument()||(_=_.add(n))})}).next(()=>n.localDocuments.getOverlayedDocuments(m,g)).next(d=>{u=d;let f=[];for(let n of l){let l=function(n,l){let u=null;for(let d of n.fieldTransforms){let n=l.data.field(d.field),h=__PRIVATE_computeTransformOperationBaseValue(d.transform,n||null);null!=h&&(null===u&&(u=ObjectValue.empty()),u.set(d.field,h))}return u||null}(n,u.get(n.key).overlayedDocument);null!=l&&f.push(new __PRIVATE_PatchMutation(n.key,l,function __PRIVATE_extractFieldMask(n){let l=[];return forEach(n.fields,(n,u)=>{let d=new FieldPath$1([n]);if(__PRIVATE_isMapValue(u)){let n=__PRIVATE_extractFieldMask(u.mapValue).fields;if(0===n.length)l.push(d);else for(let u of n)l.push(d.child(u))}else l.push(d)}),new FieldMask(l)}(l.value.mapValue),Precondition.exists(!0)))}return n.mutationQueue.addMutationBatch(m,h,f,l)}).next(l=>{d=l;let h=l.applyToLocalDocumentSet(u,_);return n.documentOverlayCache.saveOverlays(m,l.batchId,h)})}).then(()=>({batchId:d.batchId,changes:__PRIVATE_convertOverlayedDocumentMapToDocumentMap(u)}))}(h.localStore,l);h.sharedClientState.addPendingMutation(f.batchId),d=f.batchId,(n=h.Da[h.currentUser.toKey()])||(n=new SortedMap(__PRIVATE_primitiveComparator)),n=n.insert(d,u),h.Da[h.currentUser.toKey()]=n,await __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(h,f.changes),await __PRIVATE_fillWritePipeline(h.remoteStore)}catch(l){let n=__PRIVATE_wrapInUserErrorIfRecoverable(l,"Failed to persist write");u.reject(n)}}async function __PRIVATE_syncEngineApplyRemoteEvent(n,l){try{let u=await function(n,l){let u=l.snapshotVersion,d=n.ns;return n.persistence.runTransaction("Apply remote event","readwrite-primary",h=>{var f;let m,g;let _=n.os.newChangeBuffer({trackRemovals:!0});d=n.ns;let j=[];l.targetChanges.forEach((f,m)=>{var g;let _=d.get(m);if(!_)return;j.push(n.Qr.removeMatchingKeys(h,f.removedDocuments,m).next(()=>n.Qr.addMatchingKeys(h,f.addedDocuments,m)));let $=_.withSequenceNumber(h.currentSequenceNumber);null!==l.targetMismatches.get(m)?$=$.withResumeToken(ByteString.EMPTY_BYTE_STRING,SnapshotVersion.min()).withLastLimboFreeSnapshotVersion(SnapshotVersion.min()):f.resumeToken.approximateByteSize()>0&&($=$.withResumeToken(f.resumeToken,u)),d=d.insert(m,$),g=$,(0===_.resumeToken.approximateByteSize()||g.snapshotVersion.toMicroseconds()-_.snapshotVersion.toMicroseconds()>=3e8||f.addedDocuments.size+f.modifiedDocuments.size+f.removedDocuments.size>0)&&j.push(n.Qr.updateTargetData(h,$))});let $=tE,z=__PRIVATE_documentKeySet();if(l.documentUpdates.forEach(u=>{l.resolvedLimboDocuments.has(u)&&j.push(n.persistence.referenceDelegate.updateLimboDocument(h,u))}),j.push((f=l.documentUpdates,m=__PRIVATE_documentKeySet(),g=__PRIVATE_documentKeySet(),f.forEach(n=>m=m.add(n)),_.getEntries(h,m).next(n=>{let l=tE;return f.forEach((u,d)=>{let h=n.get(u);d.isFoundDocument()!==h.isFoundDocument()&&(g=g.add(u)),d.isNoDocument()&&d.version.isEqual(SnapshotVersion.min())?(_.removeEntry(u,d.readTime),l=l.insert(u,d)):!h.isValidDocument()||d.version.compareTo(h.version)>0||0===d.version.compareTo(h.version)&&h.hasPendingWrites?(_.addEntry(d),l=l.insert(u,d)):__PRIVATE_logDebug("LocalStore","Ignoring outdated watch update for ",u,". Current version:",h.version," Watch version:",d.version)}),{cs:l,ls:g}})).next(n=>{$=n.cs,z=n.ls})),!u.isEqual(SnapshotVersion.min())){let l=n.Qr.getLastRemoteSnapshotVersion(h).next(l=>n.Qr.setTargetsMetadata(h,h.currentSequenceNumber,u));j.push(l)}return PersistencePromise.waitFor(j).next(()=>_.apply(h)).next(()=>n.localDocuments.getLocalViewOfDocuments(h,$,z)).next(()=>$)}).then(l=>(n.ns=d,l))}(n.localStore,l);l.targetChanges.forEach((l,u)=>{let d=n.Sa.get(u);d&&(l.addedDocuments.size+l.modifiedDocuments.size+l.removedDocuments.size<=1||fail(),l.addedDocuments.size>0?d.ma=!0:l.modifiedDocuments.size>0?d.ma||fail():l.removedDocuments.size>0&&(d.ma||fail(),d.ma=!1))}),await __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(n,u,l)}catch(n){await __PRIVATE_ignoreIfPrimaryLeaseLoss(n)}}function __PRIVATE_syncEngineApplyOnlineStateChange(n,l,u){var d;if(n.isPrimaryClient&&0===u||!n.isPrimaryClient&&1===u){let u;let h=[];n.ga.forEach((n,u)=>{let d=u.view.U_(l);d.snapshot&&h.push(d.snapshot)}),(d=n.eventManager).onlineState=l,u=!1,d.queries.forEach((n,d)=>{for(let n of d.Q_)n.U_(l)&&(u=!0)}),u&&__PRIVATE_raiseSnapshotsInSyncEvent(d),h.length&&n.fa.u_(h),n.onlineState=l,n.isPrimaryClient&&n.sharedClientState.setOnlineState(l)}}async function __PRIVATE_syncEngineRejectListen(n,l,u){n.sharedClientState.updateQueryState(l,"rejected",u);let d=n.Sa.get(l),h=d&&d.key;if(h){let u=new SortedMap(DocumentKey.comparator);u=u.insert(h,MutableDocument.newNoDocument(h,SnapshotVersion.min()));let d=__PRIVATE_documentKeySet().add(h),f=new RemoteEvent(SnapshotVersion.min(),new Map,new SortedMap(__PRIVATE_primitiveComparator),u,d);await __PRIVATE_syncEngineApplyRemoteEvent(n,f),n.wa=n.wa.remove(h),n.Sa.delete(l),__PRIVATE_pumpEnqueuedLimboResolutions(n)}else await __PRIVATE_localStoreReleaseTarget(n.localStore,l,!1).then(()=>__PRIVATE_removeAndCleanupTarget(n,l,u)).catch(__PRIVATE_ignoreIfPrimaryLeaseLoss)}async function __PRIVATE_syncEngineApplySuccessfulWrite(n,l){var u;let d=l.batch.batchId;try{let h=await (u=n.localStore).persistence.runTransaction("Acknowledge batch","readwrite-primary",n=>{let d=l.batch.keys(),h=u.os.newChangeBuffer({trackRemovals:!0});return(function(n,l,u,d){let h=u.batch,f=h.keys(),m=PersistencePromise.resolve();return f.forEach(n=>{m=m.next(()=>d.getEntry(l,n)).next(l=>{let f=u.docVersions.get(n);null!==f||fail(),0>l.version.compareTo(f)&&(h.applyToRemoteDocument(l,u),l.isValidDocument()&&(l.setReadTime(u.commitVersion),d.addEntry(l)))})}),m.next(()=>n.mutationQueue.removeMutationBatch(l,h))})(u,n,l,h).next(()=>h.apply(n)).next(()=>u.mutationQueue.performConsistencyCheck(n)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(n,d,l.batch.batchId)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,function(n){let l=__PRIVATE_documentKeySet();for(let u=0;u<n.mutationResults.length;++u)n.mutationResults[u].transformResults.length>0&&(l=l.add(n.batch.mutations[u].key));return l}(l))).next(()=>u.localDocuments.getDocuments(n,d))});__PRIVATE_processUserCallback(n,d,null),__PRIVATE_triggerPendingWritesCallbacks(n,d),n.sharedClientState.updateMutationState(d,"acknowledged"),await __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(n,h)}catch(n){await __PRIVATE_ignoreIfPrimaryLeaseLoss(n)}}async function __PRIVATE_syncEngineRejectFailedWrite(n,l,u){var d;try{let h=await (d=n.localStore).persistence.runTransaction("Reject batch","readwrite-primary",n=>{let u;return d.mutationQueue.lookupMutationBatch(n,l).next(l=>(null!==l||fail(),u=l.keys(),d.mutationQueue.removeMutationBatch(n,l))).next(()=>d.mutationQueue.performConsistencyCheck(n)).next(()=>d.documentOverlayCache.removeOverlaysForBatchId(n,u,l)).next(()=>d.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,u)).next(()=>d.localDocuments.getDocuments(n,u))});__PRIVATE_processUserCallback(n,l,u),__PRIVATE_triggerPendingWritesCallbacks(n,l),n.sharedClientState.updateMutationState(l,"rejected",u),await __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(n,h)}catch(n){await __PRIVATE_ignoreIfPrimaryLeaseLoss(n)}}function __PRIVATE_triggerPendingWritesCallbacks(n,l){(n.Ca.get(l)||[]).forEach(n=>{n.resolve()}),n.Ca.delete(l)}function __PRIVATE_processUserCallback(n,l,u){let d=n.Da[n.currentUser.toKey()];if(d){let h=d.get(l);h&&(u?h.reject(u):h.resolve(),d=d.remove(l)),n.Da[n.currentUser.toKey()]=d}}function __PRIVATE_removeAndCleanupTarget(n,l,u=null){for(let d of(n.sharedClientState.removeLocalQueryTarget(l),n.pa.get(l)))n.ga.delete(d),u&&n.fa.xa(d,u);n.pa.delete(l),n.isPrimaryClient&&n.ba.Vr(l).forEach(l=>{n.ba.containsKey(l)||__PRIVATE_removeLimboTarget(n,l)})}function __PRIVATE_removeLimboTarget(n,l){n.ya.delete(l.path.canonicalString());let u=n.wa.get(l);null!==u&&(__PRIVATE_remoteStoreUnlisten(n.remoteStore,u),n.wa=n.wa.remove(l),n.Sa.delete(u),__PRIVATE_pumpEnqueuedLimboResolutions(n))}function __PRIVATE_updateTrackedLimbos(n,l,u){for(let d of u)d instanceof __PRIVATE_AddedLimboDocument?(n.ba.addReference(d.key,l),function(n,l){let u=l.key,d=u.path.canonicalString();n.wa.get(u)||n.ya.has(d)||(__PRIVATE_logDebug("SyncEngine","New document in limbo: "+u),n.ya.add(d),__PRIVATE_pumpEnqueuedLimboResolutions(n))}(n,d)):d instanceof __PRIVATE_RemovedLimboDocument?(__PRIVATE_logDebug("SyncEngine","Document no longer in limbo: "+d.key),n.ba.removeReference(d.key,l),n.ba.containsKey(d.key)||__PRIVATE_removeLimboTarget(n,d.key)):fail()}function __PRIVATE_pumpEnqueuedLimboResolutions(n){for(;n.ya.size>0&&n.wa.size<n.maxConcurrentLimboResolutions;){let l=n.ya.values().next().value;n.ya.delete(l);let u=new DocumentKey(ResourcePath.fromString(l)),d=n.va.next();n.Sa.set(d,new LimboResolution(u)),n.wa=n.wa.insert(u,d),__PRIVATE_remoteStoreListen(n.remoteStore,new TargetData(__PRIVATE_queryToTarget(__PRIVATE_newQueryForPath(u.path)),d,"TargetPurposeLimboResolution",__PRIVATE_ListenSequence._e))}}async function __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(n,l,u){let d=[],h=[],f=[];n.ga.isEmpty()||(n.ga.forEach((m,g)=>{f.push(n.Ma(g,l,u).then(l=>{if((l||u)&&n.isPrimaryClient&&n.sharedClientState.updateQueryState(g.targetId,(null==l?void 0:l.fromCache)?"not-current":"current"),l){d.push(l);let n=__PRIVATE_LocalViewChanges.Ki(g.targetId,l);h.push(n)}}))}),await Promise.all(f),n.fa.u_(d),await async function(n,l){try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",u=>PersistencePromise.forEach(l,l=>PersistencePromise.forEach(l.qi,d=>n.persistence.referenceDelegate.addReference(u,l.targetId,d)).next(()=>PersistencePromise.forEach(l.Qi,d=>n.persistence.referenceDelegate.removeReference(u,l.targetId,d)))))}catch(n){if(!__PRIVATE_isIndexedDbTransactionError(n))throw n;__PRIVATE_logDebug("LocalStore","Failed to update sequence numbers: "+n)}for(let u of l){let l=u.targetId;if(!u.fromCache){let u=n.ns.get(l),d=u.snapshotVersion,h=u.withLastLimboFreeSnapshotVersion(d);n.ns=n.ns.insert(l,h)}}}(n.localStore,h))}async function __PRIVATE_syncEngineHandleCredentialChange(n,l){if(!n.currentUser.isEqual(l)){__PRIVATE_logDebug("SyncEngine","User change. New user:",l.toKey());let u=await __PRIVATE_localStoreHandleUserChange(n.localStore,l);n.currentUser=l,n.Ca.forEach(n=>{n.forEach(n=>{n.reject(new FirestoreError(tg.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),n.Ca.clear(),n.sharedClientState.handleUserChange(l,u.removedBatchIds,u.addedBatchIds),await __PRIVATE_syncEngineEmitNewSnapsAndNotifyLocalStore(n,u.us)}}function __PRIVATE_syncEngineGetRemoteKeysForTarget(n,l){let u=n.Sa.get(l);if(u&&u.ma)return __PRIVATE_documentKeySet().add(u.key);{let u=__PRIVATE_documentKeySet(),d=n.pa.get(l);if(!d)return u;for(let l of d){let d=n.ga.get(l);u=u.unionWith(d.view.la)}return u}}let MemoryOfflineComponentProvider=class MemoryOfflineComponentProvider{constructor(){this.synchronizeTabs=!1}async initialize(n){this.serializer=__PRIVATE_newSerializer(n.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(n),this.persistence=this.createPersistence(n),await this.persistence.start(),this.localStore=this.createLocalStore(n),this.gcScheduler=this.createGarbageCollectionScheduler(n,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(n,this.localStore)}createGarbageCollectionScheduler(n,l){return null}createIndexBackfillerScheduler(n,l){return null}createLocalStore(n){var l,u,d,h;return l=this.persistence,u=new __PRIVATE_QueryEngine,d=n.initialUser,h=this.serializer,new __PRIVATE_LocalStoreImpl(l,u,d,h)}createPersistence(n){return new __PRIVATE_MemoryPersistence(__PRIVATE_MemoryEagerDelegate.Hr,this.serializer)}createSharedClientState(n){return new __PRIVATE_MemorySharedClientState}async terminate(){var n,l;null===(n=this.gcScheduler)||void 0===n||n.stop(),null===(l=this.indexBackfillerScheduler)||void 0===l||l.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}};let OnlineComponentProvider=class OnlineComponentProvider{async initialize(n,l){this.localStore||(this.localStore=n.localStore,this.sharedClientState=n.sharedClientState,this.datastore=this.createDatastore(l),this.remoteStore=this.createRemoteStore(l),this.eventManager=this.createEventManager(l),this.syncEngine=this.createSyncEngine(l,!n.synchronizeTabs),this.sharedClientState.onlineStateHandler=n=>__PRIVATE_syncEngineApplyOnlineStateChange(this.syncEngine,n,1),this.remoteStore.remoteSyncer.handleCredentialChange=__PRIVATE_syncEngineHandleCredentialChange.bind(null,this.syncEngine),await __PRIVATE_remoteStoreApplyPrimaryState(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(n){return new __PRIVATE_EventManagerImpl}createDatastore(n){var l,u,d;let h=__PRIVATE_newSerializer(n.databaseInfo.databaseId),f=(l=n.databaseInfo,new __PRIVATE_WebChannelConnection(l));return u=n.authCredentials,d=n.appCheckCredentials,new __PRIVATE_DatastoreImpl(u,d,f,h)}createRemoteStore(n){var l,u,d,h;return l=this.localStore,u=this.datastore,d=n.asyncQueue,h=__PRIVATE_BrowserConnectivityMonitor.D()?new __PRIVATE_BrowserConnectivityMonitor:new __PRIVATE_NoopConnectivityMonitor,new __PRIVATE_RemoteStoreImpl(l,u,d,n=>__PRIVATE_syncEngineApplyOnlineStateChange(this.syncEngine,n,0),h)}createSyncEngine(n,l){return function(n,l,u,d,h,f,m){let g=new __PRIVATE_SyncEngineImpl(n,l,u,d,h,f);return m&&(g.Fa=!0),g}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,n.initialUser,n.maxConcurrentLimboResolutions,l)}async terminate(){var n;await async function(n){__PRIVATE_logDebug("RemoteStore","RemoteStore shutting down."),n.v_.add(5),await __PRIVATE_disableNetworkInternal(n),n.M_.shutdown(),n.x_.set("Unknown")}(this.remoteStore),null===(n=this.datastore)||void 0===n||n.terminate()}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_AsyncObserver=class __PRIVATE_AsyncObserver{constructor(n){this.observer=n,this.muted=!1}next(n){this.observer.next&&this.Ba(this.observer.next,n)}error(n){this.observer.error?this.Ba(this.observer.error,n):__PRIVATE_logError("Uncaught Error in snapshot listener:",n.toString())}La(){this.muted=!0}Ba(n,l){this.muted||setTimeout(()=>{this.muted||n(l)},0)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Transaction$2=class Transaction$2{constructor(n){this.datastore=n,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}async lookup(n){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw this.lastTransactionError=new FirestoreError(tg.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;let l=await async function(n,l){let u={documents:l.map(l=>__PRIVATE_toName(n.serializer,l))},d=await n.vo("BatchGetDocuments",n.serializer.databaseId,ResourcePath.emptyPath(),u,l.length),h=new Map;d.forEach(l=>{var u;let d=(u=n.serializer,"found"in l?function(n,l){l.found||fail(),l.found.name,l.found.updateTime;let u=fromName(n,l.found.name),d=__PRIVATE_fromVersion(l.found.updateTime),h=l.found.createTime?__PRIVATE_fromVersion(l.found.createTime):SnapshotVersion.min(),f=new ObjectValue({mapValue:{fields:l.found.fields}});return MutableDocument.newFoundDocument(u,d,h,f)}(u,l):"missing"in l?function(n,l){l.missing||fail(),l.readTime||fail();let u=fromName(n,l.missing),d=__PRIVATE_fromVersion(l.readTime);return MutableDocument.newNoDocument(u,d)}(u,l):fail());h.set(d.key.toString(),d)});let f=[];return l.forEach(n=>{let l=h.get(n.toString());l||fail(),f.push(l)}),f}(this.datastore,n);return l.forEach(n=>this.recordVersion(n)),l}set(n,l){this.write(l.toMutation(n,this.precondition(n))),this.writtenDocs.add(n.toString())}update(n,l){try{this.write(l.toMutation(n,this.preconditionForUpdate(n)))}catch(n){this.lastTransactionError=n}this.writtenDocs.add(n.toString())}delete(n){this.write(new __PRIVATE_DeleteMutation(n,this.precondition(n))),this.writtenDocs.add(n.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;let n=this.readVersions;this.mutations.forEach(l=>{n.delete(l.key.toString())}),n.forEach((n,l)=>{let u=DocumentKey.fromPath(l);this.mutations.push(new __PRIVATE_VerifyMutation(u,this.precondition(u)))}),await async function(n,l){let u={writes:l.map(l=>toMutation(n.serializer,l))};await n.So("Commit",n.serializer.databaseId,ResourcePath.emptyPath(),u)}(this.datastore,this.mutations),this.committed=!0}recordVersion(n){let l;if(n.isFoundDocument())l=n.version;else{if(!n.isNoDocument())throw fail();l=SnapshotVersion.min()}let u=this.readVersions.get(n.key.toString());if(u){if(!l.isEqual(u))throw new FirestoreError(tg.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(n.key.toString(),l)}precondition(n){let l=this.readVersions.get(n.toString());return!this.writtenDocs.has(n.toString())&&l?l.isEqual(SnapshotVersion.min())?Precondition.exists(!1):Precondition.updateTime(l):Precondition.none()}preconditionForUpdate(n){let l=this.readVersions.get(n.toString());if(!this.writtenDocs.has(n.toString())&&l){if(l.isEqual(SnapshotVersion.min()))throw new FirestoreError(tg.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Precondition.updateTime(l)}return Precondition.exists(!0)}write(n){this.ensureCommitNotCalled(),this.mutations.push(n)}ensureCommitNotCalled(){}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_TransactionRunner=class __PRIVATE_TransactionRunner{constructor(n,l,u,d,h){this.asyncQueue=n,this.datastore=l,this.options=u,this.updateFunction=d,this.deferred=h,this.za=u.maxAttempts,this.jo=new __PRIVATE_ExponentialBackoff(this.asyncQueue,"transaction_retry")}ja(){this.za-=1,this.Ha()}Ha(){this.jo.qo(async()=>{let n=new Transaction$2(this.datastore),l=this.Ja(n);l&&l.then(l=>{this.asyncQueue.enqueueAndForget(()=>n.commit().then(()=>{this.deferred.resolve(l)}).catch(n=>{this.Ya(n)}))}).catch(n=>{this.Ya(n)})})}Ja(n){try{let l=this.updateFunction(n);return!__PRIVATE_isNullOrUndefined(l)&&l.catch&&l.then?l:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(n){return this.deferred.reject(n),null}}Ya(n){this.za>0&&this.Za(n)?(this.za-=1,this.asyncQueue.enqueueAndForget(()=>(this.Ha(),Promise.resolve()))):this.deferred.reject(n)}Za(n){if("FirebaseError"===n.name){let l=n.code;return"aborted"===l||"failed-precondition"===l||"already-exists"===l||!__PRIVATE_isPermanentError(l)}return!1}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FirestoreClient=class FirestoreClient{constructor(n,l,u,d){this.authCredentials=n,this.appCheckCredentials=l,this.asyncQueue=u,this.databaseInfo=d,this.user=User.UNAUTHENTICATED,this.clientId=__PRIVATE_AutoId.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(u,async n=>{__PRIVATE_logDebug("FirestoreClient","Received user=",n.uid),await this.authCredentialListener(n),this.user=n}),this.appCheckCredentials.start(u,n=>(__PRIVATE_logDebug("FirestoreClient","Received new app check token=",n),this.appCheckCredentialListener(n,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(n){this.authCredentialListener=n}setAppCheckTokenChangeListener(n){this.appCheckCredentialListener=n}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new FirestoreError(tg.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();let n=new __PRIVATE_Deferred;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),n.resolve()}catch(u){let l=__PRIVATE_wrapInUserErrorIfRecoverable(u,"Failed to shutdown persistence");n.reject(l)}}),n.promise}};async function __PRIVATE_setOfflineComponentProvider(n,l){n.asyncQueue.verifyOperationInProgress(),__PRIVATE_logDebug("FirestoreClient","Initializing OfflineComponentProvider");let u=n.configuration;await l.initialize(u);let d=u.initialUser;n.setCredentialChangeListener(async n=>{d.isEqual(n)||(await __PRIVATE_localStoreHandleUserChange(l.localStore,n),d=n)}),l.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=l}async function __PRIVATE_setOnlineComponentProvider(n,l){n.asyncQueue.verifyOperationInProgress();let u=await __PRIVATE_ensureOfflineComponents(n);__PRIVATE_logDebug("FirestoreClient","Initializing OnlineComponentProvider"),await l.initialize(u,n.configuration),n.setCredentialChangeListener(n=>__PRIVATE_remoteStoreHandleCredentialChange(l.remoteStore,n)),n.setAppCheckTokenChangeListener((n,u)=>__PRIVATE_remoteStoreHandleCredentialChange(l.remoteStore,u)),n._onlineComponents=l}async function __PRIVATE_ensureOfflineComponents(n){if(!n._offlineComponents){if(n._uninitializedComponentsProvider){__PRIVATE_logDebug("FirestoreClient","Using user provided OfflineComponentProvider");try{await __PRIVATE_setOfflineComponentProvider(n,n._uninitializedComponentsProvider._offline)}catch(l){if(!("FirebaseError"===l.name?l.code===tg.FAILED_PRECONDITION||l.code===tg.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&l instanceof DOMException)||22===l.code||20===l.code||11===l.code))throw l;__PRIVATE_logWarn("Error using user provided cache. Falling back to memory cache: "+l),await __PRIVATE_setOfflineComponentProvider(n,new MemoryOfflineComponentProvider)}}else __PRIVATE_logDebug("FirestoreClient","Using default OfflineComponentProvider"),await __PRIVATE_setOfflineComponentProvider(n,new MemoryOfflineComponentProvider)}return n._offlineComponents}async function __PRIVATE_ensureOnlineComponents(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(__PRIVATE_logDebug("FirestoreClient","Using user provided OnlineComponentProvider"),await __PRIVATE_setOnlineComponentProvider(n,n._uninitializedComponentsProvider._online)):(__PRIVATE_logDebug("FirestoreClient","Using default OnlineComponentProvider"),await __PRIVATE_setOnlineComponentProvider(n,new OnlineComponentProvider))),n._onlineComponents}async function __PRIVATE_getEventManager(n){let l=await __PRIVATE_ensureOnlineComponents(n),u=l.eventManager;return u.onListen=__PRIVATE_syncEngineListen.bind(null,l.syncEngine),u.onUnlisten=__PRIVATE_syncEngineUnlisten.bind(null,l.syncEngine),u}/**
 * @license
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function __PRIVATE_cloneLongPollingOptions(n){let l={};return void 0!==n.timeoutSeconds&&(l.timeoutSeconds=n.timeoutSeconds),l}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tM=new Map;function __PRIVATE_validateDocumentPath(n){if(!DocumentKey.isDocumentKey(n))throw new FirestoreError(tg.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function __PRIVATE_valueDescription(n){if(void 0===n)return"undefined";if(null===n)return"null";if("string"==typeof n)return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if("number"==typeof n||"boolean"==typeof n)return""+n;if("object"==typeof n){if(n instanceof Array)return"an array";{var l;let u=(l=n).constructor?l.constructor.name:null;return u?`a custom ${u} object`:"an object"}}return"function"==typeof n?"a function":fail()}function __PRIVATE_cast(n,l){if("_delegate"in n&&(n=n._delegate),!(n instanceof l)){if(l.name===n.constructor.name)throw new FirestoreError(tg.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let u=__PRIVATE_valueDescription(n);throw new FirestoreError(tg.INVALID_ARGUMENT,`Expected type '${l.name}', but it was: ${u}`)}}return n}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FirestoreSettingsImpl=class FirestoreSettingsImpl{constructor(n){var l,u;if(void 0===n.host){if(void 0!==n.ssl)throw new FirestoreError(tg.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=n.host,this.ssl=null===(l=n.ssl)||void 0===l||l;if(this.credentials=n.credentials,this.ignoreUndefinedProperties=!!n.ignoreUndefinedProperties,this.localCache=n.localCache,void 0===n.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==n.cacheSizeBytes&&n.cacheSizeBytes<1048576)throw new FirestoreError(tg.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=n.cacheSizeBytes}(function(n,l,u,d){if(!0===l&&!0===d)throw new FirestoreError(tg.INVALID_ARGUMENT,`${n} and ${u} cannot be used together.`)})("experimentalForceLongPolling",n.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",n.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!n.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===n.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!n.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=__PRIVATE_cloneLongPollingOptions(null!==(u=n.experimentalLongPollingOptions)&&void 0!==u?u:{}),function(n){if(void 0!==n.timeoutSeconds){if(isNaN(n.timeoutSeconds))throw new FirestoreError(tg.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (must not be NaN)`);if(n.timeoutSeconds<5)throw new FirestoreError(tg.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (minimum allowed value is 5)`);if(n.timeoutSeconds>30)throw new FirestoreError(tg.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!n.useFetchStreams}isEqual(n){var l,u;return this.host===n.host&&this.ssl===n.ssl&&this.credentials===n.credentials&&this.cacheSizeBytes===n.cacheSizeBytes&&this.experimentalForceLongPolling===n.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===n.experimentalAutoDetectLongPolling&&(l=this.experimentalLongPollingOptions,u=n.experimentalLongPollingOptions,l.timeoutSeconds===u.timeoutSeconds)&&this.ignoreUndefinedProperties===n.ignoreUndefinedProperties&&this.useFetchStreams===n.useFetchStreams}};let Firestore$1=class Firestore$1{constructor(n,l,u,d){this._authCredentials=n,this._appCheckCredentials=l,this._databaseId=u,this._app=d,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new FirestoreSettingsImpl({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new FirestoreError(tg.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(n){if(this._settingsFrozen)throw new FirestoreError(tg.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 FirestoreSettingsImpl(n),void 0!==n.credentials&&(this._authCredentials=function(n){if(!n)return new __PRIVATE_EmptyAuthCredentialsProvider;switch(n.type){case"firstParty":return new __PRIVATE_FirstPartyAuthCredentialsProvider(n.sessionIndex||"0",n.iamToken||null,n.authTokenFactory||null);case"provider":return n.client;default:throw new FirestoreError(tg.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(n.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(n){let l=tM.get(n);l&&(__PRIVATE_logDebug("ComponentProvider","Removing Datastore"),tM.delete(n),l.terminate())}(this),Promise.resolve()}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Query=class Query{constructor(n,l,u){this.converter=l,this._query=u,this.type="query",this.firestore=n}withConverter(n){return new Query(this.firestore,n,this._query)}};let DocumentReference=class DocumentReference{constructor(n,l,u){this.converter=l,this._key=u,this.type="document",this.firestore=n}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new CollectionReference(this.firestore,this.converter,this._key.path.popLast())}withConverter(n){return new DocumentReference(this.firestore,n,this._key)}};let CollectionReference=class CollectionReference extends Query{constructor(n,l,u){super(n,l,__PRIVATE_newQueryForPath(u)),this._path=u,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let n=this._path.popLast();return n.isEmpty()?null:new DocumentReference(this.firestore,null,new DocumentKey(n))}withConverter(n){return new CollectionReference(this.firestore,n,this._path)}};function doc(n,l,...u){if(n=(0,et.m9)(n),1==arguments.length&&(l=__PRIVATE_AutoId.newId()),/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n,l,u){if(!u)throw new FirestoreError(tg.INVALID_ARGUMENT,`Function doc() cannot be called with an empty ${l}.`)}(0,"path",l),n instanceof Firestore$1){let d=ResourcePath.fromString(l,...u);return __PRIVATE_validateDocumentPath(d),new DocumentReference(n,null,new DocumentKey(d))}{if(!(n instanceof DocumentReference||n instanceof CollectionReference))throw new FirestoreError(tg.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let d=n._path.child(ResourcePath.fromString(l,...u));return __PRIVATE_validateDocumentPath(d),new DocumentReference(n.firestore,n instanceof CollectionReference?n.converter:null,new DocumentKey(d))}}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let __PRIVATE_AsyncQueueImpl=class __PRIVATE_AsyncQueueImpl{constructor(){this.Xa=Promise.resolve(),this.eu=[],this.tu=!1,this.nu=[],this.ru=null,this.iu=!1,this.su=!1,this.ou=[],this.jo=new __PRIVATE_ExponentialBackoff(this,"async_queue_retry"),this._u=()=>{let n=getDocument();n&&__PRIVATE_logDebug("AsyncQueue","Visibility state changed to "+n.visibilityState),this.jo.Ko()};let n=getDocument();n&&"function"==typeof n.addEventListener&&n.addEventListener("visibilitychange",this._u)}get isShuttingDown(){return this.tu}enqueueAndForget(n){this.enqueue(n)}enqueueAndForgetEvenWhileRestricted(n){this.au(),this.uu(n)}enterRestrictedMode(n){if(!this.tu){this.tu=!0,this.su=n||!1;let l=getDocument();l&&"function"==typeof l.removeEventListener&&l.removeEventListener("visibilitychange",this._u)}}enqueue(n){if(this.au(),this.tu)return new Promise(()=>{});let l=new __PRIVATE_Deferred;return this.uu(()=>this.tu&&this.su?Promise.resolve():(n().then(l.resolve,l.reject),l.promise)).then(()=>l.promise)}enqueueRetryable(n){this.enqueueAndForget(()=>(this.eu.push(n),this.cu()))}async cu(){if(0!==this.eu.length){try{await this.eu[0](),this.eu.shift(),this.jo.reset()}catch(n){if(!__PRIVATE_isIndexedDbTransactionError(n))throw n;__PRIVATE_logDebug("AsyncQueue","Operation failed with retryable error: "+n)}this.eu.length>0&&this.jo.qo(()=>this.cu())}}uu(n){let l=this.Xa.then(()=>(this.iu=!0,n().catch(n=>{let l;this.ru=n,this.iu=!1;let u=(l=n.message||"",n.stack&&(l=n.stack.includes(n.message)?n.stack:n.message+"\n"+n.stack),l);throw __PRIVATE_logError("INTERNAL UNHANDLED ERROR: ",u),n}).then(n=>(this.iu=!1,n))));return this.Xa=l,l}enqueueAfterDelay(n,l,u){this.au(),this.ou.indexOf(n)>-1&&(l=0);let d=DelayedOperation.createAndSchedule(this,n,l,u,n=>this.lu(n));return this.nu.push(d),d}au(){this.ru&&fail()}verifyOperationInProgress(){}async hu(){let n;do n=this.Xa,await n;while(n!==this.Xa)}Pu(n){for(let l of this.nu)if(l.timerId===n)return!0;return!1}Iu(n){return this.hu().then(()=>{for(let l of(this.nu.sort((n,l)=>n.targetTimeMs-l.targetTimeMs),this.nu))if(l.skipDelay(),"all"!==n&&l.timerId===n)break;return this.hu()})}Tu(n){this.ou.push(n)}lu(n){let l=this.nu.indexOf(n);this.nu.splice(l,1)}};function __PRIVATE_isPartialObserver(n){return function(n,l){if("object"!=typeof n||null===n)return!1;for(let u of l)if(u in n&&"function"==typeof n[u])return!0;return!1}(n,["next","error","complete"])}let Firestore=class Firestore extends Firestore$1{constructor(n,l,u,d){super(n,l,u,d),this.type="firestore",this._queue=new __PRIVATE_AsyncQueueImpl,this._persistenceKey=(null==d?void 0:d.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||__PRIVATE_configureFirestore(this),this._firestoreClient.terminate()}};function getFirestore(n,l){let u="object"==typeof n?n:(0,$.Mq)(),d=(0,$.qX)(u,"firestore").getImmediate({identifier:"string"==typeof n?n:l||"(default)"});if(!d._initialized){let n=(0,et.P0)("firestore");n&&function(n,l,u,d={}){var h;let f=(n=__PRIVATE_cast(n,Firestore$1))._getSettings(),m=`${l}:${u}`;if("firestore.googleapis.com"!==f.host&&f.host!==m&&__PRIVATE_logWarn("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),n._setSettings(Object.assign(Object.assign({},f),{host:m,ssl:!1})),d.mockUserToken){let l,u;if("string"==typeof d.mockUserToken)l=d.mockUserToken,u=User.MOCK_USER;else{l=(0,et.Sg)(d.mockUserToken,null===(h=n._app)||void 0===h?void 0:h.options.projectId);let f=d.mockUserToken.sub||d.mockUserToken.user_id;if(!f)throw new FirestoreError(tg.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");u=new User(f)}n._authCredentials=new __PRIVATE_EmulatorAuthCredentialsProvider(new __PRIVATE_OAuthToken(l,u))}}(d,...n)}return d}function ensureFirestoreConfigured(n){return n._firestoreClient||__PRIVATE_configureFirestore(n),n._firestoreClient.verifyNotTerminated(),n._firestoreClient}function __PRIVATE_configureFirestore(n){var l,u,d,h,f,m;let g=n._freezeSettings(),_=(h=n._databaseId,f=(null===(l=n._app)||void 0===l?void 0:l.options.appId)||"",m=n._persistenceKey,new DatabaseInfo(h,f,m,g.host,g.ssl,g.experimentalForceLongPolling,g.experimentalAutoDetectLongPolling,__PRIVATE_cloneLongPollingOptions(g.experimentalLongPollingOptions),g.useFetchStreams));n._firestoreClient=new FirestoreClient(n._authCredentials,n._appCheckCredentials,n._queue,_),(null===(u=g.localCache)||void 0===u?void 0:u._offlineComponentProvider)&&(null===(d=g.localCache)||void 0===d?void 0:d._onlineComponentProvider)&&(n._firestoreClient._uninitializedComponentsProvider={_offlineKind:g.localCache.kind,_offline:g.localCache._offlineComponentProvider,_online:g.localCache._onlineComponentProvider})}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Bytes=class Bytes{constructor(n){this._byteString=n}static fromBase64String(n){try{return new Bytes(ByteString.fromBase64String(n))}catch(n){throw new FirestoreError(tg.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(n){return new Bytes(ByteString.fromUint8Array(n))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(n){return this._byteString.isEqual(n._byteString)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FieldPath=class FieldPath{constructor(...n){for(let l=0;l<n.length;++l)if(0===n[l].length)throw new FirestoreError(tg.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new FieldPath$1(n)}isEqual(n){return this._internalPath.isEqual(n._internalPath)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FieldValue=class FieldValue{constructor(n){this._methodName=n}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let GeoPoint=class GeoPoint{constructor(n,l){if(!isFinite(n)||n<-90||n>90)throw new FirestoreError(tg.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+n);if(!isFinite(l)||l<-180||l>180)throw new FirestoreError(tg.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+l);this._lat=n,this._long=l}get latitude(){return this._lat}get longitude(){return this._long}isEqual(n){return this._lat===n._lat&&this._long===n._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(n){return __PRIVATE_primitiveComparator(this._lat,n._lat)||__PRIVATE_primitiveComparator(this._long,n._long)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tD=/^__.*__$/;let ParsedSetData=class ParsedSetData{constructor(n,l,u){this.data=n,this.fieldMask=l,this.fieldTransforms=u}toMutation(n,l){return null!==this.fieldMask?new __PRIVATE_PatchMutation(n,this.data,this.fieldMask,l,this.fieldTransforms):new __PRIVATE_SetMutation(n,this.data,l,this.fieldTransforms)}};let ParsedUpdateData=class ParsedUpdateData{constructor(n,l,u){this.data=n,this.fieldMask=l,this.fieldTransforms=u}toMutation(n,l){return new __PRIVATE_PatchMutation(n,this.data,this.fieldMask,l,this.fieldTransforms)}};function __PRIVATE_isWrite(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw fail()}}let __PRIVATE_ParseContextImpl=class __PRIVATE_ParseContextImpl{constructor(n,l,u,d,h,f){this.settings=n,this.databaseId=l,this.serializer=u,this.ignoreUndefinedProperties=d,void 0===h&&this.Eu(),this.fieldTransforms=h||[],this.fieldMask=f||[]}get path(){return this.settings.path}get du(){return this.settings.du}Au(n){return new __PRIVATE_ParseContextImpl(Object.assign(Object.assign({},this.settings),n),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Ru(n){var l;let u=null===(l=this.path)||void 0===l?void 0:l.child(n),d=this.Au({path:u,Vu:!1});return d.mu(n),d}fu(n){var l;let u=null===(l=this.path)||void 0===l?void 0:l.child(n),d=this.Au({path:u,Vu:!1});return d.Eu(),d}gu(n){return this.Au({path:void 0,Vu:!0})}pu(n){return __PRIVATE_createError(n,this.settings.methodName,this.settings.yu||!1,this.path,this.settings.wu)}contains(n){return void 0!==this.fieldMask.find(l=>n.isPrefixOf(l))||void 0!==this.fieldTransforms.find(l=>n.isPrefixOf(l.field))}Eu(){if(this.path)for(let n=0;n<this.path.length;n++)this.mu(this.path.get(n))}mu(n){if(0===n.length)throw this.pu("Document fields must not be empty");if(__PRIVATE_isWrite(this.du)&&tD.test(n))throw this.pu('Document fields cannot begin and end with "__"')}};let __PRIVATE_UserDataReader=class __PRIVATE_UserDataReader{constructor(n,l,u){this.databaseId=n,this.ignoreUndefinedProperties=l,this.serializer=u||__PRIVATE_newSerializer(n)}Su(n,l,u,d=!1){return new __PRIVATE_ParseContextImpl({du:n,methodName:l,wu:u,path:FieldPath$1.emptyPath(),Vu:!1,yu:d},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}};function __PRIVATE_newUserDataReader(n){let l=n._freezeSettings(),u=__PRIVATE_newSerializer(n._databaseId);return new __PRIVATE_UserDataReader(n._databaseId,!!l.ignoreUndefinedProperties,u)}function __PRIVATE_parseSetData(n,l,u,d,h,f={}){let m,g;let _=n.Su(f.merge||f.mergeFields?2:0,l,u,h);__PRIVATE_validatePlainObject("Data must be an object, but it was:",_,d);let j=__PRIVATE_parseObject(d,_);if(f.merge)m=new FieldMask(_.fieldMask),g=_.fieldTransforms;else if(f.mergeFields){let n=[];for(let d of f.mergeFields){let h=__PRIVATE_fieldPathFromArgument$1(l,d,u);if(!_.contains(h))throw new FirestoreError(tg.INVALID_ARGUMENT,`Field '${h}' is specified in your field mask but missing from your input data.`);__PRIVATE_fieldMaskContains(n,h)||n.push(h)}m=new FieldMask(n),g=_.fieldTransforms.filter(n=>m.covers(n.field))}else m=null,g=_.fieldTransforms;return new ParsedSetData(new ObjectValue(j),m,g)}let __PRIVATE_DeleteFieldValueImpl=class __PRIVATE_DeleteFieldValueImpl extends FieldValue{_toFieldTransform(n){if(2!==n.du)throw 1===n.du?n.pu(`${this._methodName}() can only appear at the top level of your update data`):n.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return n.fieldMask.push(n.path),null}isEqual(n){return n instanceof __PRIVATE_DeleteFieldValueImpl}};let __PRIVATE_ArrayUnionFieldValueImpl=class __PRIVATE_ArrayUnionFieldValueImpl extends FieldValue{constructor(n,l){super(n),this.bu=l}_toFieldTransform(n){let l=new __PRIVATE_ParseContextImpl({du:3,wu:n.settings.wu,methodName:this._methodName,Vu:!0},n.databaseId,n.serializer,n.ignoreUndefinedProperties),u=this.bu.map(n=>__PRIVATE_parseData(n,l)),d=new __PRIVATE_ArrayUnionTransformOperation(u);return new FieldTransform(n.path,d)}isEqual(n){return n instanceof __PRIVATE_ArrayUnionFieldValueImpl&&(0,et.vZ)(this.bu,n.bu)}};function __PRIVATE_parseUpdateData(n,l,u,d){let h=n.Su(1,l,u);__PRIVATE_validatePlainObject("Data must be an object, but it was:",h,d);let f=[],m=ObjectValue.empty();forEach(d,(n,d)=>{let g=__PRIVATE_fieldPathFromDotSeparatedString(l,n,u);d=(0,et.m9)(d);let _=h.fu(g);if(d instanceof __PRIVATE_DeleteFieldValueImpl)f.push(g);else{let n=__PRIVATE_parseData(d,_);null!=n&&(f.push(g),m.set(g,n))}});let g=new FieldMask(f);return new ParsedUpdateData(m,g,h.fieldTransforms)}function __PRIVATE_parseUpdateVarargs(n,l,u,d,h,f){let m=n.Su(1,l,u),g=[__PRIVATE_fieldPathFromArgument$1(l,d,u)],_=[h];if(f.length%2!=0)throw new FirestoreError(tg.INVALID_ARGUMENT,`Function ${l}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let n=0;n<f.length;n+=2)g.push(__PRIVATE_fieldPathFromArgument$1(l,f[n])),_.push(f[n+1]);let j=[],$=ObjectValue.empty();for(let n=g.length-1;n>=0;--n)if(!__PRIVATE_fieldMaskContains(j,g[n])){let l=g[n],u=_[n];u=(0,et.m9)(u);let d=m.fu(l);if(u instanceof __PRIVATE_DeleteFieldValueImpl)j.push(l);else{let n=__PRIVATE_parseData(u,d);null!=n&&(j.push(l),$.set(l,n))}}let z=new FieldMask(j);return new ParsedUpdateData($,z,m.fieldTransforms)}function __PRIVATE_parseData(n,l){if(__PRIVATE_looksLikeJsonObject(n=(0,et.m9)(n)))return __PRIVATE_validatePlainObject("Unsupported field value:",l,n),__PRIVATE_parseObject(n,l);if(n instanceof FieldValue)return function(n,l){if(!__PRIVATE_isWrite(l.du))throw l.pu(`${n._methodName}() can only be used with update() and set()`);if(!l.path)throw l.pu(`${n._methodName}() is not currently supported inside arrays`);let u=n._toFieldTransform(l);u&&l.fieldTransforms.push(u)}(n,l),null;if(void 0===n&&l.ignoreUndefinedProperties)return null;if(l.path&&l.fieldMask.push(l.path),n instanceof Array){if(l.settings.Vu&&4!==l.du)throw l.pu("Nested arrays are not supported");return function(n,l){let u=[],d=0;for(let h of n){let n=__PRIVATE_parseData(h,l.gu(d));null==n&&(n={nullValue:"NULL_VALUE"}),u.push(n),d++}return{arrayValue:{values:u}}}(n,l)}return function(n,l){if(null===(n=(0,et.m9)(n)))return{nullValue:"NULL_VALUE"};if("number"==typeof n){var u,d,h;return u=l.serializer,"number"==typeof(h=d=n)&&Number.isInteger(h)&&!__PRIVATE_isNegativeZero(h)&&h<=Number.MAX_SAFE_INTEGER&&h>=Number.MIN_SAFE_INTEGER?__PRIVATE_toInteger(d):__PRIVATE_toDouble(u,d)}if("boolean"==typeof n)return{booleanValue:n};if("string"==typeof n)return{stringValue:n};if(n instanceof Date){let u=Timestamp.fromDate(n);return{timestampValue:toTimestamp(l.serializer,u)}}if(n instanceof Timestamp){let u=new Timestamp(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:toTimestamp(l.serializer,u)}}if(n instanceof GeoPoint)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof Bytes)return{bytesValue:__PRIVATE_toBytes(l.serializer,n._byteString)};if(n instanceof DocumentReference){let u=l.databaseId,d=n.firestore._databaseId;if(!d.isEqual(u))throw l.pu(`Document reference is for database ${d.projectId}/${d.database} but should be for database ${u.projectId}/${u.database}`);return{referenceValue:__PRIVATE_toResourceName(n.firestore._databaseId||l.databaseId,n._key.path)}}throw l.pu(`Unsupported field value: ${__PRIVATE_valueDescription(n)}`)}(n,l)}function __PRIVATE_parseObject(n,l){let u={};return isEmpty(n)?l.path&&l.path.length>0&&l.fieldMask.push(l.path):forEach(n,(n,d)=>{let h=__PRIVATE_parseData(d,l.Ru(n));null!=h&&(u[n]=h)}),{mapValue:{fields:u}}}function __PRIVATE_looksLikeJsonObject(n){return!("object"!=typeof n||null===n||n instanceof Array||n instanceof Date||n instanceof Timestamp||n instanceof GeoPoint||n instanceof Bytes||n instanceof DocumentReference||n instanceof FieldValue)}function __PRIVATE_validatePlainObject(n,l,u){if(!__PRIVATE_looksLikeJsonObject(u)||!("object"==typeof u&&null!==u&&(Object.getPrototypeOf(u)===Object.prototype||null===Object.getPrototypeOf(u)))){let d=__PRIVATE_valueDescription(u);throw"an object"===d?l.pu(n+" a custom object"):l.pu(n+" "+d)}}function __PRIVATE_fieldPathFromArgument$1(n,l,u){if((l=(0,et.m9)(l))instanceof FieldPath)return l._internalPath;if("string"==typeof l)return __PRIVATE_fieldPathFromDotSeparatedString(n,l);throw __PRIVATE_createError("Field path arguments must be of type string or ",n,!1,void 0,u)}let tN=RegExp("[~\\*/\\[\\]]");function __PRIVATE_fieldPathFromDotSeparatedString(n,l,u){if(l.search(tN)>=0)throw __PRIVATE_createError(`Invalid field path (${l}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,u);try{return new FieldPath(...l.split("."))._internalPath}catch(d){throw __PRIVATE_createError(`Invalid field path (${l}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,u)}}function __PRIVATE_createError(n,l,u,d,h){let f=d&&!d.isEmpty(),m=void 0!==h,g=`Function ${l}() called with invalid data`;u&&(g+=" (via `toFirestore()`)"),g+=". ";let _="";return(f||m)&&(_+=" (found",f&&(_+=` in field ${d}`),m&&(_+=` in document ${h}`),_+=")"),new FirestoreError(tg.INVALID_ARGUMENT,g+n+_)}function __PRIVATE_fieldMaskContains(n,l){return n.some(n=>n.isEqual(l))}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let DocumentSnapshot$1=class DocumentSnapshot$1{constructor(n,l,u,d,h){this._firestore=n,this._userDataWriter=l,this._key=u,this._document=d,this._converter=h}get id(){return this._key.path.lastSegment()}get ref(){return new DocumentReference(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){let n=new QueryDocumentSnapshot$1(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(n)}return this._userDataWriter.convertValue(this._document.data.value)}}get(n){if(this._document){let l=this._document.data.field(__PRIVATE_fieldPathFromArgument("DocumentSnapshot.get",n));if(null!==l)return this._userDataWriter.convertValue(l)}}};let QueryDocumentSnapshot$1=class QueryDocumentSnapshot$1 extends DocumentSnapshot$1{data(){return super.data()}};function __PRIVATE_fieldPathFromArgument(n,l){return"string"==typeof l?__PRIVATE_fieldPathFromDotSeparatedString(n,l):l instanceof FieldPath?l._internalPath:l._delegate._internalPath}let AbstractUserDataWriter=class AbstractUserDataWriter{convertValue(n,l="none"){switch(__PRIVATE_typeOrder(n)){case 0:return null;case 1:return n.booleanValue;case 2:return __PRIVATE_normalizeNumber(n.integerValue||n.doubleValue);case 3:return this.convertTimestamp(n.timestampValue);case 4:return this.convertServerTimestamp(n,l);case 5:return n.stringValue;case 6:return this.convertBytes(__PRIVATE_normalizeByteString(n.bytesValue));case 7:return this.convertReference(n.referenceValue);case 8:return this.convertGeoPoint(n.geoPointValue);case 9:return this.convertArray(n.arrayValue,l);case 10:return this.convertObject(n.mapValue,l);default:throw fail()}}convertObject(n,l){return this.convertObjectMap(n.fields,l)}convertObjectMap(n,l="none"){let u={};return forEach(n,(n,d)=>{u[n]=this.convertValue(d,l)}),u}convertGeoPoint(n){return new GeoPoint(__PRIVATE_normalizeNumber(n.latitude),__PRIVATE_normalizeNumber(n.longitude))}convertArray(n,l){return(n.values||[]).map(n=>this.convertValue(n,l))}convertServerTimestamp(n,l){switch(l){case"previous":let u=__PRIVATE_getPreviousValue(n);return null==u?null:this.convertValue(u,l);case"estimate":return this.convertTimestamp(__PRIVATE_getLocalWriteTime(n));default:return null}}convertTimestamp(n){let l=__PRIVATE_normalizeTimestamp(n);return new Timestamp(l.seconds,l.nanos)}convertDocumentKey(n,l){let u=ResourcePath.fromString(n);__PRIVATE_isValidResourceName(u)||fail();let d=new DatabaseId(u.get(1),u.get(3)),h=new DocumentKey(u.popFirst(5));return d.isEqual(l)||__PRIVATE_logError(`Document ${h} contains a document reference within a different database (${d.projectId}/${d.database}) which is not supported. It will be treated as a reference in the current database (${l.projectId}/${l.database}) instead.`),h}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function __PRIVATE_applyFirestoreDataConverter(n,l,u){return n?u&&(u.merge||u.mergeFields)?n.toFirestore(l,u):n.toFirestore(l):l}let __PRIVATE_LiteUserDataWriter=class __PRIVATE_LiteUserDataWriter extends AbstractUserDataWriter{constructor(n){super(),this.firestore=n}convertBytes(n){return new Bytes(n)}convertReference(n){let l=this.convertDocumentKey(n,this.firestore._databaseId);return new DocumentReference(this.firestore,null,l)}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let SnapshotMetadata=class SnapshotMetadata{constructor(n,l){this.hasPendingWrites=n,this.fromCache=l}isEqual(n){return this.hasPendingWrites===n.hasPendingWrites&&this.fromCache===n.fromCache}};let DocumentSnapshot=class DocumentSnapshot extends DocumentSnapshot$1{constructor(n,l,u,d,h,f){super(n,l,u,d,f),this._firestore=n,this._firestoreImpl=n,this.metadata=h}exists(){return super.exists()}data(n={}){if(this._document){if(this._converter){let l=new QueryDocumentSnapshot(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(l,n)}return this._userDataWriter.convertValue(this._document.data.value,n.serverTimestamps)}}get(n,l={}){if(this._document){let u=this._document.data.field(__PRIVATE_fieldPathFromArgument("DocumentSnapshot.get",n));if(null!==u)return this._userDataWriter.convertValue(u,l.serverTimestamps)}}};let QueryDocumentSnapshot=class QueryDocumentSnapshot extends DocumentSnapshot{data(n={}){return super.data(n)}};let QuerySnapshot=class QuerySnapshot{constructor(n,l,u,d){this._firestore=n,this._userDataWriter=l,this._snapshot=d,this.metadata=new SnapshotMetadata(d.hasPendingWrites,d.fromCache),this.query=u}get docs(){let n=[];return this.forEach(l=>n.push(l)),n}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(n,l){this._snapshot.docs.forEach(u=>{n.call(l,new QueryDocumentSnapshot(this._firestore,this._userDataWriter,u.key,u,new SnapshotMetadata(this._snapshot.mutatedKeys.has(u.key),this._snapshot.fromCache),this.query.converter))})}docChanges(n={}){let l=!!n.includeMetadataChanges;if(l&&this._snapshot.excludesMetadataChanges)throw new FirestoreError(tg.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===l||(this._cachedChanges=function(n,l){if(n._snapshot.oldDocs.isEmpty()){let l=0;return n._snapshot.docChanges.map(u=>{let d=new QueryDocumentSnapshot(n._firestore,n._userDataWriter,u.doc.key,u.doc,new SnapshotMetadata(n._snapshot.mutatedKeys.has(u.doc.key),n._snapshot.fromCache),n.query.converter);return u.doc,{type:"added",doc:d,oldIndex:-1,newIndex:l++}})}{let u=n._snapshot.oldDocs;return n._snapshot.docChanges.filter(n=>l||3!==n.type).map(l=>{let d=new QueryDocumentSnapshot(n._firestore,n._userDataWriter,l.doc.key,l.doc,new SnapshotMetadata(n._snapshot.mutatedKeys.has(l.doc.key),n._snapshot.fromCache),n.query.converter),h=-1,f=-1;return 0!==l.type&&(h=u.indexOf(l.doc.key),u=u.delete(l.doc.key)),1!==l.type&&(f=(u=u.add(l.doc)).indexOf(l.doc.key)),{type:function(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return fail()}}(l.type),doc:d,oldIndex:h,newIndex:f}})}}(this,l),this._cachedChangesIncludeMetadataChanges=l),this._cachedChanges}};/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function getDoc(n){n=__PRIVATE_cast(n,DocumentReference);let l=__PRIVATE_cast(n.firestore,Firestore);return(function(n,l,u={}){let d=new __PRIVATE_Deferred;return n.asyncQueue.enqueueAndForget(async()=>(function(n,l,u,d,h){let f=new __PRIVATE_AsyncObserver({next:f=>{l.enqueueAndForget(()=>__PRIVATE_eventManagerUnlisten(n,m));let g=f.docs.has(u);!g&&f.fromCache?h.reject(new FirestoreError(tg.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&f.fromCache&&d&&"server"===d.source?h.reject(new FirestoreError(tg.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):h.resolve(f)},error:n=>h.reject(n)}),m=new __PRIVATE_QueryListener(__PRIVATE_newQueryForPath(u.path),f,{includeMetadataChanges:!0,Z_:!0});return __PRIVATE_eventManagerListen(n,m)})(await __PRIVATE_getEventManager(n),n.asyncQueue,l,u,d)),d.promise})(ensureFirestoreConfigured(l),n._key).then(u=>__PRIVATE_convertToDocSnapshot(l,n,u))}let __PRIVATE_ExpUserDataWriter=class __PRIVATE_ExpUserDataWriter extends AbstractUserDataWriter{constructor(n){super(),this.firestore=n}convertBytes(n){return new Bytes(n)}convertReference(n){let l=this.convertDocumentKey(n,this.firestore._databaseId);return new DocumentReference(this.firestore,null,l)}};function setDoc(n,l,u){var d;n=__PRIVATE_cast(n,DocumentReference);let h=__PRIVATE_cast(n.firestore,Firestore),f=__PRIVATE_applyFirestoreDataConverter(n.converter,l,u);return d=[__PRIVATE_parseSetData(__PRIVATE_newUserDataReader(h),"setDoc",n._key,f,null!==n.converter,u).toMutation(n._key,Precondition.none())],function(n,l){let u=new __PRIVATE_Deferred;return n.asyncQueue.enqueueAndForget(async()=>__PRIVATE_syncEngineWrite(await __PRIVATE_ensureOnlineComponents(n).then(n=>n.syncEngine),l,u)),u.promise}(ensureFirestoreConfigured(h),d)}function onSnapshot(n,...l){var u,d,h;let f,m,g;n=(0,et.m9)(n);let _={includeMetadataChanges:!1},j=0;"object"!=typeof l[0]||__PRIVATE_isPartialObserver(l[j])||(_=l[j],j++);let $={includeMetadataChanges:_.includeMetadataChanges};if(__PRIVATE_isPartialObserver(l[j])){let n=l[j];l[j]=null===(u=n.next)||void 0===u?void 0:u.bind(n),l[j+1]=null===(d=n.error)||void 0===d?void 0:d.bind(n),l[j+2]=null===(h=n.complete)||void 0===h?void 0:h.bind(n)}if(n instanceof DocumentReference)m=__PRIVATE_cast(n.firestore,Firestore),g=__PRIVATE_newQueryForPath(n._key.path),f={next:u=>{l[j]&&l[j](__PRIVATE_convertToDocSnapshot(m,n,u))},error:l[j+1],complete:l[j+2]};else{let u=__PRIVATE_cast(n,Query);m=__PRIVATE_cast(u.firestore,Firestore),g=u._query;let d=new __PRIVATE_ExpUserDataWriter(m);f={next:n=>{l[j]&&l[j](new QuerySnapshot(m,d,u,n))},error:l[j+1],complete:l[j+2]},/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){if("L"===n.limitType&&0===n.explicitOrderBy.length)throw new FirestoreError(tg.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}(n._query)}return function(n,l,u,d){let h=new __PRIVATE_AsyncObserver(d),f=new __PRIVATE_QueryListener(l,h,u);return n.asyncQueue.enqueueAndForget(async()=>__PRIVATE_eventManagerListen(await __PRIVATE_getEventManager(n),f)),()=>{h.La(),n.asyncQueue.enqueueAndForget(async()=>__PRIVATE_eventManagerUnlisten(await __PRIVATE_getEventManager(n),f))}}(ensureFirestoreConfigured(m),g,$,f)}function __PRIVATE_convertToDocSnapshot(n,l,u){let d=u.docs.get(l._key),h=new __PRIVATE_ExpUserDataWriter(n);return new DocumentSnapshot(n,h,l._key,d,new SnapshotMetadata(u.hasPendingWrites,u.fromCache),l.converter)}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let tV={maxAttempts:5};function __PRIVATE_validateReference(n,l){if((n=(0,et.m9)(n)).firestore!==l)throw new FirestoreError(tg.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return n}/**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *//**
 * @license
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Transaction=class Transaction extends class{constructor(n,l){this._firestore=n,this._transaction=l,this._dataReader=__PRIVATE_newUserDataReader(n)}get(n){let l=__PRIVATE_validateReference(n,this._firestore),u=new __PRIVATE_LiteUserDataWriter(this._firestore);return this._transaction.lookup([l._key]).then(n=>{if(!n||1!==n.length)return fail();let d=n[0];if(d.isFoundDocument())return new DocumentSnapshot$1(this._firestore,u,d.key,d,l.converter);if(d.isNoDocument())return new DocumentSnapshot$1(this._firestore,u,l._key,null,l.converter);throw fail()})}set(n,l,u){let d=__PRIVATE_validateReference(n,this._firestore),h=__PRIVATE_applyFirestoreDataConverter(d.converter,l,u),f=__PRIVATE_parseSetData(this._dataReader,"Transaction.set",d._key,h,null!==d.converter,u);return this._transaction.set(d._key,f),this}update(n,l,u,...d){let h;let f=__PRIVATE_validateReference(n,this._firestore);return h="string"==typeof(l=(0,et.m9)(l))||l instanceof FieldPath?__PRIVATE_parseUpdateVarargs(this._dataReader,"Transaction.update",f._key,l,u,d):__PRIVATE_parseUpdateData(this._dataReader,"Transaction.update",f._key,l),this._transaction.update(f._key,h),this}delete(n){let l=__PRIVATE_validateReference(n,this._firestore);return this._transaction.delete(l._key),this}}{constructor(n,l){super(n,l),this._firestore=n}get(n){let l=__PRIVATE_validateReference(n,this._firestore),u=new __PRIVATE_ExpUserDataWriter(this._firestore);return super.get(n).then(n=>new DocumentSnapshot(this._firestore,u,l._key,n._document,new SnapshotMetadata(!1,!1),l.converter))}};function runTransaction(n,l,u){n=__PRIVATE_cast(n,Firestore);let d=Object.assign(Object.assign({},tV),u);return!function(n){if(n.maxAttempts<1)throw new FirestoreError(tg.INVALID_ARGUMENT,"Max attempts must be at least 1")}(d),function(n,l,u){let d=new __PRIVATE_Deferred;return n.asyncQueue.enqueueAndForget(async()=>{let h=await __PRIVATE_ensureOnlineComponents(n).then(n=>n.datastore);new __PRIVATE_TransactionRunner(n.asyncQueue,h,u,l,d).ja()}),d.promise}(ensureFirestoreConfigured(n),u=>l(new Transaction(n,u)),d)}function arrayUnion(...n){return new __PRIVATE_ArrayUnionFieldValueImpl("arrayUnion",n)}new WeakMap,function(n=!0){tf=$.Jn,(0,$.Xd)(new z.wA("firestore",(l,{instanceIdentifier:u,options:d})=>{let h=l.getProvider("app").getImmediate(),f=new Firestore(new __PRIVATE_FirebaseAuthCredentialsProvider(l.getProvider("auth-internal")),new __PRIVATE_FirebaseAppCheckTokenProvider(l.getProvider("app-check-internal")),function(n,l){if(!Object.prototype.hasOwnProperty.apply(n.options,["projectId"]))throw new FirestoreError(tg.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new DatabaseId(n.options.projectId,l)}(h,u),h);return d=Object.assign({useFetchStreams:n},d),f._setSettings(d),f},"PUBLIC").setMultipleInstances(!0)),(0,$.KN)(tp,"4.4.1",void 0),(0,$.KN)(tp,"4.4.1","esm2017")}()},71540:function(n,l,u){"use strict";u.d(l,{Jt:function(){return getDownloadURL},cF:function(){return getStorage},iH:function(){return ref},B0:function(){return uploadBytesResumable}});var d,h,f,m,g=u(96327),_=u(83395),j=u(46387);/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let $="firebasestorage.googleapis.com",z="storageBucket";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let StorageError=class StorageError extends _.ZR{constructor(n,l,u=0){super(prependCode(n),`Firebase Storage: ${l} (${prependCode(n)})`),this.status_=u,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,StorageError.prototype)}get status(){return this.status_}set status(n){this.status_=n}_codeEquals(n){return prependCode(n)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(n){this.customData.serverResponse=n,this.customData.serverResponse?this.message=`${this._baseMessage}
${this.customData.serverResponse}`:this.message=this._baseMessage}};function prependCode(n){return"storage/"+n}function unknown(){return new StorageError(f.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function retryLimitExceeded(){return new StorageError(f.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function canceled(){return new StorageError(f.CANCELED,"User canceled the upload/download.")}function cannotSliceBlob(){return new StorageError(f.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function invalidArgument(n){return new StorageError(f.INVALID_ARGUMENT,n)}function appDeleted(){return new StorageError(f.APP_DELETED,"The Firebase app was deleted.")}function invalidFormat(n,l){return new StorageError(f.INVALID_FORMAT,"String does not match format '"+n+"': "+l)}function internalError(n){throw new StorageError(f.INTERNAL_ERROR,"Internal error: "+n)}(d=f||(f={})).UNKNOWN="unknown",d.OBJECT_NOT_FOUND="object-not-found",d.BUCKET_NOT_FOUND="bucket-not-found",d.PROJECT_NOT_FOUND="project-not-found",d.QUOTA_EXCEEDED="quota-exceeded",d.UNAUTHENTICATED="unauthenticated",d.UNAUTHORIZED="unauthorized",d.UNAUTHORIZED_APP="unauthorized-app",d.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",d.INVALID_CHECKSUM="invalid-checksum",d.CANCELED="canceled",d.INVALID_EVENT_NAME="invalid-event-name",d.INVALID_URL="invalid-url",d.INVALID_DEFAULT_BUCKET="invalid-default-bucket",d.NO_DEFAULT_BUCKET="no-default-bucket",d.CANNOT_SLICE_BLOB="cannot-slice-blob",d.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",d.NO_DOWNLOAD_URL="no-download-url",d.INVALID_ARGUMENT="invalid-argument",d.INVALID_ARGUMENT_COUNT="invalid-argument-count",d.APP_DELETED="app-deleted",d.INVALID_ROOT_OPERATION="invalid-root-operation",d.INVALID_FORMAT="invalid-format",d.INTERNAL_ERROR="internal-error",d.UNSUPPORTED_ENVIRONMENT="unsupported-environment";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Location=class Location{constructor(n,l){this.bucket=n,this.path_=l}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){let n=encodeURIComponent;return"/b/"+n(this.bucket)+"/o/"+n(this.path)}bucketOnlyServerUrl(){let n=encodeURIComponent;return"/b/"+n(this.bucket)+"/o"}static makeFromBucketSpec(n,l){let u;try{u=Location.makeFromUrl(n,l)}catch(l){return new Location(n,"")}if(""===u.path)return u;throw new StorageError(f.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+n+"'.")}static makeFromUrl(n,l){let u=null,d="([A-Za-z0-9.\\-_]+)",h=RegExp("^gs://"+d+"(/(.*))?$","i");function httpModify(n){n.path_=decodeURIComponent(n.path)}let m=l.replace(/[.]/g,"\\."),g=RegExp(`^https?://${m}/v[A-Za-z0-9_]+/b/${d}/o(/([^?#]*).*)?$`,"i"),_=RegExp(`^https?://${l===$?"(?:storage.googleapis.com|storage.cloud.google.com)":l}/${d}/([^?#]*)`,"i"),j=[{regex:h,indices:{bucket:1,path:3},postModify:function(n){"/"===n.path.charAt(n.path.length-1)&&(n.path_=n.path_.slice(0,-1))}},{regex:g,indices:{bucket:1,path:3},postModify:httpModify},{regex:_,indices:{bucket:1,path:2},postModify:httpModify}];for(let l=0;l<j.length;l++){let d=j[l],h=d.regex.exec(n);if(h){let n=h[d.indices.bucket],l=h[d.indices.path];l||(l=""),u=new Location(n,l),d.postModify(u);break}}if(null==u)throw new StorageError(f.INVALID_URL,"Invalid URL '"+n+"'.");return u}};let FailRequest=class FailRequest{constructor(n){this.promise_=Promise.reject(n)}getPromise(){return this.promise_}cancel(n=!1){}};function isString(n){return"string"==typeof n||n instanceof String}function isNativeBlob(n){return isNativeBlobDefined()&&n instanceof Blob}function isNativeBlobDefined(){return"undefined"!=typeof Blob}function validateNumber(n,l,u,d){if(d<l)throw invalidArgument(`Invalid value for '${n}'. Expected ${l} or greater.`);if(d>u)throw invalidArgument(`Invalid value for '${n}'. Expected ${u} or less.`)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function makeUrl(n,l,u){let d=l;return null==u&&(d=`https://${l}`),`${u}://${d}/v0${n}`}function makeQueryString(n){let l=encodeURIComponent,u="?";for(let d in n)if(n.hasOwnProperty(d)){let h=l(d)+"="+l(n[d]);u=u+h+"&"}return u.slice(0,-1)}/**
 * @license
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function isRetryStatusCode(n,l){let u=n>=500&&n<600,d=-1!==[408,429].indexOf(n),h=-1!==l.indexOf(n);return u||d||h}(h=m||(m={}))[h.NO_ERROR=0]="NO_ERROR",h[h.NETWORK_ERROR=1]="NETWORK_ERROR",h[h.ABORT=2]="ABORT";/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let NetworkRequest=class NetworkRequest{constructor(n,l,u,d,h,f,m,g,_,j,$,z=!0){this.url_=n,this.method_=l,this.headers_=u,this.body_=d,this.successCodes_=h,this.additionalRetryCodes_=f,this.callback_=m,this.errorCallback_=g,this.timeout_=_,this.progressCallback_=j,this.connectionFactory_=$,this.retry=z,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((n,l)=>{this.resolve_=n,this.reject_=l,this.start_()})}start_(){let backoffDone=(n,l)=>{let u=this.resolve_,d=this.reject_,h=l.connection;if(l.wasSuccessCode)try{let n=this.callback_(h,h.getResponse());void 0!==n?u(n):u()}catch(n){d(n)}else if(null!==h){let n=unknown();n.serverResponse=h.getErrorText(),d(this.errorCallback_?this.errorCallback_(h,n):n)}else if(l.canceled){let n=this.appDelete_?appDeleted():canceled();d(n)}else{let n=retryLimitExceeded();d(n)}};this.canceled_?backoffDone(!1,new RequestEndStatus(!1,null,!0)):this.backoffId_=/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n,l,u){let d=1,h=null,f=null,m=!1,g=0,_=!1;function triggerCallback(...n){_||(_=!0,l.apply(null,n))}function callWithDelay(l){h=setTimeout(()=>{h=null,n(responseHandler,2===g)},l)}function clearGlobalTimeout(){f&&clearTimeout(f)}function responseHandler(n,...l){let u;if(_){clearGlobalTimeout();return}if(n){clearGlobalTimeout(),triggerCallback.call(null,n,...l);return}let h=2===g||m;if(h){clearGlobalTimeout(),triggerCallback.call(null,n,...l);return}d<64&&(d*=2),1===g?(g=2,u=0):u=(d+Math.random())*1e3,callWithDelay(u)}let j=!1;function stop(n){!j&&(j=!0,clearGlobalTimeout(),!_&&(null!==h?(n||(g=2),clearTimeout(h),callWithDelay(0)):n||(g=1)))}return callWithDelay(0),f=setTimeout(()=>{m=!0,stop(!0)},u),stop}((n,l)=>{if(l){n(!1,new RequestEndStatus(!1,null,!0));return}let u=this.connectionFactory_();this.pendingConnection_=u;let progressListener=n=>{let l=n.loaded,u=n.lengthComputable?n.total:-1;null!==this.progressCallback_&&this.progressCallback_(l,u)};null!==this.progressCallback_&&u.addUploadProgressListener(progressListener),u.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&u.removeUploadProgressListener(progressListener),this.pendingConnection_=null;let l=u.getErrorCode()===m.NO_ERROR,d=u.getStatus();if(!l||isRetryStatusCode(d,this.additionalRetryCodes_)&&this.retry){let l=u.getErrorCode()===m.ABORT;n(!1,new RequestEndStatus(!1,null,l));return}let h=-1!==this.successCodes_.indexOf(d);n(!0,new RequestEndStatus(h,u))})},backoffDone,this.timeout_)}getPromise(){return this.promise_}cancel(n){this.canceled_=!0,this.appDelete_=n||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}};let RequestEndStatus=class RequestEndStatus{constructor(n,l,u){this.wasSuccessCode=n,this.connection=l,this.canceled=!!u}};function getBlob$1(...n){let l="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0;if(void 0!==l){let u=new l;for(let l=0;l<n.length;l++)u.append(n[l]);return u.getBlob()}if(isNativeBlobDefined())return new Blob(n);throw new StorageError(f.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let ee={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};let StringData=class StringData{constructor(n,l){this.data=n,this.contentType=l||null}};function utf8Bytes_(n){let l=[];for(let u=0;u<n.length;u++){let d=n.charCodeAt(u);if(d<=127)l.push(d);else if(d<=2047)l.push(192|d>>6,128|63&d);else if((64512&d)==55296){let h=u<n.length-1&&(64512&n.charCodeAt(u+1))==56320;if(h){let h=d,f=n.charCodeAt(++u);d=65536|(1023&h)<<10|1023&f,l.push(240|d>>18,128|d>>12&63,128|d>>6&63,128|63&d)}else l.push(239,191,189)}else(64512&d)==56320?l.push(239,191,189):l.push(224|d>>12,128|d>>6&63,128|63&d)}return new Uint8Array(l)}function base64Bytes_(n,l){let u;switch(n){case ee.BASE64:{let u=-1!==l.indexOf("-"),d=-1!==l.indexOf("_");if(u||d)throw invalidFormat(n,"Invalid character '"+(u?"-":"_")+"' found: is it base64url encoded?");break}case ee.BASE64URL:{let u=-1!==l.indexOf("+"),d=-1!==l.indexOf("/");if(u||d)throw invalidFormat(n,"Invalid character '"+(u?"+":"/")+"' found: is it base64 encoded?");l=l.replace(/-/g,"+").replace(/_/g,"/")}}try{u=/**
 * @license
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){if("undefined"==typeof atob)throw new StorageError(f.UNSUPPORTED_ENVIRONMENT,"base-64 is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.");return atob(n)}(l)}catch(l){if(l.message.includes("polyfill"))throw l;throw invalidFormat(n,"Invalid character found")}let d=new Uint8Array(u.length);for(let n=0;n<u.length;n++)d[n]=u.charCodeAt(n);return d}let DataURLParts=class DataURLParts{constructor(n){this.base64=!1,this.contentType=null;let l=n.match(/^data:([^,]+)?,/);if(null===l)throw invalidFormat(ee.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");let u=l[1]||null;null!=u&&(this.base64=function(n,l){let u=n.length>=l.length;return!!u&&n.substring(n.length-l.length)===l}(u,";base64"),this.contentType=this.base64?u.substring(0,u.length-7):u),this.rest=n.substring(n.indexOf(",")+1)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let FbsBlob=class FbsBlob{constructor(n,l){let u=0,d="";isNativeBlob(n)?(this.data_=n,u=n.size,d=n.type):n instanceof ArrayBuffer?(l?this.data_=new Uint8Array(n):(this.data_=new Uint8Array(n.byteLength),this.data_.set(new Uint8Array(n))),u=this.data_.length):n instanceof Uint8Array&&(l?this.data_=n:(this.data_=new Uint8Array(n.length),this.data_.set(n)),u=n.length),this.size_=u,this.type_=d}size(){return this.size_}type(){return this.type_}slice(n,l){if(isNativeBlob(this.data_)){let u=this.data_,d=u.webkitSlice?u.webkitSlice(n,l):u.mozSlice?u.mozSlice(n,l):u.slice?u.slice(n,l):null;return null===d?null:new FbsBlob(d)}{let u=new Uint8Array(this.data_.buffer,n,l-n);return new FbsBlob(u,!0)}}static getBlob(...n){if(isNativeBlobDefined()){let l=n.map(n=>n instanceof FbsBlob?n.data_:n);return new FbsBlob(getBlob$1.apply(null,l))}{let l=n.map(n=>isString(n)?function(n,l){switch(n){case ee.RAW:return new StringData(utf8Bytes_(l));case ee.BASE64:case ee.BASE64URL:return new StringData(base64Bytes_(n,l));case ee.DATA_URL:return new StringData(function(n){let l=new DataURLParts(n);return l.base64?base64Bytes_(ee.BASE64,l.rest):function(n){let l;try{l=decodeURIComponent(n)}catch(n){throw invalidFormat(ee.DATA_URL,"Malformed data URL.")}return utf8Bytes_(l)}(l.rest)}(l),function(n){let l=new DataURLParts(n);return l.contentType}(l))}throw unknown()}(ee.RAW,n).data:n.data_),u=0;l.forEach(n=>{u+=n.byteLength});let d=new Uint8Array(u),h=0;return l.forEach(n=>{for(let l=0;l<n.length;l++)d[h++]=n[l]}),new FbsBlob(d,!0)}}uploadData(){return this.data_}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function jsonObjectOrNull(n){var l;let u;try{u=JSON.parse(n)}catch(n){return null}return"object"!=typeof(l=u)||Array.isArray(l)?null:u}function lastComponent(n){let l=n.lastIndexOf("/",n.length-2);return -1===l?n:n.slice(l+1)}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function noXform_(n,l){return l}let Mapping=class Mapping{constructor(n,l,u,d){this.server=n,this.local=l||n,this.writable=!!u,this.xform=d||noXform_}};let et=null;function getMappings(){if(et)return et;let n=[];n.push(new Mapping("bucket")),n.push(new Mapping("generation")),n.push(new Mapping("metageneration")),n.push(new Mapping("name","fullPath",!0));let l=new Mapping("name");l.xform=function(n,l){return!isString(l)||l.length<2?l:lastComponent(l)},n.push(l);let u=new Mapping("size");return u.xform=function(n,l){return void 0!==l?Number(l):l},n.push(u),n.push(new Mapping("timeCreated")),n.push(new Mapping("updated")),n.push(new Mapping("md5Hash",null,!0)),n.push(new Mapping("cacheControl",null,!0)),n.push(new Mapping("contentDisposition",null,!0)),n.push(new Mapping("contentEncoding",null,!0)),n.push(new Mapping("contentLanguage",null,!0)),n.push(new Mapping("contentType",null,!0)),n.push(new Mapping("metadata","customMetadata",!0)),et=n}function fromResourceString(n,l,u){let d=jsonObjectOrNull(l);return null===d?null:function(n,l,u){let d={};d.type="file";let h=u.length;for(let n=0;n<h;n++){let h=u[n];d[h.local]=h.xform(d,l[h.server])}return Object.defineProperty(d,"ref",{get:function(){let l=d.bucket,u=d.fullPath,h=new Location(l,u);return n._makeStorageReference(h)}}),d}(n,d,u)}function toResourceString(n,l){let u={},d=l.length;for(let h=0;h<d;h++){let d=l[h];d.writable&&(u[d.server]=n[d.local])}return JSON.stringify(u)}let RequestInfo=class RequestInfo{constructor(n,l,u,d){this.url=n,this.method=l,this.handler=u,this.timeout=d,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function handlerCheck(n){if(!n)throw unknown()}function metadataHandler(n,l){return function(u,d){let h=fromResourceString(n,d,l);return handlerCheck(null!==h),h}}function sharedErrorHandler(n){return function(l,u){var d,h;let m;return 401===l.getStatus()?m=l.getErrorText().includes("Firebase App Check token is invalid")?new StorageError(f.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new StorageError(f.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===l.getStatus()?(d=n.bucket,m=new StorageError(f.QUOTA_EXCEEDED,"Quota for bucket '"+d+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===l.getStatus()?(h=n.path,m=new StorageError(f.UNAUTHORIZED,"User does not have permission to access '"+h+"'.")):m=u,m.status=l.getStatus(),m.serverResponse=u.serverResponse,m}}function objectErrorHandler(n){let l=sharedErrorHandler(n);return function(u,d){let h=l(u,d);if(404===u.getStatus()){var m;m=n.path,h=new StorageError(f.OBJECT_NOT_FOUND,"Object '"+m+"' does not exist.")}return h.serverResponse=d.serverResponse,h}}function metadataForUpload_(n,l,u){let d=Object.assign({},u);return d.fullPath=n.path,d.size=l.size(),!d.contentType&&(d.contentType=l&&l.type()||"application/octet-stream"),d}let ResumableUploadStatus=class ResumableUploadStatus{constructor(n,l,u,d){this.current=n,this.total=l,this.finalized=!!u,this.metadata=d||null}};function checkResumeHeader_(n,l){let u=null;try{u=n.getResponseHeader("X-Goog-Upload-Status")}catch(n){handlerCheck(!1)}return handlerCheck(!!u&&-1!==(l||["active"]).indexOf(u)),u}let en={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function taskStateFromInternalTaskState(n){switch(n){case"running":case"pausing":case"canceling":return en.RUNNING;case"paused":return en.PAUSED;case"success":return en.SUCCESS;case"canceled":return en.CANCELED;default:return en.ERROR}}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Observer=class Observer{constructor(n,l,u){"function"==typeof n||null!=l||null!=u?(this.next=n,this.error=null!=l?l:void 0,this.complete=null!=u?u:void 0):(this.next=n.next,this.error=n.error,this.complete=n.complete)}};/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function index_esm2017_async(n){return(...l)=>{Promise.resolve().then(()=>n(...l))}}let XhrConnection=class XhrConnection{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=m.NO_ERROR,this.sendPromise_=new Promise(n=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=m.ABORT,n()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=m.NETWORK_ERROR,n()}),this.xhr_.addEventListener("load",()=>{n()})})}send(n,l,u,d){if(this.sent_)throw internalError("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(l,n,!0),void 0!==d)for(let n in d)d.hasOwnProperty(n)&&this.xhr_.setRequestHeader(n,d[n].toString());return void 0!==u?this.xhr_.send(u):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw internalError("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw internalError("cannot .getStatus() before sending");try{return this.xhr_.status}catch(n){return -1}}getResponse(){if(!this.sent_)throw internalError("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw internalError("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(n){return this.xhr_.getResponseHeader(n)}addUploadProgressListener(n){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",n)}removeUploadProgressListener(n){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",n)}};let XhrTextConnection=class XhrTextConnection extends XhrConnection{initXhr(){this.xhr_.responseType="text"}};function newTextConnection(){return new XhrTextConnection}/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let UploadTask=class UploadTask{constructor(n,l,u=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=n,this._blob=l,this._metadata=u,this._mappings=getMappings(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=n=>{if(this._request=void 0,this._chunkMultiplier=1,n._codeEquals(f.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{let l=this.isExponentialBackoffExpired();if(isRetryStatusCode(n.status,[])){if(l)n=retryLimitExceeded();else{this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,this.completeTransitions_();return}}this._error=n,this._transition("error")}},this._metadataErrorHandler=n=>{this._request=void 0,n._codeEquals(f.CANCELED)?this.completeTransitions_():(this._error=n,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((n,l)=>{this._resolve=n,this._reject=l,this._start()}),this._promise.then(null,()=>{})}isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}_makeProgressCallback(){let n=this._transferred;return l=>this._updateProgress(n+l)}_shouldDoResumable(n){return n.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(n){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([l,u])=>{switch(this._state){case"running":n(l,u);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((n,l)=>{let u=function(n,l,u,d,h){let f=l.bucketOnlyServerUrl(),m=metadataForUpload_(l,d,h),g={name:m.fullPath},_=makeUrl(f,n.host,n._protocol),j={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${d.size()}`,"X-Goog-Upload-Header-Content-Type":m.contentType,"Content-Type":"application/json; charset=utf-8"},$=toResourceString(m,u),z=n.maxUploadRetryTime,ee=new RequestInfo(_,"POST",function(n){let l;checkResumeHeader_(n);try{l=n.getResponseHeader("X-Goog-Upload-URL")}catch(n){handlerCheck(!1)}return handlerCheck(isString(l)),l},z);return ee.urlParams=g,ee.headers=j,ee.body=$,ee.errorHandler=sharedErrorHandler(l),ee}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),d=this._ref.storage._makeRequest(u,newTextConnection,n,l);this._request=d,d.getPromise().then(n=>{this._request=void 0,this._uploadUrl=n,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){let n=this._uploadUrl;this._resolveToken((l,u)=>{let d=function(n,l,u,d){let h=n.maxUploadRetryTime,f=new RequestInfo(u,"POST",function(n){let l=checkResumeHeader_(n,["active","final"]),u=null;try{u=n.getResponseHeader("X-Goog-Upload-Size-Received")}catch(n){handlerCheck(!1)}u||handlerCheck(!1);let h=Number(u);return handlerCheck(!isNaN(h)),new ResumableUploadStatus(h,d.size(),"final"===l)},h);return f.headers={"X-Goog-Upload-Command":"query"},f.errorHandler=sharedErrorHandler(l),f}(this._ref.storage,this._ref._location,n,this._blob),h=this._ref.storage._makeRequest(d,newTextConnection,l,u);this._request=h,h.getPromise().then(n=>{this._request=void 0,this._updateProgress(n.current),this._needToFetchStatus=!1,n.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){let n=262144*this._chunkMultiplier,l=new ResumableUploadStatus(this._transferred,this._blob.size()),u=this._uploadUrl;this._resolveToken((d,h)=>{let m;try{m=function(n,l,u,d,h,m,g,_){let j=new ResumableUploadStatus(0,0);if(g?(j.current=g.current,j.total=g.total):(j.current=0,j.total=d.size()),d.size()!==j.total)throw new StorageError(f.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");let $=j.total-j.current,z=$;h>0&&(z=Math.min(z,h));let ee=j.current,et=ee+z,en="";en=0===z?"finalize":$===z?"upload, finalize":"upload";let eo={"X-Goog-Upload-Command":en,"X-Goog-Upload-Offset":`${j.current}`},es=d.slice(ee,et);if(null===es)throw cannotSliceBlob();let el=l.maxUploadRetryTime,eu=new RequestInfo(u,"POST",function(n,u){let h;let f=checkResumeHeader_(n,["active","final"]),g=j.current+z,_=d.size();return h="final"===f?metadataHandler(l,m)(n,u):null,new ResumableUploadStatus(g,_,"final"===f,h)},el);return eu.headers=eo,eu.body=es.uploadData(),eu.progressCallback=_||null,eu.errorHandler=sharedErrorHandler(n),eu}(this._ref._location,this._ref.storage,u,this._blob,n,this._mappings,l,this._makeProgressCallback())}catch(n){this._error=n,this._transition("error");return}let g=this._ref.storage._makeRequest(m,newTextConnection,d,h,!1);this._request=g,g.getPromise().then(n=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(n.current),n.finalized?(this._metadata=n.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){let n=262144*this._chunkMultiplier;2*n<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((n,l)=>{let u=function(n,l,u){let d=l.fullServerUrl(),h=makeUrl(d,n.host,n._protocol),f=n.maxOperationRetryTime,m=new RequestInfo(h,"GET",metadataHandler(n,u),f);return m.errorHandler=objectErrorHandler(l),m}(this._ref.storage,this._ref._location,this._mappings),d=this._ref.storage._makeRequest(u,newTextConnection,n,l);this._request=d,d.getPromise().then(n=>{this._request=void 0,this._metadata=n,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((n,l)=>{let u=function(n,l,u,d,h){let f=l.bucketOnlyServerUrl(),m={"X-Goog-Upload-Protocol":"multipart"},g=function(){let n="";for(let l=0;l<2;l++)n+=Math.random().toString().slice(2);return n}();m["Content-Type"]="multipart/related; boundary="+g;let _=metadataForUpload_(l,d,h),j=toResourceString(_,u),$="--"+g+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+j+"\r\n--"+g+"\r\nContent-Type: "+_.contentType+"\r\n\r\n",z=FbsBlob.getBlob($,d,"\r\n--"+g+"--");if(null===z)throw cannotSliceBlob();let ee={name:_.fullPath},et=makeUrl(f,n.host,n._protocol),en=n.maxUploadRetryTime,eo=new RequestInfo(et,"POST",metadataHandler(n,u),en);return eo.urlParams=ee,eo.headers=m,eo.body=z.uploadData(),eo.errorHandler=sharedErrorHandler(l),eo}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),d=this._ref.storage._makeRequest(u,newTextConnection,n,l);this._request=d,d.getPromise().then(n=>{this._request=void 0,this._metadata=n,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(n){let l=this._transferred;this._transferred=n,this._transferred!==l&&this._notifyObservers()}_transition(n){if(this._state!==n)switch(n){case"canceling":case"pausing":this._state=n,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":let l="paused"===this._state;this._state=n,l&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=n,this._notifyObservers();break;case"canceled":this._error=canceled(),this._state=n,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){let n=taskStateFromInternalTaskState(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:n,metadata:this._metadata,task:this,ref:this._ref}}on(n,l,u,d){let h=new Observer(l||void 0,u||void 0,d||void 0);return this._addObserver(h),()=>{this._removeObserver(h)}}then(n,l){return this._promise.then(n,l)}catch(n){return this.then(null,n)}_addObserver(n){this._observers.push(n),this._notifyObserver(n)}_removeObserver(n){let l=this._observers.indexOf(n);-1!==l&&this._observers.splice(l,1)}_notifyObservers(){this._finishPromise();let n=this._observers.slice();n.forEach(n=>{this._notifyObserver(n)})}_finishPromise(){if(void 0!==this._resolve){let n=!0;switch(taskStateFromInternalTaskState(this._state)){case en.SUCCESS:index_esm2017_async(this._resolve.bind(null,this.snapshot))();break;case en.CANCELED:case en.ERROR:let l=this._reject;index_esm2017_async(l.bind(null,this._error))();break;default:n=!1}n&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(n){let l=taskStateFromInternalTaskState(this._state);switch(l){case en.RUNNING:case en.PAUSED:n.next&&index_esm2017_async(n.next.bind(n,this.snapshot))();break;case en.SUCCESS:n.complete&&index_esm2017_async(n.complete.bind(n))();break;case en.CANCELED:case en.ERROR:default:n.error&&index_esm2017_async(n.error.bind(n,this._error))()}}resume(){let n="paused"===this._state||"pausing"===this._state;return n&&this._transition("running"),n}pause(){let n="running"===this._state;return n&&this._transition("pausing"),n}cancel(){let n="running"===this._state||"pausing"===this._state;return n&&this._transition("canceling"),n}};/**
 * @license
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */let Reference=class Reference{constructor(n,l){this._service=n,l instanceof Location?this._location=l:this._location=Location.makeFromUrl(l,n.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(n,l){return new Reference(n,l)}get root(){let n=new Location(this._location.bucket,"");return this._newRef(this._service,n)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return lastComponent(this._location.path)}get storage(){return this._service}get parent(){let n=/**
 * @license
 * Copyright 2017 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function(n){if(0===n.length)return null;let l=n.lastIndexOf("/");if(-1===l)return"";let u=n.slice(0,l);return u}(this._location.path);if(null===n)return null;let l=new Location(this._location.bucket,n);return new Reference(this._service,l)}_throwIfRoot(n){if(""===this._location.path)throw new StorageError(f.INVALID_ROOT_OPERATION,"The operation '"+n+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}};function extractBucket(n,l){let u=null==l?void 0:l[z];return null==u?null:Location.makeFromBucketSpec(u,n)}let FirebaseStorageImpl=class FirebaseStorageImpl{constructor(n,l,u,d,h){this.app=n,this._authProvider=l,this._appCheckProvider=u,this._url=d,this._firebaseVersion=h,this._bucket=null,this._host=$,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,null!=d?this._bucket=Location.makeFromBucketSpec(d,this._host):this._bucket=extractBucket(this._host,this.app.options)}get host(){return this._host}set host(n){this._host=n,null!=this._url?this._bucket=Location.makeFromBucketSpec(this._url,n):this._bucket=extractBucket(n,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(n){validateNumber("time",0,Number.POSITIVE_INFINITY,n),this._maxUploadRetryTime=n}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(n){validateNumber("time",0,Number.POSITIVE_INFINITY,n),this._maxOperationRetryTime=n}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;let n=this._authProvider.getImmediate({optional:!0});if(n){let l=await n.getToken();if(null!==l)return l.accessToken}return null}async _getAppCheckToken(){let n=this._appCheckProvider.getImmediate({optional:!0});if(n){let l=await n.getToken();return l.token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(n=>n.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(n){return new Reference(this,n)}_makeRequest(n,l,u,d,h=!0){if(this._deleted)return new FailRequest(appDeleted());{let f=function(n,l,u,d,h,f,m=!0){let g=makeQueryString(n.urlParams),_=n.url+g,j=Object.assign({},n.headers);return l&&(j["X-Firebase-GMPID"]=l),null!==u&&u.length>0&&(j.Authorization="Firebase "+u),j["X-Firebase-Storage-Version"]="webjs/"+(null!=f?f:"AppManager"),null!==d&&(j["X-Firebase-AppCheck"]=d),new NetworkRequest(_,n.method,j,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,h,m)}(n,this._appId,u,d,l,this._firebaseVersion,h);return this._requests.add(f),f.getPromise().then(()=>this._requests.delete(f),()=>this._requests.delete(f)),f}}async makeRequestWithTokens(n,l){let[u,d]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(n,l,u,d).getPromise()}};let eo="@firebase/storage",es="0.12.0",el="storage";function uploadBytesResumable(n,l,u){var d;return(d=n=(0,_.m9)(n))._throwIfRoot("uploadBytesResumable"),new UploadTask(d,new FbsBlob(l),u)}function getDownloadURL(n){return function(n){n._throwIfRoot("getDownloadURL");let l=function(n,l,u){let d=l.fullServerUrl(),h=makeUrl(d,n.host,n._protocol),f=n.maxOperationRetryTime,m=new RequestInfo(h,"GET",function(l,d){let h=fromResourceString(n,d,u);return handlerCheck(null!==h),function(n,l,u,d){let h=jsonObjectOrNull(l);if(null===h||!isString(h.downloadTokens))return null;let f=h.downloadTokens;if(0===f.length)return null;let m=encodeURIComponent,g=f.split(","),_=g.map(l=>{let h=n.bucket,f=n.fullPath,g="/b/"+m(h)+"/o/"+m(f),_=makeUrl(g,u,d),j=makeQueryString({alt:"media",token:l});return _+j});return _[0]}(h,d,n.host,n._protocol)},f);return m.errorHandler=objectErrorHandler(l),m}(n.storage,n._location,getMappings());return n.storage.makeRequestWithTokens(l,newTextConnection).then(n=>{if(null===n)throw new StorageError(f.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return n})}(n=(0,_.m9)(n))}function ref(n,l){return function(n,l){if(!(l&&/^[A-Za-z]+:\/\//.test(l)))return function refFromPath(n,l){if(n instanceof FirebaseStorageImpl){if(null==n._bucket)throw new StorageError(f.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+z+"' property when initializing the app?");let u=new Reference(n,n._bucket);return null!=l?refFromPath(u,l):u}return void 0!==l?function(n,l){let u=function(n,l){let u=l.split("/").filter(n=>n.length>0).join("/");return 0===n.length?u:n+"/"+u}(n._location.path,l),d=new Location(n._location.bucket,u);return new Reference(n.storage,d)}(n,l):n}(n,l);if(n instanceof FirebaseStorageImpl)return new Reference(n,l);throw invalidArgument("To use ref(service, url), the first argument must be a Storage instance.")}(n=(0,_.m9)(n),l)}function getStorage(n=(0,g.Mq)(),l){n=(0,_.m9)(n);let u=(0,g.qX)(n,el),d=u.getImmediate({identifier:l}),h=(0,_.P0)("storage");return h&&function(n,l,u,d={}){!function(n,l,u,d={}){n.host=`${l}:${u}`,n._protocol="http";let{mockUserToken:h}=d;h&&(n._overrideAuthToken="string"==typeof h?h:(0,_.Sg)(h,n.app.options.projectId))}(n,l,u,d)}(d,...h),d}(0,g.Xd)(new j.wA(el,function(n,{instanceIdentifier:l}){let u=n.getProvider("app").getImmediate(),d=n.getProvider("auth-internal"),h=n.getProvider("app-check-internal");return new FirebaseStorageImpl(u,d,h,l,g.Jn)},"PUBLIC").setMultipleInstances(!0)),(0,g.KN)(eo,es,""),(0,g.KN)(eo,es,"esm2017")},22970:function(n,l,u){"use strict";u.d(l,{Jh:function(){return __generator},_T:function(){return __rest},ev:function(){return __spreadArray},fl:function(){return __spread},mG:function(){return __awaiter},pi:function(){return __assign}});var __assign=function(){return(__assign=Object.assign||function(n){for(var l,u=1,d=arguments.length;u<d;u++)for(var h in l=arguments[u])Object.prototype.hasOwnProperty.call(l,h)&&(n[h]=l[h]);return n}).apply(this,arguments)};function __rest(n,l){var u={};for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&0>l.indexOf(d)&&(u[d]=n[d]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var h=0,d=Object.getOwnPropertySymbols(n);h<d.length;h++)0>l.indexOf(d[h])&&Object.prototype.propertyIsEnumerable.call(n,d[h])&&(u[d[h]]=n[d[h]]);return u}function __awaiter(n,l,u,d){return new(u||(u=Promise))(function(h,f){function fulfilled(n){try{step(d.next(n))}catch(n){f(n)}}function rejected(n){try{step(d.throw(n))}catch(n){f(n)}}function step(n){var l;n.done?h(n.value):((l=n.value)instanceof u?l:new u(function(n){n(l)})).then(fulfilled,rejected)}step((d=d.apply(n,l||[])).next())})}function __generator(n,l){var u,d,h,f,m={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return f={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function verb(g){return function(_){return function(g){if(u)throw TypeError("Generator is already executing.");for(;f&&(f=0,g[0]&&(m=0)),m;)try{if(u=1,d&&(h=2&g[0]?d.return:g[0]?d.throw||((h=d.return)&&h.call(d),0):d.next)&&!(h=h.call(d,g[1])).done)return h;switch(d=0,h&&(g=[2&g[0],h.value]),g[0]){case 0:case 1:h=g;break;case 4:return m.label++,{value:g[1],done:!1};case 5:m.label++,d=g[1],g=[0];continue;case 7:g=m.ops.pop(),m.trys.pop();continue;default:if(!(h=(h=m.trys).length>0&&h[h.length-1])&&(6===g[0]||2===g[0])){m=0;continue}if(3===g[0]&&(!h||g[1]>h[0]&&g[1]<h[3])){m.label=g[1];break}if(6===g[0]&&m.label<h[1]){m.label=h[1],h=g;break}if(h&&m.label<h[2]){m.label=h[2],m.ops.push(g);break}h[2]&&m.ops.pop(),m.trys.pop();continue}g=l.call(n,m)}catch(n){g=[6,n],d=0}finally{u=h=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([g,_])}}}function __spread(){for(var n=[],l=0;l<arguments.length;l++)n=n.concat(function(n,l){var u="function"==typeof Symbol&&n[Symbol.iterator];if(!u)return n;var d,h,f=u.call(n),m=[];try{for(;(void 0===l||l-- >0)&&!(d=f.next()).done;)m.push(d.value)}catch(n){h={error:n}}finally{try{d&&!d.done&&(u=f.return)&&u.call(f)}finally{if(h)throw h.error}}return m}(arguments[l]));return n}function __spreadArray(n,l,u){if(u||2==arguments.length)for(var d,h=0,f=l.length;h<f;h++)!d&&h in l||(d||(d=Array.prototype.slice.call(l,0,h)),d[h]=l[h]);return n.concat(d||Array.prototype.slice.call(l))}"function"==typeof SuppressedError&&SuppressedError},48847:function(n){"use strict";n.exports=JSON.parse('{"id":"google-analytics","description":"Install a Google Analytics tag on your website","website":"https://analytics.google.com/analytics/web/","scripts":[{"url":"https://www.googletagmanager.com/gtag/js","params":["id"],"strategy":"worker","location":"head","action":"append"},{"code":"window.dataLayer=window.dataLayer||[];window.gtag=function gtag(){window.dataLayer.push(arguments);};gtag(\'js\',new Date());gtag(\'config\',\'${args.id}\')","strategy":"worker","location":"head","action":"append"}]}')},13240:function(n){"use strict";n.exports=JSON.parse('{"id":"google-maps-embed","description":"Embed a Google Maps embed on your webpage","website":"https://developers.google.com/maps/documentation/embed/get-started","html":{"element":"iframe","attributes":{"loading":"lazy","src":{"url":"https://www.google.com/maps/embed/v1/place","slugParam":"mode","params":["key","q","center","zoom","maptype","language","region"]},"referrerpolicy":"no-referrer-when-downgrade","frameborder":"0","style":"border:0","allowfullscreen":true,"width":null,"height":null}}}')},51991:function(n){"use strict";n.exports=JSON.parse('{"id":"youtube-embed","description":"Embed a YouTube embed on your webpage.","website":"https://github.com/paulirish/lite-youtube-embed","html":{"element":"lite-youtube","attributes":{"videoid":null,"playlabel":null}},"stylesheets":["https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/lite-yt-embed.css"],"scripts":[{"url":"https://cdn.jsdelivr.net/gh/paulirish/lite-youtube-embed@master/src/lite-yt-embed.js","strategy":"idle","location":"head","action":"append"}]}')}},function(n){var __webpack_exec__=function(l){return n(n.s=l)};n.O(0,[9774,179],function(){return __webpack_exec__(66788),__webpack_exec__(86570),__webpack_exec__(29870)}),_N_E=n.O()}]);
//# sourceMappingURL=_app-f9b747f3a8af0a67.js.map