1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(null!=n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:mercury-fem":!0});var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="788e2fb5-4cc4-4ce6-a259-cce18de2c535",e._sentryDebugIdIdentifier="sentry-dbid-788e2fb5-4cc4-4ce6-a259-cce18de2c535")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2410],{9742:(e,t,n)=>{"use strict";let r,i;n.d(t,{Lc:()=>t3,Ts:()=>t1,mY:()=>t2}),function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(s||(s={}));var s,o,a,u,l,c,d,h,f,g,v=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var u=n(),l=u.logger,c=u.logLevel;if(c&&c<s.Debug||!c||!l)return e.apply(i,o);var d={type:"invoke public method",name:t,args:o,stacktrace:(Error().stack||"").split("\n").slice(3).map(function(e){return e.trim()}),time:{start:new Date().toISOString()},states:{}};r&&d.states&&(d.states.before=r());var h=e.apply(i,o);return h&&h.promise?h.promise.then(function(){r&&d.states&&(d.states.after=r()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))}):(r&&d.states&&(d.states.after=r()),d.time&&(d.time.end=new Date().toISOString()),l.debug(JSON.stringify(d,null,2))),h}},p=n(71450),m="Amplitude Logger ",y=function(){function e(){this.logLevel=s.None}return e.prototype.disable=function(){this.logLevel=s.None},e.prototype.enable=function(e){void 0===e&&(e=s.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Verbose||console.log("".concat(m,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Warn||console.warn("".concat(m,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Error||console.error("".concat(m,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<s.Debug||console.log("".concat(m,"[Debug]: ").concat(e.join(" ")))},e}();!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(o||(o={}));var b=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if("object"!=typeof e)return null;var t,n,r,i,s,a,u,l,c,d,h,f,g,v,p,m,y,b,S,w,C,I,E=e.code||0,P=this.buildStatus(E);switch(P){case o.Success:return{status:P,statusCode:E,body:{eventsIngested:null!=(t=e.events_ingested)?t:0,payloadSizeBytes:null!=(n=e.payload_size_bytes)?n:0,serverUploadTime:null!=(r=e.server_upload_time)?r:0}};case o.Invalid:return{status:P,statusCode:E,body:{error:null!=(i=e.error)?i:"",missingField:null!=(s=e.missing_field)?s:"",eventsWithInvalidFields:null!=(a=e.events_with_invalid_fields)?a:{},eventsWithMissingFields:null!=(u=e.events_with_missing_fields)?u:{},eventsWithInvalidIdLengths:null!=(l=e.events_with_invalid_id_lengths)?l:{},epsThreshold:null!=(c=e.eps_threshold)?c:0,exceededDailyQuotaDevices:null!=(d=e.exceeded_daily_quota_devices)?d:{},silencedDevices:null!=(h=e.silenced_devices)?h:[],silencedEvents:null!=(f=e.silenced_events)?f:[],throttledDevices:null!=(g=e.throttled_devices)?g:{},throttledEvents:null!=(v=e.throttled_events)?v:[]}};case o.PayloadTooLarge:return{status:P,statusCode:E,body:{error:null!=(p=e.error)?p:""}};case o.RateLimit:return{status:P,statusCode:E,body:{error:null!=(m=e.error)?m:"",epsThreshold:null!=(y=e.eps_threshold)?y:0,throttledDevices:null!=(b=e.throttled_devices)?b:{},throttledUsers:null!=(S=e.throttled_users)?S:{},exceededDailyQuotaDevices:null!=(w=e.exceeded_daily_quota_devices)?w:{},exceededDailyQuotaUsers:null!=(C=e.exceeded_daily_quota_users)?C:{},throttledEvents:null!=(I=e.throttled_events)?I:[]}};case o.Timeout:default:return{status:P,statusCode:E}}},e.prototype.buildStatus=function(e){return e>=200&&e<300?o.Success:429===e?o.RateLimit:413===e?o.PayloadTooLarge:408===e?o.Timeout:e>
1=400&&e<500?o.Invalid:e>=500?o.Failed:o.Unknown},e}(),S=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,p.C6)(t,e),t.prototype.send=function(e,t){return(0,p.sH)(this,void 0,void 0,function(){var n,r;return(0,p.YH)(this,function(i){switch(i.label){case 0:if("undefined"==typeof fetch)throw Error("FetchTransport is not supported");return[4,fetch(e,{headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"})];case 1:return[4,(n=i.sent()).text()];case 2:r=i.sent();try{return[2,this.buildResponse(JSON.parse(r))]}catch(e){return[2,this.buildResponse({code:n.status})]}}})})},t}(b),w="".concat("AMP","_unsent"),C="$default_instance",I="https://api2.amplitude.com/2/httpapi",E=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:C,logLevel:s.Warn,loggerProvider:new y,offline:!1,optOut:!1,serverUrl:I,serverZone:"US",useBatch:!1}},P=function(){function e(e){this._optOut=!1;var t,n,r,i,s=E();this.apiKey=e.apiKey,this.flushIntervalMillis=null!=(t=e.flushIntervalMillis)?t:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=null!=(n=e.logLevel)?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:s.offline,this.optOut=null!=(r=e.optOut)?r:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!=(i=e.useBatch)?i:s.useBatch,this.loggerProvider.enable(this.logLevel);var o=k(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),k=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=E().serverZone),void 0===n&&(n=E().useBatch),e)return{serverUrl:e,serverZone:void 0};var r,i=["US","EU"].includes(t)?t:E().serverZone;return{serverZone:i,serverUrl:(r=n,"EU"===i?r?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":r?"https://api2.amplitude.com/batch":I)}};(function(){this.sdk={metrics:{histogram:{}}}}).prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(a||(a={}));var q="[Amplitude]",x="".concat(q," Session Replay ID"),O=a.US,R={enabled:!0},M="".concat(q," Session Replay Debug"),_="amp-mask";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision"}(u||(u={}));var T=function(){function e(e){this.logger=e,this.log=this.getSafeMethod("log"),this.warn=this.getSafeMethod("warn"),this.error=this.getSafeMethod("error"),this.debug=this.getSafeMethod("debug")}return e.prototype.getSafeMethod=function(e){if(!this.logger)return function(){};var t,n=this.logger[e];return"function"==typeof n?(null!=(t=n.__rrweb_original__)?t:n).bind(this.logger):function(){}},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),D=n(87449),A="medium",L=function(e,t,n){switch(t){case"light":if("input"!==e)return!0;var r,i,s=n?(i=(r=n).type,r.hasAttribute("data-rr-is-password")?"password":i?i.toLowerCase():null):"";if(!s)return!1;if(["password","hidden","email","tel"].includes(s)||n.autocomplete.startsWith("cc-"))return!0;return!1;case"medium":case"conservative":return!0;default:return L(e,A,n)}},H=function(e,t,n){var r,i,s;if(void 0===t&&(t={defaultMaskLevel:A}),n){if(n.closest("."+_)||(null!=(r=t.maskSelector)?r:[]).some(function(e){return n.closest(e)}))return!0;if(n.closest(".amp-unmask")||(null!=(i=t.unmaskSelector)?i:[]).some(function(e){return n.closest(e)}))return!1}return L(e,null!=(s=t.defaultMaskLevel)?s:A,n)},N=function(e,t){return function(n,r){return H(e,t,r)?n.replace(/[^\s]/g,"*"):n}},F=function(){var e=(0,D.m)();return(null==e?void 0:e.location)?e.location.href:""},j=function(e,t){return t||(e===a.STAGING?"https://api-sr.stag2.amplitude.com/sessions/v2/track":e===a.EU?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")},U=function(e){var t=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");return new RegExp("^".concat(t,"$"))},Q=function(e){if(!e.every(function(e){return"string"==typeof e.selector&&"string"==typeof e.replacement}))throw Error("ugcFilterRules must be an array of objects with selector and replacement properties");if(!e.every(function(e){var t;return"string"==typeof(t=e.selector)&&""!==t.trim()&&!!/^\/|^https?:\/\/[^\s]+$/.test(t)}))throw Error("ugcFilterRules must be an array of objects with valid globs")},B=function(e,t){var n,r;try{for(var i=(0,p.Ju)(t),s=i.next();!s.done;s=i.next()){var o=s.value,a=U(o.selector);if(a.test(e))return e.replace(a,o.replacement)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},Y=function(){return(0,p.sH)(void 0,void 0,void 0,function(){var e,t,n,r;return(0,p.YH)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,3,,4]),!(e=(0,D.m)()))return[3,2];return[4,e.navigator.storage.estimate()];case 1:return n=(t=i.sent()).usage,r=t.quota,[2,{totalStorageSize:n?Math.round(n/1024):0,percentOfQuota:n&&r?Math.round((n/r+Number.EPSILON)*1e3)/1e3:0,usageDetails:JSON.stringify(t.usageDetails)}];case 2:return[3,4];case 3:return i.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:""}]}})})},z=function(e){var t=(0,p.Cl)({},e),n=t.apiKey;return t.apiKey="****".concat(n.substring(n.length-4)),t},K=function(){return{flushMaxRetries:2,logLevel:s.Warn,loggerProvider:new y,transportProvider:new S}},W=function(e){function t(t,n){var r,i,s,o,a,u=this,l=K();return(u=e.call(this,(0,p.Cl)((0,p.Cl)({transportProvider:l.transportProvider,loggerProvider:new T(n.loggerProvider||l.loggerProvider)},n),{apiKey:t}))||this).flushMaxRetries=void 0!==n.flushMaxRetries&&n.flushMaxRetries<=l.flushMaxRetries?n.flushMaxRetries:l.flushMaxRetries,u.apiKey=t,u.sampleRate=n.sampleRate||0,u.serverZone=n.serverZone||O,u.configServerUrl=n.configServerUrl,u.trackServerUrl=n.trackServerUrl,u.shouldInlineStylesheet=n.shouldInlineStylesheet,u.version=n.version,u.performanceConfig=n.performanceConfig||R,u.storeType=null!=(r=n.storeType)?r:"idb",u.applyBackgroun
1dColorToBlockedElements=null!=(i=n.applyBackgroundColorToBlockedElements)&&i,u.enableUrlChangePolling=null!=(s=n.enableUrlChangePolling)&&s,u.urlChangePollingInterval=null!=(o=n.urlChangePollingInterval)?o:1e3,u.captureDocumentTitle=null!=(a=n.captureDocumentTitle)&&a,n.privacyConfig&&(u.privacyConfig=n.privacyConfig),n.interactionConfig&&(u.interactionConfig=n.interactionConfig,u.interactionConfig.ugcFilterRules&&Q(u.interactionConfig.ugcFilterRules)),n.debugMode&&(u.debugMode=n.debugMode),n.experimental&&(u.experimental=n.experimental),n.omitElementTags&&(u.omitElementTags=n.omitElementTags),u}return(0,p.C6)(t,e),t}(P);!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(l||(l={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(c||(c={}));var J=function(e){return{promise:e||Promise.resolve()}},V=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return t},G=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:$(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),$=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},X=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),Z=function(){return(Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function ee(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function et(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var en=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var s=ee(["string","number","boolean","undefined"]),o=s.next();!o.done;o=s.next())if(o.value===i)return e===t}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;var a=Array.isArray(e),u=Array.isArray(t);if(a!==u)return!1;if(a&&u){for(var l=0;l<e.length;l++)if(!en(e[l],t[l]))return!1}else{if(!en(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var c=!0;return Object.keys(e).forEach(function(n){en(e[n],t[n])||(c=!1)}),c}return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var er=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Z({},this.identity.userProperties),n=Z(Z({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,s,o,a,u=n.userProperties||{};try{for(var l=ee(Object.entries(e)),c=l.next();!c.done;c=l.next()){var d=et(c.value,2),h=d[0],f=d[1];switch(h){case"$set":try{for(var g=(i=void 0,ee(Object.entries(f))),v=g.next();!v.done;v=g.next()){var p=et(v.value,2),m=p[0],y=p[1];u[m]=y}}catch(e){i={error:e}}finally{try{v&&!v.done&&(s=g.return)&&s.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(o=void 0,ee(Object.keys(f))),S=b.next();!S.done;S=b.next()){var m=S.value;delete u[m]}}catch(e){o={error:e}}finally{try{S&&!S.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return n.userProperties=u,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return Z({},this.identity)},e.prototype.setIdentity=function(e){var t=Z({},this.identity);this.identity=Z({}
1,e),en(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),ei="undefined"!=typeof globalThis?globalThis:void 0!==n.g?n.g:self,es=function(){function e(){this.identityStore=new er,this.eventBridge=new X,this.applicationContextProvider=new G}return e.getInstance=function(t){return ei.analyticsConnectorInstances||(ei.analyticsConnectorInstances={}),ei.analyticsConnectorInstances[t]||(ei.analyticsConnectorInstances[t]=new e),ei.analyticsConnectorInstances[t]},e}(),eo=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(eo||{}),ea=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ea||{}),eu=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(eu||{}),el=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(el||{}),ec=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ec||{}),ed=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ed||{}),eh=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(eh||{}),ef=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ef||{}),eg=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),ev=(0,p.fX)([],(0,p.zs)(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,"0")}),ep=function(e){var t,n=(0,D.m)();if(!(null==(t=null==n?void 0:n.crypto)?void 0:t.getRandomValues))return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ep);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,(0,p.fX)([],(0,p.zs)(r.entries()),!1).map(function(e){var t=(0,p.zs)(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(ev[r]):ev[r]}).join("")},em=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new eg(e,t)}return e.prototype.subscribe=function(e,t,n){var r=ep(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return -1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return(0,p.sH)(this,void 0,void 0,function(){var e,t=this;return(0,p.YH)(this,function(n){switch(n.label){case 0:return[4,this.fetch()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach(function(n){t.sendCallback(n,e,"remote")}),[2]}})})},e.prototype.subscribeAll=function(e){return(0,p.sH)(this,void 0,void 0,function(){var t,n,r,i=this;return(0,p.YH)(this,function(s){switch(s.label){case 0:return t=this.fetch().then(function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return void 0!==(r=s.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),this.sendCallback(e,r,"cache")),[4,t];case 2:return s.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return(0,p.sH)(this,void 0,void 0,function(){var n,r;return(0,p.YH)(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n("Timeout exceeded")},t)}
1),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.fetch(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce(function(e,t){return null===e?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),(0,p.sH)(this,void 0,void 0,function(){var n,r,i,s,o,a,u=this;return(0,p.YH)(this,function(l){switch(l.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,o,a,l,c;return(0,p.YH)(this,function(d){switch(d.label){case 0:i=new AbortController,o=setTimeout(function(){return i.abort()},t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(s.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:if((a=d.sent()).ok)return[3,4];return[4,a.text()];case 3:return l=d.sent(),s.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(l)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(c=d.sent())instanceof Error&&"AbortError"===c.name?s.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):s.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),c),[3,9];case 8:return clearTimeout(o),[7];case 9:if(!(r<e-1))return[3,11];return[4,new Promise(function(e){return setTimeout(e,u.getJitterDelay(n))})];case 10:d.sent(),d.label=11;case 11:return[2]}})},s=this,o=0,l.label=1;case 1:if(!(o<e))return[3,4];return[5,i(o)];case 2:if("object"==typeof(a=l.sent()))return[2,a.value];l.label=3;case 3:return o++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),ey=function(e,t){var n=document.createDocumentFragment(),r=function(e){if(void 0===e&&(e=[]),"string"==typeof e&&(e=[e]),0!==(e=e.filter(function(e){try{n.querySelector(e)}catch(n){return t.warn('[session-replay-browser] omitting selector "'.concat(e,'" because it is invalid')),!1}return!0})).length)return e};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},eb=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){var e,t,n;return(0,p.sH)(this,void 0,void 0,function(){var r,i,s,o,a,u,l,c,d,h,f,g,v,m,y,b,S=this;return(0,p.YH)(this,function(w){switch(w.label){case 0:return(r=(0,p.Cl)({},this.localConfig)).optOut=this.localConfig.optOut,r.captureEnabled=!0,[4,new Promise(function(e){S.remoteConfigClient.subscribe("configs.sessionReplay","all",function(t,n){var s;if(S.localConfig.loggerProvider.debug("Session Replay remote configuration received from ".concat(n,":"),JSON.stringify(t,null,2)),t){var o=t.sr_sampling_config,a=t.sr_privacy_config,u=t.sr_targeting_config,l=null==(s=r.interactionConfig)?void 0:s.ugcFilterRules;r.interactionConfig=t.sr_interaction_config,r.interactionConfig&&l&&(r.interactionConfig.ugcFilterRules=l),r.loggingConfig=t.sr_logging_config,(o||a||u)&&(i={},o&&(i.sr_sampling_config=o),a&&(i.sr_privacy_config=a),u&&(i.sr_targeting_config=u))}e()})})];case 1:if(w.sent(),!i)return[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:i}];if(s=i.sr_sampling_config,o=i.sr_privacy_config,a=i.sr_targeting_config,s&&Object.keys(s).length>0?(Object.prototype.hasOwnProperty.call(s,"capture_enabled")?r.captureEnabled=s.capture_enabled:r.captureEnabled=!1,Object.prototype.hasOwnProperty.call(s,"sample_rate")&&(r.sampleRate=s.sample_rate)):(r.captureEnabled=!0,this.localConfig.loggerProvider.debug("Remote config successfully fetched, but no values set for project, Session Replay capture enabled.")),o){u=null!=(e=r.privacyConfig)?e:{},l={defaultMaskLevel:null!=(n=null!=(t=o.defaultMaskLevel)?t:u.defaultMaskLevel)?n:"medium",blockSelector:[],maskSelector:[],unmaskSelector:[]},c=function(e){var t,n,r,i,s,o,a,u,l,c={};"string"==typeof e.blockSelector&&(e.blockSelector=[e.blockSelector]);try{for(var d=(0,p.Ju)(null!=(a=e.blockSelector)?a:[]),h=d.next();!h.done;h=d.next()){var f=h.value;c[f]="block"}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}try{for(var g=(0,p.Ju)(null!=(u=e.maskSelector)?u:[]),v=g.next();!v.done;v=g.next()){var f=v.value;c[f]="mask"}}catch(e){r={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}try{for(var m=(0,p.Ju)(null!=(l=e.unmaskSelector)?l:[]),y=m.next();!y.done;y=m.next()){var f=y.value;c[f]="unmask"}}catch(e){s={error:e}}
1finally{try{y&&!y.done&&(o=m.return)&&o.call(m)}finally{if(s)throw s.error}}return c},d=(0,p.Cl)((0,p.Cl)({},c(u)),c(o));try{for(f=(h=(0,p.Ju)(Object.entries(d))).next();!f.done;f=h.next())v=(g=(0,p.zs)(f.value,2))[0],m=g[1],"mask"===m?l.maskSelector.push(v):"block"===m?l.blockSelector.push(v):"unmask"===m&&l.unmaskSelector.push(v)}catch(e){y={error:e}}finally{try{f&&!f.done&&(b=h.return)&&b.call(h)}finally{if(y)throw y.error}}r.privacyConfig=ey(l,this.localConfig.loggerProvider)}return a&&Object.keys(a).length>0&&(r.targetingConfig=a),this.localConfig.loggerProvider.debug(JSON.stringify({name:"session replay joined config",config:z(r)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:r,remoteConfig:i}]}})})},e}(),eS=Uint8Array,ew=Uint16Array,eC=Uint32Array,eI=new eS([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]),eE=new eS([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]),eP=new eS([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ek=function(e,t){for(var n=new ew(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new eC(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},eq=ek(eI,2),ex=eq[0],eO=eq[1];ex[28]=258,eO[258]=28;for(var eR=ek(eE,0),eM=(eR[0],eR[1]),e_=new ew(32768),eT=0;eT<32768;++eT){var eD=(43690&eT)>>>1|(21845&eT)<<1;eD=(61680&(eD=(52428&eD)>>>2|(13107&eD)<<2))>>>4|(3855&eD)<<4,e_[eT]=((65280&eD)>>>8|(255&eD)<<8)>>>1}for(var eA=function(e,t,n){for(var r,i=e.length,s=0,o=new ew(t);s<i;++s)++o[e[s]-1];var a=new ew(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;if(n){r=new ew(1<<t);var u=15-t;for(s=0;s<i;++s)if(e[s])for(var l=s<<4|e[s],c=t-e[s],d=a[e[s]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)r[e_[d]>>>u]=l}else for(s=0,r=new ew(i);s<i;++s)r[s]=e_[a[e[s]-1]++]>>>15-e[s];return r},eL=new eS(288),eT=0;eT<144;++eT)eL[eT]=8;for(var eT=144;eT<256;++eT)eL[eT]=9;for(var eT=256;eT<280;++eT)eL[eT]=7;for(var eT=280;eT<288;++eT)eL[eT]=8;for(var eH=new eS(32),eT=0;eT<32;++eT)eH[eT]=5;var eN=eA(eL,9,0),eF=eA(eH,5,0),ej=function(e){return(e/8|0)+(7&e&&1)},eU=function(e,t,n){(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof ew?ew:e instanceof eC?eC:eS)(n-t);return r.set(e.subarray(t,n)),r},eQ=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},eB=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},eY=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new eS(0),0];if(1==i){var o=new eS(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:a.f+u.f,l:a,r:u};c!=i-1;)a=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:a.f+u.f,l:a,r:u};for(var h=s[0].s,r=1;r<i;++r)s[r].s>h&&(h=s[r].s);var f=new ew(h+1),g=ez(n[c-1],f,0);if(g>t){var r=0,v=0,p=g-t,m=1<<p;for(s.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});r<i;++r){var y=s[r].s;if(f[y]>t)v+=m-(1<<g-f[y]),f[y]=t;else break}for(v>>>=p;v>0;){var b=s[r].s;f[b]<t?v-=1<<t-f[b]++-1:++r}for(;r>=0&&v;--r){var S=s[r].s;f[S]==t&&(--f[S],++v)}g=t}return[new eS(f),g]},ez=function(e,t,n){return -1==e.s?Math.max(ez(e.l,t,n+1),ez(e.r,t,n+1)):t[e.s]=n},eK=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ew(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&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(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},eW=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},eJ=function(e,t,n){var r=n.length,i=ej(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},eV=function(e,t,n,r,i,s,o,a,u,l,c){eQ(t,c++,n),++i[256];for(var d,h,f,g,v=eY(i,15),p=v[0],m=v[1],y=eY(s,15),b=y[0],S=y[1],w=eK(p),C=w[0],I=w[1],E=eK(b),P=E[0],k=E[1],q=new ew(19),x=0;x<C.length;++x)q[31&C[x]]++;for(var x=0;x<P.length;++x)q[31&P[x]]++;for(var O=eY(q,7),R=O[0],M=O[1],_=19;_>4&&!R[eP[_-1]];--_);var T=l+5<<3,D=eW(i,eL)+eW(s,eH)+o,A=eW(i,p)+eW(s,b)+o+14+3*_+eW(q,R)+(2*q[16]+3*q[17]+7*q[18]);if(T<=D&&T<=A)return eJ(t,c,e.subarray(u,u+l));
1if(eQ(t,c,1+(A<D)),c+=2,A<D){d=eA(p,m,0),h=p,f=eA(b,S,0),g=b;var L=eA(R,M,0);eQ(t,c,I-257),eQ(t,c+5,k-1),eQ(t,c+10,_-4),c+=14;for(var x=0;x<_;++x)eQ(t,c+3*x,R[eP[x]]);c+=3*_;for(var H=[C,P],N=0;N<2;++N)for(var F=H[N],x=0;x<F.length;++x){var j=31&F[x];eQ(t,c,L[j]),c+=R[j],j>15&&(eQ(t,c,F[x]>>>5&127),c+=F[x]>>>12)}}else d=eN,h=eL,f=eF,g=eH;for(var x=0;x<a;++x)if(r[x]>255){var j=r[x]>>>18&31;eB(t,c,d[j+257]),c+=h[j+257],j>7&&(eQ(t,c,r[x]>>>23&31),c+=eI[j]);var U=31&r[x];eB(t,c,f[U]),c+=g[U],U>3&&(eB(t,c,r[x]>>>5&8191),c+=eE[U])}else eB(t,c,d[r[x]]),c+=h[r[x]];return eB(t,c,d[256]),c+h[256]},eG=new eC([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),e$=function(e,t,n,r,i,s){var o=e.length,a=new eS(r+o+5*(1+Math.floor(o/7e3))+i),u=a.subarray(r,a.length-i),l=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?l=eJ(u,l,e.subarray(c,d)):(u[c]=s,l=eJ(u,l,e.subarray(c,o)))}else{for(var h=eG[t-1],f=h>>>13,g=8191&h,v=(1<<n)-1,p=new ew(32768),m=new ew(v+1),y=Math.ceil(n/3),b=2*y,S=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<b)&v},w=new eC(25e3),C=new ew(288),I=new ew(32),E=0,P=0,c=0,k=0,q=0,x=0;c<o;++c){var O=S(c),R=32767&c,M=m[O];if(p[R]=M,m[O]=R,q<=c){var _=o-c;if((E>7e3||k>24576)&&_>423){l=eV(e,u,0,w,C,I,P,k,x,c-x,l),k=E=P=0,x=c;for(var T=0;T<286;++T)C[T]=0;for(var T=0;T<30;++T)I[T]=0}var D=2,A=0,L=g,H=R-M&32767;if(_>2&&O==S(c-H))for(var N=Math.min(f,_)-1,F=Math.min(32767,c),j=Math.min(258,_);H<=F&&--L&&R!=M;){if(e[c+D]==e[c+D-H]){for(var U=0;U<j&&e[c+U]==e[c+U-H];++U);if(U>D){if(D=U,A=H,U>N)break;for(var Q=Math.min(H,U-2),B=0,T=0;T<Q;++T){var Y=c-H+T+32768&32767,z=p[Y],K=Y-z+32768&32767;K>B&&(B=K,M=Y)}}}M=p[R=M],H+=R-M+32768&32767}if(A){w[k++]=0x10000000|eO[D]<<18|eM[A];var W=31&eO[D],J=31&eM[A];P+=eI[W]+eE[J],++C[257+W],++I[J],q=c+D,++E}else w[k++]=e[c],++C[e[c]]}}l=eV(e,u,s,w,C,I,P,k,x,c-x,l)}return eU(a,0,r+ej(l)+i)},eX=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)r+=n[o],i+=r;r%=65521,i%=65521}e=r,t=i},d:function(){return(e>>>8<<16|(255&t)<<8|t>>>8)+((255&e)<<23)*2}}},eZ=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},e0=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},e1=function(){function e(e,t,n,r){var i,s=this;this.taskQueue=[],this.isProcessing=!1,this.compressEvent=function(e){return JSON.stringify(function(e,t){var n="";if(!t&&"undefined"!=typeof TextDecoder)return new TextDecoder().decode(e);for(var r=0;r<e.length;){var i=e[r++];i<128||t?n+=String.fromCharCode(i):i<224?n+=String.fromCharCode((31&i)<<6|63&e[r++]):i<240?n+=String.fromCharCode((15&i)<<12|(63&e[r++])<<6|63&e[r++]):n+=String.fromCharCode(55296|(i=((15&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536)>>10,56320|1023&i)}return n}(function(e,t){void 0===t&&(t={});var n,r=eX();r.p(e);var i=e$(e,null==(n=t).level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+n.mem,2,4,!0);return e0(i,t),eZ(i,i.length-4,r.d()),i}(function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return new TextEncoder().encode(e);for(var r=new eS(e.length+(e.length>>>1)),i=0,s=function(e){r[i++]=e},o=0;o<n;++o){if(i+5>r.length){var a=new eS(i+8+(n-o<<1));a.set(r),r=a}var u=e.charCodeAt(o);u<128?s(u):(u<2048?s(192|u>>>6):(u>55295&&u<57344?(s(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),s(128|u>>>12&63)):s(224|u>>>12),s(128|u>>>6&63)),s(128|63&u))}return eU(r,0,i)}(JSON.stringify({...e,v:"v1"}))),!0))},this.addCompressedEventToManager=function(e,t){s.eventsManager&&s.deviceId&&s.eventsManager.addEvent({event:{type:"replay",data:e},sessionId:t,deviceId:s.deviceId})},this.addCompressedEvent=function(e,t){if(s.worker)try{s.worker.postMessage({event:e,sessionId:t})}catch(n){"DataCloneError"===n.name?s.worker.postMessage(JSON.stringify({event:e,sessionId:t})):s.config.loggerProvider.warn("Unexpected error while posting message to worker:",n)}else{var n=s.compressEvent(e);s.addCompressedEventToManager(n,t)}},this.terminate=function(){var e;null==(e=s.worker)||e.terminate()};var o=(0,D.m)();if(this.canUseIdleCallback=o&&"requestIdleCallback"in o,this.eventsManager=e,this.config=t,this.deviceId=n,this.timeout=(null==(i=t.performanceConfig)?void 0:i.timeout)||2e3,r){t.loggerProvider.log("[Experimental] Enabling web worker for compression");var a=new Worker(URL.createObjectURL(new Blob([r],{type:"application/javascript"})));a.onerror=function(e){t.loggerProvider.error(e)},a.onmessage=function(e){var t=e.data,n=t.compressedEvent,r=t.sessionId;s.addCompressedEventToManager(n,r)},this.worker=a}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var n;this.canUseIdleCallback&&(null==(n=this.config.performanceConfig)?void 0:n.enabled)?(this.config.loggerProvider.debug("Enqueuing event for processing during idle time."),this.taskQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug("Processing event without idle callback."),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){for(var t=this;this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var n=this.taskQueue.shift();if(n){var r=n.event,i=n.sessionId;this.addCompressedEvent(r,i)}}this.taskQueue.length>0?requestIdleCallback(function(e){t.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e}(),e2="Failed to store session replay events in IndexedDB",e3="1.29.3",e4=function(){function e(e){var t=e.trackServerUrl,n=e.loggerProvider,r=e.payloadBatcher;this.storageKey="",this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.loggerProvider=n,this.payloadBatcher=r||function(e){return e},this.trackServerUrl=t}return e.prototype.sendEventsList=function(e){this.addToQueue((0,p.Cl)((0,p.Cl)({},e),{attempts:0,timeout:0}))},e.prototype.addToQueue=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.filter(function(t){return t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:"Session replay event batch rejected due to exceeded retry count"}),!1)}
1).forEach(function(t){if(e.queue=e.queue.concat(t),0===t.timeout)return void e.schedule(0);setTimeout(function(){t.timeout=0,e.schedule(0)},t.timeout)})},e.prototype.schedule=function(e){var t=this;this.scheduled||(this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},e))},e.prototype.flush=function(e){return void 0===e&&(e=!1),(0,p.sH)(this,void 0,void 0,function(){var t,n,r=this;return(0,p.YH)(this,function(i){switch(i.label){case 0:return t=[],n=[],this.queue.forEach(function(e){return 0===e.timeout?t.push(e):n.push(e)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),[4,Promise.all(t.map(function(t){return r.send(t,e)}))];case 1:return i.sent(),[2]}})})},e.prototype.send=function(e,t){var n,r;return void 0===t&&(t=!0),(0,p.sH)(this,void 0,void 0,function(){var i,s,o,a,u,l,c,d,h,f,g,v;return(0,p.YH)(this,function(p){switch(p.label){case 0:if(!(i=e.apiKey))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing api key"})];if(!(s=e.deviceId))return[2,this.completeRequest({context:e,err:"Session replay event batch not sent due to missing device ID"})];if(o=F(),a=e3,u=e.sampleRate,l=new URLSearchParams({device_id:s,session_id:"".concat(e.sessionId),type:"".concat(e.type)}),c="".concat((null==(n=e.version)?void 0:n.type)||"standalone","/").concat((null==(r=e.version)?void 0:r.version)||a),0===(d=this.payloadBatcher({version:1,events:e.events})).events.length)return this.completeRequest({context:e}),[2];p.label=1;case 1:return p.trys.push([1,3,,4]),h={headers:{"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(i),"X-Client-Version":a,"X-Client-Library":c,"X-Client-Url":o.substring(0,1e3),"X-Client-Sample-Rate":"".concat(u)},body:JSON.stringify(d),method:"POST"},[4,fetch("".concat(j(e.serverZone,this.trackServerUrl),"?").concat(l.toString()),h)];case 2:if(null===(f=p.sent()))return this.completeRequest({context:e,err:"Unexpected error occurred"}),[2];if(t)this.handleReponse(f.status,e);else{g="";try{g=JSON.stringify(f.body,null,2)}catch(e){}this.completeRequest({context:e,success:"".concat(f.status,": ").concat(g)})}return[3,4];case 3:return v=p.sent(),this.completeRequest({context:e,err:v}),[3,4];case 4:return[2]}})})},e.prototype.handleReponse=function(e,t){switch(new b().buildStatus(e)){case o.Success:this.handleSuccessResponse(t);break;case o.Failed:this.handleOtherResponse(t);break;default:this.completeRequest({context:t,err:"Network error occurred, event batch rejected"})}},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/1024);this.completeRequest({context:e,success:"Session replay event batch tracked successfully for session id ".concat(e.sessionId,", size of events: ").concat(t," KB")})},e.prototype.handleOtherResponse=function(e){this.addToQueue((0,p.Cl)((0,p.Cl)({},e),{timeout:e.attempts*this.retryTimeout}))},e.prototype.completeRequest=function(e){var t=e.context,n=e.err,r=e.success;t.onComplete(),n?this.loggerProvider.warn(n):r&&this.loggerProvider.log(r)},e}();let e5=(e,t)=>t.some(t=>e instanceof t),e6=new WeakMap,e8=new WeakMap,e7=new WeakMap,e9={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return e6.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return te(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function te(e){if(e instanceof IDBRequest){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(te(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)});return e7.set(t,e),t}if(e8.has(e))return e8.get(e);let t=function(e){if("function"==typeof e)return(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(tt(this),t),te(this.request)}:function(...t){return te(e.apply(tt(this),t))};return(e instanceof IDBTransaction&&function(e){if(e6.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});e6.set(e,t)}(e),e5(e,r||(r=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,e9):e}(e);return t!==e&&(e8.set(e,t),e7.set(t,e)),t}let tt=e=>e7.get(e);function tn(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){let o=indexedDB.open(e,t),a=te(o);return r&&o.addEventListener("upgradeneeded",e=>{r(te(o.result),e.oldVersion,e.newVersion,te(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}let tr=["get","getKey","getAll","getAllKeys","count"],ti=["put","add","delete","clear"],ts=new Map;function to(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(ts.get(t))return ts.get(t);let n=t.replace(/FromIndex$/,""),r=t!==n,i=ti.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||tr.includes(n)))return;let s=async function(e,...t){let s=this.transaction(e,i?"readwrite":"readonly"),o=s.store;
1return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]};return ts.set(t,s),s}e9=(e=>({...e,get:(t,n,r)=>to(t,n)||e.get(t,n,r),has:(t,n)=>!!to(t,n)||e.has(t,n)}))(e9);let ta=["continue","continuePrimaryKey","advance"],tu={},tl=new WeakMap,tc=new WeakMap,td={get(e,t){if(!ta.includes(t))return e[t];let n=tu[t];return n||(n=tu[t]=function(...e){tl.set(this,tc.get(this)[t](...e))}),n}};async function*th(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let n=new Proxy(t,td);for(tc.set(n,t),e7.set(n,tt(t));t;)yield n,t=await (tl.get(n)||t.continue()),tl.delete(n)}function tf(e,t){return t===Symbol.asyncIterator&&e5(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&e5(e,[IDBIndex,IDBObjectStore])}e9=(e=>({...e,get:(t,n,r)=>tf(t,n)?th:e.get(t,n,r),has:(t,n)=>tf(t,n)||e.has(t,n)}))(e9);var tg=function(){function e(e){var t,n,r,i=this;this.minInterval=500,this.maxInterval=1e4,this.maxPersistedEventsSize=1e6,this.interval=this.minInterval,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,t){var n=i.getStringSize(t);return i.getEventsArraySize(e)+n>=i.maxPersistedEventsSize||Date.now()-i.timeAtLastSplit>i.interval&&!!e.length&&(i.interval=Math.min(i.maxInterval,i.interval+i.minInterval),i._timeAtLastSplit=Date.now(),!0)},this.loggerProvider=e.loggerProvider,this.minInterval=null!=(t=e.minInterval)?t:this.minInterval,this.maxInterval=null!=(n=e.maxInterval)?n:this.maxInterval,this.maxPersistedEventsSize=null!=(r=e.maxPersistedEventsSize)?r:this.maxPersistedEventsSize}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){return e.length},e.prototype.getEventsArraySize=function(e){var t,n,r=0;try{for(var i=(0,p.Ju)(e),s=i.next();!s.done;s=i.next()){var o=s.value;r+=this.getStringSize(o)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r+(2+Math.max(0,e.length-1)+2*e.length)},e}();!function(e){e.RECORDING="recording",e.SENT="sent"}(d||(d={}));var tv="sessionCurrentSequence",tp="sequencesToSend",tm=function(){var e=(0,D.m)();return new Promise(function(t,n){if(!e)return n(Error("Global scope not found"));if(!e.indexedDB)return n(Error("Session Replay: cannot find indexedDB"));try{var r=e.indexedDB.open("keyval-store");r.onupgradeneeded=function(){1===r.result.version&&(r.result.close(),r.transaction&&r.transaction.abort(),e.indexedDB.deleteDatabase("keyval-store"),t())},r.onsuccess=function(){t(r.result)},r.onerror=function(){n(r.error)}}catch(e){n(e)}})},ty=function(e){return(0,p.sH)(void 0,void 0,void 0,function(){return(0,p.YH)(this,function(t){switch(t.label){case 0:if(!(e.length>0))return[3,2];return[4,Promise.all(e.splice(0,10))];case 1:return t.sent(),[3,0];case 2:return[2]}})})},tb=function(e){var t,n;return e.objectStoreNames.contains(tv)||(n=e.createObjectStore(tv,{keyPath:"sessionId"})),e.objectStoreNames.contains(tp)||(t=e.createObjectStore(tp,{keyPath:"sequenceId",autoIncrement:!0})).createIndex("sessionId","sessionId"),{sequencesStore:t,currentSequenceStore:n}},tS=function(e){function t(t){var n=e.call(this,t)||this;return n.getSequencesToSend=function(){return(0,p.sH)(n,void 0,void 0,function(){var e,t,n,r,i,s;return(0,p.YH)(this,function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),e=[],[4,this.db.transaction("sequencesToSend").store.openCursor()];case 1:t=o.sent(),o.label=2;case 2:if(!t)return[3,4];return r=(n=t.value).sessionId,i=n.events,e.push({events:i,sequenceId:t.key,sessionId:r}),[4,t.continue()];case 3:return t=o.sent(),[3,2];case 4:return[2,e];case 5:return s=o.sent(),this.loggerProvider.warn("".concat(e2,": ").concat(s)),[3,6];case 6:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return(0,p.sH)(n,void 0,void 0,function(){var t,n,r;return(0,p.YH)(this,function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),[4,this.db.get(tv,e)];case 1:if(!(t=i.sent()))return[2,void 0];return[4,this.db.put(tp,{sessionId:e,events:t.events})];case 2:return n=i.sent(),[4,this.db.put(tv,{sessionId:e,events:[]})];case 3:return i.sent(),[2,(0,p.Cl)((0,p.Cl)({},t),{sessionId:e,sequenceId:n})];case 4:return r=i.sent(),this.loggerProvider.warn("".concat(e2,": ").concat(r)),[3,5];case 5:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return(0,p.sH)(n,void 0,void 0,function(){var n,r,i,s,o,a;return(0,p.YH)(this,function(u){switch(u.label){case 0:return u.trys.push([0,10,,11]),[4,(n=this.db.transaction(tv,"readwrite")).store.get(e)];case 1:if(r=u.sent())return[3,3];return[4,n.store.put({sessionId:e,events:[t]})];case 2:return u.sent(),[2];case 3:if(i=void 0,!this.shouldSplitEventsList(r.events,t))return[3,5];return i=r.events,[4,n.store.put({sessionId:e,events:[t]})];case 4:return u.sent(),[3,7];case 5:return s=r.events.concat(t),[4,n.store.put({sessionId:e,events:s})];case 6:u.sent(),u.label=7;case 7:return[4,n.done];case 8:if(u.sent(),!i)return[2,void 0];return[4,this.storeSendingEvents(e,i)];case 9:if(!(o=u.sent()))return[2,void 0];return[2,{events:i,sessionId:e,sequenceId:o}];case 10:return a=u.sent(),this.loggerProvider.warn("".concat(e2,": ").concat(a)),[3,11];case 11:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return(0,p.sH)(n,void 0,void 0,function(){var n;return(0,p.YH)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.db.put(tp,{sessionId:e,events:t})];case 1:return[2,r.sent()];case 2:return n=r.sent(),this.loggerProvider.warn("".concat(e2,": ").concat(n)),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return(0,p.sH)(n,void 0,void 0,function(){var e;return(0,p.YH)(this,function(n){switch(n.label){case 0:if(!t)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.db.delete(tp,t)];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),this.loggerProvider.warn("".concat(e2,": ").concat(e)),[3,4];case 4:return[2]}})})},n.transitionFromKeyValStore=function(e){return(0,p.sH)(n,void 0,void 0,function(){var t,n,r,i,s,o,a,u=this;return(0,p.YH)(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,tm()];case 1:if(!(t=l.sent()))return[2];n=function(e,t){return(0,p.sH)(u,void 0,void 0,function(){var n,r,i=this;return(0,p.YH)(this,function(s){switch(s.label){case 0:return n=t.sessionSequences,r=[],Object.keys(n).forEac
1h(function(s){var o=parseInt(s,10),a=n[o];if(o===t.currentSequenceId){var u=a.events.map(function(t){return(0,p.sH)(i,void 0,void 0,function(){return(0,p.YH)(this,function(n){return[2,this.addEventToCurrentSequence(e,t)]})})});r.push.apply(r,(0,p.fX)([],(0,p.zs)(u),!1))}else a.status!==d.SENT&&r.push(i.storeSendingEvents(e,a.events))}),[4,ty(r)];case 1:return s.sent(),[2]}})})},r="".concat(w,"_").concat(this.apiKey.substring(0,10)),l.label=2;case 2:return l.trys.push([2,4,,5]),i=t.transaction("keyval").objectStore("keyval").getAll(r),[4,new Promise(function(t){i.onsuccess=function(r){return(0,p.sH)(u,void 0,void 0,function(){var i,s,o,a=this;return(0,p.YH)(this,function(u){switch(u.label){case 0:if(!(s=(i=r&&r.target.result)&&i[0]))return[3,2];return o=[],Object.keys(s).forEach(function(t){var r=parseInt(t,10),i=s[r];if(e===r)o.push(n(r,i));else{var u=i.sessionSequences;Object.keys(u).forEach(function(e){var t=parseInt(e,10);u[t].status!==d.SENT&&o.push(a.storeSendingEvents(r,u[t].events))})}}),[4,ty(o)];case 1:u.sent(),u.label=2;case 2:return t(),[2]}})})}})];case 3:return l.sent(),(s=(0,D.m)())&&s.indexedDB.deleteDatabase("keyval-store"),[3,5];case 4:return o=l.sent(),this.loggerProvider.warn("Failed to transition session replay events from keyval to new store: ".concat(o)),[3,5];case 5:return[3,7];case 6:return a=l.sent(),this.loggerProvider.warn("Failed to access keyval store: ".concat(a,". For more information, visit: https://www.docs.developers.amplitude.com/session-replay/sdks/standalone/#indexeddb-best-practices")),[3,7];case 7:return[2]}})})},n.apiKey=t.apiKey,n.db=t.db,n}return(0,p.C6)(t,e),t.new=function(e,n,r){return(0,p.sH)(this,void 0,void 0,function(){var i,s,o,a;return(0,p.YH)(this,function(u){switch(u.label){case 0:var l;return u.trys.push([0,3,,4]),i="replay"===e?"":"_".concat(e),[4,(l="".concat(n.apiKey.substring(0,10),"_amp_session_replay_events").concat(i),(0,p.sH)(void 0,void 0,void 0,function(){return(0,p.YH)(this,function(e){switch(e.label){case 0:return[4,tn(l,1,{upgrade:tb})];case 1:return[2,e.sent()]}})}))];case 1:return s=u.sent(),[4,(o=new t((0,p.Cl)((0,p.Cl)({},n),{db:s}))).transitionFromKeyValStore(r)];case 2:return u.sent(),[2,o];case 3:return a=u.sent(),n.loggerProvider.warn("".concat(e2,": ").concat(a)),[3,4];case 4:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return(0,p.sH)(this,void 0,void 0,function(){var t,n,r,i,s,o;return(0,p.YH)(this,function(a){switch(a.label){case 0:if(!e)return[3,2];return[4,this.db.get("sessionCurrentSequence",e)];case 1:if(!(t=a.sent()))return[2,void 0];return[2,[t]];case 2:n=[],a.label=3;case 3:return a.trys.push([3,8,9,10]),[4,this.db.getAll("sessionCurrentSequence")];case 4:i=(r=p.Ju.apply(void 0,[a.sent()])).next(),a.label=5;case 5:if(i.done)return[3,7];
1t=i.value,n.push(t),a.label=6;case 6:return i=r.next(),[3,5];case 7:return[3,10];case 8:return s={error:a.sent()},[3,10];case 9:try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(s)throw s.error}return[7];case 10:return[2,n]}})})},t}(tg),tw=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t}return(0,p.C6)(t,e),t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,n=(0,p.fX)([],(0,p.zs)(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:n},this.resetCurrentSequence(e),{sequenceId:t,events:n,sessionId:e}},t.prototype.getSequencesToSend=function(){return(0,p.sH)(this,void 0,void 0,function(){return(0,p.YH)(this,function(e){return[2,Object.entries(this.finalizedSequences).map(function(e){var t=(0,p.zs)(e,2),n=t[0],r=t[1],i=r.sessionId,s=r.events;return{sequenceId:Number(n),sessionId:i,events:s}})]})})},t.prototype.storeCurrentSequence=function(e){return(0,p.sH)(this,void 0,void 0,function(){return(0,p.YH)(this,function(t){return this.sequences[e]?[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return(0,p.sH)(this,void 0,void 0,function(){var n;return(0,p.YH)(this,function(r){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(n=this.addSequence(e)),this.sequences[e].push(t),[2,n]})})},t.prototype.storeSendingEvents=function(e,t){return(0,p.sH)(this,void 0,void 0,function(){return(0,p.YH)(this,function(n){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return(0,p.sH)(this,void 0,void 0,function(){return(0,p.YH)(this,function(e){return void 0!==t&&delete this.finalizedSequences[t],[2]})})},t}(tg),tC=function(e){var t=e.config,n=e.sessionId,r=e.minInterval,i=e.maxInterval,s=e.type,o=e.payloadBatcher,a=e.storeType;return(0,p.sH)(void 0,void 0,void 0,function(){var e,u,l,c,d;function h(t){return void 0===t&&(t=!1),(0,p.sH)(this,void 0,void 0,function(){return(0,p.YH)(this,function(n){return[2,e.flush(t)]})})}return(0,p.YH)(this,function(f){switch(f.label){case 0:if(e=new e4((0,p.Cl)((0,p.Cl)({},t),{loggerProvider:t.loggerProvider,payloadBatcher:o})),u=function(){return new tw({loggerProvider:t.loggerProvider,maxInterval:i,minInterval:r})},"idb"!==a)return[3,2];return[4,(0,p.sH)(void 0,void 0,void 0,function(){var e;return(0,p.YH)(this,function(o){switch(o.label){case 0:return[4,tS.new(s,{loggerProvider:t.loggerProvider,minInterval:r,maxInterval:i,apiKey:t.apiKey},n)];case 1:return e=o.sent(),t.loggerProvider.log("Failed to initialize idb store, falling back to memory store."),[2,null!=e?e:u()]}})})];case 1:return c=f.sent(),[3,3];case 2:c=u(),f.label=3;case 3:return l=c,d=function(n){var r=n.events,i=n.sessionId,o=n.deviceId,a=n.sequenceId;t.debugMode&&Y().then(function(e){var n=e.totalStorageSize,r=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug("Total storage size: ".concat(n," KB, percentage of quota: ").concat(r,"%, usage details: ").concat(i))}).catch(function(){}),e.sendEventsList({events:r,sessionId:i,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:o,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:s,onComplete:function(){return(0,p.sH)(void 0,void 0,void 0,function(){return(0,p.YH)(this,function(e){switch(e.label){case 0:return[4,l.cleanUpSessionEventsStore(i,a)];case 1:return e.sent(),[2]}})})}})},[2,{sendCurrentSequenceEvents:function(e){var n=e.sessionId,r=e.deviceId;l.storeCurrentSequence(n).then(function(e){e&&d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})}).catch(function(e){t.loggerProvider.warn("Failed to get current sequence of session replay events for session:",e)})},addEvent:function(e){var n=e.event,r=e.sessionId,i=e.deviceId;l.addEventToCurrentSequence(r,n.data).then(function(e){return e&&d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}).catch(function(e){t.loggerProvider.warn("Failed to add event to session replay capture:",e)})},sendStoredEvents:function(e){var t=e.deviceId;return(0,p.sH)(void 0,void 0,void 0,function(){var e;return(0,p.YH)(this,function(n){switch(n.label){case 0:return[4,l.getSequencesToSend()];case 1:return(e=n.sent())&&e.forEach(function(e){d({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:t})}),[2]}})})},flush:h}]}})})},tI=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new Map;e.forEach(function(e){n.set(e.name,e.manager)}),this.managers=n}return e.prototype.sendStoredEvents=function(e){return(0,p.sH)(this,void 0,void 0,function(){var t;return(0,p.YH)(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEac
1h(function(n){t.push(n.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,n=e.sessionId,r=e.event,i=e.deviceId;null==(t=this.managers.get(r.type))||t.addEvent({sessionId:n,event:r,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,n=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:n})})},e.prototype.flush=function(e){return(0,p.sH)(this,void 0,void 0,function(){var t;return(0,p.YH)(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.flush(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e}();let tE={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},tP={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},tk={};function tq(e){if(tk[e])return tk[e];let t=function(e){var t,n;let r=null==(n=null==(t=null==globalThis?void 0:globalThis.Zone)?void 0:t.__symbol__)?void 0:n.call(t,e);return r&&globalThis[r]?globalThis[r]:void 0}(e)||globalThis[e],n=t.prototype,r=e in tE?tE[e]:void 0,i=!!(r&&r.every(e=>{var t,r;return!!(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),s=e in tP?tP[e]:void 0,o=!!(s&&s.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&o)return tk[e]=t.prototype,t.prototype;try{let r=document.createElement("iframe");document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let s=i[e].prototype;if(document.body.removeChild(r),!s)return n;return tk[e]=s}catch{return n}}let tx={},tO={parentElement:function(e){var t,n="Node",r=e,i="parentElement";let s=`${n}.${String(i)}`;if(tx[s])return tx[s].call(r);let o=null==(t=Object.getOwnPropertyDescriptor(tq(n),i))?void 0:t.get;return o?(tx[s]=o,o.call(r)):r[i]}};function tR(){var e=(0,D.m)();return(null==e?void 0:e.innerHeight)||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight||0}function tM(){var e=(0,D.m)();return(null==e?void 0:e.innerWidth)||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth||0}function t_(e,t,n){for(var r=null,i=[],s=e,o=0;s&&"break"!==function(){var e,a,u,l,c=new Date().getTime()-g.getTime();if(void 0!==h.timeoutMs&&c>h.timeoutMs)throw Error("Timeout: Can't find a unique selector after ".concat(c,"ms"));var d=tj((e=s.getAttribute("id"))&&h.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null)||tj.apply(void 0,(0,p.fX)([],(0,p.zs)(Array.from(s.attributes).filter(function(e){return h.attr(e.name,e.value)}).map(function(e){return{name:"[".concat(CSS.escape(e.name),'="').concat(CSS.escape(e.value),'"]'),penalty:.5}})),!1))||tj.apply(void 0,(0,p.fX)([],(0,p.zs)(Array.from(s.classList).filter(h.className).map(function(e){return{name:"."+CSS.escape(e),penalty:1}})),!1))||tj((a=s.tagName.toLowerCase(),h.tagName(a)?{name:a,penalty:2}:null))||[tH()],f=function(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}(s);if("all"==t)f&&(d=d.concat(d.filter(tF).map(function(e){return tN(e,f)})));else if("two"==t)d=d.slice(0,1),f&&(d=d.concat(d.filter(tF).map(function(e){return tN(e,f)})));else if("one"==t){var v=(0,p.zs)(d=d.slice(0,1),1)[0];f&&tF(v)&&(d=[tN(v,f)])}else"none"==t&&(d=[tH()],f&&(d=[tN(d[0],f)]));try{for(var m=(u=void 0,(0,p.Ju)(d)),y=m.next();!y.done;y=m.next()){var v=y.value;v.level=o}}catch(e){u={error:e}}finally{try{y&&!y.done&&(l=m.return)&&l.call(m)}finally{if(u)throw u.error}}if(i.push(d),i.length>=h.seedMinLength&&(r=tT(i,n)))return"break";s=s.parentElement,o++}(););return(r||(r=tT(i,n)),!r&&n)?n():r}function tT(e,t){var n,r,i=tQ(function e(t,n){var r,i,s,o,a;return void 0===n&&(n=[]),(0,p.YH)(this,function(u){switch(u.label){case 0:if(!(t.length>0))return[3,9];u.label=1;case 1:u.trys.push([1,6,7,8]),i=(r=(0,p.Ju)(t[0])).next(),u.label=2;case 2:if(i.done)return[3,5];return s=i.value,[5,(0,p.Ju)(e(t.slice(1,t.length),n.concat(s)))];case 3:u.sent(),u.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return o={error:u.sent()},[3,8];case 7:try{i&&!i.done&&(a=r.return)&&a.call(r)}finally{if(o)throw o.error}
1return[7];case 8:return[3,11];case 9:return[4,n];case 10:u.sent(),u.label=11;case 11:return[2]}})}(e));if(i.length>h.threshold)return t?t():null;try{for(var s=(0,p.Ju)(i),o=s.next();!o.done;o=s.next()){var a=o.value;if(tL(a))return a}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return null}function tD(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?"".concat(e[r].name," > ").concat(n):"".concat(e[r].name," ").concat(n),t=e[r]}return n}function tA(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function tL(e){var t=tD(e);switch(f.querySelectorAll(t).length){case 0:throw Error("Can't select any node with this selector: ".concat(t));case 1:return!0;default:return!1}}function tH(){return{name:"*",penalty:3}}function tN(e,t){return{name:e.name+":nth-child(".concat(t,")"),penalty:e.penalty+1}}function tF(e){return"html"!==e.name&&!e.name.startsWith("#")}function tj(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(tU);return n.length>0?n:null}function tU(e){return null!=e}function tQ(e){return(0,p.fX)([],(0,p.zs)(e),!1).sort(function(e,t){return tA(e)-tA(t)})}var tB=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);t.count=1,"click"===t.type&&r.push(t)}),{version:t,events:r}},tY=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);"click"===t.type&&r.push(t)}),{version:t,events:Object.values(r.reduce(function(e,t){var n=t.x,r=t.y,i=t.selector,s=t.timestamp,o=s-s%36e5,a="".concat(n,":").concat(r,":").concat(null!=i?i:"",":").concat(o);return e[a]?e[a].count+=1:e[a]=(0,p.Cl)((0,p.Cl)({},t),{timestamp:o,count:1}),e},{}))}},tz=function(e,t){var n=t.eventsManager,r=t.sessionId,i=t.deviceIdFn,s=t.mirror,o=t.ugcFilterRules;return function(t){if(t.type!==eu.Click)return;var a,u=(0,D.m)();if(u){var l=u.location,c=u.innerHeight,d=u.innerWidth;if(l){var v=t.x,m=t.y;if(void 0!==v&&void 0!==m){var y,b,S,w,C,I=s.getNode(t.id);if(I)try{a=function(e,t){if(g=new Date,e.nodeType!==Node.ELEMENT_NODE)throw Error("Can't generate CSS selector for non-element node type.");if("html"===e.tagName.toLowerCase())return"html";var n,r,i={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};n=(h=(0,p.Cl)((0,p.Cl)({},i),void 0)).root,r=i,f=n.nodeType===Node.DOCUMENT_NODE?n:n===r.root?n.ownerDocument:n;var s=t_(e,"all",function(){return t_(e,"two",function(){return t_(e,"one",function(){return t_(e,"none")})})});if(s){var o=tQ(function e(t,n,r){var i,s,o;return void 0===r&&(r={counter:0,visited:new Map}),(0,p.YH)(this,function(a){switch(a.label){case 0:if(!(t.length>2&&t.length>h.optimizedMinLength))return[3,5];i=1,a.label=1;case 1:var u,l;if(!(i<t.length-1))return[3,5];if(r.counter>h.maxNumberOfTries||(r.counter+=1,(s=(0,p.fX)([],(0,p.zs)(t),!1)).splice(i,1),o=tD(s),r.visited.has(o)))return[2];if(!(tL(s)&&(u=s,l=n,f.querySelector(tD(u))===l)))return[3,4];return[4,s];case 2:return a.sent(),r.visited.set(o,!0),[5,(0,p.Ju)(e(s,n,r))];case 3:a.sent(),a.label=4;case 4:return i++,[3,1];case 5:return[2]}})}(s,e));return o.length>0&&(s=o[0]),tD(s)}throw Error("Selector was not found.")}(I)}catch(t){e.debug("error resolving selector from finder")}var E={left:(C=u.document).scrollingElement?C.scrollingElement.scrollLeft:void 0!==u.pageXOffset?u.pageXOffset:C.documentElement.scrollLeft||(null==C?void 0:C.body)&&(null==(y=tO.parentElement(C.body))?void 0:y.scrollLeft)||(null==(b=null==C?void 0:C.body)?void 0:b.scrollLeft)||0,top:C.scrollingElement?C.scrollingElement.scrollTop:void 0!==u.pageYOffset?u.pageYOffset:(null==C?void 0:C.documentElement.scrollTop)||(null==C?void 0:C.body)&&(null==(S=tO.parentElement(C.body))?void 0:S.scrollTop)||(null==(w=null==C?void 0:C.body)?void 0:w.scrollTop)||0},P={x:v+E.left,y:m+E.top,selector:a,viewportHeight:c,viewportWidth:d,pageUrl:B(l.href,o),timestamp:Date.now(),type:"click"},k=i();k&&n.addEvent({sessionId:r,event:{type:"interaction",data:JSON.stringify(P)},deviceId:k})}}}}},tK=function(){function e(e,t){var n=(0,D.m)();n&&n.navigator&&"function"==typeof n.navigator.sendBeacon?this.sendBeacon=function(e,t){try{if(n.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch(e){}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var n=new XMLHttpRequest;return n.open("POST",e,!0),n.setRequestHeader("Accept","*/*"),n.send(JSON.stringify(t)),!0},this.basePageUrl=j(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e}return e.prototype.send=function(e,t){var n=this.context,r=n.sessionId,i=n.type,s=new URLSearchParams({device_id:e,session_id:String(r),type:String(i),api_key:this.apiKey}),o="".concat(this.basePageUrl,"?").concat(s.toString());this.sendBeacon(o,t)||this.sendXhr(o,t)},e}(),tW=function(){function e(e,t){var n=this;this.timestamp=Date.now(),this.hook=function(e){n.update(e)},this.send=function(e){return function(t){var r,i,s=e(),o=(0,D.m)();o&&s&&n.transport.send(s,{version:1,events:[{maxScrollX:n._maxScrollX,maxScrollY:n._maxScrollY,maxScrollWidth:n._maxScrollWidth,maxScrollHeight:n._maxScrollHeight,viewportHe
1ight:tR(),viewportWidth:tM(),pageUrl:B(o.location.href,null!=(i=null==(r=n.config.interactionConfig)?void 0:r.ugcFilterRules)?i:[]),timestamp:n.timestamp,type:"scroll"}]})}},this._maxScrollX=0,this._maxScrollY=0,this._maxScrollWidth=tM(),this._maxScrollHeight=tR(),this.config=t,this.transport=e}return e.default=function(t,n){return new e(new tK(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(e.x>this._maxScrollX){var n=tM();this._maxScrollX=e.x;var r=e.x+n;r>this._maxScrollWidth&&(this._maxScrollWidth=r),this.timestamp=t}if(e.y>this._maxScrollY){var i=tR();this._maxScrollY=e.y;var s=e.y+i;s>this._maxScrollHeight&&(this._maxScrollHeight=s),this.timestamp=t}},e}(),tJ=function(e){var t=e.sessionId,n=e.deviceId;this.deviceId=n,this.sessionId=t,t&&n&&(this.sessionReplayId="".concat(n,"/").concat(t))},tV=new function(){var e=this;this.dbs={},this.createStore=function(t){return(0,p.sH)(e,void 0,void 0,function(){return(0,p.YH)(this,function(e){switch(e.label){case 0:return[4,tn(t,1,{upgrade:function(e){e.objectStoreNames.contains("sessionTargetingMatch")||e.createObjectStore("sessionTargetingMatch",{keyPath:"sessionId"})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return(0,p.sH)(e,void 0,void 0,function(){var e,n;return(0,p.YH)(this,function(r){switch(r.label){case 0:if(this.dbs&&this.dbs[t])return[2,this.dbs[t]];return e="".concat(t.substring(0,10),"_amp_session_replay_targeting"),[4,this.createStore(e)];case 1:return n=r.sent(),this.dbs[t]=n,[2,n]}})})},this.getTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId;return(0,p.sH)(e,void 0,void 0,function(){var e,t,s,o;return(0,p.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=a.sent(),t=String(i),[4,e.get("sessionTargetingMatch",t)];case 2:return[2,null==(s=a.sent())?void 0:s.targetingMatch];case 3:return o=a.sent(),n.warn("Failed to get targeting match for session id ".concat(i,": ").concat(o)),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId,s=t.targetingMatch;return(0,p.sH)(e,void 0,void 0,function(){var e,t,o;return(0,p.YH)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=a.sent(),t=String(i),[4,e.put("sessionTargetingMatch",{targetingMatch:s,sessionId:t,lastUpdated:Date.now()})];case 2:return[2,a.sent()];case 3:return o=a.sent(),n.warn("Failed to store targeting match for session id ".concat(i,": ").concat(o)),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.currentSessionId;return(0,p.sH)(e,void 0,void 0,function(){var e,t,s,o,a,u,l,c;return(0,p.YH)(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.openOrCreateDB(r)];case 1:return e=d.sent(),t=String(i),[4,(s=e.transaction("sessionTargetingMatch","readwrite")).store.getAll()];case 2:o=d.sent(),a=0,d.label=3;case 3:if(!(a<o.length))return[3,6];if(u=o[a],l=Date.now()-u.lastUpdated,!(u.sessionId!==t&&l>1728e5))return[3,5];return[4,s.store.delete(u.sessionId)];case 4:d.sent(),d.label=5;case 5:return a++,[3,3];case 6:return[4,s.done];case 7:return d.sent(),[3,9];case 8:return c=d.sent(),n.warn("Failed to clear old targeting matches for sessions: ".concat(c)),[3,9];case 9:return[2]}})})}},tG=function(e){var t=e.sessionId,r=e.targetingConfig,i=e.loggerProvider,s=e.apiKey,o=e.targetingParams;return(0,p.sH)(void 0,void 0,void 0,function(){var e,a,u;return(0,p.YH)(this,function(l){switch(l.label){case 0:return[4,tV.clearStoreOfOldSessions({loggerProvider:i,apiKey:s,currentSessionId:t})];case 1:return l.sent(),[4,tV.getTargetingMatchForSession({loggerProvider:i,apiKey:s,sessionId:t})];case 2:if(!0===l.sent())return[2,!0];e=!0,l.label=3;case 3:return l.trys.push([3,6,,7]),[4,Promise.all([n.e(1029),n.e(4784)]).then(n.bind(n,14784))];case 4:return[4,(0,l.sent().evaluateTargeting)((0,p.Cl)((0,p.Cl)({},o),{flag:r,sessionId:t,apiKey:s,loggerProvider:i}))];case 5:return(a=l.sent())&&a.sr_targeting_config&&(e="on"===a.sr_targeting_config.key),tV.storeTargetingMatchForSession({loggerProvider:i,apiKey:s,sessionId:t,targetingMatch:e}),[3,7];case 6:return u=l.sent(),i.warn(u.message),[3,7];case 7:return[2,e]}})})};function t$(e){return void 0===e&&(e={}),{name:"amplitude/url-tracking@1",observer:function(t,n,r){var i,s,o,a=(0,p.Cl)((0,p.Cl)({},e),r),u=a.ugcFilterRules||[],l=null!=(i=a.enablePolling)&&i,c=null!=(s=a.pollingInterval)?s:1e3,d=null!=(o=a.captureDocumentTitle)&&o;if(!n)return function(){};var h=void 0,f=function(){return n.location&&n.location.href||""},g=function(){var e=n.innerHeight,t=n.innerWidth,r=n.document,i=f(),s="";return d&&(s=(null==r?void 0:r.title)||""),{href:u.length>
10?B(i,u):i,title:s,viewportHeight:e,viewportWidth:t,type:"url-change-event"}},v=function(){var e=f();(void 0===h||e!==h)&&(h=e,t(g()))},m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.apply(this,t);return v(),r}},y=function(){v()};if(l){var b=n.setInterval(function(){v()},c);return v(),function(){b&&n.clearInterval(b)}}if(n.history){var S=n.history.pushState.bind(n.history),w=n.history.replaceState.bind(n.history);return n.history.pushState=m(S),n.history.replaceState=m(w),n.addEventListener("popstate",v),n.addEventListener("hashchange",y),v(),function(){n.history.pushState=S,n.history.replaceState=w,n.removeEventListener("popstate",v),n.removeEventListener("hashchange",y)}}return n.addEventListener("hashchange",y),v(),function(){n.removeEventListener("hashchange",y)}},options:e}}t$();var tX=function(){function e(){var e=this;this.name="@amplitude/session-replay-browser",this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.recordFunction=null,this.teardownEventListeners=function(t){var n=(0,D.m)();n&&(n.removeEventListener("blur",e.blurListener),n.removeEventListener("focus",e.focusListener),t||n.addEventListener("blur",e.blurListener),t||n.addEventListener("focus",e.focusListener),n.self&&"onpagehide"in n.self?(n.removeEventListener("pagehide",e.pageLeaveListener),t||n.addEventListener("pagehide",e.pageLeaveListener)):(n.removeEventListener("beforeunload",e.pageLeaveListener),t||n.addEventListener("beforeunload",e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){e.recordEvents(!1)},this.pageLeaveListener=function(t){e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,n,r){return void 0===n&&(n=!1),void 0===r&&(r=!1),(0,p.sH)(e,void 0,void 0,function(){var e,i;return(0,p.YH)(this,function(s){switch(s.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log("Session ID has not been set yet, cannot evaluate targeting for Session Replay."):this.loggerProvider.warn("Session replay init has not been called, cannot evaluate targeting."),[2];if(!this.config.targetingConfig)if(!n)return this.loggerProvider.log("No targeting config set, skipping initialization/recording for event."),[2];else this.loggerProvider.log("Targeting config has not been set yet, cannot evaluate targeting.");if(this.lastTargetingParams=t,!(this.config.targetingConfig&&!this.sessionTargetingMatch))return[3,2];return(e=t.event)&&Object.values(c).includes(e.event_type)&&(e=void 0),i=this,[4,tG({sessionId:this.identifiers.sessionId,targetingConfig:this.config.targetingConfig,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:e}})];case 1:i.sessionTargetingMatch=s.sent(),this.loggerProvider.debug(JSON.stringify({name:"targeted replay capture config",sessionTargetingMatch:this.sessionTargetingMatch,event:e,targetingParams:t},null,2)),s.label=2;case 2:if(!n)return[3,3];return this.initialize(!0),[3,5];case 3:if(!(r||!this.recordCancelCallback))return[3,5];return this.loggerProvider.log("Recording events for session due to forceRestart or no ongoing recording."),[4,this.recordEvents()];case 4:s.sent(),s.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r=!0),(0,p.sH)(e,void 0,void 0,function(){var e,i,s,o;return(0,p.YH)(this,function(a){switch(a.label){case 0:if(a.trys.push([0,3,,4]),e=void 0,!((i=this.config)&&t!==u.METADATA)||(e={config:z(i),version:e3},!r))return[3,2];return[4,Y()];case 1:s=a.sent(),e=(0,p.Cl)((0,p.Cl)({},s),e),a.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,(0,p.Cl)((0,p.Cl)({},n),e)):this.loggerProvider.debug("Not able to add custom replay capture event ".concat(t," due to no ongoing recording.")),[3,4];case 3:return o=a.sent(),this.loggerProvider.debug("Error while adding custom replay capture event: ",o),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t;try{e.loggerProvider.log("Session Replay capture stopping."),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,null==(t=e.networkObservers)||t.stop()}catch(t){e.loggerProvider.warn("Error occurred while stopping replay capture: ".concat(t.toString()))}},this.loggerProvider=new T(new y)}return e.prototype.init=function(e,t){return J(this._init(e,t))},e.prototype._init=function(e,t){var r,i,s,o,a,u,l;return(0,p.sH)(this,void 0,void 0,function(){var c,d,h,f,g,v,m,b,S,w,C,I,E,P;return(0,p.YH)(this,function(k){switch(k.label){case 0:return this.loggerProvider=new T(t.loggerProvider||new y),Object.prototype.hasOwnProperty.call(t,"logLevel")&&this.loggerProvider.enable(t.logLevel),this.identifiers=new tJ({sessionId:t.sessionId,deviceId:t.deviceId}),c=this,[4,(0,p.sH)(void 0,void 0,void 0,function(){var n;return(0,p.YH)(this,function(r){return n=new W(e,t),[2,new eb(ne
1w em(e,n.loggerProvider,n.serverZone,t.configServerUrl),n)]})})];case 1:return c.joinedConfigGenerator=k.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:h=(d=k.sent()).joinedConfig,f=d.localConfig,g=d.remoteConfig,this.config=h,this.setMetadata(t.sessionId,h,f,g,null==(r=t.version)?void 0:r.version,e3,null==(i=t.version)?void 0:i.type),t.sessionId&&(null==(s=this.config.interactionConfig)?void 0:s.enabled)&&(v=tW.default({sessionId:t.sessionId,type:"interaction"},this.config),this.pageLeaveFns=[v.send(this.getDeviceId.bind(this)).bind(v)],this.scrollHook=v.hook.bind(v)),m=[],"idb"!==(b=this.config.storeType)||(null==(o=(0,D.m)())?void 0:o.indexedDB)||(b="memory",this.loggerProvider.warn("Could not use preferred indexedDB storage, reverting to in memory option.")),this.loggerProvider.log("Using ".concat(b," for event storage.")),k.label=3;case 3:return k.trys.push([3,5,,6]),[4,tC({config:this.config,sessionId:this.identifiers.sessionId,type:"replay",storeType:b})];case 4:return S=k.sent(),m.push({name:"replay",manager:S}),[3,6];case 5:return w=k.sent(),this.loggerProvider.warn("Error occurred while creating replay events manager: ".concat(w.toString())),[3,6];case 6:if(!(null==(a=this.config.interactionConfig)?void 0:a.enabled))return[3,10];C=this.config.interactionConfig.batch?tY:tB,k.label=7;case 7:return k.trys.push([7,9,,10]),[4,tC({config:this.config,sessionId:this.identifiers.sessionId,type:"interaction",minInterval:null!=(u=this.config.interactionConfig.trackEveryNms)?u:3e4,maxInterval:6e4,payloadBatcher:C,storeType:b})];case 8:return I=k.sent(),m.push({name:"interaction",manager:I}),[3,10];case 9:return w=k.sent(),this.loggerProvider.warn("Error occurred while creating interaction events manager: ".concat(w.toString())),[3,10];case 10:if(this.eventsManager=new(tI.bind.apply(tI,(0,p.fX)([void 0],(0,p.zs)(m),!1))),this.eventCompressor&&this.eventCompressor.terminate(),E=void 0,P=(0,D.m)(),!((null==(l=this.config.experimental)?void 0:l.useWebWorker)&&P&&P.Worker))return[3,12];return[4,n.e(9961).then(n.bind(n,89961))];case 11:E=k.sent().compressionScript,k.label=12;case 12:return this.eventCompressor=new e1(this.eventsManager,this.config,this.getDeviceId(),E),[4,this.initializeNetworkObservers()];case 13:return k.sent(),this.loggerProvider.log("Installing @amplitude/session-replay-browser."),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties},!0)];case 14:return k.sent(),[2]}})})},e.prototype.setSessionId=function(e,t){return J(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,n){var r;return(0,p.sH)(this,void 0,void 0,function(){var i,s,o;return(0,p.YH)(this,function(a){switch(a.label){case 0:if(this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,(i=this.identifiers&&this.identifiers.sessionId)&&this.sendEvents(i),s=t||this.getDeviceId(),this.identifiers=new tJ({sessionId:e,deviceId:s}),!(this.joinedConfigGenerator&&i))return[3,2];return[4,this.joinedConfigGenerator.generateJoinedConfig()];case 1:o=a.sent().joinedConfig,this.config=o,a.label=2;case 2:if(!(null==(r=this.config)?void 0:r.targetingConfig))return[3,4];return[4,this.evaluateTargetingAndCapture({userProperties:null==n?void 0:n.userProperties},!1,!0)];case 3:return a.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:a.sent(),a.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,n=this.identifiers;if(!t||!n)return this.loggerProvider.warn("Session replay init has not been called, cannot get session replay properties."),{};var r=this.getShouldRecord(),i={};return r&&((e={})[x]=n.sessionReplayId?n.sessionReplayId:null,i=e,t.debugMode&&(i[M]=JSON.stringify({appHash:V(t.apiKey).toString()}))),this.addCustomRRWebEvent(u.GET_SR_PROPS,{shouldRecord:r,eventProperties:i},10===this.eventCount),10===this.eventCount&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t,n=e||(null==(t=this.identifiers)?void 0:t.sessionId),r=this.getDeviceId();this.eventsManager&&n&&r&&this.eventsManager.sendCurrentSequenceEvents({sessionId:n,deviceId:r})},e.prototype.initialize=function(e){var t;return void 0===e&&(e=!1),(0,p.sH)(this,void 0,void 0,function(){var n;return(0,p.YH)(this,function(r){return(null==(t=this.identifiers)?void 0:t.sessionId)?(n=this.getDeviceId())?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:n}),[2,this.recordEvents()]):(this.loggerProvider.log("Session is not being recorded due to lack of device id."),[2,Promise.resolve()]):(this.loggerProvider.log("Session is not being recorded due to lack of session id."),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){if(null==(t=this.config)?void 0:t.instanceName){var e,t,n,r;r=(void 0===(e=this.config.instanceName)&&(e=C),es.getInstance(e)).identityStore.getIdentity().optOut}return void 0!==r?r:null==(n=this.config)?void 0:n.optOut},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn("Session is not being recorded due to lack of config, please call sessionReplay.init."),!1;if(!this.config.captureEnabled)return this.loggerProvider.log("Session ".concat(this.identifiers.sessionId," not being captured due to capture being disabled for project or because the remote config could not be fetched.")),!1;if(this.shouldOptOut())return this.loggerProvider.log("Opting session ".concat(this.identifiers.sessionId," out of recording due to optOut config.")),!1;var e,t,n=!1,r="",i=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(r="Capturing replays for session ".concat(this.identifiers.sessionId," due to matching targeting conditions."),this.loggerProvider.log(r),n=!0,i=!0):(r="Not capturing replays for session ".concat(this.identifiers.sessionId," due to not matching targeting conditions."),this.loggerProvider.log(r),n=!1,i=!1):(e=this.identifiers.sessionId,t=this.config.sampleRate,31*Math.abs(V(e.toString()))%1e6/1e6<t)?(n=!0,i=!0):(r="Opting session ".concat(this.identifiers.sessionId," out of recording due to sample rate."),this.loggerProvider.log(r),n=!1,i=!1),this.lastShouldRecordDecision!==n&&this.config.targetingConfig&&(this.addCustomRRWebEvent(u.TARGETING_DECISION,{message:r,sessionId:this.identifiers.sessionId,matched:i,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=n),n},e.prototype.getBlockSelectors=function(){var e,t,n,r=null!=(n=null==(t=null==(e=this.config)?void 0:e.privacyConfig)?void 0:t.blockSelector)?n:[];if(0!==r.length)return r},e.prototype.getMaskTextSelectors=function(){if((null==(t=null==(e=this.config)?void 0:e.privacyConfig)?void 0:t.defaultMaskLevel)==="conservative")return"*";var e,t,n,r,i=null==(r=null==(n=this.config)?void 0:n.privacyConfig)?void 0:r.maskSelector;if(i)return i},e.prototype.getRecordingPlugins=function(e){var t,r,i,s,o,a;return(0,p.sH)(this,void 0,void 0,function(){var u,l,c,d;return(0,p.YH)(this,function(h){switch(h.label){case 0:u=[];try{l=t$({ugcFilterRules:(null==(r=null==(t=this.config)?void 0:t.interactionConfig)?void 0:r.ugcFilterRules)||[],enablePolling:(null==(i=this.config)?void 0:i.enableUrlChangePolling)||!1,pollingInterval:null==(s=this.config)?void 0:s.urlChangePollingInterval,captureDocumentTitle:null==(o=this.config)?void 0:o.captureDocumentTitle}),u.push(l)}catch(e){this.loggerProvider.warn("Failed to create URL tracking plugin:",e)}if(!(null==(a=null==e?void 0:e.console)?void 0:a.enabled))return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all([n.e(6851),n.e(1029)]).then(n.bind(n,37434))];case 2:return c=h.sent().getRecordConsolePlugin,u.push(c({level:e.console.levels})),[3,4];case 3:return d=h.sent(),this.loggerProvider.warn("Failed to load console plugin:",d),[3,4];case 4:return[2,u.length>0?u:void 0]}})})},e.prototype.getRecordFunction=function(){return(0,p.sH)(this,void 0,void 0,function(){var e,t;return(0,p.YH)(this,function(r){switch(r.label){case 0:if(this.recordFunction)return[2,this.recordFunction];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.all([n.e(8950),n.e(1029)]).then(n.bind(n,48770))];case 2:return e=r.sent().record,this.recordFunction=e,[2,e];case 3:return t=r.sent(),this.loggerProvider.warn("Failed to load rrweb-record module:",t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){var t,n,r,i,s;return void 0===e&&(e=!0),(0,p.sH)(this,void 0,void 0,function(){var o,a,l,c,d,h,f,g,v,m,y,b,S,w=this;return(0,p.YH)(this,function(p){switch(p.label){case 0:if(o=this.config,a=this.getShouldRecord(),l=null==(t=this.identifiers)?void 0:t.sessionId,!a||!l||!o)return[2];return this.stopRecordingEvents(),[4,this.getRecordFunction()];case 1:if(!(c=p.sent()))return[2];return[4,this.initializeNetworkObservers()];case 2:p.sent(),null==(n=this.networkObservers)||n.start(function(e){w.addCustomRRWebEvent(u.FETCH_REQUEST,e)}),d=o.privacyConfig,h=o.interactionConfig,f=o.loggingConfig,g=(null==h?void 0:h.enabled)?{mouseInteraction:this.eventsManager&&tz(this.loggerProvider,{eventsManager:this.eventsManager,sessionId:l,deviceIdFn:this.getDeviceId.bind(this),mirror:c.mirror,ugcFilterRules:null!=(r=h.ugcFilterRules)?r:[]}),scroll:this.scrollHook}:{},v=(null==h?void 0:h.enabled)&&h.ugcFilterRules?h.ugcFilterRules:[],this.loggerProvider.log("Session Replay capture beginning for ".concat(l,".")),p.label=3;case 3:return p.trys.push([3,5,,6]),m=this,y=c,S={emit:function(e){if(w.shouldOptOut()){w.loggerProvider.log("Opting session ".concat(l," out of recording due to optOut config.")),w.stopRecordingEvents(),w.sendEvents();return}e.type===eo.Meta&&(e.data.href=B(e.data.href,v)),w.eventCompressor&&w.eventCompressor.enqueueEvent(e,l)},inlineStylesheet:o.shouldInlineStylesheet,hooks:g,maskAllInputs:!0,maskTextClass:_,blockClass:"amp-block",blockSelector:this.getBlockSelectors(),applyBackgroun
1dColorToBlockedElements:o.applyBackgroundColorToBlockedElements,maskInputFn:N("input",d),maskTextFn:N("text",d),maskTextSelector:this.getMaskTextSelectors(),recordCanvas:!1,slimDOMOptions:{script:null==(i=o.omitElementTags)?void 0:i.script,comment:null==(s=o.omitElementTags)?void 0:s.comment},errorHandler:function(e){if(e.message.includes("insertRule")&&e.message.includes("CSSStyleSheet")||e._external_)throw e;return w.loggerProvider.warn("Error while capturing replay: ",e.toString()),!0}},[4,this.getRecordingPlugins(f)];case 4:return m.recordCancelCallback=y.apply(void 0,[(S.plugins=p.sent(),S)]),this.addCustomRRWebEvent(u.DEBUG_INFO),e&&this.addCustomRRWebEvent(u.METADATA,this.metadata),[3,6];case 5:return b=p.sent(),this.loggerProvider.warn("Failed to initialize session replay:",b),[3,6];case 6:return[2]}})})},e.prototype.getDeviceId=function(){var e;return null==(e=this.identifiers)?void 0:e.deviceId},e.prototype.getSessionId=function(){var e;return null==(e=this.identifiers)?void 0:e.sessionId},e.prototype.flush=function(e){var t;return void 0===e&&(e=!1),(0,p.sH)(this,void 0,void 0,function(){return(0,p.YH)(this,function(n){return[2,null==(t=this.eventsManager)?void 0:t.flush(e)]})})},e.prototype.shutdown=function(){this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return"plugin"===e?"@amplitude/plugin-session-replay-browser":"segment"===e?"@amplitude/segment-session-replay-plugin":null},e.prototype.setMetadata=function(e,t,n,r,i,s,o){var a=(null==e?void 0:e.toString())?V(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:n,remoteConfig:r,sessionId:e,hashValue:a,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(o),replaySDKVersion:i,standaloneSDKType:"@amplitude/session-replay-browser",standaloneSDKVersion:s}},e.prototype.initializeNetworkObservers=function(){var e,t,r;return(0,p.sH)(this,void 0,void 0,function(){var i,s;return(0,p.YH)(this,function(o){switch(o.label){case 0:if(!((null==(r=null==(t=null==(e=this.config)?void 0:e.loggingConfig)?void 0:t.network)?void 0:r.enabled)&&!this.networkObservers))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.e(1091).then(n.bind(n,61091))];case 2:return i=o.sent().NetworkObservers,this.networkObservers=new i,[3,4];case 3:return s=o.sent(),this.loggerProvider.warn("Failed to import or instantiate NetworkObservers:",s),[3,4];case 4:return[2]}})})},e}(),tZ=function(e){return function(){var t=e.config||K();return{logger:t.loggerProvider,logLevel:t.logLevel}}};let t0=function(){var e=new tX;return{init:v(e.init.bind(e),"init",tZ(e)),evaluateTargetingAndCapture:v(e.evaluateTargetingAndCapture.bind(e),"evaluateTargetingAndRecord",tZ(e)),setSessionId:v(e.setSessionId.bind(e),"setSessionId",tZ(e)),getSessionId:v(e.getSessionId.bind(e),"getSessionId",tZ(e)),getSessionReplayProperties:v(e.getSessionReplayProperties.bind(e),"getSessionReplayProperties",tZ(e)),flush:v(e.flush.bind(e),"flush",tZ(e)),shutdown:v(e.shutdown.bind(e),"shutdown",tZ(e))}}();var t1=t0.init,t2=t0.setSessionId,t3=(t0.getSessionId,t0.getSessionReplayProperties);t0.flush,t0.shutdown,t0.evaluateTargetingAndCapture},12097:e=>{e.exports={style:{fontFamily:"'arcadia', 'arcadia Fallback'"},className:"__className_d24c9b",variable:"__variable_d24c9b"}},16570:e=>{e.exports={style:{fontFamily:"'arcadiaDisplay', 'arcadiaDisplay Fallback'"},className:"__className_9fca53",variable:"__variable_9fca53"}},25022:(e,t,n)=>{"use strict";n.d(t,{$:()=>a});var r=n(34049),i=n(31668),s=n(74268),o=n(38445),a=class extends o.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let s=t.queryKey,o=t.queryHash??(0,r.F$)(s,t),a=this.get(o);return a||(a=new i.X({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){s.j.batch(()=>
1{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,r.MK)(e,t)):t}notify(e){s.j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.j.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){s.j.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}},28073:(e,t,n)=>{"use strict";function r(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}n.d(t,{A:()=>r})},37138:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(99743).A)(function(e,t){for(var n={},r=0;r<e.length;)e[r]in t&&(n[e[r]]=t[e[r]]),r+=1;return n})},48854:(e,t,n)=>{"use strict";n.d(t,{SpeedInsights:()=>c});var r=n(12115),i=n(20063),s=n(87358);function o(){return"development"===function(){return"production"}()}function a(e){return new RegExp("/".concat(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?=[/?#]|$)"))}function u(e){(0,r.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.si)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);let t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(t.current)e.route&&t.current(e.route);else{var n,r;let i=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("undefined"==typeof window||null===t.route)return null;window.si||(window.si=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];(window.siq=window.siq||[]).push(t)});let n=t.scriptSrc?t.scriptSrc:o()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":t.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":t.basePath?"".concat(t.basePath,"/speed-insights/script.js"):"/_vercel/speed-insights/script.js";if(document.head.querySelector('script[src*="'.concat(n,'"]')))return null;t.beforeSend&&(null==(e=window.si)||e.call(window,"beforeSend",t.beforeSend));let r=document.createElement("script");return r.src=n,r.defer=!0,r.dataset.sdkn="@vercel/speed-insights"+(t.framework?"/".concat(t.framework):""),r.dataset.sdkv="1.2.0",t.sampleRate&&(r.dataset.sampleRate=t.sampleRate.toString()),t.route&&(r.dataset.route=t.route),t.endpoint?r.dataset.endpoint=t.endpoint:t.basePath&&(r.dataset.endpoint="".concat(t.basePath,"/speed-insights/vitals")),t.dsn&&(r.dataset.dsn=t.dsn),o()&&!1===t.debug&&(r.dataset.debug="false"),r.onerror=()=>{console.log("[Vercel Speed Insights] Failed to load script from ".concat(n,". Please check if any content blockers are enabled and try again."))},document.head.appendChild(r),{setRoute:e=>{r.dataset.route=null!=e?e:void 0}}}({framework:null!=(n=e.framework)?n:"react",basePath:null!=(r=e.basePath)?r:function(){if(void 0!==s&&void 0!==s.env)return s.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...e});i&&(t.current=i.setRoute)}},[e.route]),null}function l(e){let t=(()=>{let e=(0,i.useParams)(),t=(0,i.useSearchParams)()||new URLSearchParams,n=(0,i.usePathname)();return e?function(e,t){if(!e||!t)return e;let n=e;try{let e=Object.entries(t);for(let[t,r]of e)if(!Array.isArray(r)){let e=a(r);e.test(n)&&(n=n.replace(e,"/[".concat(t,"]")))}for(let[t,r]of e)if(Array.isArray(r)){let e=a(r.join("/"));e.test(n)&&(n=n.replace(e,"/[...".concat(t,"]")))}return n}catch(t){return e}}(n,Object.keys(e).length?e:Object.fromEntries(t.entries())):null})();return r.createElement(u,{route:t,...e,framework:"next",basePath:function(){if(void 0!==s&&void 0!==s.env)return s.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}()})}function c(e){return r.createElement(r.Suspense,{fallback:null},r.createElement(l,{...e}))}},53815:e=>{e.exports={style:{fontFamily:"'tiemposHeadline', 'tiemposHeadline Fallback'"},className:"__className_8c65e0",variable:"__variable_8c65e0"}},66583:(e,t,n)=>{"use strict";n.d(t,{V:()=>d,Vv:()=>s,ex:()=>f,zj:()=>o});var r=n(88545),i=n(12115);let s={method:"throttle",timeMs:function(){if("undefined"==typeof window||!window.GestureEvent)return 50;try{let e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}()};function o(){let e=new Map;return{all:e,on(t,n){let r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){let r=e.get(t);r&&e.set(t,r.filter(e=>e!==n))},emit(t,n){let r=e.get(t);
1r?.forEach(e=>e(n))}}}function a(e,t,n){let r=setTimeout(function(){e(),n.removeEventListener("abort",i)},t);function i(){clearTimeout(r),n.removeEventListener("abort",i)}n.addEventListener("abort",i)}function u(){let e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((e,r)=>{t=e,n=r}),resolve:t,reject:n}}function l(){return new URLSearchParams(location.search)}var c=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=s.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;push({key:e,query:t,options:n},i=s.timeMs){(0,r.Yz)("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),"push"===n.history&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),!1===n.shallow&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||i>this.timeMs)&&(this.timeMs=i)}getQueuedQuery(e){return this.updateMap.get(e)}flush({getSearchParamsSnapshot:e=l,rateLimitFactor:t=1,...n},i){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return(0,r.Yz)("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=u();let s=()=>{this.lastFlushedAt=performance.now();let[t,r]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},i);null===r?this.resolvers.resolve(t):this.resolvers.reject(t),this.resolvers=null},o=()=>{let e=performance.now()-this.lastFlushedAt,n=this.timeMs,i=t*Math.max(0,n-e);(0,r.Yz)("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",i,n,t),0===i?s():a(s,i,this.controller.signal)};return a(o,0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){let e=Array.from(this.updateMap.keys());return(0,r.Yz)("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=s.timeMs,e}applyPendingUpdates(e,t){let{updateUrl:n,getSearchParamsSnapshot:i}=e,s=i();if((0,r.Yz)("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,s.toString()),0===this.updateMap.size)return[s,null];let o=Array.from(this.updateMap.entries()),a={...this.options},u=Array.from(this.transitions);for(let[t,n]of(e.autoResetQueueOnUpdate&&this.reset(),(0,r.Yz)("[nuqs gtq] Flushing queue %O with options %O",o,a),o))null===n?s.delete(t):s.set(t,n);t&&(s=t(s));try{return!function(e,t){let n=t;for(let t=e.length-1;t>=0;t--){let r=e[t];if(!r)continue;let i=n;n=()=>r(i)}n()}(u,()=>{n(s,a)}),[s,null]}catch(e){return console.error((0,r.z3)(429),o.map(([e])=>e).join(),e),[s,e]}}};let d=new c;var h=class{callback;resolvers=u();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,a(()=>{let t=this.resolvers;try{(0,r.Yz)("[nuqs dq] Flushing debounce queue",e);let n=this.callback(e);(0,r.Yz)("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=u(),n.then(e=>t.resolve(e)).catch(e=>t.reject(e))}catch(e){this.queuedValue=void 0,t.reject(e)}},t,this.controller.signal),this.resolvers.promise}};let f=new class{throttleQueue;queues=new Map;queuedQuerySync=o();constructor(e=new c){this.throttleQueue=e}useQueuedQueries(e){return function(e,t,n){let r=(0,i.useCallback)(()=>{let t=Object.fromEntries(e.map(e=>[e,n(e)]));return[JSON.stringify(t),t]},[e.join(","),n]),s=(0,i.useRef)(null);null===s.current&&(s.current=r());let o=(0,i.useCallback)(n=>{let r=e.map(e=>t(e,n));return()=>r.forEach(e=>e())},[e.join(","),t]);return(0,i.useSyncExternalStore)(o,()=>{let[e,t]=r();return s.current[0]===e?s.current[1]:(s.current=[e,t],t)},()=>s.current[1])}(e,(e,t)=>this.queuedQuerySync.on(e,t),e=>this.getQueuedQuery(e))}
1push(e,t,n){if(!Number.isFinite(t))return Promise.resolve((n.getSearchParamsSnapshot??l)());let i=e.key;if(!this.queues.has(i)){(0,r.Yz)("[nuqs dqc] Creating debounce queue for `%s`",i);let e=new h(e=>(this.throttleQueue.push(e),this.throttleQueue.flush(n).finally(()=>{void 0===this.queues.get(e.key)?.queuedValue&&((0,r.Yz)("[nuqs dqc] Cleaning up empty queue for `%s`",e.key),this.queues.delete(e.key)),this.queuedQuerySync.emit(e.key)})));this.queues.set(i,e)}(0,r.Yz)("[nuqs dqc] Enqueueing debounce update %O",e);let s=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),s}abort(e){let t=this.queues.get(e);return t?((0,r.Yz)("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),e=>(e.then(t.resolvers.resolve,t.resolvers.reject),e)):e=>e}abortAll(){for(let[e,t]of this.queues.entries())(0,r.Yz)("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){let t=this.queues.get(e)?.queuedValue?.query;return void 0!==t?t:this.throttleQueue.getQueuedQuery(e)}}(d)},69642:(e,t,n)=>{"use strict";n.d(t,{E:()=>p});var r=n(34049),i=n(25022),s=n(74268),o=n(69781),a=n(93049),u=class extends o.k{#t;#n;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=(0,a.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let t="pending"===this.state.status,n=!this.#r.canStart();try{if(!t){this.#i({type:"pending",variables:e,isPaused:n}),await this.#n.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:n})}let r=await this.#r.start();return await this.#n.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#n.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#i({type:"success",data:r}),r}catch(t){try{throw await this.#n.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#i({type:"error",error:t})}}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPau
1sed:!1,status:"error"}}})(this.state),s.j.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},l=n(38445),c=class extends l.Q{constructor(e={}){super(),this.config=e,this.#s=new Set,this.#o=new Map,this.#a=0}#s;#o;#a;build(e,t,n){let r=new u({mutationCache:this,mutationId:++this.#a,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#s.add(e);let t=d(e);if("string"==typeof t){let n=this.#o.get(t);n?n.push(e):this.#o.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#s.delete(e)){let t=d(e);if("string"==typeof t){let n=this.#o.get(t);if(n)if(n.length>1){let t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#o.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let n=this.#o.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let n=this.#o.get(t)?.find(t=>t!==e&&t.state.isPau
1sed);return n?.continue()??Promise.resolve()}}clear(){s.j.batch(()=>{this.#s.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#s.clear(),this.#o.clear()})}getAll(){return Array.from(this.#s)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,r.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,r.nJ)(e,t))}notify(e){s.j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return s.j.batch(()=>Promise.all(e.map(e=>e.continue().catch(r.lQ))))}};function d(e){return e.options.scope?.id}var h=n(56195),f=n(63122);function g(e){return{onFetch:(t,n)=>{let i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[],u={pages:[],pageParams:[]},l=0,c=async()=>{let n=!1,c=(0,r.ZM)(t.options,t.fetchOptions),d=async(e,i,s)=>{if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let o={client:t.client,queryKey:t.queryKey,pageParam:i,direction:s?"backward":"forward",meta:t.options.meta};Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)});let a=await c(o),{maxPages:u}=t.options,l=s?r.ZZ:r.y9;return{pages:l(e.pages,a,u),pageParams:l(e.pageParams,i,u)}};if(s&&o.length){let e="backward"===s,t={pages:o,pageParams:a},n=(e?function(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}:v)(i,t);u=await d(t,n,e)}else{let t=e??o.length;do{let e=0===l?a[0]??i.initialPageParam:v(i,u);if(l>0&&null==e)break;u=await d(u,e),l++}while(l<t)}return u};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function v(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}var p=class{#u;#n;#l;#c;#d;#h;#f;#g;constructor(e={}){this.#u=e.queryCache||new i.$,this.#n=e.mutationCache||new c,this.#l=e.defaultOptions||{},this.#c=new Map,this.#d=new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#f=h.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#g=f.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#f?.(),this.#f=void 0,this.#g?.(),this.#g=void 0)}isFetching(e){return this.#u.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#u.build(this,t),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,r.d2)(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let i=this.defaultQueryOptions({queryKey:e}),s=this.#u.get(i.queryHash),o=s?.state.data,a=(0,r.Zw)(t,o);if(void 0!==a)return this.#u.build(this,i).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return s.j.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;s.j.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#u;return s.j.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t};return Promise.all(s.j.batch(()=>this.#u.findAll(e).map(e=>e.cancel(n)))).then(r.lQ).catch(r.lQ)}invalidateQueries(e,t={}){return s.j.batch(()=>(this.#u.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(s.j.batch(()=>this.#u.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(r.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}
1))).then(r.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let n=this.#u.build(this,t);return n.isStaleByTime((0,r.d2)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(r.lQ).catch(r.lQ)}fetchInfiniteQuery(e){return e.behavior=g(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(r.lQ).catch(r.lQ)}ensureInfiniteQueryData(e){return e.behavior=g(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#n}getDefaultOptions(){return this.#l}setDefaultOptions(e){this.#l=e}setQueryDefaults(e,t){this.#c.set((0,r.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#c.values()],n={};return t.forEach(t=>{(0,r.Cp)(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#d.set((0,r.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#d.values()],n={};return t.forEach(t=>{(0,r.Cp)(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#l.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,r.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===r.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#l.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#n.clear()}}},72378:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}n.d(t,{A:()=>i});var i=function e(t,n){function i(e,i,s){if("undefined"!=typeof document){"number"==typeof(s=r({},n,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in s)s[a]&&(o+="; "+a,!0!==s[a]&&(o+="="+s[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+o}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var s=n[i].split("="),o=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(r[a]=t.read(o,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){i(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},84031:(e,t,n)=>{"use strict";n.d(t,{NuqsAdapter:()=>f});var r=n(88545),i=n(66583);function s(){(0,r.Yz)("[nuqs] Aborting queues"),i.ex.abortAll(),i.V.abort().forEach(e=>i.ex.queuedQuerySync.emit(e))}var o=n(12115),a=n(20063);let u=0;function l(){u=0,s()}function c(){--u<=0&&(u=0,queueMicrotask(s))}function d(){return(0,o.useEffect)(()=>(!function(){var e;if(e="next/app","undefined"==typeof history||(history.nuqs?.version&&"0.0.0-inject-version-here"!==history.nuqs.version?(console.error((0,r.z3)(409),history.nuqs.version,"0.0.0-inject-version-here",e),!0):!!history.nuqs?.adapters?.includes(e)))return;let t=history.replaceState,n=history.pushState;history.replaceState=function(e,n,r){return c(),t.call(history,e,n,r)},history.pushState=function(e,t,r){return c(),n.call(history,e,t,r)},history.nuqs=history.nuqs??{version:"0.0.0-inject-version-here",adapters:[]},history.nuqs.adapters.push("next/app")}
1(),window.addEventListener("popstate",l),()=>window.removeEventListener("popstate",l)),[]),null}let h=(0,r.Hx)(function(){let e=(0,a.useRouter)(),t=(0,a.useSearchParams)(),[n,s]=(0,o.useOptimistic)(t);return{searchParams:n,updateUrl:(0,o.useCallback)((t,n)=>{let a=i.V.reset().concat(Array.from(i.ex.queuedQuerySync.all.keys()));(0,o.startTransition)(()=>{if(!n.shallow)for(let e of(s(t),a))i.ex.queuedQuerySync.emit(e);let o=function(e){let{origin:t,pathname:n,hash:i}=location;return t+n+(0,r.OB)(e)+i}(t);(0,r.Yz)("[nuqs next/app] Updating url: %s",o);let l="push"===n.history?history.pushState:history.replaceState;u=3,l.call(history,null,"",o),n.scroll&&window.scrollTo(0,0),n.shallow||e.replace(o,{scroll:!1})})},[]),rateLimitFactor:3,autoResetQueueOnUpdate:!1}});function f(e){let{children:t,...n}=e;return(0,o.createElement)(h,{...n,children:[(0,o.createElement)(o.Suspense,{key:"nuqs-adapter-suspense-navspy",children:(0,o.createElement)(d)}),t]})}},87449:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});var r=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0!==n.g?n.g:void 0}},88545:(e,t,n)=>{"use strict";n.d(t,{Hx:()=>d,OB:()=>l,R8:()=>o,TU:()=>g,V7:()=>h,Yz:()=>s,uZ:()=>f,z3:()=>u});var r=n(12115);let i=function(){try{let e="nuqs-localStorage-test";if("undefined"==typeof localStorage)return!1;localStorage.setItem(e,e);let t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}();function s(e,...t){if(!i)return;let n=function(e,...t){return e.replace(/%[sfdO]/g,e=>{let n=t.shift();return"%O"===e&&n?JSON.stringify(n).replace(/"([^"]+)":/g,"$1:"):String(n)})}(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function o(e,...t){i&&console.warn(e,...t)}let a={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function u(e){return`[nuqs] ${a[e]} 2 See https://err.47ng.com/NUQS-${e}`}function l(e){if(0===e.size)return"";let t=[];for(let[n,r]of e.entries()){let e=n.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${e}=${r.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,e=>encodeURIComponent(e))}`)}return"?"+t.join("&")}let c=(0,r.createContext)({useAdapter(){throw Error(u(404))}});function d(e){return({children:t,defaultOptions:n,processUrlSearchParams:i,...s})=>(0,r.createElement)(c.Provider,{...s,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:i}},t)}function h(e){let t=(0,r.useContext)(c);if(!("useAdapter"in t))throw Error(u(404));return t.useAdapter(e)}c.displayName="NuqsAdapterContext",i&&"undefined"!=typeof window&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==c&&console.error(u(303)),window.__NuqsAdapterContext=c);let f=()=>(0,r.useContext)(c).defaultOptions,g=()=>(0,r.useContext)(c).processUrlSearchParams},88826:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(28073);function i(e){return function t(n){return 0==arguments.length||(0,r.A)(n)?t:e.apply(this,arguments)}}}
2,99743:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(88826),i=n(28073);function s(e){return function t(n,s){switch(arguments.length){case 0:return t;case 1:return(0,i.A)(n)?t:(0,r.A)(function(t){return e(n,t)});default:return(0,i.A)(n)&&(0,i.A)(s)?t:(0,i.A)(n)?(0,r.A)(function(t){return e(t,s)}):(0,i.A)(s)?(0,r.A)(function(t){return e(n,t)}):e(n,s)}}}}}]); 3//# sourceMappingURL=2410-94e50a9b4671ef54.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.