PageSourceSearch

https://app.nycfundsfinder.com/assets/index-Cl3itfPU.js

js nycfundsfinder.com collected 2026-09-30 11:39:20 UTC 181,597 bytes, 10 lines download raw bytes

1var qi=Object.defineProperty;var Hi=(e,t,r)=>t in e?qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Se=(e,t,r)=>Hi(e,typeof t!="symbol"?t+"":t,r);import{c as U,_ as I,d as _,e as w,f as D,a as yt,b as j,g as Ue}from"./vendor-firebase-Bl-igiUH.js";import{U as yr,S as qe,a as Ie,b as _e,r as ae,I as De,c as ji,g as Dt,d as Bi,R as Gi,i as Er,A as Wi,E as Ki,e as zi,f as Xi,h as Xt,j as ir,k as F,l as Tr,F as Ji,m as Et,B as It,n as Yi,o as $i,p as Qi,q as Zi,s as eo,t as to,D as Sr,u as _r,G as wr,v as Ar,K as Ir,L as Or,M as kr,w as Cr,T as Pr,x as Rr,W as Lr,y as or,z as Tt,C as ro,H as Cn,J as no,N as io,O as oo,P as ao,Q as so,V as uo,X as lo,Y as W,Z as K,_ as z}from"./background-capture-CE30RkNr.js";import{g as Pn}from"./vendor-framework-CobW1Mgl.js";function co(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var fo=1e3,Jt=function(e){if(Object.keys(e).length>fo)return!1;for(var t in e){var r=e[t];if(!Rn(t,r))return!1}return!0},Rn=function(e,t){var r,n;if(typeof e!="string")return!1;if(Array.isArray(t)){var i=!0;try{for(var o=U(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if(typeof s=="object")i=i&&Jt(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(t==null)return!1;if(typeof t=="object")return Jt(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},tt=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return I({},this._properties)},e.prototype.set=function(t,r){return this._safeSet(B.SET,t,r),this},e.prototype.setOnce=function(t,r){return this._safeSet(B.SET_ONCE,t,r),this},e.prototype.append=function(t,r){return this._safeSet(B.APPEND,t,r),this},e.prototype.prepend=function(t,r){return this._safeSet(B.PREPEND,t,r),this},e.prototype.postInsert=function(t,r){return this._safeSet(B.POSTINSERT,t,r),this},e.prototype.preInsert=function(t,r){return this._safeSet(B.PREINSERT,t,r),this},e.prototype.remove=function(t,r){return this._safeSet(B.REMOVE,t,r),this},e.prototype.add=function(t,r){return this._safeSet(B.ADD,t,r),this},e.prototype.unset=function(t){return this._safeSet(B.UNSET,t,yr),this},e.prototype.clearAll=function(){return this._properties={},this._properties[B.CLEAR_ALL]=yr,this},e.prototype._safeSet=function(t,r,n){if(this._validate(t,r,n)){var i=this._properties[t];return i===void 0&&(i={},this._properties[t]=i),i[r]=n,this._propertySet.add(r),!0}return!1},e.prototype._validate=function(t,r,n){return this._properties[B.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:t===B.ADD?typeof n=="number":t!==B.UNSET&&t!==B.REMOVE?Rn(r,n):!0},e}(),B;(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"})(B||(B={}));var vo=[B.CLEAR_ALL,B.UNSET,B.SET,B.SET_ONCE,B.ADD,B.APPEND,B.PREPEND,B.PREINSERT,B.POSTINSERT,B.REMOVE],ho="Event tracked successfully",po="Unexpected error occurred",go="Event rejected due to exceeded retry count",mo="Event skipped due to optOut config",bo="Event rejected due to missing API key",yo="Invalid API key",Eo="Client not initialized",Ge=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=qe.Unknown),{event:e,code:t,message:r}},To=function(){function e(t){this.client=t,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(t,r){var n,i;return _(this,void 0,void 0,function(){return w(this,function(o){switch(o.label){case 0:return this.plugins.some(function(a){return a.name===t.name})?(this.loggerProvider.warn("Plugin with name ".concat(t.name," already exists, skipping registration")),[2]):(t.name===void 0&&(t.name=Ie(),this.loggerProvider.warn(`Plugin name is undefined. 
2      Generating a random UUID for plugin name: `.concat(t.name,`. 
3      Set a name for the plugin to prevent it from being added multiple times.`))),t.type=(n=t.type)!==null&&n!==void 0?n:"enrichment",[4,(i=t.setup)===null||i===void 0?void 0:i.call(t,r,this.client)]);case 1:return o.sent(),this.plugins.push(t),[2]}})})},e.prototype.deregister=function(t,r){var n;return _(this,void 0,void 0,function(){var i,o;return w(this,function(a){switch(a.label){case 0:return i=this.plugins.findIndex(function(s){return s.name===t}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(t," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return a.sent(),[2]}})})},e.prototype.reset=function(t){this._clearOptOutListeners(),this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.client=t},e.prototype.push=function(t){var r=this;return new Promise(function(n){r.queue.push([t,n]),r.scheduleApply(0)})},e.prototype.scheduleApply=function(t){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},t))},e.prototype.apply=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a,s,l,v,p,u,c,d,f,v,p,E,T,b,h,g,m,y;return w(this,function(S){switch(S.label){case 0:if(!t)return[2];r=D(t,1),n=r[0],i=D(t,2),o=i[1],this.loggerProvider.log("Timeline.apply: Initial event",n),a=this.plugins.filter(function(O){return O.type==="before"}),S.label=1;case 1:S.trys.push([1,6,7,8]),s=U(a),l=s.next(),S.label=2;case 2:return l.done?[3,5]:(v=l.value,v.execute?[4,v.execute(I({},n))]:[3,4]);case 3:if(p=S.sent(),p===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),S.label=4;case 4:return l=s.next(),[3,2];case 5:return[3,8];case 6:return u=S.sent(),h={error:u},[3,8];case 7:try{l&&!l.done&&(g=s.return)&&g.call(s)}finally{if(h)throw h.error}
3return[7];case 8:c=this.plugins.filter(function(O){return O.type==="enrichment"||O.type===void 0}),S.label=9;case 9:S.trys.push([9,14,15,16]),d=U(c),f=d.next(),S.label=10;case 10:return f.done?[3,13]:(v=f.value,v.execute?[4,v.execute(I({},n))]:[3,12]);case 11:if(p=S.sent(),p===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(v.name),"', event: ").concat(JSON.stringify(n))),S.label=12;case 12:return f=d.next(),[3,10];case 13:return[3,16];case 14:return E=S.sent(),m={error:E},[3,16];case 15:try{f&&!f.done&&(y=d.return)&&y.call(d)}finally{if(m)throw m.error}return[7];case 16:return T=this.plugins.filter(function(O){return O.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),b=T.map(function(O){var P=I({},n);return O.execute(P).catch(function(C){return Ge(P,0,String(C))})}),Promise.all(b).then(function(O){var P=D(O,1),C=P[0],N=C||Ge(n,100,"Event not tracked, no destination plugins on the instance");o(N)}),[2]}})})},e.prototype.flush=function(){return _(this,void 0,void 0,function(){var t,r,n,i=this;return w(this,function(o){switch(o.label){case 0:return t=this.queue,this.queue=[],[4,Promise.all(t.map(function(a){return i.apply(a)}))];case 1:return o.sent(),r=this.plugins.filter(function(a){return a.type==="destination"}),n=r.map(function(a){return a.flush&&a.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},e.prototype.addOptOutListener=function(t){this._optOutListeners.push(t)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onIdentityChanged)===null||n===void 0||n.call(r,t)})},e.prototype.onSessionIdChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onSessionIdChanged)===null||n===void 0||n.call(r,t)})},e.prototype.onOptOutChanged=function(t){this.plugins.forEach(function(r){var n;(n=r.onOptOutChanged)===null||n===void 0||n.call(r,t)}),this._callOptOutListeners(t)},e.prototype._callOptOutListeners=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a,s,l;return w(this,function(u){switch(u.label){case 0:u.trys.push([0,7,8,9]),r=U(this._optOutListeners),n=r.next(),u.label=1;case 1:if(n.done)return[3,6];i=n.value,u.label=2;case 2:return u.trys.push([2,4,,5]),[4,i(t)];case 3:return u.sent(),[3,5];case 4:return o=u.sent(),this.loggerProvider.error("Error calling optOut listener",o),[3,5];case 5:return n=r.next(),[3,1];case 6:return[3,9];case 7:return a=u.sent(),s={error:a},[3,9];case 8:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(t){var r;(r=t.onReset)===null||r===void 0||r.call(t)})},e}(),So=function(e,t,r){var n=typeof e=="string"?{event_type:e}:e;return I(I(I({},n),r),t&&{event_properties:t})},ar=function(e,t){var r=I(I({},t),{event_type:_e.IDENTIFY,user_properties:e.getUserProperties()});return r},_o=function(e,t,r,n){var i,o=I(I({},n),{event_type:_e.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[e]=t,i)});return o},wo=function(e,t,r){var n,i=new tt;i.set(e,t);var o=I(I({},r),{event_type:_e.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[e]=t,n)});return o},Ao=function(e,t){return I(I({},t),{event_type:_e.REVENUE,event_properties:e.getEventProperties()})},Io=function(){function e(t){t===void 0&&(t="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new To(this),this.name=t}return e.prototype._init=function(t){return _(this,void 0,void 0,function(){return w(this,function(r){switch(r.label){case 0:return this.config=t,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return r.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a,s,l,u;return w(this,function(c){switch(c.label){case 0:r=this[t],this[t]=[],c.label=1;case 1:c.trys.push([1,8,9,10]),n=U(r),i=n.next(),c.label=2;case 2:return i.done?[3,7]:(o=i.value,a=o(),a&&"promise"in a?[4,a.promise]:[3,4]);case 3:return c.sent(),[3,6];case 4:return[4,a];case 5:c.sent(),c.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return s=c.sent(),l={error:s},[3,10];case 9:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(l)throw l.error}
3return[7];case 10:return this[t].length?[4,this.runQueuedFunctions(t)]:[3,12];case 11:c.sent(),c.label=12;case 12:return[2]}})})},e.prototype.track=function(t,r,n){var i=So(t,r,n);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),ae(this.dispatch(i))},e.prototype.identify=function(t,r){var n=ar(t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),ae(this.dispatch(n))},e.prototype.groupIdentify=function(t,r,n,i){var o=_o(t,r,n,i);return ae(this.dispatch(o))},e.prototype.setGroup=function(t,r,n){var i=wo(t,r,n);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),ae(this.dispatch(i))},e.prototype.revenue=function(t,r){var n=Ao(t,r);return ae(this.dispatch(n))},e.prototype.add=function(t){return this.isReady?this._addPlugin(t):(this.q.push(this._addPlugin.bind(this,t)),ae())},e.prototype._addPlugin=function(t){return ae(this.timeline.register(t,this.config))},e.prototype.remove=function(t){return this.isReady?this._removePlugin(t):(this.q.push(this._removePlugin.bind(this,t)),ae())},e.prototype._removePlugin=function(t){return ae(this.timeline.deregister(t,this.config))},e.prototype.dispatchWithCallback=function(t,r){if(!this.isReady)return r(Ge(t,0,Eo));this.process(t).then(r)},e.prototype.dispatch=function(t){return _(this,void 0,void 0,function(){var r=this;return w(this,function(n){return this.isReady?[2,this.process(t)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,t,i))})]})})},e.prototype.getOperationAppliedUserProperties=function(t){var r,n=(r=this.userProperties)!==null&&r!==void 0?r:{},i=I({},n);if(t===void 0)return i;var o={};return Object.keys(t).forEach(function(a){Object.values(De).includes(a)||(o[a]=t[a])}),vo.forEach(function(a){if(Object.keys(t).includes(a)){var s=t[a];
3switch(a){case De.CLEAR_ALL:Object.keys(i).forEach(function(l){delete i[l]});break;case De.UNSET:Object.keys(s).forEach(function(l){delete i[l]});break;case De.SET:Object.assign(i,s);break}}}),Object.assign(i,o),i},e.prototype.process=function(t){return _(this,void 0,void 0,function(){var i,r,n,i;return w(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,Ge(t,0,mo)]:(t.event_type===_e.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(t)]);case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):i.code===100?this.config.loggerProvider.warn(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),n=String(r),this.config.loggerProvider.error(n),i=Ge(t,0,n),[2,i];case 3:return[2]}})})},e.prototype.setOptOut=function(t){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!t));return}this._setOptOut(t)},e.prototype._setOptOut=function(t){this.config.optOut!==t&&(this.config.optOut=!!t,this.timeline.onOptOutChanged(t))},e.prototype.flush=function(){return ae(this.timeline.flush())},e.prototype.plugin=function(t){var r=this.timeline.plugins.find(function(n){return n.name===t});if(r===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(t));return}return r},e.prototype.plugins=function(t){return this.timeline.plugins.filter(function(r){return r instanceof t})},e}(),Oo=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(t){return this.productId=t,this},e.prototype.setQuantity=function(t){return t>0&&(this.quantity=t),this},e.prototype.setPrice=function(t){return this.price=t,this},e.prototype.setRevenueType=function(t){return this.revenueType=t,this},e.prototype.setCurrency=function(t){return this.currency=t,this},e.prototype.setRevenue=function(t){return this.revenue=t,this},e.prototype.setReceipt=function(t){return this.receipt=t,this},e.prototype.setReceiptSig=function(t){return this.receiptSig=t,this},e.prototype.setEventProperties=function(t){try{var r=JSON.parse(JSON.stringify(t));Jt(r)&&(this.properties=r)}catch{}return this},e.prototype.getEventProperties=function(){var t=this.properties?I({},this.properties):{};return t[he.REVENUE_PRODUCT_ID]=this.productId,t[he.REVENUE_QUANTITY]=this.quantity,t[he.REVENUE_PRICE]=this.price,t[he.REVENUE_TYPE]=this.revenueType,t[he.REVENUE_CURRENCY]=this.currency,t[he.REVENUE]=this.revenue,t[he.RECEIPT]=this.receipt,t[he.RECEIPT_SIG]=this.receiptSig,t},e}(),he;(function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"})(he||(he={}));var ko=function(e,t){var r=Math.max(t,1);return e.reduce(function(n,i,o){var a=Math.floor(o/r);return n[a]||(n[a]=[]),n[a].push(i),n},[])},Co=new Set([Wi,Ki,zi,Xi]),Po=function(e,t){return t===void 0&&(t=!1),Co.has(e)?!0:t};function Ro(e){return e instanceof Error?e.message:String(e)}function Ye(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var Lo=function(){function e(t){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=t==null?void 0:t.diagnosticsClient}return e.prototype.setup=function(t){var r;return _(this,void 0,void 0,function(){var n,i=this;return w(this,function(o){switch(o.label){case 0:return this.config=t,this.storageKey="".concat(ji,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),n&&n.length>0&&Promise.all(n.map(function(a){return i.execute(a)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(t){var r=this;return t.insert_id||(t.insert_id=Ie()),new Promise(function(n){var i={event:t,attempts:0,callback:function(o){return n(o)},timeout:0};r.queue.push(i),r.schedule(r.config.flushIntervalMillis),r.saveEvents()})}
3,e.prototype.removeEventsExceedFlushMaxRetries=function(t){var r=this;return t.filter(function(n){return n.attempts+=1,n.attempts<r.config.flushMaxRetries?!0:(r.fulfillRequest([n],500,go),!1)})},e.prototype.scheduleEvents=function(t){var r=this;t.forEach(function(n){r.schedule(n.timeout===0?r.config.flushIntervalMillis:n.timeout)})},e.prototype.schedule=function(t){var r=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&t>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=t,this.scheduleId=setTimeout(function(){r.queue=r.queue.map(function(n){return n.timeout=0,n}),r.flush(!0)},t);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(t){return t===void 0&&(t=!1),_(this,void 0,void 0,function(){var r,n,i,o=this;return w(this,function(a){switch(a.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),r=[],n=[],this.queue.forEach(function(s){return s.timeout===0?r.push(s):n.push(s)}),i=ko(r,this.config.flushQueueSize),[4,i.reduce(function(s,l){return _(o,void 0,void 0,function(){return w(this,function(u){switch(u.label){case 0:return[4,s];case 1:return u.sent(),[4,this.send(l,t)];case 2:return[2,u.sent()]}})})},Promise.resolve())]);case 1:return a.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(t,r){var n;return r===void 0&&(r=!0),_(this,void 0,void 0,function(){var i,o,a,s,l,u;return w(this,function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(t,400,bo)];i={api_key:this.config.apiKey,events:t.map(function(d){var f=d.event;f.extra;var v=yt(f,["extra"]);return v}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Gi,c.label=1;case 1:return c.trys.push([1,3,,4]),o=Bi(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,a=Po(o,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(o,i,this.config._enableRequestBodyCompressionExperimental&&a)];case 2:return s=c.sent(),s===null?(this.fulfillRequest(t,0,po),[2]):r?(this.handleResponse(s,t),[3,4]):("body"in s?this.fulfillRequest(t,s.statusCode,"".concat(s.status,": ").concat(Ye(s))):this.fulfillRequest(t,s.statusCode,s.status),[2]);case 3:return l=c.sent(),u=Ro(l),this.config.loggerProvider.error(u),(n=this.diagnosticsClient)===null||n===void 0||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:t.map(function(d){return d.event.event_type}),message:u,stack_trace:Dt()}),this.handleResponse({status:qe.Failed,statusCode:0},t),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(t,r){var n;Er(t.statusCode)||(n=this.diagnosticsClient)===null||n===void 0||n.recordEvent("analytics.events.unsuccessful",{events:r.map(function(o){return o.event.event_type}),code:t.statusCode,status:t.status,body:Ye(t),stack_trace:Dt()});var i=t.status;switch(i){case qe.Success:{this.handleSuccessResponse(t,r);break}case qe.Invalid:{this.handleInvalidResponse(t,r);break}case qe.PayloadTooLarge:{this.handlePayloadTooLargeResponse(t,r);break}case qe.RateLimit:{this.handleRateLimitResponse(t,r);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(i,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},e.prototype.handleSuccessResponse=function(t,r){this.fulfillRequest(r,t.statusCode,ho)},e.prototype.handleInvalidResponse=function(t,r){var n=this;if(t.body.missingField||t.body.error.startsWith(yo)){this.fulfillRequest(r,t.statusCode,t.body.error);return}var i=j(j(j(j([],D(Object.values(t.body.eventsWithInvalidFields)),!1),D(Object.values(t.body.eventsWithMissingFields)),!1),D(Object.values(t.body.eventsWithInvalidIdLengths)),!1),D(t.body.silencedEvents),!1).flat(),o=new Set(i),a=r.filter(function(l,u){if(o.has(u)){n.fulfillRequest([l],t.statusCode,t.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(Ye(t));
3var s=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(s)},e.prototype.handlePayloadTooLargeResponse=function(t,r){if(r.length===1){this.fulfillRequest(r,t.statusCode,t.body.error);return}this.config.loggerProvider.warn(Ye(t)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(t,r){var n=this,i=Object.keys(t.body.exceededDailyQuotaUsers),o=Object.keys(t.body.exceededDailyQuotaDevices),a=t.body.throttledEvents,s=new Set(i),l=new Set(o),u=new Set(a),c=r.filter(function(f,v){if(f.event.user_id&&s.has(f.event.user_id)||f.event.device_id&&l.has(f.event.device_id)){n.fulfillRequest([f],t.statusCode,t.body.error);return}return u.has(v)&&(f.timeout=n.throttleTimeout),!0});c.length>0&&this.config.loggerProvider.warn(Ye(t));var d=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(d)},e.prototype.handleOtherResponse=function(t){var r=this,n=t.map(function(o){return o.timeout=o.attempts*r.retryTimeout,o}),i=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(i)},e.prototype.fulfillRequest=function(t,r,n){var i,o,a;Er(r)?(a=this.diagnosticsClient)===null||a===void 0||a.increment("analytics.events.sent",t.length):((i=this.diagnosticsClient)===null||i===void 0||i.increment("analytics.events.dropped",t.length),(o=this.diagnosticsClient)===null||o===void 0||o.recordEvent("analytics.events.dropped",{events:t.map(function(s){return s.event.event_type}),code:r,message:n,stack_trace:Dt()})),this.removeEvents(t),t.forEach(function(s){return s.callback(Ge(s.event,r,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var t=this.queue.map(function(r){return r.event});this.config.storageProvider.set(this.storageKey,t)}},e.prototype.removeEvents=function(t){this.queue=this.queue.filter(function(r){return!t.some(function(n){return n.event.insert_id===r.event.insert_id})}),this.saveEvents()},e}(),Do=function(){function e(){this.name="identity",this.type="before",this.identityStore=Xt().identityStore}return e.prototype.execute=function(t){return _(this,void 0,void 0,function(){var r;return w(this,function(n){return r=t.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,t]})})},e.prototype.setup=function(t){return _(this,void 0,void 0,function(){return w(this,function(r){return t.instanceName&&(this.identityStore=Xt(t.instanceName).identityStore),[2]})})},e}(),Ln=function(e,t){t===void 0&&(t=Date.now());var r=Date.now(),n=r-t;return n>e},Dn=function(e,t,r){return t===void 0&&(t=""),r===void 0&&(r=10),[ir,t,e.substring(0,r)].filter(Boolean).join("_")},xo=function(e){return"".concat(ir.toLowerCase(),"_").concat(e.substring(0,6))},No=function(){var e,t,r,n;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(n=(r=(t=(e=navigator.languages)===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""},St=function(){var e,t=F();if(!(!((e=t==null?void 0:t.location)===null||e===void 0)&&e.search))return{};var r=t.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var a=o.split("=",2),s=Dr(a[0]),l=Dr(a[1]);return l&&(i[s]=l),i},{});return n},Dr=function(e){e===void 0&&(e="");try{return decodeURIComponent(e)}catch{return""}},Yt=function(e,t){return!t||!t.length?!0:t.some(function(r){return typeof r=="string"?e===r:e.match(r)})},we=function(e,t){var r=e;try{r=decodeURI(e)}catch(n){t==null||t.error("Malformed URI sequence: ",n)}return r},sr=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return _(this,void 0,void 0,function(){return w(this,function(t){return[2,!0]})})},e.prototype.get=function(t){return _(this,void 0,void 0,function(){return w(this,function(r){return[2,this.memoryStorage.get(t)]})})},e.prototype.getRaw=function(t){return _(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return[4,this.get(t)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},e.prototype.set=function(t,r){return _(this,void 0,void 0,function(){return w(this,function(n){return this.memoryStorage.set(t,r),[2]})})},e.prototype.remove=function(t){return _(this,void 0,void 0,function(){return w(this,function(r){return this.memoryStorage.delete(t),[2]})})},e.prototype.reset=function(){return _(this,void 0,void 0,function(){return w(this,function(t){return this.memoryStorage.clear(),[2]})})},e}(),Mo=function(){var e,t=F();return(e=t==null?void 0:t.navigator)===null||e===void 0?void 0:e.locks},_t=function(){function e(t,r){r===void 0&&(r={}),this.options=I({},t),this.config=r}return e.prototype.isEnabled=function(){return _(this,void 0,void 0,function(){var t,r,n,i,o=this;return w(this,function(a){switch(a.label){case 0:return t="AMP_TEST",r=I({},this.options),n=new e(r),i=String(Date.now()),[4,n.transaction(t,function(s){var l,u;try{s.set(i);var c=s.get(),d=c===i;return!d&&o.config.diagnosticsClient&&((l=o.config.diagnosticsClient)===null||l===void 0||l.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),d}catch(v){if(o.config.diagnosticsClient){var f=v instanceof Error?v.message:String(v);(u=o.config.diagnosticsClient)===null||u===void 0||u.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:f,sync:!0})}return!1}finally{s.set(null)}})];case 1:return[2,a.sent()]}})})},e.prototype.get=function(t){return _(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return[4,this.getRaw(t)];case 1:return r=n.sent(),[2,this.decodeCookieValue(t,r)]}})})},e.prototype.decodeCookieValue=function(t,r){if(r)try{var n=xn(r);if(n===void 0){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(t,", value: ").concat(r));return}return JSON.parse(n)}catch{console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(t,", value: ").concat(r));return}},e.prototype.getSync=function(t){var r=this.getRawSync(t);return this.decodeCookieValue(t,r)},e.prototype.getRaw=function(t){var r,n;return _(this,void 0,void 0,function(){var i,o,a,s,l,u,c,d,f;return w(this,function(v){switch(v.label){case 0:i=F(),o=i,v.label=1;case 1:return v.trys.push([1,4,,5]),a=o==null?void 0:o.cookieStore,a?[4,a.getAll(t)]:[3,3];case 2:if(s=v.sent(),s){s.length>1&&((r=this.config.diagnosticsClient)===null||r===void 0||r.recordEvent("cookies.duplicate",{cookies:s.map(function(p){return p.domain})}),(n=this.config.diagnosticsClient)===null||n===void 0||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(l=U(s),u=l.next();!u.done;u=l.next())if(c=u.value,Nn(c.domain,this.options.domain))return[2,c.value]}catch(p){d={error:p}}finally{try{u&&!u.done&&(f=l.return)&&f.call(l)}finally{if(d)throw d.error}}}v.label=3;case 3:return[3,5];case 4:return v.sent(),[3,5];case 5:return[2,this.getRawSync(t)]}})})},e.prototype.getRawSync=function(t){var r=this,n,i,o=F(),a=((i=(n=o==null?void 0:o.document)===null||n===void 0?void 0:n.cookie.split("; "))!==null&&i!==void 0?i:[]).filter(function(u){return u.indexOf(t+"=")===0}),s=void 0,l=this.config.duplicateResolverFn;
3if(typeof l=="function"&&a.length>1&&(s=a.find(function(u){var c;try{var d=l(u.substring(t.length+1));return d||(c=r.config.diagnosticsClient)===null||c===void 0||c.increment("cookies.duplicate.occurrence.document.cookie"),d}catch{return!1}})),s||(s=a[0]),!!s)return s.substring(t.length+1)},e.prototype.set=function(t,r){return _(this,void 0,void 0,function(){return w(this,function(n){return this.setSync(t,r),[2]})})},e.prototype.setSync=function(t,r){var n;try{var i=(n=this.options.expirationDays)!==null&&n!==void 0?n:0,o=r!==null?i:-1,a=void 0;if(o){var s=new Date;s.setTime(s.getTime()+o*24*60*60*1e3),a=s}var l="".concat(t,"=").concat(btoa(encodeURIComponent(JSON.stringify(r))));a&&(l+="; expires=".concat(a.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite));var u=F();u!=null&&u.document&&(u.document.cookie=l)}catch(d){var c=d instanceof Error?d.message:String(d);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(t,". Error: ").concat(c))}},e.prototype.remove=function(t){return _(this,void 0,void 0,function(){return w(this,function(r){switch(r.label){case 0:return[4,this.set(t,null)];case 1:return r.sent(),[2]}})})},e.prototype.reset=function(){return _(this,void 0,void 0,function(){return w(this,function(t){return[2]})})},e.isDomainWritable=function(t){return _(this,void 0,void 0,function(){var r,n,i,o;return w(this,function(a){switch(a.label){case 0:if(e.cachedTlds[t])return[2,!0];r={domain:"."+t},n="AMP_TLDTEST",i=new e(r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.transaction(n,function(s){if(e.cachedTlds[t])return!0;try{s.set(1);var l=!!s.get();return l&&(e.cachedTlds[t]=!0),l}finally{s.set(null)}})];case 2:return o=a.sent(),[2,!!o];case 3:return a.sent(),[2,!1];case 4:return[2]}})})},e.prototype.transaction=function(t,r){return _(this,void 0,void 0,function(){var n,i,o=this;return w(this,function(a){switch(a.label){case 0:if(n=Mo(),i=function(){var s={get:function(){return o.getSync(t)},set:function(l){return o.setSync(t,l)}};return r(s)},!n)return[2,i()];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n.request("com.amplitude:cookie-lock:".concat(t),i)];case 2:return[2,a.sent()];case 3:return a.sent(),[2,i()];case 4:return[2]}})})},e.cachedTlds={},e}(),Uo=function(e){try{return decodeURIComponent(atob(e))}catch{return}},Fo=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},xn=function(e){var t;return(t=Uo(e))!==null&&t!==void 0?t:Fo(e)},Nn=function(e,t){if(e===""&&t==="")return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},xr=function(e,t,r){return t===void 0&&(t=""),r===void 0&&(r=10),[ir,t,e.substring(0,r)].filter(Boolean).join("_")},Ot=function(){function e(t){this.storage=t}return e.prototype.isEnabled=function(){return _(this,void 0,void 0,function(){var t,r,n,i;return w(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return o.sent(),[4,r.get(n)];case 3:return i=o.sent(),[2,i===t];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return o.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(t){return _(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(t)];case 1:return r=n.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(t){var r;return _(this,void 0,void 0,function(){return w(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(t))||void 0]})})},e.prototype.set=function(t,r){var n;return _(this,void 0,void 0,function(){return w(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(t,JSON.stringify(r))}catch{}return[2]})})},e.prototype.remove=function(t){var r;return _(this,void 0,void 0,function(){return w(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(t)}catch{}return[2]})})},e.prototype.reset=function(){var t;return _(this,void 0,void 0,function(){return w(this,function(r){try{(t=this.storage)===null||t===void 0||t.clear()}catch{}return[2]})})},e}(),Vo=10,qo=1,H={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},Nr={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},Mr=function(){function e(t,r){this.dbPromise=null,this.logger=r,this.dbName="AMP_diagnostics_".concat(t.substring(0,10))}return e.isSupported=function(){var t;return((t=F())===null||t===void 0?void 0:t.indexedDB)!==void 0},e.prototype.getDB=function(){return _(this,void 0,void 0,function(){return w(this,function(t){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]})})},e.prototype.openDB=function(){var t=this;return new Promise(function(r,n){var i=indexedDB.open(t.dbName,qo);i.onerror=function(){t.dbPromise=null,n(new Error("Failed to open IndexedDB"))},i.onsuccess=function(){var o=i.result;
3o.onclose=function(){t.dbPromise=null,t.logger.debug("DiagnosticsStorage: DB connection closed.")},o.onerror=function(a){t.logger.debug("DiagnosticsStorage: A global database error occurred.",a),o.close()},r(o)},i.onupgradeneeded=function(o){var a=o.target.result;t.createTables(a)}})},e.prototype.createTables=function(t){if(t.objectStoreNames.contains(H.TAGS)||t.createObjectStore(H.TAGS,{keyPath:"key"}),t.objectStoreNames.contains(H.COUNTERS)||t.createObjectStore(H.COUNTERS,{keyPath:"key"}),t.objectStoreNames.contains(H.HISTOGRAMS)||t.createObjectStore(H.HISTOGRAMS,{keyPath:"key"}),!t.objectStoreNames.contains(H.EVENTS)){var r=t.createObjectStore(H.EVENTS,{keyPath:"id",autoIncrement:!0});r.createIndex("time_idx","time",{unique:!1})}t.objectStoreNames.contains(H.INTERNAL)||t.createObjectStore(H.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a=this;return w(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([H.TAGS],"readwrite"),i=n.objectStore(H.TAGS),[2,new Promise(function(l){var u=Object.entries(t);n.oncomplete=function(){l()},n.onabort=function(c){a.logger.debug("DiagnosticsStorage: Failed to set tags",c),l()},u.forEach(function(c){var d=D(c,2),f=d[0],v=d[1],p=i.put({key:f,value:v});p.onerror=function(E){a.logger.debug("DiagnosticsStorage: Failed to set tag",f,v,E)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",o),[3,3];case 3:return[2]}})})},e.prototype.incrementCounters=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a=this;return w(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([H.COUNTERS],"readwrite"),i=n.objectStore(H.COUNTERS),[2,new Promise(function(l){var u=Object.entries(t);n.oncomplete=function(){l()},n.onabort=function(c){a.logger.debug("DiagnosticsStorage: Failed to increment counters",c),l()},u.forEach(function(c){var d=D(c,2),f=d[0],v=d[1],p=i.get(f);p.onsuccess=function(){var E=p.result,T=E?E.value:0,b=i.put({key:f,value:T+v});b.onerror=function(h){a.logger.debug("DiagnosticsStorage: Failed to update counter",f,h)}},p.onerror=function(E){a.logger.debug("DiagnosticsStorage: Failed to read existing counter",f,E)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",o),[3,3];case 3:return[2]}})})},e.prototype.setHistogramStats=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a=this;return w(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),Object.entries(t).length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([H.HISTOGRAMS],"readwrite"),i=n.objectStore(H.HISTOGRAMS),[2,new Promise(function(l){var u=Object.entries(t);n.oncomplete=function(){l()},n.onabort=function(c){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",c),l()},u.forEach(function(c){var d=D(c,2),f=d[0],v=d[1],p=i.get(f);p.onsuccess=function(){var E=p.result,T;E?T={key:f,count:E.count+v.count,min:Math.min(E.min,v.min),max:Math.max(E.max,v.max),sum:E.sum+v.sum}:T={key:f,count:v.count,min:v.min,max:v.max,sum:v.sum};var b=i.put(T);b.onerror=function(h){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",f,h)}},p.onerror=function(E){a.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",f,E)}})})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",o),[3,3];case 3:return[2]}})})},e.prototype.addEventRecords=function(t){return _(this,void 0,void 0,function(){var r,n,i,o,a=this;return w(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),t.length===0?[2]:[4,this.getDB()];case 1:return r=s.sent(),n=r.transaction([H.EVENTS],"readwrite"),i=n.objectStore(H.EVENTS),[2,new Promise(function(l){n.oncomplete=function(){l()},n.onabort=function(c){a.logger.debug("DiagnosticsStorage: Failed to add event records",c),l()};var u=i.count();u.onsuccess=function(){var c=u.result,d=Math.max(0,Vo-c);d<t.length&&a.logger.debug("DiagnosticsStorage: Only added ".concat(d," of ").concat(t.length," events due to storage limit")),t.slice(0,d).forEac
3h(function(f){var v=i.add(f);v.onerror=function(p){a.logger.debug("DiagnosticsStorage: Failed to add event record",p)}})},u.onerror=function(c){a.logger.debug("DiagnosticsStorage: Failed to count existing events",c)}})];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",o),[3,3];case 3:return[2]}})})},e.prototype.setInternal=function(t,r){return _(this,void 0,void 0,function(){var n,i,o,a;return w(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),i=n.transaction([H.INTERNAL],"readwrite"),o=i.objectStore(H.INTERNAL),[2,new Promise(function(l,u){i.onabort=function(){return u(new Error("Failed to set internal value"))};var c=o.put({key:t,value:r});c.onsuccess=function(){return l()},c.onerror=function(){return u(new Error("Failed to set internal value"))}})];case 2:return a=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",a),[3,3];case 3:return[2]}})})},e.prototype.getInternal=function(t){return _(this,void 0,void 0,function(){var r,n,i,o;return w(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=a.sent(),n=r.transaction([H.INTERNAL],"readonly"),i=n.objectStore(H.INTERNAL),[2,new Promise(function(s,l){n.onabort=function(){return l(new Error("Failed to get internal value"))};var u=i.get(t);u.onsuccess=function(){return s(u.result)},u.onerror=function(){return l(new Error("Failed to get internal value"))}})];case 2:return o=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",o),[2,void 0];case 3:return[2]}})})},e.prototype.getLastFlushTimestamp=function(){return _(this,void 0,void 0,function(){var t,r;return w(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(Nr.LAST_FLUSH_TIMESTAMP)];case 1:return t=n.sent(),[2,t?parseInt(t.value,10):void 0];case 2:return r=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",r),[2,void 0];case 3:return[2]}})})},e.prototype.setLastFlushTimestamp=function(t){return _(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(Nr.LAST_FLUSH_TIMESTAMP,t.toString())];case 1:return n.sent(),[3,3];case 2:return r=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",r),[3,3];case 3:return[2]}})})},e.prototype.clearTable=function(t,r){return new Promise(function(n,i){var o=t.objectStore(r),a=o.clear();a.onsuccess=function(){return n()},a.onerror=function(){return i(new Error("Failed to clear table ".concat(r)))}})},e.prototype.getAllAndClear=function(){return _(this,void 0,void 0,function(){var t,r,n,i,o,a,s,l;return w(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),[4,this.getDB()];case 1:return t=u.sent(),r=t.transaction([H.TAGS,H.COUNTERS,H.HISTOGRAMS,H.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(r,H.TAGS),this.getAllFromStore(r,H.COUNTERS),this.getAllFromStore(r,H.HISTOGRAMS),this.getAllFromStore(r,H.EVENTS)])];case 2:return n=D.apply(void 0,[u.sent(),4]),i=n[0],o=n[1],a=n[2],s=n[3],[4,Promise.all([this.clearTable(r,H.COUNTERS),this.clearTable(r,H.HISTOGRAMS),this.clearTable(r,H.EVENTS)])];case 3:return u.sent(),[2,{tags:i,counters:o,histogramStats:a,events:s}];case 4:return l=u.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",l),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}})})},e.prototype.getAllFromStore=function(t,r){return new Promise(function(n,i){var o=t.objectStore(r),a=o.getAll();a.onsuccess=function(){return n(a.result)},a.onerror=function(){return i(new Error("Failed to get all from ".concat(r)))}})},e}(),Ho="__AMPLITUDE_SCRIPT_URL__",jo="sdk.error.uncaught",Bo=function(){var e=F();if(!e)return[];var t=e[Ho];return Array.isArray(t)?t:typeof t=="string"?[t]:[]},Go=function(e){var t=F();if(!(!t||typeof t.addEventListener!="function")){var r=function(o){var a=o.error instanceof Error?o.error:void 0,s=a==null?void 0:a.stack,l=Ur({filename:o.filename,stack:s});l&&i({type:"error",message:o.message,stack:s,filename:o.filename,errorName:a==null?void 0:a.name,metadata:{colno:o.colno,lineno:o.lineno,isTrusted:o.isTrusted,matchReason:l}})},n=function(o){var a,s=o.reason instanceof Error?o.reason:void 0,l=s==null?void 0:s.stack,u=Wo(l),c=Ur({filename:u,stack:l});c&&i({type:"unhandledrejection",message:(a=s==null?void 0:s.message)!==null&&a!==void 0?a:Ko(o.reason),stack:l,filename:u,errorName:s==null?void 0:s.name,metadata:{isTrusted:o.isTrusted,matchReason:c}})},i=function(o){e.recordEvent(jo,I({type:o.type,message:o.message,filename:o.filename,error_name:o.errorName,stack:o.stack},o.metadata))};t.addEventListener("error",r,!0),t.addEventListener("unhandledrejection",n,!0)}},Ur=function(e){var t,r,n=Bo();if(n.length!==0)try{for(var i=U(n),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.filename&&e.filename.includes(a))return"filename";if(e.stack&&e.stack.includes(a))return"stack"}}catch(s){t={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},Wo=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Ko=function(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return"[object Object]"}},zo=1e3,ut=5*60*1e3,Xo="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",Jo="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",xt=1e4,Yo=10,$o=function(){function e(t,r,n,i){n===void 0&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=t,this.logger=r,this.serverUrl=n==="US"?Xo:Jo,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(i,null,2)),this.config=I({enabled:!0,sampleRate:0},i),this.startTimestamp=Date.now(),this.shouldTrack=Tr(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Mr.isSupported()?this.storage=new Mr(t,r):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),Go(this))}return e.prototype.isStorageAndTrackEnabled=function(){return!!this.storage&&!!this.shouldTrack},e.prototype.setTag=function(t,r){if(this.isStorageAndTrackEnabled()){if
3(Object.keys(this.inMemoryTags).length>=xt){this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit");return}this.inMemoryTags[t]=r,this.startTimersIfNeeded()}},e.prototype.increment=function(t,r){if(r===void 0&&(r=1),!!this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryCounters).length>=xt){this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit");return}this.inMemoryCounters[t]=(this.inMemoryCounters[t]||0)+r,this.startTimersIfNeeded()}},e.prototype.recordHistogram=function(t,r){if(this.isStorageAndTrackEnabled()){if(Object.keys(this.inMemoryHistograms).length>=xt){this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");return}var n=this.inMemoryHistograms[t];n?(n.count+=1,n.min=Math.min(n.min,r),n.max=Math.max(n.max,r),n.sum+=r):this.inMemoryHistograms[t]={count:1,min:r,max:r,sum:r},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(t,r){if(this.isStorageAndTrackEnabled()){if(this.inMemoryEvents.length>=Yo){this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit");return}this.inMemoryEvents.push({event_name:t,time:Date.now(),event_properties:r}),this.startTimersIfNeeded()}},e.prototype.startTimersIfNeeded=function(){var t=this;this.saveTimer||(this.saveTimer=setTimeout(function(){t.saveAllDataToStorage().catch(function(r){t.logger.debug("DiagnosticsClient: Failed to save all data to storage",r)}).finally(function(){t.saveTimer=null})},zo)),this.flushTimer||(this.flushTimer=setTimeout(function(){t._flush().catch(function(r){t.logger.debug("DiagnosticsClient: Failed to flush",r)}).finally(function(){t.flushTimer=null})},ut))},e.prototype.saveAllDataToStorage=function(){return _(this,void 0,void 0,function(){var t,r,n,i;return w(this,function(o){switch(o.label){case 0:return this.storage?(t=I({},this.inMemoryTags),r=I({},this.inMemoryCounters),n=I({},this.inMemoryHistograms),i=j([],D(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(t),this.storage.incrementCounters(r),this.storage.setHistogramStats(n),this.storage.addEventRecords(i)])]):[2];case 1:return o.sent(),[2]}})})},e.prototype._flush=function(){return _(this,void 0,void 0,function(){var t,r,n,i,o,a,s,l,u,c;return w(this,function(d){switch(d.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return d.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return t=d.sent(),r=t.tags,n=t.counters,i=t.histogramStats,o=t.events,this.storage.setLastFlushTimestamp(Date.now()),a={},r.forEach(function(f){a[f.key]=f.value}),s={},n.forEach(function(f){s[f.key]=f.value}),l={},i.forEach(function(f){l[f.key]={count:f.count,min:f.min,max:f.max,avg:Math.round(f.sum/f.count*100)/100}}),u=o.map(function(f){return{event_name:f.event_name,time:f.time,event_properties:f.event_properties}}),Object.keys(s).length===0&&Object.keys(l).length===0&&u.length===0?[2]:(c={tags:a,histogram:l,counters:s,events:u},this.fetch(c),[2])}})})},e.prototype.fetch=function(t){return _(this,void 0,void 0,function(){var r,n;return w(this,function(i){switch(i.label){case 0:if(i.trys.push([0,2,,3]),!F())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return r=i.sent(),r.ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return n=i.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",n),[3,3];case 3:return[2]}})})},e.prototype.initializeFlushInterval=function(){return _(this,void 0,void 0,function(){var t,r,n;return w(this,function(i){switch(i.label){case 0:return this.storage?(t=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return r=i.sent()||-1,r===-1?(this.storage.setLastFlushTimestamp(t),this._setFlushTimer(ut),[2]):(n=t-r,n>=ut?(this._flush(),[2]):(this._setFlushTimer(ut-n),[2]))}})})},e.prototype._setFlushTimer=function(t){var r=this;this.flushTimer=setTimeout(function(){r._flush().catch(function(n){r.logger.debug("DiagnosticsClient: Failed to flush",n)}).finally(function(){r.flushTimer=null})},t)},e.prototype._setSampleRate=function(t){this.logger.debug("DiagnosticsClient: Setting sample rate to",t),this.config.sampleRate=t,this.shouldTrack=Tr(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Mn=2*1024;function Un(){return typeof CompressionStream<"u"}function Fn(e){return _(this,void 0,void 0,function(){var t,r;return w(this,function(n){switch(n.label){case 0:if(t=CompressionStream,typeof t>"u")return[2,void 0];n.label=1;case 1:return n.trys.push([1,3,,4]),r=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(r).arrayBuffer()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,void 0];case 4:return[2]}})})}var Nt=F(),He=Nt==null?void 0:Nt.console,Ne={},rt={},Mt=!1;function Qo(e){if(!He||typeof He[e]!="function")return!1;if(rt[e])return!0;var t=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{if(Ne[e]&&!Mt){Mt=!0;var i=Ne[e];
3i&&i.forEach(function(o){try{o(e,r)}catch{}})}}catch{}return Mt=!1,rt[e].apply(He,r)};return rt[e]=He[e],He[e]=t,!0}function Zo(e,t){var r=Qo(e);if(!r)return new Error("Console override failed");Ne[e]?Ne[e].push(t):Ne[e]=[t]}function ea(e){var t,r;try{for(var n=U(Object.values(Ne)),i=n.next();!i.done;i=n.next())for(var o=i.value,a=o.length-1;a>=0;a--)if(o[a]===e){o.splice(a,1);break}}catch(s){t={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}function ta(){var e,t;try{for(var r=U(Object.entries(rt)),n=r.next();!n.done;n=r.next()){var i=D(n.value,2),o=i[0],a=i[1];a&&(He[o]=a)}}catch(s){e={error:s}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}rt={},Ne={}}var Fr={addListener:Zo,removeListener:ea,_restoreConsole:ta},Vn=null,qn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],ur="data-amp-track-",Hn=["div","span","h1","h2","h3","h4","h5","h6"],jn=150,ra=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],Bn=j(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],D(ra),!1),na=Bn,ia=Bn,oa=["*"],aa=1e3,sa=4,ua=50;function la(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||e===void 0}function Gn(e,t,r){if(e){var n=t.map(Vr),i=r.map(Vr);Wn({json:e,allowlist:n,excludelist:i,ancestors:[]})}}function Wn(e){var t,r,n=e.json,i=e.targetObject,o=e.allowlist,a=e.excludelist,s=e.ancestors,l=e.parentObject,u=e.targetKey;i||(i=n);var c=Object.keys(i);try{for(var d=U(c),f=d.next();!f.done;f=d.next()){var v=f.value,p=j(j([],D(s),!1),[v],!1);la(i[v])?(!qr(p,o)||qr(p,a))&&delete i[v]:Wn({json:n,targetObject:i[v],allowlist:o,excludelist:a,ancestors:p,parentObject:i,targetKey:v})}}catch(E){t={error:E}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}Object.keys(i).length===0&&l&&u&&delete l[u]}function Vr(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map(function(t){return t.replace(/~0/g,"~").replace(/~1/g,"/")})}function $t(e,t,r,n){if(r===void 0&&(r=0),n===void 0&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&t[n]==="**";)n++;return n===t.length}var i=t[n];if(i==="**"){if(n+1===t.length)return!0;for(var o=r;o<=e.length;o++)if($t(e,t,o,n+1))return!0;return!1}else return i==="*"||i===e[r]?$t(e,t,r+1,n+1):!1}function qr(e,t){return t.some(function(r){return $t(e,r)})}var ca=500,Kn=100,da=function(){function e(t){this.request=t}return e.prototype.headers=function(t){var r,n;t===void 0&&(t=[]);var i=this.request.headers,o={};if(Array.isArray(i))i.forEach(function(d){var f=D(d,2),v=f[0],p=f[1];o[v]=p});else if(i instanceof Headers)i.forEach(function(d,f){o[f]=d});else if(typeof i=="object"&&i!==null)try{for(var a=U(Object.entries(i)),s=a.next();!s.done;s=a.next()){var l=D(s.value,2),u=l[0],c=l[1];o[u]=c}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return kt(o,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if(typeof this._bodySize=="number")return this._bodySize;var t=F();if(t!=null&&t.TextEncoder){var r=this.request.body;return this._bodySize=zn(r,Kn),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.request.body=="string"?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),_(this,void 0,void 0,function(){var n;return w(this,function(i){return t.length===0?[2,null]:(n=this.body,[2,lr(n,t,r)])})})},e}(),fa=function(){function e(t,r){this.bodyRaw=t,this.requestHeaders=r}return e.prototype.headers=function(t){return t===void 0&&(t=[]),kt(this.requestHeaders,{allow:t})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return zn(this.bodyRaw,Kn)}
3,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return typeof this.bodyRaw=="string"?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),_(this,void 0,void 0,function(){var n;return w(this,function(i){return t.length===0?[2,null]:(n=this.body,[2,lr(n,t,r)])})})},e}();function zn(e,t){var r,n,i,o=F(),a=o==null?void 0:o.TextEncoder;if(a){var s;if(typeof e=="string")s=e,i=new a().encode(s).length;else if(e instanceof Blob)s=e,i=s.size;else if(e instanceof URLSearchParams)s=e,i=new a().encode(s.toString()).length;else if(ArrayBuffer.isView(e))s=e,i=s.byteLength;else if(e instanceof ArrayBuffer)s=e,i=s.byteLength;else if(e instanceof FormData){var l=e,u=0,c=0;try{for(var d=U(l.entries()),f=d.next();!f.done;f=d.next()){var v=D(f.value,2),p=v[0],E=v[1];if(u+=p.length,typeof E=="string")u+=new a().encode(E).length;else if(E instanceof Blob)u+=E.size;else return;if(++c>=t)return}}catch(T){r={error:T}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}i=u}else if(e instanceof ReadableStream){s=e;return}return i}}var va=function(){function e(t){this.response=t}return e.prototype.headers=function(t){var r;if(t===void 0&&(t=[]),this.response.headers instanceof Headers){var n=this.response.headers,i={};return(r=n==null?void 0:n.forEach)===null||r===void 0||r.call(n,function(o,a){i[a]=o}),kt(i,{allow:t})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var t,r;if(this._bodySize!==void 0)return this._bodySize;var n=(r=(t=this.response.headers)===null||t===void 0?void 0:t.get)===null||r===void 0?void 0:r.call(t,"content-length"),i=n?parseInt(n,10):void 0;return this._bodySize=i,i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return _(this,void 0,void 0,function(){var t,r,n;return w(this,function(i){switch(i.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),i.label=1;case 1:return i.trys.push([1,3,,4]),t=this.clonedResponse.text(),r=new Promise(function(o){return setTimeout(function(){return o(null)},ca)}),[4,Promise.race([t,r])];case 2:return n=i.sent(),[2,n];case 3:return i.sent(),[2,null];case 4:return[2]}})})},e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),_(this,void 0,void 0,function(){var n;return w(this,function(i){switch(i.label){case 0:return t.length===0?[2,null]:[4,this.text()];case 1:return n=i.sent(),[2,lr(n,t,r)]}})})},e}(),ha=function(){function e(t,r,n,i){this.statusCode=t,this.headersString=r,this.size=n,this.getJson=i}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(t){var r,n;if(t===void 0&&(t=[]),!this.headersString)return{};var i={},o=this.headersString.split(`\r
4`);try{for(var a=U(o),s=a.next();!s.done;s=a.next()){var l=s.value,u=D(l.split(": "),2),c=u[0],d=u[1];c&&d&&(i[c]=d)}}catch(f){r={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return kt(i,{allow:t})},e.prototype.json=function(t,r){return t===void 0&&(t=[]),r===void 0&&(r=[]),_(this,void 0,void 0,function(){var n;return w(this,function(i){return t.length===0?[2,null]:(n=this.getJson(),n?(Gn(n,t,r),[2,n]):[2,null])})})},e}();function lr(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return Gn(n,t,r),n}catch{return null}}var nt;(function(e){e.REDACT="redact",e.REMOVE="remove"})(nt||(nt={}));var Hr="[REDACTED]",kt=function(e,t){var r,n,i=t.allow,o=i===void 0?[]:i,a=t.strategy,s=a===void 0?nt.REMOVE:a,l=j([],D(Ji),!1),u={},c=function(p){var E=p.toLowerCase();l.find(function(T){return T.toLowerCase()===E})?s===nt.REDACT&&(u[p]=Hr):o.find(function(T){return T.toLowerCase()===E})?u[p]=e[p]:s===nt.REDACT&&(u[p]=Hr)};try{for(var d=U(Object.keys(e)),f=d.next();!f.done;f=d.next()){var v=f.value;c(v)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return u},pa=function(){function e(t,r,n,i,o,a,s,l,u,c,d){s===void 0&&(s=0),this.type=t,this.method=r,this.timestamp=n,this.startTime=i,this.url=o,this.requestWrapper=a,this.status=s,this.duration=l,this.responseWrapper=u,this.error=c,this.endTime=d}return e.prototype.toSerializable=function(){var t,r,n,i,o={type:this.t
4ype,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:(t=this.requestWrapper)===null||t===void 0?void 0:t.headers(j([],D(Et),!1)),requestBodySize:(r=this.requestWrapper)===null||r===void 0?void 0:r.bodySize,responseHeaders:(n=this.responseWrapper)===null||n===void 0?void 0:n.headers(j([],D(Et),!1)),responseBodySize:(i=this.responseWrapper)===null||i===void 0?void 0:i.bodySize};return Object.fromEntries(Object.entries(o).filter(function(a){var s=D(a,2);s[0];var l=s[1];return l!==void 0}))},e}();function ga(e){return typeof e=="object"&&e!==null&&"url"in e&&"method"in e}var ma=function(){function e(t,r){r===void 0&&(r=Ie()),this.callback=t,this.id=r}return e}();function Le(e){try{e()}catch{}}var ba=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=F();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var t=F();return!!t&&!!t.fetch},e.prototype.subscribe=function(t,r){var n,i,o,a,s,l,u,c,d,f;if(this.logger||(this.logger=r),this.eventCallbacks.set(t.id,t),!this.isObserving){var v=(o=(i=(n=this.globalScope)===null||n===void 0?void 0:n.XMLHttpRequest)===null||i===void 0?void 0:i.prototype)===null||o===void 0?void 0:o.open,p=(l=(s=(a=this.globalScope)===null||a===void 0?void 0:a.XMLHttpRequest)===null||s===void 0?void 0:s.prototype)===null||l===void 0?void 0:l.send,E=(d=(c=(u=this.globalScope)===null||u===void 0?void 0:u.XMLHttpRequest)===null||c===void 0?void 0:c.prototype)===null||d===void 0?void 0:d.setRequestHeader;v&&p&&E&&this.observeXhr(v,p,E);var T=(f=this.globalScope)===null||f===void 0?void 0:f.fetch;T&&this.observeFetch(T),this.isObserving=!0}},e.prototype.unsubscribe=function(t){this.eventCallbacks.delete(t.id)},e.prototype.triggerEventCallbacks=function(t){var r=this;this.eventCallbacks.forEach(function(n){try{n.callback(t)}catch(i){Le(function(){var o;(o=r.logger)===null||o===void 0||o.debug("an unexpected error occurred while triggering event callbacks",i)})}})},e.prototype.handleNetworkRequestEvent=function(t,r,n,i,o,a,s){var l;if(!(a===void 0||s===void 0)){var u,c="GET";if(ga(r)?(u=r.url,c=r.method):u=(l=r==null?void 0:r.toString)===null||l===void 0?void 0:l.call(r),u)try{var d=new URL(u);u="".concat(d.protocol,"//").concat(d.host).concat(d.pathname).concat(d.search).concat(d.hash)}catch{}c=(n==null?void 0:n.method)||c;var f,v;i&&(f=i.status),o&&(v={name:o.name||"UnknownError",message:o.message||"An unknown error occurred"},f=0);var p=Math.floor(performance.now()-s),E=Math.floor(a+p),T=new pa(t,c,a,a,u,n,f,p,i,v,E);this.triggerEventCallbacks(T)}},e.prototype.getTimestamps=function(){var t,r;return{startTime:(t=Date.now)===null||t===void 0?void 0:t.call(Date),durationStart:(r=performance==null?void 0:performance.now)===null||r===void 0?void 0:r.call(performance)}},e.prototype.observeFetch=function(t){var r=this;!this.globalScope||!t||(this.globalScope.fetch=function(n,i){return _(r,void 0,void 0,function(){var o,a,s,l,u=this;return w(this,function(c){switch(c.label){case 0:try{o=this.getTimestamps()}catch(d){Le(function(){var f;return(f=u.logger)===null||f===void 0?void 0:f.debug("an unexpected error occurred while retrieving timestamps",d)})}c.label=1;case 1:return c.trys.push([1,3,,4]),[4,t(n,i)];case 2:return a=c.sent(),[3,4];case 3:return l=c.sent(),s=l,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,i?new da(i):void 0,a?new va(a):void 0,s,o==null?void 0:o.startTime,o==null?void 0:o.durationStart)}catch(d){Le(function(){var f;return(f=u.logger)===null||f===void 0?void 0:f.debug("an unexpected error occurred while handling fetch",d)})}if(a)return[2,a];throw s}})})})},e.createXhrJsonParser=function(t,r){return function(){var n;try{if(t.responseType==="json"){if(!((n=r.globalScope)===null||n===void 0)&&n.structuredClone)return r.globalScope.structuredClone(t.response)}else if(["text",""].includes(t.responseType))return JSON.parse(t.responseText)}catch(i){return i instanceof Error&&i.name==="InvalidStateError"&&Le(function(){var o;return(o=r.logger)===null||o===void 0?void 0:o.debug("unexpected error when retrieving responseText. responseType='".concat(t.responseType,"'"))}),null}return null}},e.prototype.observeXhr=function(t,r,n){if(!(!this.globalScope||!t||!r)){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var a,s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];var u=this,c=D(s,2),d=c[0],f=c[1];try{u.$$AmplitudeAnalyticsEvent=I({method:d,url:(a=f==null?void 0:f.toString)===null||a===void 0?void 0:a.call(f),headers:{}},o.getTimestamps())}catch(v){Le(function(){var p;return(p=o.logger)===null||p===void 0?void 0:p.debug("an unexpected error occurred while calling xhr open",v)})}return t.apply(u,s)},i.send=function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];var l=this,u=l,c=e.createXhrJsonParser(l,o),d=a[0],f=u.$$AmplitudeAnalyticsEvent;return u.$$AmplitudeAnalyticsEvent&&u.addEventListener("loadend",function(){try{var v=u.getAllResponseHeaders(),p=u.getResponseHeader("content-length"),E=new ha(u.status,v,p?parseInt(p,10):void 0,c),T=u.$$AmplitudeAnalyticsEvent.headers,b=new fa(d,T);f.status=u.status,o.handleNetworkRequestEvent("xhr",{url:f.url,method:f.method},b,E,void 0,f.startTime,f.durationStart)}catch(h){Le(function(){var g;return(g=o.logger)===null||g===void 0?void 0:g.debug("an unexpected error occurred while handling xhr send",h)})}}),r.apply(u,a)},i.setRequestHeader=function(a,s){var l=this;try{var u=l.$$AmplitudeAnalyticsEvent;u&&(u.headers[a]=s)}catch(c){Le(function(){var d;return(d=o.logger)===null||d===void 0?void 0:d.debug("an unexpected error occurred while calling xhr setRequestHeader",c)})}n.apply(l,[a,s])}}},e}(),jr=new ba,Xn=function(){function e(){}return e.prototype.parse=function(){return _(this,void 0,void 0,function(){return w(this,function(t){return[2,I(I(I(I({},It),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var t=St(),r=t[Yi],n=t[$i],i=t[Qi],o=t[Zi],a=t[eo],s=t[to];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:s}},e.prototype.getReferrer=function(){var t,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(t=n.referrer)===null||t===void 0?void 0:t.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},e.prototype.getClickIds=function(){var t,r=St();return t={},t[Sr]=r[Sr],t[_r]=r[_r],t[wr]=r[wr],t[Ar]=r[Ar],t[Ir]=r[Ir],t[Or]=r[Or],t[kr]=r[kr],t[Cr]=r[Cr],t[Pr]=r[Pr],t[Rr]=r[Rr],t[Lr]=r[Lr],t},e}(),je="data-amp-mask",Ae="*****",ya=/\b(?:\d[ -]*?){13,16}\b/,Ea=/(\d{3}-?\d{2}-?\d{4})/g,Ta=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,cr=function(e,t){var r,n;if(t===void 0&&(t=[]),typeof e!="string")return"";var i=e;i=i.replace(ya,Ae),i=i.replace(Ea,Ae),i=i.replace(Ta,Ae);try{for(var o=U(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,Ae)}catch{}}}catch(l){r={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},dr=function(e){if(typeof document>"u"||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(je)?Ae:e?e(document.title):document.title},$e={},Br;function Sa(){if(Br)return $e;
4Br=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.Observable=void 0;const e=b=>!!Symbol[b],t=b=>e(b)?Symbol[b]:"@@"+b,r=t("iterator"),n=t("observable"),i=t("species");function o(b,h){let g=b[h];if(g!=null){if(typeof g!="function")throw new TypeError(g+" is not a function");return g}}function a(b){let h=b.constructor;return h!==void 0&&(h=h[i],h===null&&(h=void 0)),h!==void 0?h:T}function s(b){return b instanceof T}function l(b){l.log?l.log(b):setTimeout(()=>{throw b})}function u(b){Promise.resolve().then(()=>{try{b()}catch(h){l(h)}})}function c(b){let h=b._cleanup;if(h!==void 0&&(b._cleanup=void 0,!!h))try{if(typeof h=="function")h();else{let g=o(h,"unsubscribe");g&&g.call(h)}}catch(g){l(g)}}function d(b){b._observer=void 0,b._queue=void 0,b._state="closed"}function f(b){let h=b._queue;if(h){b._queue=void 0,b._state="ready";for(let g=0;g<h.length&&(v(b,h[g].type,h[g].value),b._state!=="closed");++g);}}function v(b,h,g){b._state="running";let m=b._observer;try{let y=o(m,h);switch(h){case"next":y&&y.call(m,g);break;case"error":if(d(b),y)y.call(m,g);else throw g;break;case"complete":d(b),y&&y.call(m);break}}catch(y){l(y)}b._state==="closed"?c(b):b._state==="running"&&(b._state="ready")}function p(b,h,g){if(b._state!=="closed"){if(b._state==="buffering"){b._queue.push({type:h,value:g});return}if(b._state!=="ready"){b._state="buffering",b._queue=[{type:h,value:g}],u(()=>f(b));return}v(b,h,g)}}class E{constructor(h,g){this._cleanup=void 0,this._observer=h,this._queue=void 0,this._state="initializing";let m=this,y={get closed(){return m._state==="closed"},next(S){p(m,"next",S)},error(S){p(m,"error",S)},complete(){p(m,"complete")}};try{this._cleanup=g.call(void 0,y)}catch(S){y.error(S)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(d(this),c(this))}}class T{constructor(h){if(!(this instanceof T))throw new TypeError("Observable cannot be called as a function");if(typeof h!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=h}subscribe(h){return(typeof h!="object"||h===null)&&(h={next:h,error:arguments[1],complete:arguments[2]}),new E(h,this._subscriber)}forEach(h){return new Promise((g,m)=>{if(typeof h!="function"){m(new TypeError(h+" is not a function"));return}function y(){S.unsubscribe(),g()}let S=this.subscribe({next(O){try{h(O,y)}catch(P){m(P),S.unsubscribe()}},error:m,complete:g})})}map(h){if(typeof h!="function")throw new TypeError(h+" is not a function");let g=a(this);return new g(m=>this.subscribe({next(y){try{y=h(y)}catch(S){return m.error(S)}m.next(y)},error(y){m.error(y)},complete(){m.complete()}}))}filter(h){if(typeof h!="function")throw new TypeError(h+" is not a function");let g=a(this);return new g(m=>this.subscribe({next(y){try{if(!h(y))return}catch(S){return m.error(S)}m.next(y)},error(y){m.error(y)},complete(){m.complete()}}))}reduce(h){if(typeof h!="function")throw new TypeError(h+" is not a function");let g=a(this),m=arguments.length>1,y=!1,O=arguments[1];return new g(P=>this.subscribe({next(C){let N=!y;if(y=!0,!N||m)try{O=h(O,C)}catch(A){return P.error(A)}else O=C},error(C){P.error(C)},complete(){if(!y&&!m)return P.error(new TypeError("Cannot reduce an empty sequence"));P.next(O),P.complete()}}))}async all(){let h=[];return await this.forEach(g=>h.push(g)),h}concat(...h){let g=a(this);return new g(m=>{let y,S=0;function O(P){y=P.subscribe({next(C){m.next(C)},error(C){m.error(C)},complete(){S===h.length?(y=void 0,m.complete()):O(g.from(h[S++]))}})}return O(this),()=>{y&&(y.unsubscribe(),y=void 0)}})}flatMap(h){if(typeof h!="function")throw new TypeError(h+" is not a function");let g=a(this);return new g(m=>{let y=[],S=this.subscribe({next(P){if(h)try{P=h(P)}catch(N){return m.error(N)}let C=g.from(P).subscribe({next(N){m.next(N)},error(N){m.error(N)},complete(){let N=y.indexOf(C);N>=0&&y.splice(N,1),O()}});y.push(C)},error(P){m.error(P)},complete(){O()}});function O(){S.closed&&y.length===0&&m.complete()}return()=>{y.forEach(P=>P.unsubscribe()),S.unsubscribe()}})}[n](){return this}static from(h){let g=typeof this=="function"?this:T;if(h==null)throw new TypeError(h+" is not an object");let m=o(h,n);if(m){let y=m.call(h);if(Object(y)!==y)throw new TypeError(y+" is not an object");return s(y)&&y.constructor===g?y:new g(S=>y.subscribe(S))}if(e("iterator")&&(m=o(h,r),m))return new g(y=>{u(()=>{if(!y.closed){for(let S of m.call(h))if(y.next(S),y.closed)return;y.complete()}})});if(Array.isArray(h))return new g(y=>{u(()=>{if(!y.closed){for(let S=0;S<h.length;++S)if(y.next(h[S]),y.closed)return;y.complete()}})});throw new TypeError(h+" is not observable")}static of(...h){let g=typeof this=="function"?this:T;return new g(m=>{u(()=>{if(!m.closed){for(let y=0;y<h.length;++y)if(m.next(h[y]),m.closed)return;m.complete()}})})}static get[i](){return this}}return $e.Observable=T,Object.defineProperty(T,Symbol("extensions"),{value:{symbol:n,hostReportError:l},configurable:!0}),$e}var Ut,Gr;
4function _a(){return Gr||(Gr=1,Ut=Sa().Observable),Ut}var wa=_a();const te=Pn(wa);function fr(e,t){return new te(function(r){e.subscribe({next:function(n){t(n).then(function(i){return r.next(i)}).catch(function(i){return r.error(i)})},error:function(n){r.error(n)},complete:function(){r.complete()}})})}function Me(e,t){return new te(function(r){var n=!1,i=new Set,o=function(){var s,l;n=!0;try{for(var u=U(i),c=u.next();!c.done;c=u.next()){var d=c.value;try{d.unsubscribe()}catch{}}}catch(f){s={error:f}}finally{try{c&&!c.done&&(l=u.return)&&l.call(u)}finally{if(s)throw s.error}}i.clear()},a=function(s){var l=s.subscribe({next:function(u){n||r.next(u)},error:function(u){n||(n=!0,r.error(u),o())},complete:function(){i.delete(l),!n&&i.size===0&&(r.complete(),o(),n=!0)}});i.add(l)};return a(e),a(t),o})}function me(e){var t=new Set,r=null;function n(){r==null||r.unsubscribe(),r=null,t.clear()}return new te(function(i){return t.add(i),r===null&&(r=e.subscribe({next:function(o){var a,s,l;try{for(var u=U(t),c=u.next();!c.done;c=u.next()){var d=c.value;(l=d.next)===null||l===void 0||l.call(d,o)}}catch(f){a={error:f}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}},error:function(o){var a,s,l;try{for(var u=U(t),c=u.next();!c.done;c=u.next()){var d=c.value;(l=d.error)===null||l===void 0||l.call(d,o)}}catch(f){a={error:f}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}n()},complete:function(){var o,a,s;try{for(var l=U(t),u=l.next();!u.done;u=l.next()){var c=u.value;(s=c.complete)===null||s===void 0||s.call(c)}}catch(d){o={error:d}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}n()}})),function(){t.delete(i),t.size===0&&r&&(r.unsubscribe(),r=null)}})}var lt={exports:{}},Wr;function Aa(){if(Wr)return lt.exports;Wr=1;var e=Object.prototype.hasOwnProperty;function t(i){return"[Throws: "+(i?i.message:"?")+"]"}function r(i,o){if(e.call(i,o))try{return i[o]}catch(a){return t(a)}return i[o]}function n(i){var o=[];function a(s){if(s===null||typeof s!="object")return s;if(o.indexOf(s)!==-1)return"[Circular]";if(o.push(s),typeof s.toJSON=="function")try{var l=a(s.toJSON());return o.pop(),l}catch(d){return t(d)}if(Array.isArray(s)){var u=s.map(a);return o.pop(),u}var c=Object.keys(s).reduce(function(d,f){return d[f]=a(r(s,f)),d},{});return o.pop(),c}return a(i)}return lt.exports=function(i,o,a){return JSON.stringify(n(i),o,a)},lt.exports.ensureProperties=n,lt.exports}var Jn=Aa();const Yn=Pn(Jn),Ia=co({__proto__:null,default:Yn},[Jn]);var Oa=Yn||Ia,gt={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},ze=function(e,t){return typeof e=="boolean"?e:(e==null?void 0:e[t])!==!1},$n=function(e){return ze(e,"attribution")},ka=function(e){return ze(e,"fileDownloads")},Qn=function(e){return ze(e,"formInteractions")},Zn=function(e){return ze(e,"pageViews")},Kr=function(e){return ze(e,"sessions")},Ca=function(e){return ze(e,"pageUrlEnrichment")},ei=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.networkTracking===!0||typeof e.networkTracking=="object")},ti=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.elementInteractions===!0||typeof e.elementInteractions=="object")},Pa=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e.webVitals===!0},ri=function(e){return typeof e=="boolean"?e:typeof e=="object"&&(e.frustrationInteractions===!0||typeof e.frustrationInteractions=="object")},Ra=function(e){return typeof e=="boolean"?e:typeof e=="object"&&e!==null&&e.enabled!==!1},La=function(e){if(ti(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.elementInteractions=="object")return e.autocapture.elementInteractions},Da=function(e){if(ri(e.autocapture)&&typeof e.autocapture=="object"&&typeof e.autocapture.frustrationInteractions=="object")return e.autocapture.frustrationInteractions},xa=function(e){var t;if(ei(e.autocapture)){var r=void 0;return typeof e.autocapture=="object"&&typeof e.autocapture.networkTracking=="object"?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),I(I({},r),{captureRules:(t=r==null?void 0:r.captureRules)===null||t===void 0?void 0:t.map(function(n){var i,o,a;if(!((i=n.urls)===null||i===void 0)&&i.length&&(!((o=n.hosts)===null||o===void 0)&&o.length)){var s=JSON.stringify(n.hosts),l=JSON.stringify(n.urls);return(a=e.loggerProvider)===null||a===void 0||a.warn("Found network capture rule with both urls='".concat(l,"' and hosts='").concat(s,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),I(I({},n),{hosts:void 0})}return n})})}},zr=function(e){var t=function(){return!1},r=void 0,n,i=e.pageCounter,o=Zn(e.defaultTracking);return o&&(t=void 0,n=void 0,e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews=="object"&&("trackOn"in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(n=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:r,eventType:n,pageCounter:i}},Xr=function(e){return $n(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution=="object"?I({},e.defaultTracking.attribution):{}},Na=function(e){if(Qn(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking=="object"&&typeof e.defaultTracking.formInteractions=="object")return e.defaultTracking.formInteractions},yl=function(e,t){mt(e,t)},mt=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,o=n.args,a=n.resolve,s=e&&e[i];if(typeof s=="function"){var l=s.apply(e,o);typeof a=="function"&&a(l==null?void 0:l.promise)}}return e},Ft=function(e){var t=e;return t&&t._q!==void 0},vr="2.38.1",ni="amplitude-ts",Ma="Web",Ua="$remote",Fa=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(ni,"/").concat(vr),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(t){return this.config=t,Promise.resolve(void 0)},e.prototype.execute=function(t){var r,n;return _(this,void 0,void 0,function(){var i,o,a,s;return w(this,function(l){return i=new Date().getTime(),o=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,a=(n=t.event_id)!==null&&n!==void 0?n:o+1,this.config.lastEventId=a,t.time||(this.config.lastEventTime=i),s=I(I(I(I(I(I(I(I({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:Ma}),this.config.trackingOptions.language&&{language:No()}),this.config.trackingOptions.ipAddress&&{ip:Ua}),{insert_id:Ie(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),t),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,s]})})},e}(),ct=1e3,ii=function(e){Ue(t,e);function t(r){var n=this,i,o,a;try{a=(i=F())===null||i===void 0?void 0:i.localStorage}catch(s){(o=r==null?void 0:r.loggerProvider)===null||o===void 0||o.debug("Failed to access localStorage. error=".concat(JSON.stringify(s))),a=void 0}return n=e.call(this,a)||this,n.loggerProvider=r==null?void 0:r.loggerProvider,n}return t.prototype.set=function(r,n){var i;return _(this,void 0,void 0,function(){var o;return w(this,function(a){switch(a.label){case 0:return Array.isArray(n)&&n.length>ct?(o=n.length-ct,[4,e.prototype.set.call(this,r,n.slice(0,ct))]):[3,2];case 1:return a.sent(),(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(o," events because the queue length exceeded ").concat(ct,".")),[3,4];case 2:return[4,e.prototype.set.call(this,r,n)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},t}(Ot),Va=function(e){Ue(t,e);function t(){var r;return e.call(this,(r=F())===null||r===void 0?void 0:r.sessionStorage)||this}return t}(Ot),qa=function(e){Ue(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=r,n}return t.prototype.send=function(r,n,i){return i===void 0&&(i=!1),_(this,void 0,void 0,function(){var o=this;return w(this,function(a){return[2,new Promise(function(s,l){typeof XMLHttpRequest>"u"&&l(new Error("XHRTransport is not supported."));var u=new XMLHttpRequest;u.open("POST",r,!0),u.onreadystatechange=function(){if(u.readyState===o.state.done){var E=u.responseText;try{s(o.buildResponse(JSON.parse(E)))}catch{s(o.buildResponse({code:u.status}))}}};var c={"Content-Type":"application/json",Accept:"*/*"},d=JSON.stringify(n),f=i&&d.length>=Mn&&Un(),v=function(E){var T,b;c=I(I({},o.customHeaders),c);try{for(var h=U(Object.entries(c)),g=h.next();!g.done;g=h.next()){var m=D(g.value,2),y=m[0],S=m[1];u.setRequestHeader(y,S)}}catch(O){T={error:O}}finally{try{g&&!g.done&&(b=h.return)&&b.call(h)}finally{if(T)throw T.error}}u.send(E)},p=function(){return _(o,void 0,void 0,function(){var E;return w(this,function(T){switch(T.label){case 0:return f?[4,Fn(d)]:[3,2];case 1:return E=T.sent(),E?(c["Content-Encoding"]="gzip",v(E)):v(d),[3,3];case 2:v(d),T.label=3;case 3:return[2]}})})};p().catch(l)})]})})},t}(or),Ha=function(e){Ue(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.customHeaders=r,n}return t.prototype.send=function(r,n,i){return i===void 0&&(i=!1),_(this,void 0,void 0,function(){var o,a,s,l,u,c,d,f;return w(this,function(v){switch(v.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return o=JSON.stringify(n),a=i&&o.length>=Mn&&Un(),s=o,l={"Content-Type":"application/json",Accept:"*/*"},a?[4,Fn(o)]:[3,2];case 1:u=v.sent(),u&&(l["Content-Encoding"]="gzip",s=u),v.label=2;case 2:return l=I(I({},this.customHeaders),l),c={headers:l,body:s,method:"POST"},[4,fetch(r,c)];case 3:return d=v.sent(),[4,d.text()];case 4:f=v.sent();try{return[2,this.buildResponse(JSON.parse(f))]}catch{return[2,this.buildResponse({code:d.status})]}return[2]}})})},t}(or),ja=function(e){Ue(t,e);function t(){return e.call(this)||this}return t.prototype.send=function(r,n,i){return _(this,void 0,void 0,function(){var o=this;return w(this,function(a){return[2,new Promise(function(s,l){var u=F();if(!(u!=null&&u.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var c=JSON.stringify(n),d=u.navigator.sendBeacon(r,c);return s(d?o.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:c.length,server_upload_time:Date.now()}):o.buildResponse({code:500}))}catch(f){l(f)}})]})})},t}(or),Ba=function(e,t,r){return r===void 0&&(r=!0),_(void 0,void 0,void 0,function(){var n,i,o,a,s,l,u,c,d;return w(this,function(f){switch(f.label){case 0:return n=xo(e),[4,t.getRaw(n)];case 1:return i=f.sent(),i?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;
4case 3:return o=D(i.split("."),6),a=o[0],s=o[1],l=o[2],u=o[3],c=o[4],d=o[5],[2,{deviceId:a,userId:Ga(s),sessionId:Vt(u),lastEventId:Vt(d),lastEventTime:Vt(c),optOut:!!l}]}})})},Vt=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Ga=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},pe="[Amplitude]",Jr="".concat(pe," Form Started"),Wa="".concat(pe," Form Submitted"),Ka="".concat(pe," File Downloaded"),Yr="session_start",$r="session_end",za="".concat(pe," File Extension"),Xa="".concat(pe," File Name"),Ja="".concat(pe," Link ID"),Ya="".concat(pe," Link Text"),$a="".concat(pe," Link URL"),qt="".concat(pe," Form ID"),Ht="".concat(pe," Form Name"),jt="".concat(pe," Form Destination"),wt="cookie",oi="US";const El=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:Hn,DEFAULT_CSS_SELECTOR_ALLOWLIST:qn,DEFAULT_DATA_ATTRIBUTE_PREFIX:ur,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:gt,get IdentifyOperation(){return De},get LogLevel(){return Tt},OfflineDisabled:Vn,get RevenueProperty(){return he},get ServerZone(){return ro},get SpecialEventType(){return _e}},Symbol.toStringTag,{value:"Module"}));var Qr=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Qa=function(e){return Object.values(e).every(function(t){return!t})},Za=function(e){var t=I(I({},e),{referring_domain:void 0,referrer:void 0});return Object.values(t).every(function(r){return!r})},es=function(e,t,r,n,i,o){i===void 0&&(i=!0),e.referrer;var a=e.referring_domain,s=yt(e,["referrer","referring_domain"]),l=t||{};l.referrer;var u=l.referring_domain,c=yt(l,["referrer","referring_domain"]),d=r.excludeInternalReferrers;if(d){var f=os(d,n);if(!(f instanceof TypeError)&&e.referring_domain&&as(e.referring_domain,o)){if(f==="always")return Zr(f,e.referring_domain,n),!1;if(f==="ifEmptyCampaign"&&Za(e))return Zr(f,e.referring_domain,n),!1}}if(ts(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Qa(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var v=JSON.stringify(s)!==JSON.stringify(c),p=Qr(a||"")!==Qr(u||""),E=!t||v||p;return E?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),E},ts=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=""),e.some(function(r){return r instanceof RegExp?r.test(t):r===t})},rs=function(e,t){var r=t.startsWith(".")?t:".".concat(t),n=e.startsWith(".")?e:".".concat(e);return!!n.endsWith(r)},ns=function(e,t){var r=I(I({},It),e),n=Object.entries(r).reduce(function(i,o){var a,s=D(o,2),l=s[0],u=s[1];return i.setOnce("initial_".concat(l),(a=u??t.initialEmptyValue)!==null&&a!==void 0?a:"EMPTY"),u?i.set(l,u):i.unset(l)},new tt);return ar(n)},is=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},os=function(e,t){if(e===!0)return gt.always;if(typeof e=="object"){var r=e.condition;if(typeof r=="string"&&Object.keys(gt).includes(r))return r;if(typeof r>"u")return gt.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),new TypeError(n)};function Zr(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");e==="always"?r.debug(n):e==="ifEmptyCampaign"&&r.debug("".concat(n," with empty campaign parameters"))}var ai=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],si=function(e){var t,r,n=e||((r=(t=F())===null||t===void 0?void 0:t.location)===null||r===void 0?void 0:r.hostname);if(!n)return"";var i=n.split("."),o=i[i.length-1],a=i[i.length-2];return ai.find(function(s){return n.endsWith(".".concat(s))})&&(o=i[i.length-2]+"."+i[i.length-1],a=i[i.length-3]),a?"".concat(a,".").concat(o):o},as=function(e,t){var r=F();if(!r)return!1;var n=(t||"").trim()||si(r.location.hostname);return rs(e,n)},ss=function(e){Ue(t,e);function t(r,n,i,o,a,s,l,u,c,d,f,v,p,E,T,b,h,g,m,y,S,O,P,C,N,A,R,L,M,V,G,Y,de,x,q,J,re,$,ue,ee,Q,ne,ie,Z,ce){i===void 0&&(i=new sr),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),u===void 0&&(u=1e3),c===void 0&&(c=5),d===void 0&&(d=30),f===void 0&&(f=wt),b===void 0&&(b=new Cn),h===void 0&&(h=Tt.Warn),m===void 0&&(m=!1),y===void 0&&(y=!1),P===void 0&&(P=""),C===void 0&&(C=oi),R===void 0&&(R=30*60*1e3),L===void 0&&(L=new ii({loggerProvider:b})),M===void 0&&(M={ipAddress:!0,language:!0,platform:!0}),V===void 0&&(V="fetch"),G===void 0&&(G=!1),Y===void 0&&(Y=!0),$===void 0&&($=!0),ue===void 0&&(ue=0),ie===void 0&&(ie=!1),Z===void 0&&(Z=!1);var k=this,le;k=e.call(this,{apiKey:r,storageProvider:L,transportProvider:ui(V)})||this,k.apiKey=r,k.appVersion=n,k.cookieOptions=o,k.defaultTracking=a,k.autocapture=s,k.flushIntervalMillis=u,k.flushMaxRetries=c,k.flushQueueSize=d,k.identityStorage=f,k.ingestionMetadata=v,k.instanceName=p,k.loggerProvider=b,k.logLevel=h,k.minIdLength=g,k.offline=m,k.partnerId=S,k.plan=O,k.serverUrl=P,k.serverZone=C,k.sessionTimeout=R,k.storageProvider=L,k.trackingOptions=M,k.transport=V,k.useBatch=G,k.fetchRemoteConfig=Y,k.networkTrackingOptions=J,k.identify=re,k.enableDiagnostics=$,k.diagnosticsSampleRate=ue,k.diagnosticsClient=ee,k.remoteConfig=Q,k.topLevelDomain=ne,k.enableRequestBodyCompression=ie,k._enableRequestBodyCompressionExperimental=Z,k.customEnrichment=ce,k.version=vr,k._optOut=!1,k._cookieStorage=i,k.deviceId=l,k.lastEventId=E,k.lastEventTime=T,k.optOut=y,k.deferredSessionId=A,k.sessionId=N,k.pageCounter=x,k.userId=de,k.debugLogsEnabled=q,k.loggerProvider.enable(q?Tt.Debug:k.logLevel),k.networkTrackingOptions=J,k.identify=re,k.enableDiagnostics=$,k.diagnosticsSampleRate=ue,k.diagnosticsClient=ee;var Ee=(le=Q==null?void 0:Q.fetchRemoteConfig)!==null&&le!==void 0?le:Y;return k.remoteConfig=k.remoteConfig||{},k.remoteConfig.fetchRemoteConfig=Ee,k.fetchRemoteConfig=Ee,k.topLevelDomain=ne||si(),k}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(r){this._cookieStorage!==r&&(this._cookieStorage=r,this.updateStorage())}
4,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,r!==void 0&&this._deferredSessionId!==void 0&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(r){this._deferredSessionId!==r&&r!==this.sessionId&&(this._deferredSessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(r){this._pageCounter!==r&&(this._pageCounter=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(r){this._debugLogsEnabled!==r&&(this._debugLogsEnabled=r,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof _t&&(r.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Dn(this.apiKey),r)},t}(no),us=function(e,t,r,n,i){return t===void 0&&(t={}),_(void 0,void 0,void 0,function(){var o,a,s,l,u,c,d,f,v,p,E,T,b,h,g,m,y,S,O,P,C,N,A,R,L,M,V,G,Y,de,x,q,J,re,$,ue,ee,Q,ne,ie,Z,ce,k,le,Ee,Oe,ke,Ce,Te,Pe,Re;return w(this,function(fe){switch(fe.label){case 0:return o=t.identityStorage||wt,a="",o===wt&&!(!((N=t.cookieOptions)===null||N===void 0)&&N.domain)&&((A=t.cookieOptions)===null||A===void 0?void 0:A.domain)!==""?[4,ds(void 0,n)]:[3,2];case 1:a=fe.sent(),fe.label=2;case 2:return s=I({domain:(L=(R=t.cookieOptions)===null||R===void 0?void 0:R.domain)!==null&&L!==void 0?L:a,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),l={duplicateResolverFn:function(Je){var Rt=xn(Je);if(!Rt)return!1;var oe=JSON.parse(Rt);return Nn(oe.cookieDomain,s.domain)},diagnosticsClient:n},u=ls(t.identityStorage,s,l),[4,Ba(e,u,(V=(M=t.cookieOptions)===null||M===void 0?void 0:M.upgrade)!==null&&V!==void 0?V:!0)];case 3:return c=fe.sent(),[4,u.get(Dn(e))];case 4:return d=fe.sent(),f=St(),v=f.ampTimestamp?Number(f.ampTimestamp):void 0,p=v?Date.now()<v:!0,E=(q=(x=(de=(G=t.deviceId)!==null&&G!==void 0?G:p?(Y=f.ampDeviceId)!==null&&Y!==void 0?Y:f.deviceId:void 0)!==null&&de!==void 0?de:d==null?void 0:d.deviceId)!==null&&x!==void 0?x:c.deviceId)!==null&&q!==void 0?q:Ie(),T=(J=d==null?void 0:d.lastEventId)!==null&&J!==void 0?J:c.lastEventId,b=(re=d==null?void 0:d.lastEventTime)!==null&&re!==void 0?re:c.lastEventTime,h=(ue=($=t.optOut)!==null&&$!==void 0?$:d==null?void 0:d.optOut)!==null&&ue!==void 0?ue:c.optOut,g=(ee=d==null?void 0:d.sessionId)!==null&&ee!==void 0?ee:c.sessionId,m=d==null?void 0:d.deferredSessionId,y=(ne=(Q=t.userId)!==null&&Q!==void 0?Q:d==null?void 0:d.userId)!==null&&ne!==void 0?ne:c.userId,r.previousSessionDeviceId=(ie=d==null?void 0:d.deviceId)!==null&&ie!==void 0?ie:c.deviceId,r.previousSessionUserId=(Z=d==null?void 0:d.userId)!==null&&Z!==void 0?Z:c.userId,S={ipAddress:(k=(ce=t.trackingOptions)===null||ce===void 0?void 0:ce.ipAddress)!==null&&k!==void 0?k:!0,language:(Ee=(le=t.trackingOptions)===null||le===void 0?void 0:le.language)!==null&&Ee!==void 0?Ee:!0,platform:(ke=(Oe=t.trackingOptions)===null||Oe===void 0?void 0:Oe.platform)!==null&&ke!==void 0?ke:!0},O=d==null?void 0:d.pageCounter,P=d==null?void 0:d.debugLogsEnabled,t.autocapture!==void 0&&(t.defaultTracking=t.autocapture),C=new ss(e,t.appVersion,u,s,t.defaultTracking,t.autocapture,E,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,T,b,(Ce=i==null?void 0:i.loggerProvider)!==null&&Ce!==void 0?Ce:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,h,t.partnerId,t.plan,t.serverUrl,(Te=i==null?void 0:i.serverZone)!==null&&Te!==void 0?Te:t.serverZone,g,m,t.sessionTimeout,t.storageProvider,S,t.transport,t.useBatch,t.fetchRemoteConfig,y,O,P,t.networkTrackingOptions,t.identify,(Pe=i==null?void 0:i.enableDiagnostics)!==null&&Pe!==void 0?Pe:t.enableDiagnostics,(Re=i==null?void 0:i.diagnosticsSampleRate)!==null&&Re!==void 0?Re:r._diagnosticsSampleRate,n,t.remoteConfig,a,t.enableRequestBodyCompression,r._enableRequestBodyCompressionExperimentalValue,t.customEnrichment),[4,C.storageProvider.isEnabled()];case 5:return fe.sent()||(C.loggerProvider.warn("Storage provider ".concat(C.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),C.storageProvider=new sr),[2,C]}})})},ls=function(e,t,r){switch(e===void 0&&(e=wt),t===void 0&&(t={}),e){case"localStorage":return new ii;case"sessionStorage":return new Va;case"none":return new sr;case"cookie":default:return new _t(I(I({},t),{expirationDays:t.expiration}),r)}},cs=function(e){var t,r;return e===void 0&&(e={}),((t=e.remoteConfig)===null||t===void 0?void 0:t.fetchRemoteConfig)===!0?!0:!(((r=e.remoteConfig)===null||r===void 0?void 0:r.fetchRemoteConfig)===!1||e.fetchRemoteConfig===!1)},ui=function(e){var t=typeof e=="object"?e.type:e,r=typeof e=="object"?e.headers:void 0;return t==="xhr"?new qa(r):t==="beacon"?new ja:new Ha(r)},ds=function(e,t){return _(void 0,void 0,void 0,function(){var r,n,i,o,a,a,s,l,u;return w(this,function(c){switch(c.label){case 0:return[4,new _t(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!c.sent()||typeof location>"u"||!location.hostname)return[2,""];if(r=location.hostname,n=r.split("."),n.length===1)return[2,""];for(i=[],o=1,ai.find(function(d){return r.endsWith(".".concat(d))})&&(o=2),a=n.length-o-1;a>=0;--a)i.push(n.slice(a).join("."));a=0,c.label=2;case 2:if(!(a<i.length))return[3,7];s=i[a],c.label=3;case 3:return c.trys.push([3,5,,6]),[4,_t.isDomainWritable(s)];case 4:return l=c.sent(),l?[2,"."+s]:[3,6];case 5:return u=c.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(s),error:u instanceof Error?u.message:String(u)}),[3,6];case 6:return a++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(r)}),[2,""]}})})},fs=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},vs="[Amplitude] Page Viewed",Bt="AMP_PAGE_VIEW",en=function(e){e===void 0&&(e={});var t,r=F(),n=void 0,i=!1,o,a,s=e.trackOn,l=e.trackHistoryChanges,u=e.eventType,c=u===void 0?vs:u,d=function(h){var g=h;try{g=decodeURI(h)}catch(m){n==null||n.error("Malformed URI sequence: ",m)}return g},f=function(h){return _(void 0,void 0,void 0,function(){var g,m,y;return w(this,function(S){switch(S.label){case 0:return g=d(typeof location<"u"&&location.href||""),y={event_type:c},m=[{}],[4,hs()];case 1:return[2,(y.event_properties=I.apply(void 0,[I.apply(void 0,m.concat([S.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":g,"[Amplitude] Page Path":typeof location<"u"&&d(location.pathname)||"","[Amplitude] Page Title":dr(cr),"[Amplitude] Page URL":g.split("?")[0],"[Amplitude] Page View ID":h}]),y)]}})})},v=function(){return typeof s>"u"||typeof s=="function"&&s()},p=typeof location<"u"?location.href:null,E=function(){return _(void 0,void 0,void 0,function(){var h,g,m,y,S;return w(this,function(O){switch(O.label){case 0:return h=location.href,g=gs(l,h,p||"")&&v(),p=h,g?(m=void 0,a&&(m=Ie(),a.set(Bt,{pageViewId:m})),n==null||n.log("Tracking page view event"),t!=null?[3,1]:[3,3]):[3,4];case 1:return S=(y=t).track,[4,f(m)];case 2:S.apply(y,[O.sent()]),O.label=3;case 3:O.label=4;case 4:return[2]}})})},T=function(){E()},b={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(h,g){return _(void 0,void 0,void 0,function(){var m,y,S;return w(this,function(O){switch(O.label){case 0:if(t=g,o=h,n=h.loggerProvider,n.log("Installing @amplitude/plugin-page-view-tracking-browser"),i=!0,r){try{a=new Ot(r.sessionStorage)}catch{n==null||n.debug("sessionStorage is not available in this environment.")}r.addEventListener("popstate",T),r.history.pushState=new Proxy(r.history.pushState,{apply:function(P,C,N){var A=D(N,3),R=A[0],L=A[1],M=A[2];P.apply(C,[R,L,M]),i&&T()}})}return v()?(n.log("Tracking page view event"),m=void 0,a&&(m=Ie(),a.set(Bt,{pageViewId:m})),S=(y=t).track,[4,f(m)]):[3,2];case 1:S.apply(y,[O.sent()]),O.label=2;case 2:return[2]}})})},execute:function(h){return _(void 0,void 0,void 0,function(){var g,m,y;return w(this,function(S){switch(S.label){case 0:return s==="attribution"&&ps(h)?(n==null||n.log("Enriching c
4ampaign event to page view event with campaign parameters"),g=void 0,a?[4,a.get(Bt)]:[3,2]):[3,4];case 1:m=S.sent(),g=m==null?void 0:m.pageViewId,S.label=2;case 2:return[4,f(g)];case 3:y=S.sent(),h.event_type=y.event_type,h.event_properties=I(I({},h.event_properties),y.event_properties),S.label=4;case 4:return o&&h.event_type===c&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,h.event_properties=I(I({},h.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,h]}})})},teardown:function(){return _(void 0,void 0,void 0,function(){return w(this,function(h){return r&&(r.removeEventListener("popstate",T),i=!1),[2]})})}};return b},hs=function(){return _(void 0,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:return e=fs,[4,new Xn().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},ps=function(e){if(e.event_type==="$identify"&&e.user_properties){var t=e.user_properties,r=t[De.SET]||{},n=t[De.UNSET]||{},i=j(j([],D(Object.keys(r)),!1),D(Object.keys(n)),!1);return Object.keys(It).every(function(o){return i.includes(o)})}return!1},gs=function(e,t,r){switch(e){case"pathOnly":{if(r=="")return!0;var n=new URL(t),i=new URL(r),o=n.origin+n.pathname,a=i.origin+i.pathname;return o!==a}default:return t!==r}},ms=function(){var e,t=[],r=function(c,d,f){c.addEventListener(d,f),t.push({element:c,type:d,handler:f})},n=function(){t.forEach(function(c){var d=c.element,f=c.type,v=c.handler;d==null||d.removeEventListener(f,v)}),t=[]},i,o="@amplitude/plugin-form-interaction-tracking-browser",a="enrichment",s=function(c,d){return _(void 0,void 0,void 0,function(){var f,v;return w(this,function(p){return i=Na(c),f=function(){if(!d){c.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.");return}if(!(typeof document>"u")){var E=new WeakSet,T=function(h){if(!E.has(h)){E.add(h);var g=!1;r(h,"change",function(){var m,y=tn(h);g||d.track(Jr,(m={},m[qt]=Fe(h.id),m[Ht]=Fe(h.name),m[jt]=y,m)),g=!0}),r(h,"submit",function(m){var y,S,O=tn(h);if(g||d.track(Jr,(y={},y[qt]=Fe(h.id),y[Ht]=Fe(h.name),y[jt]=O,y)),g=!0,(i==null?void 0:i.shouldTrackSubmit)!==void 0)if(typeof i.shouldTrackSubmit=="function"&&typeof SubmitEvent<"u"&&m instanceof SubmitEvent)try{var P=i.shouldTrackSubmit(m);if(!P)return}catch{c.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else c.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");d.track(Wa,(S={},S[qt]=Fe(h.id),S[Ht]=Fe(h.name),S[jt]=O,S)),g=!1})}},b=Array.from(document.getElementsByTagName("form"));b.forEach(T),typeof MutationObserver<"u"&&(e=new MutationObserver(function(h){h.forEach(function(g){g.addedNodes.forEach(function(m){m.nodeName==="FORM"&&T(m),"querySelectorAll"in m&&typeof m.querySelectorAll=="function"&&Array.from(m.querySelectorAll("form")).map(T)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?f():(v=F(),v?v.addEventListener("load",f):c.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},l=function(c){return _(void 0,void 0,void 0,function(){return w(this,function(d){return[2,c]})})},u=function(){return _(void 0,void 0,void 0,function(){return w(this,function(c){return e==null||e.disconnect(),n(),[2]})})};return{name:o,type:a,setup:s,execute:l,teardown:u}},Fe=function(e){if(typeof e=="string")return e},tn=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(t??""),window.location.href).href}catch{}return t},bs=function(){var e,t=[],r=function(u,c,d){u.addEventListener(c,d),t.push({element:u,type:c,handler:d})},n=function(){t.forEach(function(u){var c=u.element,d=u.type,f=u.handler;c==null||c.removeEventListener(d,f)}),t=[]},i="@amplitude/plugin-file-download-tracking-browser",o="enrichment",a=function(u,c){return _(void 0,void 0,void 0,function(){var d,f;return w(this,function(v){return d=function(){if(!c){u.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.");return}if(!(typeof document>"u")){var p=function(b){var h;try{h=new URL(b.href,window.location.href)}catch{return}var g=E.exec(h.href),m=g==null?void 0:g[1];m&&r(b,"click",function(){var y;m&&c.track(Ka,(y={},y[za]=m,y[Xa]=h.pathname,y[Ja]=b.id,y[Ya]=b.text,y[$a]=b.href,y))})},E=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/,T=Array.from(document.getElementsByTagName("a"));T.forEach(p),typeof MutationObserver<"u"&&(e=new MutationObserver(function(b){b.forEach(function(h){h.addedNodes.forEac
4h(function(g){g.nodeName==="A"&&p(g),"querySelectorAll"in g&&typeof g.querySelectorAll=="function"&&Array.from(g.querySelectorAll("a")).map(p)})})}),e.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?d():(f=F(),f?f.addEventListener("load",d):u.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},s=function(u){return _(void 0,void 0,void 0,function(){return w(this,function(c){return[2,u]})})},l=function(){return _(void 0,void 0,void 0,function(){return w(this,function(u){return e==null||e.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:l}},rn=!1,ys=function(e){if(!(rn||e.defaultTracking!==void 0)){var t=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:
5
6amplitude.init(<YOUR_API_KEY>, {
7  defaultTracking: true,
8});
9
10Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;e.loggerProvider.warn(t),rn=!0}},Es=function(){var e="@amplitude/plugin-network-checker-browser",t="before",r=F(),n=[],i=function(l,u){r!=null&&r.addEventListener&&(r==null||r.addEventListener(l,u),n.push({type:l,handler:u}))},o=function(){n.forEach(function(l){var u=l.type,c=l.handler;r==null||r.removeEventListener(u,c)}),n=[]},a=function(l,u){return _(void 0,void 0,void 0,function(){return w(this,function(c){return typeof navigator>"u"?(l.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),l.offline=!1,[2]):(l.offline=!navigator.onLine,i("online",function(){l.loggerProvider.debug("Network connectivity changed to online."),l.offline=!1,setTimeout(function(){u.flush()},l.flushIntervalMillis)}),i("offline",function(){l.loggerProvider.debug("Network connectivity changed to offline."),l.offline=!0}),[2])})})},s=function(){return _(void 0,void 0,void 0,function(){return w(this,function(l){return o(),[2]})})};return{name:e,type:t,setup:a,teardown:s}};function li(e){var t,r,n,i,o,a,s,l,u,c,d,f;if(!(typeof e!="object"||e===null)&&!Array.isArray(e)){var v=Object.keys(e);try{for(var p=U(v),E=p.next();!E.done;E=p.next()){var T=E.value;try{var b=e[T];typeof(b==null?void 0:b.enabled)=="boolean"&&(b.enabled?(delete b.enabled,Object.keys(b).length===0&&(e[T]=!0)):e[T]=!1),li(b)}catch{}}}catch(M){t={error:M}}finally{try{E&&!E.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}try{if(!((u=(l=(s=e.autocapture)===null||s===void 0?void 0:s.networkTracking)===null||l===void 0?void 0:l.captureRules)===null||u===void 0)&&u.length)try{for(var h=U(e.autocapture.networkTracking.captureRules),g=h.next();!g.done;g=h.next()){var m=g.value;try{for(var y=(o=void 0,U(["responseHeaders","requestHeaders"])),S=y.next();!S.done;S=y.next()){var O=S.value,P=(c=m[O])!==null&&c!==void 0?c:{},C=P.captureSafeHeaders,N=P.allowlist;if(!(!C&&!N)){if(N!==void 0&&!Array.isArray(N)){delete m[O];continue}m[O]=j(j([],D(C?Et:[]),!1),D(N??[]),!1)}}}catch(M){o={error:M}}finally{try{S&&!S.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}}}catch(M){n={error:M}}finally{try{g&&!g.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}catch{}var A=(d=e.autocapture)===null||d===void 0?void 0:d.frustrationInteractions;A&&(A.rageClick&&(A.rageClicks=A.rageClick,delete A.rageClick),A.deadClick&&(A.deadClicks=A.deadClick,delete A.deadClick));try{var R=(f=e.autocapture)===null||f===void 0?void 0:f.elementInteractions;if(R&&typeof R=="object"&&(R.viewportContentUpdated===!0&&(R.viewportContentUpdated={}),R.viewportContentUpdated===!1&&(R.viewportContentUpdated={enabled:!1}),R.exposureDuration!==void 0)){var L=R.viewportContentUpdated;L===void 0?R.viewportContentUpdated={exposureDuration:R.exposureDuration}:typeof L=="object"&&L.exposureDuration===void 0&&L.enabled!==!1&&(L.exposureDuration=R.exposureDuration),delete R.exposureDuration}}catch{}}}function nn(e,t,r){var n,i,o=[];try{for(var a=U(t??[]),s=a.next();!s.done;s=a.next()){var l=s.value;try{o.push(new RegExp(l))}catch(u){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),u)}}}catch(u){n={error:u}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return e.concat(o)}function Ts(e,t){var r,n,i,o,a,s,l;if(e){li(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var u=e;if(u&&"autocapture"in u){if(typeof u.autocapture=="boolean"&&(t.autocapture=u.autocapture),typeof u.autocapture=="object"&&u.autocapture!==null){var c=I({},u.autocapture);if(t.autocapture===void 0&&(t.autocapture=u.autocapture),typeof u.autocapture.elementInteractions=="object"&&u.autocapture.elementInteractions!==null&&(!((i=u.autocapture.elementInteractions.pageUrlAllowlistRegex)===null||i===void 0)&&i.length)){c.elementInteractions=I({},u.autocapture.elementInteractions);var d=c.elementInteractions,f=(o=d.pageUrlAllowlist)!==null&&o!==void 0?o:[],v=u.autocapture.elementInteractions.pageUrlAllowlistRegex;d.pageUrlAllowlist=nn(f,v,t),delete d.pageUrlAllowlistRegex}
10if(typeof u.autocapture.networkTracking=="object"&&u.autocapture.networkTracking!==null&&(!((a=u.autocapture.networkTracking.captureRules)===null||a===void 0)&&a.length)){c.networkTracking=I({},u.autocapture.networkTracking);var p=c.networkTracking,E=(s=p.captureRules)!==null&&s!==void 0?s:[];try{for(var T=U(E),b=T.next();!b.done;b=T.next()){var h=b.value;h.urls=nn((l=h.urls)!==null&&l!==void 0?l:[],h.urlsRegex,t),delete h.urlsRegex}}catch(g){r={error:g}}finally{try{b&&!b.done&&(n=T.return)&&n.call(T)}finally{if(r)throw r.error}}}typeof t.autocapture=="boolean"&&(t.autocapture=I({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},c)),typeof t.autocapture=="object"&&(t.autocapture=I(I({},t.autocapture),c))}t.defaultTracking=t.autocapture}"customEnrichment"in u&&u.customEnrichment!==null&&(t.customEnrichment=u.customEnrichment),t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(g){t.loggerProvider.error("Failed to apply remote configuration because of error: ",g)}}}var ci="1.25.1",Ss="@amplitude/plugin-autocapture-browser",_s="@amplitude/plugin-frustration-browser",di="[Amplitude] Element Clicked",ws="[Amplitude] Dead Click",As="[Amplitude] Rage Click",Is="[Amplitude] Error Click",Os="[Amplitude] Element Changed",ks="[Amplitude] Thrashed Cursor",Cs="[Amplitude] Element ID",Ps="[Amplitude] Element Class",on="[Amplitude] Element Tag",an="[Amplitude] Element Text",Rs="[Amplitude] Element Hierarchy",Ls="[Amplitude] Element Href",Ds="[Amplitude] Element Position Left",xs="[Amplitude] Element Position Top",Ns="[Amplitude] Element Aria Label",Ms="[Amplitude] Element Attributes",Us="[Amplitude] Element Path",Fs="[Amplitude] Element Parent Label",Qt="[Amplitude] Page URL",Vs="[Amplitude] Page Title",fi="[Amplitude] Viewport Height",vi="[Amplitude] Viewport Width",qs="[Amplitude] Max Page X",Hs="[Amplitude] Max Page Y",hi="[Amplitude] Page View ID",js="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",Bs="amp-visual-tagging-selector-highlight",pi="data-amp-mask-attributes",Gs=25,gi=128,Ws="AMP_PAGE_VIEW",Ks=18e3,zs=["input","select","textarea"],mi=function(e,t){var r,n=(r=window==null?void 0:window.getComputedStyle)===null||r===void 0?void 0:r.call(window,e);return(n==null?void 0:n.getPropertyValue("cursor"))==="pointer"&&t==="click"},bi=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&Yt(window.location.href,r)||!Yt(window.location.href,t))},We=function(e,t,r){return r===void 0&&(r=!1),function(n,i){var o,a,s=e.shouldTrackEventResolver,l=(a=(o=i==null?void 0:i.tagName)===null||o===void 0?void 0:o.toLowerCase)===null||a===void 0?void 0:a.call(o);if(!l)return!1;if(s)return s(n,i);if(!bi(e))return!1;var u=String(i==null?void 0:i.getAttribute("type"))||"";if(typeof u=="string")switch(u.toLowerCase()){case"hidden":return!1;case"password":return!1}var c=mi(i,n);if(r&&c)return!0;if(t){var d=t.some(function(f){var v;return!!(!((v=i==null?void 0:i.matches)===null||v===void 0)&&v.call(i,f))});if(!d)return!1}switch(l){case"input":case"select":case"textarea":return n==="change"||n==="click";default:return c?!0:n==="click"}}},Xs=function(e){var t,r,n,i=(r=(t=e==null?void 0:e.tagName)===null||t===void 0?void 0:t.toLowerCase)===null||r===void 0?void 0:r.call(t),o=e instanceof HTMLElement?((n=e.getAttribute("contenteditable"))===null||n===void 0?void 0:n.toLowerCase())==="true":!1;return!zs.includes(i)&&!o},Js=function(e){return e?e.split(",").map(function(t){return t.trim()}).filter(function(t){return t.length>0&&t!=="id"&&t!=="class"}):[]},Ys=function(e,t){return Object.entries(e).reduce(function(r,n){var i=D(n,2),o=i[0],a=i[1];if(o.startsWith(t)){var s=o.replace(t,"");s&&(r[s]=a||"")}return r},{})},$s=function(e){return e==null||typeof e=="object"&&Object.keys(e).length===0||typeof e=="string"&&e.trim().length===0},sn=function(e){return Object.keys(e).reduce(function(t,r){var n=e[r];return $s(n)||(t[r]=n),t},{})},yi=function(){var e;try{var t=F(),r=(e=t==null?void 0:t.sessionStorage)===null||e===void 0?void 0:e.getItem(Ws);if(!r)return;var n=JSON.parse(r);if(typeof n.pageViewId=="string")return n.pageViewId}catch{}},hr=function(e,t){return e?t.some(function(r){var n;return(n=e==null?void 0:e.matches)===null||n===void 0?void 0:n.call(e,r)})?e:hr(e==null?void 0:e.parentElement,t):null},ot=function(e){return!(e.event.target===null||!e.closestTrackedAncestor)};function Qs(e){return e.type==="click"||e.type==="change"}var At;(function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"})(At||(At={}));var un="__AMPLITUDE_VISUAL_TAGGING__";function Zs(e,t){var r=e;if(r[un]!==!0){r[un]=!0;
10var n=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,a=t.actionClickAllowlist,s=null,l=function(c){e.notify({action:"element-selected",data:c})},u=function(c,d){c==="selector-mode-changed"?e.notify({action:"track-selector-mode-changed",data:d}):c==="selector-moved"&&e.notify({action:"track-selector-moved",data:d})};e.registerActionHandler("initialize-visual-tagging-selector",function(c){e.loadScriptOnce(js).then(function(){var d;s=(d=window==null?void 0:window.amplitudeVisualTaggingSelector)===null||d===void 0?void 0:d.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(f){return i?i((c==null?void 0:c.actionType)||"click",f):!0},onTrack:u,onSelect:l,visualHighlightClass:Bs,messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:a,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:ci}}}),e.notify({action:"selector-loaded"})}).catch(function(){var d;(d=e.logger)===null||d===void 0||d.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var c;(c=s==null?void 0:s.close)===null||c===void 0||c.call(s)})}}function eu(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers,o=r.clickObservable,a=o.filter(ot).filter(function(l){return n("click",l.closestTrackedAncestor)}).map(function(l){return i(l)}),s=a;return s.subscribe(function(l){t==null||t.track(di,l.targetElementProperties)})}function tu(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers,a=r.changeObservable,s=a.filter(ot).filter(function(l){return i("change",l.closestTrackedAncestor)}).map(function(l){return o(l)});return s.subscribe(function(l){t==null||t.track(Os,n("change",l.closestTrackedAncestor))})}function ru(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,s=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=s.filter(function(T){return!o("click",T.closestTrackedAncestor)}).map(function(T){var b=hr(T.event.target,n.actionClickAllowlist);return T.closestTrackedAncestor=b,T.closestTrackedAncestor!==null&&(T.targetElementProperties=i(T.type,T.closestTrackedAncestor)),T}).filter(ot).filter(function(T){return a("click",T.closestTrackedAncestor)}),d=u?Me(l,u):l,f=Me(c,d),v=null,p=null,E=fr(f,function(T){if(v&&(clearTimeout(v),v=null),T.type==="click")return p=T,v=setTimeout(function(){v=null,p=null},500),Promise.resolve(null);if(p){var b=p;return p=null,Promise.resolve(b)}return Promise.resolve(null)});return E.subscribe(function(T){T&&(t==null||t.track(di,i("click",T.closestTrackedAncestor)))})}function nu(e){var t=e.allObservables,r=t.scrollObservable,n={maxX:0,maxY:0},i=r.subscribe(function(){var o,a,s,l,u=F(),c=Math.floor((a=(o=u==null?void 0:u.scrollX)!==null&&o!==void 0?o:u==null?void 0:u.pageXOffset)!==null&&a!==void 0?a:0),d=Math.floor((l=(s=u==null?void 0:u.scrollY)!==null&&s!==void 0?s:u==null?void 0:u.pageYOffset)!==null&&l!==void 0?l:0);n.maxX=Math.max(n.maxX,c),n.maxY=Math.max(n.maxY,d)});return{unsubscribe:function(){i.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}var Ke=F(),Ei=function(){return new te(function(e){var t=new MutationObserver(function(r){e.next(r)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Ti=function(e){return e===void 0&&(e="click"),new te(function(t){var r,n=function(i){t.next(i)};return(r=F())===null||r===void 0||r.document.addEventListener(e,n,{capture:!0}),function(){var i;(i=F())===null||i===void 0||i.document.removeEventListener(e,n,{capture:!0})}})},iu=function(){return new te(function(e){var t,r=function(n){e.next(n)};return(t=F())===null||t===void 0||t.addEventListener("scroll",r),function(){var n;(n=F())===null||n===void 0||n.removeEventListener("scroll",r)}})},ou=function(){return new te(function(e){var t=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=void 0;Array.isArray(n[0])&&typeof n[0][0]=="string"&&(o=n[0][0]),e.next({kind:"console",message:o})};return Fr.addListener("error",t),function(){Fr.removeListener(t)}})},au=function(e,t){return new te(function(r){var n,i=F();if(!(i!=null&&i.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(u){u.forEach(function(c){r.next(c)})},{root:null,rootMargin:"0px",threshold:1}),a=t.join(","),s=(n=i==null?void 0:i.document.querySelectorAll(a))!==null&&n!==void 0?n:[];
10s.forEach(function(u){o.observe(u)});var l=e.subscribe(function(u){var c=u.event;return c.forEach(function(d){var f=d.addedNodes;return f.forEach(function(v){v instanceof Element&&(v.matches(a)&&o.observe(v),v.querySelectorAll(a).forEach(function(p){o.observe(p)}))})})});return function(){l.unsubscribe(),o.disconnect()}})},su=function(){return new te(function(e){var t=function(r){if(r instanceof ErrorEvent){var n={kind:"error"};r.error instanceof Error||r.error instanceof DOMException?n=I(I({},n),{message:r.error.message,stack:r.error.stack,filename:r.filename,lineNumber:r.lineno,columnNumber:r.colno}):typeof r.error=="string"&&(n.message=r.error),e.next(n)}};return Ke.addEventListener("error",t),function(){Ke.removeEventListener("error",t)}})},uu=function(){return new te(function(e){var t=function(r){var n={kind:"unhandledrejection"};r.reason instanceof Error||r.reason instanceof DOMException?(n.message=r.reason.message,n.stack=r.reason.stack):typeof r.reason=="string"&&(n.message=r.reason),e.next(n)};return Ke.addEventListener("unhandledrejection",t),function(){Ke.removeEventListener("unhandledrejection",t)}})},lu=function(){var e=Me(su(),uu());return Me(e,ou())},cu=function(){return new te(function(e){var t=function(n){e.next(n)},r={capture:!0};return Ke.document.addEventListener("mousemove",t,r),function(){Ke.document.removeEventListener("mousemove",t,r)}})},du=function(e,t){try{if(t.subprop_key==="[Amplitude] Element Text")return t.subprop_op==="is"&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if(t.subprop_key==="[Amplitude] Element Hierarchy")return t.subprop_op==="autotrack css match"&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(r){return console.error("Error matching event to filter",r),!1}return!1},fu=function(e,t){try{if(e.sourceType==="DOM_ELEMENT"){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch{return}},vu=function(e,t,r){e.forEach(function(n){if(typeof n!="string"&&n.actionType==="ATTACH_EVENT_PROPERTY"){var i=r.extractDataFromDataSource(n.dataSource,t.closestTrackedAncestor);t.targetElementProperties[n.destinationKey]=i}})},Zt={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},ln=function(e){var t,r,n,i,o=Object.values(Zt).reduce(function(v,p){return v[p]=new Set,v},{});if(!e)return o;try{for(var a=U(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{try{for(var u=(n=void 0,U(l.definition)),c=u.next();!c.done;c=u.next()){var d=c.value,f=Zt[d.event_type];f&&o[f].add(l.id)}}catch(v){n={error:v}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(v){console.warn("Skipping Labeled Event due to malformed definition",l==null?void 0:l.id,v)}}}catch(v){t={error:v}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},cn=function(e){var t,r,n,i,o=new Map;try{for(var a=U(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{for(var u=(n=void 0,U(l.conditions)),c=u.next();!c.done;c=u.next()){var d=c.value;if(d.type==="LABELED_EVENT"){var f=d.match.eventId,v=o.get(f);v||(v=[],o.set(f,v)),v.push(l)}}}catch(p){n={error:p}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},hu=function(e,t){return t.filter(function(r){return r.definition.some(function(n){return Zt[n.event_type]===e.type&&n.filters.every(function(i){return du(e,i)})})})},pu=function(e,t){var r,n,i,o,a=new Set;try{for(var s=U(e),l=s.next();!l.done;l=s.next()){var u=l.value,c=t.get(u.id);if(c)try{for(var d=(i=void 0,U(c)),f=d.next();!f.done;f=d.next()){var v=f.value;a.add(v)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(p){r={error:p}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},gu=function(){function e(t,r,n,i){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=r,this.dataExtractor=n,this.options=i}return e.prototype.evaluate=function(t){var r,n,i=this.options.pageActions;if(!i)return t;var o=hu(t,Array.from(this.groupedLabeledEvents[t.type]).map(function(c){return i.labeledEvents[c]})),a=pu(o,this.labeledEventToTriggerMap);try{for(var s=U(a),l=s.next();!l.done;l=s.next()){var u=l.value;vu(u.actions,t,this.dataExtractor)}}catch(c){r={error:c}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return t},e.prototype.update=function(t,r,n){this.groupedLabeledEvents=t,this.labeledEventToTriggerMap=r,this.options=n},e}(),mu=function(e,t,r,n){return new gu(e,t,r,n)},bu=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",pi,je]),yu=["type"],Eu=["svg","path","g"],Tu=["password","hidden"];function Su(e,t){var r,n,i,o,a,s;if(e===null)return null;var l=String(e.tagName).toLowerCase(),u={tag:l},c=Array.from((o=(i=e.parentElement)===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[]);c.length&&(u.index=c.indexOf(e),u.indexOfType=c.filter(function(y){return y.tagName===e.tagName}).indexOf(e));var d=(s=(a=e.previousElementSibling)===null||a===void 0?void 0:a.tagName)===null||s===void 0?void 0:s.toLowerCase();d&&(u.prevSib=String(d));var f=e.getAttribute("id");f&&(u.id=String(f));var v=Array.from(e.classList);v.length&&(u.classes=v);var p={},E=Array.from(e.attributes),T=E.filter(function(y){return!bu.has(y.name)}),b=!Xs(e);if(!Tu.includes(String(e.getAttribute("type")))&&!Eu.includes(l))try{for(var h=U(T),g=h.next();!g.done;g=h.next()){var m=g.value;
10if(!(b&&!yu.includes(m.name))){if(t.has(m.name)){p[m.name]=Ae;continue}p[m.name]=String(m.value).substring(0,gi)}}}catch(y){r={error:y}}finally{try{g&&!g.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return Object.keys(p).length&&(u.attrs=p),u}function _u(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&r.tagName!=="HTML";)t.push(r),r=r.parentElement;return t}var Qe=function(){function e(t,r){this.value=t,this.optimized=r}return e.prototype.toString=function(){return this.value},e}(),wu=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=Au(n,!!t,n===e);if(!i||(r.push(i),i.optimized))break;n=n.parentElement}return r.reverse(),r.join(" > ")},Au=function(e,t,r){var n,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var o=e.getAttribute("id");if(t){if(o)return new Qe(c(o),!0);var a=e.tagName.toLowerCase();if(a==="body"||a==="head"||a==="html")return new Qe(a,!0)}var s=e.tagName.toLowerCase();if(o)return new Qe(s+c(o),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new Qe(s,!0);function u(A){var R=A.getAttribute("class");return R?R.split(/\s+/g).filter(Boolean).map(function(L){return"$"+L}):[]}function c(A){return"#"+CSS.escape(A)}for(var d=u(e),f=!1,v=!1,p=-1,E=-1,T=l.children,b=0;T&&(p===-1||!v)&&b<T.length;++b){var h=T[b];if(h.nodeType===Node.ELEMENT_NODE){if(E+=1,h===e){p=E;continue}if(!v&&h.tagName.toLowerCase()===s){f=!0;var g=new Set(d);if(!g.size){v=!0;continue}for(var m=u(h),y=0;y<m.length;++y){var S=m[y];if(g.has(S)&&(g.delete(S),!g.size)){v=!0;break}}}}}var O=s;if(r&&s.toLowerCase()==="input"&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(O+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),v)O+=":nth-child("+String(p+1)+")";else if(f)try{for(var P=U(d),C=P.next();!C.done;C=P.next()){var N=C.value;O+="."+CSS.escape(N.slice(1))}}catch(A){n={error:A}}finally{try{C&&!C.done&&(i=P.return)&&i.call(P)}finally{if(n)throw n.error}}return new Qe(O,!1)},Si=function(){function e(t,r){var n,i,o=this,a;this.replaceSensitiveString=function(f){return cr(f,o.additionalMaskTextPatterns)},this.getHierarchy=function(f){var v,p,E,T,b=performance.now(),h=[];if(!f)return[];for(var g=_u(f),m=new Map,y=g.length-1;y>=0;y--){var S=g[y];if(S){var O=Js(S.getAttribute(pi)),P=y===g.length-1?[]:(E=m.get(g[y+1]))!==null&&E!==void 0?E:new Set,C=new Set(j(j([],D(P),!1),D(O),!1));m.set(S,C)}}h=g.map(function(V){var G;return Su(V,(G=m.get(V))!==null&&G!==void 0?G:new Set)});var N=function(V){V!=null&&V.attrs&&Object.entries(V.attrs).forEach(function(G){var Y=D(G,2),de=Y[0],x=Y[1];V.attrs&&(V.attrs[de]=o.replaceSensitiveString(x))})};try{for(var A=U(h),R=A.next();!R.done;R=A.next()){var L=R.value;N(L)}}catch(V){v={error:V}}finally{try{R&&!R.done&&(p=A.return)&&p.call(A)}finally{if(v)throw v.error}}var M=performance.now();return(T=o.diagnosticsClient)===null||T===void 0||T.recordHistogram("autocapturePlugin.getHierarchy",M-b),h},this.getNearestLabel=function(f){var v=f.parentElement;if(!v)return"";var p;try{p=v.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{p=null}return p?o.getText(p):o.getNearestLabel(v)},this.getElementPath=function(f){var v;if(!f)return"";var p=performance.now(),E=wu(f),T=performance.now();return(v=o.diagnosticsClient)===null||v===void 0||v.recordHistogram("autocapturePlugin.getElementPath",T-p),E},this.getEventProperties=function(f,v,p){var E,T,b,h,g=(b=(T=v==null?void 0:v.tagName)===null||T===void 0?void 0:T.toLowerCase)===null||b===void 0?void 0:b.call(T),m=typeof v.getBoundingClientRect=="function"?v.getBoundingClientRect():{left:null,top:null},y=o.getHierarchy(v),S=(h=y[0])===null||h===void 0?void 0:h.attrs,O=o.getNearestLabel(v),P=Ys(S??{},p),C=(E={},E[Rs]=y,E[on]=g,E[an]=o.getText(v),E[Ds]=m.left==null?null:Math.round(m.left),E[xs]=m.top==null?null:Math.round(m.top),E[Ms]=P,E[Us]=o.getElementPath(v),E[Fs]=O,E[Qt]=we(window.location.href.split("?")[0]),E[Vs]=dr(o.replaceSensitiveString),E[fi]=window.innerHeight,E[vi]=window.innerWidth,E),N=yi();if(N&&(C[hi]=N),C[Cs]=v.getAttribute("id")||"",C[Ps]=v.getAttribute("class"),C[Ns]=S==null?void 0:S["aria-label"],g==="a"&&f==="click"&&v instanceof HTMLAnchorElement){var A=v.href.substring(0,gi);
10C[Ls]=o.replaceSensitiveString(A)}return sn(C)},this.addTypeAndTimestamp=function(f,v){return{event:f,timestamp:Date.now(),type:v}},this.addAdditionalEventProperties=function(f,v,p,E,T){T===void 0&&(T=!1);var b=o.addTypeAndTimestamp(f,v);if(Qs(b)&&b.event.target!==null){if(T){var h=mi(b.event.target,b.type);if(h)return b.closestTrackedAncestor=b.event.target,b.targetElementProperties=o.getEventProperties(b.type,b.closestTrackedAncestor,E),b}var g=hr(b.event.target,p);return g&&(b.closestTrackedAncestor=g,b.targetElementProperties=o.getEventProperties(b.type,g,E)),b}return b},this.extractDataFromDataSource=function(f,v){if(f.sourceType==="DOM_ELEMENT"){var p=fu(f,v);return p?f.elementExtractType==="TEXT"?o.getText(p):f.elementExtractType==="ATTRIBUTE"&&f.attribute?p.getAttribute(f.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(f){var v,p,E="[".concat(je,"], [contenteditable]");if(!f.querySelector(E))return f.innerText;var T="",b=Array.from(f.childNodes);try{for(var h=U(b),g=h.next();!g.done;g=h.next()){var m=g.value;if(m.nodeType===Node.TEXT_NODE){T+=m.textContent||"";continue}if(m instanceof Element){if(m.hasAttribute(je)||m.hasAttribute("contenteditable")){T+=Ae;continue}T+=o.getTextWithMaskedDescendants(m)}}}catch(y){v={error:y}}finally{try{g&&!g.done&&(p=h.return)&&p.call(h)}finally{if(v)throw v.error}}return T},this.getText=function(f){var v=f.closest("[".concat(je,"]"))!==null;if(v)return Ae;var p="";return f.querySelector("[".concat(je,"], [contenteditable]"))?p=o.getTextWithMaskedDescendants(f):p=f.innerText||"",o.replaceSensitiveString(p.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(f){var v,p,E;if(!f)return{};var T=(E=(p=f==null?void 0:f.tagName)===null||p===void 0?void 0:p.toLowerCase)===null||E===void 0?void 0:E.call(p),b=(v={},v[on]=T,v[an]=o.getText(f),v[Qt]=window.location.href.split("?")[0],v);return sn(b)},this.diagnosticsClient=r==null?void 0:r.diagnosticsClient;var s=(a=t.maskTextRegex)!==null&&a!==void 0?a:[],l=[];try{for(var u=U(s),c=u.next();!c.done;c=u.next()){var d=c.value;if(l.length>=Gs)break;if(d instanceof RegExp)l.push(d);else if("pattern"in d&&typeof d.pattern=="string")try{l.push(new RegExp(d.pattern,"i"))}catch{}}}catch(f){n={error:f}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=l}return e}();function Iu(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=e.exposureDuration,o=i===void 0?jn:i,a=new Map,s=new Map,l=t.exposureObservable,u=l.subscribe(function(c){var d=c,f=d.target;if(d.isIntersecting){if(!a.get(f)){var v=setTimeout(function(){a.set(f,!0);var p=n.getElementPath(f);r(p),s.set(f,null)},o);s.set(f,v)}}else if(!d.isIntersecting&&d.intersectionRatio<1){var v=s.get(f);v&&(clearTimeout(v),s.set(f,null))}});return{unsubscribe:function(){u.unsubscribe()},reset:function(){s.forEach(function(c){c&&clearTimeout(c)}),s.clear(),a.clear()}}}function Ou(e){var t,r,n,i,o=e.amplitude,a=e.scrollTracker,s=e.currentElementExposed,l=e.elementExposedForPage,u=e.exposureTracker,c=e.isPageEnd,d=e.lastScroll,f=a.getState(),v=F(),p=(r=v==null?void 0:v.innerWidth)!==null&&r!==void 0?r:0,E=(n=v==null?void 0:v.innerHeight)!==null&&n!==void 0?n:0,T=(t={},t[Qt]=(i=v==null?void 0:v.location)===null||i===void 0?void 0:i.href,t[qs]=f.maxX+p,t[Hs]=f.maxY+E,t[fi]=E,t[vi]=p,t["[Amplitude] Element Exposed"]=Array.from(s),t),b=yi();if(b&&(T[hi]=b),s.size===0&&f.maxX===d.maxX&&f.maxY===d.maxY){c&&(a.reset(),l.clear(),u==null||u.reset());return}o==null||o.track("[Amplitude] Viewport Content Updated",T),d.maxX=f.maxX,d.maxY=f.maxY,s.clear(),c&&(a.reset(),l.clear(),u==null||u.reset())}function ku(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r),o=JSON.stringify(i);o.length>=Ks&&n(!1)}}var se;(function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"})(se||(se={}));var Cu=function(e,t){var r,n,i,o,a,s,l,u,c,d,f,v;e===void 0&&(e={}),t==null||t.diagnosticsClient.setTag("plugin.autocapture.version",ci);var p=e.dataAttributePrefix,E=p===void 0?ur:p,T=e.visualTaggingOptions,b=T===void 0?{enabled:!0}:T;e.cssSelectorAllowlist=(r=e.cssSelectorAllowlist)!==null&&r!==void 0?r:qn,e.actionClickAllowlist=(n=e.actionClickAllowlist)!==null&&n!==void 0?n:Hn,e.debounceTime=(i=e.debounceTime)!==null&&i!==void 0?i:0;var h=((o=e.viewportContentUpdated)===null||o===void 0?void 0:o.enabled)!==!1,g=(l=(s=(a=e.viewportContentUpdated)===null||a===void 0?void 0:a.exposureDuration)!==null&&s!==void 0?s:e.exposureDuration)!==null&&l!==void 0?l:jn;e.viewportContentUpdated=I(I({},e.viewportContentUpdated),{exposureDuration:g}),e.pageUrlExcludelist=(u=e.pageUrlExcludelist)===null||u===void 0?void 0:u.reduce(function(x,q){if(typeof q=="string"&&x.push(q),q instanceof RegExp&&x.push(q),typeof q=="object"&&q!==null&&"pattern"in q)try{x.push(new RegExp(q.pattern))}catch(J){return console.warn("Invalid regex pattern: ".concat(q.pattern),J),x}return x},[]);
10var m=Ss,y="enrichment",S=[],O=new Si(e,t),P=new Set,C=new Set,N,A=function(){var x,q=me(Ti().map(function(Q){return O.addAdditionalEventProperties(Q,"click",e.cssSelectorAllowlist,E)})),J=me(new te(function(Q){var ne,ie=function(Z){var ce=O.addAdditionalEventProperties(Z,"change",e.cssSelectorAllowlist,E);Q.next(ce)};return(ne=F())===null||ne===void 0||ne.document.addEventListener("change",ie,{capture:!0}),function(){var Z;return(Z=F())===null||Z===void 0?void 0:Z.document.removeEventListener("change",ie)}})),re;window.navigation&&(re=me(new te(function(Q){var ne=function(ie){var Z=O.addAdditionalEventProperties(ie,"navigate",e.cssSelectorAllowlist,E);Q.next(Z)};return window.navigation.addEventListener("navigate",ne),function(){window.navigation.removeEventListener("navigate",ne)}})));var $=me(Ei().map(function(Q){return O.addAdditionalEventProperties(Q,"mutation",e.cssSelectorAllowlist,E)})),ue=iu(),ee=au($,e.cssSelectorAllowlist);return x={},x[se.ChangeObservable]=J,x[se.ClickObservable]=q,x[se.MutationObservable]=$,x[se.NavigateObservable]=re,x[se.ScrollObservable]=ue,x[se.ExposureObservable]=ee,x},R=ln(Object.values((d=(c=e.pageActions)===null||c===void 0?void 0:c.labeledEvents)!==null&&d!==void 0?d:{})),L=cn((v=(f=e.pageActions)===null||f===void 0?void 0:f.triggers)!==null&&v!==void 0?v:[]),M=mu(R,L,O,e),V=function(x){var q,J;x&&(e.pageActions=I(I({},e.pageActions),x),R=ln(Object.values((q=e.pageActions.labeledEvents)!==null&&q!==void 0?q:{})),L=cn((J=e.pageActions.triggers)!==null&&J!==void 0?J:[]),M.update(R,L,e))},G=function(x,q){return _(void 0,void 0,void 0,function(){var J,re,$,ue,ee,Q,ne,ie,Z,ce,k,le,Ee,Oe,ke,Ce,Te,Pe,Re,fe,Je;return w(this,function(Rt){return typeof document>"u"?[2]:(J=!1,re={maxX:void 0,maxY:void 0},x.fetchRemoteConfig&&(x.remoteConfigClient?x.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(oe){V(oe)}):x.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),$=We(e,e.cssSelectorAllowlist),ue=We(e,e.actionClickAllowlist),ee=A(),Q=eu({allObservables:ee,amplitude:q,shouldTrackEvent:$,evaluateTriggers:M.evaluate.bind(M)}),S.push(Q),ne=tu({allObservables:ee,getEventProperties:function(){for(var oe=[],ve=0;ve<arguments.length;ve++)oe[ve]=arguments[ve];return O.getEventProperties.apply(O,j(j([],D(oe),!1),[E],!1))},amplitude:q,shouldTrackEvent:$,evaluateTriggers:M.evaluate.bind(M)}),S.push(ne),ie=ru({allObservables:ee,options:e,getEventProperties:function(){for(var oe=[],ve=0;ve<arguments.length;ve++)oe[ve]=arguments[ve];return O.getEventProperties.apply(O,j(j([],D(oe),!1),[E],!1))},amplitude:q,shouldTrackEvent:$,shouldTrackActionClick:ue}),ie&&S.push(ie),Z=nu({allObservables:ee}),S.push(Z),ce={},k=F(),le=function(oe){oe&&J||(setTimeout(function(){J=!1},100),J=!0,Ou({amplitude:q,scrollTracker:Z,currentElementExposed:C,elementExposedForPage:P,exposureTracker:ce.exposure,isPageEnd:oe,lastScroll:re}))},Ee=function(oe){ku(oe,P,C,le)},h&&(ce.exposure=Iu({allObservables:ee,onExposure:Ee,dataExtractor:O,exposureDuration:g}),ce.exposure&&S.push(ce.exposure),Oe=function(){le(!0)},k==null||k.addEventListener("beforeunload",Oe),N=function(){k==null||k.removeEventListener("beforeunload",Oe)},S.push({unsubscribe:function(){return N()}}),ke=ee[se.NavigateObservable],ke?S.push(ke.subscribe(function(){le(!0)})):k&&(Ce=function(){le(!0)},k.addEventListener("popstate",Ce),Te=k.history.pushState,k.history&&Te&&(k.history.pushState=new Proxy(Te,{apply:function(oe,ve,Mi){var Lt=D(Mi,3),Ui=Lt[0],Fi=Lt[1],Vi=Lt[2];oe.apply(ve,[Ui,Fi,Vi]),le(!0)}})),S.push({unsubscribe:function(){k.removeEventListener("popstate",Ce),k.history&&Te&&(k.history.pushState=Te)}}))),(Je=x==null?void 0:x.loggerProvider)===null||Je===void 0||Je.log("".concat(m," has been successfully added.")),window.opener&&b.enabled&&(Pe=e.cssSelectorAllowlist,Re=e.actionClickAllowlist,fe=io(),Zs(fe,{dataExtractor:O,isElementSelectable:We(e,j(j([],D(Pe),!1),D(Re),!1)),cssSelectorAllowlist:Pe,actionClickAllowlist:Re}),oo(fe),fe.setup(I({logger:x==null?void 0:x.loggerProvider},(x==null?void 0:x.serverZone)&&{endpoint:ao[x.serverZone]}))),[2])})})},Y=function(x){return _(void 0,void 0,void 0,function(){return w(this,function(q){return[2,x]})})},de=function(){return _(void 0,void 0,void 0,function(){var x,q,J,re,$;return w(this,function(ue){try{for(x=U(S),q=x.next();!q.done;q=x.next())J=q.value,J.unsubscribe()}catch(ee){re={error:ee}}finally{try{q&&!q.done&&($=x.return)&&$.call(x)}finally{if(re)throw re.error}}return[2]})})};return{name:m,type:y,setup:G,execute:Y,teardown:de}},Pu=3e3,Ru=["mutation","navigate"];function Lu(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,o=r.clickObservable,a=r.mutationObservable,s=r.navigateObservable,l=o.filter(function(v){return ot(v)&&i("click",v.closestTrackedAncestor)&&v.event.target instanceof Element&&v.event.target.closest('a[target="_blank"]')===null&&v.event.button===At.LEFT_OR_TOUCH_CONTACT}),u=s?Me(a,s):a,c=Me(l,u),d=null,f=fr(c,function(v){return d&&Ru.includes(v.type)?(clearTimeout(d),d=null,Promise.resolve(null)):v.type==="click"?d?Promise.resolve(null):new Promise(function(p){d=setTimeout(function(){p(v),d=null},Pu)}):Promise.resolve(null)});return f.subscribe(function(v){if(v){var p={"[Amplitude] X":v.event.clientX,"[Amplitude] Y":v.event.clientY};t.track(ws,I(I({},n("click",v.closestTrackedAncestor)),p),{time:v.timestamp})}})}var _i=sa,wi=aa,dn=ua;function fn(e,t){var r,n,i,o,a=t.event,s=a.pageX,l=a.pageY;e.yMin=Math.min((r=e.yMin)!==null&&r!==void 0?r:l,l),e.yMax=Math.max((n=e.yMax)!==null&&n!==void 0?n:l,l),e.xMin=Math.min((i=e.xMin)!==null&&i!==void 0?i:s,s),e.xMax=Math.max((o=e.xMax)!==null&&o!==void 0?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>dn||e.xMax-e.xMin>dn}function vn(e){if(e.length===0)return null;var t=e[0],r=e[e.length-1],n=I({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-t.timestamp,"[Amplitude] Clicks":e.map(function(i){return{X:i.event.pageX,Y:i.event.pageY,Time:i.timestamp}}),"[Amplitude] Click Count":e.length},t.targetElementProperties);return{rageClickEvent:n,time:t.timestamp}}function Du(e,t){var r=Math.max(0,e.length-_i+1),n=e[r];return t.timestamp-n.timestamp>=wi}function xu(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function Nu(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,o=n.clickObservable,a=n.selectionObservable,s=[],l={},u=null;function c(p){s=[],l={},p&&(fn(l,p),s.push(p))}var d=fr(o.filter(function(p){return i("click",p.closestTrackedAncestor)}),function(p){return _(t,void 0,void 0,function(){var E;return w(this,function(T){return fn(l,p),E=null,s.length===0||xu(s,p)||Du(s,p)||l.isOutOfBounds?(u&&(E=vn(s)),c(p)):s.push(p),u&&(clearTimeout(u.timerId),u.resolve(E),u=null),s.length>=_i?[2,new Promise(function(b){u={resolve:b,timerId:setTimeout(function(){b(vn(s))},wi)}})]:[2,null]})})}),f=a==null?void 0:a.subscribe(function(){c()}),v=d.subscribe(function(p){p!==null&&r.track(As,p.rageClickEvent,{time:p.time})});return{unsubscribe:function(){v.unsubscribe(),f==null||f.unsubscribe()}}}var Mu=2e3;function Uu(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackErrorClick,i=r.clickObservable,o=r.browserErrorObservable,a=i.filter(function(c){return ot(c)&&n("click",c.closestTrackedAncestor)&&c.event.target instanceof Element&&c.event.target.closest('a[target="_blank"]')===null&&c.event.button===At.LEFT_OR_TOUCH_CONTACT}),s=null,l=null,u=function(){s!==null&&(clearTimeout(s),s=null),l=null};return Me(a,o).subscribe(function(c){var d;if(c.type==="click"){u(),l=c,s=setTimeout(u,Mu);return}c.type==="error"&&l&&(t.track(Is,I((d={},d["[Amplitude] Kind"]=c.event.kind,d["[Amplitude] Message"]=c.event.message,d["[Amplitude] Stack"]=c.event.stack,d["[Amplitude] Filename"]=c.event.filename,d["[Amplitude] Line Number"]=c.event.lineNumber,d["[Amplitude] Column Number"]=c.event.columnNumber,d),l.targetElementProperties)),u())})}var ge;(function(e){e.INCREASING="increasing",e.DECREASING="decreasing"})(ge||(ge={}));var xe;(function(e){e.X="x",e.Y="y"})(xe||(xe={}));var Fu=function(e){var t=e.allWindowObservables,r=t.mouseMoveObservable;return new te(function(n){var i=null,o=null,a=null;return r.subscribe(function(s){var l={x:s.clientX,y:s.clientY};if(i===null){i=l;return}l.x>i.x?(o===ge.DECREASING&&n.next(xe.X),o=ge.INCREASING):l.x<i.x&&(o===ge.INCREASING&&n.next(xe.X),o=ge.DECREASING),l.y>i.y?(a===ge.DECREASING&&n.next(xe.Y),a=ge.INCREASING):l.y<i.y&&(a===ge.INCREASING&&n.next(xe.Y),a=ge.DECREASING),i=l})})};function Vu(e){var t=+Date.now();e.startTime=e.startTime||t;var r=e.changes,n=e.changesThreshold;r.push(t),r.length>n&&r.shift()}function hn(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;if(t.length<r)return!1;var i=t[t.length-1]-t[0];return i<n}function pn(e){e.changes=[],e.startTime=void 0}function gn(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length;n++){var o=i-t[n];if(o<r)break}n!==0&&(e.startTime=t[n],e.changes.splice(0,n))}function qu(e,t){var r=void 0;if(hn(e)&&(r=e.startTime),hn(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}var Ai=20,Ii=2e3,Hu=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=r===void 0?Ai:r,i=e.thresholdMs,o=i===void 0?Ii:i;return new te(function(a){var s={changes:[],changesThreshold:n,thresholdMs:o},l={changes:[],changesThreshold:n,thresholdMs:o},u=void 0,c=null;function d(){u!==void 0&&(a.next(u),u=void 0,c!==null&&clearTimeout(c),pn(s),pn(l))}return t.subscribe(function(f){c!==null&&clearTimeout(c),Vu(f===xe.X?s:l);var v=qu(s,l);return v?(u=u||v,c=setTimeout(function(){d(),c=null},o)):d(),gn(s),gn(l),function(){c!==null&&(clearTimeout(c),c=null)}})})},ju=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,o=i===void 0?Ai:i,a=e.thresholdMs,s=a===void 0?Ii:a,l=Fu({allWindowObservables:n}),u=Hu({mouseDirectionChangeObservable:l,directionChanges:o,thresholdMs:s});return u.subscribe(function(c){bi(r)&&t.track(ks,void 0,{time:c})})};function Gt(e,t,r,n){if(!n)return[];var i=e[t];return typeof i=="object"&&i!==null&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var dt=5,ft=4e3,Bu=function(e){var t;e===void 0&&(e={});var r=_s,n="enrichment",i=[],o=e.errorClicks!==!1;e.errorClicks||(o=!1);var a=e.deadClicks!==!1&&e.deadClicks!==null,s=e.rageClicks!==!1&&e.rageClicks!==null,l=e.thrashedCursor!==!1&&e.thrashedCursor!==null;e.thrashedCursor||(l=!1);var u=Gt(e,"rageClicks",oa,s),c=Gt(e,"deadClicks",na,a),d=Gt(e,"errorClicks",ia,o),f=(t=e.dataAttributePrefix)!==null&&t!==void 0?t:ur,v=new Si(e),p=j([],D(new Set(j(j(j([],D(u),!1),D(c),!1),D(d),!1))),!1),E=function(){var g,m=me(Ti("pointerdown").map(function(A){return v.addAdditionalEventProperties(A,"click",p,f,!0)})),y=me(lu().map(function(A){return v.addTypeAndTimestamp(A,"error")})),S=me(Ei().map(function(A){return v.addAdditionalEventProperties(A,"mutation",p,f)})),O;if(window.navigation){var P=new te(function(A){var R=function(L){A.next(I(I({},L),{type:"navigate"}))};return window.navigation.addEventListener("navigate",R),function(){window.navigation.removeEventListener("navigate",R)}});O=me(P.map(function(A){return v.addAdditionalEventProperties(A,"navigate",p,f)}
10))}var C=me(new te(function(A){var R=function(){var L=document.activeElement;if(L&&(L.tagName==="TEXTAREA"||L.tagName==="INPUT")){var M=void 0,V=void 0;try{if(M=L.selectionStart,V=L.selectionEnd,M===V)return}catch{return}return A.next()}var G=window.getSelection();if(!(!G||G.isCollapsed))return A.next()};return window.document.addEventListener("selectionchange",R),function(){window.document.removeEventListener("selectionchange",R)}})),N=me(cu());return g={},g[se.ClickObservable]=m,g[se.MutationObservable]=S,g[se.NavigateObservable]=O,g[se.BrowserErrorObservable]=y,g[se.SelectionObservable]=C,g[se.MouseMoveObservable]=N,g},T=function(g,m){return _(void 0,void 0,void 0,function(){var y,S,O,P,C,N,A,R,L,M,V;return w(this,function(G){return typeof document>"u"?[2]:(y=E(),s&&(S=We(e,u),O=Nu({allObservables:y,amplitude:m,shouldTrackRageClick:S}),i.push(O)),a&&(P=We(e,c),C=Lu({amplitude:m,allObservables:y,getEventProperties:function(Y,de){return v.getEventProperties(Y,de,f)},shouldTrackDeadClick:P}),i.push(C)),o&&(N=We(e,d),A=Uu({amplitude:m,allObservables:y,shouldTrackErrorClick:N}),i.push(A)),l&&(R=void 0,L=void 0,typeof e.thrashedCursor=="object"&&(R=e.thrashedCursor.directionChanges,L=e.thrashedCursor.threshold,R&&R<dt&&(g.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(R," is below the minimum of ").concat(dt,", setting to ").concat(dt)),R=dt),L&&L>ft&&(g.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(L," is above the maximum of ").concat(ft,", setting to ").concat(ft)),L=ft)),M=ju({amplitude:m,options:e,allObservables:y,directionChanges:R,thresholdMs:L}),i.push(M)),(V=g==null?void 0:g.loggerProvider)===null||V===void 0||V.log("".concat(r," has been successfully added.")),[2])})})},b=function(g){return _(void 0,void 0,void 0,function(){return w(this,function(m){return[2,g]})})},h=function(){return _(void 0,void 0,void 0,function(){var g,m,y,S,O;return w(this,function(P){try{for(g=U(i),m=g.next();!m.done;m=g.next())y=m.value,y.unsubscribe()}catch(C){S={error:C}}finally{try{m&&!m.done&&(O=g.return)&&O.call(g)}finally{if(S)throw S.error}}return[2]})})};return{name:r,type:n,setup:T,execute:b,teardown:h}},Gu="@amplitude/plugin-network-capture-browser",Oi="[Amplitude] Network Request",ki="500-599";function bt(e,t){var r=t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&"),n="^"+r.replace(/\*/g,".*")+"$",i=new RegExp(n);return i.test(e)}function Ci(e,t){var r,n,i=t.split(",");try{for(var o=U(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=D(s.split("-").map(Number),2),u=l[0],c=l[1];if(e===u&&c===void 0||e>=u&&e<=c)return!0}}catch(d){r={error:d}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}function Wu(e,t,r,n,i){if(!(e.hosts&&!e.hosts.find(function(a){return bt(t,a)}))&&!(n&&e.urls&&!Yt(n,e.urls))&&!(i&&e.methods&&!e.methods.find(function(a){return i.toLowerCase()===a.toLowerCase()||a==="*"}))){if(r||r===0){var o=e.statusCodeRange||ki;if(!Ci(r,o))return!1}return!0}}function Pi(e){var t;if(e)try{var r=(t=F())===null||t===void 0?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),o=n.hash.replace("#",""),a=n.href,s=n.host;n.hash="",n.search="";var l=n.href;return{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:l,host:s}}catch{return}}function Ku(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if(typeof r!="string")return!1;var n=JSON.parse(r),i=n.events;if(i.find(function(o){return o.event_type===Oi}))return!0}catch{}return!1}function mn(e){if(typeof e!="object"||e===null){if(e)return j([],D(Et),!1);if(e===void 0){var t=void 0;return t}return}if(e.length!==0)return e}function bn(e){var t,r;return!(!((t=e==null?void 0:e.allowlist)===null||t===void 0)&&t.length)&&!(!((r=e==null?void 0:e.blocklist)===null||r===void 0)&&r.length)}function zu(e,t){var r;t===void 0&&(t={});var n=Pi(e.url);if(!n)return!1;var i=n.host;if(t.ignoreAmplitudeRequests!==!1&&(bt(i,"*.amplitude.com")||bt(i,"amplitude.com"))||!((r=t.ignoreHosts)===null||r===void 0)&&r.find(function(a){return bt(i,a)})||!t.captureRules&&e.status!==void 0&&!Ci(e.status,ki))return!1;if(t.captureRules){var o;
10if(j([],D(t.captureRules),!1).reverse().find(function(a){if(o=Wu(a,i,e.status,e.url,e.method),o){var s=mn(a.responseHeaders);if(e.responseWrapper&&s){var l=e.responseWrapper.headers(s);l&&(e.responseHeaders=l)}var u=mn(a.requestHeaders);if(e.requestWrapper&&u){var c=e.requestWrapper.headers(u);c&&(e.requestHeaders=c)}e.responseWrapper&&a.responseBody&&!bn(a.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(a.responseBody.allowlist,a.responseBody.blocklist)),e.requestWrapper&&a.requestBody&&!bn(a.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(a.requestBody.allowlist,a.requestBody.blocklist))}return o!==void 0}),!o)return!1}return!(e.requestWrapper&&Ku(i,e.requestWrapper))}function Xu(e,t,r,n){return _(this,void 0,void 0,function(){var i,o,a;return w(this,function(s){switch(s.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=D.apply(void 0,[s.sent(),2]),o=i[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(l){n==null||n.debug("Failed to stringify request body",l)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch{n==null||n.debug("Failed to stringify response body")}s.label=2;case 2:return r==null||r.track(Oi,e),[2]}})})}function Ju(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider,o=t.networkObservable,a=o.filter(function(s){return zu(s.event,r)});return a.subscribe(function(s){var l,u,c,d=s.event,f=Pi(d.url);if(f){var v=(u=d.responseWrapper)===null||u===void 0?void 0:u.bodySize,p=(c=d.requestWrapper)===null||c===void 0?void 0:c.bodySize,E=(l={},l["[Amplitude] URL"]=f.hrefWithoutQueryOrHash,l["[Amplitude] URL Query"]=f.query,l["[Amplitude] URL Fragment"]=f.fragment,l["[Amplitude] Request Method"]=d.method,l["[Amplitude] Status Code"]=d.status,l["[Amplitude] Start Time"]=d.startTime,l["[Amplitude] Completion Time"]=d.endTime,l["[Amplitude] Duration"]=d.duration,l["[Amplitude] Request Body Size"]=p,l["[Amplitude] Response Body Size"]=v,l["[Amplitude] Request Type"]=d.type,l["[Amplitude] Request Headers"]=d.requestHeaders,l["[Amplitude] Response Headers"]=d.responseHeaders,l);Xu(E,d,n,i)}})}var er;(function(e){e.NetworkObservable="networkObservable"})(er||(er={}));var yn,Yu=function(e){e===void 0&&(e={});var t=Gu,r="enrichment",n,i=function(u,c){var d={event:u,timestamp:Date.now(),type:c};return d},o=function(){var u,c=new te(function(d){var f=new ma(function(v){var p=i(v,"network");d.next(p)});return jr.subscribe(f,n),function(){jr.unsubscribe(f)}});return u={},u[er.NetworkObservable]=c,u},a=function(u,c){return _(void 0,void 0,void 0,function(){var d;return w(this,function(f){return typeof document>"u"?[2]:(d=o(),n=u==null?void 0:u.loggerProvider,yn=Ju({allObservables:d,networkTrackingOptions:e,amplitude:c,loggerProvider:n}),n==null||n.log("".concat(t," has been successfully added.")),[2])})})},s=function(u){return _(void 0,void 0,void 0,function(){return w(this,function(c){return[2,u]})})},l=function(){return _(void 0,void 0,void 0,function(){return w(this,function(u){return yn.unsubscribe(),[2]})})};return{name:t,type:r,setup:a,execute:s,teardown:l}},$u="web-vitals-browser",Qu="[Amplitude] Web Vitals";let Ri=-1;const Xe=e=>{addEventListener("pageshow",t=>{t.persisted&&(Ri=t.timeStamp,e(t))},!0)},be=(e,t,r,n)=>{let i,o;return a=>{t.value>=0&&(a||n)&&(o=t.value-(i??0),(o||i===void 0)&&(i=t.value,t.delta=o,t.rating=((s,l)=>s>l[1]?"poor":s>l[0]?"needs-improvement":"good")(t.value,r),e(t)))}},pr=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},gr=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},at=()=>{const e=gr();return(e==null?void 0:e.activationStart)??0},ye=(e,t=-1)=>{const r=gr();let n="navigate";return Ri>=0?n="back-forward-cache":r&&(document.prerendering||at()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}}
10,Wt=new WeakMap;function mr(e,t){return Wt.get(e)||Wt.set(e,new t),Wt.get(e)}class Zu{constructor(){Se(this,"t");Se(this,"i",0);Se(this,"o",[])}h(t){var i;if(t.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),(i=this.t)==null||i.call(this,t)}}const st=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(i=>{Promise.resolve().then(()=>{t(i.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},br=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let Be=-1;const Li=new Set,En=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,tr=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Li)t();isFinite(Be)||(Be=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",tr,!0))}},Ct=()=>{var e;if(Be<0){const t=at();Be=(document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0])==null?void 0:e.startTime)??En(),addEventListener("visibilitychange",tr,!0),addEventListener("prerenderingchange",tr,!0),Xe(()=>{setTimeout(()=>{Be=En()})})}return{get firstHiddenTime(){return Be},onHidden(t){Li.add(t)}}},Pt=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Tn=[1800,3e3],Di=(e,t={})=>{Pt(()=>{const r=Ct();let n,i=ye("FCP");const o=st("paint",a=>{for(const s of a)s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<r.firstHiddenTime&&(i.value=Math.max(s.startTime-at(),0),i.entries.push(s),n(!0)))});o&&(n=be(e,i,Tn,t.reportAllChanges),Xe(a=>{i=ye("FCP"),n=be(e,i,Tn,t.reportAllChanges),pr(()=>{i.value=performance.now()-a.timeStamp,n(!0)})}))})},Sn=[.1,.25],el=(e,t={})=>{const r=Ct();Di(br(()=>{let n,i=ye("CLS",0);const o=mr(t,Zu),a=l=>{for(const u of l)o.h(u);o.i>i.value&&(i.value=o.i,i.entries=o.o,n())},s=st("layout-shift",a);s&&(n=be(e,i,Sn,t.reportAllChanges),r.onHidden(()=>{a(s.takeRecords()),n(!0)}),Xe(()=>{o.i=0,i=ye("CLS",0),n=be(e,i,Sn,t.reportAllChanges),pr(()=>n())}),setTimeout(n))}))};let xi=0,Kt=1/0,vt=0;const tl=e=>{for(const t of e)t.interactionId&&(Kt=Math.min(Kt,t.interactionId),vt=Math.max(vt,t.interactionId),xi=vt?(vt-Kt)/7+1:0)};let rr;const _n=()=>rr?xi:performance.interactionCount??0,rl=()=>{"interactionCount"in performance||rr||(rr=st("event",tl,{type:"event",buffered:!0,durationThreshold:0}))};let wn=0;class nl{constructor(){Se(this,"u",[]);Se(this,"l",new Map);Se(this,"m");Se(this,"p")}v(){wn=_n(),this.u.length=0,this.l.clear()}L(){const t=Math.min(this.u.length-1,Math.floor((_n()-wn)/50));return this.u[t]}h(t){var i,o;if((i=this.m)==null||i.call(this,t),!t.interactionId&&t.entryType!=="first-input")return;const r=this.u.at(-1);let n=this.l.get(t.interactionId);if(n||this.u.length<10||t.duration>r.P){if(n?t.duration>n.P?(n.entries=[t],n.P=t.duration):t.duration===n.P&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],P:t.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((a,s)=>s.P-a.P),this.u.length>10){const a=this.u.splice(10);for(const s of a)this.l.delete(s.id)}(o=this.p)==null||o.call(this,n)}}}const Ni=e=>{const t=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?e():(e=br(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},An=[200,500],il=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=Ct();Pt(()=>{rl();let n,i=ye("INP");const o=mr(t,nl),a=l=>{Ni(()=>{for(const c of l)o.h(c);const u=o.L();u&&u.P!==i.value&&(i.value=u.P,i.entries=u.entries,n())})},s=st("event",a,{durationThreshold:t.durationThreshold??40});n=be(e,i,An,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{a(s.takeRecords()),n(!0)}),Xe(()=>{o.v(),i=ye("INP"),n=be(e,i,An,t.reportAllChanges)}))})};class ol{constructor(){Se(this,"m")}h(t){var r;(r=this.m)==null||r.call(this,t)}}const In=[2500,4e3],al=(e,t={})=>{Pt(()=>
10{const r=Ct();let n,i=ye("LCP");const o=mr(t,ol),a=l=>{t.reportAllChanges||(l=l.slice(-1));for(const u of l)o.h(u),u.startTime<r.firstHiddenTime&&(i.value=Math.max(u.startTime-at(),0),i.entries=[u],n())},s=st("largest-contentful-paint",a);if(s){n=be(e,i,In,t.reportAllChanges);const l=br(()=>{a(s.takeRecords()),s.disconnect(),n(!0)}),u=c=>{c.isTrusted&&(Ni(l),removeEventListener(c.type,u,{capture:!0}))};for(const c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});Xe(c=>{i=ye("LCP"),n=be(e,i,In,t.reportAllChanges),pr(()=>{i.value=performance.now()-c.timeStamp,n(!0)})})}})},On=[800,1800],nr=e=>{document.prerendering?Pt(()=>nr(e)):document.readyState!=="complete"?addEventListener("load",()=>nr(e),!0):setTimeout(e)},sl=(e,t={})=>{let r=ye("TTFB"),n=be(e,r,On,t.reportAllChanges);nr(()=>{const i=gr();i&&(r.value=Math.max(i.responseStart-at(),0),r.entries=[i],n(!0),Xe(()=>{r=ye("TTFB",0),n=be(e,r,On,t.reportAllChanges),n(!0)}))})};function ul(e){var t,r=((t=e.entries[0])===null||t===void 0?void 0:t.startTime)||0;return performance.timeOrigin+r}function Ze(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(ul(e)),navigationStart:Math.floor(performance.timeOrigin)}}var ll=function(){var e=null,t=F(),r=t==null?void 0:t.document,n=t==null?void 0:t.location,i=function(s,l){return _(void 0,void 0,void 0,function(){var u,c;return w(this,function(d){return r===void 0?[2]:(u=we((n==null?void 0:n.href)||"",s.loggerProvider),c={"[Amplitude] Page Domain":(n==null?void 0:n.hostname)||"","[Amplitude] Page Location":u,"[Amplitude] Page Path":we((n==null?void 0:n.pathname)||"",s.loggerProvider),"[Amplitude] Page Title":typeof document<"u"&&document.title||"","[Amplitude] Page URL":we(u.split("?")[0],s.loggerProvider)},al(function(f){c["[Amplitude] LCP"]=Ze(f)}),Di(function(f){c["[Amplitude] FCP"]=Ze(f)}),il(function(f){c["[Amplitude] INP"]=Ze(f)}),el(function(f){c["[Amplitude] CLS"]=Ze(f)}),sl(function(f){c["[Amplitude] TTFB"]=Ze(f)}),e=function(){r.visibilityState==="hidden"&&e&&(l.track(Qu,c),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e),[2])})})},o=function(s){return _(void 0,void 0,void 0,function(){return w(this,function(l){return[2,s]})})},a=function(){return _(void 0,void 0,void 0,function(){return w(this,function(s){return e&&(r==null||r.removeEventListener("visibilitychange",e)),[2]})})};return{name:$u,type:"enrichment",setup:i,execute:o,teardown:a}},kn=function(){function e(t,r){var n;this.shouldTrackNewCampaign=!1,this.options=I({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:is(((n=r.cookieOptions)===null||n===void 0?void 0:n.domain)||r.topLevelDomain),optOut:r.optOut},t),this.storage=r.cookieStorage,this.storageKey=xr(r.apiKey,"MKTG"),this.webExpStorageKey=xr(r.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=It,this.sessionTimeout=r.sessionTimeout,this.lastEventTime=r.lastEventTime,this.logger=r.loggerProvider,this.topLevelDomain=r.topLevelDomain,r.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return _(this,void 0,void 0,function(){var t,r;return w(this,function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return r=D.apply(void 0,[n.sent(),2]),this.currentCampaign=r[0],this.previousCampaign=r[1],t=this.lastEventTime?Ln(this.sessionTimeout,this.lastEventTime):!0,es(this.currentCampaign,this.previousCampaign,this.options,this.logger,t,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return _(this,void 0,void 0,function(){var t;return w(this,function(r){switch(r.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return t=r.sent(),t?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[4,Promise.all([t||new Xn().parse(),this.storage.get(this.storageKey)])];case 4:return[2,r.sent()]}})})},e.prototype.generateCampaignEvent=function(t){this.shouldTrackNewCampaign=!1;var r=ns(this.currentCampaign,this.options);return t&&(r.event_id=t),r},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),ht="AMP_CURRENT_PAGE",pt="AMP_PREVIOUS_PAGE",Ve="AMP_URL_INFO",it;(function(e){e.Direct="direct",e.Internal="internal",e.External="external"})(it||(it={}));var cl=new Set([_e.IDENTIFY,_e.GROUP_IDENTIFY,_e.REVENUE]),dl=function(e){var t={},r=t.internalDomains,n=r===void 0?[]:r,i=F(),o=void 0,a=!1,s=void 0,l=!1,u=!1,
10c=function(E){var T;try{var b=we(E,s);T=new URL(b).hostname}catch(h){s==null||s.error("Could not parse URL: ",h)}return T},d=function(E){var T=typeof location<"u"&&location.hostname||"",b=E?c(E):void 0;if(!b)return it.Direct;var h=n.some(function(m){return T.indexOf(m)!==-1}),g=n.some(function(m){return b.indexOf(m)!==-1});return T===b||g&&h?it.Internal:it.External},f=function(){return _(void 0,void 0,void 0,function(){var E,T,b,h,g;return w(this,function(m){switch(m.label){case 0:return o&&a?[4,o.get(Ve)]:[3,3];case 1:return E=m.sent(),T=we(typeof location<"u"&&location.href||""),b=(E==null?void 0:E[ht])||"",h=void 0,T===b?h=(E==null?void 0:E[pt])||"":b?h=b:h=document.referrer||"",[4,o.set(Ve,(g={},g[ht]=T,g[pt]=h,g))];case 2:m.sent(),m.label=3;case 3:return[2]}})})},v=function(){f()},p={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(E,T){return _(void 0,void 0,void 0,function(){var b;return w(this,function(h){switch(h.label){case 0:if(s=E.loggerProvider,s.log("Installing @amplitude/plugin-page-url-enrichment-browser"),u=!0,!i)return[3,2];try{o=new Ot(i.sessionStorage)}catch{s==null||s.debug("sessionStorage is not available in this environment.")}return[4,o==null?void 0:o.isEnabled()];case 1:a=(b=h.sent())!==null&&b!==void 0?b:!1,i.addEventListener("popstate",v),l||(i.history.pushState=new Proxy(i.history.pushState,{apply:function(g,m,y){var S=D(y,3),O=S[0],P=S[1],C=S[2];g.apply(m,[O,P,C]),u&&v()}}),i.history.replaceState=new Proxy(i.history.replaceState,{apply:function(g,m,y){var S=D(y,3),O=S[0],P=S[1],C=S[2];g.apply(m,[O,P,C]),u&&v()}}),l=!0),h.label=2;case 2:return[2]}})})},execute:function(E){return _(void 0,void 0,void 0,function(){var T,b,h,g,m;return w(this,function(y){switch(y.label){case 0:return T=we(typeof location<"u"&&location.href||""),o&&a?[4,o.get(Ve)]:[3,5];case 1:return b=y.sent(),b!=null&&b[ht]?[3,3]:[4,o.set(Ve,(m={},m[ht]=T,m[pt]=document.referrer||"",m))];case 2:y.sent(),y.label=3;case 3:return[4,o.get(Ve)];case 4:if(h=y.sent(),g="",h&&(g=h[pt]||""),cl.has(E.event_type))return[2,E];E.event_properties=I(I({},E.event_properties||{}),{"[Amplitude] Page Domain":et(E,"[Amplitude] Page Domain",typeof location<"u"&&location.hostname||""),"[Amplitude] Page Location":et(E,"[Amplitude] Page Location",T),"[Amplitude] Page Path":et(E,"[Amplitude] Page Path",typeof location<"u"&&we(location.pathname)||""),"[Amplitude] Page Title":et(E,"[Amplitude] Page Title",dr(cr)),"[Amplitude] Page URL":et(E,"[Amplitude] Page URL",T.split("?")[0]),"[Amplitude] Previous Page Location":g,"[Amplitude] Previous Page Type":d(g)}),y.label=5;case 5:return[2,E]}})})},teardown:function(){return _(void 0,void 0,void 0,function(){return w(this,function(E){switch(E.label){case 0:return i&&(i.removeEventListener("popstate",v),u=!1),o&&a?[4,o.set(Ve,{})]:[3,2];case 1:E.sent(),E.label=2;case 2:return[2]}})})}};return p};function et(e,t,r){return e.event_properties||(e.event_properties={}),e.event_properties[t]===void 0?r:e.event_properties[t]}var fl=function(){var e,t,r;function n(a){return typeof a!="object"||a===null?!1:"body"in a&&typeof a.body=="string"}function i(a){if(a)try{var s=new Function("return "+a)();if(typeof s=="function")return s;e==null||e.error("Custom enrichment body did not evaluate to a function")}catch(l){e==null||e.error("Could not create custom enrichment function",l)}return function(l){return l}}var o={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(a,s){return _(void 0,void 0,void 0,function(){var l,u;return w(this,function(c){return e=a.loggerProvider,e==null||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),!((u=a.remoteConfig)===null||u===void 0)&&u.fetchRemoteConfig&&(a.remoteConfigClient?(l=a.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",function(d){d&&n(d)?r=i(d.body||""):r=i("")}),t=function(){var d;return(d=a.remoteConfigClient)===null||d===void 0?void 0:d.unsubscribe(l)}):e==null||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]})})},execute:function(a){return _(void 0,void 0,void 0,function(){var s;return w(this,function(l){if(r)try{return[2,(s=r(a))!==null&&s!==void 0?s:null]}catch(u){return e==null||e.error("Could not execute custom enrichment function",u),[2,a]}return[2,a]})})},teardown:function(){return _(void 0,void 0,void 0,function(){return w(this,function(a){return t&&t(),[2]})})}};return o},zt=-1,vl=function(e){Ue(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._diagnosticsSampleRate=0,r._enableRequestBodyCompressionExperimentalValue=!1,r}return t.prototype.init=function(r,n,i){r===void 0&&(r="");var o,a;return arguments.length>2?(o=n,a=i):typeof n=="string"?(o=n,a=void 0):(o=n==null?void 0:n.userId,a=n),ae(this._init(I(I({},a),{userId:o,apiKey:r})))},t.prototype._init=function(r){var n,i,o,a,s,l,u,c;return _(this,void 0,void 0,function(){var d,f,v,p,E,T,b,h,g,m,y,S,O,P,C,N=this;return w(this,function(A){switch(A.label){case 0:return this.initializing?[2]:(this.initializing=!0,d=cs(r),f=(n=r.loggerProvider)!==null&&n!==void 0?n:new Cn,r.loggerProvider||f.enable((i=r.logLevel)!==null&&i!==void 0?i:Tt.Warn),v=(o=r.serverZone)!==null&&o!==void 0?o:oi,E=this._diagnosticsSampleRate,T=(a=r.enableDiagnostics)!==null&&a!==void 0?a:!0,d?(p=new lo(r.apiKey,f,v,(s=r.remoteConfig)===null||s===void 0?void 0:s.serverUrl),[4,new Promise(function(R){p==null||p.subscribe("configs.diagnostics.browserSDK","all",function(L,M,V){if(f.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:L,source:M,lastFetch:V},null,2)),L){var G=L.sampleRate;typeof G=="number"&&!isNaN(G)&&(E=G);var Y=L.enabled;typeof Y=="boolean"&&(T=Y)}R()})})]):[3,2]);case 1:A.sent(),A.label=2;case 2:return b=new $o(r.apiKey,f,v,{enabled:T,sampleRate:E}),b.setTag("library","".concat(ni,"/").concat(vr)),typeof navigator<"u"&&b.setTag("user_agent",navigator.userAgent),[4,us(r.apiKey,r,this,b,{loggerProvider:f,serverZone:v,enableDiagnostics:T,diagnosticsSampleRate:E})];case 3:return h=A.sent(),d&&p?[4,new Promise(function(R){p==null||p.subscribe("configs.analyticsSDK.browserSDK","all",function(L,M,V){h.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:L,source:M,lastFetch:V},null,2)),L&&Ts(L,h),R()})})]:[3,5];case 4:A.sent(),A.label=5;case 5:return[4,e.prototype._init.call(this,h)];
10case 6:return A.sent(),this.logBrowserOptions(h),this.config.remoteConfigClient=p,$n(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener(function(R){return _(N,void 0,void 0,function(){var L;return w(this,function(M){switch(M.label){case 0:return R?[3,2]:(L=Xr(this.config),this.webAttribution=new kn(L,this.config),[4,this.webAttribution.init()]);case 1:M.sent(),M.label=2;case 2:return[2]}})})}),g=Xr(this.config),this.webAttribution=new kn(g,this.config),[4,this.webAttribution.init()]):[3,8];case 7:A.sent(),A.label=8;case 8:return m=St(),y=m.ampTimestamp?Number(m.ampTimestamp):void 0,S=y?Date.now()<y:!0,O=S&&!Number.isNaN(Number(m.ampSessionId))?Number(m.ampSessionId):void 0,P=this.config.deferredSessionId,P===zt&&!this.config.optOut&&(P=Date.now()),this.setSessionId((c=(u=(l=r.sessionId)!==null&&l!==void 0?l:O)!==null&&u!==void 0?u:P)!==null&&c!==void 0?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener(function(R){return _(N,void 0,void 0,function(){return w(this,function(L){return!R&&this.config.deferredSessionId&&(this.config.deferredSessionId===zt?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]})})}),C=Xt(r.instanceName),C.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===Vn?[3,10]:[4,this.add(Es()).promise];case 9:A.sent(),A.label=10;case 10:return[4,this.add(new Lo({diagnosticsClient:b})).promise];case 11:return A.sent(),[4,this.add(new Fa).promise];case 12:return A.sent(),[4,this.add(new Do).promise];case 13:return A.sent(),ys(this.config),ka(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(bs()).promise]):[3,15];case 14:A.sent(),A.label=15;case 15:return Qn(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(ms()).promise]):[3,17];case 16:A.sent(),A.label=17;case 17:return Zn(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(en(zr(this.config))).promise]):[3,20];case 18:return A.sent(),[3,20];case 19:this.timeline.addOptOutListener(function(R){return _(N,void 0,void 0,function(){return w(this,function(L){switch(L.label){case 0:return R?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(en(zr(this.config))).promise]);case 1:return L.sent(),[2]}})})}),A.label=20;case 20:return ti(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Cu(La(this.config),{diagnosticsClient:b})).promise]):[3,22];case 21:A.sent(),A.label=22;case 22:return ri(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Bu(Da(this.config))).promise]):[3,24];case 23:A.sent(),A.label=24;case 24:return ei(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(Yu(xa(this.config))).promise]):[3,26];case 25:A.sent(),A.label=26;case 26:return Pa(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(ll()).promise]):[3,28];case 27:A.sent(),A.label=28;case 28:return Ca(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(dl()).promise]):[3,30];case 29:A.sent(),A.label=30;case 30:return Ra(this.config.customEnrichment)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(fl()).promise]):[3,32];case 31:A.sent(),A.label=32;case 32:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 33:return A.sent(),C.eventBridge.setEventReceiver(function(R){var L=R.eventProperties||{},M=L.time,V=yt(L,["time"]),G=typeof M=="number"?{time:M}:void 0;N.track(R.eventType,V,G)}),[2]}})})},t.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},t.prototype.setUserId=function(r){if(!this.config){this.q.push(this.setUserId.bind(this,r));return}
10this.config.loggerProvider.debug("function setUserId: ",r),(r!==this.config.userId||r===void 0)&&(this.config.userId=r,this.timeline.onIdentityChanged({userId:r}),so(r,this.config.instanceName))},t.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},t.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.loggerProvider.debug("function setDeviceId: ",r),r!==this.config.deviceId&&(this.config.deviceId=r,this.timeline.onIdentityChanged({deviceId:r}),uo(r,this.config.instanceName))},t.prototype.reset=function(){this.setDeviceId(Ie()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var r,n;return{deviceId:(r=this.config)===null||r===void 0?void 0:r.deviceId,userId:(n=this.config)===null||n===void 0?void 0:n.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(r){var n,i,o;if("userId"in r&&this.setUserId(r.userId),"deviceId"in r&&r.deviceId&&this.setDeviceId(r.deviceId),"userProperties"in r){this.userProperties=r.userProperties;var a=new tt,s=(o=r.userProperties)!==null&&o!==void 0?o:{};try{for(var l=U(Object.entries(s)),u=l.next();!u.done;u=l.next()){var c=D(u.value,2),d=c[0],f=c[1];a.set(d,f)}}catch(v){n={error:v}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}this.identify(a)}},t.prototype.getOptOut=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.optOut},t.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},t.prototype.setSessionId=function(r){var n,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,r)),ae(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=r??zt,ae(Promise.resolve());if(r===void 0&&(r=Date.now()),r===this.config.sessionId)return ae(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",r);var o=this.getSessionId();o!==r&&this.timeline.onSessionIdChanged(r);var a=this.config.lastEventTime,s=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1;this.config.sessionId=r,this.config.lastEventTime=void 0,this.config.pageCounter=0,Kr(this.config.defaultTracking)&&(o&&a&&i.push(this.track($r,void 0,{device_id:this.previousSessionDeviceId,event_id:++s,session_id:o,time:a+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var l=this.trackCampaignEventIfNeeded(++s,i);return this.config.identify&&i.push(this.track(ar(this.config.identify)).promise),Kr(this.config.defaultTracking)&&i.push(this.track(Yr,void 0,{event_id:l?++s:s,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,ae(Promise.all(i))},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=ui(r)},t.prototype.identify=function(r,n){if(Ft(r)){var i=r._q;r._q=[],r=mt(new tt,i)}return n!=null&&n.user_id&&this.setUserId(n.user_id),n!=null&&n.device_id&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,r,n)},t.prototype.groupIdentify=function(r,n,i,o){if(Ft(i)){var a=i._q;i._q=[],i=mt(new tt,a)}return e.prototype.groupIdentify.call(this,r,n,i,o)},t.prototype.revenue=function(r,n){if(Ft(r)){var i=r._q;r._q=[],r=mt(new Oo,i)}return e.prototype.revenue.call(this,r,n)},t.prototype.trackCampaignEventIfNeeded=function(r,n){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var i=this.webAttribution.generateCampaignEvent(r);return n?n.push(this.track(i).promise):this.track(i),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(r){return _(this,void 0,void 0,function(){var n,i,o;return w(this,function(a){return n=Date.now(),i=Ln(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),r.event_type!==Yr&&r.event_type!==$r&&(!r.session_id||r.session_id===this.getSessionId())&&(i||o?(this.setSessionId(n),o&&this.config.loggerProvider.log("Created a new session for new campaign.")):i||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,r)]})})},t.prototype.logBrowserOptions=function(r){try{var n=I(I({},r),{apiKey:r.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",Oa(n))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},t.prototype._setDiagnosticsSampleRate=function(r){if(!(r>1||r<0)&&!this.config){this._diagnosticsSampleRate=r;return}},t.prototype._enableRequestBodyCompressionExperimental=function(r){if(!this.config){this._enableRequestBodyCompressionExperimentalValue=r;return}},t}
10(Io),hl=function(){var e=new vl;return{init:W(e.init.bind(e),"init",z(e),K(e,["config"])),add:W(e.add.bind(e),"add",z(e),K(e,["config.apiKey","timeline.plugins"])),remove:W(e.remove.bind(e),"remove",z(e),K(e,["config.apiKey","timeline.plugins"])),track:W(e.track.bind(e),"track",z(e),K(e,["config.apiKey","timeline.queue.length"])),logEvent:W(e.logEvent.bind(e),"logEvent",z(e),K(e,["config.apiKey","timeline.queue.length"])),identify:W(e.identify.bind(e),"identify",z(e),K(e,["config.apiKey","timeline.queue.length"])),groupIdentify:W(e.groupIdentify.bind(e),"groupIdentify",z(e),K(e,["config.apiKey","timeline.queue.length"])),setGroup:W(e.setGroup.bind(e),"setGroup",z(e),K(e,["config.apiKey","timeline.queue.length"])),revenue:W(e.revenue.bind(e),"revenue",z(e),K(e,["config.apiKey","timeline.queue.length"])),flush:W(e.flush.bind(e),"flush",z(e),K(e,["config.apiKey","timeline.queue.length"])),getUserId:W(e.getUserId.bind(e),"getUserId",z(e),K(e,["config","config.userId"])),setUserId:W(e.setUserId.bind(e),"setUserId",z(e),K(e,["config","config.userId"])),getDeviceId:W(e.getDeviceId.bind(e),"getDeviceId",z(e),K(e,["config","config.deviceId"])),setDeviceId:W(e.setDeviceId.bind(e),"setDeviceId",z(e),K(e,["config","config.deviceId"])),reset:W(e.reset.bind(e),"reset",z(e),K(e,["config","config.userId","config.deviceId"])),getSessionId:W(e.getSessionId.bind(e),"getSessionId",z(e),K(e,["config"])),setSessionId:W(e.setSessionId.bind(e),"setSessionId",z(e),K(e,["config"])),extendSession:W(e.extendSession.bind(e),"extendSession",z(e),K(e,["config"])),setOptOut:W(e.setOptOut.bind(e),"setOptOut",z(e),K(e,["config"])),setTransport:W(e.setTransport.bind(e),"setTransport",z(e),K(e,["config"])),getIdentity:W(e.getIdentity.bind(e),"getIdentity",z(e),K(e,["config"])),setIdentity:W(e.setIdentity.bind(e),"setIdentity",z(e),K(e,["config","config.userId","config.deviceId"])),getOptOut:W(e.getOptOut.bind(e),"getOptOut",z(e),K(e,["config"])),_setDiagnosticsSampleRate:W(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",z(e),K(e,["config"])),_enableRequestBodyCompressionExperimental:W(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",z(e),K(e,["config"]))}};const X=hl();var Tl=X.add,Sl=X.extendSession,_l=X.flush,wl=X.getDeviceId,Al=X.getIdentity,Il=X.getOptOut,Ol=X.getSessionId,kl=X.getUserId,Cl=X.groupIdentify,Pl=X.identify,Rl=X.init,Ll=X.logEvent,Dl=X.remove,xl=X.reset,Nl=X.revenue,Ml=X.setDeviceId,Ul=X.setGroup,Fl=X.setIdentity,Vl=X.setOptOut,ql=X.setSessionId,Hl=X.setTransport,jl=X.setUserId,Bl=X.track,Gl=X._setDiagnosticsSampleRate,Wl=X._enableRequestBodyCompressionExperimental;export{vl as AmplitudeBrowser,tt as Identify,Oo as Revenue,El as Types,Wl as _enableRequestBodyCompressionExperimental,Gl as _setDiagnosticsSampleRate,Tl as add,hl as createInstance,Sl as extendSession,_l as flush,wl as getDeviceId,Al as getIdentity,Il as getOptOut,Ol as getSessionId,kl as getUserId,Cl as groupIdentify,Pl as identify,Rl as init,Ll as logEvent,Dl as remove,xl as reset,Nl as revenue,yl as runQueuedFunctions,Ml as setDeviceId,Ul as setGroup,Fl as setIdentity,Vl as setOptOut,ql as setSessionId,Hl as setTransport,jl as setUserId,Bl as track};

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.