@dcl/jump-site 0.0.3 → 0.0.4-15334308896.commit-14f6c47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{auto-track-CESKe-vL.js → auto-track-DPNbzvNG.js} +1 -1
- package/assets/background--i0ipWGU.webp +0 -0
- package/assets/background-invalid-events-page-4wvWf0ma.webp +0 -0
- package/assets/background-invalid-places-page-HmsH9QxH.webp +0 -0
- package/assets/card-creator-placeholder-BobX3Kvq.webp +0 -0
- package/assets/card-events-placeholder-bdYGw8BY.webp +0 -0
- package/assets/card-places-placeholder-DtbWTTXg.webp +0 -0
- package/assets/fortmatic-C1OI35Ny.js +13 -0
- package/assets/index-2KTRZ_wQ.js +2 -0
- package/assets/{index-BcyYnbGB.js → index-BaH3PnIw.js} +1 -1
- package/assets/index-C42TJOmu.js +1 -0
- package/assets/index-CTkTBFvA.js +1 -0
- package/assets/index-CjLG8mEj.js +1 -0
- package/assets/index-CyAwJUFH.js +895 -0
- package/assets/index-DRDPElRz.js +1 -0
- package/assets/index-E7NtNklj.js +2 -0
- package/assets/index-HUqkoREA.js +5 -0
- package/assets/index-MIaFGdfG.js +12 -0
- package/assets/index-hYuGvrPG.js +1 -0
- package/assets/index.es-BniwE8Oi.js +4865 -0
- package/assets/{index.umd-DNNVL3en.js → index.umd-DP8Tg7Kp.js} +1 -1
- package/assets/secp256k1-BAUAeQyx.js +1 -0
- package/index.html +1 -1
- package/package.json +3 -3
- package/assets/background-v4-CcTBZUhV.jpg +0 -0
- package/assets/dcl-CSCjwju1.webp +0 -0
- package/assets/index-BfYbKzUW.js +0 -1
- package/assets/index-BiLuWLjK.js +0 -2
- package/assets/index-D76Uxjzx.js +0 -1
- package/assets/index-DGSVm7Cr.js +0 -1
- package/assets/index-DVdcljqq.js +0 -2
- package/assets/index-DqK5yzRc.js +0 -831
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as f,e as v,c as _,a as p}from"./index-CyAwJUFH.js";import{l as z,a as k,u as j,r as w,b as P,C as N,c as C,d as y,e as F,m as L,i as S,f as R,h as B,P as Q,j as W,k as G,n as T,o as U}from"./index-E7NtNklj.js";import{i as V}from"./is-plan-event-enabled-DS1Agtkw.js";function D(i){return i.toLowerCase().replace(".","").replace(/\s+/g,"-")}function E(i,t){return t===void 0&&(t=!1),t?btoa(i).replace(/=/g,""):void 0}function H(i){return("Integration"in i?i.Integration:i).prototype.name}function J(i,t,n){var e,a;try{var r=((a=(e=window==null?void 0:window.performance)===null||e===void 0?void 0:e.getEntriesByName(i,"resource"))!==null&&a!==void 0?a:[])[0];r&&t.stats.gauge("legacy_destination_time",Math.round(r.duration),_([n],r.duration<100?["cached"]:[],!0))}catch{}}function K(i,t,n){var e;if("Integration"in i){var a={user:function(){return n.user()},addIntegration:function(){}};i(a),e=i.Integration}else e=i;var r=new e(t);return r.analytics=n,r}function X(i,t,n,e){return f(this,void 0,void 0,function(){var a,r,s,u,o,d;return v(this,function(c){switch(c.label){case 0:a=D(t),r=E(a,e),s=k(),u="".concat(s,"/integrations/").concat(r??a,"/").concat(n,"/").concat(r??a,".dynamic.js.gz"),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,z(u)];case 2:return c.sent(),J(u,i,t),[3,4];case 3:throw o=c.sent(),i.stats.gauge("legacy_destination_time",-1,["plugin:".concat(t),"failed"]),o;case 4:return d=window["".concat(a,"Deps")],[4,Promise.all(d.map(function(g){return z(s+g+".gz")}))];case 5:return c.sent(),window["".concat(a,"Loader")](),[2,window["".concat(a,"Integration")]]}})})}function Y(i,t,n){return f(this,void 0,void 0,function(){var e,a,r,s;return v(this,function(u){return e=k(),a=D(i),r=E(i,n),s="".concat(e,"/integrations/").concat(r??a,"/").concat(t,"/").concat(r??a,".dynamic.js.gz"),[2,j(s)]})})}function Z(i){var t,n,e,a;return(a=(n=(t=i==null?void 0:i.versionSettings)===null||t===void 0?void 0:t.override)!==null&&n!==void 0?n:(e=i==null?void 0:i.versionSettings)===null||e===void 0?void 0:e.version)!==null&&a!==void 0?a:"latest"}var $=function(i,t){var n,e=t.type,a=t.bundlingStatus,r=t.versionSettings,s=a!=="unbundled"&&(e==="browser"||((n=r==null?void 0:r.componentTypes)===null||n===void 0?void 0:n.includes("browser")));return!i.startsWith("Segment")&&i!=="Iterable"&&s},q=function(i,t){var n=t.All===!1&&t[i]===void 0;return t[i]===!1||n};function x(i,t){return f(this,void 0,void 0,function(){var n,e=this;return v(this,function(a){switch(a.label){case 0:return n=[],P()?[2,t]:[4,R(function(){return t.length>0&&T()},function(){return f(e,void 0,void 0,function(){var r,s,u;return v(this,function(o){switch(o.label){case 0:return r=t.pop(),r?[4,G(r,i)]:[2];case 1:return s=o.sent(),u=s instanceof U,u||n.push(r),[2]}})})})];case 1:return a.sent(),n.map(function(r){return t.pushWithBackoff(r)}),[2,t]}})})}var tt=function(){function i(t,n,e,a,r,s){a===void 0&&(a={});var u=this;this.options={},this.type="destination",this.middleware=[],this.initializePromise=B(),this.flushing=!1,this.name=t,this.version=n,this.settings=p({},a),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=s,this.settings.type&&this.settings.type==="browser"&&delete this.settings.type,this.initializePromise.promise.then(function(o){return u._initialized=o},function(){}),this.options=r,this.buffer=r.disableClientPersistence?new Q(4,[]):new W(4,"".concat(e,":dest-").concat(t)),this.scheduleFlush()}return i.prototype.isLoaded=function(){return!!this._ready},i.prototype.ready=function(){var t=this;return this.initializePromise.promise.then(function(){var n;return(n=t.onReady)!==null&&n!==void 0?n:Promise.resolve()})},i.prototype.load=function(t,n){var e;return f(this,void 0,void 0,function(){var a,r,s=this;return v(this,function(u){switch(u.label){case 0:return this._ready||this.onReady!==void 0?[2]:(e=this.integrationSource)!==null&&e!==void 0?(r=e,[3,3]):[3,1];case 1:return[4,X(t,this.name,this.version,this.options.obfuscate)];case 2:r=u.sent(),u.label=3;case 3:a=r,this.integration=K(a,this.settings,n),this.onReady=new Promise(function(o){var d=function(){s._ready=!0,o(!0)};s.integration.once("ready",d)}),this.integration.on("initialize",function(){s.initializePromise.resolve(!0)});try{w(t,{integrationName:this.name,methodName:"initialize",type:"classic"}),this.integration.initialize()}catch(o){throw w(t,{integrationName:this.name,methodName:"initialize",type:"classic",didError:!0}),this.initializePromise.resolve(!1),o}return[2]}})})},i.prototype.unload=function(t,n){return Y(this.name,this.version,this.options.obfuscate)},i.prototype.addMiddleware=function(){for(var t,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.middleware=(t=this.middleware).concat.apply(t,n)},i.prototype.shouldBuffer=function(t){return t.event.type!=="page"&&(P()||this._ready!==!0||this._initialized!==!0)},i.prototype.send=function(t,n,e){var a,r;return f(this,void 0,void 0,function(){var s,u,o,d,c,g;return v(this,function(h){switch(h.label){case 0:return this.shouldBuffer(t)?(this.buffer.push(t),this.scheduleFlush(),[2,t]):(s=(r=(a=this.options)===null||a===void 0?void 0:a.plan)===null||r===void 0?void 0:r.track,u=t.event.event,s&&u&&this.name!=="Segment.io"&&(o=s[u],V(s,o)?t.updateEvent("integrations",p(p({},t.event.integrations),o==null?void 0:o.integrations)):(t.updateEvent("integrations",p(p({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new N({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),o!=null&&o.enabled&&(o==null?void 0:o.integrations[this.name])===!1&&t.cancel(new N({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),[4,C(this.name,t.event,this.middleware)]);case 1:if(d=h.sent(),d===null)return[2,t];c=new n(d,{traverse:!this.disableAutoISOConversion}),w(t,{integrationName:this.name,methodName:e,type:"classic"}),h.label=2;case 2:return h.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,e,c)]:[3,4];case 3:h.sent(),h.label=4;case 4:return[3,6];case 5:throw g=h.sent(),w(t,{integrationName:this.name,methodName:e,type:"classic",didError:!0}),g;case 6:return[2,t]}})})},i.prototype.track=function(t){return f(this,void 0,void 0,function(){return v(this,function(n){return[2,this.send(t,y.Track,"track")]})})},i.prototype.page=function(t){var n;return f(this,void 0,void 0,function(){return v(this,function(e){switch(e.label){case 0:return!((n=this.integration)===null||n===void 0)&&n._assumesPageview&&!this._initialized&&this.integration.initialize(),[4,this.initializePromise.promise];case 1:return e.sent(),[2,this.send(t,y.Page,"page")]}})})},i.prototype.identify=function(t){return f(this,void 0,void 0,function(){return v(this,function(n){return[2,this.send(t,y.Identify,"identify")]})})},i.prototype.alias=function(t){return f(this,void 0,void 0,function(){return v(this,function(n){return[2,this.send(t,y.Alias,"alias")]})})},i.prototype.group=function(t){return f(this,void 0,void 0,function(){return v(this,function(n){return[2,this.send(t,y.Group,"group")]})})},i.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout(function(){return f(t,void 0,void 0,function(){var n;return v(this,function(e){switch(e.label){case 0:return P()||this._ready!==!0||this._initialized!==!0?(this.scheduleFlush(),[2]):(this.flushing=!0,n=this,[4,x(this,this.buffer)]);case 1:return n.buffer=e.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},Math.random()*5e3)},i}();function rt(i,t,n,e,a,r){var s,u;if(n===void 0&&(n={}),e===void 0&&(e={}),F())return[];t.plan&&(e=e??{},e.plan=t.plan);var o=(u=(s=t.middlewareSettings)===null||s===void 0?void 0:s.routingRules)!==null&&u!==void 0?u:[],d=t.integrations,c=e.integrations,g=L(t,e??{}),h=r==null?void 0:r.reduce(function(l,b){var m;return p(p({},l),(m={},m[H(b)]=b,m))},{}),O=new Set(_(_([],Object.keys(d).filter(function(l){return $(l,d[l])}),!0),Object.keys(h||{}).filter(function(l){return S(d[l])||S(c==null?void 0:c[l])}),!0));return Array.from(O).filter(function(l){return!q(l,n)}).map(function(l){var b=d[l],m=Z(b),I=new tt(l,m,i,g[l],e,h==null?void 0:h[l]),A=o.filter(function(M){return M.destinationName===l});return A.length>0&&a&&I.addMiddleware(a),I})}export{tt as LegacyDestination,rt as ajsDestinations};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/auto-track-DPNbzvNG.js","assets/index-CyAwJUFH.js","assets/index-BaH3PnIw.js","assets/index-DRDPElRz.js","assets/is-plan-event-enabled-DS1Agtkw.js","assets/index-2KTRZ_wQ.js","assets/index-CTkTBFvA.js","assets/index-C42TJOmu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as L,a as f,b as Ht,c as C,d as y,e as g,f as x,i as se,g as U}from"./index-CyAwJUFH.js";function Xe(e,t,r){t.split&&(t=t.split("."));for(var n=0,i=t.length,o=e,a,u;n<i&&(u=""+t[n++],!(u==="__proto__"||u==="constructor"||u==="prototype"));)o=o[u]=n===i?r:typeof(a=o[u])==typeof t?a:t[n]*0!==0||~(""+t[n]).indexOf(".")?{}:[]}var Rr=function(e,t){return Object.keys(e).filter(function(r){return t(r,e[r])}).reduce(function(r,n){return r[n]=e[n],r},{})},oe=function(e){L(t,e);function t(r,n){var i=e.call(this,"".concat(r," ").concat(n))||this;return i.field=r,i}return t}(Error);function ee(e){return typeof e=="string"}function Ye(e){return typeof e=="number"}function he(e){return typeof e=="function"}function Lr(e){return e!=null}function q(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()==="object"}var st="is not a string",ct="is not an object",Nr="is nil";function qr(e){if(!Lr(e))throw new oe("Event",Nr);if(typeof e!="object")throw new oe("Event",ct)}function Ur(e){if(!ee(e.type))throw new oe(".type",st)}function $r(e){if(!ee(e.event))throw new oe(".event",st)}function zr(e){if(!q(e.properties))throw new oe(".properties",ct)}function Br(e){if(!q(e.traits))throw new oe(".traits",ct)}function Kr(e){if(!ee(e.messageId))throw new oe(".messageId",st)}function Vr(e){qr(e),Ur(e),Kr(e),e.type==="track"&&($r(e),zr(e)),["group","identify"].includes(e.type)&&Br(e)}var Gr=function(){function e(t){var r,n;this.settings=t,this.createMessageId=t.createMessageId,this.onEventMethodCall=(r=t.onEventMethodCall)!==null&&r!==void 0?r:function(){},this.onFinishedEvent=(n=t.onFinishedEvent)!==null&&n!==void 0?n:function(){}}return e}(),Jr=function(){function e(t){this.settings=new Gr(t)}return e.prototype.track=function(t,r,n,i){return this.settings.onEventMethodCall({type:"track",options:n}),this.normalize(f(f({},this.baseEvent()),{event:t,type:"track",properties:r??{},options:f({},n),integrations:f({},i)}))},e.prototype.page=function(t,r,n,i,o){var a;this.settings.onEventMethodCall({type:"page",options:i});var u={type:"page",properties:f({},n),options:f({},i),integrations:f({},o)};return t!==null&&(u.category=t,u.properties=(a=u.properties)!==null&&a!==void 0?a:{},u.properties.category=t),r!==null&&(u.name=r),this.normalize(f(f({},this.baseEvent()),u))},e.prototype.screen=function(t,r,n,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var a={type:"screen",properties:f({},n),options:f({},i),integrations:f({},o)};return t!==null&&(a.category=t),r!==null&&(a.name=r),this.normalize(f(f({},this.baseEvent()),a))},e.prototype.identify=function(t,r,n,i){return this.settings.onEventMethodCall({type:"identify",options:n}),this.normalize(f(f({},this.baseEvent()),{type:"identify",userId:t,traits:r??{},options:f({},n),integrations:i}))},e.prototype.group=function(t,r,n,i){return this.settings.onEventMethodCall({type:"group",options:n}),this.normalize(f(f({},this.baseEvent()),{type:"group",traits:r??{},options:f({},n),integrations:f({},i),groupId:t}))},e.prototype.alias=function(t,r,n,i){this.settings.onEventMethodCall({type:"alias",options:n});var o={userId:t,type:"alias",options:f({},n),integrations:f({},i)};return r!==null&&(o.previousId=r),t===void 0?this.normalize(f(f({},o),this.baseEvent())):this.normalize(f(f({},this.baseEvent()),o))},e.prototype.baseEvent=function(){return{integrations:{},options:{}}},e.prototype.context=function(t){var r,n=["userId","anonymousId","timestamp","messageId"];delete t.integrations;var i=Object.keys(t),o=(r=t.context)!==null&&r!==void 0?r:{},a={};return i.forEach(function(u){u!=="context"&&(n.includes(u)?Xe(a,u,t[u]):Xe(o,u,t[u]))}),[o,a]},e.prototype.normalize=function(t){var r,n,i=Object.keys((r=t.integrations)!==null&&r!==void 0?r:{}).reduce(function(p,h){var v,m;return f(f({},p),(v={},v[h]=!!(!((m=t.integrations)===null||m===void 0)&&m[h]),v))},{});t.options=Rr(t.options||{},function(p,h){return h!==void 0});var o=f(f({},i),(n=t.options)===null||n===void 0?void 0:n.integrations),a=t.options?this.context(t.options):[],u=a[0],s=a[1],c=t.options,l=Ht(t,["options"]),d=f(f(f(f({timestamp:new Date},l),{context:u,integrations:o}),s),{messageId:c.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(d),Vr(d),d},e}();function Wr(e,t){return new Promise(function(r,n){var i=setTimeout(function(){n(Error("Promise timed out"))},t);e.then(function(o){return clearTimeout(i),r(o)}).catch(n)})}function Qr(e){return new Promise(function(t){return setTimeout(t,e)})}function Hr(e,t,r){var n=function(){try{return Promise.resolve(t(e))}catch(i){return Promise.reject(i)}};return Qr(r).then(function(){return Wr(n(),1e3)}).catch(function(i){e==null||e.log("warn","Callback Error",{error:i}),e==null||e.stats.increment("callback_error")}).then(function(){return e})}var Xt=function(){var e,t,r=!1,n=new Promise(function(i,o){e=function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];r=!0,i.apply(void 0,a)},t=function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];r=!0,o.apply(void 0,a)}});return{resolve:e,reject:t,promise:n,isSettled:function(){return r}}},lt=function(){function e(t){var r;this.callbacks={},this.warned=!1,this.maxListeners=(r=t==null?void 0:t.maxListeners)!==null&&r!==void 0?r:10}return e.prototype.warnIfPossibleMemoryLeak=function(t){this.warned||this.maxListeners&&this.callbacks[t].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(t)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},e.prototype.on=function(t,r){return this.callbacks[t]?(this.callbacks[t].push(r),this.warnIfPossibleMemoryLeak(t)):this.callbacks[t]=[r],this},e.prototype.once=function(t,r){var n=this,i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n.off(t,i),r.apply(n,o)};return this.on(t,i),this},e.prototype.off=function(t,r){var n,i=(n=this.callbacks[t])!==null&&n!==void 0?n:[],o=i.filter(function(a){return a!==r});return this.callbacks[t]=o,this},e.prototype.emit=function(t){for(var r=this,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var a=(n=this.callbacks[t])!==null&&n!==void 0?n:[];return a.forEach(function(u){u.apply(r,i)}),this},e}();function Xr(e){var t=Math.random()+1,r=e.minTimeout,n=r===void 0?500:r,i=e.factor,o=i===void 0?2:i,a=e.attempt,u=e.maxTimeout,s=u===void 0?1/0:u;return Math.min(t*n*Math.pow(o,a),s)}var Yt="onRemoveFromFuture",ft=function(e){L(t,e);function t(r,n,i){var o=e.call(this)||this;return o.future=[],o.maxAttempts=r,o.queue=n,o.seen=i??{},o}return t.prototype.push=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=n.map(function(a){var u=r.updateAttempts(a);return u>r.maxAttempts||r.includes(a)?!1:(r.queue.push(a),!0)});return this.queue=this.queue.sort(function(a,u){return r.getAttempts(a)-r.getAttempts(u)}),o},t.prototype.pushWithBackoff=function(r,n){var i=this;if(n===void 0&&(n=0),n==0&&this.getAttempts(r)===0)return this.push(r)[0];var o=this.updateAttempts(r);if(o>this.maxAttempts||this.includes(r))return!1;var a=Xr({attempt:o-1});return n>0&&a<n&&(a=n),setTimeout(function(){i.queue.push(r),i.future=i.future.filter(function(u){return u.id!==r.id}),i.emit(Yt)},a),this.future.push(r),!0},t.prototype.getAttempts=function(r){var n;return(n=this.seen[r.id])!==null&&n!==void 0?n:0},t.prototype.updateAttempts=function(r){return this.seen[r.id]=this.getAttempts(r)+1,this.getAttempts(r)},t.prototype.includes=function(r){return this.queue.includes(r)||this.future.includes(r)||!!this.queue.find(function(n){return n.id===r.id})||!!this.future.find(function(n){return n.id===r.id})},t.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(t.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),t}(lt),ne=256,Ce=[],Ae;for(;ne--;)Ce[ne]=(ne+256).toString(16).substring(1);function dt(){var e=0,t,r="";if(!Ae||ne+16>256){for(Ae=Array(e=256);e--;)Ae[e]=256*Math.random()|0;e=ne=0}for(;e<16;e++)t=Ae[ne+e],e==6?r+=Ce[t&15|64]:e==8?r+=Ce[t&63|128]:r+=Ce[t],e&1&&e>1&&e<11&&(r+="-");return ne++,r}var Yr=function(){function e(){this._logs=[]}return e.prototype.log=function(t,r,n){var i=new Date;this._logs.push({level:t,message:r,time:i,extras:n})},Object.defineProperty(e.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),e.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(r,n){var i,o,a,u=f(f({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete u.time;var s=(a=(o=n.time)===null||o===void 0?void 0:o.toISOString())!==null&&a!==void 0?a:"";return r[s]&&(s="".concat(s,"-").concat(Math.random())),f(f({},r),(i={},i[s]=u,i))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(r){var n=r.level,i=r.message,o=r.extras;n==="info"||n==="debug"?console.log(i,o??""):console[n](i,o??"")});this._logs=[]},e}(),Zr=function(e){var t={gauge:"g",counter:"c"};return t[e]},Zt=function(){function e(){this.metrics=[]}return e.prototype.increment=function(t,r,n){r===void 0&&(r=1),this.metrics.push({metric:t,value:r,tags:n??[],type:"counter",timestamp:Date.now()})},e.prototype.gauge=function(t,r,n){this.metrics.push({metric:t,value:r,tags:n??[],type:"gauge",timestamp:Date.now()})},e.prototype.flush=function(){var t=this.metrics.map(function(r){return f(f({},r),{tags:r.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},e.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:Zr(t.type),e:t.timestamp}})},e}(),en=function(e){L(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.gauge=function(){},t.prototype.increment=function(){},t.prototype.flush=function(){},t.prototype.serialize=function(){return[]},t}(Zt),ae=function(){function e(t){var r,n,i;this.retry=(r=t.retry)!==null&&r!==void 0?r:!0,this.type=(n=t.type)!==null&&n!==void 0?n:"plugin Error",this.reason=(i=t.reason)!==null&&i!==void 0?i:""}return e}(),ke=function(){function e(t,r,n,i){r===void 0&&(r=dt()),n===void 0&&(n=new en),i===void 0&&(i=new Yr),this.attempts=0,this.event=t,this._id=r,this.logger=i,this.stats=n}return e.system=function(){},e.prototype.isSame=function(t){return t.id===this.id},e.prototype.cancel=function(t){throw t||new ae({reason:"Context Cancel"})},e.prototype.log=function(t,r,n){this.logger.log(t,r,n)},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),e.prototype.updateEvent=function(t,r){var n;if(t.split(".")[0]==="integrations"){var i=t.split(".")[1];if(((n=this.event.integrations)===null||n===void 0?void 0:n[i])===!1)return this.event}return Xe(this.event,t,r),this.event},e.prototype.failedDelivery=function(){return this._failedDelivery},e.prototype.setFailedDelivery=function(t){this._failedDelivery=t},e.prototype.logs=function(){return this.logger.logs},e.prototype.flush=function(){this.logger.flush(),this.stats.flush()},e.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},e}();function tn(e,t){var r={};return e.forEach(function(n){var i,o=void 0;{var a=n[t];o=typeof a!="string"?JSON.stringify(a):a}o!==void 0&&(r[o]=C(C([],(i=r[o])!==null&&i!==void 0?i:[],!0),[n],!1))}),r}var rn=function(e){return typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"},nn=function(){var e,t,r=0;return{done:function(){return e},run:function(n){var i=n();return rn(i)&&(++r===1&&(e=new Promise(function(o){return t=o})),i.finally(function(){return--r===0&&t()})),i}}};function on(e){return y(this,void 0,void 0,function(){var t;return g(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e()];case 1:return[2,r.sent()];case 2:return t=r.sent(),[2,Promise.reject(t)];case 3:return[2]}})})}function we(e,t){e.log("debug","plugin",{plugin:t.name});var r=new Date().getTime(),n=t[e.event.type];if(n===void 0)return Promise.resolve(e);var i=on(function(){return n.apply(t,[e])}).then(function(o){var a=new Date().getTime()-r;return o.stats.gauge("plugin_time",a,["plugin:".concat(t.name)]),o}).catch(function(o){if(o instanceof ae&&o.type==="middleware_cancellation")throw o;return o instanceof ae?(e.log("warn",o.type,{plugin:t.name,error:o}),o):(e.log("error","plugin Error",{plugin:t.name,error:o}),e.stats.increment("plugin_error",1,["plugin:".concat(t.name)]),o)});return i}function an(e,t){return we(e,t).then(function(r){if(r instanceof ke)return r;e.log("debug","Context canceled"),e.stats.increment("context_canceled"),e.cancel(r)})}var un=function(e){L(t,e);function t(r){var n=e.call(this)||this;return n.criticalTasks=nn(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=r,n.queue.on(Yt,function(){n.scheduleFlush(0)}),n}return t.prototype.register=function(r,n,i){return y(this,void 0,void 0,function(){var o,a,u=this;return g(this,function(s){switch(s.label){case 0:return this.plugins.push(n),o=function(c){u.failedInitializations.push(n.name),u.emit("initialization_failure",n),console.warn(n.name,c),r.log("warn","Failed to load destination",{plugin:n.name,error:c}),u.plugins=u.plugins.filter(function(l){return l!==n})},n.type==="destination"&&n.name!=="Segment.io"?(n.load(r,i).catch(o),[3,4]):[3,1];case 1:return s.trys.push([1,3,,4]),[4,n.load(r,i)];case 2:return s.sent(),[3,4];case 3:return a=s.sent(),o(a),[3,4];case 4:return[2]}})})},t.prototype.deregister=function(r,n,i){return y(this,void 0,void 0,function(){var o;return g(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(r,i))]:[3,2];case 1:a.sent(),a.label=2;case 2:return this.plugins=this.plugins.filter(function(u){return u.name!==n.name}),[3,4];case 3:return o=a.sent(),r.log("warn","Failed to unload destination",{plugin:n.name,error:o}),[3,4];case 4:return[2]}})})},t.prototype.dispatch=function(r){return y(this,void 0,void 0,function(){var n;return g(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.push(r),n=this.subscribeToDelivery(r),this.scheduleFlush(0),[2,n]})})},t.prototype.subscribeToDelivery=function(r){return y(this,void 0,void 0,function(){var n=this;return g(this,function(i){return[2,new Promise(function(o){var a=function(u,s){u.isSame(r)&&(n.off("flush",a),o(u))};n.on("flush",a)})]})})},t.prototype.dispatchSingle=function(r){return y(this,void 0,void 0,function(){var n=this;return g(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.updateAttempts(r),r.attempts=1,[2,this.deliver(r).catch(function(o){var a=n.enqueuRetry(o,r);return a?n.subscribeToDelivery(r):(r.setFailedDelivery({reason:o}),r)})]})})},t.prototype.isEmpty=function(){return this.queue.length===0},t.prototype.scheduleFlush=function(r){var n=this;r===void 0&&(r=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},r))},t.prototype.deliver=function(r){return y(this,void 0,void 0,function(){var n,i,o,a;return g(this,function(u){switch(u.label){case 0:return[4,this.criticalTasks.done()];case 1:u.sent(),n=Date.now(),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,this.flushOne(r)];case 3:return r=u.sent(),i=Date.now()-n,this.emit("delivery_success",r),r.stats.gauge("delivered",i),r.log("debug","Delivered",r.event),[2,r];case 4:throw o=u.sent(),a=o,r.log("error","Failed to deliver",a),this.emit("delivery_failure",r,a),r.stats.increment("delivery_failed"),o;case 5:return[2]}})})},t.prototype.enqueuRetry=function(r,n){var i=!(r instanceof ae)||r.retry;return i?this.queue.pushWithBackoff(n):!1},t.prototype.flush=function(){return y(this,void 0,void 0,function(){var r,n,i;return g(this,function(o){switch(o.label){case 0:if(this.queue.length===0)return[2,[]];if(r=this.queue.pop(),!r)return[2,[]];r.attempts=this.queue.getAttempts(r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(r)];case 2:return r=o.sent(),this.emit("flush",r,!0),[3,4];case 3:return n=o.sent(),i=this.enqueuRetry(n,r),i||(r.setFailedDelivery({reason:n}),this.emit("flush",r,!1)),[2,[]];case 4:return[2,[r]]}})})},t.prototype.isReady=function(){return!0},t.prototype.availableExtensions=function(r){var n=this.plugins.filter(function(h){var v,m,S;if(h.type!=="destination"&&h.name!=="Segment.io")return!0;var w=void 0;return(v=h.alternativeNames)===null||v===void 0||v.forEach(function(b){r[b]!==void 0&&(w=r[b])}),(S=(m=r[h.name])!==null&&m!==void 0?m:w)!==null&&S!==void 0?S:(h.name==="Segment.io"?!0:r.All)!==!1}),i=tn(n,"type"),o=i.before,a=o===void 0?[]:o,u=i.enrichment,s=u===void 0?[]:u,c=i.destination,l=c===void 0?[]:c,d=i.after,p=d===void 0?[]:d;return{before:a,enrichment:s,destinations:l,after:p}},t.prototype.flushOne=function(r){var n,i;return y(this,void 0,void 0,function(){var o,a,u,s,c,l,v,d,p,h,v,m,S,w,b;return g(this,function(E){switch(E.label){case 0:if(!this.isReady())throw new Error("Not ready");r.attempts>1&&this.emit("delivery_retry",r),o=this.availableExtensions((n=r.event.integrations)!==null&&n!==void 0?n:{}),a=o.before,u=o.enrichment,s=0,c=a,E.label=1;case 1:return s<c.length?(l=c[s],[4,an(r,l)]):[3,4];case 2:v=E.sent(),v instanceof ke&&(r=v),this.emit("message_enriched",r,l),E.label=3;case 3:return s++,[3,1];case 4:d=0,p=u,E.label=5;case 5:return d<p.length?(h=p[d],[4,we(r,h)]):[3,8];case 6:v=E.sent(),v instanceof ke&&(r=v),this.emit("message_enriched",r,h),E.label=7;case 7:return d++,[3,5];case 8:return m=this.availableExtensions((i=r.event.integrations)!==null&&i!==void 0?i:{}),S=m.destinations,w=m.after,[4,new Promise(function(O,I){setTimeout(function(){var M=S.map(function(D){return we(r,D)});Promise.all(M).then(O).catch(I)},0)})];case 9:return E.sent(),r.stats.increment("message_delivered"),this.emit("message_delivered",r),b=w.map(function(O){return we(r,O)}),[4,Promise.all(b)];case 10:return E.sent(),[2,r]}})})},t}(lt),sn=function(e,t){var r=Date.now()-e;return Math.max((t??300)-r,0)};function cn(e,t,r,n){return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return r.emit("dispatch_start",e),i=Date.now(),t.isEmpty()?[4,t.dispatchSingle(e)]:[3,2];case 1:return o=a.sent(),[3,4];case 2:return[4,t.dispatch(e)];case 3:o=a.sent(),a.label=4;case 4:return n!=null&&n.callback?[4,Hr(o,n.callback,sn(i,n.timeout))]:[3,6];case 5:o=a.sent(),a.label=6;case 6:return n!=null&&n.debug&&o.flush(),[2,o]}})})}function er(e,t,r,n){var i,o=[e,t,r,n],a=q(e)?e.event:e;if(!a||!ee(a))throw new Error("Event missing");var u=q(e)?(i=e.properties)!==null&&i!==void 0?i:{}:q(t)?t:{},s={};he(r)||(s=r??{}),q(e)&&!he(t)&&(s=t??{});var c=o.find(he);return[a,u,s,c]}function Ze(e,t,r,n,i){var o,a,u=null,s=null,c=[e,t,r,n,i],l=c.filter(ee);l.length===1?ee(c[1])?(s=c[1],u=null):(s=l[0],u=null):l.length===2&&(typeof c[0]=="string"&&(u=c[0]),typeof c[1]=="string"&&(s=c[1]));var d=c.find(he),p=c.filter(q);return p.length===1?q(c[2])?(a={},o=c[2]):q(c[3])?(o={},a=c[3]):(o=p[0],a={}):p.length===2&&(o=p[0],a=p[1]),[u,s,o??(o={}),a??(a={}),d]}var et=function(e){return function(){for(var t,r,n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var a={},u=["callback","options","traits","id"],s=0,c=i;s<c.length;s++){var l=c[s],d=u.pop();if(d==="id"){if(ee(l)||Ye(l)){a.id=l.toString();continue}if(l==null)continue;d=u.pop()}if((d==="traits"||d==="options")&&(l==null||q(l))&&(a[d]=l),he(l)){a.callback=l;break}}return[(t=a.id)!==null&&t!==void 0?t:e.id(),(r=a.traits)!==null&&r!==void 0?r:{},(n=a.options)!==null&&n!==void 0?n:{},a.callback]}};function tr(e,t,r,n){Ye(e)&&(e=e.toString()),Ye(t)&&(t=t.toString());var i=[e,t,r,n],o=i.filter(ee),a=o[0],u=a===void 0?e:a,s=o[1],c=s===void 0?null:s,l=i.filter(q)[0],d=l===void 0?{}:l,p=i.find(he);return[u,c,d,p]}function vt(){return typeof window<"u"}function So(){return!vt()}function ln(){return vt()?window.navigator.onLine:!0}function Se(){return!ln()}function fn(e,t){return t=t||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],a=[],u={},s=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:s,headers:{keys:function(){return o},entries:function(){return a},get:function(l){return u[l.toLowerCase()]},has:function(l){return l.toLowerCase()in u}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(l,d,p){o.push(d=d.toLowerCase()),a.push([d,p]),u[d]=u[d]?u[d]+","+p:p}),r(s())},i.onerror=n,i.withCredentials=t.credentials=="include",t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)})}var ht=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},Te=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=ht();return(r&&r.fetch||fn).apply(void 0,e)},je="1.79.0",rr="api.segment.io/v1",dn=function(e,t,r){var n=t.reduce(function(i,o){var a=o.split(":"),u=a[0],s=a[1];return i[u]=s,i},{});return{type:"Counter",metric:e,value:1,tags:f(f({},n),{library:"analytics.js",library_version:"npm:next-".concat(je)})}};function Ve(e){console.error("Error sending segment performance metrics",e)}var vn=function(){function e(t){var r=this,n,i,o,a,u;if(this.host=(n=t==null?void 0:t.host)!==null&&n!==void 0?n:rr,this.sampleRate=(i=t==null?void 0:t.sampleRate)!==null&&i!==void 0?i:1,this.flushTimer=(o=t==null?void 0:t.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(a=t==null?void 0:t.maxQueueSize)!==null&&a!==void 0?a:20,this.protocol=(u=t==null?void 0:t.protocol)!==null&&u!==void 0?u:"https",this.queue=[],this.sampleRate>0){var s=!1,c=function(){s||(s=!0,r.flush().catch(Ve),s=!1,setTimeout(c,r.flushTimer))};c()}}return e.prototype.increment=function(t,r){if(t.includes("analytics_js.")&&r.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var n=dn(t,r);this.queue.push(n),t.includes("error")&&this.flush().catch(Ve)}},e.prototype.flush=function(){return y(this,void 0,void 0,function(){var t=this;return g(this,function(r){switch(r.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(n){Ve(n),t.sampleRate=0})];case 1:return r.sent(),[2]}})})},e.prototype.send=function(){return y(this,void 0,void 0,function(){var t,r,n;return g(this,function(i){return t={series:this.queue},this.queue=[],r={"Content-Type":"text/plain"},n="".concat(this.protocol,"://").concat(this.host,"/m"),[2,Te(n,{headers:r,body:JSON.stringify(t),method:"POST"})]})})},e}(),Oe,nr=function(e){L(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.initRemoteMetrics=function(r){Oe=new vn(r)},t.prototype.increment=function(r,n,i){e.prototype.increment.call(this,r,n,i),Oe==null||Oe.increment(r,i??[])},t}(Zt),K=function(e){L(t,e);function t(r,n){return e.call(this,r,n,new nr)||this}return t.system=function(){return new this({type:"track",event:"system"})},t}(ke),ir="bpc",or=function(e,t,r,n,i,o){return{__t:ir,c:t,p:n,u:e,s:r,t:i,r:o}},hn=Object.keys(or("","","","","",""));function pn(e){if(!q(e)||e.__t!==ir)return!1;for(var t in e)if(!hn.includes(t))return!1;return!0}var yn=function(e,t){return e.indexOf("?")>-1?e:e+t},gn=function(e){var t=e.indexOf("#");return t===-1?e:e.slice(0,t)},mn=function(e){try{return new URL(e).pathname}catch{return e[0]==="/"?e:"/"+e}},ar=function(e){var t=e.c,r=e.p,n=e.s,i=e.u,o=e.r,a=e.t,u=t?mn(t):r,s=t?yn(t,n):gn(i);return{path:u,referrer:o,search:n,title:a,url:s}},ur=function(){var e=document.querySelector("link[rel='canonical']");return or(location.href,e&&e.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},bn=function(){return ar(ur())};function _n(e,t){return Object.assign.apply(Object,C([{}],t.map(function(r){var n;if(e&&Object.prototype.hasOwnProperty.call(e,r))return n={},n[r]=e[r],n}),!1))}var le=function(e,t){t===void 0&&(t=bn());var r=e.context,n;e.type==="page"&&(n=e.properties&&_n(e.properties,Object.keys(t)),e.properties=f(f(f({},t),e.properties),e.name?{name:e.name}:{})),r.page=f(f(f({},t),n),r.page)},sr=function(e){L(t,e);function t(r){var n=e.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(dt())},onEventMethodCall:function(i){var o=i.options;n.maybeUpdateAnonId(o)},onFinishedEvent:function(i){return n.addIdentity(i),i}})||this;return n.user=r,n}return t.prototype.maybeUpdateAnonId=function(r){r!=null&&r.anonymousId&&this.user.anonymousId(r.anonymousId)},t.prototype.addIdentity=function(r){this.user.id()&&(r.userId=this.user.id()),this.user.anonymousId()&&(r.anonymousId=this.user.anonymousId())},t.prototype.track=function(r,n,i,o,a){var u=e.prototype.track.call(this,r,n,i,o);return le(u,a),u},t.prototype.page=function(r,n,i,o,a,u){var s=e.prototype.page.call(this,r,n,i,o,a);return le(s,u),s},t.prototype.screen=function(r,n,i,o,a,u){var s=e.prototype.screen.call(this,r,n,i,o,a);return le(s,u),s},t.prototype.identify=function(r,n,i,o,a){var u=e.prototype.identify.call(this,r,n,i,o);return le(u,a),u},t.prototype.group=function(r,n,i,o,a){var u=e.prototype.group.call(this,r,n,i,o);return le(u,a),u},t.prototype.alias=function(r,n,i,o,a){var u=e.prototype.alias.call(this,r,n,i,o);return le(u,a),u},t}(Jr),cr=function(e){return"addMiddleware"in e&&e.type==="destination"},V={getItem:function(){},setItem:function(){},removeItem:function(){}};try{V=vt()&&window.localStorage?window.localStorage:V}catch(e){console.warn("Unable to access localStorage",e)}function lr(e){var t=V.getItem(e);return(t?JSON.parse(t):[]).map(function(r){return new K(r.event,r.id)})}function wn(e,t){var r=lr(e),n=C(C([],t,!0),r,!0),i=n.reduce(function(o,a){var u;return f(f({},o),(u={},u[a.id]=a,u))},{});V.setItem(e,JSON.stringify(Object.values(i)))}function fr(e){var t=V.getItem(e);return t?JSON.parse(t):{}}function Sn(e,t){var r=fr(e);V.setItem(e,JSON.stringify(f(f({},r),t)))}function Ut(e){V.removeItem(e)}var En=function(){return new Date().getTime()};function tt(e,t,r){r===void 0&&(r=0);var n=50,i="persisted-queue:v1:".concat(e,":lock"),o=function(c){return new Date().getTime()>c},a=V.getItem(i),u=a?JSON.parse(a):null,s=u===null||o(u);if(s){V.setItem(i,JSON.stringify(En()+n)),t(),V.removeItem(i);return}!s&&r<3?setTimeout(function(){tt(e,t,r+1)},n):console.error("Unable to retrieve lock")}var pt=function(e){L(t,e);function t(r,n){var i=e.call(this,r,[])||this,o="persisted-queue:v1:".concat(n,":items"),a="persisted-queue:v1:".concat(n,":seen"),u=[],s={};return tt(n,function(){try{u=lr(o),s=fr(a),Ut(o),Ut(a),i.queue=C(C([],u,!0),i.queue,!0),i.seen=f(f({},s),i.seen)}catch(c){console.error(c)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var c=C(C([],i.queue,!0),i.future,!0);try{tt(n,function(){wn(o,c),Sn(a,i.seen)})}catch(l){console.error(l)}}}),i}return t}(ft),In=function(e){L(t,e);function t(r){return e.call(this,typeof r=="string"?new pt(4,r):r)||this}return t.prototype.flush=function(){return y(this,void 0,void 0,function(){return g(this,function(r){return Se()?[2,[]]:[2,e.prototype.flush.call(this)]})})},t}(un);function yt(e){for(var t=e.constructor.prototype,r=0,n=Object.getOwnPropertyNames(t);r<n.length;r++){var i=n[r];if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);o&&typeof o.value=="function"&&(e[i]=e[i].bind(e))}}return e}/*! js-cookie v3.0.1 | MIT */function Me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var Pn={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function rt(e,t){function r(i,o,a){if(!(typeof document>"u")){a=Me({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var s in a)a[s]&&(u+="; "+s,a[s]!==!0&&(u+="="+a[s].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+u}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},u=0;u<o.length;u++){var s=o[u].split("="),c=s.slice(1).join("=");try{var l=decodeURIComponent(s[0]);if(a[l]=e.read(c,l),i===l)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",Me({},o,{expires:-1}))},withAttributes:function(i){return rt(this.converter,Me({},this.attributes,i))},withConverter:function(i){return rt(Me({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var W=rt(Pn,{path:"/"});function An(e){var t=e.hostname,r=t.split("."),n=r[r.length-1],i=[];if(r.length===4&&parseInt(n,10)>0||r.length<=1)return i;for(var o=r.length-2;o>=0;--o)i.push(r.slice(o).join("."));return i}function On(e){try{return new URL(e)}catch{return}}function dr(e){var t=On(e);if(t)for(var r=An(t),n=0;n<r.length;++n){var i="__tld__",o=r[n],a={domain:"."+o};try{if(W.set(i,"1",a),W.get(i))return W.remove(i,a),o}catch{return}}}var Mn=365,vr=function(){function e(t){t===void 0&&(t=e.defaults),this.options=f(f({},e.defaults),t)}return Object.defineProperty(e,"defaults",{get:function(){return{maxage:Mn,domain:dr(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),e.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},e.prototype.get=function(t){var r;try{var n=W.get(t);if(n==null)return null;try{return(r=JSON.parse(n))!==null&&r!==void 0?r:null}catch{return n??null}}catch{return null}},e.prototype.set=function(t,r){typeof r=="string"?W.set(t,r,this.opts()):r===null?W.remove(t,this.opts()):W.set(t,JSON.stringify(r),this.opts())},e.prototype.remove=function(t){return W.remove(t,this.opts())},e}(),xn=function(){function e(){}return e.prototype.localStorageWarning=function(t,r){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(r))},e.prototype.get=function(t){var r;try{var n=localStorage.getItem(t);if(n===null)return null;try{return(r=JSON.parse(n))!==null&&r!==void 0?r:null}catch{return n??null}}catch{return this.localStorageWarning(t,"unavailable"),null}},e.prototype.set=function(t,r){try{localStorage.setItem(t,JSON.stringify(r))}catch{this.localStorageWarning(t,"full")}},e.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch{this.localStorageWarning(t,"unavailable")}},e}(),gt=function(){function e(){this.cache={}}return e.prototype.get=function(t){var r;return(r=this.cache[t])!==null&&r!==void 0?r:null},e.prototype.set=function(t,r){this.cache[t]=r},e.prototype.remove=function(t){delete this.cache[t]},e}(),j={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function hr(e){return e&&e.stores&&Array.isArray(e.stores)&&e.stores.every(function(t){return Object.values(j).includes(t)})}function Cn(e){return typeof e=="object"&&e.name!==void 0}var Ge=function(e,t,r,n){console.warn("".concat(e.constructor.name,": Can't ").concat(t,' key "').concat(r,'" | Err: ').concat(n))},Z=function(){function e(t){this.stores=t}return e.prototype.get=function(t){for(var r=null,n=0,i=this.stores;n<i.length;n++){var o=i[n];try{if(r=o.get(t),r!=null)return r}catch(a){Ge(o,"get",t,a)}}return null},e.prototype.set=function(t,r){this.stores.forEach(function(n){try{n.set(t,r)}catch(i){Ge(n,"set",t,i)}})},e.prototype.clear=function(t){this.stores.forEach(function(r){try{r.remove(t)}catch(n){Ge(r,"remove",t,n)}})},e.prototype.getAndSync=function(t){var r=this.get(t),n=typeof r=="number"?r.toString():r;return this.set(t,n),n},e}();function nt(e){var t=e.map(function(r){var n,i;switch(Cn(r)?(n=r.name,i=r.settings):n=r,n){case j.Cookie:return new vr(i);case j.LocalStorage:return new xn;case j.Memory:return new gt;default:throw new Error("Unknown Store Type: ".concat(r))}});return t}function pr(e,t){return e.map(function(r){return t&&r===j.Cookie?{name:r,settings:t}:r})}var re={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},mt=function(){function e(t,r){t===void 0&&(t=re);var n=this,i,o,a,u;this.options={},this.id=function(c){if(n.options.disable)return null;var l=n.identityStore.getAndSync(n.idKey);if(c!==void 0){n.identityStore.set(n.idKey,c);var d=c!==l&&l!==null&&c!==null;d&&n.anonymousId(null)}var p=n.identityStore.getAndSync(n.idKey);if(p)return p;var h=n.legacyUserStore.get(re.cookie.oldKey);return h?typeof h=="object"?h.id:h:null},this.anonymousId=function(c){var l,d;if(n.options.disable)return null;if(c===void 0){var p=(l=n.identityStore.getAndSync(n.anonKey))!==null&&l!==void 0?l:(d=n.legacySIO())===null||d===void 0?void 0:d[0];if(p)return p}return c===null?(n.identityStore.set(n.anonKey,null),n.identityStore.getAndSync(n.anonKey)):(n.identityStore.set(n.anonKey,c??dt()),n.identityStore.getAndSync(n.anonKey))},this.traits=function(c){var l;if(!n.options.disable)return c===null&&(c={}),c&&n.traitsStore.set(n.traitsKey,c??{}),(l=n.traitsStore.get(n.traitsKey))!==null&&l!==void 0?l:{}},this.options=f(f({},re),t),this.cookieOptions=r,this.idKey=(o=(i=t.cookie)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:re.cookie.key,this.traitsKey=(u=(a=t.localStorage)===null||a===void 0?void 0:a.key)!==null&&u!==void 0?u:re.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,r),this.legacyUserStore=this.createStorage(this.options,r,function(c){return c===j.Cookie}),this.traitsStore=this.createStorage(this.options,r,function(c){return c!==j.Cookie});var s=this.legacyUserStore.get(re.cookie.oldKey);s&&typeof s=="object"&&(s.id&&this.id(s.id),s.traits&&this.traits(s.traits)),yt(this)}return e.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var r=t.split("----"),n=r[0],i=r[1];return[n,i]},e.prototype.identify=function(t,r){if(!this.options.disable){r=r??{};var n=this.id();(n===null||n===t)&&(r=f(f({},this.traits()),r)),t&&this.id(t),this.traits(r)}},e.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},e.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},e.prototype.load=function(){return new e(this.options,this.cookieOptions)},e.prototype.save=function(){return!0},e.prototype.createStorage=function(t,r,n){var i=[j.LocalStorage,j.Cookie,j.Memory];return t.disable?new Z([]):t.persist?(t.storage!==void 0&&t.storage!==null&&hr(t.storage)&&(i=t.storage.stores),t.localStorageFallbackDisabled&&(i=i.filter(function(o){return o!==j.LocalStorage})),n&&(i=i.filter(n)),new Z(nt(pr(i,r)))):new Z([new gt])},e.defaults=re,e}(),$t={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},yr=function(e){L(t,e);function t(r,n){r===void 0&&(r=$t);var i=e.call(this,f(f({},$t),r),n)||this;return i.anonymousId=function(o){},yt(i),i}return t}(mt),bt="analytics";function _t(){return window[bt]}function Dn(e){bt=e}function kn(e){window[bt]=e}var Fn=function(e){return typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"},gr=function(e,t,r){r.getAndRemove(e).forEach(function(n){Re(t,n).catch(console.error)})},Tn=function(e,t){return y(void 0,void 0,void 0,function(){var r,n,i;return g(this,function(o){switch(o.label){case 0:r=0,n=t.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return r<n.length?(i=n[r],[4,Re(e,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},jn=function(e,t){return y(void 0,void 0,void 0,function(){var r,n,i;return g(this,function(o){switch(o.label){case 0:r=0,n=t.getAndRemove("register"),o.label=1;case 1:return r<n.length?(i=n[r],[4,Re(e,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},Rn=gr.bind(void 0,"on"),Ln=gr.bind(void 0,"setAnonymousId"),Nn=function(e,t){Object.keys(t.calls).forEach(function(r){t.getAndRemove(r).forEach(function(n){setTimeout(function(){Re(e,n).catch(console.error)},0)})})},fe=function(e){if(mr(e)){var t=e.pop();return ar(t)}},mr=function(e){var t=e[e.length-1];return pn(t)},it=function(){function e(t,r,n,i){n===void 0&&(n=function(){}),i===void 0&&(i=console.error),this.method=t,this.resolve=n,this.reject=i,this.called=!1,this.args=r}return e}(),qn=function(){function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._callMap={},this.add.apply(this,t)}return Object.defineProperty(e.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),e.prototype.get=function(t){var r;return(r=this.calls[t])!==null&&r!==void 0?r:[]},e.prototype.getAndRemove=function(t){var r=this.get(t);return this.calls[t]=[],r},e.prototype.add=function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];r.forEach(function(i){var o=["track","screen","alias","group","page","identify"];o.includes(i.method)&&!mr(i.args)&&(i.args=C(C([],i.args,!0),[ur()],!1)),t.calls[i.method]?t.calls[i.method].push(i):t.calls[i.method]=[i]})},e.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},e.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},e.prototype._pushSnippetWindowBuffer=function(){},e}();function Re(e,t){return y(this,void 0,void 0,function(){var r,n;return g(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t.called?[2,void 0]:(t.called=!0,r=e[t.method].apply(e,t.args),Fn(r)?[4,r]:[3,2]);case 1:i.sent(),i.label=2;case 2:return t.resolve(r),[3,4];case 3:return n=i.sent(),t.reject(n),[3,4];case 4:return[2]}})})}var Un=function(){function e(t){var r=this;this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=je,this._preInitBuffer=new qn,this._promise=t(this._preInitBuffer),this._promise.then(function(n){var i=n[0],o=n[1];r.instance=i,r.ctx=o}).catch(function(){})}return e.prototype.then=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).then.apply(t,r)},e.prototype.catch=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).catch.apply(t,r)},e.prototype.finally=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(t=this._promise).finally.apply(t,r)},e.prototype._createMethod=function(t){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r.instance){var a=(n=r.instance)[t].apply(n,i);return Promise.resolve(a)}return new Promise(function(u,s){r._preInitBuffer.add(new it(t,i,u,s))})}},e.prototype._createChainableMethod=function(t){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r.instance?((n=r.instance)[t].apply(n,i),r):(r._preInitBuffer.add(new it(t,i)),r)}},e}(),X={},G={},wt={},br={exports:{}};(function(e){e.exports=t(r),e.exports.find=e.exports,e.exports.replace=function(u,s,c,l){return t(i).call(this,u,s,c,l),u},e.exports.del=function(u,s,c){return t(n).call(this,u,s,null,c),u};function t(u){return function(s,c,l,d){var p=d&&a(d.normalizer)?d.normalizer:o;c=p(c);for(var h,v=!1;!v;)m();function m(){for(h in s){var S=p(h);if(c.indexOf(S)===0){var w=c.substr(S.length);if(w.charAt(0)==="."||w.length===0){c=w.substr(1);var b=s[h];if(b==null){v=!0;return}if(!c.length){v=!0;return}s=b;return}}}h=void 0,v=!0}if(h)return s==null?s:u(s,h,l)}}function r(u,s){if(u.hasOwnProperty(s))return u[s]}function n(u,s){return u.hasOwnProperty(s)&&delete u[s],u}function i(u,s,c){return u.hasOwnProperty(s)&&(u[s]=c),u}function o(u){return u.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}function a(u){return typeof u=="function"}})(br);var Le=br.exports,$n=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});var H=$n(Le);function de(e,t){return function(){var r=this.traits(),n=this.properties?this.properties():{};return H.default(r,"address."+e)||H.default(r,e)||(t?H.default(r,"address."+t):null)||(t?H.default(r,t):null)||H.default(n,"address."+e)||H.default(n,e)||(t?H.default(n,"address."+t):null)||(t?H.default(n,t):null)}}function zn(e){e.zip=de("postalCode","zip"),e.country=de("country"),e.street=de("street"),e.state=de("state"),e.city=de("city"),e.region=de("region")}wt.default=zn;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.clone=void 0;function ot(e){if(typeof e!="object")return e;if(Object.prototype.toString.call(e)==="[object Object]"){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=ot(e[r]));return t}else return Array.isArray(e)?e.map(ot):e}Ne.clone=ot;var St={};Object.defineProperty(St,"__esModule",{value:!0});var Bn={Salesforce:!0};function Kn(e){return!Bn[e]}St.default=Kn;var qe={},_r=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;qe.parse=function(e){var t=[1,5,6,7,11,12],r=_r.exec(e),n=0;if(!r)return new Date(e);for(var i=0,o;o=t[i];i++)r[o]=parseInt(r[o],10)||0;r[2]=parseInt(r[2],10)||1,r[3]=parseInt(r[3],10)||1,r[2]--,r[8]=r[8]?(r[8]+"00").substring(0,3):0,r[4]===" "?n=new Date().getTimezoneOffset():r[9]!=="Z"&&r[10]&&(n=r[11]*60+r[12],r[10]==="+"&&(n=0-n));var a=Date.UTC(r[1],r[2],r[3],r[5],r[6]+n,r[7],r[8]);return new Date(a)};qe.is=function(e,t){return typeof e!="string"||t&&/^\d{4}-\d{2}-\d{2}/.test(e)===!1?!1:_r.test(e)};var Et={},Vn=/\d{13}/;Et.is=function(e){return Vn.test(e)};Et.parse=function(e){return e=parseInt(e,10),new Date(e)};var It={},Gn=/\d{10}/;It.is=function(e){return Gn.test(e)};It.parse=function(e){var t=parseInt(e,10)*1e3;return new Date(t)};var zt=qe,Bt=Et,Kt=It,Jn=Object.prototype,wr=Jn.toString;function Wn(e){return wr.call(e)==="[object Date]"}function Qn(e){return wr.call(e)==="[object Number]"}var Pt=function(t){return Wn(t)?t:Qn(t)?new Date(Hn(t)):zt.is(t)?zt.parse(t):Bt.is(t)?Bt.parse(t):Kt.is(t)?Kt.parse(t):new Date(t)};function Hn(e){return e<315576e5?e*1e3:e}var Vt=qe,Xn=At;function At(e,t){return t===void 0&&(t=!0),e&&typeof e=="object"?Yn(e,t):Array.isArray(e)?Zn(e,t):Vt.is(e,t)?Vt.parse(e):e}function Yn(e,t){return Object.keys(e).forEach(function(r){e[r]=At(e[r],t)}),e}function Zn(e,t){return e.forEach(function(r,n){e[n]=At(r,t)}),e}var Ee=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(G,"__esModule",{value:!0});G.Facade=void 0;var ei=Ee(wt),ye=Ne,ti=Ee(St),ri=Ee(Pt),at=Ee(Le),ni=Ee(Xn);function N(e,t){t=t||{},this.raw=ye.clone(e),"clone"in t||(t.clone=!0),t.clone&&(e=ye.clone(e)),"traverse"in t||(t.traverse=!0),"timestamp"in e?e.timestamp=ri.default(e.timestamp):e.timestamp=new Date,t.traverse&&ni.default(e),this.opts=t,this.obj=e}G.Facade=N;var P=N.prototype;P.proxy=function(e){var t=e.split(".");e=t.shift();var r=this[e]||this.obj[e];return r&&(typeof r=="function"&&(r=r.call(this)||{}),t.length===0?this.opts.clone?ut(r):r:(r=at.default(r,t.join(".")),this.opts.clone?ut(r):r))};P.field=function(e){var t=this.obj[e];return this.opts.clone?ut(t):t};N.proxy=function(e){return function(){return this.proxy(e)}};N.field=function(e){return function(){return this.field(e)}};N.multi=function(e){return function(){var t=this.proxy(e+"s");if(Array.isArray(t))return t;var r=this.proxy(e);return r&&(r=[this.opts.clone?ye.clone(r):r]),r||[]}};N.one=function(e){return function(){var t=this.proxy(e);if(t)return t;var r=this.proxy(e+"s");if(Array.isArray(r))return r[0]}};P.json=function(){var e=this.opts.clone?ye.clone(this.obj):this.obj;return this.type&&(e.type=this.type()),e};P.rawEvent=function(){return this.raw};P.options=function(e){var t=this.obj.options||this.obj.context||{},r=this.opts.clone?ye.clone(t):t;if(!e)return r;if(this.enabled(e)){var n=this.integrations(),i=n[e]||at.default(n,e);return typeof i!="object"&&(i=at.default(this.options(),e)),typeof i=="object"?i:{}}};P.context=P.options;P.enabled=function(e){var t=this.proxy("options.providers.all");typeof t!="boolean"&&(t=this.proxy("options.all")),typeof t!="boolean"&&(t=this.proxy("integrations.all")),typeof t!="boolean"&&(t=!0);var r=t&&ti.default(e),n=this.integrations();if(n.providers&&n.providers.hasOwnProperty(e)&&(r=n.providers[e]),n.hasOwnProperty(e)){var i=n[e];typeof i=="boolean"?r=i:r=!0}return!!r};P.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()};P.active=function(){var e=this.proxy("options.active");return e==null&&(e=!0),e};P.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")};P.sessionId=P.anonymousId;P.groupId=N.proxy("options.groupId");P.traits=function(e){var t=this.proxy("options.traits")||{},r=this.userId();e=e||{},r&&(t.id=r);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=this[n]==null?this.proxy("options.traits."+n):this[n]();if(i==null)continue;t[e[n]]=i,delete t[n]}return t};P.library=function(){var e=this.proxy("options.library");return e?typeof e=="string"?{name:e,version:null}:e:{name:"unknown",version:null}};P.device=function(){var e=this.proxy("context.device");(typeof e!="object"||e===null)&&(e={});var t=this.library().name;return e.type||(t.indexOf("ios")>-1&&(e.type="ios"),t.indexOf("android")>-1&&(e.type="android")),e};P.userAgent=N.proxy("context.userAgent");P.timezone=N.proxy("context.timezone");P.timestamp=N.field("timestamp");P.channel=N.field("channel");P.ip=N.proxy("context.ip");P.userId=N.field("userId");ei.default(P);function ut(e){return ye.clone(e)}var Ue={},ii=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Alias=void 0;var oi=ii(se),Sr=G;function $(e,t){Sr.Facade.call(this,e,t)}Ue.Alias=$;oi.default($,Sr.Facade);$.prototype.action=function(){return"alias"};$.prototype.type=$.prototype.action;$.prototype.previousId=function(){return this.field("previousId")||this.field("from")};$.prototype.from=$.prototype.previousId;$.prototype.userId=function(){return this.field("userId")||this.field("to")};$.prototype.to=$.prototype.userId;var $e={},ge={};Object.defineProperty(ge,"__esModule",{value:!0});var ai=/.+\@.+\..+/;function ui(e){return ai.test(e)}ge.default=ui;var Ot=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($e,"__esModule",{value:!0});$e.Group=void 0;var si=Ot(se),ci=Ot(ge),li=Ot(Pt),me=G;function Mt(e,t){me.Facade.call(this,e,t)}$e.Group=Mt;si.default(Mt,me.Facade);var z=Mt.prototype;z.action=function(){return"group"};z.type=z.action;z.groupId=me.Facade.field("groupId");z.created=function(){var e=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(e)return li.default(e)};z.email=function(){var e=this.proxy("traits.email");if(e)return e;var t=this.groupId();if(ci.default(t))return t};z.traits=function(e){var t=this.properties(),r=this.groupId();e=e||{},r&&(t.id=r);for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=this[n]==null?this.proxy("traits."+n):this[n]();if(i==null)continue;t[e[n]]=i,delete t[n]}return t};z.name=me.Facade.proxy("traits.name");z.industry=me.Facade.proxy("traits.industry");z.employees=me.Facade.proxy("traits.employees");z.properties=function(){return this.field("traits")||this.field("properties")||{}};var Ie={},ze=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.Identify=void 0;var J=G,pe=ze(Le),fi=ze(se),di=ze(ge),Er=ze(Pt),ie=function(e){return e.trim()};function xt(e,t){J.Facade.call(this,e,t)}Ie.Identify=xt;fi.default(xt,J.Facade);var A=xt.prototype;A.action=function(){return"identify"};A.type=A.action;A.traits=function(e){var t=this.field("traits")||{},r=this.userId();e=e||{},r&&(t.id=r);for(var n in e){var i=this[n]==null?this.proxy("traits."+n):this[n]();i!=null&&(t[e[n]]=i,n!==e[n]&&delete t[n])}return t};A.email=function(){var e=this.proxy("traits.email");if(e)return e;var t=this.userId();if(di.default(t))return t};A.created=function(){var e=this.proxy("traits.created")||this.proxy("traits.createdAt");if(e)return Er.default(e)};A.companyCreated=function(){var e=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(e)return Er.default(e)};A.companyName=function(){return this.proxy("traits.company.name")};A.name=function(){var e=this.proxy("traits.name");if(typeof e=="string")return ie(e);var t=this.firstName(),r=this.lastName();if(t&&r)return ie(t+" "+r)};A.firstName=function(){var e=this.proxy("traits.firstName");if(typeof e=="string")return ie(e);var t=this.proxy("traits.name");if(typeof t=="string")return ie(t).split(" ")[0]};A.lastName=function(){var e=this.proxy("traits.lastName");if(typeof e=="string")return ie(e);var t=this.proxy("traits.name");if(typeof t=="string"){var r=ie(t).indexOf(" ");if(r!==-1)return ie(t.substr(r+1))}};A.uid=function(){return this.userId()||this.username()||this.email()};A.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")};A.age=function(){var e=this.birthday(),t=pe.default(this.traits(),"age");if(t!=null)return t;if(e instanceof Date){var r=new Date;return r.getFullYear()-e.getFullYear()}};A.avatar=function(){var e=this.traits();return pe.default(e,"avatar")||pe.default(e,"photoUrl")||pe.default(e,"avatarUrl")};A.position=function(){var e=this.traits();return pe.default(e,"position")||pe.default(e,"jobTitle")};A.username=J.Facade.proxy("traits.username");A.website=J.Facade.one("traits.website");A.websites=J.Facade.multi("traits.website");A.phone=J.Facade.one("traits.phone");A.phones=J.Facade.multi("traits.phone");A.address=J.Facade.proxy("traits.address");A.gender=J.Facade.proxy("traits.gender");A.birthday=J.Facade.proxy("traits.birthday");var be={},Ct=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(be,"__esModule",{value:!0});be.Track=void 0;var vi=Ct(se),k=G,hi=Ie,pi=Ct(ge),Ir=Ct(Le);function Dt(e,t){k.Facade.call(this,e,t)}be.Track=Dt;vi.default(Dt,k.Facade);var _=Dt.prototype;_.action=function(){return"track"};_.type=_.action;_.event=k.Facade.field("event");_.value=k.Facade.proxy("properties.value");_.category=k.Facade.proxy("properties.category");_.id=k.Facade.proxy("properties.id");_.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")};_.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")};_.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")};_.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")};_.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")};_.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")};_.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")};_.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")};_.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")};_.sku=k.Facade.proxy("properties.sku");_.tax=k.Facade.proxy("properties.tax");_.name=k.Facade.proxy("properties.name");_.price=k.Facade.proxy("properties.price");_.total=k.Facade.proxy("properties.total");_.repeat=k.Facade.proxy("properties.repeat");_.coupon=k.Facade.proxy("properties.coupon");_.shipping=k.Facade.proxy("properties.shipping");_.discount=k.Facade.proxy("properties.discount");_.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")};_.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")};_.description=k.Facade.proxy("properties.description");_.plan=k.Facade.proxy("properties.plan");_.subtotal=function(){var e=Ir.default(this.properties(),"subtotal"),t=this.total()||this.revenue();if(e)return e;if(!t)return 0;if(this.total()){var r=this.tax();r&&(t-=r),r=this.shipping(),r&&(t-=r),r=this.discount(),r&&(t+=r)}return t};_.products=function(){var e=this.properties(),t=Ir.default(e,"products");return Array.isArray(t)?t.filter(function(r){return r!==null}):[]};_.quantity=function(){var e=this.obj.properties||{};return e.quantity||1};_.currency=function(){var e=this.obj.properties||{};return e.currency||"USD"};_.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};_.query=k.Facade.proxy("options.query");_.properties=function(e){var t=this.field("properties")||{};e=e||{};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=this[r]==null?this.proxy("properties."+r):this[r]();if(n==null)continue;t[e[r]]=n,delete t[r]}return t};_.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()};_.email=function(){var e=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(e)return e;var t=this.userId();if(pi.default(t))return t};_.revenue=function(){var e=this.proxy("properties.revenue"),t=this.event(),r=/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;return!e&&t&&t.match(r)&&(e=this.proxy("properties.total")),yi(e)};_.cents=function(){var e=this.revenue();return typeof e!="number"?this.value()||0:e*100};_.identify=function(){var e=this.json();return e.traits=this.traits(),new hi.Identify(e,this.opts)};function yi(e){if(e){if(typeof e=="number")return e;if(typeof e=="string"&&(e=e.replace(/\$/g,""),e=parseFloat(e),!isNaN(e)))return e}}var Pe={},Pr=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.Page=void 0;var gi=Pr(se),ce=G,mi=be,bi=Pr(ge);function kt(e,t){ce.Facade.call(this,e,t)}Pe.Page=kt;gi.default(kt,ce.Facade);var R=kt.prototype;R.action=function(){return"page"};R.type=R.action;R.category=ce.Facade.field("category");R.name=ce.Facade.field("name");R.title=ce.Facade.proxy("properties.title");R.path=ce.Facade.proxy("properties.path");R.url=ce.Facade.proxy("properties.url");R.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")};R.properties=function(e){var t=this.field("properties")||{},r=this.category(),n=this.name();e=e||{},r&&(t.category=r),n&&(t.name=n);for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=this[i]==null?this.proxy("properties."+i):this[i]();if(o==null)continue;t[e[i]]=o,i!==e[i]&&delete t[i]}return t};R.email=function(){var e=this.proxy("context.traits.email")||this.proxy("properties.email");if(e)return e;var t=this.userId();if(bi.default(t))return t};R.fullName=function(){var e=this.category(),t=this.name();return t&&e?e+" "+t:t};R.event=function(e){return e?"Viewed "+e+" Page":"Loaded a Page"};R.track=function(e){var t=this.json();return t.event=this.event(e),t.timestamp=this.timestamp(),t.properties=this.properties(),new mi.Track(t,this.opts)};var Be={},_i=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Be,"__esModule",{value:!0});Be.Screen=void 0;var wi=_i(se),Ar=Pe,Si=be;function ue(e,t){Ar.Page.call(this,e,t)}Be.Screen=ue;wi.default(ue,Ar.Page);ue.prototype.action=function(){return"screen"};ue.prototype.type=ue.prototype.action;ue.prototype.event=function(e){return e?"Viewed "+e+" Screen":"Loaded a Screen"};ue.prototype.track=function(e){var t=this.json();return t.event=this.event(e),t.timestamp=this.timestamp(),t.properties=this.properties(),new Si.Track(t,this.opts)};var Ke={},Ei=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.Delete=void 0;var Ii=Ei(se),Or=G;function Ft(e,t){Or.Facade.call(this,e,t)}Ke.Delete=Ft;Ii.default(Ft,Or.Facade);Ft.prototype.type=function(){return"delete"};(function(e){var t=x&&x.__assign||function(){return t=Object.assign||function(l){for(var d,p=1,h=arguments.length;p<h;p++){d=arguments[p];for(var v in d)Object.prototype.hasOwnProperty.call(d,v)&&(l[v]=d[v])}return l},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.Delete=e.Screen=e.Page=e.Track=e.Identify=e.Group=e.Alias=e.Facade=void 0;var r=G;Object.defineProperty(e,"Facade",{enumerable:!0,get:function(){return r.Facade}});var n=Ue;Object.defineProperty(e,"Alias",{enumerable:!0,get:function(){return n.Alias}});var i=$e;Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Ie;Object.defineProperty(e,"Identify",{enumerable:!0,get:function(){return o.Identify}});var a=be;Object.defineProperty(e,"Track",{enumerable:!0,get:function(){return a.Track}});var u=Pe;Object.defineProperty(e,"Page",{enumerable:!0,get:function(){return u.Page}});var s=Be;Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return s.Screen}});var c=Ke;Object.defineProperty(e,"Delete",{enumerable:!0,get:function(){return c.Delete}}),e.default=t(t({},r.Facade),{Alias:n.Alias,Group:i.Group,Identify:o.Identify,Track:a.Track,Page:u.Page,Screen:s.Screen,Delete:c.Delete})})(X);function Fe(e,t){var r=new X.Facade(e,t);return e.type==="track"&&(r=new X.Track(e,t)),e.type==="identify"&&(r=new X.Identify(e,t)),e.type==="page"&&(r=new X.Page(e,t)),e.type==="alias"&&(r=new X.Alias(e,t)),e.type==="group"&&(r=new X.Group(e,t)),e.type==="screen"&&(r=new X.Screen(e,t)),Object.defineProperty(r,"obj",{value:e,writable:!0}),r}var Pi=function(e){var t=!1;window.addEventListener("pagehide",function(){t||(t=!0,e(t))}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(t)return;t=!0}else t=!1;e(t)})},Mr=function(e){L(t,e);function t(r,n){var i=e.call(this,r)||this;return i.retryTimeout=n,i.name="RateLimitError",i}return t}(Error),xr=function(e){return f({"Content-Type":"text/plain"},typeof e=="function"?e():e)},Ai=500,Oi=64;function Tt(e){var t=encodeURI(JSON.stringify(e)).split(/%..|./).length-1;return t/1024}function Mi(e){return Tt(e)>=Ai-50}function xi(e){return Tt(e)>=Oi-10}function Ci(e){var t=[],r=0;return e.forEach(function(n){var i=Tt(t[r]);i>=64&&r++,t[r]?t[r].push(n):t[r]=[n]}),t}function Di(e,t){var r,n,i=[],o=!1,a=(r=t==null?void 0:t.size)!==null&&r!==void 0?r:10,u=(n=t==null?void 0:t.timeout)!==null&&n!==void 0?n:5e3,s=0;function c(v){var m;if(v.length!==0){var S=(m=v[0])===null||m===void 0?void 0:m.writeKey,w=v.map(function(b){var E=b;E.sentAt;var O=Ht(E,["sentAt"]);return O});return Te("https://".concat(e,"/b"),{credentials:t==null?void 0:t.credentials,keepalive:(t==null?void 0:t.keepalive)||o,headers:xr(t==null?void 0:t.headers),method:"post",body:JSON.stringify({writeKey:S,batch:w,sentAt:new Date().toISOString()}),priority:t==null?void 0:t.priority}).then(function(b){var E;if(b.status>=500)throw new Error("Bad response from server: ".concat(b.status));if(b.status===429){var O=(E=b.headers)===null||E===void 0?void 0:E.get("x-ratelimit-reset"),I=typeof O=="string"?parseInt(O)*1e3:u;throw new Mr("Rate limit exceeded: ".concat(b.status),I)}})}}function l(v){var m;return v===void 0&&(v=1),y(this,void 0,void 0,function(){var S;return g(this,function(w){return i.length?(S=i,i=[],[2,(m=c(S))===null||m===void 0?void 0:m.catch(function(b){var E,O=K.system();O.log("error","Error sending batch",b),v<=((E=t==null?void 0:t.maxRetries)!==null&&E!==void 0?E:10)&&(b.name==="RateLimitError"&&(s=b.retryTimeout),i.push.apply(i,S),i.map(function(I){if("_metadata"in I){var M=I;M._metadata=f(f({},M._metadata),{retryCount:v})}}),p(v+1))})]):[2]})})}var d;function p(v){v===void 0&&(v=1),!d&&(d=setTimeout(function(){d=void 0,l(v).catch(console.error)},s||u),s=0)}Pi(function(v){if(o=v,o&&i.length){var m=Ci(i).map(c);Promise.all(m).catch(console.error)}});function h(v,m){return y(this,void 0,void 0,function(){var S;return g(this,function(w){return i.push(m),S=i.length>=a||Mi(i)||(t==null?void 0:t.keepalive)&&xi(i),[2,S||o?l():p()]})})}return{dispatch:h}}function ki(e){function t(r,n){return Te(r,{credentials:e==null?void 0:e.credentials,keepalive:e==null?void 0:e.keepalive,headers:xr(e==null?void 0:e.headers),method:"post",body:JSON.stringify(n),priority:e==null?void 0:e.priority}).then(function(i){var o;if(i.status>=500)throw new Error("Bad response from server: ".concat(i.status));if(i.status===429){var a=(o=i.headers)===null||o===void 0?void 0:o.get("x-ratelimit-reset"),u=a?parseInt(a)*1e3:5e3;throw new Mr("Rate limit exceeded: ".concat(i.status),u)}})}return{dispatch:t}}function Fi(e,t,r,n,i){var o,a=e.user();delete t.options,t.writeKey=r==null?void 0:r.apiKey,t.userId=t.userId||a.id(),t.anonymousId=t.anonymousId||a.anonymousId(),t.sentAt=new Date;var u=e.queue.failedInitializations||[];u.length>0&&(t._metadata={failedInitializations:u}),i!=null&&(i.attempts>1&&(t._metadata=f(f({},t._metadata),{retryCount:i.attempts})),i.attempts++);var s=[],c=[];for(var l in n){var d=n[l];l==="Segment.io"&&s.push(l),d.bundlingStatus==="bundled"&&s.push(l),d.bundlingStatus==="unbundled"&&c.push(l)}for(var p=0,h=(r==null?void 0:r.unbundledIntegrations)||[];p<h.length;p++){var v=h[p];c.includes(v)||c.push(v)}var m=(o=r==null?void 0:r.maybeBundledConfigIds)!==null&&o!==void 0?o:{},S=[];return s.sort().forEach(function(w){var b;((b=m[w])!==null&&b!==void 0?b:[]).forEach(function(E){S.push(E)})}),(r==null?void 0:r.addBundledMetadata)!==!1&&(t._metadata=f(f({},t._metadata),{bundled:s.sort(),unbundled:c.sort(),bundledIds:S})),t}var Ti=function(e,t){return y(void 0,void 0,void 0,function(){var r;return g(this,function(n){return r=function(i){return y(void 0,void 0,void 0,function(){var o;return g(this,function(a){switch(a.label){case 0:return e(i)?(o=r,[4,t()]):[3,2];case 1:return[2,o.apply(void 0,[a.sent()])];case 2:return[2]}})})},[2,r(void 0)]})})};function ji(e,t){return y(this,void 0,void 0,function(){var r,n=this;return g(this,function(i){switch(i.label){case 0:return r=[],Se()?[2,t]:[4,Ti(function(){return t.length>0&&!Se()},function(){return y(n,void 0,void 0,function(){var o,a,u;return g(this,function(s){switch(s.label){case 0:return o=t.pop(),o?[4,we(o,e)]:[2];case 1:return a=s.sent(),u=a instanceof K,u||r.push(o),[2]}})})})];case 1:return i.sent(),r.map(function(o){return t.pushWithBackoff(o)}),[2,t]}})})}function ve(e,t,r,n){var i=this;e||setTimeout(function(){return y(i,void 0,void 0,function(){var o,a;return g(this,function(u){switch(u.label){case 0:return o=!0,[4,ji(r,t)];case 1:return a=u.sent(),o=!1,t.todo>0&&n(o,a,r,n),[2]}})})},Math.random()*5e3)}function Ri(e,t){var r,n,i,o,a=e.user();return t.previousId=(i=(n=(r=t.previousId)!==null&&r!==void 0?r:t.from)!==null&&n!==void 0?n:a.id())!==null&&i!==void 0?i:a.anonymousId(),t.userId=(o=t.userId)!==null&&o!==void 0?o:t.to,delete t.from,delete t.to,t}var Li=function(e){return e.name==="Segment.io"};function Cr(e,t,r){var n,i,o;window.addEventListener("pagehide",function(){u.push.apply(u,Array.from(s)),s.clear()});var a=(n=t==null?void 0:t.apiKey)!==null&&n!==void 0?n:"",u=e.options.disableClientPersistence?new ft(e.queue.queue.maxAttempts,[]):new pt(e.queue.queue.maxAttempts,"".concat(a,":dest-Segment.io")),s=new Set,c=!1,l=(i=t==null?void 0:t.apiHost)!==null&&i!==void 0?i:rr,d=(o=t==null?void 0:t.protocol)!==null&&o!==void 0?o:"https",p="".concat(d,"://").concat(l),h=t==null?void 0:t.deliveryStrategy,v=h&&"strategy"in h&&h.strategy==="batching"?Di(l,h.config):ki(h==null?void 0:h.config);function m(w){return y(this,void 0,void 0,function(){var b,E;return g(this,function(O){return Se()?(u.push(w),ve(c,u,S,ve),[2,w]):(s.add(w),b=w.event.type.charAt(0),E=Fe(w.event).json(),w.event.type==="track"&&delete E.traits,w.event.type==="alias"&&(E=Ri(e,E)),[2,v.dispatch("".concat(p,"/").concat(b),Fi(e,E,t,r,w)).then(function(){return w}).catch(function(I){if(w.log("error","Error sending event",I),I.name==="RateLimitError"){var M=I.retryTimeout;u.pushWithBackoff(w,M)}else u.pushWithBackoff(w);return ve(c,u,S,ve),w}).finally(function(){s.delete(w)})])})})}var S={metadata:{writeKey:a,apiHost:l,protocol:d},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:m,identify:m,page:m,alias:m,group:m,screen:m};return u.todo&&ve(c,u,S,ve),S}var Y="This is being deprecated and will be not be available in future releases of Analytics JS",Je=ht(),We=Je==null?void 0:Je.analytics;function Ni(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=t?10:1,i=r?new ft(n,[]):new pt(n,e);return new In(i)}var qi=function(){function e(t,r){var n;this.timeout=300,this._getSegmentPluginMetadata=function(){var o;return(o=r.plugins.find(Li))===null||o===void 0?void 0:o.metadata},this.writeKey=t.writeKey;var i={integrations:{"Segment.io":{apiKey:""}}};this.cdnSettings=(n=t.cdnSettings)!==null&&n!==void 0?n:i,this.cdnURL=t.cdnURL}return Object.defineProperty(e.prototype,"apiHost",{get:function(){var t,r;return(r=(t=this._getSegmentPluginMetadata)===null||t===void 0?void 0:t.call(this))===null||r===void 0?void 0:r.apiHost},enumerable:!1,configurable:!0}),e}();function B(){console.warn(Y)}var jt=function(e){L(t,e);function t(r,n,i,o,a){var u=this,s,c;u=e.call(this)||this,u._debug=!1,u.initialized=!1,u.user=function(){return u._user},u.init=u.initialize.bind(u),u.log=B,u.addIntegrationMiddleware=B,u.listeners=B,u.addEventListener=B,u.removeAllListeners=B,u.removeListener=B,u.removeEventListener=B,u.hasListeners=B,u.add=B,u.addIntegration=B;var l=n==null?void 0:n.cookie,d=(s=n==null?void 0:n.disableClientPersistence)!==null&&s!==void 0?s:!1;u.queue=i??Ni("".concat(r.writeKey,":event-queue"),n==null?void 0:n.retryQueue,d),u.settings=new qi(r,u.queue);var p=n==null?void 0:n.storage;return u._universalStorage=u.createStore(d,p,l),u._user=o??new mt(f({persist:!d,storage:n==null?void 0:n.storage},n==null?void 0:n.user),l).load(),u._group=a??new yr(f({persist:!d,storage:n==null?void 0:n.storage},n==null?void 0:n.group),l).load(),u.eventFactory=new sr(u._user),u.integrations=(c=n==null?void 0:n.integrations)!==null&&c!==void 0?c:{},u.options=n??{},yt(u),u}return t.prototype.createStore=function(r,n,i){return r?new Z([new gt]):n&&hr(n)?new Z(nt(pr(n.stores,i))):new Z(nt([j.LocalStorage,{name:j.Cookie,settings:i},j.Memory]))},Object.defineProperty(t.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),t.prototype.track=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,d=this;return g(this,function(p){return i=fe(r),o=er.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=this.eventFactory.track(a,u,s,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return d.emit("track",a,h.event.properties,h.event.options),h})]})})},t.prototype.page=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,d,p=this;return g(this,function(h){return i=fe(r),o=Ze.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=o[4],d=this.eventFactory.page(a,u,s,c,this.integrations,i),[2,this._dispatch(d,l).then(function(v){return p.emit("page",a,u,v.event.properties,v.event.options),v})]})})},t.prototype.identify=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,d=this;return g(this,function(p){return i=fe(r),o=et(this._user).apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],this._user.identify(a,u),l=this.eventFactory.identify(this._user.id(),this._user.traits(),s,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return d.emit("identify",h.event.userId,h.event.traits,h.event.options),h})]})})},t.prototype.group=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=fe(n);if(n.length===0)return this._group;var a=et(this._group).apply(void 0,n),u=a[0],s=a[1],c=a[2],l=a[3];this._group.identify(u,s);var d=this._group.id(),p=this._group.traits(),h=this.eventFactory.group(d,p,c,this.integrations,o);return this._dispatch(h,l).then(function(v){return r.emit("group",v.event.groupId,v.event.traits,v.event.options),v})},t.prototype.alias=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,d=this;return g(this,function(p){return i=fe(r),o=tr.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=this.eventFactory.alias(a,u,s,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return d.emit("alias",a,u,h.event.options),h})]})})},t.prototype.screen=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a,u,s,c,l,d,p=this;return g(this,function(h){return i=fe(r),o=Ze.apply(void 0,r),a=o[0],u=o[1],s=o[2],c=o[3],l=o[4],d=this.eventFactory.screen(a,u,s,c,this.integrations,i),[2,this._dispatch(d,l).then(function(v){return p.emit("screen",a,u,v.event.properties,v.event.options),v})]})})},t.prototype.trackClick=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-DPNbzvNG.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,C([this],r,!1))]}})})},t.prototype.trackLink=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-DPNbzvNG.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.link).call.apply(o,C([this],r,!1))]}})})},t.prototype.trackSubmit=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-DPNbzvNG.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,C([this],r,!1))]}})})},t.prototype.trackForm=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return[4,U(()=>import("./auto-track-DPNbzvNG.js"),__vite__mapDeps([0,1]))];case 1:return i=a.sent(),[2,(o=i.form).call.apply(o,C([this],r,!1))]}})})},t.prototype.register=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a=this;return g(this,function(u){switch(u.label){case 0:return i=K.system(),o=r.map(function(s){return a.queue.register(i,s,a)}),[4,Promise.all(o)];case 1:return u.sent(),[2,i]}})})},t.prototype.deregister=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return y(this,void 0,void 0,function(){var i,o,a=this;return g(this,function(u){switch(u.label){case 0:return i=K.system(),o=r.map(function(s){var c=a.queue.plugins.find(function(l){return l.name===s});if(c)return a.queue.deregister(i,c,a);i.log("warn","plugin ".concat(s," not found"))}),[4,Promise.all(o)];case 1:return u.sent(),[2,i]}})})},t.prototype.debug=function(r){return r===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=r,this},t.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},t.prototype.timeout=function(r){this.settings.timeout=r},t.prototype._dispatch=function(r,n){return y(this,void 0,void 0,function(){var i;return g(this,function(o){return i=new K(r),i.stats.increment("analytics_js.invoke",1,[r.type]),Se()&&!this.options.retryQueue?[2,i]:[2,cn(i,this.queue,this,{callback:n,debug:this._debug,timeout:this.settings.timeout})]})})},t.prototype.addSourceMiddleware=function(r){return y(this,void 0,void 0,function(){var n=this;return g(this,function(i){switch(i.label){case 0:return[4,this.queue.criticalTasks.run(function(){return y(n,void 0,void 0,function(){var o,a,u;return g(this,function(s){switch(s.label){case 0:return[4,U(()=>Promise.resolve().then(()=>ro),void 0)];case 1:return o=s.sent().sourceMiddlewarePlugin,a={},this.queue.plugins.forEach(function(c){if(c.type==="destination")return a[c.name]=!0}),u=o(r,a),[4,this.register(u)];case 2:return s.sent(),[2]}})})})];case 1:return i.sent(),[2,this]}})})},t.prototype.addDestinationMiddleware=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return this.queue.plugins.filter(cr).forEach(function(o){(r==="*"||o.name.toLowerCase()===r.toLowerCase())&&o.addMiddleware.apply(o,n)}),Promise.resolve(this)},t.prototype.setAnonymousId=function(r){return this._user.anonymousId(r)},t.prototype.queryString=function(r){return y(this,void 0,void 0,function(){var n;return g(this,function(i){switch(i.label){case 0:return this.options.useQueryString===!1?[2,[]]:[4,U(()=>import("./index-BaH3PnIw.js"),__vite__mapDeps([2,1]))];case 1:return n=i.sent().queryString,[2,n(this,r)]}})})},t.prototype.use=function(r){return r(this),this},t.prototype.ready=function(r){return r===void 0&&(r=function(n){return n}),y(this,void 0,void 0,function(){return g(this,function(n){return[2,Promise.all(this.queue.plugins.map(function(i){return i.ready?i.ready():Promise.resolve()})).then(function(i){return r(i),i})]})})},t.prototype.noConflict=function(){return console.warn(Y),kn(We??this),this},t.prototype.normalize=function(r){return console.warn(Y),this.eventFactory.normalize(r)},Object.defineProperty(t.prototype,"failedInitializations",{get:function(){return console.warn(Y),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VERSION",{get:function(){return je},enumerable:!1,configurable:!0}),t.prototype.initialize=function(r,n){return y(this,void 0,void 0,function(){return g(this,function(i){return console.warn(Y),[2,Promise.resolve(this)]})})},t.prototype.pageview=function(r){return y(this,void 0,void 0,function(){return g(this,function(n){switch(n.label){case 0:return console.warn(Y),[4,this.page({path:r})];case 1:return n.sent(),[2,this]}})})},Object.defineProperty(t.prototype,"plugins",{get:function(){var r;return console.warn(Y),(r=this._plugins)!==null&&r!==void 0?r:{}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Integrations",{get:function(){console.warn(Y);var r=this.queue.plugins.filter(function(n){return n.type==="destination"}).reduce(function(n,i){var o="".concat(i.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),a=window[o];if(!a)return n;var u=a.Integration;return u?(n[i.name]=u,n):(n[i.name]=a,n)},{});return r},enumerable:!1,configurable:!0}),t.prototype.push=function(r){var n=this,i=r.shift();i&&!n[i]||n[i].apply(this,r)},t}(lt),Gt=function(e){L(t,e);function t(){var r=e.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return r.initialized=!0,r}return t}(jt),Jt={VITE_SEGMENT_DEV_API_KEY:"UJLmm39XefLTcE55pRdWiwBT1JoTs6OI",VITE_SEGMENT_PRD_API_KEY:"uMHQo9dBTi626Bv11I3RxcH3Jui8lKMm"};function Dr(){return typeof process>"u"||!Jt?{}:Jt}var Ui=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,$i=function(){var e,t=Array.prototype.slice.call(document.querySelectorAll("script"));return t.forEach(function(r){var n,i=(n=r.getAttribute("src"))!==null&&n!==void 0?n:"",o=Ui.exec(i);o&&o[1]&&(e=o[1])}),e},De,zi=function(){var e,t=De??((e=_t())===null||e===void 0?void 0:e._cdn);return t},Bi=function(e){var t=_t();t&&(t._cdn=e),De=e},Rt=function(){var e=zi();if(e)return e;var t=$i();return t||"https://cdn.segment.com"},Eo=function(){var e=Rt();return"".concat(e,"/next-integrations")};function Ki(e,t){var r,n=Object.entries((r=t.integrations)!==null&&r!==void 0?r:{}).reduce(function(i,o){var a,u,s=o[0],c=o[1];return typeof c=="object"?f(f({},i),(a={},a[s]=c,a)):f(f({},i),(u={},u[s]={},u))},{});return Object.entries(e.integrations).reduce(function(i,o){var a,u=o[0],s=o[1];return f(f({},i),(a={},a[u]=f(f({},s),n[u]),a))},{})}function Vi(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Gi(e){return y(this,void 0,void 0,function(){var t;return g(this,function(r){return t=navigator.userAgentData,t?e?[2,t.getHighEntropyValues(e).catch(function(){return t.toJSON()})]:[2,t.toJSON()]:[2,void 0]})})}var _e;function Ji(){if(_e)return _e;var e=dr(window.location.href);return _e={expires:31536e6,secure:!1,path:"/"},e&&(_e.domain=e),_e}function Wi(e){var t={btid:"dataxu",urid:"millennial-media"};e.startsWith("?")&&(e=e.substring(1)),e=e.replace(/\?/g,"&");for(var r=e.split("&"),n=0,i=r;n<i.length;n++){var o=i[n],a=o.split("="),u=a[0],s=a[1];if(t[u])return{id:s,type:t[u]}}}function Qi(e){return e.startsWith("?")&&(e=e.substring(1)),e=e.replace(/\?/g,"&"),e.split("&").reduce(function(t,r){var n=r.split("="),i=n[0],o=n[1],a=o===void 0?"":o;if(i.includes("utm_")&&i.length>4){var u=i.slice(4);u==="campaign"&&(u="name"),t[u]=Vi(a)}return t},{})}function Hi(){var e=W.get("_ga");if(e&&e.startsWith("amp"))return e}function Xi(e,t,r){var n,i=new Z(r?[]:[new vr(Ji())]),o=i.get("s:context.referrer"),a=(n=Wi(e))!==null&&n!==void 0?n:o;a&&(t&&(t.referrer=f(f({},t.referrer),a)),i.set("s:context.referrer",a))}var Yi=function(e){try{var t=new URLSearchParams;return Object.entries(e).forEach(function(r){var n=r[0],i=r[1];Array.isArray(i)?i.forEach(function(o){return t.append(n,o)}):t.append(n,i)}),t.toString()}catch{return""}},Zi=function(){function e(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(r,n){return y(t,void 0,void 0,function(){var i;return g(this,function(o){switch(o.label){case 0:this.instance=n,o.label=1;case 1:return o.trys.push([1,3,,4]),i=this,[4,Gi(this.instance.options.highEntropyValuesClientHints)];case 2:return i.userAgentData=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(r){var n,i,o=r.event.context,a=o.page.search||"",u=typeof a=="object"?Yi(a):a;o.userAgent=navigator.userAgent,o.userAgentData=t.userAgentData;var s=navigator.userLanguage||navigator.language;typeof o.locale>"u"&&typeof s<"u"&&(o.locale=s),(n=o.library)!==null&&n!==void 0||(o.library={name:"analytics.js",version:"".concat("npm:next","-").concat(je)}),u&&!o.campaign&&(o.campaign=Qi(u));var c=Hi();c&&(o.amp={id:c}),Xi(u,o,(i=t.instance.options.disableClientPersistence)!==null&&i!==void 0?i:!1);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}return r},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}return e}(),eo=new Zi;function kr(e){var t=Array.prototype.slice.call(window.document.querySelectorAll("script"));return t.find(function(r){return r.src===e})}function Qe(e,t){var r=kr(e);if(r!==void 0){var n=r==null?void 0:r.getAttribute("status");if(n==="loaded")return Promise.resolve(r);if(n==="loading")return new Promise(function(i,o){r.addEventListener("load",function(){return i(r)}),r.addEventListener("error",function(a){return o(a)})})}return new Promise(function(i,o){var a,u=window.document.createElement("script");u.type="text/javascript",u.src=e,u.async=!0,u.setAttribute("status","loading");for(var s=0,c=Object.entries({});s<c.length;s++){var l=c[s],d=l[0],p=l[1];u.setAttribute(d,p)}u.onload=function(){u.onerror=u.onload=null,u.setAttribute("status","loaded"),i(u)},u.onerror=function(){u.onerror=u.onload=null,u.setAttribute("status","error"),o(new Error("Failed to load ".concat(e)))};var h=window.document.querySelector("script");h?(a=h.parentElement)===null||a===void 0||a.insertBefore(u,h):window.document.head.appendChild(u)})}function Io(e){var t=kr(e);return t!==void 0&&t.remove(),Promise.resolve()}function Fr(e,t,r){return y(this,void 0,void 0,function(){function n(c,l){return y(this,void 0,void 0,function(){var d,p,h;return g(this,function(v){switch(v.label){case 0:return d=!1,p=null,[4,l({payload:Fe(c,{clone:!0,traverse:!1}),integration:e,next:function(m){d=!0,m===null&&(p=null),m&&(p=m.obj)}})];case 1:return v.sent(),!d&&p!==null&&(p=p,p.integrations=f(f({},c.integrations),(h={},h[e]=!1,h))),[2,p]}})})}var i,o,a,u,s;return g(this,function(c){switch(c.label){case 0:i=Fe(t,{clone:!0,traverse:!1}).rawEvent(),o=0,a=r,c.label=1;case 1:return o<a.length?(u=a[o],[4,n(i,u)]):[3,4];case 2:if(s=c.sent(),s===null)return[2,null];i=s,c.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})}function to(e,t){function r(n){return y(this,void 0,void 0,function(){var i;return g(this,function(o){switch(o.label){case 0:return i=!1,[4,e({payload:Fe(n.event,{clone:!0,traverse:!1}),integrations:t??{},next:function(a){i=!0,a&&(n.event=a.obj)}})];case 1:if(o.sent(),!i)throw new ae({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(e.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:r,page:r,screen:r,identify:r,alias:r,group:r}}const ro=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:Fr,sourceMiddlewarePlugin:to},Symbol.toStringTag,{value:"Module"}));function xe(e,t){var r=t.methodName,n=t.integrationName,i=t.type,o=t.didError,a=o===void 0?!1:o;e.stats.increment("analytics_js.integration.invoke".concat(a?".error":""),1,["method:".concat(r),"integration_name:".concat(n),"type:".concat(i)])}var no=function(){function e(t,r){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=Xt(),this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=r,this.name=t,this.type=r.type,this.alternativeNames.push(r.name)}return e.prototype.addMiddleware=function(){for(var t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];this.type==="destination"&&(t=this.middleware).push.apply(t,r)},e.prototype.transform=function(t){return y(this,void 0,void 0,function(){var r;return g(this,function(n){switch(n.label){case 0:return[4,Fr(this.name,t.event,this.middleware)];case 1:return r=n.sent(),r===null&&t.cancel(new ae({retry:!1,reason:"dropped by destination middleware"})),[2,new K(r)]}})})},e.prototype._createMethod=function(t){var r=this;return function(n){return y(r,void 0,void 0,function(){var i,o;return g(this,function(a){switch(a.label){case 0:return this.action[t]?(i=n,this.type!=="destination"?[3,2]:[4,this.transform(n)]):[2,n];case 1:i=a.sent(),a.label=2;case 2:return a.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!a.sent())throw new Error("Something prevented the destination from getting ready");return xe(n,{integrationName:this.action.name,methodName:t,type:"action"}),[4,this.action[t](i)];case 4:return a.sent(),[3,6];case 5:throw o=a.sent(),xe(n,{integrationName:this.action.name,methodName:t,type:"action",didError:!0}),o;case 6:return[2,n]}})})}},e.prototype.isLoaded=function(){return this.action.isLoaded()},e.prototype.ready=function(){return y(this,void 0,void 0,function(){return g(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}})})},e.prototype.load=function(t,r){return y(this,void 0,void 0,function(){var n,i,o,a;return g(this,function(u){switch(u.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];u.label=1;case 1:return u.trys.push([1,3,,4]),xe(t,{integrationName:this.action.name,methodName:"load",type:"action"}),n=this.action.load(t,r),o=(i=this.loadPromise).resolve,[4,n];case 2:return o.apply(i,[u.sent()]),[2,n];case 3:throw a=u.sent(),xe(t,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(a),a;case 4:return[2]}})})},e.prototype.unload=function(t,r){var n,i;return(i=(n=this.action).unload)===null||i===void 0?void 0:i.call(n,t,r)},e}();function io(e){if(!Array.isArray(e))throw new Error("Not a valid list of plugins");var t=["load","isLoaded","name","version","type"];return e.forEach(function(r){t.forEach(function(n){var i;if(r[n]===void 0)throw new Error("Plugin: ".concat((i=r.name)!==null&&i!==void 0?i:"unknown"," missing required function ").concat(n))})}),!0}function oo(e,t){var r=e[t.creationName],n=e[t.name];return e.All===!1&&!r&&!n||r===!1||n===!1}function ao(e,t){return y(this,void 0,void 0,function(){var r,n,i,o,a,u;return g(this,function(s){switch(s.label){case 0:if(s.trys.push([0,9,,10]),r=new RegExp("https://cdn.segment.(com|build)"),n=Rt(),!t)return[3,6];i=e.url.split("/"),o=i[i.length-2],a=e.url.replace(o,btoa(o).replace(/=/g,"")),s.label=1;case 1:return s.trys.push([1,3,,5]),[4,Qe(a.replace(r,n))];case 2:return s.sent(),[3,5];case 3:return s.sent(),[4,Qe(e.url.replace(r,n))];case 4:return s.sent(),[3,5];case 5:return[3,8];case 6:return[4,Qe(e.url.replace(r,n))];case 7:s.sent(),s.label=8;case 8:return typeof window[e.libraryName]=="function"?[2,window[e.libraryName]]:[3,10];case 9:throw u=s.sent(),console.error("Failed to create PluginFactory",e),u;case 10:return[2]}})})}function uo(e,t,r,n,i,o){var a,u,s;return y(this,void 0,void 0,function(){var c,l,d,p=this;return g(this,function(h){switch(h.label){case 0:return c=[],l=(u=(a=e.middlewareSettings)===null||a===void 0?void 0:a.routingRules)!==null&&u!==void 0?u:[],d=((s=e.remotePlugins)!==null&&s!==void 0?s:[]).map(function(v){return y(p,void 0,void 0,function(){var m,S,w,b,E,O,I;return g(this,function(M){switch(M.label){case 0:if(oo(t,v))return[2];M.label=1;case 1:return M.trys.push([1,6,,7]),S=o==null?void 0:o.find(function(D){var Q=D.pluginName;return Q===v.name}),S?[3,3]:[4,ao(v,n==null?void 0:n.obfuscate)];case 2:S=M.sent(),M.label=3;case 3:return m=S,m?(w=r[v.name],[4,m(f(f({},v.settings),w))]):[3,5];case 4:b=M.sent(),E=Array.isArray(b)?b:[b],io(E),O=l.filter(function(D){return D.destinationName===v.creationName}),E.forEach(function(D){var Q=new no(v.creationName,D);O.length&&i&&Q.addMiddleware(i),c.push(Q)}),M.label=5;case 5:return[3,7];case 6:return I=M.sent(),console.warn("Failed to load Remote Plugin",I),[3,7];case 7:return[2]}})})}),[4,Promise.all(d)];case 1:return h.sent(),[2,c.filter(Boolean)]}})})}var He,Wt,so=ht(),Qt=(He=(Wt=so).__SEGMENT_INSPECTOR__)!==null&&He!==void 0?He:Wt.__SEGMENT_INSPECTOR__={},co=function(e){var t;return(t=Qt.attach)===null||t===void 0?void 0:t.call(Qt,e)};function lo(e,t){return Te("".concat(t,"/v1/projects/").concat(e,"/settings")).then(function(r){return r.ok?r.json():r.text().then(function(n){throw new Error(n)})}).catch(function(r){throw console.error(r.message),r})}function fo(e){return Dr().NODE_ENV!=="test"&&Object.keys(e.integrations).length>1}function vo(e){var t,r,n;return Dr().NODE_ENV!=="test"&&((n=(r=(t=e.middlewareSettings)===null||t===void 0?void 0:t.routingRules)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0)>0}function ho(e,t){Ln(e,t),Rn(e,t)}function po(e,t,r){return y(this,void 0,void 0,function(){return g(this,function(n){switch(n.label){case 0:return[4,go(e,t)];case 1:return n.sent(),Nn(e,r),[2]}})})}var yo=function(){var e,t,r=(e=window.location.hash)!==null&&e!==void 0?e:"",n=(t=window.location.search)!==null&&t!==void 0?t:"",i=n.length?n:r.replace(/(?=#).*(?=\?)/,"");return i},go=function(e,t){return y(void 0,void 0,void 0,function(){return g(this,function(r){switch(r.label){case 0:return t.includes("ajs_")?[4,e.queryString(t).catch(console.error)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})};function mo(e,t,r,n,i,o,a){var u,s,c;return i===void 0&&(i=[]),y(this,void 0,void 0,function(){var l,d,p,h,v,m,S,w,b,E,O,I,M,D,Q,Tr=this;return g(this,function(F){switch(F.label){case 0:return ho(r,a),l=i==null?void 0:i.filter(function(T){return typeof T=="object"}),d=i==null?void 0:i.filter(function(T){return typeof T=="function"&&typeof T.pluginName=="string"}),vo(t)?[4,U(()=>import("./index-D6ZMQedT.js"),[]).then(function(T){return T.tsubMiddleware(t.middlewareSettings.routingRules)})]:[3,2];case 1:return h=F.sent(),[3,3];case 2:h=void 0,F.label=3;case 3:return p=h,fo(t)||o.length>0?[4,U(()=>import("./index-DRDPElRz.js"),__vite__mapDeps([3,1,4])).then(function(T){return T.ajsDestinations(e,t,r.integrations,n,p,o)})]:[3,5];case 4:return m=F.sent(),[3,6];case 5:m=[],F.label=6;case 6:return v=m,t.legacyVideoPluginsEnabled?[4,U(()=>import("./index-2KTRZ_wQ.js"),__vite__mapDeps([5,1])).then(function(T){return T.loadLegacyVideoPlugins(r)})]:[3,8];case 7:F.sent(),F.label=8;case 8:return!((u=n.plan)===null||u===void 0)&&u.track?[4,U(()=>import("./index-CTkTBFvA.js"),__vite__mapDeps([6,1,4])).then(function(T){var te;return T.schemaFilter((te=n.plan)===null||te===void 0?void 0:te.track,t)})]:[3,10];case 9:return w=F.sent(),[3,11];case 10:w=void 0,F.label=11;case 11:return S=w,b=Ki(t,n),[4,uo(t,r.integrations,b,n,p,d).catch(function(){return[]})];case 12:return E=F.sent(),O=C(C([eo],v,!0),E,!0),S&&O.push(S),I=((s=n.integrations)===null||s===void 0?void 0:s.All)===!1&&!n.integrations["Segment.io"]||n.integrations&&n.integrations["Segment.io"]===!1,I?[3,14]:(D=(M=O).push,[4,Cr(r,b["Segment.io"],t.integrations)]);case 13:D.apply(M,[F.sent()]),F.label=14;case 14:return[4,r.register.apply(r,C(C([],O,!1),l,!1))];case 15:return Q=F.sent(),[4,jn(r,a)];case 16:return F.sent(),Object.entries((c=t.enabledMiddleware)!==null&&c!==void 0?c:{}).some(function(T){var te=T[1];return te})?[4,U(()=>import("./index-C42TJOmu.js"),__vite__mapDeps([7,1])).then(function(T){var te=T.remoteMiddlewares;return y(Tr,void 0,void 0,function(){var Lt,Nt;return g(this,function(qt){switch(qt.label){case 0:return[4,te(Q,t,n.obfuscate)];case 1:return Lt=qt.sent(),Nt=Lt.map(function(jr){return r.addSourceMiddleware(jr)}),[2,Promise.all(Nt)]}})})})]:[3,18];case 17:F.sent(),F.label=18;case 18:return[4,Tn(r,a)];case 19:return F.sent(),[2,Q]}})})}function bo(e,t,r){var n,i,o,a,u,s,c,l,d;return t===void 0&&(t={}),y(this,void 0,void 0,function(){var p,h,v,m,S,w,b,E,O,I,M;return g(this,function(D){switch(D.label){case 0:return t.disable===!0?[2,[new Gt,K.system()]]:(t.globalAnalyticsKey&&Dn(t.globalAnalyticsKey),e.cdnURL&&Bi(e.cdnURL),t.initialPageview&&r.add(new it("page",[])),p=yo(),h=(n=e.cdnURL)!==null&&n!==void 0?n:Rt(),(i=e.cdnSettings)!==null&&i!==void 0?(m=i,[3,3]):[3,1]);case 1:return[4,lo(e.writeKey,h)];case 2:m=D.sent(),D.label=3;case 3:return v=m,t.updateCDNSettings&&(v=t.updateCDNSettings(v)),typeof t.disable!="function"?[3,5]:[4,t.disable(v)];case 4:if(S=D.sent(),S)return[2,[new Gt,K.system()]];D.label=5;case 5:return w=(a=(o=v.integrations["Segment.io"])===null||o===void 0?void 0:o.retryQueue)!==null&&a!==void 0?a:!0,t=f({retryQueue:w},t),b=new jt(f(f({},e),{cdnSettings:v,cdnURL:h}),t),co(b),E=(u=e.plugins)!==null&&u!==void 0?u:[],O=(s=e.classicIntegrations)!==null&&s!==void 0?s:[],I=(c=t.integrations)===null||c===void 0?void 0:c["Segment.io"],nr.initRemoteMetrics(f(f({},v.metrics),{host:(l=I==null?void 0:I.apiHost)!==null&&l!==void 0?l:(d=v.metrics)===null||d===void 0?void 0:d.host,protocol:I==null?void 0:I.protocol})),[4,mo(e.writeKey,v,b,t,E,O,r)];case 6:return M=D.sent(),b.initialized=!0,b.emit("initialize",e,t),[4,po(b,p,r)];case 7:return D.sent(),[2,[b,M]]}})})}var _o=function(e){L(t,e);function t(){var r=this,n=Xt(),i=n.promise,o=n.resolve;return r=e.call(this,function(a){return i.then(function(u){var s=u[0],c=u[1];return bo(s,c,a)})})||this,r._resolveLoadStart=function(a,u){return o([a,u])},r}return t.prototype.load=function(r,n){return n===void 0&&(n={}),this._resolveLoadStart(r,n),this},t.load=function(r,n){return n===void 0&&(n={}),new t().load(r,n)},t.standalone=function(r,n){return t.load({writeKey:r},n).then(function(i){return i[0]})},t}(Un);const Po=Object.freeze(Object.defineProperty({__proto__:null,Analytics:jt,AnalyticsBrowser:_o,Context:K,ContextCancelation:ae,EventFactory:sr,Group:yr,UniversalStorage:Z,User:mt,getGlobalAnalytics:_t,isDestinationPluginWithAddMiddleware:cr,resolveAliasArguments:tr,resolveArguments:er,resolvePageArguments:Ze,resolveUserArguments:et,segmentio:Cr},Symbol.toStringTag,{value:"Module"}));export{ae as C,ft as P,Eo as a,Se as b,Fr as c,X as d,So as e,Ti as f,Vi as g,Xt as h,q as i,pt as j,we as k,Qe as l,Ki as m,ln as n,K as o,Wr as p,Po as q,xe as r,Io as u};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),ve=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(ve||{}),T=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(T||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),dt=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(dt||{}),ht=(e=>(e.Retry="retry",e))(ht||{}),pt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(pt||{}),X=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(X||{}),mt=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(mt||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),Et=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(Et||{}),b=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(b||{}),ft=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(ft||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),gt=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(gt||{}),_t=(e=>(e.Harmony="HARMONY",e))(_t||{}),vt=(e=>(e.PhoneNumber="phone_number",e))(vt||{}),Ee={VITE_SEGMENT_DEV_API_KEY:"UJLmm39XefLTcE55pRdWiwBT1JoTs6OI",VITE_SEGMENT_PRD_API_KEY:"uMHQo9dBTi626Bv11I3RxcH3Jui8lKMm"},It=Object.create,pe=Object.defineProperty,yt=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,Me=Object.getOwnPropertySymbols,Nt=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Me)for(var r of Me(t))At.call(t,r)&&Le(e,r,t[r]);return e},ye=(e,t)=>yt(e,Rt(t)),Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Mt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $t(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=wt(t,n))||i.enumerable});return e},Lt=(e,t,r)=>(r=e!=null?It(Nt(e)):{},Mt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),v=(e,t,r)=>new Promise((i,n)=>{var s=u=>{try{o(r.next(u))}catch(l){n(l)}},a=u=>{try{o(r.throw(u))}catch(l){n(l)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,a);o((r=r.apply(e,t)).next())}),St=Ot((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function a(l,c,d,f,_){if(typeof d!="function")throw new TypeError("The listener must be a function");var I=new s(d,f||l,_),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],I]:l._events[$].push(I):(l._events[$]=I,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)r.call(c,d)&&l.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},u.prototype.listeners=function(l){var c=i?i+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,_=d.length,I=new Array(_);f<_;f++)I[f]=d[f].fn;return I},u.prototype.listenerCount=function(l){var c=i?i+l:l,d=this._events[c];return d?d.fn?1:d.length:0},u.prototype.emit=function(l,c,d,f,_,I){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,C,y;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,d),!0;case 4:return p.fn.call(p.context,c,d,f),!0;case 5:return p.fn.call(p.context,c,d,f,_),!0;case 6:return p.fn.call(p.context,c,d,f,_,I),!0}for(y=1,C=new Array(L-1);y<L;y++)C[y-1]=arguments[y];p.fn.apply(p.context,C)}else{var ut=p.length,V;for(y=0;y<ut;y++)switch(p[y].once&&this.removeListener(l,p[y].fn,void 0,!0),L){case 1:p[y].fn.call(p[y].context);break;case 2:p[y].fn.call(p[y].context,c);break;case 3:p[y].fn.call(p[y].context,c,d);break;case 4:p[y].fn.call(p[y].context,c,d,f);break;default:if(!C)for(V=1,C=new Array(L-1);V<L;V++)C[V-1]=arguments[V];p[y].fn.apply(p[y].context,C)}}return!0},u.prototype.on=function(l,c,d){return a(this,l,c,d,!1)},u.prototype.once=function(l,c,d){return a(this,l,c,d,!0)},u.prototype.removeListener=function(l,c,d,f){var _=i?i+l:l;if(!this._events[_])return this;if(!c)return o(this,_),this;var I=this._events[_];if(I.fn)I.fn===c&&(!f||I.once)&&(!d||I.context===d)&&o(this,_);else{for(var $=0,p=[],L=I.length;$<L;$++)(I[$].fn!==c||f&&!I[$].once||d&&I[$].context!==d)&&p.push(I[$]);p.length?this._events[_]=p.length===1?p[0]:p:o(this,_)}return this},u.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)});function Ct(e){let t={exports:{}};return e(t,t.exports),t.exports}var bt=Number.MAX_SAFE_INTEGER||9007199254740991,we={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:bt,MAX_SAFE_COMPONENT_LENGTH:16},Pt=typeof process=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=Pt,ee=Ct(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(u,l,c)=>{let d=a++;E(d,l),s[u]=d,n[d]=l,i[d]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,Be=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},kt=(e,t)=>Be(t,e),Ut={compareIdentifiers:Be,rcompareIdentifiers:kt},{MAX_LENGTH:Ce,MAX_SAFE_INTEGER:re}=we,{re:be,t:Pe}=ee,{compareIdentifiers:H}=Ut,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Ce)throw new TypeError(`version is longer than ${Ce} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?be[Pe.LOOSE]:be[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Dt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Dt,Gt=(e,t,r)=>q(e,t,r)===0,xt=Gt,Ft=(e,t,r)=>q(e,t,r)!==0,Wt=Ft,jt=(e,t,r)=>q(e,t,r)>0,qt=jt,Vt=(e,t,r)=>q(e,t,r)>=0,Ht=Vt,Bt=(e,t,r)=>q(e,t,r)<0,Xt=Bt,Kt=(e,t,r)=>q(e,t,r)<=0,Yt=Kt,zt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return xt(e,r,i);case"!=":return Wt(e,r,i);case">":return qt(e,r,i);case">=":return Ht(e,r,i);case"<":return Xt(e,r,i);case"<=":return Yt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=zt,B=Symbol("SemVer ANY"),Q=class{static get ANY(){return B}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===B?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=B}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===B||e===B)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,cr(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Jt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Qt)).replace(N[R.CARETTRIM],Zt)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>er(n,this.options)).join(" ").split(/\s+/).map(n=>lr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ur(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Jt,tildeTrimReplace:Qt,caretTrimReplace:Zt}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},er=(e,t)=>(E("comp",e,t),e=ir(e,t),E("caret",e),e=tr(e,t),E("tildes",e),e=sr(e,t),E("xrange",e),e=ar(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",tr=(e,t)=>e.trim().split(/\s+/).map(r=>rr(r,t)).join(" "),rr=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let u;return E("tilde",e,i,n,s,a,o),A(n)?u="":A(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),u=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",u),u})},ir=(e,t)=>e.trim().split(/\s+/).map(r=>nr(r,t)).join(" "),nr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,u)=>{let l;return E("caret",e,n,s,a,o,u),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(E("replaceCaret pr",u),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},sr=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>or(r,t)).join(" ")),or=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,u)=>{E("xRange",e,i,n,s,a,o,u);let l=A(s),c=l||A(a),d=c||A(o),f=d;return n==="="&&f&&(n=""),u=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(u="-0"),i=`${n+s}.${a}.${o}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},ar=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),lr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),cr=e=>(t,r,i,n,s,a,o,u,l,c,d,f,_)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${d}-${f}`:e?`<${l}.${c}.${+d+1}-0`:`<=${u}`}`.trim(),ur=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},dr=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:hr}=we,{re:Ge,t:xe}=ee,pr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>hr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},mr=pr,{re:ie,t:ne}=ee,Er=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:mr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function fr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function gr(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function _r(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,fr))}function vr(e){return decodeURIComponent(Array.from(atob(e),gr).join(""))}function Xe(e){return _r(JSON.stringify(e))}function Ir(e){return JSON.parse(vr(e))}function K(e){return typeof e>"u"}function yr(e){return e===null}function Ke(e){return yr(e)||K(e)}function wr(e){return Ke(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function Rr(e){return Ke(e)?!1:typeof e=="number"&&Object.values(ve).includes(e)}function ue(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function _i(e,t){return Object.assign(g,t),e}var $r={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},de=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Rr(t)?t:ve.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,de.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ye=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ye.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Nr(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Ar(){return new D(U.ModalNotReady,"Modal is not ready.")}function Or(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Tr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Mr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
|
|
2
|
+
- Extension \`${r.name}\` supports version(s) \`${i}\``:i||(t+=`
|
|
3
|
+
- Extension \`${r.name}\` does not support ${g.platform} environments.`)}),new D(U.IncompatibleExtensions,t)}function Lr(e){let t=r=>{let i=r+1,n=i%10,s=i%100;return n===1&&s!==11?`${i}st`:n===2&&s!==12?`${i}nd`:n===3&&s!==13?`${i}rd`:`${i}th`};return new D(U.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
|
|
4
|
+
Expected: \`${e.expected}\`
|
|
5
|
+
Received: \`${e.received}\``)}function vi(){return new te(j.DuplicateIframe,"Duplicate iframes found.")}function Sr(){return new te(j.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function Cr(){return new te(j.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${g.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function Y(e){let{method:t,removalVersions:r,useInstead:i}=e,n=r[g.sdkName],s=i?` Use \`${i}\` instead.`:"",a=`\`${t}\` will be removed from \`${g.sdkName}\` in version \`${n}\`.${s}`;return new te(j.DeprecationNotice,a)}function*br(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}var Pr=br();function ze(){return Pr.next().value}var Je=Symbol("Payload pre-processed by Magic SDK");function Qe(e){return Object.defineProperty(e,Je,{value:!0,enumerable:!1}),e}function kr(e){return!!e[Je]}function he(e){var t,r,i;return kr(e)||(e.jsonrpc=(t=e.jsonrpc)!=null?t:"2.0",e.id=ze(),e.method=(r=e.method)!=null?r:"noop",e.params=(i=e.params)!=null?i:[],Qe(e)),e}function m(e,t=[]){return Qe({params:t,method:e,jsonrpc:"2.0",id:ze()})}var Re=class{constructor(e){e instanceof Re?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):wr(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},Ur=Lt(St()),Dr=class extends Ur.default{};function Ze(){let e=new Dr;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...i)=>(e[t].apply(e,i),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var et=Symbol("isPromiEvent");function Gr(e){return!!e[et]}function Z(e){let t=tt(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:i}=Ze(),n=Symbol("Promise.then"),s=Symbol("Promise.catch"),a=Symbol("Promise.finally"),o=(c,d)=>(...f)=>{let _=d[c].apply(d,f);return u(_)},u=c=>Object.assign(c,{[et]:!0,[n]:c[n]||c.then,[s]:c[s]||c.catch,[a]:c[a]||c.finally,then:o(n,c),catch:o(s,c),finally:o(a,c),on:i("on",c),once:i("once",c),addListener:i("addListener",c),off:i("off",c),removeListener:i("removeListener",c),removeAllListeners:i("removeAllListeners",c),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),l=u(t.then(c=>(l.emit("done",c),l.emit("settled"),c),c=>{throw l.emit("error",c),l.emit("settled"),c}));return l}function tt(e){return new Promise((t,r)=>{let i=e(t,r);Promise.resolve(i).catch(r)})}var G=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(ce.MAGIC_HANDLE_REQUEST,he(e)),r=Z((n,s)=>{t.then(a=>{if(i(),a.hasError)s(new de(a.payload.error));else if(a.hasResult)n(a.payload.result);else throw Or()}).catch(a=>{i(),s(a)})}),i=this.overlay.on(k.MAGIC_HANDLE_EVENT,n=>{var s;let{response:a}=n.data;if(a.id===e.id&&((s=a.result)!=null&&s.event)){let{event:o,params:u=[]}=a.result;r.emit(o,...u)}});return r}createIntermediaryEvent(e,t){return r=>{let i=m(h.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(i)}}};function xr(e,t){let[r]=e.split(".").map(Number);return r>=t}var z={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},Fr=class extends G{loginWithMagicLink(e){let t=g.sdkName==="@magic-sdk/react-native"||g.sdkName==="@magic-sdk/react-native-bare"||g.sdkName==="@magic-sdk/react-native-expo";if(t&&xr(g.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");t&&Y({method:"auth.loginWithMagicLink()",removalVersions:z,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:i=!0,redirectURI:n,overrides:s}=e,a=m(this.sdk.testMode?h.LoginWithMagicLinkTestMode:h.LoginWithMagicLink,[{email:r,showUI:i,redirectURI:n,overrides:s}]);return this.request(a)}loginWithSMS(e){let{phoneNumber:t}=e,r=m(this.sdk.testMode?h.LoginWithSmsTestMode:h.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r,deviceCheckUI:i,overrides:n}=e,s=m(this.sdk.testMode?h.LoginWithEmailOTPTestMode:h.LoginWithEmailOTP,[{email:t,showUI:r,deviceCheckUI:i,overrides:n}]),a=this.request(s);return!i&&a&&a.on(ge.Retry,()=>{this.createIntermediaryEvent(ge.Retry,s.id)()}),!r&&a&&(a.on(X.VerifyEmailOtp,o=>{this.createIntermediaryEvent(X.VerifyEmailOtp,s.id)(o)}),a.on(X.Cancel,()=>{this.createIntermediaryEvent(X.Cancel,s.id)()})),a}loginWithCredential(e){let t=e??"";if(!e&&g.platform==="web"){t=window.location.search;let i=window.location.origin+window.location.pathname;window.history.replaceState(null,"",i)}let r=m(this.sdk.testMode?h.LoginWithCredentialTestMode:h.LoginWithCredential,[t]);return this.request(r)}setAuthorizationToken(e){let t=m(h.SetAuthorizationToken,[{jwt:e}]);return this.request(t)}updateEmailWithUI(e){let{email:t,showUI:r=!0}=e,i=m(this.sdk.testMode?h.UpdateEmailTestMode:h.UpdateEmail,[{email:t,showUI:r}]),n=this.request(i);return r||(n.on(b.Retry,()=>{this.createIntermediaryEvent(b.Retry,i.id)()}),n.on(b.Cancel,()=>{this.createIntermediaryEvent(b.Cancel,i.id)()}),n.on(b.VerifyEmailOtp,s=>{this.createIntermediaryEvent(b.VerifyEmailOtp,i.id)(s)}),n.on(P.RetryWithNewEmail,s=>{this.createIntermediaryEvent(P.RetryWithNewEmail,i.id)(s)}),n.on(P.Cancel,()=>{this.createIntermediaryEvent(P.Cancel,i.id)()}),n.on(P.VerifyEmailOtp,s=>{this.createIntermediaryEvent(P.VerifyEmailOtp,i.id)(s)})),n}},rt={};Tt(rt,{clear:()=>Wr,getItem:()=>O,iterate:()=>it,key:()=>qr,keys:()=>Vr,length:()=>jr,removeItem:()=>W,setItem:()=>M});var se;function S(e){return(...t)=>v(this,null,function*(){return se||(se=yield g.configureStorage()),yield se.ready(),se[e](...t)})}var O=S("getItem"),M=S("setItem"),W=S("removeItem"),Wr=S("clear"),jr=S("length"),qr=S("key"),Vr=S("keys"),it=S("iterate");function Hr(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&191|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var nt="STORE_KEY_PRIVATE_KEY",_e="STORE_KEY_PUBLIC_JWK",st="ECDSA",Br="P-256",Xr={name:st,namedCurve:Br};function me(){let e=typeof window<"u"&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}function Kr(){return v(this,null,function*(){let e=yield Yr();if(!e){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:t}=window.crypto,r=yield O(nt);if(!r||!t){console.info("unable to find private key or webcrypto unsupported");return}let i={iat:Math.floor(new Date().getTime()/1e3),jti:Hr()},n={typ:"dpop+jwt",alg:"ES256",jwk:e},s={protected:We(JSON.stringify(n)),claims:We(JSON.stringify(i))},a=Jr(`${s.protected}.${s.claims}`),o={name:st,hash:{name:"SHA-256"}},u=Zr(new Uint8Array(yield t.sign(o,r,a)));return`${s.protected}.${s.claims}.${u}`})}function Yr(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}return(yield O(_e))||(yield zr()),O(_e)})}function zr(){return v(this,null,function*(){let{subtle:e}=window.crypto,t=yield e.generateKey(Xr,!1,["sign"]),r=yield e.exportKey("jwk",t.publicKey);yield M(nt,t.privateKey),yield M(_e,r)})}function We(e){return ot(Qr(e))}function Jr(e){return new TextEncoder().encode(e)}function ot(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function Qr(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,r)=>String.fromCharCode(parseInt(r,16)))}function Zr(e){let t="";return e.forEach(r=>{t+=String.fromCharCode(r)}),ot(t)}var $e="ds",Ne="ek",Ae="iv",Oe="AES-GCM",ei=256;function Te(){return v(this,null,function*(){let e=[];yield it((t,r,i)=>{r.startsWith(`${$e}_`)&&e.push(r)});for(let t of e)yield W(t)})}function at(e){let t="",r=new Uint8Array(e),i=r.byteLength;for(let n=0;n<i;n++)t+=String.fromCharCode(r[n]);return window.btoa(t)}function lt(e){let t=window.atob(e),r=t.length,i=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}function ti(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{crypto:e}=window;return(yield O(Ae))||e.getRandomValues(new Uint8Array(12))})}function ri(){return v(this,null,function*(){if(!me()){console.info("webcrypto is not supported");return}let{subtle:e}=window.crypto;return(yield O(Ne))||(yield e.generateKey({name:Oe,length:ei},!1,["encrypt","decrypt"]))})}function ii(e,t){return v(this,null,function*(){let r=yield ti(),i=yield ri();if(!r||!i||!e)return;let n=lt(e),{subtle:s}=window.crypto,a=yield s.encrypt({name:Oe,iv:r},i,n),o=at(a);yield M(`${$e}_${t}`,o),yield M(Ne,i),yield M(Ae,r)})}function ni(e){return v(this,null,function*(){let t=yield O(`${$e}_${e}`),r=yield O(Ae),i=yield O(Ne);if(!r||!t||!i||!me())return;let{subtle:n}=window.crypto,s=yield n.decrypt({name:Oe,iv:r},i,lt(t));return at(s)})}function je(e,t){return t?new URL(e,t):new URL(e)}var si=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet",this.localForageIsLoggedInKey="magic_auth_is_logged_in",this.userLoggedOutCallbacks=[]}getIdToken(e){let t=m(this.sdk.testMode?h.GetIdTokenTestMode:h.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=m(this.sdk.testMode?h.GenerateIdTokenTestMode:h.GenerateIdToken,[e]);return this.request(t)}getInfo(){return v(this,null,function*(){let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}isLoggedIn(){return Z((e,t)=>v(this,null,function*(){try{let r=!1;this.sdk.useStorageCache&&(r=(yield O(this.localForageIsLoggedInKey))==="true",r&&e(!0));let i=m(this.sdk.testMode?h.IsLoggedInTestMode:h.IsLoggedIn),n=yield this.request(i);this.sdk.useStorageCache&&(n?M(this.localForageIsLoggedInKey,!0):W(this.localForageIsLoggedInKey),r&&!n&&this.emitUserLoggedOut(!0)),e(n)}catch(r){t(r)}}))}logout(){return W(this.localForageKey),W(this.localForageIsLoggedInKey),Te(),Z((e,t)=>v(this,null,function*(){try{let r=m(this.sdk.testMode?h.LogoutTestMode:h.Logout),i=yield this.request(r);this.sdk.useStorageCache&&this.emitUserLoggedOut(i),e(i)}catch(r){t(r)}}))}requestInfoWithUI(e){let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}showSettings(e){let t=m(this.sdk.testMode?h.UserSettingsTestMode:h.UserSettings,[e]);return this.request(t)}recoverAccount(e){let t=m(this.sdk.testMode?h.RecoverAccountTestMode:h.RecoverAccount,[e]);return this.request(t)}getMetadata(){Y({method:"user.getMetadata()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=m(this.sdk.testMode?h.GetMetadataTestMode:h.GetMetadata);return this.request(e)}onUserLoggedOut(e){this.userLoggedOutCallbacks.push(e)}emitUserLoggedOut(e){this.userLoggedOutCallbacks.forEach(t=>{t(e)})}},oi=class extends G{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Z((t,r)=>v(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(T.MetaMask))){let o=yield this.autoConnectIfWalletBrowser(T.MetaMask);t(o);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(T.CoinbaseWallet))){let o=yield this.autoConnectIfWalletBrowser(T.CoinbaseWallet);t(o);return}let i=this.getUserEnv(),n=m(h.Login,[i]),s=this.request(n);s.on(ae.WalletSelected,o=>this.handleWalletSelected(ye(Ie({},o),{payloadId:n.id}))),s.on("id-token-created",o=>{e.emit("id-token-created",o)});let a=yield s;a.error&&r(a),t(a)}catch(i){r(i)}}));return e}showUI(){return this.request(m(h.ShowUI))}showAddress(){return this.request(m(h.ShowAddress))}showSendTokensUI(){return this.request(m(h.ShowSendTokensUI))}showOnRamp(){return this.request(m(h.ShowOnRamp))}showNFTs(){return this.request(m(h.ShowNFTs))}showBalances(){return this.request(m(h.ShowBalances))}sendGaslessTransaction(e,t){return this.request(m(h.SendGaslessTransaction,[e,t]))}getInfo(){return v(this,null,function*(){Y({method:"wallet.getInfo()",removalVersions:z,useInstead:"user.getInfo()"}).log();let e=yield O(this.localForageKey),t=m(h.GetInfo,[{walletType:e}]);return this.request(t)})}disconnect(){Y({method:"wallet.disconnect()",removalVersions:z,useInstead:"user.logout()"}).log(),W(this.localForageKey),Te();let e=m(h.Disconnect);return this.request(e)}requestUserInfoWithUI(e){Y({method:"wallet.requestUserInfoWithUI()",removalVersions:z,useInstead:"user.requestUserInfoWithUI()"}).log();let t=m(h.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}getProvider(){return v(this,null,function*(){switch(yield O(this.localForageKey)){case T.MetaMask:return this.getMetaMaskProvider();case T.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,t,r;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((r=(t=window.ethereum)==null?void 0:t.providers)!=null&&r.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,t;return((t=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:t.find(r=>r==null?void 0:r.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case T.MetaMask:return this.connectToMetaMask();case T.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let t=m("mc_is_wallet_enabled",[{wallet:e}]);return this.request(t)}handleWalletSelected(e){return v(this,null,function*(){try{let t=yield this.connectToThirdPartyWallet(e.wallet);yield M(this.localForageKey,e.wallet),this.createIntermediaryEvent(ae.WalletConnected,e.payloadId)(t)}catch(t){console.error(t),this.createIntermediaryEvent(ae.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return v(this,null,function*(){let t;e===T.MetaMask&&(t=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===T.CoinbaseWallet&&(t=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield M(this.localForageKey,e);let r=m(h.AutoConnect,[{wallet:e,address:t}]);return this.request(r)})}},{createBoundEmitterMethod:oe,createChainingEmitterMethod:x}=Ze(),ai=class extends G{constructor(){super(...arguments),this.isMagic=!0,this.on=x("on",this),this.once=x("once",this),this.addListener=x("addListener",this),this.off=x("off",this),this.removeListener=x("removeListener",this),this.removeAllListeners=x("removeAllListeners",this),this.emit=oe("emit"),this.eventNames=oe("eventNames"),this.listeners=oe("listeners"),this.listenerCount=oe("listenerCount")}sendAsync(e,t){if(!t)throw Lr({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:t===null?"null":typeof t});if(Array.isArray(e))this.overlay.post(ce.MAGIC_HANDLE_REQUEST,e.map(r=>{let i=he(r);return this.prefixPayloadMethodForTestMode(i),i})).then(r=>{t(null,r.map(i=>ye(Ie({},i.payload),{error:i.hasError?new de(i.payload.error):null})))});else{let r=he(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(ce.MAGIC_HANDLE_REQUEST,r).then(i=>{t(i.hasError?new de(i.payload.error):null,i.payload)})}}send(e,t){if(typeof e=="string"){let i=m(e,Array.isArray(t)?t:[]);return this.request(i)}if(Array.isArray(e)||t){this.sendAsync(e,t);return}let r=Sr();return r.log(),new Re(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=m(h.Login);return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){let t="testMode/eth/";this.sdk.testMode&&(e.method=`${t}${e.method}`)}},qe=["request","overlay","sdk"];function li(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==G.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var ct=class extends G{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Z,isPromiEvent:Gr,encodeJSON:Xe,decodeJSON:Ir,createJsonRpcRequestPayload:m,standardizeJsonRpcRequestPayload:he,storage:rt};let e=[this,...li(this)];qe.forEach(t=>{let r=e.map(a=>Object.getOwnPropertyDescriptor(a,t)),i=r.findIndex(a=>!!a),n=i>0,s=r[i];s&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:s,isPrototypeField:n}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw Tr(t)}}))})}init(e){this.__is_initialized__||(qe.forEach(t=>{if(this.__sdk_access_field_descriptors__.has(t)){let{descriptor:r,isPrototypeField:i}=this.__sdk_access_field_descriptors__.get(t);i?delete this[t]:Object.defineProperty(this,t,r)}}),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:i}=e,n=i?` Use \`${i}\` instead.`:"",s=`\`${t}\` will be removed from this Extension in version \`${r}\`.${n}`;return new Fe(this,"DEPRECATION_NOTICE",s)}createWarning(e,t){return new Fe(this,e,t)}createError(e,t,r){return new Ye(this,e,t,r)}},ci=class extends ct{},J=class extends ct{};J.Internal=ci,J.Anonymous="anonymous extension";var ui=class extends G{purchase(e){let t=m(h.NFTPurchase,[e]);return this.request(t)}checkout(e){let t=m(h.NFTCheckout,[e]);return this.request(t)}transfer(e){let t=m(h.NFTTransfer,[e]);return this.request(t)}};function Ve(e){return e.compat&&e.compat[g.sdkName]!=null?typeof e.compat[g.sdkName]=="string"?dr(Er(g.version),e.compat[g.sdkName]):!!e.compat[g.sdkName]:!0}function di(e,t,r){return!t&&!r?`${e}_eth_mainnet`:r?`${e}_${JSON.stringify(r)}`:t?typeof t=="string"?`${e}_eth_${t}`:`${e}_${t.rpcUrl}_${t.chainId}_${t.chainType}`:`${e}_unknown`}function hi(e){var t;let r=(t=e==null?void 0:e.extensions)!=null?t:[],i={},n=[];if(Array.isArray(r)?r.forEach(s=>{Ve(s)?(s.init(this),(s.name||s.name!==J.Anonymous)&&(this[s.name]=s),s instanceof J.Internal&&(ue(s.config)||(i[s.name]=s.config))):n.push(s)}):Object.keys(r).forEach(s=>{if(Ve(r[s])){r[s].init(this);let a=r[s];this[s]=a,a instanceof J.Internal&&(ue(a.config)||(i[r[s].name]=a.config))}else n.push(r[s])}),n.length)throw Mr(n);return i}var le=class{constructor(e,t){this.apiKey=e;var r;if(!e)throw Nr();g.platform==="react-native"&&(t!=null&&t.endpoint)&&Cr().log();let{defaultEndpoint:i,version:n}=g;this.testMode=!!(t!=null&&t.testMode),this.useStorageCache=!!(t!=null&&t.useStorageCache),this.endpoint=je((r=t==null?void 0:t.endpoint)!=null?r:i).origin,this.auth=new Fr(this),this.user=new si(this),this.wallet=new oi(this),this.nft=new ui(this),this.rpcProvider=new ai(this);let s=hi.call(this,t);this.parameters=Xe(ye(Ie({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:t==null?void 0:t.network,host:je(this.endpoint).host,sdk:$r[g.sdkName],version:n,ext:ue(s)?void 0:s,locale:(t==null?void 0:t.locale)||"en_US"},g.bundleId?{bundleId:g.bundleId}:{}),{meta:t==null?void 0:t.meta})),this.networkHash=di(this.apiKey,t==null?void 0:t.network,ue(s)?void 0:s),t!=null&&t.deferPreload||this.preload()}get overlay(){if(!le.__overlays__.has(this.parameters)){let e=new g.ViewController(this.endpoint,this.parameters,this.networkHash);e.init(),le.__overlays__.set(this.parameters,e)}return le.__overlays__.get(this.parameters)}preload(){return v(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},pi=le;pi.__overlays__=new Map;function mi(e,t){return t&&Array.isArray(e)?e.find(r=>r.id===t):e}function Ei(e,t){var r;let i=(r=t.data.response)==null?void 0:r.id,n=mi(e,i);if(i&&n){let s=new Re(n).applyResult(t.data.response.result).applyError(t.data.response.error);return{id:i,response:s}}return{}}function fi(e,t,r){return v(this,null,function*(){var i;let n=yield O("rt"),s;if(g.platform==="web")try{s=(i=yield O("jwt"))!=null?i:yield Kr()}catch(u){console.error("webcrypto error",u)}let a={msgType:e,payload:t};s&&(a.jwt=s),s&&n&&(a.rt=n);let o=yield ni(r);return o&&(a.deviceShare=o),a})}function gi(e){return v(this,null,function*(){!e.data.rt||(yield M("rt",e.data.rt))})}var Ii=class{constructor(e,t,r){this.endpoint=e,this.parameters=t,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(e,t){return v(this,null,function*(){return tt((r,i)=>v(this,null,function*(){if(!this.isConnectedToInternet){let l=Ar();i(l)}this.isReadyForRequest||(yield this.waitForReady());let n=[],s=Array.isArray(t)?t.map(l=>l.id):[],a=yield fi(`${e}-${this.parameters}`,t,this.networkHash);yield this._post(a);let o=l=>c=>{var d;let{id:f,response:_}=Ei(t,c);if(gi(c),((d=_==null?void 0:_.payload.error)==null?void 0:d.message)==="User denied account access.")Te();else if(c.data.deviceShare){let{deviceShare:I}=c.data;ii(I,this.networkHash)}f&&_&&Array.isArray(t)&&s.includes(f)?(n.push(_),n.length===t.length&&(l(),r(n))):f&&_&&!Array.isArray(t)&&f===t.id&&(l(),r(_))},u=this.on(k.MAGIC_HANDLE_RESPONSE,o(()=>u()))}))})}on(e,t){let r=t.bind(window),i=n=>{n.data.msgType===`${e}-${this.parameters}`&&r(n)};return this.messageHandlers.add(i),()=>this.messageHandlers.delete(i)}waitForReady(){return new Promise(e=>{let t=this.on(k.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,e(),t()})})}listen(){this.on(k.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(k.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()}),this.on(k.MAGIC_SEND_PRODUCT_ANNOUNCEMENT,e=>{e.data.response.result.product_announcement&&new te(j.ProductAnnouncement,e.data.response.result.product_announcement).log()})}};export{pi as $,D as A,Ii as B,ae as E,X as I,je as J,_i as K,gt as L,pt as N,ft as O,ge as R,Et as T,P as U,Ye as V,te as W,de as _,J as a,mt as b,ht as c,ce as d,ve as e,k as f,dt as g,b as h,U as i,_t as k,Ar as m,j as p,vi as q,Fe as s,T as u,h as v,Gr as x,vt as y};
|