PageSourceSearch

https://1whnva.com/resources/v1/app/assets/setup-amplitude-PW9NszkX.js

js 1whnva.com collected 2026-10-08 05:57:02 UTC 129,598 bytes, 10 lines download raw bytes

1import{X as x,_ as P,P as W,J as N,z as S,H as w,M as dt,G as be,al as pn}from"./logger-BOxpBNGt.js";var he;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(he||(he={}));var ye;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(ye||(ye={}));var At="-",We="AMP",gn="".concat(We,"_unsent"),Er="$default_instance",bt="https://api2.amplitude.com/2/httpapi",br="https://api.eu.amplitude.com/2/httpapi",_r="https://api2.amplitude.com/batch",Tr="https://api.eu.amplitude.com/batch",mn="utm_campaign",yn="utm_content",En="utm_id",bn="utm_medium",_n="utm_source",Tn="utm_term",Pt="dclid",Ct="fbclid",kt="gbraid",Rt="gclid",Ot="ko_click_id",Lt="li_fat_id",xt="msclkid",Dt="rdt_cid",Ut="ttclid",Nt="twclid",Mt="wbraid",Sr={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Sn=1e3,ft=function(t){if(Object.keys(t).length>Sn)return!1;for(var e in t){var r=t[e];if(!wr(e,r))return!1}return!0},wr=function(t,e){var r,n;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var o=x(e),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if(typeof s=="object")i=i&&ft(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(e==null)return!1;if(typeof e=="object")return ft(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0},Ie=(function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return P({},this._properties)},t.prototype.set=function(e,r){return this._safeSet(D.SET,e,r),this},t.prototype.setOnce=function(e,r){return this._safeSet(D.SET_ONCE,e,r),this},t.prototype.append=function(e,r){return this._safeSet(D.APPEND,e,r),this},t.prototype.prepend=function(e,r){return this._safeSet(D.PREPEND,e,r),this},t.prototype.postInsert=function(e,r){return this._safeSet(D.POSTINSERT,e,r),this},t.prototype.preInsert=function(e,r){return this._safeSet(D.PREINSERT,e,r),this},t.prototype.remove=function(e,r){return this._safeSet(D.REMOVE,e,r),this},t.prototype.add=function(e,r){return this._safeSet(D.ADD,e,r),this},t.prototype.unset=function(e){return this._safeSet(D.UNSET,e,At),this},t.prototype.clearAll=function(){return this._properties={},this._properties[D.CLEAR_ALL]=At,this},t.prototype._safeSet=function(e,r,n){if(this._validate(e,r,n)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[r]=n,this._propertySet.add(r),!0}return!1},t.prototype._validate=function(e,r,n){return this._properties[D.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:e===D.ADD?typeof n=="number":e!==D.UNSET&&e!==D.REMOVE?wr(r,n):!0},t})(),D;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(D||(D={}));var wn=[D.CLEAR_ALL,D.UNSET,D.SET,D.SET_ONCE,D.ADD,D.APPEND,D.PREPEND,D.PREINSERT,D.POSTINSERT,D.REMOVE],In="Event tracked successfully",An="Unexpected error occurred",Pn="Event rejected due to exceeded retry count",Cn="Event skipped due to optOut config",kn="Event rejected due to missing API key",Rn="Invalid API key",On="Client not initialized",B;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(B||(B={}));var we=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=B.Unknown),{event:t,code:e,message:r}},U=function(){var t="ampIntegrationContext";if(typeof globalThis<"u"&&typeof globalThis[t]<"u")return globalThis[t];if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},Ln=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Ee)},Ft=W([],N(Array(256).keys()),!1).map(function(t){return t.toString(16).padStart(2,"0")}),Ee=function(t){var e,r=U();if(!(!((e=r?.crypto)===null||e===void 0)&&e.getRandomValues))return Ln(t);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,W([],N(n.entries()),!1).map(function(i){var o=N(i,2),a=o[0],s=o[1];return[4,6,8,10].includes(a)?"-".concat(Ft[s]):Ft[s]}).join("")},xn=(function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this.pluginStatus=new Map,this._optOutListeners=[]}return t.prototype.register=function(e,r){var n,i;return S(this,void 0,void 0,function(){var o;return w(this,function(a){switch(a.label){case 0:return e.name===void 0&&(e.name=Ee(),this.loggerProvider.warn(`Plugin name is undefined.
2      Generating a random UUID for plugin name: `.concat(e.name,`.
3      Set a name for the plugin to prevent it from being added multiple times.`))),o=e.name,this.pluginStatus.has(o)?(this.loggerProvider.warn("Plugin with name ".concat(o," already exists, skipping registration")),[2]):(e.type=(n=e.type)!==null&&n!==void 0?n:"enrichment",this.pluginStatus.set(o,"locked"),[4,(i=e.setup)===null||i===void 0?void 0:i.call(e,r,this.client)]);case 1:return a.sent(),this.pluginStatus.get(o)!=="locked"?[2]:(this.plugins.push(e),this.pluginStatus.set(o,"installed"),[2])}})})},t.prototype.deregister=function(e,r){var n;return S(this,void 0,void 0,function(){var i,o;return w(this,function(a){switch(a.label){case 0:return this.pluginStatus.delete(e),i=this.plugins.findIndex(function(s){return s.name===e}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(e," 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]}})})},t.prototype.reset=function(e){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.pluginStatus.clear(),this.client=e},t.prototype.push=function(e){var r=this;return new Promise(function(n){r.queue.push([e,n]),r.scheduleApply(0)})},t.prototype.scheduleApply=function(e){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)})},e))},t.prototype.apply=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c,f,E,u,l,h,v,f,E,T,b,g,d,p,m,y;return w(this,function(_){switch(_.label){case 0:if(!e)return[2];r=N(e,1),n=r[0],i=N(e,2),o=i[1],this.loggerProvider.log("Timeline.apply: Initial event",n),a=this.plugins.filter(function(A){return A.type==="before"}),_.label=1;case 1:_.trys.push([1,6,7,8]),s=x(a),c=s.next(),_.label=2;case 2:return c.done?[3,5]:(f=c.value,f.execute?[4,f.execute(P({},n))]:[3,4]);case 3:if(E=_.sent(),E===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=E,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),_.label=4;case 4:return c=s.next(),[3,2];case 5:return[3,8];case 6:return u=_.sent(),d={error:u},[3,8];
3case 7:try{c&&!c.done&&(p=s.return)&&p.call(s)}finally{if(d)throw d.error}return[7];case 8:l=this.plugins.filter(function(A){return A.type==="enrichment"||A.type===void 0}),_.label=9;case 9:_.trys.push([9,14,15,16]),h=x(l),v=h.next(),_.label=10;case 10:return v.done?[3,13]:(f=v.value,f.execute?[4,f.execute(P({},n))]:[3,12]);case 11:if(E=_.sent(),E===null)return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),o({event:n,code:0,message:""}),[2];n=E,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),_.label=12;case 12:return v=h.next(),[3,10];case 13:return[3,16];case 14:return T=_.sent(),m={error:T},[3,16];case 15:try{v&&!v.done&&(y=h.return)&&y.call(h)}finally{if(m)throw m.error}return[7];case 16:return b=this.plugins.filter(function(A){return A.type==="destination"}),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),g=b.map(function(A){var C=P({},n);return A.execute(C).catch(function(k){return we(C,0,String(k))})}),Promise.all(g).then(function(A){var C=N(A,1),k=C[0],O=k||we(n,100,"Event not tracked, no destination plugins on the instance");o(O)}),[2]}})})},t.prototype.flush=function(){return S(this,void 0,void 0,function(){var e,r,n,i=this;return w(this,function(o){switch(o.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.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]}})})},t.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},t.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},t.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(r){var n;(n=r.onIdentityChanged)===null||n===void 0||n.call(r,e)})},t.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(r){var n;(n=r.onSessionIdChanged)===null||n===void 0||n.call(r,e)})},t.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(r){var n;(n=r.onOptOutChanged)===null||n===void 0||n.call(r,e)}),this._callOptOutListeners(e)},t.prototype._callOptOutListeners=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c;return w(this,function(u){switch(u.label){case 0:u.trys.push([0,7,8,9]),r=x(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(e)];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&&(c=r.return)&&c.call(r)}finally{if(s)throw s.error}return[7];case 9:return[2]}})})},t.prototype.onReset=function(){this.plugins.forEach(function(e){var r;(r=e.onReset)===null||r===void 0||r.call(e)})},t})(),Dn=function(t,e,r){var n=typeof t=="string"?{event_type:t}:t;return P(P(P({},n),r),e&&{event_properties:e})},Ir=function(t,e){var r=P(P({},e),{event_type:ye.IDENTIFY,user_properties:t.getUserProperties()});return r},Un=function(t,e,r,n){var i,o=P(P({},n),{event_type:ye.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[t]=e,i)});return o},Nn=function(t,e,r){var n,i=new Ie;i.set(t,e);var o=P(P({},r),{event_type:ye.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[t]=e,n)});return o},Mn=function(t,e){return P(P({},e),{event_type:ye.REVENUE,event_properties:t.getEventProperties()})},re=function(t){return{promise:t||Promise.resolve()}},Fn=(function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new xn(this),this.name=e}return t.prototype._init=function(e){return S(this,void 0,void 0,function(){return w(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return r.sent(),this.isReady=!0,[2]}})})},t.prototype.runQueuedFunctions=function(e){return S(this,void 0,void 0,function(){var r,n,i,o,a,s,c,u;return w(this,function(l){switch(l.label){case 0:r=this[e],this[e]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),n=x(r),i=n.next(),l.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 l.sent(),[3,6];case 4:return[4,a];case 5:l.sent(),l.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return s=l.sent(),c={error:s},[3,10];case 9:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(c)throw c.error}
3return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}})})},t.prototype.track=function(e,r,n){var i=Dn(e,r,n);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),re(this.dispatch(i))},t.prototype.identify=function(e,r){var n=Ir(e,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),re(this.dispatch(n))},t.prototype.groupIdentify=function(e,r,n,i){var o=Un(e,r,n,i);return re(this.dispatch(o))},t.prototype.setGroup=function(e,r,n){var i=Nn(e,r,n);return this.userProperties=this.getOperationAppliedUserProperties(i.user_properties),re(this.dispatch(i))},t.prototype.revenue=function(e,r){var n=Mn(e,r);return re(this.dispatch(n))},t.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),re())},t.prototype._addPlugin=function(e){return re(this.timeline.register(e,this.config))},t.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),re())},t.prototype._removePlugin=function(e){return re(this.timeline.deregister(e,this.config))},t.prototype.dispatchWithCallback=function(e,r){if(!this.isReady)return r(we(e,0,On));this.process(e).then(r)},t.prototype.dispatch=function(e){return S(this,void 0,void 0,function(){var r=this;return w(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,e,i))})]})})},t.prototype.getOperationAppliedUserProperties=function(e){var r,n=(r=this.userProperties)!==null&&r!==void 0?r:{},i=P({},n);if(e===void 0)return i;var o={};return Object.keys(e).forEach(function(a){Object.values(he).includes(a)||(o[a]=e[a])}),wn.forEach(function(a){if(Object.keys(e).includes(a)){var s=e[a];
3switch(a){case he.CLEAR_ALL:Object.keys(i).forEach(function(c){delete i[c]});break;case he.UNSET:Object.keys(s).forEach(function(c){delete i[c]});break;case he.SET:Object.assign(i,s);break}}}),Object.assign(i,o),i},t.prototype.process=function(e){return S(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,we(e,0,Cn)]:(e.event_type===ye.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);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=we(e,0,n),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!e));return}this._setOptOut(e)},t.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},t.prototype.flush=function(){return re(this.timeline.flush())},t.prototype.plugin=function(e){var r=this.timeline.plugins.find(function(n){return n.name===e});if(r===void 0){this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e));return}return r},t.prototype.plugins=function(e){return this.timeline.plugins.filter(function(r){return r instanceof e})},t})(),Ar=(function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setReceipt=function(e){return this.receipt=e,this},t.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},t.prototype.setEventProperties=function(e){try{var r=JSON.parse(JSON.stringify(e));ft(r)&&(this.properties=r)}catch{}return this},t.prototype.getEventProperties=function(){var e=this.properties?P({},this.properties):{};return e[ue.REVENUE_PRODUCT_ID]=this.productId,e[ue.REVENUE_QUANTITY]=this.quantity,e[ue.REVENUE_PRICE]=this.price,e[ue.REVENUE_TYPE]=this.revenueType,e[ue.REVENUE_CURRENCY]=this.currency,e[ue.REVENUE]=this.revenue,e[ue.RECEIPT]=this.receipt,e[ue.RECEIPT_SIG]=this.receiptSig,e},t})(),ue;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue",t.RECEIPT="$receipt",t.RECEIPT_SIG="$receiptSig"})(ue||(ue={}));var Vn=function(t,e){var r=Math.max(e,1);return t.reduce(function(n,i,o){var a=Math.floor(o/r);return n[a]||(n[a]=[]),n[a].push(i),n},[])},ne;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(ne||(ne={}));var Ue="Amplitude Logger ",Pr=(function(){function t(){this.logLevel=ne.None}return t.prototype.disable=function(){this.logLevel=ne.None},t.prototype.enable=function(e){e===void 0&&(e=ne.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<ne.Verbose||console.log("".concat(Ue,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<ne.Warn||console.warn("".concat(Ue,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<ne.Error||console.error("".concat(Ue,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<ne.Debug||console.log("".concat(Ue,"[Debug]: ").concat(e.join(" ")))},t})(),Fe=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Er,logLevel:ne.Warn,loggerProvider:new Pr,offline:!1,optOut:!1,serverUrl:bt,serverZone:"US",useBatch:!1}},qn=(function(){function t(e){var r,n,i,o;this._optOut=!1;var a=Fe();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:a.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||a.flushQueueSize,this.instanceName=e.instanceName||a.instanceName,this.loggerProvider=e.loggerProvider||a.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:a.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=e.offline!==void 0?e.offline:a.offline,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:a.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||a.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:a.useBatch,this.loggerProvider.enable(this.logLevel);var s=Cr(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
3,enumerable:!1,configurable:!0}),t})(),Gn=function(t,e){return t==="EU"?e?Tr:br:e?_r:bt},Cr=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=Fe().serverZone),r===void 0&&(r=Fe().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:Fe().serverZone;return{serverZone:n,serverUrl:Gn(n,r)}},kr=(function(){function t(){this.sdk={metrics:{histogram:{}}}}return t.prototype.recordHistogram=function(e,r){this.sdk.metrics.histogram[e]=r},t})();function vt(t){return t>=200&&t<300}var Ve=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(`
4`).slice(2+t).map(function(r){return r.trim()})},V=function(t){return function(){var e=P({},t.config),r=e.loggerProvider,n=e.logLevel;return{logger:r,logLevel:n}}},Bn=function(t,e){var r,n;e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,"");try{for(var i=x(e.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(a in t)t=t[a];else return}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},q=function(t,e){return function(){var r,n,i={};try{for(var o=x(e),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=Bn(t,s)}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},G=function(t,e,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=r(),c=s.logger,u=s.logLevel;if(u&&u<ne.Debug||!u||!c)return t.apply(i,o);var l={type:"invoke public method",name:e,args:o,stacktrace:Ve(1),time:{start:new Date().toISOString()},states:{}};n&&l.states&&(l.states.before=n());var h=t.apply(i,o);return h&&h.promise?h.promise.then(function(){n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=new Date().toISOString()),c.debug(JSON.stringify(l,null,2))}):(n&&l.states&&(l.states.after=n()),l.time&&(l.time.end=new Date().toISOString()),c.debug(JSON.stringify(l,null,2))),h}},jn=new Set([bt,br,_r,Tr]),Hn=function(t,e){return e===void 0&&(e=!1),jn.has(t)?!0:e};function $n(t){return t instanceof Error?t.message:String(t)}function Ce(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body,null,2))}catch{}return e}var Kn=(function(){function t(e){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=e?.diagnosticsClient}return t.prototype.setup=function(e){var r;return S(this,void 0,void 0,function(){var n,i=this;return w(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(gn,"_").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)]}})})},t.prototype.execute=function(e){var r=this;return e.insert_id||(e.insert_id=Ee()),new Promise(function(n){var i={event:e,attempts:0,callback:function(o){return n(o)},timeout:0};r.queue.push(i),r.schedule(r.config.flushIntervalMillis),r.saveEvents()})},t.prototype.removeEventsExceedFlushMaxRetries=function(e){var r=this;return e.filter(function(n){return n.attempts+=1,n.attempts<r.config.flushMaxRetries?!0:(r.fulfillRequest([n],500,Pn),!1)})},t.prototype.scheduleEvents=function(e){var r=this;e.forEach(function(n){r.schedule(n.timeout===0?r.config.flushIntervalMillis:n.timeout)})},t.prototype.schedule=function(e){var r=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){r.queue=r.queue.map(function(n){return n.timeout=0,n}),r.flush(!0)},e);return}},t.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},t.prototype.flush=function(e){return e===void 0&&(e=!1),S(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=Vn(r,this.config.flushQueueSize),[4,i.reduce(function(s,c){return S(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(c,e)];case 2:return[2,u.sent()]}})})},Promise.resolve())]);case 1:return a.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},t.prototype.send=function(e,r){var n;return r===void 0&&(r=!0),S(this,void 0,void 0,function(){var i,o,a,s,c,u;return w(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,kn)];i={api_key:this.config.apiKey,events:e.map(function(h){var v=h.event;v.extra;var f=dt(v,["extra"]);return f}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new kr,l.label=1;case 1:return l.trys.push([1,3,,4]),o=Cr(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,a=Hn(o,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(o,i,a)];case 2:return s=l.sent(),s===null?(this.fulfillRequest(e,0,An),[2]):r?(this.handleResponse(s,e),[3,4]):("body"in s?this.fulfillRequest(e,s.statusCode,"".concat(s.status,": ").concat(Ce(s))):this.fulfillRequest(e,s.statusCode,s.status),[2]);case 3:return c=l.sent(),u=$n(c),this.config.loggerProvider.error(u),(n=this.diagnosticsClient)===null||n===void 0||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map(function(h){return h.event.event_type}),message:u,stack_trace:Ve()}),this.handleResponse({status:B.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,r){var n;vt(e.statusCode)||(n=this.diagnosticsClient)===null||n===void 0||n.recordEvent("analytics.events.unsuccessful",{events:r.map(function(o){return o.event.event_type}),code:e.statusCode,status:e.status,body:Ce(e),stack_trace:Ve()});var i=e.status;switch(i){case B.Success:{this.handleSuccessResponse(e,r);break}case B.Invalid:{this.handleInvalidResponse(e,r);break}case B.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,r);break}case B.RateLimit:{this.handleRateLimitResponse(e,r);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(i,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},t.prototype.handleSuccessResponse=function(e,r){this.fulfillRequest(r,e.statusCode,In)},t.prototype.handleInvalidResponse=function(e,r){var n=this;if(e.body.missingField||e.body.error.startsWith(Rn)){this.fulfillRequest(r,e.statusCode,e.body.error);return}var i=W(W(W(W([],N(Object.values(e.body.eventsWithInvalidFields)),!1),N(Object.values(e.body.eventsWithMissingFields)),!1),N(Object.values(e.body.eventsWithInvalidIdLengths)),!1),N(e.body.silencedEvents),!1).flat(),o=new Set(i),a=r.filter(function(c,u){if(o.has(u)){n.fulfillRequest([c],e.statusCode,e.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(Ce(e));
4var s=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(s)},t.prototype.handlePayloadTooLargeResponse=function(e,r){if(r.length===1){this.fulfillRequest(r,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(Ce(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},t.prototype.handleRateLimitResponse=function(e,r){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),a=e.body.throttledEvents,s=new Set(i),c=new Set(o),u=new Set(a),l=r.filter(function(v,f){if(v.event.user_id&&s.has(v.event.user_id)||v.event.device_id&&c.has(v.event.device_id)){n.fulfillRequest([v],e.statusCode,e.body.error);return}return u.has(f)&&(v.timeout=n.throttleTimeout),!0});l.length>0&&this.config.loggerProvider.warn(Ce(e));var h=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(h)},t.prototype.handleOtherResponse=function(e){var r=this,n=e.map(function(o){return o.timeout=o.attempts*r.retryTimeout,o}),i=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(i)},t.prototype.fulfillRequest=function(e,r,n){var i,o,a;vt(r)?(a=this.diagnosticsClient)===null||a===void 0||a.increment("analytics.events.sent",e.length):((i=this.diagnosticsClient)===null||i===void 0||i.increment("analytics.events.dropped",e.length),(o=this.diagnosticsClient)===null||o===void 0||o.recordEvent("analytics.events.dropped",{events:e.map(function(s){return s.event.event_type}),code:r,message:n,stack_trace:Ve()})),this.removeEvents(e),e.forEach(function(s){return s.callback(we(s.event,r,n))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(r){return r.event});this.config.storageProvider.set(this.storageKey,e)}},t.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(r){return!e.some(function(n){return n.event.insert_id===r.event.insert_id})}),this.saveEvents()},t})(),Wn=(function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Xn(),platform:"Web",os:void 0,deviceModel:void 0}},t})(),Xn=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},zn=(function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(r){e(r)}),this.queue=[])},t})(),ge=function(){return ge=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ge.apply(this,arguments)};function qe(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}var Ge=function(t,e){var r,n,i=["string","number","boolean","undefined"],o=typeof t,a=typeof e;if(o!==a)return!1;try{for(var s=qe(i),c=s.next();!c.done;c=s.next()){var u=c.value;if(u===o)return t===e}}catch(b){r={error:b}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;var l=Array.isArray(t),h=Array.isArray(e);if(l!==h)return!1;if(l&&h){for(var v=0;v<t.length;v++)if(!Ge(t[v],e[v]))return!1}else{var f=Object.keys(t).sort(),E=Object.keys(e).sort();if(!Ge(f,E))return!1;var T=!0;return Object.keys(t).forEach(function(b){Ge(t[b],e[b])||(T=!1)}),T}return!0},Yn="$set",Qn="$unset",Jn="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n});var Zn=(function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,r=ge({},this.identity.userProperties),n=ge(ge({},this.identity),{userProperties:r});return{setUserId:function(i){return n.userId=i,this},setDeviceId:function(i){return n.deviceId=i,this},setUserProperties:function(i){return n.userProperties=i,this},setOptOut:function(i){return n.optOut=i,this},updateUserProperties:function(i){var o,a,s,c,u,l,h=n.userProperties||{};try{for(var v=qe(Object.entries(i)),f=v.next();!f.done;f=v.next()){var E=Vt(f.value,2),T=E[0],b=E[1];switch(T){case Yn:try{for(var g=(s=void 0,qe(Object.entries(b))),d=g.next();!d.done;d=g.next()){var p=Vt(d.value,2),m=p[0],y=p[1];h[m]=y}}catch(C){s={error:C}}finally{try{d&&!d.done&&(c=g.return)&&c.call(g)}finally{if(s)throw s.error}}break;case Qn:try{for(var _=(u=void 0,qe(Object.keys(b))),A=_.next();!A.done;A=_.next()){var m=A.value;delete h[m]}}catch(C){u={error:C}}finally{try{A&&!A.done&&(l=_.return)&&l.call(_)}finally{if(u)throw u.error}}break;case Jn:h={};break}}}catch(C){o={error:C}}finally{try{f&&!f.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}return n.userProperties=h,this},commit:function(){return e.setIdentity(n),this}}},t.prototype.getIdentity=function(){return ge({},this.identity)},t.prototype.setIdentity=function(e){var r=ge({},this.identity);this.identity=ge({}
4,e),Ge(r,this.identity)||this.listeners.forEach(function(n){n(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t})(),ke=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,ei=(function(){function t(){this.identityStore=new Zn,this.eventBridge=new zn,this.applicationContextProvider=new Wn}return t.getInstance=function(e){return ke.analyticsConnectorInstances||(ke.analyticsConnectorInstances={}),ke.analyticsConnectorInstances[e]||(ke.analyticsConnectorInstances[e]=new t),ke.analyticsConnectorInstances[e]},t})(),Le=function(t){return t===void 0&&(t=Er),ei.getInstance(t)},ti=function(t,e){Le(e).identityStore.editIdentity().setUserId(t).commit()},ri=function(t,e){Le(e).identityStore.editIdentity().setDeviceId(t).commit()},ni=(function(){function t(){this.name="identity",this.type="before",this.identityStore=Le().identityStore}return t.prototype.execute=function(e){return S(this,void 0,void 0,function(){var r;return w(this,function(n){return r=e.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,e]})})},t.prototype.setup=function(e){return S(this,void 0,void 0,function(){return w(this,function(r){return e.instanceName&&(this.identityStore=Le(e.instanceName).identityStore),[2]})})},t})(),Rr=function(t,e){e===void 0&&(e=Date.now());var r=Date.now(),n=r-e;return n>t},Or=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[We,e,t.substring(0,r)].filter(Boolean).join("_")},ii=function(t){return"".concat(We.toLowerCase(),"_").concat(t.substring(0,6))},oi=function(){var t,e,r,n;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(n=(r=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""},Ae=function(){var t,e=U();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var r=e.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var a=o.split("=",2),s=qt(a[0]),c=qt(a[1]);return c&&(i[s]=c),i},{});return n},qt=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}},Gt=function(t,e){return!e||!e.length?!0:e.some(function(r){return typeof r=="string"?t===r:t.match(r)})},Lr=function(t,e){var r=t;try{r=decodeURI(t)}catch{}return r},ai=function(t){var e={};for(var r in t){var n=t[r];n&&(e[r]=n)}return e},_t=(function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return S(this,void 0,void 0,function(){return w(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return S(this,void 0,void 0,function(){return w(this,function(r){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return S(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},t.prototype.set=function(e,r){return S(this,void 0,void 0,function(){return w(this,function(n){return this.memoryStorage.set(e,r),[2]})})},t.prototype.remove=function(e){return S(this,void 0,void 0,function(){return w(this,function(r){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return S(this,void 0,void 0,function(){return w(this,function(e){return this.memoryStorage.clear(),[2]})})},t})(),si=function(){var t,e=U();return(t=e?.navigator)===null||t===void 0?void 0:t.locks},ht=(function(){function t(e,r){r===void 0&&(r={}),this.options=P({},e),this.config=r}return t.prototype.isEnabled=function(){return S(this,void 0,void 0,function(){var e,r,n,i,o=this;return w(this,function(a){switch(a.label){case 0:return e="AMP_TEST",r=P({},this.options),n=new t(r),i=String(Date.now()),[4,n.transaction(e,function(s){var c,u;try{s.set(i);var l=s.get(),h=l===i;return!h&&o.config.diagnosticsClient&&((c=o.config.diagnosticsClient)===null||c===void 0||c.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:e,testValue:i,sync:!0})),h}catch(f){if(o.config.diagnosticsClient){var v=f instanceof Error?f.message:String(f);(u=o.config.diagnosticsClient)===null||u===void 0||u.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:e,testValue:i,error:v,sync:!0})}return!1}finally{s.set(null)}})];case 1:return[2,a.sent()]}})})},t.prototype.get=function(e){return S(this,void 0,void 0,function(){var r;return w(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:return r=n.sent(),[2,this.decodeCookieValue(e,r)]}})})},t.prototype.decodeCookieValue=function(e,r){if(r)try{var n=li(r);if(n===void 0){console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r));return}return JSON.parse(n)}catch{console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r));return}},t.prototype.getSync=function(e){var r=this.getRawSync(e);return this.decodeCookieValue(e,r)},t.prototype.getRaw=function(e){var r,n;return S(this,void 0,void 0,function(){var i,o,a,s,c,u,l,h,v;return w(this,function(f){switch(f.label){case 0:i=U(),o=i,f.label=1;
4case 1:return f.trys.push([1,4,,5]),a=o?.cookieStore,a?[4,a.getAll(e)]:[3,3];case 2:if(s=f.sent(),s){s.length>1&&((r=this.config.diagnosticsClient)===null||r===void 0||r.recordEvent("cookies.duplicate",{cookies:s.map(function(E){return E.domain})}),(n=this.config.diagnosticsClient)===null||n===void 0||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=x(s),u=c.next();!u.done;u=c.next())if(l=u.value,di(l.domain,this.options.domain))return[2,l.value]}catch(E){h={error:E}}finally{try{u&&!u.done&&(v=c.return)&&v.call(c)}finally{if(h)throw h.error}}}f.label=3;case 3:return[3,5];case 4:return f.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}})})},t.prototype.getRawSync=function(e){var r=this,n,i,o=U(),a=((i=(n=o?.document)===null||n===void 0?void 0:n.cookie.split("; "))!==null&&i!==void 0?i:[]).filter(function(u){return u.indexOf(e+"=")===0}),s=void 0,c=this.config.duplicateResolverFn;if(typeof c=="function"&&a.length>1&&(s=a.find(function(u){var l;try{var h=c(u.substring(e.length+1));return h||(l=r.config.diagnosticsClient)===null||l===void 0||l.increment("cookies.duplicate.occurrence.document.cookie"),h}catch{return!1}})),s||(s=a[0]),!!s)return s.substring(e.length+1)},t.prototype.set=function(e,r){return S(this,void 0,void 0,function(){return w(this,function(n){return this.setSync(e,r),[2]})})},t.prototype.setSync=function(e,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 c="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(r))));a&&(c+="; expires=".concat(a.toUTCString())),c+="; path=/",this.options.domain&&(c+="; domain=".concat(this.options.domain)),this.options.secure&&(c+="; Secure"),this.options.sameSite&&(c+="; SameSite=".concat(this.options.sameSite));var u=U();u?.document&&(u.document.cookie=c)}catch(h){var l=h instanceof Error?h.message:String(h);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(l))}},t.prototype.remove=function(e){return S(this,void 0,void 0,function(){return w(this,function(r){switch(r.label){case 0:return[4,this.set(e,null)];case 1:return r.sent(),[2]}})})},t.prototype.reset=function(){return S(this,void 0,void 0,function(){return w(this,function(e){return[2]})})},t.isDomainWritable=function(e){return S(this,void 0,void 0,function(){var r,n,i,o;return w(this,function(a){switch(a.label){case 0:if(t.cachedTlds[e])return[2,!0];r={domain:"."+e},n="AMP_TLDTEST",i=new t(r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i.transaction(n,function(s){if(t.cachedTlds[e])return!0;try{s.set(1);var c=!!s.get();return c&&(t.cachedTlds[e]=!0),c}finally{s.set(null)}})];case 2:return o=a.sent(),[2,!!o];case 3:return a.sent(),[2,!1];case 4:return[2]}})})},t.prototype.transaction=function(e,r){return S(this,void 0,void 0,function(){var n,i,o=this;return w(this,function(a){switch(a.label){case 0:if(n=si(),i=function(){var s={get:function(){return o.getSync(e)},set:function(c){return o.setSync(e,c)}};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(e),i)];case 2:return[2,a.sent()];case 3:return a.sent(),[2,i()];case 4:return[2]}})})},t.cachedTlds={},t})(),ui=function(t){try{return decodeURIComponent(atob(t))}catch{return}},ci=function(t){try{return decodeURIComponent(atob(decodeURIComponent(t)))}catch{return}},li=function(t){var e;return(e=ui(t))!==null&&e!==void 0?e:ci(t)},di=function(t,e){if(t===""&&e==="")return!0;if(!t||!e)return!1;var r=t.startsWith(".")?t.substring(1):t,n=e.startsWith(".")?e.substring(1):e;return r.toLowerCase()===n.toLowerCase()},fi=function(t,e,r){return r===void 0&&(r=10),[We,e,t.substring(0,r)].filter(Boolean).join("_")},vi=(function(){function t(e){this.storage=e}return t.prototype.isEnabled=function(){return S(this,void 0,void 0,function(){var e,r,n,i;return w(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];e=String(Date.now()),r=new t(this.storage),n="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(n,e)];case 2:return o.sent(),[4,r.get(n)];case 3:return i=o.sent(),[2,i===e];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return o.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return S(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(e)];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]}})})},t.prototype.getRaw=function(e){var r;return S(this,void 0,void 0,function(){return w(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(e))||void 0]})})},t.prototype.set=function(e,r){var n;return S(this,void 0,void 0,function(){return w(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(e,JSON.stringify(r))}catch{}return[2]})})},t.prototype.remove=function(e){var r;return S(this,void 0,void 0,function(){return w(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return S(this,void 0,void 0,function(){return w(this,function(r){try{(e=this.storage)===null||e===void 0||e.clear()}catch{}return[2]})})},t})(),Xe=(function(){function t(){}return t.prototype.send=function(e,r,n){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var r,n,i,o,a,s,c,u,l,h,v,f,E,T,b,g,d,p,m,y,_,A;if(typeof e!="object")return null;var C=e.code||0,k=this.buildStatus(C);switch(k){case B.Success:return{status:k,statusCode:C,body:{eventsIngested:(r=e.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=e.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case B.Invalid:return{status:k,statusCode:C,body:{error:(o=e.error)!==null&&o!==void 0?o:"",missingField:(a=e.missing_field)!==null&&a!==void 0?a:"",eventsWithInvalidFields:(s=e.events_with_invali
4d_fields)!==null&&s!==void 0?s:{},eventsWithMissingFields:(c=e.events_with_missing_fields)!==null&&c!==void 0?c:{},eventsWithInvalidIdLengths:(u=e.events_with_invalid_id_lengths)!==null&&u!==void 0?u:{},epsThreshold:(l=e.eps_threshold)!==null&&l!==void 0?l:0,exceededDailyQuotaDevices:(h=e.exceeded_daily_quota_devices)!==null&&h!==void 0?h:{},silencedDevices:(v=e.silenced_devices)!==null&&v!==void 0?v:[],silencedEvents:(f=e.silenced_events)!==null&&f!==void 0?f:[],throttledDevices:(E=e.throttled_devices)!==null&&E!==void 0?E:{},throttledEvents:(T=e.throttled_events)!==null&&T!==void 0?T:[]}};case B.PayloadTooLarge:return{status:k,statusCode:C,body:{error:(b=e.error)!==null&&b!==void 0?b:""}};case B.RateLimit:return{status:k,statusCode:C,body:{error:(g=e.error)!==null&&g!==void 0?g:"",epsThreshold:(d=e.eps_threshold)!==null&&d!==void 0?d:0,throttledDevices:(p=e.throttled_devices)!==null&&p!==void 0?p:{},throttledUsers:(m=e.throttled_users)!==null&&m!==void 0?m:{},exceededDailyQuotaDevices:(y=e.exceeded_daily_quota_devices)!==null&&y!==void 0?y:{},exceededDailyQuotaUsers:(_=e.exceeded_daily_quota_users)!==null&&_!==void 0?_:{},throttledEvents:(A=e.throttled_events)!==null&&A!==void 0?A:[]}};case B.Timeout:default:return{status:k,statusCode:C}}},t.prototype.buildStatus=function(e){return vt(e)?B.Success:e===429?B.RateLimit:e===413?B.PayloadTooLarge:e===408?B.Timeout:e>=400&&e<500?B.Invalid:e>=500?B.Failed:B.Unknown},t})(),hi=(function(t){be(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.customHeaders=r,n}return e.prototype.send=function(r,n){return S(this,void 0,void 0,function(){var i,o,a;return w(this,function(s){switch(s.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:P({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(n),method:"POST"},[4,fetch(r,i)];case 1:return o=s.sent(),[4,o.text()];case 2:a=s.sent();try{return[2,this.buildResponse(JSON.parse(a))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},e})(Xe),xr=null,Dr=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],Ur="data-amp-track-",Nr=["div","span","h1","h2","h3","h4","h5","h6"],Mr=150,pi=(function(){function t(){}return t.prototype.parse=function(){return S(this,void 0,void 0,function(){return w(this,function(e){return[2,P(P(P(P({},Sr),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Ae(),r=e[mn],n=e[yn],i=e[En],o=e[bn],a=e[_n],s=e[Tn];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:s}},t.prototype.getReferrer=function(){var e,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(e=n.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},t.prototype.getClickIds=function(){var e,r=Ae();return e={},e[Pt]=r[Pt],e[Ct]=r[Ct],e[kt]=r[kt],e[Rt]=r[Rt],e[Ot]=r[Ot],e[Lt]=r[Lt],e[xt]=r[xt],e[Dt]=r[Dt],e[Ut]=r[Ut],e[Nt]=r[Nt],e[Mt]=r[Mt],e},t})(),Se="data-amp-mask",me="*****",gi=/\b(?:\d[ -]*?){13,16}\b/,mi=/(\d{3}-?\d{2}-?\d{4})/g,yi=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Fr=function(t,e){var r,n;if(e===void 0&&(e=[]),typeof t!="string")return"";var i=t;i=i.replace(gi,me),i=i.replace(mi,me),i=i.replace(yi,me);try{for(var o=x(e),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,me)}catch{}}}catch(c){r={error:c}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},Vr=function(t){if(typeof document>"u"||!document.title)return"";var e=document.querySelector("title");return e&&e.hasAttribute(Se)?me:t?t(document.title):document.title},Re={},Bt;function Ei(){if(Bt)return Re;Bt=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.Observable=void 0;const t=g=>!!Symbol[g],e=g=>t(g)?Symbol[g]:"@@"+g,r=e("iterator"),n=e("observable"),i=e("species");function o(g,d){let p=g[d];if(p!=null){if(typeof p!="function")throw new TypeError(p+" is not a function");return p}}function a(g){let d=g.constructor;return d!==void 0&&(d=d[i],d===null&&(d=void 0)),d!==void 0?d:b}function s(g){return g instanceof b}function c(g){c.log?c.log(g):setTimeout(()=>{throw g})}function u(g){Promise.resolve().then(()=>{try{g()}catch(d){c(d)}})}function l(g){let d=g._cleanup;
4if(d!==void 0&&(g._cleanup=void 0,!!d))try{if(typeof d=="function")d();else{let p=o(d,"unsubscribe");p&&p.call(d)}}catch(p){c(p)}}function h(g){g._observer=void 0,g._queue=void 0,g._state="closed"}function v(g){let d=g._queue;if(d){g._queue=void 0,g._state="ready";for(let p=0;p<d.length&&(f(g,d[p].type,d[p].value),g._state!=="closed");++p);}}function f(g,d,p){g._state="running";let m=g._observer;try{let y=o(m,d);switch(d){case"next":y&&y.call(m,p);break;case"error":if(h(g),y)y.call(m,p);else throw p;break;case"complete":h(g),y&&y.call(m);break}}catch(y){c(y)}g._state==="closed"?l(g):g._state==="running"&&(g._state="ready")}function E(g,d,p){if(g._state!=="closed"){if(g._state==="buffering"){g._queue.push({type:d,value:p});return}if(g._state!=="ready"){g._state="buffering",g._queue=[{type:d,value:p}],u(()=>v(g));return}f(g,d,p)}}class T{constructor(d,p){this._cleanup=void 0,this._observer=d,this._queue=void 0,this._state="initializing";let m=this,y={get closed(){return m._state==="closed"},next(_){E(m,"next",_)},error(_){E(m,"error",_)},complete(){E(m,"complete")}};try{this._cleanup=p.call(void 0,y)}catch(_){y.error(_)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(h(this),l(this))}}class b{constructor(d){if(!(this instanceof b))throw new TypeError("Observable cannot be called as a function");if(typeof d!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=d}subscribe(d){return(typeof d!="object"||d===null)&&(d={next:d,error:arguments[1],complete:arguments[2]}),new T(d,this._subscriber)}forEach(d){return new Promise((p,m)=>{if(typeof d!="function"){m(new TypeError(d+" is not a function"));return}function y(){_.unsubscribe(),p()}let _=this.subscribe({next(A){try{d(A,y)}catch(C){m(C),_.unsubscribe()}},error:m,complete:p})})}map(d){if(typeof d!="function")throw new TypeError(d+" is not a function");let p=a(this);return new p(m=>this.subscribe({next(y){try{y=d(y)}catch(_){return m.error(_)}m.next(y)},error(y){m.error(y)},complete(){m.complete()}}))}filter(d){if(typeof d!="function")throw new TypeError(d+" is not a function");let p=a(this);return new p(m=>this.subscribe({next(y){try{if(!d(y))return}catch(_){return m.error(_)}m.next(y)},error(y){m.error(y)},complete(){m.complete()}}))}reduce(d){if(typeof d!="function")throw new TypeError(d+" is not a function");let p=a(this),m=arguments.length>1,y=!1,A=arguments[1];return new p(C=>this.subscribe({next(k){let O=!y;if(y=!0,!O||m)try{A=d(A,k)}catch(L){return C.error(L)}else A=k},error(k){C.error(k)},complete(){if(!y&&!m)return C.error(new TypeError("Cannot reduce an empty sequence"));C.next(A),C.complete()}}))}async all(){let d=[];return await this.forEach(p=>d.push(p)),d}concat(...d){let p=a(this);return new p(m=>{let y,_=0;function A(C){y=C.subscribe({next(k){m.next(k)},error(k){m.error(k)},complete(){_===d.length?(y=void 0,m.complete()):A(p.from(d[_++]))}})}return A(this),()=>{y&&(y.unsubscribe(),y=void 0)}})}flatMap(d){if(typeof d!="function")throw new TypeError(d+" is not a function");let p=a(this);return new p(m=>{let y=[],_=this.subscribe({next(C){if(d)try{C=d(C)}catch(O){return m.error(O)}let k=p.from(C).subscribe({next(O){m.next(O)},error(O){m.error(O)},complete(){let O=y.indexOf(k);O>=0&&y.splice(O,1),A()}});y.push(k)},error(C){m.error(C)},complete(){A()}});function A(){_.closed&&y.length===0&&m.complete()}return()=>{y.forEach(C=>C.unsubscribe()),_.unsubscribe()}})}[n](){return this}static from(d){let p=typeof this=="function"?this:b;if(d==null)throw new TypeError(d+" is not an object");let m=o(d,n);if(m){let y=m.call(d);if(Object(y)!==y)throw new TypeError(y+" is not an object");return s(y)&&y.constructor===p?y:new p(_=>y.subscribe(_))}if(t("iterator")&&(m=o(d,r),m))return new p(y=>{u(()=>{if(!y.closed){for(let _ of m.call(d))if(y.next(_),y.closed)return;y.complete()}})});if(Array.isArray(d))return new p(y=>{u(()=>{if(!y.closed){for(let _=0;_<d.length;++_)if(y.next(d[_]),y.closed)return;y.complete()}})});throw new TypeError(d+" is not observable")}static of(...d){let p=typeof this=="function"?this:b;return new p(m=>{u(()=>{if(!m.closed){for(let y=0;y<d.length;++y)if(m.next(d[y]),m.closed)return;m.complete()}})})}static get[i](){return this}}return Re.Observable=b,Object.defineProperty(b,Symbol("extensions"),{value:{symbol:n,hostReportError:c},configurable:!0}),Re}var rt,jt;function bi(){return jt||(jt=1,rt=Ei().Observable),rt}var _i=bi();const pe=pn(_i);function Ti(t,e){return new pe(function(r){t.subscribe({next:function(n){e(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 Ht(t,e){return new pe(function(r){var n=!1,i=new Set,o=function(){var s,c;n=!0;try{for(var u=x(i),l=u.next();!l.done;l=u.next()){var h=l.value;try{h.unsubscribe()}catch{}}}catch(v){s={error:v}}finally{try{l&&!l.done&&(c=u.return)&&c.call(u)}finally{if(s)throw s.error}}i.clear()},a=function(s){var c=s.subscribe({next:function(u){n||r.next(u)},error:function(u){n||(n=!0,r.error(u),o())},complete:function(){i.delete(c),!n&&i.size===0&&(r.complete(),o(),n=!0)}});i.add(c)};return a(t),a(e),o})}function Ne(t){var e=new Set,r=null;function n(){r?.unsubscribe(),r=null,e.clear()}return new pe(function(i){return e.add(i),r===null&&(r=t.subscribe({next:function(o){var a,s,c;try{for(var u=x(e),l=u.next();!l.done;l=u.next()){var h=l.value;
4(c=h.next)===null||c===void 0||c.call(h,o)}}catch(v){a={error:v}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}},error:function(o){var a,s,c;try{for(var u=x(e),l=u.next();!l.done;l=u.next()){var h=l.value;(c=h.error)===null||c===void 0||c.call(h,o)}}catch(v){a={error:v}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}n()},complete:function(){var o,a,s;try{for(var c=x(e),u=c.next();!u.done;u=c.next()){var l=u.value;(s=l.complete)===null||s===void 0||s.call(l)}}catch(h){o={error:h}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}n()}})),function(){e.delete(i),e.size===0&&r&&(r.unsubscribe(),r=null)}})}var pt="https://app.amplitude.com",Si="https://app.eu.amplitude.com",wi="https://apps.stag2.amplitude.com",Ii={US:pt,EU:Si,STAGING:wi},Ai="https://cdn.amplitude.com/libs/background-capture-1.0.1.js.gz",Pi=function(t){var e=document.querySelector('script[src="'.concat(CSS.escape(t),'"]'));return e?Promise.resolve({status:!0}):new Promise(function(r,n){var i;try{var o=document.createElement("script");o.type="text/javascript",o.async=!0,o.src=t,o.addEventListener("load",function(){r({status:!0})},{once:!0}),o.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(t)})}),(i=document.head)===null||i===void 0||i.appendChild(o)}catch(a){n(a)}})};function Ci(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var qr,gt="__AMPLITUDE_MESSENGER_INSTANCE__",je="__AMPLITUDE_MESSENGER__",ki=(function(){function t(e){var r=e===void 0?{}:e,n=r.origin,i=n===void 0?pt:n;this[qr]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=i}return t.prototype.notify=function(e){var r,n,i,o;(n=(r=this.logger)===null||r===void 0?void 0:r.debug)===null||n===void 0||n.call(r,"Message sent: ",JSON.stringify(e)),(o=(i=window.opener)===null||i===void 0?void 0:i.postMessage)===null||o===void 0||o.call(i,e,this.endpoint)},t.prototype.sendRequest=function(e,r,n){var i=this;n===void 0&&(n={timeout:15e3});var o=Ci(),a={id:o,action:e,args:r},s=new Promise(function(c,u){i.requestCallbacks[o]={resolve:c,reject:u},i.notify(a),n.timeout>0&&setTimeout(function(){u(new Error("".concat(e," timed out (id: ").concat(o,")"))),delete i.requestCallbacks[o]},n.timeout)});return s},t.prototype.handleResponse=function(e){var r;if(!this.requestCallbacks[e.id]){(r=this.logger)===null||r===void 0||r.warn("No callback found for request id: ".concat(e.id));return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},t.prototype.registerActionHandler=function(e,r){var n,i,o,a;this.actionHandlers.has(e)&&((a=(o=this.logger)===null||o===void 0?void 0:o.warn)===null||a===void 0||a.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,r);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var c=x(s),u=c.next();!u.done;u=c.next()){var l=u.value;r(l)}}catch(h){n={error:h}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}},t.prototype.loadScriptOnce=function(e){return S(this,void 0,void 0,function(){var r,n,i;return w(this,function(o){switch(o.label){case 0:if(r=this.scriptLoadPromises.get(e),r)return[2,r];n=Pi(e).then(function(){}),this.scriptLoadPromises.set(e,n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),this.scriptLoadPromises.delete(e),i;case 4:return[2]}})})},t.prototype.setup=function(e){var r=this,n,i,o=e===void 0?{}:e,a=o.logger,s=o.endpoint;a&&(this.logger=a),s&&this.endpoint===pt&&(this.endpoint=s),!this.isSetup&&(this.isSetup=!0,(i=(n=this.logger)===null||n===void 0?void 0:n.debug)===null||i===void 0||i.call(n,"Setting up messenger"),this.messageHandler=function(c){var u,l,h,v,f;if((l=(u=r.logger)===null||u===void 0?void 0:u.debug)===null||l===void 0||l.call(u,"Message received: ",JSON.stringify(c)),r.endpoint===c.origin){var E=c.data,T=E?.action;if(T)if("id"in E&&E.id)(v=(h=r.logger)===null||h===void 0?void 0:h.debug)===null||v===void 0||v.call(h,"Received Response to previous request: ",JSON.stringify(c)),r.handleResponse(E);else{if(T==="ping"){r.notify({action:"pong"});return}var b=r.actionHandlers.get(T);if(b)b(E.data);else{var g=(f=r.pendingMessages.get(T))!==null&&f!==void 0?f:[];g.push(E.data),r.pendingMessages.set(T,g)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},t.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=U();e?.[je]===this&&delete e[je]},t})();qr=gt;function Ri(t){return typeof t=="object"&&t!==null&&gt in t&&t[gt]===!0}function Oi(t){var e=U(),r=e?.[je];if(Ri(r))return r;var n=new ki(t);
4return e&&(e[je]=n),n}var $t="__AMPLITUDE_BACKGROUND_CAPTURE__";function Li(t,e){var r,n=t;if(n[$t]!==!0){n[$t]=!0;var i=(r=void 0)!==null&&r!==void 0?r:Ai,o=null,a=function(s,c){var u,l;s==="background-capture-complete"&&((l=(u=t.logger)===null||u===void 0?void 0:u.debug)===null||l===void 0||l.call(u,"Background capture complete"),t.notify({action:"background-capture-complete",data:c}))};t.registerActionHandler("initialize-background-capture",function(){var s,c;(c=(s=t.logger)===null||s===void 0?void 0:s.debug)===null||c===void 0||c.call(s,"Initializing background capture (external script)");var u=new URL(i,t.endpoint).toString();t.loadScriptOnce(u).then(function(){var l,h,v;(h=(l=t.logger)===null||l===void 0?void 0:l.debug)===null||h===void 0||h.call(l,"Background capture script loaded (external)"),o=(v=window?.amplitudeBackgroundCapture)===null||v===void 0?void 0:v.call(window,{messenger:t,onBackgroundCapture:a}),t.notify({action:"background-capture-loaded"})}).catch(function(){var l;(l=t.logger)===null||l===void 0||l.warn("Failed to initialize background capture")})}),t.registerActionHandler("close-background-capture",function(){var s;(s=o?.close)===null||s===void 0||s.call(o),o=null})}}var xe=function(t,e){return typeof t=="boolean"?t:t?.[e]!==!1},Gr=function(t){return xe(t,"attribution")},xi=function(t){return xe(t,"fileDownloads")},Di=function(t){return xe(t,"formInteractions")},Br=function(t){return xe(t,"pageViews")},Kt=function(t){return xe(t,"sessions")},jr=function(t){return typeof t=="boolean"?t:typeof t=="object"&&(t.elementInteractions===!0||typeof t.elementInteractions=="object")},Ui=function(t){if(jr(t.autocapture)&&typeof t.autocapture=="object"&&typeof t.autocapture.elementInteractions=="object")return t.autocapture.elementInteractions},Ni=function(t){var e=function(){return!1},r=void 0,n,i=t.pageCounter,o=Br(t.defaultTracking);return o&&(e=void 0,n=void 0,t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.pageViews&&typeof t.defaultTracking.pageViews=="object"&&("trackOn"in t.defaultTracking.pageViews&&(e=t.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in t.defaultTracking.pageViews&&(r=t.defaultTracking.pageViews.trackHistoryChanges),"eventType"in t.defaultTracking.pageViews&&t.defaultTracking.pageViews.eventType&&(n=t.defaultTracking.pageViews.eventType))),{trackOn:e,trackHistoryChanges:r,eventType:n,pageCounter:i}},Mi=function(t){return Gr(t.defaultTracking)&&t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.attribution&&typeof t.defaultTracking.attribution=="object"?P({},t.defaultTracking.attribution):{}},Fi=function(t,e){Be(t,e)},Be=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=n.name,o=n.args,a=n.resolve,s=t&&t[i];if(typeof s=="function"){var c=s.apply(t,o);typeof a=="function"&&a(c?.promise)}}return t},nt=function(t){var e=t;return e&&e._q!==void 0},Hr="2.12.2",Vi="amplitude-ts",qi="Web",Gi="$remote",Bi=(function(){function t(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Vi,"/").concat(Hr),typeof navigator<"u"&&(this.userAgent=navigator.userAgent)}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){var r,n;return S(this,void 0,void 0,function(){var i,o,a,s;return w(this,function(c){return i=new Date().getTime(),o=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,a=(n=e.event_id)!==null&&n!==void 0?n:o+1,this.config.lastEventId=a,e.time||(this.config.lastEventTime=i),s=P(P(P(P(P(P(P(P({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:qi}),this.config.trackingOptions.language&&{language:oi()}),this.config.trackingOptions.ipAddress&&{ip:Gi}),{insert_id:Ee(),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}}),e),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,s]})})},t})(),$r=(function(){function t(e){this.storage=e}return t.prototype.isEnabled=function(){return S(this,void 0,void 0,function(){var e,r,n,i;return w(this,function(o){switch(o.label){case 0:if(!this.storage)return[2,!1];e=String(Date.now()),r=new t(this.storage),n="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(n,e)];case 2:return o.sent(),[4,r.get(n)];case 3:return i=o.sent(),[2,i===e];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return o.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return S(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(e)];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]}})})},t.prototype.getRaw=function(e){var r;return S(this,void 0,void 0,function(){return w(this,function(n){return[2,((r=this.storage)===null||r===void 0?void 0:r.getItem(e))||void 0]})})},t.prototype.set=function(e,r){var n;return S(this,void 0,void 0,function(){return w(this,function(i){try{(n=this.storage)===null||n===void 0||n.setItem(e,JSON.stringify(r))}catch{}return[2]})})},t.prototype.remove=function(e){var r;return S(this,void 0,void 0,function(){return w(this,function(n){try{(r=this.storage)===null||r===void 0||r.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return S(this,void 0,void 0,function(){return w(this,function(r){try{(e=this.storage)===null||e===void 0||e.clear()}catch{}return[2]})})},t})(),Me=1e3,Kr=(function(t){be(e,t);function e(r){var n=this,i;return n=t.call(this,(i=U())===null||i===void 0?void 0:i.localStorage)||this,n.loggerProvider=r?.loggerProvider,n}return e.prototype.set=function(r,n){var i;return S(this,void 0,void 0,function(){var o;return w(this,function(a){switch(a.label){case 0:return Array.isArray(n)&&n.length>Me?(o=n.length-Me,[4,t.prototype.set.call(this,r,n.slice(0,Me))]):[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(Me,".")),[3,4];case 2:return[4,t.prototype.set.call(this,r,n)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},e})($r),ji=(function(t){be(e,t);function e(){var r;return t.call(this,(r=U())===null||r===void 0?void 0:r.sessionStorage)||this}return e})($r),Hi=(function(t){be(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={done:4},r}return e.prototype.send=function(r,n){return S(this,void 0,void 0,function(){var i=this;return w(this,function(o){return[2,new Promise(function(a,s){typeof XMLHttpRequest>"u"&&s(new Error("XHRTransport is not supported."));var c=new XMLHttpRequest;c.open("POST",r,!0),c.onreadystatechange=function(){if(c.readyState===i.state.done){var u=c.responseText;try{a(i.buildResponse(JSON.parse(u)))}catch{a(i.buildResponse({code:c.status}))}}},c.setRequestHeader("Content-Type","application/json"),c.setRequestHeader("Accept","*/*"),c.send(JSON.stringify(n))})]})})},e})(Xe),$i=(function(t){be(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return S(this,void 0,void 0,function(){var i=this;return w(this,function(o){return[2,new Promise(function(a,s){var c=U();if(!c?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var u=JSON.stringify(n),l=c.navigator.sendBeacon(r,JSON.stringify(n));return a(l?i.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:u.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(h){s(h)}})]})})},e})(Xe),Ki=function(t,e,r){return r===void 0&&(r=!0),S(void 0,void 0,void 0,function(){var n,i,o,a,s,c,u,l,h;return w(this,function(v){switch(v.label){case 0:return n=ii(t),[4,e.getRaw(n)];case 1:return i=v.sent(),i?r?[4,e.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:v.sent(),v.label=3;
4case 3:return o=N(i.split("."),6),a=o[0],s=o[1],c=o[2],u=o[3],l=o[4],h=o[5],[2,{deviceId:a,userId:Wi(s),sessionId:it(u),lastEventId:it(h),lastEventTime:it(l),optOut:!!c}]}})})},it=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},Wi=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}},ce="[Amplitude]",Wt="".concat(ce," Form Started"),Xi="".concat(ce," Form Submitted"),zi="".concat(ce," File Downloaded"),Xt="session_start",zt="session_end",Yi="".concat(ce," File Extension"),Qi="".concat(ce," File Name"),Ji="".concat(ce," Link ID"),Zi="".concat(ce," Link Text"),eo="".concat(ce," Link URL"),ot="".concat(ce," Form ID"),at="".concat(ce," Form Name"),st="".concat(ce," Form Destination"),He="cookie",to="US",ro=(function(t){be(e,t);function e(r,n,i,o,a,s,c,u,l,h,v,f,E,T,b,g,d,p,m,y,_,A,C,k,O,L,M,K,$,F,X,le,de,R){i===void 0&&(i=new _t),o===void 0&&(o={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),u===void 0&&(u=1e3),l===void 0&&(l=5),h===void 0&&(h=30),v===void 0&&(v=He),g===void 0&&(g=new Pr),d===void 0&&(d=ne.Warn),m===void 0&&(m=!1),y===void 0&&(y=!1),C===void 0&&(C=""),k===void 0&&(k=to),L===void 0&&(L=1800*1e3),M===void 0&&(M=new Kr({loggerProvider:g})),K===void 0&&(K={ipAddress:!0,language:!0,platform:!0}),$===void 0&&($="fetch"),F===void 0&&(F=!1),X===void 0&&(X=!1);var I=t.call(this,{apiKey:r,storageProvider:M,transportProvider:Wr($)})||this;return I.apiKey=r,I.appVersion=n,I.cookieOptions=o,I.defaultTracking=a,I.autocapture=s,I.flushIntervalMillis=u,I.flushMaxRetries=l,I.flushQueueSize=h,I.identityStorage=v,I.ingestionMetadata=f,I.instanceName=E,I.loggerProvider=g,I.logLevel=d,I.minIdLength=p,I.offline=m,I.partnerId=_,I.plan=A,I.serverUrl=C,I.serverZone=k,I.sessionTimeout=L,I.storageProvider=M,I.trackingOptions=K,I.transport=$,I.useBatch=F,I.fetchRemoteConfig=X,I.version=Hr,I._optOut=!1,I._cookieStorage=i,I.deviceId=c,I.lastEventId=T,I.lastEventTime=b,I.optOut=y,I.sessionId=O,I.pageCounter=de,I.userId=le,I.debugLogsEnabled=R,I.loggerProvider.enable(R?ne.Debug:I.logLevel),I}return Object.defineProperty(e.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(r){this._cookieStorage!==r&&(this._cookieStorage=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(r){this._pageCounter!==r&&(this._pageCounter=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"debugLogsEnabled",{set:function(r){this._debugLogsEnabled!==r&&(this._debugLogsEnabled=r,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var r={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(Or(this.apiKey),r)},e})(qn),no=function(t,e,r){return e===void 0&&(e={}),S(void 0,void 0,void 0,function(){var n,i,o,a,s,c,u,l,h,v,f,E,T,b,g,d,p,m,y,_,A,C,k,O,L,M,K,$,F,X,le,de,R,I,H,ie,Z,fe,z,ee,oe,ae,Y;return w(this,function(Q){switch(Q.label){case 0:return n=e.identityStorage||He,y={},n===He?[3,1]:(o="",[3,5]);
4case 1:return(A=(_=e.cookieOptions)===null||_===void 0?void 0:_.domain)!==null&&A!==void 0?(a=A,[3,4]):[3,2];case 2:return[4,oo()];case 3:a=Q.sent(),Q.label=4;case 4:o=a,Q.label=5;case 5:return i=P.apply(void 0,[(y.domain=o,y.expiration=365,y.sameSite="Lax",y.secure=!1,y.upgrade=!0,y),e.cookieOptions]),s=io(e.identityStorage,i),[4,Ki(t,s,(k=(C=e.cookieOptions)===null||C===void 0?void 0:C.upgrade)!==null&&k!==void 0?k:!0)];case 6:return c=Q.sent(),[4,s.get(Or(t))];case 7:return u=Q.sent(),l=Ae(),h=($=(K=(M=(L=(O=e.deviceId)!==null&&O!==void 0?O:l.ampDeviceId)!==null&&L!==void 0?L:l.deviceId)!==null&&M!==void 0?M:u?.deviceId)!==null&&K!==void 0?K:c.deviceId)!==null&&$!==void 0?$:Ee(),v=(F=u?.lastEventId)!==null&&F!==void 0?F:c.lastEventId,f=(X=u?.lastEventTime)!==null&&X!==void 0?X:c.lastEventTime,E=(de=(le=e.optOut)!==null&&le!==void 0?le:u?.optOut)!==null&&de!==void 0?de:c.optOut,T=(R=u?.sessionId)!==null&&R!==void 0?R:c.sessionId,b=(H=(I=e.userId)!==null&&I!==void 0?I:u?.userId)!==null&&H!==void 0?H:c.userId,r.previousSessionDeviceId=(ie=u?.deviceId)!==null&&ie!==void 0?ie:c.deviceId,r.previousSessionUserId=(Z=u?.userId)!==null&&Z!==void 0?Z:c.userId,g={ipAddress:(z=(fe=e.trackingOptions)===null||fe===void 0?void 0:fe.ipAddress)!==null&&z!==void 0?z:!0,language:(oe=(ee=e.trackingOptions)===null||ee===void 0?void 0:ee.language)!==null&&oe!==void 0?oe:!0,platform:(Y=(ae=e.trackingOptions)===null||ae===void 0?void 0:ae.platform)!==null&&Y!==void 0?Y:!0},d=u?.pageCounter,p=u?.debugLogsEnabled,e.autocapture!==void 0&&(e.defaultTracking=e.autocapture),m=new ro(t,e.appVersion,s,i,e.defaultTracking,e.autocapture,h,e.flushIntervalMillis,e.flushMaxRetries,e.flushQueueSize,n,e.ingestionMetadata,e.instanceName,v,f,e.loggerProvider,e.logLevel,e.minIdLength,e.offline,E,e.partnerId,e.plan,e.serverUrl,e.serverZone,T,e.sessionTimeout,e.storageProvider,g,e.transport,e.useBatch,e.fetchRemoteConfig,b,d,p),[4,m.storageProvider.isEnabled()];case 8:return Q.sent()||(m.loggerProvider.warn("Storage provider ".concat(m.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),m.storageProvider=new _t),[2,m]}})})},io=function(t,e){switch(t===void 0&&(t=He),e===void 0&&(e={}),t){case"localStorage":return new Kr;case"sessionStorage":return new ji;case"none":return new _t;default:return new ht(P(P({},e),{expirationDays:e.expiration}))}},Wr=function(t){return t==="xhr"?new Hi:t==="beacon"?new $i:new hi},oo=function(t){return S(void 0,void 0,void 0,function(){var e,r,n,i,o,o,a,s,c,u;return w(this,function(l){switch(l.label){case 0:return[4,new ht().isEnabled()];case 1:if(!l.sent()||typeof location>"u"||!location.hostname)return[2,""];for(e=location.hostname,r=e.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,l.label=2;case 2:return o<n.length?(a=n[o],s={domain:"."+a},c=new ht(s),[4,c.set(i,1)]):[3,7];case 3:return l.sent(),[4,c.get(i)];case 4:return u=l.sent(),u?[4,c.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+a];case 6:return o++,[3,2];case 7:return[2,""]}})})},ao="[Amplitude] Page Viewed",ut="AMP_PAGE_VIEW",so=function(t){t===void 0&&(t={});var e,r=U(),n=void 0,i=!1,o,a,s=t.trackOn,c=t.trackHistoryChanges,u=t.eventType,l=u===void 0?ao:u,h=function(d){var p=d;try{p=decodeURI(d)}catch(m){n?.error("Malformed URI sequence: ",m)}return p},v=function(d){return S(void 0,void 0,void 0,function(){var p,m,y;return w(this,function(_){switch(_.label){case 0:return p=h(typeof location<"u"&&location.href||""),y={event_type:l},m=[{}],[4,uo()];case 1:return[2,(y.event_properties=P.apply(void 0,[P.apply(void 0,m.concat([_.sent()])),{"[Amplitude] Page Domain":typeof location<"u"&&location.hostname||"","[Amplitude] Page Location":p,"[Amplitude] Page Path":typeof location<"u"&&h(location.pathname)||"","[Amplitude] Page Title":Vr(Fr),"[Amplitude] Page URL":p.split("?")[0],"[Amplitude] Page View ID":d}]),y)]}})})},f=function(){return typeof s>"u"||typeof s=="function"&&s()},E=typeof location<"u"?location.href:null,T=function(){return S(void 0,void 0,void 0,function(){var d,p,m,y,_;return w(this,function(A){switch(A.label){case 0:return d=location.href,p=lo(c,d,E||"")&&f(),E=d,p?(m=void 0,a&&(m=Ee(),a.set(ut,{pageViewId:m})),n?.log("Tracking page view event"),e!=null?[3,1]:[3,3]):[3,4];case 1:return _=(y=e).track,[4,v(m)];case 2:_.apply(y,[A.sent()]),A.label=3;case 3:A.label=4;case 4:return[2]}})})},b=function(){T()},g={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(d,p){return S(void 0,void 0,void 0,function(){var m,y,_;return w(this,function(A){switch(A.label){case 0:if(e=p,o=d,n=d.loggerProvider,n.log("Installing @amplitude/plugin-page-view-tracking-browser"),i=!0,r){try{a=new vi(r.sessionStorage)}catch{n?.debug("sessionStorage is not available in this environment.")}r.addEventListener("popstate",b),r.history.pushState=new Proxy(r.history.pushState,{apply:function(C,k,O){var L=N(O,3),M=L[0],K=L[1],$=L[2];C.apply(k,[M,K,$]),i&&b()}})}return f()?(n.log("Tracking page view event"),m=void 0,a&&(m=Ee(),a.set(ut,{pageViewId:m})),_=(y=e).track,[4,v(m)]):[3,2];case 1:_.apply(y,[A.sent()]),A.label=2;case 2:return[2]}})})},execute:function(d){return S(void 0,void 0,void 0,function(){var p,m,y;return w(this,function(_){switch(_.label){case 0:return s==="attribution"&&co(d)?(n?.log("Enriching c
4ampaign event to page view event with campaign parameters"),p=void 0,a?[4,a.get(ut)]:[3,2]):[3,4];case 1:m=_.sent(),p=m?.pageViewId,_.label=2;case 2:return[4,v(p)];case 3:y=_.sent(),d.event_type=y.event_type,d.event_properties=P(P({},d.event_properties),y.event_properties),_.label=4;case 4:return o&&d.event_type===l&&(o.pageCounter=o.pageCounter?o.pageCounter+1:1,d.event_properties=P(P({},d.event_properties),{"[Amplitude] Page Counter":o.pageCounter})),[2,d]}})})},teardown:function(){return S(void 0,void 0,void 0,function(){return w(this,function(d){return r&&(r.removeEventListener("popstate",b),i=!1),[2]})})}};return g},uo=function(){return S(void 0,void 0,void 0,function(){var t;return w(this,function(e){switch(e.label){case 0:return t=ai,[4,new pi().parse()];case 1:return[2,t.apply(void 0,[e.sent()])]}})})},co=function(t){if(t.event_type==="$identify"&&t.user_properties){var e=t.user_properties,r=e[he.SET]||{},n=e[he.UNSET]||{},i=W(W([],N(Object.keys(r)),!1),N(Object.keys(n)),!1);return Object.keys(Sr).every(function(o){return i.includes(o)})}return!1},lo=function(t,e,r){switch(t){case"pathOnly":{if(r=="")return!0;var n=new URL(e),i=new URL(r),o=n.origin+n.pathname,a=i.origin+i.pathname;return o!==a}default:return e!==r}},fo=function(){var t,e=[],r=function(u,l,h){u.addEventListener(l,h),e.push({element:u,type:l,handler:h})},n=function(){e.forEach(function(u){var l=u.element,h=u.type,v=u.handler;l?.removeEventListener(h,v)}),e=[]},i="@amplitude/plugin-form-interaction-tracking-browser",o="enrichment",a=function(u,l){return S(void 0,void 0,void 0,function(){var h,v;return w(this,function(f){return h=function(){if(!l){u.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=function(b){var g=!1;r(b,"change",function(){var d,p=Yt(b);g||l.track(Wt,(d={},d[ot]=Te(b.id),d[at]=Te(b.name),d[st]=p,d)),g=!0}),r(b,"submit",function(){var d,p,m=Yt(b);g||l.track(Wt,(d={},d[ot]=Te(b.id),d[at]=Te(b.name),d[st]=m,d)),l.track(Xi,(p={},p[ot]=Te(b.id),p[at]=Te(b.name),p[st]=m,p)),g=!1})},T=Array.from(document.getElementsByTagName("form"));T.forEach(E),typeof MutationObserver<"u"&&(t=new MutationObserver(function(b){b.forEach(function(g){g.addedNodes.forEach(function(d){d.nodeName==="FORM"&&E(d),"querySelectorAll"in d&&typeof d.querySelectorAll=="function"&&Array.from(d.querySelectorAll("form")).map(E)})})}),t.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?h():(v=U(),v?v.addEventListener("load",h):u.loggerProvider.debug("Form interaction tracking is not installed because global is undefined.")),[2]})})},s=function(u){return S(void 0,void 0,void 0,function(){return w(this,function(l){return[2,u]})})},c=function(){return S(void 0,void 0,void 0,function(){return w(this,function(u){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:c}},Te=function(t){if(typeof t=="string")return t},Yt=function(t){var e=t.getAttribute("action");try{e=new URL(encodeURI(e??""),window.location.href).href}catch{}return e},vo=function(){var t,e=[],r=function(u,l,h){u.addEventListener(l,h),e.push({element:u,type:l,handler:h})},n=function(){e.forEach(function(u){var l=u.element,h=u.type,v=u.handler;l?.removeEventListener(h,v)}),e=[]},i="@amplitude/plugin-file-download-tracking-browser",o="enrichment",a=function(u,l){return S(void 0,void 0,void 0,function(){var h,v;return w(this,function(f){return h=function(){if(!l){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 E=function(g){var d;try{d=new URL(g.href,window.location.href)}catch{return}var p=T.exec(d.href),m=p?.[1];m&&r(g,"click",function(){var y;m&&l.track(zi,(y={},y[Yi]=m,y[Qi]=d.pathname,y[Ji]=g.id,y[Zi]=g.text,y[eo]=g.href,y))})},T=/\.(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)(\?.+)?$/,b=Array.from(document.getElementsByTagName("a"));b.forEach(E),typeof MutationObserver<"u"&&(t=new MutationObserver(function(g){g.forEach(function(d){d.addedNodes.forEac
4h(function(p){p.nodeName==="A"&&E(p),"querySelectorAll"in p&&typeof p.querySelectorAll=="function"&&Array.from(p.querySelectorAll("a")).map(E)})})}),t.observe(document.body,{subtree:!0,childList:!0}))}},document.readyState==="complete"?h():(v=U(),v?v.addEventListener("load",h):u.loggerProvider.debug("File download tracking is not installed because global is undefined.")),[2]})})},s=function(u){return S(void 0,void 0,void 0,function(){return w(this,function(l){return[2,u]})})},c=function(){return S(void 0,void 0,void 0,function(){return w(this,function(u){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:a,execute:s,teardown:c}},Qt=!1,ho=function(t){if(!(Qt||t.defaultTracking!==void 0)){var e=`\`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.`;t.loggerProvider.warn(e),Qt=!0}},po=function(){var t="@amplitude/plugin-network-checker-browser",e="before",r=U(),n=[],i=function(c,u){r&&(r.addEventListener(c,u),n.push({type:c,handler:u}))},o=function(){n.forEach(function(c){var u=c.type,l=c.handler;r&&r.removeEventListener(u,l)}),n=[]},a=function(c,u){return S(void 0,void 0,void 0,function(){return w(this,function(l){return typeof navigator>"u"?(c.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),c.offline=!1,[2]):(c.offline=!navigator.onLine,i("online",function(){c.loggerProvider.debug("Network connectivity changed to online."),c.offline=!1,setTimeout(function(){u.flush()},c.flushIntervalMillis)}),i("offline",function(){c.loggerProvider.debug("Network connectivity changed to offline."),c.offline=!0}),[2])})})},s=function(){return S(void 0,void 0,void 0,function(){return w(this,function(c){return o(),[2]})})};return{name:t,type:e,setup:a,teardown:s}},$e;(function(t){t.US="US",t.EU="EU"})($e||($e={}));var Ke;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(Ke||(Ke={}));var go="Network error occurred, remote config fetch failed",mo="Remote config successfully fetched",yo="Remote config fetch rejected due to exceeded retry count",Jt="Remote config fetch rejected due to timeout after 5 seconds",Zt="Unexpected error occurred",Eo="https://sr-client-cfg.amplitude.com/config",bo="https://sr-client-cfg.stag2.amplitude.com/config",_o="https://sr-client-cfg.eu.amplitude.com/config",To=(function(){function t(e){var r=e.localConfig,n=e.configKeys,i=this;this.retryTimeout=1e3,this.attempts=0,this.sessionTargetingMatch=!1,this.metrics={},this.getRemoteConfig=function(o,a,s){return S(i,void 0,void 0,function(){var c,u,l;return w(this,function(h){switch(h.label){case 0:return c=Date.now(),[4,this.fetchWithTimeout(s)];case 1:return u=h.sent(),u&&(l=u.configs&&u.configs[o],l)?(this.metrics.fetchTimeAPISuccess=Date.now()-c,[2,l[a]]):(this.metrics.fetchTimeAPIFail=Date.now()-c,[2,void 0])}})})},this.fetchWithTimeout=function(o){return S(i,void 0,void 0,function(){var a,s,c;return w(this,function(u){switch(u.label){case 0:return a=new AbortController,s=setTimeout(function(){return a.abort()},5e3),[4,this.fetchRemoteConfig(a.signal,o)];case 1:return c=u.sent(),clearTimeout(s),[2,c]}})})},this.fetchRemoteConfig=function(o,a){return S(i,void 0,void 0,function(){var s,c,u,l,h,v,f,E,T,b,g,d,p;return w(this,function(m){switch(m.label){case 0:if(a===this.lastFetchedSessionId&&this.attempts>=this.localConfig.flushMaxRetries)return[2,this.completeRequest({err:yo})];if(o.aborted)return[2,this.completeRequest({err:Jt})];a!==this.lastFetchedSessionId&&(this.lastFetchedSessionId=a,this.attempts=0),m.label=1;case 1:m.trys.push([1,3,,4]),s=new URLSearchParams({api_key:this.localConfig.apiKey});try{for(c=x(this.configKeys),u=c.next();!u.done;u=c.next())l=u.value,s.append("config_keys",l)}catch(y){g={error:y}}finally{try{u&&!u.done&&(d=c.return)&&d.call(c)}finally{if(g)throw g.error}}return a&&s.set("session_id",String(a)),h={headers:{Accept:"*/*"},method:"GET"},v="".concat(this.getServerUrl(),"?").concat(s.toString()),this.attempts+=1,[4,fetch(v,P(P({},h),{signal:o}))];case 2:if(f=m.sent(),f===null)return[2,this.completeRequest({err:Zt})];switch(E=new Xe().buildStatus(f.status),E){case Ke.Success:return this.attempts=0,[2,this.parseAndStore
10Config(f)];case Ke.Failed:return[2,this.retryFetch(o,a)];default:return[2,this.completeRequest({err:go})]}case 3:return T=m.sent(),b=T,o.aborted?[2,this.completeRequest({err:Jt})]:[2,this.completeRequest({err:(p=b.message)!==null&&p!==void 0?p:Zt})];case 4:return[2]}})})},this.retryFetch=function(o,a){return S(i,void 0,void 0,function(){var s=this;return w(this,function(c){switch(c.label){case 0:return[4,new Promise(function(u){return setTimeout(u,s.attempts*s.retryTimeout)})];case 1:return c.sent(),[2,this.fetchRemoteConfig(o,a)]}})})},this.parseAndStoreConfig=function(o){return S(i,void 0,void 0,function(){var a;return w(this,function(s){switch(s.label){case 0:return[4,o.json()];case 1:return a=s.sent(),this.completeRequest({success:mo}),[2,a]}})})},this.localConfig=r,this.configKeys=n}return t.prototype.getServerUrl=function(){return this.localConfig.serverZone===$e.STAGING?bo:this.localConfig.serverZone===$e.EU?_o:Eo},t.prototype.completeRequest=function(e){var r=e.err,n=e.success;if(r)throw new Error(r);n&&this.localConfig.loggerProvider.log(n)},t})(),So=function(t){var e=t.localConfig,r=t.configKeys;return S(void 0,void 0,void 0,function(){return w(this,function(n){return[2,new To({localConfig:e,configKeys:r})]})})},wo=So,Io=(function(){function t(e){this.config=e,this.config.loggerProvider.debug("Local configuration before merging with remote config",JSON.stringify(this.config,null,2))}return t.prototype.initialize=function(){return S(this,void 0,void 0,function(){var e;return w(this,function(r){switch(r.label){case 0:return e=this,[4,wo({localConfig:this.config,configKeys:["analyticsSDK"]})];case 1:return e.remoteConfigFetch=r.sent(),[2]}})})},t.prototype.generateJoinedConfig=function(){var e,r,n,i;return S(this,void 0,void 0,function(){var o,a,s;return w(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),a=this.remoteConfigFetch,a?[4,this.remoteConfigFetch.getRemoteConfig("analyticsSDK","browserSDK",this.config.sessionId)]:[3,2];case 1:a=c.sent(),c.label=2;case 2:return o=a,this.config.loggerProvider.debug("Remote configuration:",JSON.stringify(o,null,2)),o&&"autocapture"in o&&(typeof o.autocapture=="boolean"&&(this.config.autocapture=o.autocapture),typeof o.autocapture=="object"&&(this.config.autocapture===void 0&&(this.config.autocapture=o.autocapture),typeof this.config.autocapture=="boolean"&&(this.config.autocapture=P({attribution:this.config.autocapture,fileDownloads:this.config.autocapture,formInteractions:this.config.autocapture,pageViews:this.config.autocapture,sessions:this.config.autocapture,elementInteractions:this.config.autocapture},o.autocapture)),typeof this.config.autocapture=="object"&&(this.config.autocapture=P(P({},this.config.autocapture),o.autocapture))),this.config.defaultTracking=this.config.autocapture),this.config.loggerProvider.debug("Joined configuration: ",JSON.stringify(this.config,null,2)),(e=(i=this.config).requestMetadata)!==null&&e!==void 0||(i.requestMetadata=new kr),!((r=this.remoteConfigFetch)===null||r===void 0)&&r.metrics.fetchTimeAPISuccess&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_success",this.remoteConfigFetch.metrics.fetchTimeAPISuccess),!((n=this.remoteConfigFetch)===null||n===void 0)&&n.metrics.fetchTimeAPIFail&&this.config.requestMetadata.recordHistogram("remote_config_fetch_time_API_fail",this.remoteConfigFetch.metrics.fetchTimeAPIFail),[3,4];case 3:return s=c.sent(),this.config.loggerProvider.error("Failed to fetch remote configuration because of error: ",s),[3,4];case 4:return[2,this.config]}})})},t})(),Ao=function(t){return S(void 0,void 0,void 0,function(){var e;return w(this,function(r){switch(r.label){case 0:return e=new Io(t),[4,e.initialize()];case 1:return r.sent(),[2,e]}})})},Po="1.27.2",Co="@amplitude/plugin-autocapture-browser",Xr="[Amplitude] Element Clicked",ko="[Amplitude] Element Changed",Ro="[Amplitude] Element ID",Oo="[Amplitude] Element Class",er="[Amplitude] Element Tag",tr="[Amplitude] Element Text",Lo="[Amplitude] Element Hierarchy",xo="[Amplitude] Element Href",Do="[Amplitude] Element Position Left",Uo="[Amplitude] Element Position Top",No="[Amplitude] Element Aria Label",Mo="[Amplitude] Element Attributes",Fo="[Amplitude] Element Path",Vo="[Amplitude] Element Parent Label",mt="[Amplitude] Page URL",qo="[Amplitude] Page Title",zr="[Amplitude] Viewport Height",Yr="[Amplitude] Viewport Width",Go="[Amplitude] Max Page X",Bo="[Amplitude] Max Page Y",Qr="[Amplitude] Page View ID",jo="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",Ho="amp-visual-tagging-selector-highlight",Jr="data-amp-mask-attributes",$o=25,Zr=128,Ko="AMP_PAGE_VIEW",Wo=18e3,Xo=["input","select","textarea"],en=function(t,e){var r,n=(r=window?.getComputedStyle)===null||r===void 0?void 0:r.call(window,t);return n?.getPropertyValue("cursor")==="pointer"&&e==="click"},zo=function(t){var e=t.pageUrlAllowlist,r=t.pageUrlExcludelist;return!(r&&r.length>0&&Gt(window.location.href,r)||!Gt(window.location.href,e))},ct=function(t,e,r){return r===void 0&&(r=!1),function(n,i){var o,a,s=t.shouldTrackEventResolver,c=(a=(o=i?.tagName)===null||o===void 0?void 0:o.toLowerCase)===null||a===void 0?void 0:a.call(o);if(!c)return!1;if(s)return s(n,i);if(!zo(t))return!1;var u=String(i?.getAttribute("type"))||"";if(typeof u=="string")switch(u.toLowerCase()){case"hidden":return!1;case"password":return!1}var l=en(i,n);if(r&&l)return!0;
10if(e){var h=e.some(function(v){var f;return!!(!((f=i?.matches)===null||f===void 0)&&f.call(i,v))});if(!h)return!1}switch(c){case"input":case"select":case"textarea":return n==="change"||n==="click";default:return l?!0:n==="click"}}},Yo=function(t){var e,r,n,i=(r=(e=t?.tagName)===null||e===void 0?void 0:e.toLowerCase)===null||r===void 0?void 0:r.call(e),o=t instanceof HTMLElement?((n=t.getAttribute("contenteditable"))===null||n===void 0?void 0:n.toLowerCase())==="true":!1;return!Xo.includes(i)&&!o},Qo=function(t){return t?t.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&e!=="id"&&e!=="class"}):[]},Jo=function(t,e){return Object.entries(t).reduce(function(r,n){var i=N(n,2),o=i[0],a=i[1];if(o.startsWith(e)){var s=o.replace(e,"");s&&(r[s]=a||"")}return r},{})},Zo=function(t){return t==null||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0},rr=function(t){return Object.keys(t).reduce(function(e,r){var n=t[r];return Zo(n)||(e[r]=n),e},{})},tn=function(){var t;try{var e=U(),r=(t=e?.sessionStorage)===null||t===void 0?void 0:t.getItem(Ko);if(!r)return;var n=JSON.parse(r);if(typeof n.pageViewId=="string")return n.pageViewId}catch{}},Tt=function(t,e){return t?e.some(function(r){var n;return(n=t?.matches)===null||n===void 0?void 0:n.call(t,r)})?t:Tt(t?.parentElement,e):null},St=function(t){return!(t.event.target===null||!t.closestTrackedAncestor)};function ea(t){return t.type==="click"||t.type==="change"}var nr;(function(t){t[t.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",t[t.MIDDLE=1]="MIDDLE",t[t.RIGHT=2]="RIGHT"})(nr||(nr={}));var ir="__AMPLITUDE_VISUAL_TAGGING__";function ta(t,e){var r=t;if(r[ir]!==!0){r[ir]=!0;var n=e.dataExtractor,i=e.isElementSelectable,o=e.cssSelectorAllowlist,a=e.actionClickAllowlist,s=null,c=function(l){t.notify({action:"element-selected",data:l})},u=function(l,h){l==="selector-mode-changed"?t.notify({action:"track-selector-mode-changed",data:h}):l==="selector-moved"&&t.notify({action:"track-selector-moved",data:h})};t.registerActionHandler("initialize-visual-tagging-selector",function(l){t.loadScriptOnce(jo).then(function(){var h;
10s=(h=window?.amplitudeVisualTaggingSelector)===null||h===void 0?void 0:h.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(v){return i?i(l?.actionType||"click",v):!0},onTrack:u,onSelect:c,visualHighlightClass:Ho,messenger:t,cssSelectorAllowlist:o,actionClickAllowlist:a,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:Po}}}),t.notify({action:"selector-loaded"})}).catch(function(){var h;(h=t.logger)===null||h===void 0||h.warn("Failed to initialize visual tagging selector")})}),t.registerActionHandler("close-visual-tagging-selector",function(){var l;(l=s?.close)===null||l===void 0||l.call(s)})}}function ra(t){var e=t.amplitude,r=t.allObservables,n=t.shouldTrackEvent,i=t.evaluateTriggers,o=r.clickObservable,a=o.filter(St).filter(function(c){return n("click",c.closestTrackedAncestor)}).map(function(c){return i(c)}),s=a;return s.subscribe(function(c){e?.track(Xr,c.targetElementProperties)})}function na(t){var e=t.amplitude,r=t.allObservables,n=t.getEventProperties,i=t.shouldTrackEvent,o=t.evaluateTriggers,a=r.changeObservable,s=a.filter(St).filter(function(c){return i("change",c.closestTrackedAncestor)}).map(function(c){return o(c)});return s.subscribe(function(c){e?.track(ko,n("change",c.closestTrackedAncestor))})}function ia(t){var e=t.amplitude,r=t.allObservables,n=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,a=t.shouldTrackActionClick,s=r.clickObservable,c=r.mutationObservable,u=r.navigateObservable,l=s.filter(function(b){return!o("click",b.closestTrackedAncestor)}).map(function(b){var g=Tt(b.event.target,n.actionClickAllowlist);return b.closestTrackedAncestor=g,b.closestTrackedAncestor!==null&&(b.targetElementProperties=i(b.type,b.closestTrackedAncestor)),b}).filter(St).filter(function(b){return a("click",b.closestTrackedAncestor)}),h=u?Ht(c,u):c,v=Ht(l,h),f=null,E=null,T=Ti(v,function(b){if(f&&(clearTimeout(f),f=null),b.type==="click")return E=b,f=setTimeout(function(){f=null,E=null},500),Promise.resolve(null);if(E){var g=E;return E=null,Promise.resolve(g)}return Promise.resolve(null)});return T.subscribe(function(b){b&&e?.track(Xr,i("click",b.closestTrackedAncestor))})}function oa(t){var e=t.allObservables,r=e.scrollObservable,n={maxX:0,maxY:0},i=r.subscribe(function(){var o,a,s,c,u=U(),l=Math.floor((a=(o=u?.scrollX)!==null&&o!==void 0?o:u?.pageXOffset)!==null&&a!==void 0?a:0),h=Math.floor((c=(s=u?.scrollY)!==null&&s!==void 0?s:u?.pageYOffset)!==null&&c!==void 0?c:0);n.maxX=Math.max(n.maxX,l),n.maxY=Math.max(n.maxY,h)});return{unsubscribe:function(){i.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}var aa=function(){return new pe(function(t){var e=new MutationObserver(function(r){t.next(r)});return document.body&&e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}})},sa=function(t){return t===void 0&&(t="click"),new pe(function(e){var r,n=function(i){e.next(i)};return(r=U())===null||r===void 0||r.document.addEventListener(t,n,{capture:!0}),function(){var i;(i=U())===null||i===void 0||i.document.removeEventListener(t,n,{capture:!0})}})},ua=function(){return new pe(function(t){var e,r=function(n){t.next(n)};return(e=U())===null||e===void 0||e.addEventListener("scroll",r),function(){var n;(n=U())===null||n===void 0||n.removeEventListener("scroll",r)}})},ca=function(t,e){return new pe(function(r){var n,i=U();if(!i?.IntersectionObserver)return function(){};var o=new IntersectionObserver(function(u){u.forEach(function(l){r.next(l)})},{root:null,rootMargin:"0px",threshold:1}),a=e.join(","),s=(n=i?.document.querySelectorAll(a))!==null&&n!==void 0?n:[];s.forEach(function(u){o.observe(u)});var c=t.subscribe(function(u){var l=u.event;return l.forEach(function(h){var v=h.addedNodes;return v.forEach(function(f){f instanceof Element&&(f.matches(a)&&o.observe(f),f.querySelectorAll(a).forEach(function(E){o.observe(E)}))})})});return function(){c.unsubscribe(),o.disconnect()}})},la=function(t,e){try{if(e.subprop_key==="[Amplitude] Element Text")return e.subprop_op==="is"&&e.subprop_value.includes(t.targetElementProperties["[Amplitude] Element Text"]);if(e.subprop_key==="[Amplitude] Element Hierarchy")return e.subprop_op==="autotrack css match"&&!!t.closestTrackedAncestor.closest(e.subprop_value.toString())}catch(r){return console.error("Error matching event to filter",r),!1}return!1},da=function(t,e){try{if(t.sourceType==="DOM_ELEMENT"){var r=document.documentElement;return t.scope&&e&&(r=e.closest(t.scope)),r&&t.selector?r.querySelector(t.selector):r}}catch{return}}
10,fa=function(t,e,r){t.forEach(function(n){if(typeof n!="string"&&n.actionType==="ATTACH_EVENT_PROPERTY"){var i=r.extractDataFromDataSource(n.dataSource,e.closestTrackedAncestor);e.targetElementProperties[n.destinationKey]=i}})},yt={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},or=function(t){var e,r,n,i,o=Object.values(yt).reduce(function(f,E){return f[E]=new Set,f},{});if(!t)return o;try{for(var a=x(t),s=a.next();!s.done;s=a.next()){var c=s.value;try{try{for(var u=(n=void 0,x(c.definition)),l=u.next();!l.done;l=u.next()){var h=l.value,v=yt[h.event_type];v&&o[v].add(c.id)}}catch(f){n={error:f}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}catch(f){console.warn("Skipping Labeled Event due to malformed definition",c?.id,f)}}}catch(f){e={error:f}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return o},ar=function(t){var e,r,n,i,o=new Map;try{for(var a=x(t),s=a.next();!s.done;s=a.next()){var c=s.value;try{for(var u=(n=void 0,x(c.conditions)),l=u.next();!l.done;l=u.next()){var h=l.value;if(h.type==="LABELED_EVENT"){var v=h.match.eventId,f=o.get(v);f||(f=[],o.set(v,f)),f.push(c)}}}catch(E){n={error:E}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(E){e={error:E}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return o},va=function(t,e){return e.filter(function(r){return r.definition.some(function(n){return yt[n.event_type]===t.type&&n.filters.every(function(i){return la(t,i)})})})},ha=function(t,e){var r,n,i,o,a=new Set;try{for(var s=x(t),c=s.next();!c.done;c=s.next()){var u=c.value,l=e.get(u.id);if(l)try{for(var h=(i=void 0,x(l)),v=h.next();!v.done;v=h.next()){var f=v.value;a.add(f)}}catch(E){i={error:E}}finally{try{v&&!v.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}}catch(E){r={error:E}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(a)},pa=(function(){function t(e,r,n,i){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=r,this.dataExtractor=n,this.options=i}return t.prototype.evaluate=function(e){var r,n,i=this.options.pageActions;if(!i)return e;var o=va(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(l){return i.labeledEvents[l]})),a=ha(o,this.labeledEventToTriggerMap);try{for(var s=x(a),c=s.next();!c.done;c=s.next()){var u=c.value;fa(u.actions,e,this.dataExtractor)}}catch(l){r={error:l}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return e},t.prototype.update=function(e,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=r,this.options=n},t})(),ga=function(t,e,r,n){return new pa(t,e,r,n)},ma=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Jr,Se]),ya=["type"],Ea=["svg","path","g"],ba=["password","hidden"];function _a(t,e){var r,n,i,o,a,s;if(t===null)return null;var c=String(t.tagName).toLowerCase(),u={tag:c},l=Array.from((o=(i=t.parentElement)===null||i===void 0?void 0:i.children)!==null&&o!==void 0?o:[]);l.length&&(u.index=l.indexOf(t),u.indexOfType=l.filter(function(y){return y.tagName===t.tagName}).indexOf(t));var h=(s=(a=t.previousElementSibling)===null||a===void 0?void 0:a.tagName)===null||s===void 0?void 0:s.toLowerCase();h&&(u.prevSib=String(h));var v=t.getAttribute("id");v&&(u.id=String(v));var f=Array.from(t.classList);f.length&&(u.classes=f);var E={},T=Array.from(t.attributes),b=T.filter(function(y){return!ma.has(y.name)}),g=!Yo(t);if(!ba.includes(String(t.getAttribute("type")))&&!Ea.includes(c))try{for(var d=x(b),p=d.next();!p.done;p=d.next()){var m=p.value;if(!(g&&!ya.includes(m.name))){if(e.has(m.name)){E[m.name]=me;continue}E[m.name]=String(m.value).substring(0,Zr)}}}catch(y){r={error:y}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return Object.keys(E).length&&(u.attrs=E),u}function Ta(t){var e=[];if(!t)return e;e.push(t);for(var r=t.parentElement;r&&r.tagName!=="HTML";)e.push(r),r=r.parentElement;return e}var Oe=(function(){function t(e,r){this.value=e,this.optimized=r}return t.prototype.toString=function(){return this.value},t}
10)(),Sa=function(t,e){if(t.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=t;n;){var i=wa(n,!!e,n===t);if(!i||(r.push(i),i.optimized))break;n=n.parentElement}return r.reverse(),r.join(" > ")},wa=function(t,e,r){var n,i;if(t.nodeType!==Node.ELEMENT_NODE)return null;var o=t.getAttribute("id");if(e){if(o)return new Oe(l(o),!0);var a=t.tagName.toLowerCase();if(a==="body"||a==="head"||a==="html")return new Oe(a,!0)}var s=t.tagName.toLowerCase();if(o)return new Oe(s+l(o),!0);var c=t.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new Oe(s,!0);function u(L){var M=L.getAttribute("class");return M?M.split(/\s+/g).filter(Boolean).map(function(K){return"$"+K}):[]}function l(L){return"#"+CSS.escape(L)}for(var h=u(t),v=!1,f=!1,E=-1,T=-1,b=c.children,g=0;b&&(E===-1||!f)&&g<b.length;++g){var d=b[g];if(d.nodeType===Node.ELEMENT_NODE){if(T+=1,d===t){E=T;continue}if(!f&&d.tagName.toLowerCase()===s){v=!0;var p=new Set(h);if(!p.size){f=!0;continue}for(var m=u(d),y=0;y<m.length;++y){var _=m[y];if(p.has(_)&&(p.delete(_),!p.size)){f=!0;break}}}}}var A=s;if(r&&s.toLowerCase()==="input"&&t.getAttribute("type")&&!t.getAttribute("id")&&!t.getAttribute("class")&&(A+="[type="+CSS.escape(t.getAttribute("type")||"")+"]"),f)A+=":nth-child("+String(E+1)+")";else if(v)try{for(var C=x(h),k=C.next();!k.done;k=C.next()){var O=k.value;A+="."+CSS.escape(O.slice(1))}}catch(L){n={error:L}}finally{try{k&&!k.done&&(i=C.return)&&i.call(C)}finally{if(n)throw n.error}}return new Oe(A,!1)},Ia=(function(){function t(e,r){var n,i,o=this,a;this.replaceSensitiveString=function(v){return Fr(v,o.additionalMaskTextPatterns)},this.getHierarchy=function(v){var f,E,T,b,g=performance.now(),d=[];if(!v)return[];for(var p=Ta(v),m=new Map,y=p.length-1;y>=0;y--){var _=p[y];if(_){var A=Qo(_.getAttribute(Jr)),C=y===p.length-1?[]:(T=m.get(p[y+1]))!==null&&T!==void 0?T:new Set,k=new Set(W(W([],N(C),!1),N(A),!1));m.set(_,k)}}d=p.map(function(F){var X;return _a(F,(X=m.get(F))!==null&&X!==void 0?X:new Set)});var O=function(F){F?.attrs&&Object.entries(F.attrs).forEach(function(X){var le=N(X,2),de=le[0],R=le[1];F.attrs&&(F.attrs[de]=o.replaceSensitiveString(R))})};try{for(var L=x(d),M=L.next();!M.done;M=L.next()){var K=M.value;O(K)}}catch(F){f={error:F}}finally{try{M&&!M.done&&(E=L.return)&&E.call(L)}finally{if(f)throw f.error}}var $=performance.now();return(b=o.diagnosticsClient)===null||b===void 0||b.recordHistogram("autocapturePlugin.getHierarchy",$-g),d},this.getNearestLabel=function(v){var f=v.parentElement;if(!f)return"";var E;try{E=f.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch{E=null}return E?o.getText(E):o.getNearestLabel(f)},this.getElementPath=function(v){var f;if(!v)return"";var E=performance.now(),T=Sa(v),b=performance.now();return(f=o.diagnosticsClient)===null||f===void 0||f.recordHistogram("autocapturePlugin.getElementPath",b-E),T},this.getEventProperties=function(v,f,E){var T,b,g,d,p=(g=(b=f?.tagName)===null||b===void 0?void 0:b.toLowerCase)===null||g===void 0?void 0:g.call(b),m=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():{left:null,top:null},y=o.getHierarchy(f),_=(d=y[0])===null||d===void 0?void 0:d.attrs,A=o.getNearestLabel(f),C=Jo(_??{},E),k=(T={},T[Lo]=y,T[er]=p,T[tr]=o.getText(f),T[Do]=m.left==null?null:Math.round(m.left),T[Uo]=m.top==null?null:Math.round(m.top),T[Mo]=C,T[Fo]=o.getElementPath(f),T[Vo]=A,T[mt]=Lr(window.location.href.split("?")[0]),T[qo]=Vr(o.replaceSensitiveString),T[zr]=window.innerHeight,T[Yr]=window.innerWidth,T),O=tn();if(O&&(k[Qr]=O),k[Ro]=f.getAttribute("id")||"",k[Oo]=f.getAttribute("class"),k[No]=_?.["aria-label"],p==="a"&&v==="click"&&f instanceof HTMLAnchorElement){var L=f.href.substring(0,Zr);k[xo]=o.replaceSensitiveString(L)}return rr(k)},this.addTypeAndTimestamp=function(v,f){return{event:v,timestamp:Date.now(),type:f}},this.addAdditionalEventProperties=function(v,f,E,T,b){b===void 0&&(b=!1);
10var g=o.addTypeAndTimestamp(v,f);if(ea(g)&&g.event.target!==null){if(b){var d=en(g.event.target,g.type);if(d)return g.closestTrackedAncestor=g.event.target,g.targetElementProperties=o.getEventProperties(g.type,g.closestTrackedAncestor,T),g}var p=Tt(g.event.target,E);return p&&(g.closestTrackedAncestor=p,g.targetElementProperties=o.getEventProperties(g.type,p,T)),g}return g},this.extractDataFromDataSource=function(v,f){if(v.sourceType==="DOM_ELEMENT"){var E=da(v,f);return E?v.elementExtractType==="TEXT"?o.getText(E):v.elementExtractType==="ATTRIBUTE"&&v.attribute?E.getAttribute(v.attribute):void 0:void 0}},this.getTextWithMaskedDescendants=function(v){var f,E,T="[".concat(Se,"], [contenteditable]");if(!v.querySelector(T))return v.innerText;var b="",g=Array.from(v.childNodes);try{for(var d=x(g),p=d.next();!p.done;p=d.next()){var m=p.value;if(m.nodeType===Node.TEXT_NODE){b+=m.textContent||"";continue}if(m instanceof Element){if(m.hasAttribute(Se)||m.hasAttribute("contenteditable")){b+=me;continue}b+=o.getTextWithMaskedDescendants(m)}}}catch(y){f={error:y}}finally{try{p&&!p.done&&(E=d.return)&&E.call(d)}finally{if(f)throw f.error}}return b},this.getText=function(v){var f=v.closest("[".concat(Se,"]"))!==null;if(f)return me;var E="";return v.querySelector("[".concat(Se,"], [contenteditable]"))?E=o.getTextWithMaskedDescendants(v):E=v.innerText||"",o.replaceSensitiveString(E.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(v){var f,E,T;if(!v)return{};var b=(T=(E=v?.tagName)===null||E===void 0?void 0:E.toLowerCase)===null||T===void 0?void 0:T.call(E),g=(f={},f[er]=b,f[tr]=o.getText(v),f[mt]=window.location.href.split("?")[0],f);return rr(g)},this.diagnosticsClient=r?.diagnosticsClient;var s=(a=e.maskTextRegex)!==null&&a!==void 0?a:[],c=[];try{for(var u=x(s),l=u.next();!l.done;l=u.next()){var h=l.value;if(c.length>=$o)break;if(h instanceof RegExp)c.push(h);else if("pattern"in h&&typeof h.pattern=="string")try{c.push(new RegExp(h.pattern,"i"))}catch{}}}catch(v){n={error:v}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=c}return t})();function Aa(t){var e=t.allObservables,r=t.onExposure,n=t.dataExtractor,i=t.exposureDuration,o=i===void 0?Mr:i,a=new Map,s=new Map,c=e.exposureObservable,u=c.subscribe(function(l){var h=l,v=h.target;if(h.isIntersecting){if(!a.get(v)){var f=setTimeout(function(){a.set(v,!0);var E=n.getElementPath(v);r(E),s.set(v,null)},o);s.set(v,f)}}else if(!h.isIntersecting&&h.intersectionRatio<1){var f=s.get(v);f&&(clearTimeout(f),s.set(v,null))}});return{unsubscribe:function(){u.unsubscribe()},reset:function(){s.forEach(function(l){l&&clearTimeout(l)}),s.clear(),a.clear()}}}function Pa(t){var e,r,n,i,o,a,s=t.amplitude,c=t.scrollTracker,u=t.currentElementExposed,l=t.elementExposedForPage,h=t.exposureTracker,v=t.isPageEnd,f=t.lastScroll,E=c.getState(),T=U(),b=(r=T?.innerWidth)!==null&&r!==void 0?r:0,g=(n=T?.innerHeight)!==null&&n!==void 0?n:0,d=(e={},e[mt]=Lr((a=(o=(i=T?.location)===null||i===void 0?void 0:i.href)===null||o===void 0?void 0:o.split("?")[0])!==null&&a!==void 0?a:""),e[Go]=E.maxX+b,e[Bo]=E.maxY+g,e[zr]=g,e[Yr]=b,e["[Amplitude] Element Exposed"]=Array.from(u),e),p=tn();if(p&&(d[Qr]=p),u.size===0&&E.maxX===f.maxX&&E.maxY===f.maxY){v&&(c.reset(),l.clear(),h?.reset());return}s?.track("[Amplitude] Viewport Content Updated",d),f.maxX=E.maxX,f.maxY=E.maxY,u.clear(),v&&(c.reset(),l.clear(),h?.reset())}function Ca(t,e,r,n){if(!e.has(t)){e.add(t),r.add(t);var i=Array.from(r),o=JSON.stringify(i);o.length>=Wo&&n(!1)}}var ve;(function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable",t.ScrollObservable="scrollObservable",t.ExposureObservable="exposureObservable",t.BrowserErrorObservable="browserErrorObservable",t.SelectionObservable="selectionObservable",t.MouseMoveObservable="mouseMoveObservable"})(ve||(ve={}));var ka=function(t,e){var r,n,i,o,a,s,c,u,l,h,v,f;t===void 0&&(t={});var E=t.dataAttributePrefix,T=E===void 0?Ur:E,b=t.visualTaggingOptions,g=b===void 0?{enabled:!0}:b;t.cssSelectorAllowlist=(r=t.cssSelectorAllowlist)!==null&&r!==void 0?r:Dr,t.actionClickAllowlist=(n=t.actionClickAllowlist)!==null&&n!==void 0?n:Nr,t.debounceTime=(i=t.debounceTime)!==null&&i!==void 0?i:0;var d=((o=t.viewportContentUpdated)===null||o===void 0?void 0:o.enabled)!==!1,p=(c=(s=(a=t.viewportContentUpdated)===null||a===void 0?void 0:a.exposureDuration)!==null&&s!==void 0?s:t.exposureDuration)!==null&&c!==void 0?c:Mr;t.viewportContentUpdated=P(P({},t.viewportContentUpdated),{exposureDuration:p}),t.pageUrlExcludelist=(u=t.pageUrlExcludelist)===null||u===void 0?void 0:u.reduce(function(R,I){if(typeof I=="str
10ing"&&R.push(I),I instanceof RegExp&&R.push(I),typeof I=="object"&&I!==null&&"pattern"in I)try{R.push(new RegExp(I.pattern))}catch(H){return console.warn("Invalid regex pattern: ".concat(I.pattern),H),R}return R},[]);var m=Co,y="enrichment",_=[],A=new Ia(t,e),C=new Set,k=new Set,O,L=function(){var R,I=Ne(sa().map(function(ee){return A.addAdditionalEventProperties(ee,"click",t.cssSelectorAllowlist,T)})),H=Ne(new pe(function(ee){var oe,ae=function(Y){var Q=A.addAdditionalEventProperties(Y,"change",t.cssSelectorAllowlist,T);ee.next(Q)};return(oe=U())===null||oe===void 0||oe.document.addEventListener("change",ae,{capture:!0}),function(){var Y;return(Y=U())===null||Y===void 0?void 0:Y.document.removeEventListener("change",ae)}})),ie;window.navigation&&(ie=Ne(new pe(function(ee){var oe=function(ae){var Y=A.addAdditionalEventProperties(ae,"navigate",t.cssSelectorAllowlist,T);ee.next(Y)};return window.navigation.addEventListener("navigate",oe),function(){window.navigation.removeEventListener("navigate",oe)}})));var Z=Ne(aa().map(function(ee){return A.addAdditionalEventProperties(ee,"mutation",t.cssSelectorAllowlist,T)})),fe=ua(),z=ca(Z,t.cssSelectorAllowlist);return R={},R[ve.ChangeObservable]=H,R[ve.ClickObservable]=I,R[ve.MutationObservable]=Z,R[ve.NavigateObservable]=ie,R[ve.ScrollObservable]=fe,R[ve.ExposureObservable]=z,R},M=or(Object.values((h=(l=t.pageActions)===null||l===void 0?void 0:l.labeledEvents)!==null&&h!==void 0?h:{})),K=ar((f=(v=t.pageActions)===null||v===void 0?void 0:v.triggers)!==null&&f!==void 0?f:[]),$=ga(M,K,A,t),F=function(R){var I,H;R&&(t.pageActions=P(P({},t.pageActions),R),M=or(Object.values((I=t.pageActions.labeledEvents)!==null&&I!==void 0?I:{})),K=ar((H=t.pageActions.triggers)!==null&&H!==void 0?H:[]),$.update(M,K,t))},X=function(R,I){return S(void 0,void 0,void 0,function(){var H,ie,Z,fe,z,ee,oe,ae,Y,Q,J,_e,It,ze,Ye,Qe,Pe,Je,Ze,De,et;return w(this,function(is){return typeof document>"u"?[2]:(H=!1,ie={maxX:void 0,maxY:void 0},R.fetchRemoteConfig&&(R.remoteConfigClient?R.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(te){F(te)}):R.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),Z=ct(t,t.cssSelectorAllowlist),fe=ct(t,t.actionClickAllowlist),z=L(),ee=ra({allObservables:z,amplitude:I,shouldTrackEvent:Z,evaluateTriggers:$.evaluate.bind($)}),_.push(ee),oe=na({allObservables:z,getEventProperties:function(){for(var te=[],se=0;se<arguments.length;se++)te[se]=arguments[se];return A.getEventProperties.apply(A,W(W([],N(te),!1),[T],!1))},amplitude:I,shouldTrackEvent:Z,evaluateTriggers:$.evaluate.bind($)}),_.push(oe),ae=ia({allObservables:z,options:t,getEventProperties:function(){for(var te=[],se=0;se<arguments.length;se++)te[se]=arguments[se];return A.getEventProperties.apply(A,W(W([],N(te),!1),[T],!1))},amplitude:I,shouldTrackEvent:Z,shouldTrackActionClick:fe}),ae&&_.push(ae),Y=oa({allObservables:z}),_.push(Y),Q={},J=U(),_e=function(te){te&&H||(setTimeout(function(){H=!1},100),H=!0,Pa({amplitude:I,scrollTracker:Y,currentElementExposed:k,elementExposedForPage:C,exposureTracker:Q.exposure,isPageEnd:te,lastScroll:ie}))},It=function(te){Ca(te,C,k,_e)},d&&(Q.exposure=Aa({allObservables:z,onExposure:It,dataExtractor:A,exposureDuration:p}),Q.exposure&&_.push(Q.exposure),ze=function(){_e(!0)},J?.addEventListener("beforeunload",ze),O=function(){J?.removeEventListener("beforeunload",ze)},_.push({unsubscribe:function(){return O()}}),Ye=z[ve.NavigateObservable],Ye?_.push(Ye.subscribe(function(){_e(!0)})):J&&(Qe=function(){_e(!0)},J.addEventListener("popstate",Qe),Pe=J.history.pushState,J.history&&Pe&&(J.history.pushState=new Proxy(Pe,{apply:function(te,se,dn){var tt=N(dn,3),fn=tt[0],vn=tt[1],hn=tt[2];te.apply(se,[fn,vn,hn]),_e(!0)}})),_.push({unsubscribe:function(){J.removeEventListener("popstate",Qe),J.history&&Pe&&(J.history.pushState=Pe)}}))),(et=R?.loggerProvider)===null||et===void 0||et.log("".concat(m," has been successfully added.")),window.opener&&g.enabled&&(Je=t.cssSelectorAllowlist,Ze=t.actionClickAllowlist,De=Oi(),ta(De,{dataExtractor:A,isElementSelectable:ct(t,W(W([],N(Je),!1),N(Ze),!1)),cssSelectorAllowlist:Je,actionClickAllowlist:Ze}),Li(De),De.setup(P({logger:R?.loggerProvider},R?.serverZone&&{endpoint:Ii[R.serverZone]}))),[2])})})},le=function(R){return S(void 0,void 0,void 0,function(){return w(this,function(I){return[2,R]})})},de=function(){return S(void 0,void 0,void 0,function(){var R,I,H,ie,Z;return w(this,function(fe){try{for(R=x(_),I=R.next();!I.done;I=R.next())H=I.value,H.unsubscribe()}catch(z){ie={error:z}}finally{try{I&&!I.done&&(Z=R.return)&&Z.call(R)}finally{if(ie)throw ie.error}}return[2]})})};return{name:m,type:y,setup:X,execute:le,teardown:de}}
10,Ra="utm_campaign",Oa="utm_content",La="utm_id",xa="utm_medium",Da="utm_source",Ua="utm_term",sr="dclid",ur="fbclid",cr="gbraid",lr="gclid",dr="ko_click_id",fr="li_fat_id",vr="msclkid",hr="rtd_cid",pr="ttclid",gr="twclid",mr="wbraid",wt={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},yr=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},Na=function(t){return Object.values(t).every(function(e){return!e})},Ma=function(t,e,r,n,i){i===void 0&&(i=!0),t.referrer;var o=t.referring_domain,a=dt(t,["referrer","referring_domain"]),s=e||{};s.referrer;var c=s.referring_domain,u=dt(s,["referrer","referring_domain"]);if(Fa(r.excludeReferrers,t.referring_domain))return n.debug("This is not a new campaign because ".concat(t.referring_domain," is in the exclude referrer list.")),!1;if(!i&&Na(t)&&e)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(a)!==JSON.stringify(u),h=yr(o||"")!==yr(c||""),v=!e||l||h;return v?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."),v},Fa=function(t,e){return t===void 0&&(t=[]),e===void 0&&(e=""),t.some(function(r){return r instanceof RegExp?r.test(e):r===e})},Va=function(t,e){var r=P(P({},wt),t),n=Object.entries(r).reduce(function(i,o){var a,s=N(o,2),c=s[0],u=s[1];return i.setOnce("initial_".concat(c),(a=u??e.initialEmptyValue)!==null&&a!==void 0?a:"EMPTY"),u?i.set(c,u):i.unset(c)},new Ie);return Ir(n)},qa=function(t){var e=t;return e?(e.startsWith(".")&&(e=e.substring(1)),[new RegExp("".concat(e.replace(".","\\."),"$"))]):[]},Ga=(function(){function t(){}return t.prototype.parse=function(){return S(this,void 0,void 0,function(){return w(this,function(e){return[2,P(P(P(P({},wt),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Ae(),r=e[Ra],n=e[Oa],i=e[La],o=e[xa],a=e[Da],s=e[Ua];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:a,utm_term:s}},t.prototype.getReferrer=function(){var e,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(e=n.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},t.prototype.getClickIds=function(){var e,r=Ae();return e={},e[sr]=r[sr],e[ur]=r[ur],e[cr]=r[cr],e[lr]=r[lr],e[dr]=r[dr],e[fr]=r[fr],e[vr]=r[vr],e[hr]=r[hr],e[pr]=r[pr],e[gr]=r[gr],e[mr]=r[mr],e},t})(),Ba=(function(){function t(e,r){var n;this.shouldTrackNewCampaign=!1,this.options=P({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:qa((n=r.cookieOptions)===null||n===void 0?void 0:n.domain)},e),this.storage=r.cookieStorage,this.storageKey=fi(r.apiKey,"MKTG"),this.currentCampaign=wt,this.sessionTimeout=r.sessionTimeout,this.lastEventTime=r.lastEventTime,this.logger=r.loggerProvider,r.loggerProvider.log("Installing web attribution tracking.")}return t.prototype.init=function(){return S(this,void 0,void 0,function(){var e,r;return w(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:return r=N.apply(void 0,[n.sent(),2]),this.currentCampaign=r[0],this.previousCampaign=r[1],e=this.lastEventTime?Rr(this.sessionTimeout,this.lastEventTime):!0,Ma(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},t.prototype.fetchCampaign=function(){return S(this,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:return[4,Promise.all([new Ga().parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}})})},t.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var r=Va(this.currentCampaign,this.options);return e&&(r.event_id=e),r},t.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},t})(),ja=(function(t){be(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.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?.userId,a=n),re(this._init(P(P({},a),{userId:o,apiKey:r})))},e.prototype._init=function(r){var n,i,o;return S(this,void 0,void 0,function(){var a,s,c,u,l,h,v=this;return w(this,function(f){switch(f.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,no(r.apiKey,r,this)]);case 1:return a=f.sent(),r.fetchRemoteConfig?[4,Ao(a)]:[3,4];case 2:return s=f.sent(),[4,s.generateJoinedConfig()];case 3:a=f.sent(),f.label=4;case 4:return[4,t.prototype._init.call(this,a)];case 5:return f.sent(),this.logBrowserOptions(a),Gr(this.config.defaultTracking)?(c=Mi(this.config),this.webAttribution=new Ba(c,this.config),[4,this.webAttribution.init()]):[3,7];case 6:f.sent(),f.label=7;case 7:return u=Ae(),l=Number.isNaN(Number(u.ampSessionId))?void 0:Number(u.ampSessionId),this.setSessionId((o=(i=(n=r.sessionId)!==null&&n!==void 0?n:l)!==null&&i!==void 0?i:this.config.sessionId)!==null&&o!==void 0?o:Date.now()),h=Le(r.instanceName),h.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===xr?[3,9]:[4,this.add(po()).promise];case 8:f.sent(),f.label=9;case 9:return[4,this.add(new Kn).promise];case 10:return f.sent(),[4,this.add(new Bi).promise];case 11:return f.sent(),[4,this.add(new ni).promise];case 12:return f.sent(),ho(this.config),xi(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(vo()).promise]):[3,14];case 13:f.sent(),f.label=14;case 14:return Di(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(fo()).promise]):[3,16];case 15:f.sent(),f.label=16;case 16:return Br(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(so(Ni(this.config))).promise]):[3,18];case 17:f.sent(),f.label=18;case 18:return jr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(ka(Ui(this.config))).promise]):[3,20];case 19:f.sent(),f.label=20;case 20:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 21:return f.sent(),h.eventBridge.setEventReceiver(function(E){v.track(E.eventType,E.eventProperties)}),[2]}})})},e.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},e.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,ti(r,this.config.instanceName))},e.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},e.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.loggerProvider.debug("function setDeviceId: ",r),this.config.deviceId=r,ri(r,this.config.instanceName)},e.prototype.reset=function(){this.setDeviceId(Ee()),this.setUserId(void 0)},e.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},e.prototype.setSessionId=function(r){var n,i=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,r)),re(Promise.resolve());if(r===this.config.sessionId)return re(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",r);var o=this.getSessionId(),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,Kt(this.config.defaultTracking)&&(o&&a&&i.push(this.track(zt,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 c=this.trackCampaignEventIfNeeded(++s,i);return Kt(this.config.defaultTracking)&&i.push(this.track(Xt,void 0,{event_id:c?++s:s,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,re(Promise.all(i))},e.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},e.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=Wr(r)},e.prototype.identify=function(r,n){if(nt(r)){var i=r._q;r._q=[],r=Be(new Ie,i)}return n?.user_id&&this.setUserId(n.user_id),n?.device_id&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,r,n)},e.prototype.groupIdentify=function(r,n,i,o){if(nt(i)){var a=i._q;i._q=[],i=Be(new Ie,a)}return t.prototype.groupIdentify.call(this,r,n,i,o)},e.prototype.revenue=function(r,n){if(nt(r)){var i=r._q;r._q=[],r=Be(new Ar,i)}return t.prototype.revenue.call(this,r,n)},e.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},e.prototype.process=function(r){return S(this,void 0,void 0,function(){var n,i,o;return w(this,function(a){return n=Date.now(),i=Rr(this.config.sessionTimeout,this.config.lastEventTime),o=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),r.event_type!==Xt&&r.event_type!==zt&&(!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,t.prototype.process.call(this,r)]})})},e.prototype.logBrowserOptions=function(r){try{var n=P(P({},r),{apiKey:r.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(n))}catch(i){this.config.loggerProvider.error("Error logging browser config",i)}},e})(Fn),rn=function(){var t=new ja;return{init:G(t.init.bind(t),"init",V(t),q(t,["config"])),add:G(t.add.bind(t),"add",V(t),q(t,["config.apiKey","timeline.plugins"])),remove:G(t.remove.bind(t),"remove",V(t),q(t,["config.apiKey","timeline.plugins"])),track:G(t.track.bind(t),"track",V(t),q(t,["config.apiKey","timeline.queue.length"])),logEvent:G(t.logEvent.bind(t),"logEvent",V(t),q(t,["config.apiKey","timeline.queue.length"])),identify:G(t.identify.bind(t),"identify",V(t),q(t,["config.apiKey","timeline.queue.length"])),groupIdentify:G(t.groupIdentify.bind(t),"groupIdentify",V(t),q(t,["config.apiKey","timeline.queue.length"])),setGroup:G(t.setGroup.bind(t),"setGroup",V(t),q(t,["config.apiKey","timeline.queue.length"])),revenue:G(t.revenue.bind(t),"revenue",V(t),q(t,["config.apiKey","timeline.queue.length"])),flush:G(t.flush.bind(t),"flush",V(t),q(t,["config.apiKey","timeline.queue.length"])),getUserId:G(t.getUserId.bind(t),"getUserId",V(t),q(t,["config","config.userId"])),setUserId:G(t.setUserId.bind(t),"setUserId",V(t),q(t,["config","config.userId"])),getDeviceId:G(t.getDeviceId.bind(t),"getDeviceId",V(t),q(t,["config","config.deviceId"])),setDeviceId:G(t.setDeviceId.bind(t),"setDeviceId",V(t),q(t,["config","config.deviceId"])),reset:G(t.reset.bind(t),"reset",V(t),q(t,["config","config.userId","config.deviceId"])),getSessionId:G(t.getSessionId.bind(t),"getSessionId",V(t),q(t,["config"])),setSessionId:G(t.setSessionId.bind(t),"setSessionId",V(t),q(t,["config"])),extendSession:G(t.extendSession.bind(t),"extendSession",V(t),q(t,["config"])),setOptOut:G(t.setOptOut.bind(t),"setOptOut",V(t),q(t,["config"])),setTransport:G(t.setTransport.bind(t),"setTransport",V(t),q(t,["config"]))}};const j=rn();var Ha=j.add,$a=j.extendSession,Ka=j.flush,nn=j.getDeviceId,on=j.getSessionId,an=j.getUserId,Wa=j.groupIdentify,sn=j.identify,un=j.init,Xa=j.logEvent,za=j.remove,Ya=j.reset,Qa=j.revenue,Ja=j.setDeviceId,Za=j.setGroup,es=j.setOptOut,ts=j.setSessionId,r
10s=j.setTransport,cn=j.setUserId,ln=j.track,Et;(function(t){t.IdentifyOperation=he,t.SpecialEventType=ye,t.RevenueProperty=ue,t.LogLevel=ne,t.OfflineDisabled=xr,t.DEFAULT_CSS_SELECTOR_ALLOWLIST=Dr,t.DEFAULT_DATA_ATTRIBUTE_PREFIX=Ur,t.DEFAULT_ACTION_CLICK_ALLOWLIST=Nr})(Et||(Et={}));const as=Object.freeze(Object.defineProperty({__proto__:null,Identify:Ie,Revenue:Ar,get Types(){return Et},add:Ha,createInstance:rn,extendSession:$a,flush:Ka,getDeviceId:nn,getSessionId:on,getUserId:an,groupIdentify:Wa,identify:sn,init:un,logEvent:Xa,remove:za,reset:Ya,revenue:Qa,runQueuedFunctions:Fi,setDeviceId:Ja,setGroup:Za,setOptOut:es,setSessionId:ts,setTransport:rs,setUserId:cn,track:ln},Symbol.toStringTag,{value:"Module"})),lt={init:un,getDeviceId:nn,getSessionId:on,Identify:Ie,identify:sn,track:ln,getUserId:an,setUserId:cn},ns=t=>(t&&(lt.init(t,{autocapture:!1}),window.amplitude=lt),lt),ss=Object.freeze(Object.defineProperty({__proto__:null,setupAmplitude:ns},Symbol.toStringTag,{value:"Module"}));export{Ii as A,Xe as B,qn as C,hi as F,ne as L,ye as S,Ee as U,ei as a,Pr as b,B as c,G as d,Li as e,nn as f,Le as g,U as h,Oi as i,as as j,ss as k,re as r,ns as s};

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.