@walkeros/web-destination-segment 3.4.2 → 4.0.0-next-1777463920154
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/README.md +23 -23
- package/dist/dev.d.mts +13 -13
- package/dist/dev.d.ts +13 -13
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +13 -13
- package/dist/examples/index.d.ts +13 -13
- package/dist/examples/index.js +37 -32
- package/dist/examples/index.mjs +37 -32
- package/dist/index.browser.js +1 -1
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +52 -199
- package/package.json +3 -3
package/dist/index.browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Destination=(()=>{var t,e,n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,u=(t=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(t,{get:(t,e)=>("undefined"!=typeof require?require:t)[e]}):t)(function(t){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),c=(t,e)=>function(){return t&&(e=(0,t[o(t)[0]])(t=0)),e},l=(t,e)=>function(){return e||(0,t[o(t)[0]])((e={exports:{}}).exports,e),e.exports},d=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},f=(t,e,n,a)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let u of o(e))s.call(t,u)||u===n||r(t,u,{get:()=>e[u],enumerable:!(a=i(e,u))||a.enumerable});return t},p=(t,e,i)=>(i=null!=t?n(a(t)):{},f(!e&&t&&t.__esModule?i:r(i,"default",{value:t,enumerable:!0}),t));function h(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function v(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function y(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}u((r=r.apply(t,e||[])).next())})}function m(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function g(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var b=c({"../../../../node_modules/tslib/tslib.es6.mjs"(){t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)},e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)}}}),w=c({"../../../../node_modules/@segment/analytics-core/dist/esm/emitter/interface.js"(){}}),_=c({"../../../../node_modules/@segment/analytics-core/dist/esm/plugins/index.js"(){}}),x=c({"../../../../node_modules/@segment/analytics-core/dist/esm/events/interfaces.js"(){}});function k(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,a=e.length,s=t;o<a&&"__proto__"!=(i=""+e[o++])&&"constructor"!==i&&"prototype"!==i;)s=s[i]=o===a?n:typeof(r=s[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}var j,S,P=c({"../../../../node_modules/dset/dist/index.mjs"(){}}),O=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/pick.js"(){j=function(t,e){return Object.keys(t).filter(function(n){return e(n,t[n])}).reduce(function(e,n){return e[n]=t[n],e},{})}}}),I=c({"../../../../node_modules/@segment/analytics-core/dist/esm/validation/errors.js"(){b(),S=function(t){function e(e,n){var r=t.call(this,"".concat(e," ").concat(n))||this;return r.field=e,r}return h(e,t),e}(Error)}});function A(t){return"string"==typeof t}function E(t){return"number"==typeof t}function M(t){return"function"==typeof t}function N(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var F,C,T,D=c({"../../../../node_modules/@segment/analytics-core/dist/esm/validation/helpers.js"(){}});function R(t){!function(t){if(null==t)throw new S("Event",T);if("object"!=typeof t)throw new S("Event",C)}(t),function(t){if(!A(t.type))throw new S(".type",F)}(t),function(t){if(!A(t.messageId))throw new S(".messageId",F)}(t),"track"===t.type&&(function(t){if(!A(t.event))throw new S(".event",F)}(t),function(t){if(!N(t.properties))throw new S(".properties",C)}(t)),["group","identify"].includes(t.type)&&function(t){if(!N(t.traits))throw new S(".traits",C)}(t)}var L,q,z=c({"../../../../node_modules/@segment/analytics-core/dist/esm/validation/assertions.js"(){I(),D(),F="is not a string",C="is not an object",T="is nil"}}),U=c({"../../../../node_modules/@segment/analytics-core/dist/esm/events/index.js"(){b(),x(),P(),O(),z(),L=function(){return function(t){var e,n;this.settings=t,this.createMessageId=t.createMessageId,this.onEventMethodCall=null!==(e=t.onEventMethodCall)&&void 0!==e?e:function(){},this.onFinishedEvent=null!==(n=t.onFinishedEvent)&&void 0!==n?n:function(){}}}(),q=function(){function t(t){this.settings=new L(t)}return t.prototype.track=function(t,n,r,i){return this.settings.onEventMethodCall({type:"track",options:r}),this.normalize(e(e({},this.baseEvent()),{event:t,type:"track",properties:null!=n?n:{},options:e({},r),integrations:e({},i)}))},t.prototype.page=function(t,n,r,i,o){var a;this.settings.onEventMethodCall({type:"page",options:i});var s={type:"page",properties:e({},r),options:e({},i),integrations:e({},o)};return null!==t&&(s.category=t,s.properties=null!==(a=s.properties)&&void 0!==a?a:{},s.properties.category=t),null!==n&&(s.name=n),this.normalize(e(e({},this.baseEvent()),s))},t.prototype.screen=function(t,n,r,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var a={type:"screen",properties:e({},r),options:e({},i),integrations:e({},o)};return null!==t&&(a.category=t),null!==n&&(a.name=n),this.normalize(e(e({},this.baseEvent()),a))},t.prototype.identify=function(t,n,r,i){return this.settings.onEventMethodCall({type:"identify",options:r}),this.normalize(e(e({},this.baseEvent()),{type:"identify",userId:t,traits:null!=n?n:{},options:e({},r),integrations:i}))},t.prototype.group=function(t,n,r,i){return this.settings.onEventMethodCall({type:"group",options:r}),this.normalize(e(e({},this.baseEvent()),{type:"group",traits:null!=n?n:{},options:e({},r),integrations:e({},i),groupId:t}))},t.prototype.alias=function(t,n,r,i){this.settings.onEventMethodCall({type:"alias",options:r});var o={userId:t,type:"alias",options:e({},r),integrations:e({},i)};return null!==n&&(o.previousId=n),void 0===t?this.normalize(e(e({},o),this.baseEvent())):this.normalize(e(e({},this.baseEvent()),o))},t.prototype.baseEvent=function(){return{integrations:{},options:{}}},t.prototype.context=function(t){var e,n=["userId","anonymousId","timestamp","messageId"];delete t.integrations;var r=Object.keys(t),i=null!==(e=t.context)&&void 0!==e?e:{},o={};return r.forEach(function(e){"context"!==e&&(n.includes(e)?k(o,e,t[e]):k(i,e,t[e]))}),[i,o]},t.prototype.normalize=function(t){var n,r,i=Object.keys(null!==(n=t.integrations)&&void 0!==n?n:{}).reduce(function(n,r){var i,o;return e(e({},n),((i={})[r]=Boolean(null===(o=t.integrations)||void 0===o?void 0:o[r]),i))},{});t.options=j(t.options||{},function(t,e){return void 0!==e});var o=e(e({},i),null===(r=t.options)||void 0===r?void 0:r.integrations),a=t.options?this.context(t.options):[],s=a[0],u=a[1],c=t.options,l=v(t,["options"]),d=e(e(e(e({timestamp:new Date},l),{context:s,integrations:o}),u),{messageId:c.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(d),R(d),d},t}()}});function B(t,e){return new Promise(function(n,r){var i=setTimeout(function(){r(Error("Promise timed out"))},e);t.then(function(t){return clearTimeout(i),n(t)}).catch(r)})}function V(t,e,n){var r;return(r=n,new Promise(function(t){return setTimeout(t,r)})).then(function(){return B(function(){try{return Promise.resolve(e(t))}catch(t){return Promise.reject(t)}}(),1e3)}).catch(function(e){null==t||t.log("warn","Callback Error",{error:e}),null==t||t.stats.increment("callback_error")}).then(function(){return t})}var K,H,J=c({"../../../../node_modules/@segment/analytics-core/dist/esm/callback/index.js"(){}}),G=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/create-deferred/create-deferred.js"(){K=function(){var t,e,n=!1,r=new Promise(function(r,i){t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n=!0,r.apply(void 0,t)},e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n=!0,i.apply(void 0,t)}});return{resolve:t,reject:e,promise:r,isSettled:function(){return n}}}}}),W=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/create-deferred/index.js"(){G()}}),Y=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/emitter/emitter.js"(){H=function(){function t(t){var e;this.callbacks={},this.warned=!1,this.maxListeners=null!==(e=null==t?void 0:t.maxListeners)&&void 0!==e?e:10}return t.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)},t.prototype.on=function(t,e){return this.callbacks[t]?(this.callbacks[t].push(e),this.warnIfPossibleMemoryLeak(t)):this.callbacks[t]=[e],this},t.prototype.once=function(t,e){var n=this,r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n.off(t,r),e.apply(n,i)};return this.on(t,r),this},t.prototype.off=function(t,e){var n,r=(null!==(n=this.callbacks[t])&&void 0!==n?n:[]).filter(function(t){return t!==e});return this.callbacks[t]=r,this},t.prototype.emit=function(t){for(var e,n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(null!==(e=this.callbacks[t])&&void 0!==e?e:[]).forEach(function(t){t.apply(n,r)}),this},t}()}}),Q=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/emitter/index.js"(){Y()}}),Z=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/index.js"(){W(),Q()}});var $,X,tt,et,nt,rt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/priority-queue/backoff.js"(){}}),it=c({"../../../../node_modules/@segment/analytics-core/dist/esm/priority-queue/index.js"(){b(),Z(),rt(),$="onRemoveFromFuture",X=function(t){function e(e,n,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=e,i.queue=n,i.seen=null!=r?r:{},i}return h(e,t),e.prototype.push=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.map(function(e){return!(t.updateAttempts(e)>t.maxAttempts||t.includes(e))&&(t.queue.push(e),!0)});return this.queue=this.queue.sort(function(e,n){return t.getAttempts(e)-t.getAttempts(n)}),r},e.prototype.pushWithBackoff=function(t,e){var n=this;if(void 0===e&&(e=0),0==e&&0===this.getAttempts(t))return this.push(t)[0];var r=this.updateAttempts(t);if(r>this.maxAttempts||this.includes(t))return!1;var i=function(t){var e=Math.random()+1,n=t.minTimeout,r=void 0===n?500:n,i=t.factor,o=void 0===i?2:i,a=t.attempt,s=t.maxTimeout,u=void 0===s?1/0:s;return Math.min(e*r*Math.pow(o,a),u)}({attempt:r-1});return e>0&&i<e&&(i=e),setTimeout(function(){n.queue.push(t),n.future=n.future.filter(function(e){return e.id!==t.id}),n.emit($)},i),this.future.push(t),!0},e.prototype.getAttempts=function(t){var e;return null!==(e=this.seen[t.id])&&void 0!==e?e:0},e.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},e.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(e){return e.id===t.id}))||Boolean(this.future.find(function(e){return e.id===t.id}))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(H)}});function ot(){var t,e=0,n="";if(!nt||tt+16>256){for(nt=Array(e=256);e--;)nt[e]=256*Math.random()|0;e=tt=0}for(;e<16;e++)t=nt[tt+e],n+=6==e?et[15&t|64]:8==e?et[63&t|128]:et[t],1&e&&e>1&&e<11&&(n+="-");return tt++,n}var at,st,ut,ct,lt,dt,ft=c({"../../../../node_modules/@lukeed/uuid/dist/index.mjs"(){for(tt=256,et=[];tt--;)et[tt]=(tt+256).toString(16).substring(1)}}),pt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/logger/index.js"(){b(),at=function(){function t(){this._logs=[]}return t.prototype.log=function(t,e,n){var r=new Date;this._logs.push({level:t,message:e,time:r,extras:n})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(t,n){var r,i,o,a=e(e({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete a.time;var s=null!==(o=null===(i=n.time)||void 0===i?void 0:i.toISOString())&&void 0!==o?o:"";return t[s]&&(s="".concat(s,"-").concat(Math.random())),e(e({},t),((r={})[s]=a,r))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(t){var e=t.level,n=t.message,r=t.extras;"info"===e||"debug"===e?console.log(n,null!=r?r:""):console[e](n,null!=r?r:"")});this._logs=[]},t}()}}),ht=c({"../../../../node_modules/@segment/analytics-core/dist/esm/stats/index.js"(){b(),st=function(t){return{gauge:"g",counter:"c"}[t]},ut=function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,e,n){void 0===e&&(e=1),this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,e,n){this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map(function(t){return e(e({},t),{tags:t.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:st(t.type),e:t.timestamp}})},t}(),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.gauge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.increment=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.flush=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.serialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return[]},e}(ut)}}),vt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/context/index.js"(){ft(),P(),pt(),ht(),lt=function(){return function(t){var e,n,r;this.retry=null===(e=t.retry)||void 0===e||e,this.type=null!==(n=t.type)&&void 0!==n?n:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""}}(),dt=function(){function t(t,e,n,r){void 0===e&&(e=ot()),void 0===n&&(n=new ct),void 0===r&&(r=new at),this.attempts=0,this.event=t,this._id=e,this.logger=r,this.stats=n}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new lt({reason:"Context Cancel"})},t.prototype.log=function(t,e,n){this.logger.log(t,e,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,e){var n;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(n=this.event.integrations)||void 0===n?void 0:n[r]))return this.event}return k(this.event,t,e),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}()}});var yt,mt,gt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/group-by.js"(){b()}}),bt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/is-thenable.js"(){yt=function(t){return"object"==typeof t&&null!==t&&"then"in t&&"function"==typeof t.then}}}),wt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/task/task-group.js"(){bt(),mt=function(){var t,e,n=0;return{done:function(){return t},run:function(r){var i=r();return yt(i)&&(1===++n&&(t=new Promise(function(t){return e=t})),i.finally(function(){return 0===--n&&e()})),i}}}}});function _t(t,e){t.log("debug","plugin",{plugin:e.name});var n=(new Date).getTime(),r=e[t.event.type];return void 0===r?Promise.resolve(t):function(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,n.sent()];case 2:return e=n.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}(function(){return r.apply(e,[t])}).then(function(t){var r=(new Date).getTime()-n;return t.stats.gauge("plugin_time",r,["plugin:".concat(e.name)]),t}).catch(function(n){if(n instanceof lt&&"middleware_cancellation"===n.type)throw n;return n instanceof lt?(t.log("warn",n.type,{plugin:e.name,error:n}),n):(t.log("error","plugin Error",{plugin:e.name,error:n}),t.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),n)})}function xt(t,e){return _t(t,e).then(function(e){if(e instanceof dt)return e;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(e)})}var kt,jt,St=c({"../../../../node_modules/@segment/analytics-core/dist/esm/queue/delivery.js"(){b(),vt()}}),Pt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/queue/event-queue.js"(){b(),gt(),it(),vt(),Z(),wt(),St(),kt=function(t){function e(e){var n=t.call(this)||this;return n.criticalTasks=mt(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=e,n.queue.on($,function(){n.scheduleFlush(0)}),n}return h(e,t),e.prototype.register=function(t,e,n){return y(this,void 0,void 0,function(){var r,i,o=this;return m(this,function(a){switch(a.label){case 0:return this.plugins.push(e),r=function(n){o.failedInitializations.push(e.name),o.emit("initialization_failure",e),console.warn(e.name,n),t.log("warn","Failed to load destination",{plugin:e.name,error:n}),o.plugins=o.plugins.filter(function(t){return t!==e})},"destination"!==e.type||"Segment.io"===e.name?[3,1]:(e.load(t,n).catch(r),[3,4]);case 1:return a.trys.push([1,3,,4]),[4,e.load(t,n)];case 2:return a.sent(),[3,4];case 3:return i=a.sent(),r(i),[3,4];case 4:return[2]}})})},e.prototype.deregister=function(t,e,n){return y(this,void 0,void 0,function(){var r;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.unload?[4,Promise.resolve(e.unload(t,n))]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==e.name}),[3,4];case 3:return r=i.sent(),t.log("warn","Failed to unload destination",{plugin:e.name,error:r}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),e=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,e]})})},e.prototype.subscribeToDelivery=function(t){return y(this,void 0,void 0,function(){var e=this;return m(this,function(n){return[2,new Promise(function(n){var r=function(i,o){i.isSame(t)&&(e.off("flush",r),n(i))};e.on("flush",r)})]})})},e.prototype.dispatchSingle=function(t){return y(this,void 0,void 0,function(){var e=this;return m(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(n){return e.enqueuRetry(n,t)?e.subscribeToDelivery(t):(t.setFailedDelivery({reason:n}),t)})]})})},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.scheduleFlush=function(t){var e=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){e.flush().then(function(){setTimeout(function(){e.flushing=!1,e.queue.length&&e.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){return y(this,void 0,void 0,function(){var e,n,r,i;return m(this,function(o){switch(o.label){case 0:return[4,this.criticalTasks.done()];case 1:o.sent(),e=Date.now(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=o.sent(),n=Date.now()-e,this.emit("delivery_success",t),t.stats.gauge("delivered",n),t.log("debug","Delivered",t.event),[2,t];case 4:throw r=o.sent(),i=r,t.log("error","Failed to deliver",i),this.emit("delivery_failure",t,i),t.stats.increment("delivery_failed"),r;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,e){return!(t instanceof lt&&!t.retry)&&this.queue.pushWithBackoff(e)},e.prototype.flush=function(){return y(this,void 0,void 0,function(){var t,e;return m(this,function(n){switch(n.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=n.sent(),this.emit("flush",t,!0),[3,4];case 3:return e=n.sent(),this.enqueuRetry(e,t)||(t.setFailedDelivery({reason:e}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var e,n,r=this.plugins.filter(function(e){var n,r,i;if("destination"!==e.type&&"Segment.io"!==e.name)return!0;var o=void 0;return null===(n=e.alternativeNames)||void 0===n||n.forEach(function(e){void 0!==t[e]&&(o=t[e])}),null!==(i=null!==(r=t[e.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Segment.io"===e.name||t.All)}),i=(e="type",n={},r.forEach(function(t){var r,i=void 0;if("string"==typeof e){var o=t[e];i="string"!=typeof o?JSON.stringify(o):o}else e instanceof Function&&(i=e(t));void 0!==i&&(n[i]=g(g([],null!==(r=n[i])&&void 0!==r?r:[],!0),[t],!1))}),n),o=i.before,a=void 0===o?[]:o,s=i.enrichment,u=void 0===s?[]:s,c=i.destination,l=void 0===c?[]:c,d=i.after;return{before:a,enrichment:u,destinations:l,after:void 0===d?[]:d}},e.prototype.flushOne=function(t){var e,n;return y(this,void 0,void 0,function(){var r,i,o,a,s,u,c,l,d,f,p,h,v,y;return m(this,function(m){switch(m.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),r=this.availableExtensions(null!==(e=t.event.integrations)&&void 0!==e?e:{}),i=r.before,o=r.enrichment,a=0,s=i,m.label=1;case 1:return a<s.length?(u=s[a],[4,xt(t,u)]):[3,4];case 2:(f=m.sent())instanceof dt&&(t=f),this.emit("message_enriched",t,u),m.label=3;case 3:return a++,[3,1];case 4:c=0,l=o,m.label=5;case 5:return c<l.length?(d=l[c],[4,_t(t,d)]):[3,8];case 6:(f=m.sent())instanceof dt&&(t=f),this.emit("message_enriched",t,d),m.label=7;case 7:return c++,[3,5];case 8:return p=this.availableExtensions(null!==(n=t.event.integrations)&&void 0!==n?n:{}),h=p.destinations,v=p.after,[4,new Promise(function(e,n){setTimeout(function(){var r=h.map(function(e){return _t(t,e)});Promise.all(r).then(e).catch(n)},0)})];case 9:return m.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),y=v.map(function(e){return _t(t,e)}),[4,Promise.all(y)];case 10:return m.sent(),[2,t]}})})},e}(H)}}),Ot=c({"../../../../node_modules/@segment/analytics-core/dist/esm/analytics/index.js"(){}});function It(t,e,n,r){return y(this,void 0,void 0,function(){var i,o;return m(this,function(a){switch(a.label){case 0:return n.emit("dispatch_start",t),i=Date.now(),e.isEmpty()?[4,e.dispatchSingle(t)]:[3,2];case 1:return o=a.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:o=a.sent(),a.label=4;case 4:return(null==r?void 0:r.callback)?[4,V(o,r.callback,jt(i,r.timeout))]:[3,6];case 5:o=a.sent(),a.label=6;case 6:return(null==r?void 0:r.debug)&&o.flush(),[2,o]}})})}var At=c({"../../../../node_modules/@segment/analytics-core/dist/esm/analytics/dispatch.js"(){b(),J(),jt=function(t,e){var n=Date.now()-t;return Math.max((null!=e?e:300)-n,0)}}}),Et=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/bind-all.js"(){}}),Mt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/index.js"(){w(),_(),x(),U(),J(),it(),vt(),Pt(),Ot(),At(),D(),I(),z(),Et(),ht(),St()}});function Nt(){return"undefined"!=typeof window}function Ft(){return!Nt()}var Ct=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/environment/index.js"(){}});function Tt(){return!Nt()||window.navigator.onLine}function Dt(){return!Tt()}var Rt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/connection/index.js"(){Ct()}});function Lt(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,n){o.push(e=e.toLowerCase()),a.push([e,n]),s[e]=s[e]?s[e]+","+n:n}),n(u())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)})}var qt,zt,Ut,Bt,Vt=c({"../../../../node_modules/unfetch/dist/unfetch.mjs"(){}}),Kt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/get-global.js"(){qt=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:null}}}),Ht=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/fetch.js"(){Vt(),Kt(),zt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=qt();return(n&&n.fetch||Lt).apply(void 0,t)}}}),Jt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/generated/version.js"(){Ut="1.82.0"}});function Gt(){return Bt}var Wt,Yt,Qt,Zt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/version-type.js"(){Bt="npm"}}),$t=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/constants/index.js"(){Wt="api.segment.io/v1"}});function Xt(t){console.error("Error sending segment performance metrics",t)}var te,ee,ne,re,ie,oe,ae=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/stats/remote-metrics.js"(){b(),Ht(),Jt(),Zt(),$t(),Yt=function(t,n,r){var i=n.reduce(function(t,e){var n=e.split(":"),r=n[0],i=n[1];return t[r]=i,t},{});return{type:"Counter",metric:t,value:1,tags:e(e({},i),{library:"analytics.js",library_version:"web"===r?"next-".concat(Ut):"npm:next-".concat(Ut)})}},Qt=function(){function t(t){var e,n,r,i,o,a=this;if(this.host=null!==(e=null==t?void 0:t.host)&&void 0!==e?e:Wt,this.sampleRate=null!==(n=null==t?void 0:t.sampleRate)&&void 0!==n?n:1,this.flushTimer=null!==(r=null==t?void 0:t.flushTimer)&&void 0!==r?r:3e4,this.maxQueueSize=null!==(i=null==t?void 0:t.maxQueueSize)&&void 0!==i?i:20,this.protocol=null!==(o=null==t?void 0:t.protocol)&&void 0!==o?o:"https",this.queue=[],this.sampleRate>0){var s=!1,u=function(){s||(s=!0,a.flush().catch(Xt),s=!1,setTimeout(u,a.flushTimer))};u()}}return t.prototype.increment=function(t,e){if(t.includes("analytics_js.")&&0!==e.length&&!(Math.random()>this.sampleRate||this.queue.length>=this.maxQueueSize)){var n=Yt(t,e,Gt());this.queue.push(n),t.includes("error")&&this.flush().catch(Xt)}},t.prototype.flush=function(){return y(this,void 0,void 0,function(){var t=this;return m(this,function(e){switch(e.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(e){Xt(e),t.sampleRate=0})];case 1:return e.sent(),[2]}})})},t.prototype.send=function(){return y(this,void 0,void 0,function(){var t,e,n;return m(this,function(r){return t={series:this.queue},this.queue=[],e={"Content-Type":"text/plain"},n="".concat(this.protocol,"://").concat(this.host,"/m"),[2,zt(n,{headers:e,body:JSON.stringify(t),method:"POST"})]})})},t}()}}),se=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/stats/index.js"(){b(),Mt(),ae(),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.initRemoteMetrics=function(t){te=new Qt(t)},e.prototype.increment=function(e,n,r){t.prototype.increment.call(this,e,n,r),null==te||te.increment(e,null!=r?r:[])},e}(ut)}}),ue=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/context/index.js"(){b(),Mt(),se(),ne=function(t){function e(e,n){return t.call(this,e,n,new ee)||this}return h(e,t),e.system=function(){return new this({type:"track",event:"system"})},e}(dt)}}),ce=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/priority-queue/index.js"(){Mt()}});function le(t){var e=re.getItem(t);return(e?JSON.parse(e):[]).map(function(t){return new ne(t.event,t.id)})}function de(t){var e=re.getItem(t);return e?JSON.parse(e):{}}function fe(t){re.removeItem(t)}function pe(t,e,n){void 0===n&&(n=0);var r,i="persisted-queue:v1:".concat(t,":lock"),o=re.getItem(i),a=o?JSON.parse(o):null,s=null===a||(r=a,(new Date).getTime()>r);if(s)return re.setItem(i,JSON.stringify(ie()+50)),e(),void re.removeItem(i);!s&&n<3?setTimeout(function(){pe(t,e,n+1)},50):console.error("Unable to retrieve lock")}var he,ve=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/priority-queue/persisted.js"(){b(),ce(),ue(),Ct(),re={getItem:function(){},setItem:function(){},removeItem:function(){}};try{re=Nt()&&window.localStorage?window.localStorage:re}catch(t){console.warn("Unable to access localStorage",t)}ie=function(){return(new Date).getTime()},oe=function(t){function n(n,r){var i=t.call(this,n,[])||this,o="persisted-queue:v1:".concat(r,":items"),a="persisted-queue:v1:".concat(r,":seen"),s=[],u={};return pe(r,function(){try{s=le(o),u=de(a),fe(o),fe(a),i.queue=g(g([],s,!0),i.queue,!0),i.seen=e(e({},u),i.seen)}catch(t){console.error(t)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var t=g(g([],i.queue,!0),i.future,!0);try{pe(r,function(){!function(t,n){var r=le(t),i=g(g([],n,!0),r,!0).reduce(function(t,n){var r;return e(e({},t),((r={})[n.id]=n,r))},{});re.setItem(t,JSON.stringify(Object.values(i)))}(o,t),function(t,n){var r=de(t);re.setItem(t,JSON.stringify(e(e({},r),n)))}(a,i.seen)})}catch(t){console.error(t)}}}),i}return h(n,t),n}(X)}});function ye(){return window[he]}var me,ge=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/global-analytics-helper.js"(){he="analytics"}}),be=l({"../../../../node_modules/obj-case/index.js"(t,e){function n(t){return function(e,n,r,i){var a,s=i&&function(t){return"function"==typeof t}(i.normalizer)?i.normalizer:o;n=s(n);for(var u=!1;!u;)c();function c(){for(a in e){var t=s(a);if(0===n.indexOf(t)){var r=n.substr(t.length);if("."===r.charAt(0)||0===r.length){n=r.substr(1);var i=e[a];return null==i?void(u=!0):n.length?void(e=i):void(u=!0)}}}a=void 0,u=!0}if(a)return null==e?e:t(e,a,r)}}function r(t,e){return t.hasOwnProperty(e)&&delete t[e],t}function i(t,e,n){return t.hasOwnProperty(e)&&(t[e]=n),t}function o(t){return t.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}e.exports=n(function(t,e){if(t.hasOwnProperty(e))return t[e]}),e.exports.find=e.exports,e.exports.replace=function(t,e,r,o){return n(i).call(this,t,e,r,o),t},e.exports.del=function(t,e,i){return n(r).call(this,t,e,null,i),t}}}),we=l({"../../../../node_modules/@segment/facade/dist/address.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var n=e(be());function r(t,e){return function(){var r=this.traits(),i=this.properties?this.properties():{};return n.default(r,"address."+t)||n.default(r,t)||(e?n.default(r,"address."+e):null)||(e?n.default(r,e):null)||n.default(i,"address."+t)||n.default(i,t)||(e?n.default(i,"address."+e):null)||(e?n.default(i,e):null)}}t.default=function(t){t.zip=r("postalCode","zip"),t.country=r("country"),t.street=r("street"),t.state=r("state"),t.city=r("city"),t.region=r("region")}}}),_e=l({"../../../../node_modules/@segment/facade/dist/clone.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function t(e){if("object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=t(e[r]));return n}return Array.isArray(e)?e.map(t):e}}}),xe=l({"../../../../node_modules/@segment/facade/dist/is-enabled.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e={Salesforce:!0};t.default=function(t){return!e[t]}}}),ke=l({"../../../../node_modules/@segment/isodate/lib/index.js"(t){var e=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;t.parse=function(t){var n=[1,5,6,7,11,12],r=e.exec(t),i=0;if(!r)return new Date(t);for(var o,a=0;o=n[a];a++)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]?i=(new Date).getTimezoneOffset():"Z"!==r[9]&&r[10]&&(i=60*r[11]+r[12],"+"===r[10]&&(i=0-i));var s=Date.UTC(r[1],r[2],r[3],r[5],r[6]+i,r[7],r[8]);return new Date(s)},t.is=function(t,n){return"string"==typeof t&&((!n||!1!==/^\d{4}-\d{2}-\d{2}/.test(t))&&e.test(t))}}}),je=l({"../../../../node_modules/new-date/lib/milliseconds.js"(t){var e=/\d{13}/;t.is=function(t){return e.test(t)},t.parse=function(t){return t=parseInt(t,10),new Date(t)}}}),Se=l({"../../../../node_modules/new-date/lib/seconds.js"(t){var e=/\d{10}/;t.is=function(t){return e.test(t)},t.parse=function(t){var e=1e3*parseInt(t,10);return new Date(e)}}}),Pe=l({"../../../../node_modules/new-date/lib/index.js"(t,e){var n=ke(),r=je(),i=Se(),o=Object.prototype.toString;e.exports=function(t){return e=t,"[object Date]"===o.call(e)?t:function(t){return"[object Number]"===o.call(t)}(t)?new Date((a=t)<315576e5?1e3*a:a):n.is(t)?n.parse(t):r.is(t)?r.parse(t):i.is(t)?i.parse(t):new Date(t);var e,a}}}),Oe=l({"../../../../node_modules/@segment/isodate-traverse/lib/index.js"(t,e){var n=ke();function r(t,e){return void 0===e&&(e=!0),t&&"object"==typeof t?function(t,e){return Object.keys(t).forEach(function(n){t[n]=r(t[n],e)}),t}(t,e):Array.isArray(t)?function(t,e){return t.forEach(function(n,i){t[i]=r(n,e)}),t}(t,e):n.is(t,e)?n.parse(t):t}e.exports=r}}),Ie=l({"../../../../node_modules/@segment/facade/dist/facade.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Facade=void 0;var n=e(we()),r=_e(),i=e(xe()),o=e(Pe()),a=e(be()),s=e(Oe());function u(t,e){e=e||{},this.raw=r.clone(t),"clone"in e||(e.clone=!0),e.clone&&(t=r.clone(t)),"traverse"in e||(e.traverse=!0),t.timestamp="timestamp"in t?o.default(t.timestamp):new Date,e.traverse&&s.default(t),this.opts=e,this.obj=t}t.Facade=u;var c=u.prototype;function l(t){return r.clone(t)}c.proxy=function(t){var e=t.split("."),n=this[t=e.shift()]||this.obj[t];return n?("function"==typeof n&&(n=n.call(this)||{}),0===e.length||(n=a.default(n,e.join("."))),this.opts.clone?l(n):n):n},c.field=function(t){var e=this.obj[t];return this.opts.clone?l(e):e},u.proxy=function(t){return function(){return this.proxy(t)}},u.field=function(t){return function(){return this.field(t)}},u.multi=function(t){return function(){var e=this.proxy(t+"s");if(Array.isArray(e))return e;var n=this.proxy(t);return n&&(n=[this.opts.clone?r.clone(n):n]),n||[]}},u.one=function(t){return function(){var e=this.proxy(t);if(e)return e;var n=this.proxy(t+"s");return Array.isArray(n)?n[0]:void 0}},c.json=function(){var t=this.opts.clone?r.clone(this.obj):this.obj;return this.type&&(t.type=this.type()),t},c.rawEvent=function(){return this.raw},c.options=function(t){var e=this.obj.options||this.obj.context||{},n=this.opts.clone?r.clone(e):e;if(!t)return n;if(this.enabled(t)){var i=this.integrations(),o=i[t]||a.default(i,t);return"object"!=typeof o&&(o=a.default(this.options(),t)),"object"==typeof o?o:{}}},c.context=c.options,c.enabled=function(t){var e=this.proxy("options.providers.all");"boolean"!=typeof e&&(e=this.proxy("options.all")),"boolean"!=typeof e&&(e=this.proxy("integrations.all")),"boolean"!=typeof e&&(e=!0);var n=e&&i.default(t),r=this.integrations();if(r.providers&&r.providers.hasOwnProperty(t)&&(n=r.providers[t]),r.hasOwnProperty(t)){var o=r[t];n="boolean"!=typeof o||o}return!!n},c.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()},c.active=function(){var t=this.proxy("options.active");return null==t&&(t=!0),t},c.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")},c.sessionId=c.anonymousId,c.groupId=u.proxy("options.groupId"),c.traits=function(t){var e=this.proxy("options.traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=null==this[r]?this.proxy("options.traits."+r):this[r]();if(null==i)continue;e[t[r]]=i,delete e[r]}return e},c.library=function(){var t=this.proxy("options.library");return t?"string"==typeof t?{name:t,version:null}:t:{name:"unknown",version:null}},c.device=function(){var t=this.proxy("context.device");"object"==typeof t&&null!==t||(t={});var e=this.library().name;return t.type||(e.indexOf("ios")>-1&&(t.type="ios"),e.indexOf("android")>-1&&(t.type="android")),t},c.userAgent=u.proxy("context.userAgent"),c.timezone=u.proxy("context.timezone"),c.timestamp=u.field("timestamp"),c.channel=u.field("channel"),c.ip=u.proxy("context.ip"),c.userId=u.field("userId"),n.default(c)}}),Ae=l({"../../../../node_modules/inherits/inherits_browser.js"(t,e){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}}}),Ee=l({"../../../../node_modules/inherits/inherits.js"(t,e){try{if("function"!=typeof(n=u("util")).inherits)throw"";e.exports=n.inherits}catch(t){e.exports=Ae()}var n}}),Me=l({"../../../../node_modules/@segment/facade/dist/alias.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Alias=void 0;var n=e(Ee()),r=Ie();function i(t,e){r.Facade.call(this,t,e)}t.Alias=i,n.default(i,r.Facade),i.prototype.action=function(){return"alias"},i.prototype.type=i.prototype.action,i.prototype.previousId=function(){return this.field("previousId")||this.field("from")},i.prototype.from=i.prototype.previousId,i.prototype.userId=function(){return this.field("userId")||this.field("to")},i.prototype.to=i.prototype.userId}}),Ne=l({"../../../../node_modules/@segment/facade/dist/is-email.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=/.+\@.+\..+/;t.default=function(t){return e.test(t)}}}),Fe=l({"../../../../node_modules/@segment/facade/dist/group.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Group=void 0;var n=e(Ee()),r=e(Ne()),i=e(Pe()),o=Ie();function a(t,e){o.Facade.call(this,t,e)}t.Group=a,n.default(a,o.Facade);var s=a.prototype;s.action=function(){return"group"},s.type=s.action,s.groupId=o.Facade.field("groupId"),s.created=function(){var t=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(t)return i.default(t)},s.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.groupId();return r.default(e)?e:void 0},s.traits=function(t){var e=this.properties(),n=this.groupId();for(var r in t=t||{},n&&(e.id=n),t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=null==this[r]?this.proxy("traits."+r):this[r]();if(null==i)continue;e[t[r]]=i,delete e[r]}return e},s.name=o.Facade.proxy("traits.name"),s.industry=o.Facade.proxy("traits.industry"),s.employees=o.Facade.proxy("traits.employees"),s.properties=function(){return this.field("traits")||this.field("properties")||{}}}}),Ce=l({"../../../../node_modules/@segment/facade/dist/identify.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Identify=void 0;var n=Ie(),r=e(be()),i=e(Ee()),o=e(Ne()),a=e(Pe()),s=function(t){return t.trim()};function u(t,e){n.Facade.call(this,t,e)}t.Identify=u,i.default(u,n.Facade);var c=u.prototype;c.action=function(){return"identify"},c.type=c.action,c.traits=function(t){var e=this.field("traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("traits."+r):this[r]();null!=i&&(e[t[r]]=i,r!==t[r]&&delete e[r])}return e},c.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.userId();return o.default(e)?e:void 0},c.created=function(){var t=this.proxy("traits.created")||this.proxy("traits.createdAt");if(t)return a.default(t)},c.companyCreated=function(){var t=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(t)return a.default(t)},c.companyName=function(){return this.proxy("traits.company.name")},c.name=function(){var t=this.proxy("traits.name");if("string"==typeof t)return s(t);var e=this.firstName(),n=this.lastName();return e&&n?s(e+" "+n):void 0},c.firstName=function(){var t=this.proxy("traits.firstName");if("string"==typeof t)return s(t);var e=this.proxy("traits.name");return"string"==typeof e?s(e).split(" ")[0]:void 0},c.lastName=function(){var t=this.proxy("traits.lastName");if("string"==typeof t)return s(t);var e=this.proxy("traits.name");if("string"==typeof e){var n=s(e).indexOf(" ");if(-1!==n)return s(e.substr(n+1))}},c.uid=function(){return this.userId()||this.username()||this.email()},c.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")},c.age=function(){var t=this.birthday(),e=r.default(this.traits(),"age");return null!=e?e:t instanceof Date?(new Date).getFullYear()-t.getFullYear():void 0},c.avatar=function(){var t=this.traits();return r.default(t,"avatar")||r.default(t,"photoUrl")||r.default(t,"avatarUrl")},c.position=function(){var t=this.traits();return r.default(t,"position")||r.default(t,"jobTitle")},c.username=n.Facade.proxy("traits.username"),c.website=n.Facade.one("traits.website"),c.websites=n.Facade.multi("traits.website"),c.phone=n.Facade.one("traits.phone"),c.phones=n.Facade.multi("traits.phone"),c.address=n.Facade.proxy("traits.address"),c.gender=n.Facade.proxy("traits.gender"),c.birthday=n.Facade.proxy("traits.birthday")}}),Te=l({"../../../../node_modules/@segment/facade/dist/track.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Track=void 0;var n=e(Ee()),r=Ie(),i=Ce(),o=e(Ne()),a=e(be());function s(t,e){r.Facade.call(this,t,e)}t.Track=s,n.default(s,r.Facade);var u=s.prototype;u.action=function(){return"track"},u.type=u.action,u.event=r.Facade.field("event"),u.value=r.Facade.proxy("properties.value"),u.category=r.Facade.proxy("properties.category"),u.id=r.Facade.proxy("properties.id"),u.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")},u.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")},u.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")},u.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")},u.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")},u.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")},u.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")},u.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")},u.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")},u.sku=r.Facade.proxy("properties.sku"),u.tax=r.Facade.proxy("properties.tax"),u.name=r.Facade.proxy("properties.name"),u.price=r.Facade.proxy("properties.price"),u.total=r.Facade.proxy("properties.total"),u.repeat=r.Facade.proxy("properties.repeat"),u.coupon=r.Facade.proxy("properties.coupon"),u.shipping=r.Facade.proxy("properties.shipping"),u.discount=r.Facade.proxy("properties.discount"),u.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")},u.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")},u.description=r.Facade.proxy("properties.description"),u.plan=r.Facade.proxy("properties.plan"),u.subtotal=function(){var t=a.default(this.properties(),"subtotal"),e=this.total()||this.revenue();if(t)return t;if(!e)return 0;if(this.total()){var n=this.tax();n&&(e-=n),(n=this.shipping())&&(e-=n),(n=this.discount())&&(e+=n)}return e},u.products=function(){var t=this.properties(),e=a.default(t,"products");return Array.isArray(e)?e.filter(function(t){return null!==t}):[]},u.quantity=function(){return(this.obj.properties||{}).quantity||1},u.currency=function(){return(this.obj.properties||{}).currency||"USD"},u.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},u.query=r.Facade.proxy("options.query"),u.properties=function(t){var e=this.field("properties")||{};for(var n in t=t||{})if(Object.prototype.hasOwnProperty.call(t,n)){var r=null==this[n]?this.proxy("properties."+n):this[n]();if(null==r)continue;e[t[n]]=r,delete e[n]}return e},u.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()},u.email=function(){var t=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(t)return t;var e=this.userId();return o.default(e)?e:void 0},u.revenue=function(){var t=this.proxy("properties.revenue"),e=this.event();return!t&&e&&e.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(t=this.proxy("properties.total")),function(t){if(!t)return;if("number"==typeof t)return t;if("string"!=typeof t)return;if(t=t.replace(/\$/g,""),t=parseFloat(t),!isNaN(t))return t}(t)},u.cents=function(){var t=this.revenue();return"number"!=typeof t?this.value()||0:100*t},u.identify=function(){var t=this.json();return t.traits=this.traits(),new i.Identify(t,this.opts)}}}),De=l({"../../../../node_modules/@segment/facade/dist/page.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;var n=e(Ee()),r=Ie(),i=Te(),o=e(Ne());function a(t,e){r.Facade.call(this,t,e)}t.Page=a,n.default(a,r.Facade);var s=a.prototype;s.action=function(){return"page"},s.type=s.action,s.category=r.Facade.field("category"),s.name=r.Facade.field("name"),s.title=r.Facade.proxy("properties.title"),s.path=r.Facade.proxy("properties.path"),s.url=r.Facade.proxy("properties.url"),s.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},s.properties=function(t){var e=this.field("properties")||{},n=this.category(),r=this.name();for(var i in t=t||{},n&&(e.category=n),r&&(e.name=r),t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=null==this[i]?this.proxy("properties."+i):this[i]();if(null==o)continue;e[t[i]]=o,i!==t[i]&&delete e[i]}return e},s.email=function(){var t=this.proxy("context.traits.email")||this.proxy("properties.email");if(t)return t;var e=this.userId();return o.default(e)?e:void 0},s.fullName=function(){var t=this.category(),e=this.name();return e&&t?t+" "+e:e},s.event=function(t){return t?"Viewed "+t+" Page":"Loaded a Page"},s.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new i.Track(e,this.opts)}}}),Re=l({"../../../../node_modules/@segment/facade/dist/screen.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Screen=void 0;var n=e(Ee()),r=De(),i=Te();function o(t,e){r.Page.call(this,t,e)}t.Screen=o,n.default(o,r.Page),o.prototype.action=function(){return"screen"},o.prototype.type=o.prototype.action,o.prototype.event=function(t){return t?"Viewed "+t+" Screen":"Loaded a Screen"},o.prototype.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new i.Track(e,this.opts)}}}),Le=l({"../../../../node_modules/@segment/facade/dist/delete.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Delete=void 0;var n=e(Ee()),r=Ie();function i(t,e){r.Facade.call(this,t,e)}t.Delete=i,n.default(i,r.Facade),i.prototype.type=function(){return"delete"}}}),qe=l({"../../../../node_modules/@segment/facade/dist/index.js"(t){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Delete=t.Screen=t.Page=t.Track=t.Identify=t.Group=t.Alias=t.Facade=void 0;var n=Ie();Object.defineProperty(t,"Facade",{enumerable:!0,get:function(){return n.Facade}});var r=Me();Object.defineProperty(t,"Alias",{enumerable:!0,get:function(){return r.Alias}});var i=Fe();Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Ce();Object.defineProperty(t,"Identify",{enumerable:!0,get:function(){return o.Identify}});var a=Te();Object.defineProperty(t,"Track",{enumerable:!0,get:function(){return a.Track}});var s=De();Object.defineProperty(t,"Page",{enumerable:!0,get:function(){return s.Page}});var u=Re();Object.defineProperty(t,"Screen",{enumerable:!0,get:function(){return u.Screen}});var c=Le();Object.defineProperty(t,"Delete",{enumerable:!0,get:function(){return c.Delete}}),t.default=e(e({},n.Facade),{Alias:r.Alias,Group:i.Group,Identify:o.Identify,Track:a.Track,Page:s.Page,Screen:u.Screen,Delete:c.Delete})}});function ze(t,e){var n=new me.Facade(t,e);return"track"===t.type&&(n=new me.Track(t,e)),"identify"===t.type&&(n=new me.Identify(t,e)),"page"===t.type&&(n=new me.Page(t,e)),"alias"===t.type&&(n=new me.Alias(t,e)),"group"===t.type&&(n=new me.Group(t,e)),"screen"===t.type&&(n=new me.Screen(t,e)),Object.defineProperty(n,"obj",{value:t,writable:!0}),n}var Ue,Be=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/to-facade.js"(){me=p(qe())}}),Ve=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/p-while.js"(){b(),Ue=function(t,e){return y(void 0,void 0,void 0,function(){var n;return m(this,function(r){return[2,(n=function(r){return y(void 0,void 0,void 0,function(){var i;return m(this,function(o){switch(o.label){case 0:return t(r)?(i=n,[4,e()]):[3,2];case 1:return[2,i.apply(void 0,[o.sent()])];case 2:return[2]}})})})(void 0)]})})}}}),Ke=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/callback/index.js"(){Mt()}}),He={};function Je(t,e,n,r){var i=this;return t?((t instanceof Element?[t]:"toArray"in t?t.toArray():t).forEach(function(t){t.addEventListener("click",function(o){var a,s,u=e instanceof Function?e(t):e,c=n instanceof Function?n(t):n,l=t.getAttribute("href")||t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("xlink:href")||(null===(a=t.getElementsByTagName("a")[0])||void 0===a?void 0:a.getAttribute("href")),d=B(i.track(u,c,null!=r?r:{}),null!==(s=i.settings.timeout)&&void 0!==s?s:500);(function(t,e){return!("_blank"!==t.target||!e)})(t,l)||function(t){var e=t;return!!(e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1==e.button)}(o)||l&&(o.preventDefault?o.preventDefault():o.returnValue=!1,d.catch(console.error).then(function(){window.location.href=l}).catch(console.error))},!1)}),this):this}function Ge(t,e,n,r){var i=this;return t?(t instanceof HTMLFormElement&&(t=[t]),t.forEach(function(t){if(!(t instanceof Element))throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");var o=function(o){var a;o.preventDefault?o.preventDefault():o.returnValue=!1;var s=e instanceof Function?e(t):e,u=n instanceof Function?n(t):n;B(i.track(s,u,null!=r?r:{}),null!==(a=i.settings.timeout)&&void 0!==a?a:500).catch(console.error).then(function(){t.submit()}).catch(console.error)},a=window.jQuery||window.Zepto;a?a(t).submit(o):t.addEventListener("submit",o,!1)}),this):this}d(He,{form:()=>Ge,link:()=>Je});var We=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/auto-track.js"(){Ke()}}),Ye={};function Qe(t,n,r){return y(this,void 0,void 0,function(){function i(n,r){return y(this,void 0,void 0,function(){var i,o,a;return m(this,function(s){switch(s.label){case 0:return i=!1,o=null,[4,r({payload:ze(n,{clone:!0,traverse:!1}),integration:t,next:function(t){i=!0,null===t&&(o=null),t&&(o=t.obj)}})];case 1:return s.sent(),i||null===o||(o.integrations=e(e({},n.integrations),((a={})[t]=!1,a))),[2,o]}})})}var o,a,s,u,c;return m(this,function(t){switch(t.label){case 0:o=ze(n,{clone:!0,traverse:!1}).rawEvent(),a=0,s=r,t.label=1;case 1:return a<s.length?(u=s[a],[4,i(o,u)]):[3,4];case 2:if(null===(c=t.sent()))return[2,null];o=c,t.label=3;case 3:return a++,[3,1];case 4:return[2,o]}})})}function Ze(t,e){function n(n){return y(this,void 0,void 0,function(){var r;return m(this,function(i){switch(i.label){case 0:return r=!1,[4,t({payload:ze(n.event,{clone:!0,traverse:!1}),integrations:null!=e?e:{},next:function(t){r=!0,t&&(n.event=t.obj)}})];case 1:if(i.sent(),!r)throw new lt({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(t){return Promise.resolve(t)},track:n,page:n,screen:n,identify:n,alias:n,group:n}}d(Ye,{applyDestinationMiddleware:()=>Qe,sourceMiddlewarePlugin:()=>Ze});var $e=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/middleware/index.js"(){b(),ue(),Be()}});function Xe(t,e){return Object.keys(e).reduce(function(n,r){r.startsWith(t)&&(n[r.substr(t.length)]=e[r]);return n},{})}var tn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/query-string/pickPrefix.js"(){}});function en(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}}var nn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/query-string/gracefulDecodeURIComponent.js"(){}}),rn={};function on(t,e){var n=document.createElement("a");n.href=e;var r=n.search.slice(1).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1];return t[r]=en(i),t},{}),i=[],o=r.ajs_uid,a=r.ajs_event,s=r.ajs_aid,u=N(t.options.useQueryString)?t.options.useQueryString:{},c=u.aid,l=void 0===c?/.+/:c,d=u.uid,f=void 0===d?/.+/:d;if(s){var p=Array.isArray(r.ajs_aid)?r.ajs_aid[0]:r.ajs_aid;l.test(p)&&t.setAnonymousId(p)}if(o){var h=Array.isArray(r.ajs_uid)?r.ajs_uid[0]:r.ajs_uid;if(f.test(h)){var v=Xe("ajs_trait_",r);i.push(t.identify(h,v))}}if(a){var y=Array.isArray(r.ajs_event)?r.ajs_event[0]:r.ajs_event,m=Xe("ajs_prop_",r);i.push(t.track(y,m))}return Promise.all(i)}d(rn,{queryString:()=>on});var an,sn,un,cn,ln,dn,fn,pn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/query-string/index.js"(){tn(),nn(),Mt()}}),hn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/parse-cdn.js"(){ge(),an=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,sn=function(){var t;return Array.prototype.slice.call(document.querySelectorAll("script")).forEach(function(e){var n,r=null!==(n=e.getAttribute("src"))&&void 0!==n?n:"",i=an.exec(r);i&&i[1]&&(t=i[1])}),t},cn=function(){var t;return null!=un?un:null===(t=ye())||void 0===t?void 0:t._cdn},ln=function(t){var e=ye();e&&(e._cdn=t),un=t},dn=function(){var t=cn();if(t)return t;var e=sn();return e||"https://cdn.segment.com"},fn=function(){var t=dn();return"".concat(t,"/next-integrations")}}});function vn(t,n){var r,i=Object.entries(null!==(r=n.integrations)&&void 0!==r?r:{}).reduce(function(t,n){var r,i,o=n[0],a=n[1];return e(e({},t),"object"==typeof a?((r={})[o]=a,r):((i={})[o]={},i))},{});return Object.entries(t.integrations).reduce(function(t,n){var r,o=n[0],a=n[1];return e(e({},t),((r={})[o]=e(e({},a),i[o]),r))},{})}var yn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/merged-options.js"(){b()}});function mn(t){return Array.prototype.slice.call(window.document.querySelectorAll("script")).find(function(e){return e.src===t})}function gn(t,e){var n=mn(t);if(void 0!==n){var r=null==n?void 0:n.getAttribute("status");if("loaded"===r)return Promise.resolve(n);if("loading"===r)return new Promise(function(t,e){n.addEventListener("load",function(){return t(n)}),n.addEventListener("error",function(t){return e(t)})})}return new Promise(function(n,r){var i,o=window.document.createElement("script");o.type="text/javascript",o.src=t,o.async=!0,o.setAttribute("status","loading");for(var a=0,s=Object.entries(null!=e?e:{});a<s.length;a++){var u=s[a],c=u[0],l=u[1];o.setAttribute(c,l)}o.onload=function(){o.onerror=o.onload=null,o.setAttribute("status","loaded"),n(o)},o.onerror=function(){o.onerror=o.onload=null,o.setAttribute("status","error"),r(new Error("Failed to load ".concat(t)))};var d=window.document.querySelector("script");d?null===(i=d.parentElement)||void 0===i||i.insertBefore(o,d):window.document.head.appendChild(o)})}var bn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/load-script.js"(){}});function wn(t,e){var n=e.methodName,r=e.integrationName,i=e.type,o=e.didError,a=void 0!==o&&o;t.stats.increment("analytics_js.integration.invoke".concat(a?".error":""),1,["method:".concat(n),"integration_name:".concat(r),"type:".concat(i)])}var _n,xn,kn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/stats/metric-helpers.js"(){}}),jn=l({"../../../../node_modules/@segment/analytics-next/dist/pkg/vendor/tsub/tsub.js"(t,e){!function(n,r){if("object"==typeof t&&"object"==typeof e)e.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var i=r();for(var o in i)("object"==typeof t?t:n)[o]=i[o]}}(self,function(){return function(){var t={2870:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.matches=e.transform=void 0;var i=n(4303);Object.defineProperty(e,"transform",{enumerable:!0,get:function(){return r(i).default}});var o=n(2370);Object.defineProperty(e,"matches",{enumerable:!0,get:function(){return r(o).default}});var a=n(1444);Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return r(a).default}})},2370:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(7843));function o(t,e){if(!Array.isArray(t))return!0===a(t,e);var n,r,i,l,d,f,p,h=t[0];switch(h){case"!":return!o(t[1],e);case"or":for(var v=1;v<t.length;v++)if(o(t[v],e))return!0;return!1;case"and":for(v=1;v<t.length;v++)if(!o(t[v],e))return!1;return!0;case"=":case"!=":return function(t,e,n,r){switch(s(t)&&(t=o(t,r)),s(e)&&(e=o(e,r)),"object"==typeof t&&"object"==typeof e&&(t=JSON.stringify(t),e=JSON.stringify(e)),n){case"=":return t===e;case"!=":return t!==e;default:throw new Error("Invalid operator in compareItems: ".concat(n))}}(a(t[1],e),a(t[2],e),h,e);case"<=":case"<":case">":case">=":return function(t,e,n,r){if(s(t)&&(t=o(t,r)),s(e)&&(e=o(e,r)),"number"!=typeof t||"number"!=typeof e)return!1;switch(n){case"<=":return t<=e;case">=":return t>=e;case"<":return t<e;case">":return t>e;default:throw new Error("Invalid operator in compareNumbers: ".concat(n))}}(a(t[1],e),a(t[2],e),h,e);case"in":return d=a(t[1],e),f=a(t[2],e),p=e,void 0!==f.find(function(t){return a(t,p)===d});case"contains":return i=a(t[1],e),l=a(t[2],e),"string"==typeof i&&"string"==typeof l&&-1!==i.indexOf(l);case"match":return n=a(t[1],e),r=a(t[2],e),"string"==typeof n&&"string"==typeof r&&function(t,e){var n,r;t:for(;t.length>0;){var i,o;if(i=(n=u(t)).star,o=n.chunk,t=n.pattern,i&&""===o)return!0;var a=c(o,e),s=a.t,l=a.ok,d=a.err;if(d)return!1;if(!l||!(0===s.length||t.length>0)){if(i)for(var f=0;f<e.length;f++){if(s=(r=c(o,e.slice(f+1))).t,l=r.ok,d=r.err,l){if(0===t.length&&s.length>0)continue;e=s;continue t}if(d)return!1}return!1}e=s}return 0===e.length}(r,n);case"lowercase":var y=a(t[1],e);return"string"!=typeof y?null:y.toLowerCase();case"typeof":return typeof a(t[1],e);case"length":return function(t){return null===t?0:Array.isArray(t)||"string"==typeof t?t.length:NaN}(a(t[1],e));default:throw new Error("FQL IR could not evaluate for token: ".concat(h))}}function a(t,e){return Array.isArray(t)?t:"object"==typeof t?t.value:(0,i.default)(e,t)}function s(t){return!!Array.isArray(t)&&(("lowercase"===t[0]||"length"===t[0]||"typeof"===t[0])&&2===t.length||("contains"===t[0]||"match"===t[0])&&3===t.length)}function u(t){for(var e={star:!1,chunk:"",pattern:""};t.length>0&&"*"===t[0];)t=t.slice(1),e.star=!0;var n,r=!1;t:for(n=0;n<t.length;n++)switch(t[n]){case"\\":n+1<t.length&&n++;break;case"[":r=!0;break;case"]":r=!1;break;case"*":if(!r)break t}return e.chunk=t.slice(0,n),e.pattern=t.slice(n),e}function c(t,e){for(var n,r,i={t:"",ok:!1,err:!1};t.length>0;){if(0===e.length)return i;switch(t[0]){case"[":var o=e[0];e=e.slice(1);var a=!0;(t=t.slice(1)).length>0&&"^"===t[0]&&(a=!1,t=t.slice(1));for(var s=!1,u=0;;){if(t.length>0&&"]"===t[0]&&u>0){t=t.slice(1);break}var c,d="";if(c=(n=l(t)).char,t=n.newChunk,n.err)return i;if(d=c,"-"===t[0]&&(d=(r=l(t.slice(1))).char,t=r.newChunk,r.err))return i;c<=o&&o<=d&&(s=!0),u++}if(s!==a)return i;break;case"?":e=e.slice(1),t=t.slice(1);break;case"\\":if(0===(t=t.slice(1)).length)return i.err=!0,i;default:if(t[0]!==e[0])return i;e=e.slice(1),t=t.slice(1)}}return i.t=e,i.ok=!0,i.err=!1,i}function l(t){var e={char:"",newChunk:"",err:!1};return 0===t.length||"-"===t[0]||"]"===t[0]||"\\"===t[0]&&0===(t=t.slice(1)).length?(e.err=!0,e):(e.char=t[0],e.newChunk=t.slice(1),0===e.newChunk.length&&(e.err=!0),e)}e.default=function(t,e){if(!e)throw new Error("No matcher supplied!");switch(e.type){case"all":return!0;case"fql":return function(t,e){if(!t)return!1;try{t=JSON.parse(t)}catch(e){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(t,'": ').concat(e))}var n=o(t,e);return"boolean"==typeof n&&n}(e.ir,t);default:throw new Error("Matcher of type ".concat(e.type," unsupported."))}}},1444:function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.rules=[],this.rules=t||[]}return t.prototype.getRulesByDestinationName=function(t){for(var e=[],n=0,r=this.rules;n<r.length;n++){var i=r[n];i.destinationName!==t&&void 0!==i.destinationName||e.push(i)}return e},t}();e.default=n},4303:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(374)),o=r(n(7843)),a=r(n(5500)),s=n(9014),u=n(4966);function c(t,e){d(t,e.drop,function(t,e){e.forEach(function(e){return delete t[e]})})}function l(t,e){d(t,e.allow,function(t,e){Object.keys(t).forEach(function(n){e.includes(n)||delete t[n]})})}function d(t,e,n){Object.entries(e).forEach(function(e){var r=e[0],i=e[1],a=function(t){"object"==typeof t&&null!==t&&n(t,i)},s=""===r?t:(0,o.default)(t,r);Array.isArray(s)?s.forEach(a):a(s)})}function f(t,e){var n=JSON.parse(JSON.stringify(t));for(var r in e.map)if(e.map.hasOwnProperty(r)){var i=e.map[r],a=r.split("."),c=void 0;if(a.length>1?(a.pop(),c=(0,o.default)(n,a.join("."))):c=t,"object"==typeof c){if(i.copy){var l=(0,o.default)(n,i.copy);void 0!==l&&(0,s.dset)(t,r,l)}else if(i.move){var d=(0,o.default)(n,i.move);void 0!==d&&(0,s.dset)(t,r,d),(0,u.unset)(t,i.move)}else i.hasOwnProperty("set")&&(0,s.dset)(t,r,i.set);if(i.to_string){var f=(0,o.default)(t,r);if("string"==typeof f||"object"==typeof f&&null!==f)continue;void 0!==f?(0,s.dset)(t,r,JSON.stringify(f)):(0,s.dset)(t,r,"undefined")}}}}function p(t,e){return!(e.sample.percent<=0)&&(e.sample.percent>=1||(e.sample.path?function(t,e){var n=(0,o.default)(t,e.sample.path),r=(0,i.default)(JSON.stringify(n)),s=-64,u=[];h(r.slice(0,8),u);for(var c=0,l=0;l<64&&1!==u[l];l++)c++;if(0!==c){var d=[];h(r.slice(9,16),d),s-=c,u.splice(0,c),d.splice(64-c),u=u.concat(d)}return u[63]=0===u[63]?1:0,(0,a.default)(parseInt(u.join(""),2),s)<e.sample.percent}(t,e):(n=e.sample.percent,Math.random()<=n)));var n}function h(t,e){for(var n=0;n<8;n++)for(var r=t[n],i=128;i>=1;i/=2)r-i>=0?(r-=i,e.push(1)):e.push(0)}e.default=function(t,e){for(var n=t,r=0,i=e;r<i.length;r++){var o=i[r];switch(o.type){case"drop":return null;case"drop_properties":c(n,o.config);break;case"allow_properties":l(n,o.config);break;case"sample_event":if(p(n,o.config))break;return null;case"map_properties":f(n,o.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(o.type,'" is unsupported.'))}}return n}},4966:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.unset=void 0;var i=r(n(7843));e.unset=function(t,e){if((0,i.default)(t,e)){for(var n=e.split("."),r=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)r=n.pop().slice(0,-1)+"."+r;for(;n.length;)t=t[e=n.shift()];return delete t[r]}return!0}},9014:function(t,e){e.dset=function(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,a=e.length,s=t;o<a&&"__proto__"!==(i=e[o++])&&"constructor"!==i&&"prototype"!==i;)s=s[i]=o===a?n:typeof(r=s[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}},3304:function(t){var e="function"==typeof Float64Array?Float64Array:void 0;t.exports=e},7382:function(t,e,n){var r,i=n(5569),o=n(3304),a=n(8482);r=i()?o:a,t.exports=r},8482:function(t){t.exports=function(){throw new Error("not implemented")}},6322:function(t,e,n){var r,i=n(2508),o=n(5679),a=n(882);r=i()?o:a,t.exports=r},882:function(t){t.exports=function(){throw new Error("not implemented")}},5679:function(t){var e="function"==typeof Uint16Array?Uint16Array:void 0;t.exports=e},4773:function(t,e,n){var r,i=n(9773),o=n(3004),a=n(3078);r=i()?o:a,t.exports=r},3078:function(t){t.exports=function(){throw new Error("not implemented")}},3004:function(t){var e="function"==typeof Uint32Array?Uint32Array:void 0;t.exports=e},7980:function(t,e,n){var r,i=n(8114),o=n(6737),a=n(3357);r=i()?o:a,t.exports=r},3357:function(t){t.exports=function(){throw new Error("not implemented")}},6737:function(t){var e="function"==typeof Uint8Array?Uint8Array:void 0;t.exports=e},2684:function(t){var e="function"==typeof Float64Array?Float64Array:null;t.exports=e},5569:function(t,e,n){var r=n(3876);t.exports=r},3876:function(t,e,n){var r=n(1448),i=n(2684);t.exports=function(){var t,e;if("function"!=typeof i)return!1;try{e=new i([1,3.14,-3.14,NaN]),t=r(e)&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}},9048:function(t,e,n){var r=n(3763);t.exports=r},3763:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t,n){return null!=t&&e.call(t,n)}},7009:function(t,e,n){var r=n(6784);t.exports=r},6784:function(t){t.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}},3123:function(t,e,n){var r=n(8481);t.exports=r},8481:function(t,e,n){var r=n(7009)();t.exports=function(){return r&&"symbol"==typeof Symbol.toStringTag}},2508:function(t,e,n){var r=n(3403);t.exports=r},3403:function(t,e,n){var r=n(768),i=n(9668),o=n(187);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},187:function(t){var e="function"==typeof Uint16Array?Uint16Array:null;t.exports=e},9773:function(t,e,n){var r=n(2822);t.exports=r},2822:function(t,e,n){var r=n(2744),i=n(3899),o=n(746);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},746:function(t){var e="function"==typeof Uint32Array?Uint32Array:null;t.exports=e},8114:function(t,e,n){var r=n(8066);t.exports=r},8066:function(t,e,n){var r=n(8279),i=n(3443),o=n(2731);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},2731:function(t){var e="function"==typeof Uint8Array?Uint8Array:null;t.exports=e},1448:function(t,e,n){var r=n(1453);t.exports=r},1453:function(t,e,n){var r=n(6208),i="function"==typeof Float64Array;t.exports=function(t){return i&&t instanceof Float64Array||"[object Float64Array]"===r(t)}},9331:function(t,e,n){var r=n(7980),i={uint16:n(6322),uint8:r};t.exports=i},5902:function(t,e,n){var r=n(4106);t.exports=r},4106:function(t,e,n){var r,i,o=n(9331);(i=new o.uint16(1))[0]=4660,r=52===new o.uint8(i.buffer)[0],t.exports=r},768:function(t,e,n){var r=n(3823);t.exports=r},3823:function(t,e,n){var r=n(6208),i="function"==typeof Uint16Array;t.exports=function(t){return i&&t instanceof Uint16Array||"[object Uint16Array]"===r(t)}},2744:function(t,e,n){var r=n(2326);t.exports=r},2326:function(t,e,n){var r=n(6208),i="function"==typeof Uint32Array;t.exports=function(t){return i&&t instanceof Uint32Array||"[object Uint32Array]"===r(t)}},8279:function(t,e,n){var r=n(208);t.exports=r},208:function(t,e,n){var r=n(6208),i="function"==typeof Uint8Array;t.exports=function(t){return i&&t instanceof Uint8Array||"[object Uint8Array]"===r(t)}},6315:function(t){t.exports=1023},1686:function(t){t.exports=2147483647},3105:function(t){t.exports=2146435072},3449:function(t){t.exports=2147483648},6988:function(t){t.exports=-1023},9777:function(t){t.exports=1023},3690:function(t){t.exports=-1074},2918:function(t,e,n){var r=n(4772).NEGATIVE_INFINITY;t.exports=r},4165:function(t){var e=Number.POSITIVE_INFINITY;t.exports=e},6488:function(t){t.exports=22250738585072014e-324},9668:function(t){t.exports=65535},3899:function(t){t.exports=4294967295},3443:function(t){t.exports=255},7011:function(t,e,n){var r=n(812);t.exports=r},812:function(t,e,n){var r=n(4165),i=n(2918);t.exports=function(t){return t===r||t===i}},1883:function(t,e,n){var r=n(1797);t.exports=r},1797:function(t){t.exports=function(t){return t!=t}},513:function(t,e,n){var r=n(5760);t.exports=r},5760:function(t){t.exports=function(t){return Math.abs(t)}},5848:function(t,e,n){var r=n(677);t.exports=r},677:function(t,e,n){var r=n(3449),i=n(1686),o=n(7838),a=n(1921),s=n(2490),u=[0,0];t.exports=function(t,e){var n,c;return o.assign(t,u,1,0),n=u[0],n&=i,c=a(e),s(n|=c&=r,u[1])}},5500:function(t,e,n){var r=n(8397);t.exports=r},8397:function(t,e,n){var r=n(4165),i=n(2918),o=n(6315),a=n(9777),s=n(6988),u=n(3690),c=n(1883),l=n(7011),d=n(5848),f=n(4948),p=n(8478),h=n(7838),v=n(2490),y=[0,0],m=[0,0];t.exports=function(t,e){var n,g;return 0===t||c(t)||l(t)?t:(f(y,t),e+=y[1],(e+=p(t=y[0]))<u?d(0,t):e>a?t<0?i:r:(e<=s?(e+=52,g=2220446049250313e-31):g=1,h(m,t),n=m[0],n&=2148532223,g*v(n|=e+o<<20,m[1])))}},4772:function(t,e,n){var r=n(7548);t.exports=r},7548:function(t){t.exports=Number},8478:function(t,e,n){var r=n(4500);t.exports=r},4500:function(t,e,n){var r=n(1921),i=n(3105),o=n(6315);t.exports=function(t){var e=r(t);return(e=(e&i)>>>20)-o|0}},2490:function(t,e,n){var r=n(9639);t.exports=r},4445:function(t,e,n){var r,i,o;!0===n(5902)?(i=1,o=0):(i=0,o=1),r={HIGH:i,LOW:o},t.exports=r},9639:function(t,e,n){var r=n(4773),i=n(7382),o=n(4445),a=new i(1),s=new r(a.buffer),u=o.HIGH,c=o.LOW;t.exports=function(t,e){return s[u]=t,s[c]=e,a[0]}},5646:function(t,e,n){var r;r=!0===n(5902)?1:0,t.exports=r},1921:function(t,e,n){var r=n(6285);t.exports=r},6285:function(t,e,n){var r=n(4773),i=n(7382),o=n(5646),a=new i(1),s=new r(a.buffer);t.exports=function(t){return a[0]=t,s[o]}},9024:function(t,e,n){var r=n(6488),i=n(7011),o=n(1883),a=n(513);t.exports=function(t,e,n,s){return o(t)||i(t)?(e[s]=t,e[s+n]=0,e):0!==t&&a(t)<r?(e[s]=4503599627370496*t,e[s+n]=-52,e):(e[s]=t,e[s+n]=0,e)}},4948:function(t,e,n){var r=n(7576),i=n(9422);r(i,"assign",n(9024)),t.exports=i},9422:function(t,e,n){var r=n(9024);t.exports=function(t){return r(t,[0,0],1,0)}},5239:function(t,e,n){var r=n(4773),i=n(7382),o=n(5782),a=new i(1),s=new r(a.buffer),u=o.HIGH,c=o.LOW;t.exports=function(t,e,n,r){return a[0]=t,e[r]=s[u],e[r+n]=s[c],e}},7838:function(t,e,n){var r=n(7576),i=n(4010);r(i,"assign",n(5239)),t.exports=i},5782:function(t,e,n){var r,i,o;!0===n(5902)?(i=1,o=0):(i=0,o=1),r={HIGH:i,LOW:o},t.exports=r},4010:function(t,e,n){var r=n(5239);t.exports=function(t){return r(t,[0,0],1,0)}},7576:function(t,e,n){var r=n(7063);t.exports=r},7063:function(t,e,n){var r=n(6691);t.exports=function(t,e,n){r(t,e,{configurable:!1,enumerable:!1,writable:!1,value:n})}},2073:function(t){var e=Object.defineProperty;t.exports=e},1680:function(t){var e="function"==typeof Object.defineProperty?Object.defineProperty:null;t.exports=e},1471:function(t,e,n){var r=n(1680);t.exports=function(){try{return r({},"x",{}),!0}catch(t){return!1}}},6691:function(t,e,n){var r,i=n(1471),o=n(2073),a=n(1309);r=i()?o:a,t.exports=r},1309:function(t){var e=Object.prototype,n=e.toString,r=e.__defineGetter__,i=e.__defineSetter__,o=e.__lookupGetter__,a=e.__lookupSetter__;t.exports=function(t,s,u){var c,l,d,f;if("object"!=typeof t||null===t||"[object Array]"===n.call(t))throw new TypeError("invalid argument. First argument must be an object. Value: `"+t+"`.");if("object"!=typeof u||null===u||"[object Array]"===n.call(u))throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+u+"`.");if((l="value"in u)&&(o.call(t,s)||a.call(t,s)?(c=t.__proto__,t.__proto__=e,delete t[s],t[s]=u.value,t.__proto__=c):t[s]=u.value),d="get"in u,f="set"in u,l&&(d||f))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return d&&r&&r.call(t,s,u.get),f&&i&&i.call(t,s,u.set),t}},6208:function(t,e,n){var r,i=n(3123),o=n(7407),a=n(4210);r=i()?a:o,t.exports=r},7407:function(t,e,n){var r=n(173);t.exports=function(t){return r.call(t)}},4210:function(t,e,n){var r=n(9048),i=n(1403),o=n(173);t.exports=function(t){var e,n,a;if(null==t)return o.call(t);n=t[i],e=r(t,i);try{t[i]=void 0}catch(e){return o.call(t)}return a=o.call(t),e?t[i]=n:delete t[i],a}},173:function(t){var e=Object.prototype.toString;t.exports=e},1403:function(t){var e="function"==typeof Symbol?Symbol.toStringTag:"";t.exports=e},7843:function(t){t.exports=function(t,e,n,r,i){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:i;return t===i?n:t}},374:function(t,e,n){n.r(e),n.d(e,{default:function(){return o}});for(var r=[],i=0;i<64;)r[i]=0|4294967296*Math.sin(++i%Math.PI);function o(t){var e,n,o,a=[e=1732584193,n=4023233417,~e,~n],s=[],u=unescape(encodeURI(t))+"",c=u.length;for(t=--c/4+2|15,s[--t]=8*c;~c;)s[c>>2]|=u.charCodeAt(c)<<8*c--;for(i=u=0;i<t;i+=16){for(c=a;u<64;c=[o=c[3],e+((o=c[0]+[e&n|~e&o,o&e|~o&n,e^n^o,n^(e|~o)][c=u>>4]+r[u]+~~s[i|15&[u,5*u+1,3*u+5,7*u][c]])<<(c=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*c+u++%4])|o>>>-c),e,n])e=0|c[1],n=c[2];for(u=4;u;)a[--u]+=c[u]}for(t="";u<32;)t+=(a[u>>3]>>4*(1^u++)&15).toString(16);return t}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}return n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(2870)}()})}}),Sn={};d(Sn,{tsubMiddleware:()=>xn});var Pn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/routing-middleware/index.js"(){_n=p(jn()),xn=function(t){return function(e){var n=e.payload,r=e.integration,i=e.next;new _n.Store(t).getRulesByDestinationName(r).forEach(function(t){for(var e=t.matchers,r=t.transformers,o=0;o<e.length;o++)if(_n.matches(n.obj,e[o])&&(n.obj=_n.transform(n.obj,r[o]),null===n.obj))return i(null)}),i(n)}}}});function On(t,e){var n,r;return"boolean"==typeof(null==e?void 0:e.enabled)?e.enabled:null===(r=null===(n=null==t?void 0:t.__default)||void 0===n?void 0:n.enabled)||void 0===r||r}var In=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/is-plan-event-enabled.js"(){}});function An(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function En(t,e){return void 0===e&&(e=!1),e?btoa(t).replace(/=/g,""):void 0}function Mn(t,e,n,r){return y(this,void 0,void 0,function(){var i,o,a,s,u,c;return m(this,function(l){switch(l.label){case 0:i=An(e),o=En(i,r),a=fn(),s="".concat(a,"/integrations/").concat(null!=o?o:i,"/").concat(n,"/").concat(null!=o?o:i,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,gn(s)];case 2:return l.sent(),function(t,e,n){var r,i;try{var o=(null!==(i=null===(r=null===window||void 0===window?void 0:window.performance)||void 0===r?void 0:r.getEntriesByName(t,"resource"))&&void 0!==i?i:[])[0];o&&e.stats.gauge("legacy_destination_time",Math.round(o.duration),g([n],o.duration<100?["cached"]:[],!0))}catch(t){}}(s,t,e),[3,4];case 3:throw u=l.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(e),"failed"]),u;case 4:return c=window["".concat(i,"Deps")],[4,Promise.all(c.map(function(t){return gn(a+t+".gz")}))];case 5:return l.sent(),window["".concat(i,"Loader")](),[2,window["".concat(i,"Integration")]]}})})}var Nn,Fn,Cn,Tn,Dn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/ajs-destination/loader.js"(){b(),hn(),bn()}}),Rn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/ajs-destination/utils.js"(){Nn=function(t,e){var n,r=e.type,i=e.bundlingStatus,o=e.versionSettings,a="unbundled"!==i&&("browser"===r||(null===(n=null==o?void 0:o.componentTypes)||void 0===n?void 0:n.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&a},Fn=function(t,e){var n=!1===e.All&&void 0===e[t];return!1===e[t]||n}}}),Ln={};function qn(t,e){return y(this,void 0,void 0,function(){var n,r=this;return m(this,function(i){switch(i.label){case 0:return n=[],Dt()?[2,e]:[4,Ue(function(){return e.length>0&&Tt()},function(){return y(r,void 0,void 0,function(){var r,i;return m(this,function(o){switch(o.label){case 0:return(r=e.pop())?[4,_t(r,t)]:[2];case 1:return i=o.sent(),i instanceof ne||n.push(r),[2]}})})})];case 1:return i.sent(),n.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}function zn(t,n,r,i,o,a){var s,u;if(void 0===r&&(r={}),void 0===i&&(i={}),Ft())return[];n.plan&&((i=null!=i?i:{}).plan=n.plan);var c=null!==(u=null===(s=n.middlewareSettings)||void 0===s?void 0:s.routingRules)&&void 0!==u?u:[],l=n.integrations,d=i.integrations,f=vn(n,null!=i?i:{}),p=null==a?void 0:a.reduce(function(t,n){var r;return e(e({},t),((r={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,r))},{}),h=new Set(g(g([],Object.keys(l).filter(function(t){return Nn(t,l[t])}),!0),Object.keys(p||{}).filter(function(t){return N(l[t])||N(null==d?void 0:d[t])}),!0));return Array.from(h).filter(function(t){return!Fn(t,r)}).map(function(e){var n=function(t){var e,n,r,i;return null!==(i=null!==(n=null===(e=null==t?void 0:t.versionSettings)||void 0===e?void 0:e.override)&&void 0!==n?n:null===(r=null==t?void 0:t.versionSettings)||void 0===r?void 0:r.version)&&void 0!==i?i:"latest"}(l[e]),r=new Tn(e,n,t,f[e],i,null==p?void 0:p[e]);return c.filter(function(t){return t.destinationName===e}).length>0&&o&&r.addMiddleware(o),r})}d(Ln,{LegacyDestination:()=>Tn,ajsDestinations:()=>zn});var Un=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/ajs-destination/index.js"(){b(),Cn=p(qe()),Rt(),ue(),Ct(),Mt(),In(),yn(),Ve(),ce(),ve(),$e(),Dn(),Mt(),Rn(),kn(),Z(),Tn=function(){function t(t,n,r,i,o,a){void 0===i&&(i={});var s=this;this.options={},this.type="destination",this.middleware=[],this.initializePromise=K(),this.flushing=!1,this.name=t,this.version=n,this.settings=e({},i),this.disableAutoISOConversion=o.disableAutoISOConversion||!1,this.integrationSource=a,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.initializePromise.promise.then(function(t){return s._initialized=t},function(){}),this.options=o,this.buffer=o.disableClientPersistence?new X(4,[]):new oe(4,"".concat(r,":dest-").concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return!!this._ready},t.prototype.ready=function(){var t=this;return this.initializePromise.promise.then(function(){var e;return null!==(e=t.onReady)&&void 0!==e?e:Promise.resolve()})},t.prototype.load=function(t,e){var n;return y(this,void 0,void 0,function(){var r,i,o,a=this;return m(this,function(s){switch(s.label){case 0:if(this._ready||void 0!==this.onReady)return[2];s.label=1;case 1:return s.trys.push([1,5,,6]),null===(n=this.integrationSource)||void 0===n?[3,2]:(i=n,[3,4]);case 2:return[4,Mn(t,this.name,this.version,this.options.obfuscate)];case 3:i=s.sent(),s.label=4;case 4:return r=i,this.integration=function(t,e,n){var r;"Integration"in t?(t({user:function(){return n.user()},addIntegration:function(){}}),r=t.Integration):r=t;var i=new r(e);return i.analytics=n,i}(r,this.settings,e),[3,6];case 5:throw o=s.sent(),wn(t,{integrationName:this.name,methodName:"load",type:"classic",didError:!0}),o;case 6:this.onReady=new Promise(function(t){a.integration.once("ready",function(){a._ready=!0,t(!0)})}),this.integration.on("initialize",function(){a.initializePromise.resolve(!0)});try{wn(t,{integrationName:this.name,methodName:"initialize",type:"classic"}),this.integration.initialize()}catch(e){throw wn(t,{integrationName:this.name,methodName:"initialize",type:"classic",didError:!0}),this.initializePromise.resolve(!1),e}return[2]}})})},t.prototype.unload=function(t,e){return function(t,e,n){return y(this,void 0,void 0,function(){var r,i,o;return m(this,function(a){return r=fn(),i=An(t),o=En(t,n),[2,(s="".concat(r,"/integrations/").concat(null!=o?o:i,"/").concat(e,"/").concat(null!=o?o:i,".dynamic.js.gz"),u=mn(s),void 0!==u&&u.remove(),Promise.resolve())];var s,u})})}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.middleware=(t=this.middleware).concat.apply(t,e)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(Dt()||!0!==this._ready||!0!==this._initialized)},t.prototype.send=function(t,n,r){var i,o;return y(this,void 0,void 0,function(){var a,s,u,c,l,d;return m(this,function(f){switch(f.label){case 0:return this.shouldBuffer(t)?(this.buffer.push(t),this.scheduleFlush(),[2,t]):(a=null===(o=null===(i=this.options)||void 0===i?void 0:i.plan)||void 0===o?void 0:o.track,s=t.event.event,a&&s&&"Segment.io"!==this.name&&(u=a[s],On(a,u)?t.updateEvent("integrations",e(e({},t.event.integrations),null==u?void 0:u.integrations)):(t.updateEvent("integrations",e(e({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new lt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),(null==u?void 0:u.enabled)&&!1===(null==u?void 0:u.integrations[this.name])&&t.cancel(new lt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),[4,Qe(this.name,t.event,this.middleware)]);case 1:if(null===(c=f.sent()))return[2,t];l=new n(c,{traverse:!this.disableAutoISOConversion}),wn(t,{integrationName:this.name,methodName:r,type:"classic"}),f.label=2;case 2:return f.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,r,l)]:[3,4];case 3:f.sent(),f.label=4;case 4:return[3,6];case 5:throw d=f.sent(),wn(t,{integrationName:this.name,methodName:r,type:"classic",didError:!0}),d;case 6:return[2,t]}})})},t.prototype.track=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Track,"track")]})})},t.prototype.page=function(t){var e;return y(this,void 0,void 0,function(){return m(this,function(n){switch(n.label){case 0:return(null===(e=this.integration)||void 0===e?void 0:e._assumesPageview)&&!this._initialized&&this.integration.initialize(),[4,this.initializePromise.promise];case 1:return n.sent(),[2,this.send(t,Cn.Page,"page")]}})})},t.prototype.identify=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Identify,"identify")]})})},t.prototype.alias=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Alias,"alias")]})})},t.prototype.group=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Group,"group")]})})},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout(function(){return y(t,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return Dt()||!0!==this._ready||!0!==this._initialized?(this.scheduleFlush(),[2]):(this.flushing=!0,t=this,[4,qn(this,this.buffer)]);case 1:return t.buffer=e.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},5e3*Math.random())},t}()}}),Bn=l({"../../../../node_modules/@segment/analytics.js-video-plugins/dist/index.umd.js"(t,e){var n,r;n=window,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){n.r(e);var r="function"==typeof fetch?fetch.bind():function(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest;for(var o in i.open(e.method||"get",t,!0),e.headers)i.setRequestHeader(o,e.headers[o]);function a(){var t,e=[],n=[],r={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(i,o,a){e.push(o=o.toLowerCase()),n.push([o,a]),t=r[o],r[o]=t?t+","+a:a}),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:a,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]))},headers:{keys:function(){return e},entries:function(){return n},get:function(t){return r[t.toLowerCase()]},has:function(t){return t.toLowerCase()in r}}}}i.withCredentials="include"==e.credentials,i.onload=function(){n(a())},i.onerror=r,i.send(e.body)})};e.default=r},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pluginName=e}return r(t,[{key:"track",value:function(t,e){window.analytics.track(t,e,{integration:{name:this.pluginName}})}}]),t}();e.default=i},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.YouTubeAnalytics=e.VimeoAnalytics=void 0;var r=o(n(3)),i=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}e.VimeoAnalytics=r.default,e.YouTubeAnalytics=i.default},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"VimeoAnalytics"));return r.authToken=n,r.player=t,r.metadata={content:{},playback:{videoPlayer:"Vimeo"}},r.mostRecentHeartbeat=0,r.isPaused=!1,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"initialize",value:function(){var t=this,e={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var n in e)this.registerHandler(n,e[n]);this.player.getVideoId().then(function(e){t.retrieveMetadata({id:e})}).catch(console.error)}},{key:"registerHandler",value:function(t,e){var n=this;this.player.on(t,function(t){n.updateMetadata(t),e.call(n,t)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var t=this.mostRecentHeartbeat,e=this.metadata.playback.position;e!==t&&e-t>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(e))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(t){var e=this;return new Promise(function(n,r){var o=t.id;(0,i.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+e.authToken}}).then(function(t){return t.ok?t.json():r(t)}).then(function(t){e.metadata.content.title=t.name,e.metadata.content.description=t.description,e.metadata.content.publisher=t.user.name,e.metadata.playback.position=0,e.metadata.playback.totalLength=t.duration}).catch(function(t){return console.error("Request to Vimeo API Failed with: ",t),r(t)})})}},{key:"updateMetadata",value:function(t){var e=this;return new Promise(function(n,r){e.player.getVolume().then(function(r){r&&(e.metadata.playback.sound=100*r),e.metadata.playback.position=t.seconds,n()}).catch(r)})}}]),e}(o(n(1)).default);e.default=a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"YoutubeAnalytics"));return r.player=t,r.apiKey=n,r.playerLoaded=!1,r.playbackStarted=!1,r.contentStarted=!1,r.isPaused=!1,r.isBuffering=!1,r.isSeeking=!1,r.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},r.metadata=[{playback:{video_player:"youtube"},content:{}}],r.playlistIndex=0,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(t){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(t){var e=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=e,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),t.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var t=this;return new Promise(function(e,n){var r=t.player.getVideoData(),o=t.player.getPlaylist()||[r.video_id],a=o.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+a+"&part=snippet,contentDetails&key="+t.apiKey).then(function(t){if(!t.ok){var e=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw e.response=t,e}return t.json()}).then(function(n){t.metadata=[];for(var r=0,i=0;i<o.length;i++){var a=n.items[i];t.metadata.push({content:{title:a.snippet.title,description:a.snippet.description,keywords:a.snippet.tags,channel:a.snippet.channelTitle,airdate:a.snippet.publishedAt}}),r+=s(a.contentDetails.duration)}for(i=0;i<o.length;i++)t.metadata[i].playback={total_length:r,video_player:"youtube"};e()}).catch(function(e){t.metadata=o.map(function(t){return{playback:{video_player:"youtube"},content:{}}}),n(e)})})}},{key:"handleBuffer",value:function(){var t=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),t&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var e=this.player.getPlaylist();e&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===e.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var t=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(t?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var t=this.player.getPlaylistIndex(),e=this.player.getPlaylist();(e&&t===e.length-1||-1===t)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var t=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,e=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(t-e)>2e3}}]),e}(o(n(1)).default);function s(t){var e=t.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return e=e.slice(1).map(function(t){if(null!=t)return t.replace(/\D/,"")}),3600*(parseInt(e[0])||0)+60*(parseInt(e[1])||0)+(parseInt(e[2])||0)}e.default=a}])},"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.analyticsVideoPlugins=r():n.analyticsVideoPlugins=r()}}),Vn={};function Kn(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return[4,Promise.resolve().then(()=>p(Bn()))];case 1:return e=n.sent(),t._plugins=e,[2]}})})}d(Vn,{loadLegacyVideoPlugins:()=>Kn});var Hn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/legacy-video-plugins/index.js"(){b()}}),Jn={};function Gn(t,n){function r(r){var i=t,o=r.event.event;if(i&&o){var a=i[o];if(!On(i,a))return r.updateEvent("integrations",e(e({},r.event.integrations),{All:!1,"Segment.io":!0})),r;var s=function(t,e){var n,r;if(!t||!Object.keys(t))return{};var i=t.integrations?Object.keys(t.integrations).filter(function(e){return!1===t.integrations[e]}):[],o=[];return(null!==(n=e.remotePlugins)&&void 0!==n?n:[]).forEach(function(t){i.forEach(function(e){t.creationName==e&&o.push(t.name)})}),(null!==(r=e.remotePlugins)&&void 0!==r?r:[]).reduce(function(t,e){return e.settings.subscriptions&&o.includes(e.name)&&e.settings.subscriptions.forEach(function(n){return t["".concat(e.name," ").concat(n.partnerAction)]=!1}),t},{})}(a,n);r.updateEvent("integrations",e(e(e({},r.event.integrations),null==a?void 0:a.integrations),s))}return r}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:r,alias:r,track:r,identify:r,group:r}}d(Jn,{schemaFilter:()=>Gn});var Wn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/schema-filter/index.js"(){b(),In()}}),Yn={};function Qn(t,e,n){var r;return y(this,void 0,void 0,function(){var i,o,a,s,u=this;return m(this,function(c){switch(c.label){case 0:return Ft()?[2,[]]:(i=fn(),o=null!==(r=e.enabledMiddleware)&&void 0!==r?r:{},a=Object.entries(o).filter(function(t){t[0];return t[1]}).map(function(t){return t[0]}),s=a.map(function(e){return y(u,void 0,void 0,function(){var r,o,a,s;return m(this,function(u){switch(u.label){case 0:r=e.replace("@segment/",""),o=r,n&&(o=btoa(r).replace(/=/g,"")),a="".concat(i,"/middleware/").concat(o,"/latest/").concat(o,".js.gz"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,gn(a)];case 2:return u.sent(),[2,window["".concat(r,"Middleware")]];case 3:return s=u.sent(),t.log("error",s),t.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(s)]);case 1:return[2,c.sent().filter(Boolean)]}})})}d(Yn,{remoteMiddlewares:()=>Qn});var Zn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/remote-middleware/index.js"(){b(),Ct(),bn(),hn()}}),$n={};d($n,{DestinationSegment:()=>Ni,default:()=>qi,destinationSegment:()=>Li});var Xn=Object.defineProperty;((t,e)=>{for(var n in e)Xn(t,n,{get:e[n],enumerable:!0})})({},{Level:()=>er});var tr,er=((tr=er||{})[tr.ERROR=0]="ERROR",tr[tr.WARN=1]="WARN",tr[tr.INFO=2]="INFO",tr[tr.DEBUG=3]="DEBUG",tr);function nr(t){return Array.isArray(t)}function rr(t){return void 0!==t}function ir(t){return"object"==typeof t&&null!==t&&!nr(t)&&"[object Object]"===Object.prototype.toString.call(t)}function or(t){return"string"==typeof t}function ar(t,e="",n){const r=e.split(".");let i=t;for(let t=0;t<r.length;t++){const e=r[t];if("*"===e&&nr(i)){const e=r.slice(t+1).join("."),o=[];for(const t of i){const r=ar(t,e,n);o.push(r)}return o}if(i=i instanceof Object?i[e]:void 0,void 0===i)break}return rr(i)?i:n}function sr(t){return function(t){return"boolean"==typeof t}(t)||or(t)||function(t){return"number"==typeof t&&!Number.isNaN(t)}(t)||!rr(t)||nr(t)&&t.every(sr)||ir(t)&&Object.values(t).every(sr)}function ur(t){return sr(t)?t:void 0}function cr(t,e,n){return async function(...r){try{return await t(...r)}catch(t){if(!e)return;return await e(t)}finally{await(null==n?void 0:n())}}}async function lr(t,e={},n={}){var r;if(!rr(t))return;const i=ir(t)&&t.consent||n.consent||(null==(r=n.collector)?void 0:r.consent),o=nr(e)?e:[e];for(const e of o){const r=await cr(dr)(t,e,{...n,consent:i});if(rr(r))return r}}async function dr(t,e,n={}){const{collector:r,consent:i}=n;return(nr(e)?e:[e]).reduce(async(e,o)=>{const a=await e;if(a)return a;const s=or(o)?{key:o}:o;if(!Object.keys(s).length)return;const{condition:u,consent:c,fn:l,key:d,loop:f,map:p,set:h,validate:v,value:y}=s;if(u&&!await cr(u)(t,o,r))return;if(c&&!function(t,e={},n={}){const r={...e,...n},i={};let o=!t||0===Object.keys(t).length;return Object.keys(r).forEach(e=>{r[e]&&(i[e]=!0,t&&t[e]&&(o=!0))}),!!o&&i}(c,i))return y;let m=rr(y)?y:t;if(l&&(m=await cr(l)(t,o,n)),d&&(m=ar(t,d,y)),f){const[e,r]=f,i="this"===e?[t]:await lr(t,e,n);nr(i)&&(m=(await Promise.all(i.map(t=>lr(t,r,n)))).filter(rr))}else p?m=await Object.entries(p).reduce(async(e,[r,i])=>{const o=await e,a=await lr(t,i,n);return rr(a)&&(o[r]=a),o},Promise.resolve({})):h&&(m=await Promise.all(h.map(e=>dr(t,e,n))));v&&!await cr(v)(m)&&(m=void 0);const g=ur(m);return rr(g)?g:ur(y)},Promise.resolve(void 0))}function fr(t,e,n,r){var i,o=[t,e,n,r],a=N(t)?t.event:t;if(!a||!A(a))throw new Error("Event missing");var s=N(t)?null!==(i=t.properties)&&void 0!==i?i:{}:N(e)?e:{},u={};return M(n)||(u=null!=n?n:{}),N(t)&&!M(e)&&(u=null!=e?e:{}),[a,s,u,o.find(M)]}function pr(t,e,n,r,i){var o,a,s=null,u=null,c=[t,e,n,r,i],l=c.filter(A);1===l.length?A(c[1])?(u=c[1],s=null):(u=l[0],s=null):2===l.length&&("string"==typeof c[0]&&(s=c[0]),"string"==typeof c[1]&&(u=c[1]));var d=c.find(M),f=c.filter(N);return 1===f.length?N(c[2])?(a={},o=c[2]):N(c[3])?(o={},a=c[3]):(o=f[0],a={}):2===f.length&&(o=f[0],a=f[1]),[s,u,null!=o?o:o={},null!=a?a:a={},d]}b(),Mt();var hr=function(t){return function(){for(var e,n,r,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var a={},s=["callback","options","traits","id"],u=0,c=i;u<c.length;u++){var l=c[u],d=s.pop();if("id"===d){if(A(l)||E(l)){a.id=l.toString();continue}if(null==l)continue;d=s.pop()}if("traits"!==d&&"options"!==d||null!=l&&!N(l)||(a[d]=l),M(l)){a.callback=l;break}}return[null!==(e=a.id)&&void 0!==e?e:t.id(),null!==(n=a.traits)&&void 0!==n?n:{},null!==(r=a.options)&&void 0!==r?r:{},a.callback]}};function vr(t,e,n,r){E(t)&&(t=t.toString()),E(e)&&(e=e.toString());var i=[t,e,n,r],o=i.filter(A),a=o[0],s=void 0===a?t:a,u=o[1],c=void 0===u?null:u,l=i.filter(N)[0];return[s,c,void 0===l?{}:l,i.find(M)]}Rt(),ue(),Mt(),Z(),b(),ft();var yr=function(t,e,n,r,i,o){return{__t:"bpc",c:e,p:r,u:t,s:n,t:i,r:o}},mr=Object.keys(yr("","","","","",""));function gr(t){if(e=t,"object"!==Object.prototype.toString.call(e).slice(8,-1).toLowerCase())return!1;var e;if("bpc"!==t.__t)return!1;for(var n in t)if(!mr.includes(n))return!1;return!0}var br=function(t){var e,n,r=t.c,i=t.p,o=t.s,a=t.u,s=t.r,u=t.t,c=r?function(t){try{return new URL(t).pathname}catch(e){return"/"===t[0]?t:"/"+t}}(r):i,l=r?function(t,e){return t.indexOf("?")>-1?t:t+e}(r,o):-1===(n=(e=a).indexOf("#"))?e:e.slice(0,n);return{path:c,referrer:s,search:o,title:u,url:l}},wr=function(){var t=document.querySelector("link[rel='canonical']");return yr(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)};b(),b();var _r=function(t,n){void 0===n&&(n=br(wr()));var r,i,o,a=t.context;"page"===t.type&&(r=t.properties&&(i=t.properties,o=Object.keys(n),Object.assign.apply(Object,g([{}],o.map(function(t){var e;if(i&&Object.prototype.hasOwnProperty.call(i,t))return(e={})[t]=i[t],e}),!1))),t.properties=e(e(e({},n),t.properties),t.name?{name:t.name}:{})),a.page=e(e(e({},n),r),a.page)};Mt();var xr=function(t){function e(e){var n=t.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(ot())},onEventMethodCall:function(t){var e=t.options;n.maybeUpdateAnonId(e)},onFinishedEvent:function(t){return n.addIdentity(t),t}})||this;return n.user=e,n}return h(e,t),e.prototype.maybeUpdateAnonId=function(t){(null==t?void 0:t.anonymousId)&&this.user.anonymousId(t.anonymousId)},e.prototype.addIdentity=function(t){this.user.id()&&(t.userId=this.user.id()),this.user.anonymousId()&&(t.anonymousId=this.user.anonymousId())},e.prototype.track=function(e,n,r,i,o){var a=t.prototype.track.call(this,e,n,r,i);return _r(a,o),a},e.prototype.page=function(e,n,r,i,o,a){var s=t.prototype.page.call(this,e,n,r,i,o);return _r(s,a),s},e.prototype.screen=function(e,n,r,i,o,a){var s=t.prototype.screen.call(this,e,n,r,i,o);return _r(s,a),s},e.prototype.identify=function(e,n,r,i,o){var a=t.prototype.identify.call(this,e,n,r,i);return _r(a,o),a},e.prototype.group=function(e,n,r,i,o){var a=t.prototype.group.call(this,e,n,r,i);return _r(a,o),a},e.prototype.alias=function(e,n,r,i,o){var a=t.prototype.alias.call(this,e,n,r,i);return _r(a,o),a},e}(q),kr=function(t){return"addMiddleware"in t&&"destination"===t.type};b(),ve(),Mt(),Rt();var jr=function(t){function e(e){return t.call(this,"string"==typeof e?new oe(4,e):e)||this}return h(e,t),e.prototype.flush=function(){return y(this,void 0,void 0,function(){return m(this,function(e){return Dt()?[2,[]]:[2,t.prototype.flush.call(this)]})})},e}(kt);function Sr(t){for(var e=t.constructor.prototype,n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var i=r[n];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}return t}function Pr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}b(),ft(),b();var Or=function t(e,n){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=Pr({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in i)i[a]&&(o+="; "+a,!0!==i[a]&&(o+="="+i[a].split(";")[0]));return document.cookie=t+"="+e.write(r,t)+o}}return Object.create({set:r,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(r[s]=e.read(a,s),t===s)break}catch(t){}}return t?r[t]:r}},remove:function(t,e){r(t,"",Pr({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,Pr({},this.attributes,e))},withConverter:function(e){return t(Pr({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Ir=Or;function Ar(t){var e=function(t){try{return new URL(t)}catch(t){return}}(t);if(e)for(var n=function(t){var e=t.hostname.split("."),n=e[e.length-1],r=[];if(4===e.length&&parseInt(n,10)>0)return r;if(e.length<=1)return r;for(var i=e.length-2;i>=0;--i)r.push(e.slice(i).join("."));return r}(e),r=0;r<n.length;++r){var i="__tld__",o=n[r],a={domain:"."+o};try{if(Ir.set(i,"1",a),Ir.get(i))return Ir.remove(i,a),o}catch(t){return}}}var Er=function(){function t(n){void 0===n&&(n=t.defaults),this.options=e(e({},t.defaults),n)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:365,domain:Ar(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(t){var e;try{var n=Ir.get(t);if(null==n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(t){return null}},t.prototype.set=function(t,e){"string"==typeof e?Ir.set(t,e,this.opts()):null===e?Ir.remove(t,this.opts()):Ir.set(t,JSON.stringify(e),this.opts())},t.prototype.remove=function(t){return Ir.remove(t,this.opts())},t}(),Mr=function(){function t(){}return t.prototype.localStorageWarning=function(t,e){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(e))},t.prototype.get=function(t){var e;try{var n=localStorage.getItem(t);if(null===n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(e){return this.localStorageWarning(t,"unavailable"),null}},t.prototype.set=function(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){this.localStorageWarning(t,"full")}},t.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch(e){this.localStorageWarning(t,"unavailable")}},t}(),Nr=function(){function t(){this.cache={}}return t.prototype.get=function(t){var e;return null!==(e=this.cache[t])&&void 0!==e?e:null},t.prototype.set=function(t,e){this.cache[t]=e},t.prototype.remove=function(t){delete this.cache[t]},t}(),Fr={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function Cr(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(t){return Object.values(Fr).includes(t)})}var Tr=function(t,e,n,r){console.warn("".concat(t.constructor.name,": Can't ").concat(e,' key "').concat(n,'" | Err: ').concat(r))},Dr=function(){function t(t){this.stores=t}return t.prototype.get=function(t){for(var e=null,n=0,r=this.stores;n<r.length;n++){var i=r[n];try{if(null!=(e=i.get(t)))return e}catch(e){Tr(i,"get",t,e)}}return null},t.prototype.set=function(t,e){this.stores.forEach(function(n){try{n.set(t,e)}catch(e){Tr(n,"set",t,e)}})},t.prototype.clear=function(t){this.stores.forEach(function(e){try{e.remove(t)}catch(n){Tr(e,"remove",t,n)}})},t.prototype.getAndSync=function(t){var e=this.get(t),n="number"==typeof e?e.toString():e;return this.set(t,n),n},t}();function Rr(t){return t.map(function(t){var e,n;switch(!function(t){return"object"==typeof t&&void 0!==t.name}(t)?e=t:(e=t.name,n=t.settings),e){case Fr.Cookie:return new Er(n);case Fr.LocalStorage:return new Mr;case Fr.Memory:return new Nr;default:throw new Error("Unknown Store Type: ".concat(t))}})}function Lr(t,e){return t.map(function(t){return e&&t===Fr.Cookie?{name:t,settings:e}:t})}var qr={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},zr=function(){function t(t,n){void 0===t&&(t=qr);var r,i,o,a,s=this;this.options={},this.id=function(t){if(s.options.disable)return null;var e=s.identityStore.getAndSync(s.idKey);void 0!==t&&(s.identityStore.set(s.idKey,t),t!==e&&null!==e&&null!==t&&s.anonymousId(null));var n=s.identityStore.getAndSync(s.idKey);if(n)return n;var r=s.legacyUserStore.get(qr.cookie.oldKey);return r?"object"==typeof r?r.id:r:null},this.anonymousId=function(t){var e,n;if(s.options.disable)return null;if(void 0===t){var r=null!==(e=s.identityStore.getAndSync(s.anonKey))&&void 0!==e?e:null===(n=s.legacySIO())||void 0===n?void 0:n[0];if(r)return r}return null===t?(s.identityStore.set(s.anonKey,null),s.identityStore.getAndSync(s.anonKey)):(s.identityStore.set(s.anonKey,null!=t?t:ot()),s.identityStore.getAndSync(s.anonKey))},this.traits=function(t){var e;if(!s.options.disable)return null===t&&(t={}),t&&s.traitsStore.set(s.traitsKey,null!=t?t:{}),null!==(e=s.traitsStore.get(s.traitsKey))&&void 0!==e?e:{}},this.options=e(e({},qr),t),this.cookieOptions=n,this.idKey=null!==(i=null===(r=t.cookie)||void 0===r?void 0:r.key)&&void 0!==i?i:qr.cookie.key,this.traitsKey=null!==(a=null===(o=t.localStorage)||void 0===o?void 0:o.key)&&void 0!==a?a:qr.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,n),this.legacyUserStore=this.createStorage(this.options,n,function(t){return t===Fr.Cookie}),this.traitsStore=this.createStorage(this.options,n,function(t){return t!==Fr.Cookie});var u=this.legacyUserStore.get(qr.cookie.oldKey);u&&"object"==typeof u&&(u.id&&this.id(u.id),u.traits&&this.traits(u.traits)),Sr(this)}return t.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var e=t.split("----");return[e[0],e[1]]},t.prototype.identify=function(t,n){if(!this.options.disable){n=null!=n?n:{};var r=this.id();null!==r&&r!==t||(n=e(e({},this.traits()),n)),t&&this.id(t),this.traits(n)}},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.prototype.createStorage=function(t,e,n){var r=[Fr.LocalStorage,Fr.Cookie,Fr.Memory];return t.disable?new Dr([]):t.persist?(void 0!==t.storage&&null!==t.storage&&Cr(t.storage)&&(r=t.storage.stores),t.localStorageFallbackDisabled&&(r=r.filter(function(t){return t!==Fr.LocalStorage})),n&&(r=r.filter(n)),new Dr(Rr(Lr(r,e)))):new Dr([new Nr])},t.defaults=qr,t}(),Ur={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},Br=function(t){function n(n,r){void 0===n&&(n=Ur);var i=t.call(this,e(e({},Ur),n),r)||this;return i.anonymousId=function(t){},Sr(i),i}return h(n,t),n}(zr);ve(),Jt(),ce(),Kt(),ge(),b();Jt(),ge(),Zt();var Vr=function(t,e,n){n.getAndRemove(t).forEach(function(t){$r(e,t).catch(console.error)})},Kr=function(t,e){return y(void 0,void 0,void 0,function(){var n,r,i;return m(this,function(o){switch(o.label){case 0:n=0,r=e.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return n<r.length?(i=r[n],[4,$r(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},Hr=function(t,e){return y(void 0,void 0,void 0,function(){var n,r,i;return m(this,function(o){switch(o.label){case 0:n=0,r=e.getAndRemove("register"),o.label=1;case 1:return n<r.length?(i=r[n],[4,$r(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},Jr=Vr.bind(void 0,"on"),Gr=Vr.bind(void 0,"setAnonymousId"),Wr=function(t){if(Yr(t)){var e=t.pop();return br(e)}},Yr=function(t){return gr(t[t.length-1])},Qr=function(){return function(t,e,n,r){void 0===n&&(n=function(){}),void 0===r&&(r=console.error),this.method=t,this.resolve=n,this.reject=r,this.called=!1,this.args=e}}(),Zr=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._callMap={},this.add.apply(this,t)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e;return null!==(e=this.calls[t])&&void 0!==e?e:[]},t.prototype.getAndRemove=function(t){var e=this.get(t);return this.calls[t]=[],e},t.prototype.add=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach(function(e){["track","screen","alias","group","page","identify"].includes(e.method)&&!Yr(e.args)&&(e.args=g(g([],e.args,!0),[wr()],!1)),t.calls[e.method]?t.calls[e.method].push(e):t.calls[e.method]=[e]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){if("npm"!==Gt()){var t=ye();if(Array.isArray(t)){var e=t.splice(0,t.length).map(function(t){var e=t[0],n=t.slice(1);return new Qr(e,n)});this.add.apply(this,e)}}},t}();function $r(t,e){return y(this,void 0,void 0,function(){var n,r;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,n=t[e.method].apply(t,e.args),"object"==typeof(o=n)&&null!==o&&"then"in o&&"function"==typeof o.then?[4,n]:[3,2]);case 1:i.sent(),i.label=2;case 2:return e.resolve(n),[3,4];case 3:return r=i.sent(),e.reject(r),[3,4];case 4:return[2]}var o})})}var Xr=function(){function t(t){var e=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=Ut,this._preInitBuffer=new Zr,this._promise=t(this._preInitBuffer),this._promise.then(function(t){var n=t[0],r=t[1];e.instance=n,e.ctx=r}).catch(function(){})}return t.prototype.then=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).then.apply(t,e)},t.prototype.catch=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).catch.apply(t,e)},t.prototype.finally=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).finally.apply(t,e)},t.prototype._createMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e.instance){var o=(n=e.instance)[t].apply(n,r);return Promise.resolve(o)}return new Promise(function(n,i){e._preInitBuffer.add(new Qr(t,r,n,i))})}},t.prototype._createChainableMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.instance?((n=e.instance)[t].apply(n,r),e):(e._preInitBuffer.add(new Qr(t,r)),e)}},t}();b(),Rt(),ce(),ve(),Be(),b(),Ht();b();var ti=function(t){function e(e,n){var r=t.call(this,e)||this;return r.retryTimeout=n,r.name="RateLimitError",r}return h(e,t),e}(Error);ue(),b();var ei=function(t){return e({"Content-Type":"text/plain"},"function"==typeof t?t():t)};function ni(t){return(encodeURI(JSON.stringify(t)).split(/%..|./).length-1)/1024}function ri(t,n){var r,i,o,a,s,u=[],c=!1,l=null!==(r=null==n?void 0:n.size)&&void 0!==r?r:10,d=null!==(i=null==n?void 0:n.timeout)&&void 0!==i?i:5e3,f=0;function p(e){var r;if(0!==e.length){var i=null===(r=e[0])||void 0===r?void 0:r.writeKey,o=e.map(function(t){var e=t;e.sentAt;return v(e,["sentAt"])});return zt("https://".concat(t,"/b"),{credentials:null==n?void 0:n.credentials,keepalive:(null==n?void 0:n.keepalive)||c,headers:ei(null==n?void 0:n.headers),method:"post",body:JSON.stringify({writeKey:i,batch:o,sentAt:(new Date).toISOString()}),priority:null==n?void 0:n.priority}).then(function(t){var e;if(t.status>=500)throw new Error("Bad response from server: ".concat(t.status));if(429===t.status){var n=null===(e=t.headers)||void 0===e?void 0:e.get("x-ratelimit-reset"),r="string"==typeof n?1e3*parseInt(n):d;throw new ti("Rate limit exceeded: ".concat(t.status),r)}})}}function h(t){var r;return void 0===t&&(t=1),y(this,void 0,void 0,function(){var i;return m(this,function(o){return u.length?(i=u,u=[],[2,null===(r=p(i))||void 0===r?void 0:r.catch(function(r){var o;ne.system().log("error","Error sending batch",r),t<=(null!==(o=null==n?void 0:n.maxRetries)&&void 0!==o?o:10)&&("RateLimitError"===r.name&&(f=r.retryTimeout),u.push.apply(u,i),u.map(function(n){if("_metadata"in n){var r=n;r._metadata=e(e({},r._metadata),{retryCount:t})}}),g(t+1))})]):[2]})})}function g(t){void 0===t&&(t=1),o||(o=setTimeout(function(){o=void 0,h(t).catch(console.error)},f||d),f=0)}return a=function(t){if((c=t)&&u.length){var e=(n=u,r=[],i=0,n.forEach(function(t){ni(r[i])>=64&&i++,r[i]?r[i].push(t):r[i]=[t]}),r).map(p);Promise.all(e).catch(console.error)}var n,r,i},s=!1,window.addEventListener("pagehide",function(){s||a(s=!0)}),document.addEventListener("visibilitychange",function(){if("hidden"==document.visibilityState){if(s)return;s=!0}else s=!1;a(s)}),{dispatch:function(t,e){return y(this,void 0,void 0,function(){var t;return m(this,function(r){return u.push(e),t=u.length>=l||function(t){return ni(t)>=450}(u)||(null==n?void 0:n.keepalive)&&function(t){return ni(t)>=54}(u),[2,t||c?h():g()]})})}}}function ii(t,n,r,i,o){var a,s=t.user();delete n.options,n.writeKey=null==r?void 0:r.apiKey,n.userId=n.userId||s.id(),n.anonymousId=n.anonymousId||s.anonymousId(),n.sentAt=new Date;var u=t.queue.failedInitializations||[];u.length>0&&(n._metadata={failedInitializations:u}),null!=o&&(o.attempts>1&&(n._metadata=e(e({},n._metadata),{retryCount:o.attempts})),o.attempts++);var c=[],l=[];for(var d in i){var f=i[d];"Segment.io"===d&&c.push(d),"bundled"===f.bundlingStatus&&c.push(d),"unbundled"===f.bundlingStatus&&l.push(d)}for(var p=0,h=(null==r?void 0:r.unbundledIntegrations)||[];p<h.length;p++){var v=h[p];l.includes(v)||l.push(v)}var y=null!==(a=null==r?void 0:r.maybeBundledConfigIds)&&void 0!==a?a:{},m=[];return c.sort().forEach(function(t){var e;(null!==(e=y[t])&&void 0!==e?e:[]).forEach(function(t){m.push(t)})}),!1!==(null==r?void 0:r.addBundledMetadata)&&(n._metadata=e(e({},n._metadata),{bundled:c.sort(),unbundled:l.sort(),bundledIds:m})),n}function oi(t,e){return y(this,void 0,void 0,function(){var n,r=this;return m(this,function(i){switch(i.label){case 0:return n=[],Dt()?[2,e]:[4,Ue(function(){return e.length>0&&!Dt()},function(){return y(r,void 0,void 0,function(){var r,i;return m(this,function(o){switch(o.label){case 0:return(r=e.pop())?[4,_t(r,t)]:[2];case 1:return i=o.sent(),i instanceof ne||n.push(r),[2]}})})})];case 1:return i.sent(),n.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}function ai(t,e,n,r){var i=this;t||setTimeout(function(){return y(i,void 0,void 0,function(){var t,i;return m(this,function(o){switch(o.label){case 0:return t=!0,[4,oi(n,e)];case 1:return i=o.sent(),t=!1,e.todo>0&&r(t,i,n,r),[2]}})})},5e3*Math.random())}Ht(),b(),b(),Rt(),ue(),Mt(),Ve(),$t();var si=function(t){return"Segment.io"===t.name};function ui(t,e,n){var r,i,o;window.addEventListener("pagehide",function(){u.push.apply(u,Array.from(c)),c.clear()});var a,s=null!==(r=null==e?void 0:e.apiKey)&&void 0!==r?r:"",u=t.options.disableClientPersistence?new X(t.queue.queue.maxAttempts,[]):new oe(t.queue.queue.maxAttempts,"".concat(s,":dest-Segment.io")),c=new Set,l=!1,d=null!==(i=null==e?void 0:e.apiHost)&&void 0!==i?i:Wt,f=null!==(o=null==e?void 0:e.protocol)&&void 0!==o?o:"https",p="".concat(f,"://").concat(d),h=null==e?void 0:e.deliveryStrategy,v=h&&"strategy"in h&&"batching"===h.strategy?ri(d,h.config):(a=null==h?void 0:h.config,{dispatch:function(t,e){return zt(t,{credentials:null==a?void 0:a.credentials,keepalive:null==a?void 0:a.keepalive,headers:ei(null==a?void 0:a.headers),method:"post",body:JSON.stringify(e),priority:null==a?void 0:a.priority}).then(function(t){var e;if(t.status>=500)throw new Error("Bad response from server: ".concat(t.status));if(429===t.status){var n=null===(e=t.headers)||void 0===e?void 0:e.get("x-ratelimit-reset"),r=n?1e3*parseInt(n):5e3;throw new ti("Rate limit exceeded: ".concat(t.status),r)}})}});function g(r){return y(this,void 0,void 0,function(){var i,o;return m(this,function(a){return Dt()?(u.push(r),ai(l,u,b,ai),[2,r]):(c.add(r),i=r.event.type.charAt(0),o=ze(r.event).json(),"track"===r.event.type&&delete o.traits,"alias"===r.event.type&&(o=function(t,e){var n,r,i,o,a=t.user();return e.previousId=null!==(i=null!==(r=null!==(n=e.previousId)&&void 0!==n?n:e.from)&&void 0!==r?r:a.id())&&void 0!==i?i:a.anonymousId(),e.userId=null!==(o=e.userId)&&void 0!==o?o:e.to,delete e.from,delete e.to,e}(t,o)),u.getAttempts(r)>=u.maxAttempts?(c.delete(r),[2,r]):[2,v.dispatch("".concat(p,"/").concat(i),ii(t,o,e,n,r)).then(function(){return r}).catch(function(t){if(r.log("error","Error sending event",t),"RateLimitError"===t.name){var e=t.retryTimeout;u.pushWithBackoff(r,e)}else u.pushWithBackoff(r);return ai(l,u,b,ai),r}).finally(function(){c.delete(r)})])})})}var b={metadata:{writeKey:s,apiHost:d,protocol:f},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:g,identify:g,page:g,alias:g,group:g,screen:g};return u.todo&&ai(l,u,b,ai),b}var ci="This is being deprecated and will be not be available in future releases of Analytics JS",li=qt(),di=null==li?void 0:li.analytics;var fi=function(){function t(t,e){var n;this.timeout=300,this._getSegmentPluginMetadata=function(){var t;return null===(t=e.plugins.find(si))||void 0===t?void 0:t.metadata},this.writeKey=t.writeKey;this.cdnSettings=null!==(n=t.cdnSettings)&&void 0!==n?n:{integrations:{"Segment.io":{apiKey:""}}},this.cdnURL=t.cdnURL}return Object.defineProperty(t.prototype,"apiHost",{get:function(){var t,e;return null===(e=null===(t=this._getSegmentPluginMetadata)||void 0===t?void 0:t.call(this))||void 0===e?void 0:e.apiHost},enumerable:!1,configurable:!0}),t}();function pi(){console.warn(ci)}var hi,vi=function(t){function n(n,r,i,o,a){var s,u,c=this;(c=t.call(this)||this)._debug=!1,c.initialized=!1,c.user=function(){return c._user},c.init=c.initialize.bind(c),c.log=pi,c.addIntegrationMiddleware=pi,c.listeners=pi,c.addEventListener=pi,c.removeAllListeners=pi,c.removeListener=pi,c.removeEventListener=pi,c.hasListeners=pi,c.add=pi,c.addIntegration=pi;var l=null==r?void 0:r.cookie,d=null!==(s=null==r?void 0:r.disableClientPersistence)&&void 0!==s&&s;c.queue=null!=i?i:function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var r=e?10:1,i=n?new X(r,[]):new oe(r,t);return new jr(i)}("".concat(n.writeKey,":event-queue"),null==r?void 0:r.retryQueue,d),c.settings=new fi(n,c.queue);var f=null==r?void 0:r.storage;return c._universalStorage=c.createStore(d,f,l),c._user=null!=o?o:new zr(e({persist:!d,storage:null==r?void 0:r.storage},null==r?void 0:r.user),l).load(),c._group=null!=a?a:new Br(e({persist:!d,storage:null==r?void 0:r.storage},null==r?void 0:r.group),l).load(),c.eventFactory=new xr(c._user),c.integrations=null!==(u=null==r?void 0:r.integrations)&&void 0!==u?u:{},c.options=null!=r?r:{},Sr(c),c}return h(n,t),n.prototype.createStore=function(t,e,n){return t?new Dr([new Nr]):e&&Cr(e)?new Dr(Rr(Lr(e.stores,n))):new Dr(Rr([Fr.LocalStorage,{name:Fr.Cookie,settings:n},Fr.Memory]))},Object.defineProperty(n.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),n.prototype.track=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u=this;return m(this,function(c){return e=Wr(t),n=fr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=this.eventFactory.track(r,i,o,this.integrations,e),[2,this._dispatch(s,a).then(function(t){return u.emit("track",r,t.event.properties,t.event.options),t})]})})},n.prototype.page=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u,c=this;return m(this,function(l){return e=Wr(t),n=pr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=this.eventFactory.page(r,i,o,a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return c.emit("page",r,i,t.event.properties,t.event.options),t})]})})},n.prototype.identify=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u=this;return m(this,function(c){return e=Wr(t),n=hr(this._user).apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],this._user.identify(r,i),s=this.eventFactory.identify(this._user.id(),this._user.traits(),o,this.integrations,e),[2,this._dispatch(s,a).then(function(t){return u.emit("identify",t.event.userId,t.event.traits,t.event.options),t})]})})},n.prototype.group=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Wr(e);if(0===e.length)return this._group;var i=hr(this._group).apply(void 0,e),o=i[0],a=i[1],s=i[2],u=i[3];this._group.identify(o,a);var c=this._group.id(),l=this._group.traits(),d=this.eventFactory.group(c,l,s,this.integrations,r);return this._dispatch(d,u).then(function(e){return t.emit("group",e.event.groupId,e.event.traits,e.event.options),e})},n.prototype.alias=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u=this;return m(this,function(c){return e=Wr(t),n=vr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=this.eventFactory.alias(r,i,o,this.integrations,e),[2,this._dispatch(s,a).then(function(t){return u.emit("alias",r,i,t.event.options),t})]})})},n.prototype.screen=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u,c=this;return m(this,function(l){return e=Wr(t),n=pr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=this.eventFactory.screen(r,i,o,a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return c.emit("screen",r,i,t.event.properties,t.event.options),t})]})})},n.prototype.trackClick=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.link).call.apply(n,g([this],t,!1))]}})})},n.prototype.trackLink=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.link).call.apply(n,g([this],t,!1))]}})})},n.prototype.trackSubmit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.form).call.apply(n,g([this],t,!1))]}})})},n.prototype.trackForm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.form).call.apply(n,g([this],t,!1))]}})})},n.prototype.register=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r=this;return m(this,function(i){switch(i.label){case 0:return e=ne.system(),n=t.map(function(t){return r.queue.register(e,t,r)}),[4,Promise.all(n)];case 1:return i.sent(),[2,e]}})})},n.prototype.deregister=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r=this;return m(this,function(i){switch(i.label){case 0:return e=ne.system(),n=t.map(function(t){var n=r.queue.plugins.find(function(e){return e.name===t});if(n)return r.queue.deregister(e,n,r);e.log("warn","plugin ".concat(t," not found"))}),[4,Promise.all(n)];case 1:return i.sent(),[2,e]}})})},n.prototype.debug=function(t){return!1===t&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},n.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},n.prototype.timeout=function(t){this.settings.timeout=t},n.prototype._dispatch=function(t,e){return y(this,void 0,void 0,function(){var n;return m(this,function(r){return(n=new ne(t)).stats.increment("analytics_js.invoke",1,[t.type]),Dt()&&!this.options.retryQueue?[2,n]:[2,It(n,this.queue,this,{callback:e,debug:this._debug,timeout:this.settings.timeout})]})})},n.prototype.addSourceMiddleware=function(t){return y(this,void 0,void 0,function(){var e=this;return m(this,function(n){switch(n.label){case 0:return[4,this.queue.criticalTasks.run(function(){return y(e,void 0,void 0,function(){var e,n,r;return m(this,function(i){switch(i.label){case 0:return[4,Promise.resolve().then(()=>($e(),Ye))];case 1:return e=i.sent().sourceMiddlewarePlugin,n={},this.queue.plugins.forEach(function(t){if("destination"===t.type)return n[t.name]=!0}),r=e(t,n),[4,this.register(r)];case 2:return i.sent(),[2]}})})})];case 1:return n.sent(),[2,this]}})})},n.prototype.addDestinationMiddleware=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.queue.plugins.filter(kr).forEach(function(n){"*"!==t&&n.name.toLowerCase()!==t.toLowerCase()||n.addMiddleware.apply(n,e)}),Promise.resolve(this)},n.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},n.prototype.queryString=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return!1===this.options.useQueryString?[2,[]]:[4,Promise.resolve().then(()=>(pn(),rn))];case 1:return[2,(0,e.sent().queryString)(this,t)]}})})},n.prototype.use=function(t){return t(this),this},n.prototype.ready=function(t){return void 0===t&&(t=function(t){return t}),y(this,void 0,void 0,function(){return m(this,function(e){return[2,Promise.all(this.queue.plugins.map(function(t){return t.ready?t.ready():Promise.resolve()})).then(function(e){return t(e),e})]})})},n.prototype.noConflict=function(){var t;return console.warn(ci),t=null!=di?di:this,window[he]=t,this},n.prototype.normalize=function(t){return console.warn(ci),this.eventFactory.normalize(t)},Object.defineProperty(n.prototype,"failedInitializations",{get:function(){return console.warn(ci),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"VERSION",{get:function(){return Ut},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,e){return y(this,void 0,void 0,function(){return m(this,function(t){return console.warn(ci),[2,Promise.resolve(this)]})})},n.prototype.pageview=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return console.warn(ci),[4,this.page({path:t})];case 1:return e.sent(),[2,this]}})})},Object.defineProperty(n.prototype,"plugins",{get:function(){var t;return console.warn(ci),null!==(t=this._plugins)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Integrations",{get:function(){return console.warn(ci),this.queue.plugins.filter(function(t){return"destination"===t.type}).reduce(function(t,e){var n="".concat(e.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),r=window[n];if(!r)return t;var i=r.Integration;return i?(t[e.name]=i,t):(t[e.name]=r,t)},{})},enumerable:!1,configurable:!0}),n.prototype.push=function(t){var e=t.shift();e&&!this[e]||this[e].apply(this,t)},n}(H),yi=function(t){function e(){var e=t.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return e.initialized=!0,e}return h(e,t),e}(vi);function mi(){return"undefined"!=typeof process&&process.env?process.env:{}}function gi(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){return(e=navigator.userAgentData)?t?[2,e.getHighEntropyValues(t).catch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}function bi(){if(hi)return hi;var t=Ar(window.location.href);return hi={expires:31536e6,secure:!1,path:"/"},t&&(hi.domain=t),hi}b(),hn(),ue(),yn(),Z(),b(),Jt(),Zt(),nn(),b();var wi=new(function(){return function(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(e,n){return y(t,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:this.instance=n,e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,gi(this.instance.options.highEntropyValuesClientHints)];case 2:return t.userAgentData=e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(n){var r,i,o=n.event.context,a=o.page.search||"",s="object"==typeof a?function(t){try{var e=new URLSearchParams;return Object.entries(t).forEach(function(t){var n=t[0],r=t[1];Array.isArray(r)?r.forEach(function(t){return e.append(n,t)}):e.append(n,r)}),e.toString()}catch(t){return""}}(a):a;o.userAgent=navigator.userAgent,o.userAgentData=t.userAgentData;var u=navigator.userLanguage||navigator.language;void 0===o.locale&&void 0!==u&&(o.locale=u),null!==(r=o.library)&&void 0!==r||(o.library={name:"analytics.js",version:"".concat("web"===Gt()?"next":"npm:next","-").concat(Ut)}),s&&!o.campaign&&(o.campaign=function(t){return t.startsWith("?")&&(t=t.substring(1)),(t=t.replace(/\?/g,"&")).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1],o=void 0===i?"":i;if(r.includes("utm_")&&r.length>4){var a=r.slice(4);"campaign"===a&&(a="name"),t[a]=en(o)}return t},{})}(s));var c=function(){var t=Ir.get("_ga");if(t&&t.startsWith("amp"))return t}();c&&(o.amp={id:c}),function(t,n,r){var i,o=new Dr(r?[]:[new Er(bi())]),a=o.get("s:context.referrer"),s=null!==(i=function(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1));for(var n=0,r=(t=t.replace(/\?/g,"&")).split("&");n<r.length;n++){var i=r[n].split("="),o=i[0],a=i[1];if(e[o])return{id:a,type:e[o]}}}(t))&&void 0!==i?i:a;s&&(n&&(n.referrer=e(e({},n.referrer),s)),o.set("s:context.referrer",s))}(s,o,null!==(i=t.instance.options.disableClientPersistence)&&void 0!==i&&i);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){}return n},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}}());b(),bn(),hn(),$e(),ue(),kn(),Z();var _i,xi,ki=function(){function t(t,e){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=K(),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=e,this.name=t,this.type=e.type,this.alternativeNames.push(e.name)}return t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];"destination"===this.type&&(t=this.middleware).push.apply(t,e)},t.prototype.transform=function(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return[4,Qe(this.name,t.event,this.middleware)];case 1:return null===(e=n.sent())&&t.cancel(new lt({retry:!1,reason:"dropped by destination middleware"})),[2,new ne(e)]}})})},t.prototype._createMethod=function(t){var e=this;return function(n){return y(e,void 0,void 0,function(){var e,r;return m(this,function(i){switch(i.label){case 0:return this.action[t]?(e=n,"destination"!==this.type?[3,2]:[4,this.transform(n)]):[2,n];case 1:e=i.sent(),i.label=2;case 2:return i.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!i.sent())throw new Error("Something prevented the destination from getting ready");return wn(n,{integrationName:this.action.name,methodName:t,type:"action"}),[4,this.action[t](e)];case 4:return i.sent(),[3,6];case 5:throw r=i.sent(),wn(n,{integrationName:this.action.name,methodName:t,type:"action",didError:!0}),r;case 6:return[2,n]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return y(this,void 0,void 0,function(){return m(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]}})})},t.prototype.load=function(t,e){return y(this,void 0,void 0,function(){var n,r,i,o;return m(this,function(a){switch(a.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];a.label=1;case 1:return a.trys.push([1,3,,4]),wn(t,{integrationName:this.action.name,methodName:"load",type:"action"}),n=this.action.load(t,e),i=(r=this.loadPromise).resolve,[4,n];case 2:return i.apply(r,[a.sent()]),[2,n];case 3:throw o=a.sent(),wn(t,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(o),o;case 4:return[2]}})})},t.prototype.unload=function(t,e){var n,r;return null===(r=(n=this.action).unload)||void 0===r?void 0:r.call(n,t,e)},t}();function ji(t,e){return y(this,void 0,void 0,function(){var n,r,i,o,a,s;return m(this,function(u){switch(u.label){case 0:if(u.trys.push([0,9,,10]),n=new RegExp("https://cdn.segment.(com|build)"),r=dn(),!e)return[3,6];i=t.url.split("/"),o=i[i.length-2],a=t.url.replace(o,btoa(o).replace(/=/g,"")),u.label=1;case 1:return u.trys.push([1,3,,5]),[4,gn(a.replace(n,r))];case 2:return u.sent(),[3,5];case 3:return u.sent(),[4,gn(t.url.replace(n,r))];case 4:return u.sent(),[3,5];case 5:return[3,8];case 6:return[4,gn(t.url.replace(n,r))];case 7:u.sent(),u.label=8;case 8:return"function"==typeof window[t.libraryName]?[2,window[t.libraryName]]:[3,10];case 9:throw s=u.sent(),console.error("Failed to create PluginFactory",t),s;case 10:return[2]}})})}function Si(t,n,r,i,o,a){var s,u,c;return y(this,void 0,void 0,function(){var l,d,f,p=this;return m(this,function(h){switch(h.label){case 0:return l=[],d=null!==(u=null===(s=t.middlewareSettings)||void 0===s?void 0:s.routingRules)&&void 0!==u?u:[],f=(null!==(c=t.remotePlugins)&&void 0!==c?c:[]).map(function(t){return y(p,void 0,void 0,function(){var s,u,c,f,p,h,v;return m(this,function(y){switch(y.label){case 0:if(function(t,e){var n=t[e.creationName],r=t[e.name];return!1===t.All&&!n&&!r||!1===n||!1===r}(n,t))return[2];y.label=1;case 1:return y.trys.push([1,6,,7]),(u=null==a?void 0:a.find(function(e){return e.pluginName===t.name}))?[3,3]:[4,ji(t,null==i?void 0:i.obfuscate)];case 2:u=y.sent(),y.label=3;case 3:return(s=u)?(c=r[t.name],[4,s(e(e({},t.settings),c))]):[3,5];case 4:f=y.sent(),function(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];t.forEach(function(t){e.forEach(function(e){var n;if(void 0===t[e])throw new Error("Plugin: ".concat(null!==(n=t.name)&&void 0!==n?n:"unknown"," missing required function ").concat(e))})})}(p=Array.isArray(f)?f:[f]),h=d.filter(function(e){return e.destinationName===t.creationName}),p.forEach(function(e){var n=new ki(t.creationName,e);h.length&&o&&n.addMiddleware(o),l.push(n)}),y.label=5;case 5:return[3,7];case 6:return v=y.sent(),console.warn("Failed to load Remote Plugin",v),wn(ne.system(),{integrationName:t.name,methodName:"load",type:"action",didError:!0}),[3,7];case 7:return[2]}})})}),[4,Promise.all(f)];case 1:return h.sent(),[2,l.filter(Boolean)]}})})}Kt();var Pi=null!==(_i=(xi=qt()).__SEGMENT_INSPECTOR__)&&void 0!==_i?_i:xi.__SEGMENT_INSPECTOR__={};function Oi(t,e,n){return y(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return[4,Ii(t,e)];case 1:return r.sent(),function(t,e){Object.keys(e.calls).forEach(function(n){e.getAndRemove(n).forEach(function(e){setTimeout(function(){$r(t,e).catch(console.error)},0)})})}(t,n),[2]}})})}se(),ge(),Ht();var Ii=function(t,e){return y(void 0,void 0,void 0,function(){return m(this,function(n){switch(n.label){case 0:return e.includes("ajs_")?[4,t.queryString(e).catch(console.error)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})};function Ai(t,e,n,r,i,o,a){var s,u,c;return void 0===i&&(i=[]),y(this,void 0,void 0,function(){var l,d,f,p,h,v,b,w,_,x,k,j,S,P,O=this;return m(this,function(I){switch(I.label){case 0:return function(t,e){Gr(t,e),Jr(t,e)}(n,a),l=null==i?void 0:i.filter(function(t){return"object"==typeof t}),d=null==i?void 0:i.filter(function(t){return"function"==typeof t&&"string"==typeof t.pluginName}),function(t){var e,n,r;return"test"!==mi().NODE_ENV&&(null!==(r=null===(n=null===(e=t.middlewareSettings)||void 0===e?void 0:e.routingRules)||void 0===n?void 0:n.length)&&void 0!==r?r:0)>0}(e)?[4,Promise.resolve().then(()=>(Pn(),Sn)).then(function(t){return t.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return p=I.sent(),[3,3];case 2:p=void 0,I.label=3;case 3:return f=p,A=e,"test"!==mi().NODE_ENV&&Object.keys(A.integrations).length>1||o.length>0?[4,Promise.resolve().then(()=>(Un(),Ln)).then(function(i){return i.ajsDestinations(t,e,n.integrations,r,f,o)})]:[3,5];case 4:return v=I.sent(),[3,6];case 5:v=[],I.label=6;case 6:return h=v,e.legacyVideoPluginsEnabled?[4,Promise.resolve().then(()=>(Hn(),Vn)).then(function(t){return t.loadLegacyVideoPlugins(n)})]:[3,8];case 7:I.sent(),I.label=8;case 8:return(null===(s=r.plan)||void 0===s?void 0:s.track)?[4,Promise.resolve().then(()=>(Wn(),Jn)).then(function(t){var n;return t.schemaFilter(null===(n=r.plan)||void 0===n?void 0:n.track,e)})]:[3,10];case 9:return w=I.sent(),[3,11];case 10:w=void 0,I.label=11;case 11:return b=w,_=vn(e,r),[4,Si(e,n.integrations,_,r,f,d).catch(function(t){return console.error("Failed to load remote plugins",t),[]})];case 12:return x=I.sent(),k=g(g([wi],h,!0),x,!0),b&&k.push(b),!1===(null===(u=r.integrations)||void 0===u?void 0:u.All)&&!r.integrations["Segment.io"]||r.integrations&&!1===r.integrations["Segment.io"]?[3,14]:(S=(j=k).push,[4,ui(n,_["Segment.io"],e.integrations)]);case 13:S.apply(j,[I.sent()]),I.label=14;case 14:return[4,n.register.apply(n,g(g([],k,!1),l,!1))];case 15:return P=I.sent(),[4,Hr(n,a)];case 16:return I.sent(),Object.entries(null!==(c=e.enabledMiddleware)&&void 0!==c?c:{}).some(function(t){return t[1]})?[4,Promise.resolve().then(()=>(Zn(),Yn)).then(function(t){var i=t.remoteMiddlewares;return y(O,void 0,void 0,function(){var t,o;return m(this,function(a){switch(a.label){case 0:return[4,i(P,e,r.obfuscate)];case 1:return t=a.sent(),o=t.map(function(t){return n.addSourceMiddleware(t)}),[2,Promise.all(o)]}})})})]:[3,18];case 17:I.sent(),I.label=18;case 18:return[4,Kr(n,a)];case 19:return I.sent(),[2,P]}var A})})}function Ei(t,n,r){var i,o,a,s,u,c,l,d,f;return void 0===n&&(n={}),y(this,void 0,void 0,function(){var p,h,v,y,g,b,w,_,x,k;return m(this,function(m){switch(m.label){case 0:return!0===n.disable?[2,[new yi,ne.system()]]:(n.globalAnalyticsKey&&(P=n.globalAnalyticsKey,he=P),t.cdnURL&&ln(t.cdnURL),n.initialPageview&&r.add(new Qr("page",[])),p=function(){var t,e,n=null!==(t=window.location.hash)&&void 0!==t?t:"",r=null!==(e=window.location.search)&&void 0!==e?e:"";return r.length?r:n.replace(/(?=#).*(?=\?)/,"")}(),h=null!==(i=t.cdnURL)&&void 0!==i?i:dn(),null===(o=t.cdnSettings)||void 0===o?[3,1]:(y=o,[3,3]));case 1:return[4,(j=t.writeKey,S=h,zt("".concat(S,"/v1/projects/").concat(j,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(t){throw new Error(t)})}).catch(function(t){throw console.error(t.message),t}))];case 2:y=m.sent(),m.label=3;case 3:return v=y,n.updateCDNSettings&&(v=n.updateCDNSettings(v)),"function"!=typeof n.disable?[3,5]:[4,n.disable(v)];case 4:if(m.sent())return[2,[new yi,ne.system()]];m.label=5;case 5:return g=null===(s=null===(a=v.integrations["Segment.io"])||void 0===a?void 0:a.retryQueue)||void 0===s||s,n=e({retryQueue:g},n),function(t){var e;null===(e=Pi.attach)||void 0===e||e.call(Pi,t)}(b=new vi(e(e({},t),{cdnSettings:v,cdnURL:h}),n)),w=null!==(u=t.plugins)&&void 0!==u?u:[],_=null!==(c=t.classicIntegrations)&&void 0!==c?c:[],x=null===(l=n.integrations)||void 0===l?void 0:l["Segment.io"],ee.initRemoteMetrics(e(e({},v.metrics),{host:null!==(d=null==x?void 0:x.apiHost)&&void 0!==d?d:null===(f=v.metrics)||void 0===f?void 0:f.host,protocol:null==x?void 0:x.protocol})),[4,Ai(t.writeKey,v,b,n,w,_,r)];case 6:return k=m.sent(),b.initialized=!0,b.emit("initialize",t,n),[4,Oi(b,p,r)];case 7:return m.sent(),[2,[b,k]]}var j,S,P})})}var Mi=function(t){function e(){var e=this,n=K(),r=n.promise,i=n.resolve;return(e=t.call(this,function(t){return r.then(function(e){return Ei(e[0],e[1],t)})})||this)._resolveLoadStart=function(t,e){return i([t,e])},e}return h(e,t),e.prototype.load=function(t,e){return void 0===e&&(e={}),this._resolveLoadStart(t,e),this},e.load=function(t,n){return void 0===n&&(n={}),(new e).load(t,n)},e.standalone=function(t,n){return e.load({writeKey:t},n).then(function(t){return t[0]})},e}(Xr);ue();var Ni={},Fi={load:(t,e)=>Mi.load(t,e)};function Ci(t){var e;return null!=(e=null==t?void 0:t.analytics)?e:Fi}function Ti(t,e){const{apiKey:n,identify:r,group:i,consent:o,_state:a,...s}=e,u={initialPageview:!1,...s};return t.load({writeKey:n},u)}function Di(t){if(!t)return"";try{return JSON.stringify(t)}catch(t){return""}}var Ri,Li={type:"segment",config:{},init({config:t,env:e}){var n;if(!(null==(n=t.settings)?void 0:n.apiKey))return!1;const r=t.settings,i=Ci(e),o={lastIdentity:{},lastGroup:{},loaded:!1};return!!t.consent&&Object.keys(t.consent).length>0||(o.analytics=Ti(i,r),o.loaded=!0),{...t,settings:{...r,_state:o}}},async push(t,{config:e,rule:n,env:r,data:i,collector:o}){var a,s;const u=Ci(r),c=e.settings||{},l=c._state||{},d=function(t,e,n){return n.analytics?n.analytics:n.loaded?void 0:(n.analytics=Ti(t,e),n.loaded=!0,n.analytics)}(u,c,l);if(!d)return;const f=(null==n?void 0:n.settings)||{},p=function(t,e){const n=e.consent;if(!n||0===Object.keys(n).length)return;const r=t.consent;if(!ir(r))return;const i={};for(const[t,e]of Object.entries(n))t in r&&(i[e]=!0===r[t]);return 0!==Object.keys(i).length?{context:{consent:{categoryPreferences:i}}}:void 0}(t,c);if(void 0!==f.reset){("boolean"==typeof f.reset?f.reset:await lr(t,f.reset,{collector:o}))&&(d.reset(),l.lastIdentity={},l.lastGroup={})}const h=null!=(a=f.identify)?a:c.identify;if(void 0!==h){const e=await lr(t,h,{collector:o});ir(e)&&function(t,e,n,r){var i;const o=n.lastIdentity||{},a=or(e.userId)?e.userId:void 0,s=or(e.anonymousId)?e.anonymousId:void 0,u=ir(e.traits)&&!nr(e.traits)?e.traits:void 0;s&&s!==o.anonymousId&&t.setAnonymousId(s);const c=Di(u),l=a!==o.userId,d=c!==(null!=(i=o.traitsHash)?i:"");(l||void 0!==u&&d||s)&&(r?t.identify(a,u||{},r):t.identify(a,u||{}),n.lastIdentity={userId:a,anonymousId:null!=s?s:o.anonymousId,traitsHash:c})}(d,e,l,p)}const v=null!=(s=f.group)?s:c.group;if(void 0!==v){const e=await lr(t,v,{collector:o});ir(e)&&function(t,e,n,r){var i;const o=or(e.groupId)?e.groupId:void 0;if(!o)return;const a=ir(e.traits)&&!nr(e.traits)?e.traits:void 0,s=n.lastGroup||{},u=Di(a),c=o!==s.groupId,l=u!==(null!=(i=s.traitsHash)?i:"");(c||l)&&(r?t.group(o,a||{},r):t.group(o,a||{}),n.lastGroup={groupId:o,traitsHash:u})}(d,e,l,p)}if(void 0!==f.page&&await async function(t,e,n,r,i){if(!0===e)return void(i?t.page(void 0,void 0,void 0,i):t.page());const o=await lr(n,e,{collector:r});if(!ir(o))return;const a=o,s=or(a.category)?a.category:void 0,u=or(a.name)?a.name:void 0,c=ir(a.properties)&&!nr(a.properties)?a.properties:void 0;i?t.page(null!=s?s:null,null!=u?u:null,null!=c?c:{},i):void 0!==c?t.page(null!=s?s:null,null!=u?u:null,c):void 0!==u||void 0!==s?t.page(null!=s?s:null,null!=u?u:null):t.page()}(d,f.page,t,o,p),!0!==(null==n?void 0:n.skip)){const e=or(null==n?void 0:n.name)?n.name:t.name,r=ir(i)?i:{};p?d.track(e,r,p):d.track(e,r)}c._state=l},on(t,e){var n,r;if("consent"!==t||!e.data)return;const i=e.data,o=null==(n=e.config)?void 0:n.consent;if(!o||0===Object.keys(o).length)return;const a=(null==(r=e.config)?void 0:r.settings)||{},s=a._state||{},u=Ci(e.env);Object.keys(o).every(t=>!0===i[t])&&!s.loaded&&(s.analytics=Ti(u,a),s.loaded=!0,a._state=s)}},qi=Li;return Ri=$n,f(r({},"__esModule",{value:!0}),Ri)})();
|
|
1
|
+
"use strict";var Destination=(()=>{var t,e,n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,u=(t=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(t,{get:(t,e)=>("undefined"!=typeof require?require:t)[e]}):t)(function(t){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),c=(t,e)=>function(){return t&&(e=(0,t[o(t)[0]])(t=0)),e},l=(t,e)=>function(){return e||(0,t[o(t)[0]])((e={exports:{}}).exports,e),e.exports},d=(t,e)=>{for(var n in e)r(t,n,{get:e[n],enumerable:!0})},f=(t,e,n,a)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let u of o(e))s.call(t,u)||u===n||r(t,u,{get:()=>e[u],enumerable:!(a=i(e,u))||a.enumerable});return t},p=(t,e,i)=>(i=null!=t?n(a(t)):{},f(!e&&t&&t.__esModule?i:r(i,"default",{value:t,enumerable:!0}),t));function h(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function v(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function y(t,e,n,r){return new(n||(n=Promise))(function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}u((r=r.apply(t,e||[])).next())})}function m(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function g(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}var b=c({"../../../../node_modules/tslib/tslib.es6.mjs"(){t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)},e=function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)}}}),w=c({"../../../../node_modules/@segment/analytics-core/dist/esm/emitter/interface.js"(){}}),_=c({"../../../../node_modules/@segment/analytics-core/dist/esm/plugins/index.js"(){}}),x=c({"../../../../node_modules/@segment/analytics-core/dist/esm/events/interfaces.js"(){}});function k(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,a=e.length,s=t;o<a&&"__proto__"!=(i=""+e[o++])&&"constructor"!==i&&"prototype"!==i;)s=s[i]=o===a?n:typeof(r=s[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}var j,S,P=c({"../../../../node_modules/dset/dist/index.mjs"(){}}),O=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/pick.js"(){j=function(t,e){return Object.keys(t).filter(function(n){return e(n,t[n])}).reduce(function(e,n){return e[n]=t[n],e},{})}}}),I=c({"../../../../node_modules/@segment/analytics-core/dist/esm/validation/errors.js"(){b(),S=function(t){function e(e,n){var r=t.call(this,"".concat(e," ").concat(n))||this;return r.field=e,r}return h(e,t),e}(Error)}});function A(t){return"string"==typeof t}function E(t){return"number"==typeof t}function M(t){return"function"==typeof t}function N(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var F,C,T,D=c({"../../../../node_modules/@segment/analytics-core/dist/esm/validation/helpers.js"(){}});function R(t){!function(t){if(null==t)throw new S("Event",T);if("object"!=typeof t)throw new S("Event",C)}(t),function(t){if(!A(t.type))throw new S(".type",F)}(t),function(t){if(!A(t.messageId))throw new S(".messageId",F)}(t),"track"===t.type&&(function(t){if(!A(t.event))throw new S(".event",F)}(t),function(t){if(!N(t.properties))throw new S(".properties",C)}(t)),["group","identify"].includes(t.type)&&function(t){if(!N(t.traits))throw new S(".traits",C)}(t)}var L,q,z=c({"../../../../node_modules/@segment/analytics-core/dist/esm/validation/assertions.js"(){I(),D(),F="is not a string",C="is not an object",T="is nil"}}),U=c({"../../../../node_modules/@segment/analytics-core/dist/esm/events/index.js"(){b(),x(),P(),O(),z(),L=function(){return function(t){var e,n;this.settings=t,this.createMessageId=t.createMessageId,this.onEventMethodCall=null!==(e=t.onEventMethodCall)&&void 0!==e?e:function(){},this.onFinishedEvent=null!==(n=t.onFinishedEvent)&&void 0!==n?n:function(){}}}(),q=function(){function t(t){this.settings=new L(t)}return t.prototype.track=function(t,n,r,i){return this.settings.onEventMethodCall({type:"track",options:r}),this.normalize(e(e({},this.baseEvent()),{event:t,type:"track",properties:null!=n?n:{},options:e({},r),integrations:e({},i)}))},t.prototype.page=function(t,n,r,i,o){var a;this.settings.onEventMethodCall({type:"page",options:i});var s={type:"page",properties:e({},r),options:e({},i),integrations:e({},o)};return null!==t&&(s.category=t,s.properties=null!==(a=s.properties)&&void 0!==a?a:{},s.properties.category=t),null!==n&&(s.name=n),this.normalize(e(e({},this.baseEvent()),s))},t.prototype.screen=function(t,n,r,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var a={type:"screen",properties:e({},r),options:e({},i),integrations:e({},o)};return null!==t&&(a.category=t),null!==n&&(a.name=n),this.normalize(e(e({},this.baseEvent()),a))},t.prototype.identify=function(t,n,r,i){return this.settings.onEventMethodCall({type:"identify",options:r}),this.normalize(e(e({},this.baseEvent()),{type:"identify",userId:t,traits:null!=n?n:{},options:e({},r),integrations:i}))},t.prototype.group=function(t,n,r,i){return this.settings.onEventMethodCall({type:"group",options:r}),this.normalize(e(e({},this.baseEvent()),{type:"group",traits:null!=n?n:{},options:e({},r),integrations:e({},i),groupId:t}))},t.prototype.alias=function(t,n,r,i){this.settings.onEventMethodCall({type:"alias",options:r});var o={userId:t,type:"alias",options:e({},r),integrations:e({},i)};return null!==n&&(o.previousId=n),void 0===t?this.normalize(e(e({},o),this.baseEvent())):this.normalize(e(e({},this.baseEvent()),o))},t.prototype.baseEvent=function(){return{integrations:{},options:{}}},t.prototype.context=function(t){var e,n=["userId","anonymousId","timestamp","messageId"];delete t.integrations;var r=Object.keys(t),i=null!==(e=t.context)&&void 0!==e?e:{},o={};return r.forEach(function(e){"context"!==e&&(n.includes(e)?k(o,e,t[e]):k(i,e,t[e]))}),[i,o]},t.prototype.normalize=function(t){var n,r,i=Object.keys(null!==(n=t.integrations)&&void 0!==n?n:{}).reduce(function(n,r){var i,o;return e(e({},n),((i={})[r]=Boolean(null===(o=t.integrations)||void 0===o?void 0:o[r]),i))},{});t.options=j(t.options||{},function(t,e){return void 0!==e});var o=e(e({},i),null===(r=t.options)||void 0===r?void 0:r.integrations),a=t.options?this.context(t.options):[],s=a[0],u=a[1],c=t.options,l=v(t,["options"]),d=e(e(e(e({timestamp:new Date},l),{context:s,integrations:o}),u),{messageId:c.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(d),R(d),d},t}()}});function B(t,e){return new Promise(function(n,r){var i=setTimeout(function(){r(Error("Promise timed out"))},e);t.then(function(t){return clearTimeout(i),n(t)}).catch(r)})}function V(t,e,n){var r;return(r=n,new Promise(function(t){return setTimeout(t,r)})).then(function(){return B(function(){try{return Promise.resolve(e(t))}catch(t){return Promise.reject(t)}}(),1e3)}).catch(function(e){null==t||t.log("warn","Callback Error",{error:e}),null==t||t.stats.increment("callback_error")}).then(function(){return t})}var K,H,J=c({"../../../../node_modules/@segment/analytics-core/dist/esm/callback/index.js"(){}}),G=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/create-deferred/create-deferred.js"(){K=function(){var t,e,n=!1,r=new Promise(function(r,i){t=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n=!0,r.apply(void 0,t)},e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];n=!0,i.apply(void 0,t)}});return{resolve:t,reject:e,promise:r,isSettled:function(){return n}}}}}),W=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/create-deferred/index.js"(){G()}}),Y=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/emitter/emitter.js"(){H=function(){function t(t){var e;this.callbacks={},this.warned=!1,this.maxListeners=null!==(e=null==t?void 0:t.maxListeners)&&void 0!==e?e:10}return t.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)},t.prototype.on=function(t,e){return this.callbacks[t]?(this.callbacks[t].push(e),this.warnIfPossibleMemoryLeak(t)):this.callbacks[t]=[e],this},t.prototype.once=function(t,e){var n=this,r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];n.off(t,r),e.apply(n,i)};return this.on(t,r),this},t.prototype.off=function(t,e){var n,r=(null!==(n=this.callbacks[t])&&void 0!==n?n:[]).filter(function(t){return t!==e});return this.callbacks[t]=r,this},t.prototype.emit=function(t){for(var e,n=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return(null!==(e=this.callbacks[t])&&void 0!==e?e:[]).forEach(function(t){t.apply(n,r)}),this},t}()}}),Q=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/emitter/index.js"(){Y()}}),Z=c({"../../../../node_modules/@segment/analytics-generic-utils/dist/esm/index.js"(){W(),Q()}});var $,X,tt,et,nt,rt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/priority-queue/backoff.js"(){}}),it=c({"../../../../node_modules/@segment/analytics-core/dist/esm/priority-queue/index.js"(){b(),Z(),rt(),$="onRemoveFromFuture",X=function(t){function e(e,n,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=e,i.queue=n,i.seen=null!=r?r:{},i}return h(e,t),e.prototype.push=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.map(function(e){return!(t.updateAttempts(e)>t.maxAttempts||t.includes(e))&&(t.queue.push(e),!0)});return this.queue=this.queue.sort(function(e,n){return t.getAttempts(e)-t.getAttempts(n)}),r},e.prototype.pushWithBackoff=function(t,e){var n=this;if(void 0===e&&(e=0),0==e&&0===this.getAttempts(t))return this.push(t)[0];var r=this.updateAttempts(t);if(r>this.maxAttempts||this.includes(t))return!1;var i=function(t){var e=Math.random()+1,n=t.minTimeout,r=void 0===n?500:n,i=t.factor,o=void 0===i?2:i,a=t.attempt,s=t.maxTimeout,u=void 0===s?1/0:s;return Math.min(e*r*Math.pow(o,a),u)}({attempt:r-1});return e>0&&i<e&&(i=e),setTimeout(function(){n.queue.push(t),n.future=n.future.filter(function(e){return e.id!==t.id}),n.emit($)},i),this.future.push(t),!0},e.prototype.getAttempts=function(t){var e;return null!==(e=this.seen[t.id])&&void 0!==e?e:0},e.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},e.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find(function(e){return e.id===t.id}))||Boolean(this.future.find(function(e){return e.id===t.id}))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(H)}});function ot(){var t,e=0,n="";if(!nt||tt+16>256){for(nt=Array(e=256);e--;)nt[e]=256*Math.random()|0;e=tt=0}for(;e<16;e++)t=nt[tt+e],n+=6==e?et[15&t|64]:8==e?et[63&t|128]:et[t],1&e&&e>1&&e<11&&(n+="-");return tt++,n}var at,st,ut,ct,lt,dt,ft=c({"../../../../node_modules/@lukeed/uuid/dist/index.mjs"(){for(tt=256,et=[];tt--;)et[tt]=(tt+256).toString(16).substring(1)}}),pt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/logger/index.js"(){b(),at=function(){function t(){this._logs=[]}return t.prototype.log=function(t,e,n){var r=new Date;this._logs.push({level:t,message:e,time:r,extras:n})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce(function(t,n){var r,i,o,a=e(e({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete a.time;var s=null!==(o=null===(i=n.time)||void 0===i?void 0:i.toISOString())&&void 0!==o?o:"";return t[s]&&(s="".concat(s,"-").concat(Math.random())),e(e({},t),((r={})[s]=a,r))},{});console.table?console.table(t):console.log(t)}else this.logs.forEach(function(t){var e=t.level,n=t.message,r=t.extras;"info"===e||"debug"===e?console.log(n,null!=r?r:""):console[e](n,null!=r?r:"")});this._logs=[]},t}()}}),ht=c({"../../../../node_modules/@segment/analytics-core/dist/esm/stats/index.js"(){b(),st=function(t){return{gauge:"g",counter:"c"}[t]},ut=function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,e,n){void 0===e&&(e=1),this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,e,n){this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map(function(t){return e(e({},t),{tags:t.tags.join(",")})});console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(t){return{m:t.metric,v:t.value,t:t.tags,k:st(t.type),e:t.timestamp}})},t}(),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.gauge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.increment=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.flush=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},e.prototype.serialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return[]},e}(ut)}}),vt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/context/index.js"(){ft(),P(),pt(),ht(),lt=function(){return function(t){var e,n,r;this.retry=null===(e=t.retry)||void 0===e||e,this.type=null!==(n=t.type)&&void 0!==n?n:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""}}(),dt=function(){function t(t,e,n,r){void 0===e&&(e=ot()),void 0===n&&(n=new ct),void 0===r&&(r=new at),this.attempts=0,this.event=t,this._id=e,this.logger=r,this.stats=n}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new lt({reason:"Context Cancel"})},t.prototype.log=function(t,e,n){this.logger.log(t,e,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,e){var n;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(n=this.event.integrations)||void 0===n?void 0:n[r]))return this.event}return k(this.event,t,e),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}()}});var yt,mt,gt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/group-by.js"(){b()}}),bt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/is-thenable.js"(){yt=function(t){return"object"==typeof t&&null!==t&&"then"in t&&"function"==typeof t.then}}}),wt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/task/task-group.js"(){bt(),mt=function(){var t,e,n=0;return{done:function(){return t},run:function(r){var i=r();return yt(i)&&(1===++n&&(t=new Promise(function(t){return e=t})),i.finally(function(){return 0===--n&&e()})),i}}}}});function _t(t,e){t.log("debug","plugin",{plugin:e.name});var n=(new Date).getTime(),r=e[t.event.type];return void 0===r?Promise.resolve(t):function(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,n.sent()];case 2:return e=n.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}(function(){return r.apply(e,[t])}).then(function(t){var r=(new Date).getTime()-n;return t.stats.gauge("plugin_time",r,["plugin:".concat(e.name)]),t}).catch(function(n){if(n instanceof lt&&"middleware_cancellation"===n.type)throw n;return n instanceof lt?(t.log("warn",n.type,{plugin:e.name,error:n}),n):(t.log("error","plugin Error",{plugin:e.name,error:n}),t.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),n)})}function xt(t,e){return _t(t,e).then(function(e){if(e instanceof dt)return e;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(e)})}var kt,jt,St=c({"../../../../node_modules/@segment/analytics-core/dist/esm/queue/delivery.js"(){b(),vt()}}),Pt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/queue/event-queue.js"(){b(),gt(),it(),vt(),Z(),wt(),St(),kt=function(t){function e(e){var n=t.call(this)||this;return n.criticalTasks=mt(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=e,n.queue.on($,function(){n.scheduleFlush(0)}),n}return h(e,t),e.prototype.register=function(t,e,n){return y(this,void 0,void 0,function(){var r,i,o=this;return m(this,function(a){switch(a.label){case 0:return this.plugins.push(e),r=function(n){o.failedInitializations.push(e.name),o.emit("initialization_failure",e),console.warn(e.name,n),t.log("warn","Failed to load destination",{plugin:e.name,error:n}),o.plugins=o.plugins.filter(function(t){return t!==e})},"destination"!==e.type||"Segment.io"===e.name?[3,1]:(e.load(t,n).catch(r),[3,4]);case 1:return a.trys.push([1,3,,4]),[4,e.load(t,n)];case 2:return a.sent(),[3,4];case 3:return i=a.sent(),r(i),[3,4];case 4:return[2]}})})},e.prototype.deregister=function(t,e,n){return y(this,void 0,void 0,function(){var r;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.unload?[4,Promise.resolve(e.unload(t,n))]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter(function(t){return t.name!==e.name}),[3,4];case 3:return r=i.sent(),t.log("warn","Failed to unload destination",{plugin:e.name,error:r}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),e=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,e]})})},e.prototype.subscribeToDelivery=function(t){return y(this,void 0,void 0,function(){var e=this;return m(this,function(n){return[2,new Promise(function(n){var r=function(i,o){i.isSame(t)&&(e.off("flush",r),n(i))};e.on("flush",r)})]})})},e.prototype.dispatchSingle=function(t){return y(this,void 0,void 0,function(){var e=this;return m(this,function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch(function(n){return e.enqueuRetry(n,t)?e.subscribeToDelivery(t):(t.setFailedDelivery({reason:n}),t)})]})})},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.scheduleFlush=function(t){var e=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout(function(){e.flush().then(function(){setTimeout(function(){e.flushing=!1,e.queue.length&&e.scheduleFlush(0)},0)})},t))},e.prototype.deliver=function(t){return y(this,void 0,void 0,function(){var e,n,r,i;return m(this,function(o){switch(o.label){case 0:return[4,this.criticalTasks.done()];case 1:o.sent(),e=Date.now(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=o.sent(),n=Date.now()-e,this.emit("delivery_success",t),t.stats.gauge("delivered",n),t.log("debug","Delivered",t.event),[2,t];case 4:throw r=o.sent(),i=r,t.log("error","Failed to deliver",i),this.emit("delivery_failure",t,i),t.stats.increment("delivery_failed"),r;case 5:return[2]}})})},e.prototype.enqueuRetry=function(t,e){return!(t instanceof lt&&!t.retry)&&this.queue.pushWithBackoff(e)},e.prototype.flush=function(){return y(this,void 0,void 0,function(){var t,e;return m(this,function(n){switch(n.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=n.sent(),this.emit("flush",t,!0),[3,4];case 3:return e=n.sent(),this.enqueuRetry(e,t)||(t.setFailedDelivery({reason:e}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var e,n,r=this.plugins.filter(function(e){var n,r,i;if("destination"!==e.type&&"Segment.io"!==e.name)return!0;var o=void 0;return null===(n=e.alternativeNames)||void 0===n||n.forEach(function(e){void 0!==t[e]&&(o=t[e])}),null!==(i=null!==(r=t[e.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Segment.io"===e.name||t.All)}),i=(e="type",n={},r.forEach(function(t){var r,i=void 0;if("string"==typeof e){var o=t[e];i="string"!=typeof o?JSON.stringify(o):o}else e instanceof Function&&(i=e(t));void 0!==i&&(n[i]=g(g([],null!==(r=n[i])&&void 0!==r?r:[],!0),[t],!1))}),n),o=i.before,a=void 0===o?[]:o,s=i.enrichment,u=void 0===s?[]:s,c=i.destination,l=void 0===c?[]:c,d=i.after;return{before:a,enrichment:u,destinations:l,after:void 0===d?[]:d}},e.prototype.flushOne=function(t){var e,n;return y(this,void 0,void 0,function(){var r,i,o,a,s,u,c,l,d,f,p,h,v,y;return m(this,function(m){switch(m.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),r=this.availableExtensions(null!==(e=t.event.integrations)&&void 0!==e?e:{}),i=r.before,o=r.enrichment,a=0,s=i,m.label=1;case 1:return a<s.length?(u=s[a],[4,xt(t,u)]):[3,4];case 2:(f=m.sent())instanceof dt&&(t=f),this.emit("message_enriched",t,u),m.label=3;case 3:return a++,[3,1];case 4:c=0,l=o,m.label=5;case 5:return c<l.length?(d=l[c],[4,_t(t,d)]):[3,8];case 6:(f=m.sent())instanceof dt&&(t=f),this.emit("message_enriched",t,d),m.label=7;case 7:return c++,[3,5];case 8:return p=this.availableExtensions(null!==(n=t.event.integrations)&&void 0!==n?n:{}),h=p.destinations,v=p.after,[4,new Promise(function(e,n){setTimeout(function(){var r=h.map(function(e){return _t(t,e)});Promise.all(r).then(e).catch(n)},0)})];case 9:return m.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),y=v.map(function(e){return _t(t,e)}),[4,Promise.all(y)];case 10:return m.sent(),[2,t]}})})},e}(H)}}),Ot=c({"../../../../node_modules/@segment/analytics-core/dist/esm/analytics/index.js"(){}});function It(t,e,n,r){return y(this,void 0,void 0,function(){var i,o;return m(this,function(a){switch(a.label){case 0:return n.emit("dispatch_start",t),i=Date.now(),e.isEmpty()?[4,e.dispatchSingle(t)]:[3,2];case 1:return o=a.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:o=a.sent(),a.label=4;case 4:return(null==r?void 0:r.callback)?[4,V(o,r.callback,jt(i,r.timeout))]:[3,6];case 5:o=a.sent(),a.label=6;case 6:return(null==r?void 0:r.debug)&&o.flush(),[2,o]}})})}var At=c({"../../../../node_modules/@segment/analytics-core/dist/esm/analytics/dispatch.js"(){b(),J(),jt=function(t,e){var n=Date.now()-t;return Math.max((null!=e?e:300)-n,0)}}}),Et=c({"../../../../node_modules/@segment/analytics-core/dist/esm/utils/bind-all.js"(){}}),Mt=c({"../../../../node_modules/@segment/analytics-core/dist/esm/index.js"(){w(),_(),x(),U(),J(),it(),vt(),Pt(),Ot(),At(),D(),I(),z(),Et(),ht(),St()}});function Nt(){return"undefined"!=typeof window}function Ft(){return!Nt()}var Ct=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/environment/index.js"(){}});function Tt(){return!Nt()||window.navigator.onLine}function Dt(){return!Tt()}var Rt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/connection/index.js"(){Ct()}});function Lt(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,n){o.push(e=e.toLowerCase()),a.push([e,n]),s[e]=s[e]?s[e]+","+n:n}),n(u())},i.onerror=r,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)})}var qt,zt,Ut,Bt,Vt=c({"../../../../node_modules/unfetch/dist/unfetch.mjs"(){}}),Kt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/get-global.js"(){qt=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:null}}}),Ht=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/fetch.js"(){Vt(),Kt(),zt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=qt();return(n&&n.fetch||Lt).apply(void 0,t)}}}),Jt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/generated/version.js"(){Ut="1.82.0"}});function Gt(){return Bt}var Wt,Yt,Qt,Zt=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/version-type.js"(){Bt="npm"}}),$t=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/constants/index.js"(){Wt="api.segment.io/v1"}});function Xt(t){console.error("Error sending segment performance metrics",t)}var te,ee,ne,re,ie,oe,ae=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/stats/remote-metrics.js"(){b(),Ht(),Jt(),Zt(),$t(),Yt=function(t,n,r){var i=n.reduce(function(t,e){var n=e.split(":"),r=n[0],i=n[1];return t[r]=i,t},{});return{type:"Counter",metric:t,value:1,tags:e(e({},i),{library:"analytics.js",library_version:"web"===r?"next-".concat(Ut):"npm:next-".concat(Ut)})}},Qt=function(){function t(t){var e,n,r,i,o,a=this;if(this.host=null!==(e=null==t?void 0:t.host)&&void 0!==e?e:Wt,this.sampleRate=null!==(n=null==t?void 0:t.sampleRate)&&void 0!==n?n:1,this.flushTimer=null!==(r=null==t?void 0:t.flushTimer)&&void 0!==r?r:3e4,this.maxQueueSize=null!==(i=null==t?void 0:t.maxQueueSize)&&void 0!==i?i:20,this.protocol=null!==(o=null==t?void 0:t.protocol)&&void 0!==o?o:"https",this.queue=[],this.sampleRate>0){var s=!1,u=function(){s||(s=!0,a.flush().catch(Xt),s=!1,setTimeout(u,a.flushTimer))};u()}}return t.prototype.increment=function(t,e){if(t.includes("analytics_js.")&&0!==e.length&&!(Math.random()>this.sampleRate||this.queue.length>=this.maxQueueSize)){var n=Yt(t,e,Gt());this.queue.push(n),t.includes("error")&&this.flush().catch(Xt)}},t.prototype.flush=function(){return y(this,void 0,void 0,function(){var t=this;return m(this,function(e){switch(e.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(e){Xt(e),t.sampleRate=0})];case 1:return e.sent(),[2]}})})},t.prototype.send=function(){return y(this,void 0,void 0,function(){var t,e,n;return m(this,function(r){return t={series:this.queue},this.queue=[],e={"Content-Type":"text/plain"},n="".concat(this.protocol,"://").concat(this.host,"/m"),[2,zt(n,{headers:e,body:JSON.stringify(t),method:"POST"})]})})},t}()}}),se=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/stats/index.js"(){b(),Mt(),ae(),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.initRemoteMetrics=function(t){te=new Qt(t)},e.prototype.increment=function(e,n,r){t.prototype.increment.call(this,e,n,r),null==te||te.increment(e,null!=r?r:[])},e}(ut)}}),ue=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/context/index.js"(){b(),Mt(),se(),ne=function(t){function e(e,n){return t.call(this,e,n,new ee)||this}return h(e,t),e.system=function(){return new this({type:"track",event:"system"})},e}(dt)}}),ce=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/priority-queue/index.js"(){Mt()}});function le(t){var e=re.getItem(t);return(e?JSON.parse(e):[]).map(function(t){return new ne(t.event,t.id)})}function de(t){var e=re.getItem(t);return e?JSON.parse(e):{}}function fe(t){re.removeItem(t)}function pe(t,e,n){void 0===n&&(n=0);var r,i="persisted-queue:v1:".concat(t,":lock"),o=re.getItem(i),a=o?JSON.parse(o):null,s=null===a||(r=a,(new Date).getTime()>r);if(s)return re.setItem(i,JSON.stringify(ie()+50)),e(),void re.removeItem(i);!s&&n<3?setTimeout(function(){pe(t,e,n+1)},50):console.error("Unable to retrieve lock")}var he,ve=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/priority-queue/persisted.js"(){b(),ce(),ue(),Ct(),re={getItem:function(){},setItem:function(){},removeItem:function(){}};try{re=Nt()&&window.localStorage?window.localStorage:re}catch(t){console.warn("Unable to access localStorage",t)}ie=function(){return(new Date).getTime()},oe=function(t){function n(n,r){var i=t.call(this,n,[])||this,o="persisted-queue:v1:".concat(r,":items"),a="persisted-queue:v1:".concat(r,":seen"),s=[],u={};return pe(r,function(){try{s=le(o),u=de(a),fe(o),fe(a),i.queue=g(g([],s,!0),i.queue,!0),i.seen=e(e({},u),i.seen)}catch(t){console.error(t)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var t=g(g([],i.queue,!0),i.future,!0);try{pe(r,function(){!function(t,n){var r=le(t),i=g(g([],n,!0),r,!0).reduce(function(t,n){var r;return e(e({},t),((r={})[n.id]=n,r))},{});re.setItem(t,JSON.stringify(Object.values(i)))}(o,t),function(t,n){var r=de(t);re.setItem(t,JSON.stringify(e(e({},r),n)))}(a,i.seen)})}catch(t){console.error(t)}}}),i}return h(n,t),n}(X)}});function ye(){return window[he]}var me,ge=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/global-analytics-helper.js"(){he="analytics"}}),be=l({"../../../../node_modules/obj-case/index.js"(t,e){function n(t){return function(e,n,r,i){var a,s=i&&function(t){return"function"==typeof t}(i.normalizer)?i.normalizer:o;n=s(n);for(var u=!1;!u;)c();function c(){for(a in e){var t=s(a);if(0===n.indexOf(t)){var r=n.substr(t.length);if("."===r.charAt(0)||0===r.length){n=r.substr(1);var i=e[a];return null==i?void(u=!0):n.length?void(e=i):void(u=!0)}}}a=void 0,u=!0}if(a)return null==e?e:t(e,a,r)}}function r(t,e){return t.hasOwnProperty(e)&&delete t[e],t}function i(t,e,n){return t.hasOwnProperty(e)&&(t[e]=n),t}function o(t){return t.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}e.exports=n(function(t,e){if(t.hasOwnProperty(e))return t[e]}),e.exports.find=e.exports,e.exports.replace=function(t,e,r,o){return n(i).call(this,t,e,r,o),t},e.exports.del=function(t,e,i){return n(r).call(this,t,e,null,i),t}}}),we=l({"../../../../node_modules/@segment/facade/dist/address.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0});var n=e(be());function r(t,e){return function(){var r=this.traits(),i=this.properties?this.properties():{};return n.default(r,"address."+t)||n.default(r,t)||(e?n.default(r,"address."+e):null)||(e?n.default(r,e):null)||n.default(i,"address."+t)||n.default(i,t)||(e?n.default(i,"address."+e):null)||(e?n.default(i,e):null)}}t.default=function(t){t.zip=r("postalCode","zip"),t.country=r("country"),t.street=r("street"),t.state=r("state"),t.city=r("city"),t.region=r("region")}}}),_e=l({"../../../../node_modules/@segment/facade/dist/clone.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function t(e){if("object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=t(e[r]));return n}return Array.isArray(e)?e.map(t):e}}}),xe=l({"../../../../node_modules/@segment/facade/dist/is-enabled.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e={Salesforce:!0};t.default=function(t){return!e[t]}}}),ke=l({"../../../../node_modules/@segment/isodate/lib/index.js"(t){var e=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;t.parse=function(t){var n=[1,5,6,7,11,12],r=e.exec(t),i=0;if(!r)return new Date(t);for(var o,a=0;o=n[a];a++)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]?i=(new Date).getTimezoneOffset():"Z"!==r[9]&&r[10]&&(i=60*r[11]+r[12],"+"===r[10]&&(i=0-i));var s=Date.UTC(r[1],r[2],r[3],r[5],r[6]+i,r[7],r[8]);return new Date(s)},t.is=function(t,n){return"string"==typeof t&&((!n||!1!==/^\d{4}-\d{2}-\d{2}/.test(t))&&e.test(t))}}}),je=l({"../../../../node_modules/new-date/lib/milliseconds.js"(t){var e=/\d{13}/;t.is=function(t){return e.test(t)},t.parse=function(t){return t=parseInt(t,10),new Date(t)}}}),Se=l({"../../../../node_modules/new-date/lib/seconds.js"(t){var e=/\d{10}/;t.is=function(t){return e.test(t)},t.parse=function(t){var e=1e3*parseInt(t,10);return new Date(e)}}}),Pe=l({"../../../../node_modules/new-date/lib/index.js"(t,e){var n=ke(),r=je(),i=Se(),o=Object.prototype.toString;e.exports=function(t){return e=t,"[object Date]"===o.call(e)?t:function(t){return"[object Number]"===o.call(t)}(t)?new Date((a=t)<315576e5?1e3*a:a):n.is(t)?n.parse(t):r.is(t)?r.parse(t):i.is(t)?i.parse(t):new Date(t);var e,a}}}),Oe=l({"../../../../node_modules/@segment/isodate-traverse/lib/index.js"(t,e){var n=ke();function r(t,e){return void 0===e&&(e=!0),t&&"object"==typeof t?function(t,e){return Object.keys(t).forEach(function(n){t[n]=r(t[n],e)}),t}(t,e):Array.isArray(t)?function(t,e){return t.forEach(function(n,i){t[i]=r(n,e)}),t}(t,e):n.is(t,e)?n.parse(t):t}e.exports=r}}),Ie=l({"../../../../node_modules/@segment/facade/dist/facade.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Facade=void 0;var n=e(we()),r=_e(),i=e(xe()),o=e(Pe()),a=e(be()),s=e(Oe());function u(t,e){e=e||{},this.raw=r.clone(t),"clone"in e||(e.clone=!0),e.clone&&(t=r.clone(t)),"traverse"in e||(e.traverse=!0),t.timestamp="timestamp"in t?o.default(t.timestamp):new Date,e.traverse&&s.default(t),this.opts=e,this.obj=t}t.Facade=u;var c=u.prototype;function l(t){return r.clone(t)}c.proxy=function(t){var e=t.split("."),n=this[t=e.shift()]||this.obj[t];return n?("function"==typeof n&&(n=n.call(this)||{}),0===e.length||(n=a.default(n,e.join("."))),this.opts.clone?l(n):n):n},c.field=function(t){var e=this.obj[t];return this.opts.clone?l(e):e},u.proxy=function(t){return function(){return this.proxy(t)}},u.field=function(t){return function(){return this.field(t)}},u.multi=function(t){return function(){var e=this.proxy(t+"s");if(Array.isArray(e))return e;var n=this.proxy(t);return n&&(n=[this.opts.clone?r.clone(n):n]),n||[]}},u.one=function(t){return function(){var e=this.proxy(t);if(e)return e;var n=this.proxy(t+"s");return Array.isArray(n)?n[0]:void 0}},c.json=function(){var t=this.opts.clone?r.clone(this.obj):this.obj;return this.type&&(t.type=this.type()),t},c.rawEvent=function(){return this.raw},c.options=function(t){var e=this.obj.options||this.obj.context||{},n=this.opts.clone?r.clone(e):e;if(!t)return n;if(this.enabled(t)){var i=this.integrations(),o=i[t]||a.default(i,t);return"object"!=typeof o&&(o=a.default(this.options(),t)),"object"==typeof o?o:{}}},c.context=c.options,c.enabled=function(t){var e=this.proxy("options.providers.all");"boolean"!=typeof e&&(e=this.proxy("options.all")),"boolean"!=typeof e&&(e=this.proxy("integrations.all")),"boolean"!=typeof e&&(e=!0);var n=e&&i.default(t),r=this.integrations();if(r.providers&&r.providers.hasOwnProperty(t)&&(n=r.providers[t]),r.hasOwnProperty(t)){var o=r[t];n="boolean"!=typeof o||o}return!!n},c.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()},c.active=function(){var t=this.proxy("options.active");return null==t&&(t=!0),t},c.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")},c.sessionId=c.anonymousId,c.groupId=u.proxy("options.groupId"),c.traits=function(t){var e=this.proxy("options.traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=null==this[r]?this.proxy("options.traits."+r):this[r]();if(null==i)continue;e[t[r]]=i,delete e[r]}return e},c.library=function(){var t=this.proxy("options.library");return t?"string"==typeof t?{name:t,version:null}:t:{name:"unknown",version:null}},c.device=function(){var t=this.proxy("context.device");"object"==typeof t&&null!==t||(t={});var e=this.library().name;return t.type||(e.indexOf("ios")>-1&&(t.type="ios"),e.indexOf("android")>-1&&(t.type="android")),t},c.userAgent=u.proxy("context.userAgent"),c.timezone=u.proxy("context.timezone"),c.timestamp=u.field("timestamp"),c.channel=u.field("channel"),c.ip=u.proxy("context.ip"),c.userId=u.field("userId"),n.default(c)}}),Ae=l({"../../../../node_modules/inherits/inherits_browser.js"(t,e){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}}}),Ee=l({"../../../../node_modules/inherits/inherits.js"(t,e){try{if("function"!=typeof(n=u("util")).inherits)throw"";e.exports=n.inherits}catch(t){e.exports=Ae()}var n}}),Me=l({"../../../../node_modules/@segment/facade/dist/alias.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Alias=void 0;var n=e(Ee()),r=Ie();function i(t,e){r.Facade.call(this,t,e)}t.Alias=i,n.default(i,r.Facade),i.prototype.action=function(){return"alias"},i.prototype.type=i.prototype.action,i.prototype.previousId=function(){return this.field("previousId")||this.field("from")},i.prototype.from=i.prototype.previousId,i.prototype.userId=function(){return this.field("userId")||this.field("to")},i.prototype.to=i.prototype.userId}}),Ne=l({"../../../../node_modules/@segment/facade/dist/is-email.js"(t){Object.defineProperty(t,"__esModule",{value:!0});var e=/.+\@.+\..+/;t.default=function(t){return e.test(t)}}}),Fe=l({"../../../../node_modules/@segment/facade/dist/group.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Group=void 0;var n=e(Ee()),r=e(Ne()),i=e(Pe()),o=Ie();function a(t,e){o.Facade.call(this,t,e)}t.Group=a,n.default(a,o.Facade);var s=a.prototype;s.action=function(){return"group"},s.type=s.action,s.groupId=o.Facade.field("groupId"),s.created=function(){var t=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(t)return i.default(t)},s.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.groupId();return r.default(e)?e:void 0},s.traits=function(t){var e=this.properties(),n=this.groupId();for(var r in t=t||{},n&&(e.id=n),t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=null==this[r]?this.proxy("traits."+r):this[r]();if(null==i)continue;e[t[r]]=i,delete e[r]}return e},s.name=o.Facade.proxy("traits.name"),s.industry=o.Facade.proxy("traits.industry"),s.employees=o.Facade.proxy("traits.employees"),s.properties=function(){return this.field("traits")||this.field("properties")||{}}}}),Ce=l({"../../../../node_modules/@segment/facade/dist/identify.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Identify=void 0;var n=Ie(),r=e(be()),i=e(Ee()),o=e(Ne()),a=e(Pe()),s=function(t){return t.trim()};function u(t,e){n.Facade.call(this,t,e)}t.Identify=u,i.default(u,n.Facade);var c=u.prototype;c.action=function(){return"identify"},c.type=c.action,c.traits=function(t){var e=this.field("traits")||{},n=this.userId();for(var r in t=t||{},n&&(e.id=n),t){var i=null==this[r]?this.proxy("traits."+r):this[r]();null!=i&&(e[t[r]]=i,r!==t[r]&&delete e[r])}return e},c.email=function(){var t=this.proxy("traits.email");if(t)return t;var e=this.userId();return o.default(e)?e:void 0},c.created=function(){var t=this.proxy("traits.created")||this.proxy("traits.createdAt");if(t)return a.default(t)},c.companyCreated=function(){var t=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(t)return a.default(t)},c.companyName=function(){return this.proxy("traits.company.name")},c.name=function(){var t=this.proxy("traits.name");if("string"==typeof t)return s(t);var e=this.firstName(),n=this.lastName();return e&&n?s(e+" "+n):void 0},c.firstName=function(){var t=this.proxy("traits.firstName");if("string"==typeof t)return s(t);var e=this.proxy("traits.name");return"string"==typeof e?s(e).split(" ")[0]:void 0},c.lastName=function(){var t=this.proxy("traits.lastName");if("string"==typeof t)return s(t);var e=this.proxy("traits.name");if("string"==typeof e){var n=s(e).indexOf(" ");if(-1!==n)return s(e.substr(n+1))}},c.uid=function(){return this.userId()||this.username()||this.email()},c.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")},c.age=function(){var t=this.birthday(),e=r.default(this.traits(),"age");return null!=e?e:t instanceof Date?(new Date).getFullYear()-t.getFullYear():void 0},c.avatar=function(){var t=this.traits();return r.default(t,"avatar")||r.default(t,"photoUrl")||r.default(t,"avatarUrl")},c.position=function(){var t=this.traits();return r.default(t,"position")||r.default(t,"jobTitle")},c.username=n.Facade.proxy("traits.username"),c.website=n.Facade.one("traits.website"),c.websites=n.Facade.multi("traits.website"),c.phone=n.Facade.one("traits.phone"),c.phones=n.Facade.multi("traits.phone"),c.address=n.Facade.proxy("traits.address"),c.gender=n.Facade.proxy("traits.gender"),c.birthday=n.Facade.proxy("traits.birthday")}}),Te=l({"../../../../node_modules/@segment/facade/dist/track.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Track=void 0;var n=e(Ee()),r=Ie(),i=Ce(),o=e(Ne()),a=e(be());function s(t,e){r.Facade.call(this,t,e)}t.Track=s,n.default(s,r.Facade);var u=s.prototype;u.action=function(){return"track"},u.type=u.action,u.event=r.Facade.field("event"),u.value=r.Facade.proxy("properties.value"),u.category=r.Facade.proxy("properties.category"),u.id=r.Facade.proxy("properties.id"),u.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")},u.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")},u.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")},u.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")},u.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")},u.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")},u.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")},u.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")},u.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")},u.sku=r.Facade.proxy("properties.sku"),u.tax=r.Facade.proxy("properties.tax"),u.name=r.Facade.proxy("properties.name"),u.price=r.Facade.proxy("properties.price"),u.total=r.Facade.proxy("properties.total"),u.repeat=r.Facade.proxy("properties.repeat"),u.coupon=r.Facade.proxy("properties.coupon"),u.shipping=r.Facade.proxy("properties.shipping"),u.discount=r.Facade.proxy("properties.discount"),u.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")},u.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")},u.description=r.Facade.proxy("properties.description"),u.plan=r.Facade.proxy("properties.plan"),u.subtotal=function(){var t=a.default(this.properties(),"subtotal"),e=this.total()||this.revenue();if(t)return t;if(!e)return 0;if(this.total()){var n=this.tax();n&&(e-=n),(n=this.shipping())&&(e-=n),(n=this.discount())&&(e+=n)}return e},u.products=function(){var t=this.properties(),e=a.default(t,"products");return Array.isArray(e)?e.filter(function(t){return null!==t}):[]},u.quantity=function(){return(this.obj.properties||{}).quantity||1},u.currency=function(){return(this.obj.properties||{}).currency||"USD"},u.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},u.query=r.Facade.proxy("options.query"),u.properties=function(t){var e=this.field("properties")||{};for(var n in t=t||{})if(Object.prototype.hasOwnProperty.call(t,n)){var r=null==this[n]?this.proxy("properties."+n):this[n]();if(null==r)continue;e[t[n]]=r,delete e[n]}return e},u.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()},u.email=function(){var t=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(t)return t;var e=this.userId();return o.default(e)?e:void 0},u.revenue=function(){var t=this.proxy("properties.revenue"),e=this.event();return!t&&e&&e.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(t=this.proxy("properties.total")),function(t){if(!t)return;if("number"==typeof t)return t;if("string"!=typeof t)return;if(t=t.replace(/\$/g,""),t=parseFloat(t),!isNaN(t))return t}(t)},u.cents=function(){var t=this.revenue();return"number"!=typeof t?this.value()||0:100*t},u.identify=function(){var t=this.json();return t.traits=this.traits(),new i.Identify(t,this.opts)}}}),De=l({"../../../../node_modules/@segment/facade/dist/page.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Page=void 0;var n=e(Ee()),r=Ie(),i=Te(),o=e(Ne());function a(t,e){r.Facade.call(this,t,e)}t.Page=a,n.default(a,r.Facade);var s=a.prototype;s.action=function(){return"page"},s.type=s.action,s.category=r.Facade.field("category"),s.name=r.Facade.field("name"),s.title=r.Facade.proxy("properties.title"),s.path=r.Facade.proxy("properties.path"),s.url=r.Facade.proxy("properties.url"),s.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},s.properties=function(t){var e=this.field("properties")||{},n=this.category(),r=this.name();for(var i in t=t||{},n&&(e.category=n),r&&(e.name=r),t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=null==this[i]?this.proxy("properties."+i):this[i]();if(null==o)continue;e[t[i]]=o,i!==t[i]&&delete e[i]}return e},s.email=function(){var t=this.proxy("context.traits.email")||this.proxy("properties.email");if(t)return t;var e=this.userId();return o.default(e)?e:void 0},s.fullName=function(){var t=this.category(),e=this.name();return e&&t?t+" "+e:e},s.event=function(t){return t?"Viewed "+t+" Page":"Loaded a Page"},s.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new i.Track(e,this.opts)}}}),Re=l({"../../../../node_modules/@segment/facade/dist/screen.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Screen=void 0;var n=e(Ee()),r=De(),i=Te();function o(t,e){r.Page.call(this,t,e)}t.Screen=o,n.default(o,r.Page),o.prototype.action=function(){return"screen"},o.prototype.type=o.prototype.action,o.prototype.event=function(t){return t?"Viewed "+t+" Screen":"Loaded a Screen"},o.prototype.track=function(t){var e=this.json();return e.event=this.event(t),e.timestamp=this.timestamp(),e.properties=this.properties(),new i.Track(e,this.opts)}}}),Le=l({"../../../../node_modules/@segment/facade/dist/delete.js"(t){var e=t&&t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t,"__esModule",{value:!0}),t.Delete=void 0;var n=e(Ee()),r=Ie();function i(t,e){r.Facade.call(this,t,e)}t.Delete=i,n.default(i,r.Facade),i.prototype.type=function(){return"delete"}}}),qe=l({"../../../../node_modules/@segment/facade/dist/index.js"(t){var e=t&&t.__assign||function(){return e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},e.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Delete=t.Screen=t.Page=t.Track=t.Identify=t.Group=t.Alias=t.Facade=void 0;var n=Ie();Object.defineProperty(t,"Facade",{enumerable:!0,get:function(){return n.Facade}});var r=Me();Object.defineProperty(t,"Alias",{enumerable:!0,get:function(){return r.Alias}});var i=Fe();Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Ce();Object.defineProperty(t,"Identify",{enumerable:!0,get:function(){return o.Identify}});var a=Te();Object.defineProperty(t,"Track",{enumerable:!0,get:function(){return a.Track}});var s=De();Object.defineProperty(t,"Page",{enumerable:!0,get:function(){return s.Page}});var u=Re();Object.defineProperty(t,"Screen",{enumerable:!0,get:function(){return u.Screen}});var c=Le();Object.defineProperty(t,"Delete",{enumerable:!0,get:function(){return c.Delete}}),t.default=e(e({},n.Facade),{Alias:r.Alias,Group:i.Group,Identify:o.Identify,Track:a.Track,Page:s.Page,Screen:u.Screen,Delete:c.Delete})}});function ze(t,e){var n=new me.Facade(t,e);return"track"===t.type&&(n=new me.Track(t,e)),"identify"===t.type&&(n=new me.Identify(t,e)),"page"===t.type&&(n=new me.Page(t,e)),"alias"===t.type&&(n=new me.Alias(t,e)),"group"===t.type&&(n=new me.Group(t,e)),"screen"===t.type&&(n=new me.Screen(t,e)),Object.defineProperty(n,"obj",{value:t,writable:!0}),n}var Ue,Be=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/to-facade.js"(){me=p(qe())}}),Ve=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/p-while.js"(){b(),Ue=function(t,e){return y(void 0,void 0,void 0,function(){var n;return m(this,function(r){return[2,(n=function(r){return y(void 0,void 0,void 0,function(){var i;return m(this,function(o){switch(o.label){case 0:return t(r)?(i=n,[4,e()]):[3,2];case 1:return[2,i.apply(void 0,[o.sent()])];case 2:return[2]}})})})(void 0)]})})}}}),Ke=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/callback/index.js"(){Mt()}}),He={};function Je(t,e,n,r){var i=this;return t?((t instanceof Element?[t]:"toArray"in t?t.toArray():t).forEach(function(t){t.addEventListener("click",function(o){var a,s,u=e instanceof Function?e(t):e,c=n instanceof Function?n(t):n,l=t.getAttribute("href")||t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("xlink:href")||(null===(a=t.getElementsByTagName("a")[0])||void 0===a?void 0:a.getAttribute("href")),d=B(i.track(u,c,null!=r?r:{}),null!==(s=i.settings.timeout)&&void 0!==s?s:500);(function(t,e){return!("_blank"!==t.target||!e)})(t,l)||function(t){var e=t;return!!(e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1==e.button)}(o)||l&&(o.preventDefault?o.preventDefault():o.returnValue=!1,d.catch(console.error).then(function(){window.location.href=l}).catch(console.error))},!1)}),this):this}function Ge(t,e,n,r){var i=this;return t?(t instanceof HTMLFormElement&&(t=[t]),t.forEach(function(t){if(!(t instanceof Element))throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");var o=function(o){var a;o.preventDefault?o.preventDefault():o.returnValue=!1;var s=e instanceof Function?e(t):e,u=n instanceof Function?n(t):n;B(i.track(s,u,null!=r?r:{}),null!==(a=i.settings.timeout)&&void 0!==a?a:500).catch(console.error).then(function(){t.submit()}).catch(console.error)},a=window.jQuery||window.Zepto;a?a(t).submit(o):t.addEventListener("submit",o,!1)}),this):this}d(He,{form:()=>Ge,link:()=>Je});var We=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/auto-track.js"(){Ke()}}),Ye={};function Qe(t,n,r){return y(this,void 0,void 0,function(){function i(n,r){return y(this,void 0,void 0,function(){var i,o,a;return m(this,function(s){switch(s.label){case 0:return i=!1,o=null,[4,r({payload:ze(n,{clone:!0,traverse:!1}),integration:t,next:function(t){i=!0,null===t&&(o=null),t&&(o=t.obj)}})];case 1:return s.sent(),i||null===o||(o.integrations=e(e({},n.integrations),((a={})[t]=!1,a))),[2,o]}})})}var o,a,s,u,c;return m(this,function(t){switch(t.label){case 0:o=ze(n,{clone:!0,traverse:!1}).rawEvent(),a=0,s=r,t.label=1;case 1:return a<s.length?(u=s[a],[4,i(o,u)]):[3,4];case 2:if(null===(c=t.sent()))return[2,null];o=c,t.label=3;case 3:return a++,[3,1];case 4:return[2,o]}})})}function Ze(t,e){function n(n){return y(this,void 0,void 0,function(){var r;return m(this,function(i){switch(i.label){case 0:return r=!1,[4,t({payload:ze(n.event,{clone:!0,traverse:!1}),integrations:null!=e?e:{},next:function(t){r=!0,t&&(n.event=t.obj)}})];case 1:if(i.sent(),!r)throw new lt({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(t){return Promise.resolve(t)},track:n,page:n,screen:n,identify:n,alias:n,group:n}}d(Ye,{applyDestinationMiddleware:()=>Qe,sourceMiddlewarePlugin:()=>Ze});var $e=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/middleware/index.js"(){b(),ue(),Be()}});function Xe(t,e){return Object.keys(e).reduce(function(n,r){r.startsWith(t)&&(n[r.substr(t.length)]=e[r]);return n},{})}var tn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/query-string/pickPrefix.js"(){}});function en(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t}}var nn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/query-string/gracefulDecodeURIComponent.js"(){}}),rn={};function on(t,e){var n=document.createElement("a");n.href=e;var r=n.search.slice(1).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1];return t[r]=en(i),t},{}),i=[],o=r.ajs_uid,a=r.ajs_event,s=r.ajs_aid,u=N(t.options.useQueryString)?t.options.useQueryString:{},c=u.aid,l=void 0===c?/.+/:c,d=u.uid,f=void 0===d?/.+/:d;if(s){var p=Array.isArray(r.ajs_aid)?r.ajs_aid[0]:r.ajs_aid;l.test(p)&&t.setAnonymousId(p)}if(o){var h=Array.isArray(r.ajs_uid)?r.ajs_uid[0]:r.ajs_uid;if(f.test(h)){var v=Xe("ajs_trait_",r);i.push(t.identify(h,v))}}if(a){var y=Array.isArray(r.ajs_event)?r.ajs_event[0]:r.ajs_event,m=Xe("ajs_prop_",r);i.push(t.track(y,m))}return Promise.all(i)}d(rn,{queryString:()=>on});var an,sn,un,cn,ln,dn,fn,pn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/query-string/index.js"(){tn(),nn(),Mt()}}),hn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/parse-cdn.js"(){ge(),an=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,sn=function(){var t;return Array.prototype.slice.call(document.querySelectorAll("script")).forEach(function(e){var n,r=null!==(n=e.getAttribute("src"))&&void 0!==n?n:"",i=an.exec(r);i&&i[1]&&(t=i[1])}),t},cn=function(){var t;return null!=un?un:null===(t=ye())||void 0===t?void 0:t._cdn},ln=function(t){var e=ye();e&&(e._cdn=t),un=t},dn=function(){var t=cn();if(t)return t;var e=sn();return e||"https://cdn.segment.com"},fn=function(){var t=dn();return"".concat(t,"/next-integrations")}}});function vn(t,n){var r,i=Object.entries(null!==(r=n.integrations)&&void 0!==r?r:{}).reduce(function(t,n){var r,i,o=n[0],a=n[1];return e(e({},t),"object"==typeof a?((r={})[o]=a,r):((i={})[o]={},i))},{});return Object.entries(t.integrations).reduce(function(t,n){var r,o=n[0],a=n[1];return e(e({},t),((r={})[o]=e(e({},a),i[o]),r))},{})}var yn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/merged-options.js"(){b()}});function mn(t){return Array.prototype.slice.call(window.document.querySelectorAll("script")).find(function(e){return e.src===t})}function gn(t,e){var n=mn(t);if(void 0!==n){var r=null==n?void 0:n.getAttribute("status");if("loaded"===r)return Promise.resolve(n);if("loading"===r)return new Promise(function(t,e){n.addEventListener("load",function(){return t(n)}),n.addEventListener("error",function(t){return e(t)})})}return new Promise(function(n,r){var i,o=window.document.createElement("script");o.type="text/javascript",o.src=t,o.async=!0,o.setAttribute("status","loading");for(var a=0,s=Object.entries(null!=e?e:{});a<s.length;a++){var u=s[a],c=u[0],l=u[1];o.setAttribute(c,l)}o.onload=function(){o.onerror=o.onload=null,o.setAttribute("status","loaded"),n(o)},o.onerror=function(){o.onerror=o.onload=null,o.setAttribute("status","error"),r(new Error("Failed to load ".concat(t)))};var d=window.document.querySelector("script");d?null===(i=d.parentElement)||void 0===i||i.insertBefore(o,d):window.document.head.appendChild(o)})}var bn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/load-script.js"(){}});function wn(t,e){var n=e.methodName,r=e.integrationName,i=e.type,o=e.didError,a=void 0!==o&&o;t.stats.increment("analytics_js.integration.invoke".concat(a?".error":""),1,["method:".concat(n),"integration_name:".concat(r),"type:".concat(i)])}var _n,xn,kn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/core/stats/metric-helpers.js"(){}}),jn=l({"../../../../node_modules/@segment/analytics-next/dist/pkg/vendor/tsub/tsub.js"(t,e){!function(n,r){if("object"==typeof t&&"object"==typeof e)e.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var i=r();for(var o in i)("object"==typeof t?t:n)[o]=i[o]}}(self,function(){return function(){var t={2870:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Store=e.matches=e.transform=void 0;var i=n(4303);Object.defineProperty(e,"transform",{enumerable:!0,get:function(){return r(i).default}});var o=n(2370);Object.defineProperty(e,"matches",{enumerable:!0,get:function(){return r(o).default}});var a=n(1444);Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return r(a).default}})},2370:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(7843));function o(t,e){if(!Array.isArray(t))return!0===a(t,e);var n,r,i,l,d,f,p,h=t[0];switch(h){case"!":return!o(t[1],e);case"or":for(var v=1;v<t.length;v++)if(o(t[v],e))return!0;return!1;case"and":for(v=1;v<t.length;v++)if(!o(t[v],e))return!1;return!0;case"=":case"!=":return function(t,e,n,r){switch(s(t)&&(t=o(t,r)),s(e)&&(e=o(e,r)),"object"==typeof t&&"object"==typeof e&&(t=JSON.stringify(t),e=JSON.stringify(e)),n){case"=":return t===e;case"!=":return t!==e;default:throw new Error("Invalid operator in compareItems: ".concat(n))}}(a(t[1],e),a(t[2],e),h,e);case"<=":case"<":case">":case">=":return function(t,e,n,r){if(s(t)&&(t=o(t,r)),s(e)&&(e=o(e,r)),"number"!=typeof t||"number"!=typeof e)return!1;switch(n){case"<=":return t<=e;case">=":return t>=e;case"<":return t<e;case">":return t>e;default:throw new Error("Invalid operator in compareNumbers: ".concat(n))}}(a(t[1],e),a(t[2],e),h,e);case"in":return d=a(t[1],e),f=a(t[2],e),p=e,void 0!==f.find(function(t){return a(t,p)===d});case"contains":return i=a(t[1],e),l=a(t[2],e),"string"==typeof i&&"string"==typeof l&&-1!==i.indexOf(l);case"match":return n=a(t[1],e),r=a(t[2],e),"string"==typeof n&&"string"==typeof r&&function(t,e){var n,r;t:for(;t.length>0;){var i,o;if(i=(n=u(t)).star,o=n.chunk,t=n.pattern,i&&""===o)return!0;var a=c(o,e),s=a.t,l=a.ok,d=a.err;if(d)return!1;if(!l||!(0===s.length||t.length>0)){if(i)for(var f=0;f<e.length;f++){if(s=(r=c(o,e.slice(f+1))).t,l=r.ok,d=r.err,l){if(0===t.length&&s.length>0)continue;e=s;continue t}if(d)return!1}return!1}e=s}return 0===e.length}(r,n);case"lowercase":var y=a(t[1],e);return"string"!=typeof y?null:y.toLowerCase();case"typeof":return typeof a(t[1],e);case"length":return function(t){return null===t?0:Array.isArray(t)||"string"==typeof t?t.length:NaN}(a(t[1],e));default:throw new Error("FQL IR could not evaluate for token: ".concat(h))}}function a(t,e){return Array.isArray(t)?t:"object"==typeof t?t.value:(0,i.default)(e,t)}function s(t){return!!Array.isArray(t)&&(("lowercase"===t[0]||"length"===t[0]||"typeof"===t[0])&&2===t.length||("contains"===t[0]||"match"===t[0])&&3===t.length)}function u(t){for(var e={star:!1,chunk:"",pattern:""};t.length>0&&"*"===t[0];)t=t.slice(1),e.star=!0;var n,r=!1;t:for(n=0;n<t.length;n++)switch(t[n]){case"\\":n+1<t.length&&n++;break;case"[":r=!0;break;case"]":r=!1;break;case"*":if(!r)break t}return e.chunk=t.slice(0,n),e.pattern=t.slice(n),e}function c(t,e){for(var n,r,i={t:"",ok:!1,err:!1};t.length>0;){if(0===e.length)return i;switch(t[0]){case"[":var o=e[0];e=e.slice(1);var a=!0;(t=t.slice(1)).length>0&&"^"===t[0]&&(a=!1,t=t.slice(1));for(var s=!1,u=0;;){if(t.length>0&&"]"===t[0]&&u>0){t=t.slice(1);break}var c,d="";if(c=(n=l(t)).char,t=n.newChunk,n.err)return i;if(d=c,"-"===t[0]&&(d=(r=l(t.slice(1))).char,t=r.newChunk,r.err))return i;c<=o&&o<=d&&(s=!0),u++}if(s!==a)return i;break;case"?":e=e.slice(1),t=t.slice(1);break;case"\\":if(0===(t=t.slice(1)).length)return i.err=!0,i;default:if(t[0]!==e[0])return i;e=e.slice(1),t=t.slice(1)}}return i.t=e,i.ok=!0,i.err=!1,i}function l(t){var e={char:"",newChunk:"",err:!1};return 0===t.length||"-"===t[0]||"]"===t[0]||"\\"===t[0]&&0===(t=t.slice(1)).length?(e.err=!0,e):(e.char=t[0],e.newChunk=t.slice(1),0===e.newChunk.length&&(e.err=!0),e)}e.default=function(t,e){if(!e)throw new Error("No matcher supplied!");switch(e.type){case"all":return!0;case"fql":return function(t,e){if(!t)return!1;try{t=JSON.parse(t)}catch(e){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(t,'": ').concat(e))}var n=o(t,e);return"boolean"==typeof n&&n}(e.ir,t);default:throw new Error("Matcher of type ".concat(e.type," unsupported."))}}},1444:function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.rules=[],this.rules=t||[]}return t.prototype.getRulesByDestinationName=function(t){for(var e=[],n=0,r=this.rules;n<r.length;n++){var i=r[n];i.destinationName!==t&&void 0!==i.destinationName||e.push(i)}return e},t}();e.default=n},4303:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(n(374)),o=r(n(7843)),a=r(n(5500)),s=n(9014),u=n(4966);function c(t,e){d(t,e.drop,function(t,e){e.forEach(function(e){return delete t[e]})})}function l(t,e){d(t,e.allow,function(t,e){Object.keys(t).forEach(function(n){e.includes(n)||delete t[n]})})}function d(t,e,n){Object.entries(e).forEach(function(e){var r=e[0],i=e[1],a=function(t){"object"==typeof t&&null!==t&&n(t,i)},s=""===r?t:(0,o.default)(t,r);Array.isArray(s)?s.forEach(a):a(s)})}function f(t,e){var n=JSON.parse(JSON.stringify(t));for(var r in e.map)if(e.map.hasOwnProperty(r)){var i=e.map[r],a=r.split("."),c=void 0;if(a.length>1?(a.pop(),c=(0,o.default)(n,a.join("."))):c=t,"object"==typeof c){if(i.copy){var l=(0,o.default)(n,i.copy);void 0!==l&&(0,s.dset)(t,r,l)}else if(i.move){var d=(0,o.default)(n,i.move);void 0!==d&&(0,s.dset)(t,r,d),(0,u.unset)(t,i.move)}else i.hasOwnProperty("set")&&(0,s.dset)(t,r,i.set);if(i.to_string){var f=(0,o.default)(t,r);if("string"==typeof f||"object"==typeof f&&null!==f)continue;void 0!==f?(0,s.dset)(t,r,JSON.stringify(f)):(0,s.dset)(t,r,"undefined")}}}}function p(t,e){return!(e.sample.percent<=0)&&(e.sample.percent>=1||(e.sample.path?function(t,e){var n=(0,o.default)(t,e.sample.path),r=(0,i.default)(JSON.stringify(n)),s=-64,u=[];h(r.slice(0,8),u);for(var c=0,l=0;l<64&&1!==u[l];l++)c++;if(0!==c){var d=[];h(r.slice(9,16),d),s-=c,u.splice(0,c),d.splice(64-c),u=u.concat(d)}return u[63]=0===u[63]?1:0,(0,a.default)(parseInt(u.join(""),2),s)<e.sample.percent}(t,e):(n=e.sample.percent,Math.random()<=n)));var n}function h(t,e){for(var n=0;n<8;n++)for(var r=t[n],i=128;i>=1;i/=2)r-i>=0?(r-=i,e.push(1)):e.push(0)}e.default=function(t,e){for(var n=t,r=0,i=e;r<i.length;r++){var o=i[r];switch(o.type){case"drop":return null;case"drop_properties":c(n,o.config);break;case"allow_properties":l(n,o.config);break;case"sample_event":if(p(n,o.config))break;return null;case"map_properties":f(n,o.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(o.type,'" is unsupported.'))}}return n}},4966:function(t,e,n){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.unset=void 0;var i=r(n(7843));e.unset=function(t,e){if((0,i.default)(t,e)){for(var n=e.split("."),r=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)r=n.pop().slice(0,-1)+"."+r;for(;n.length;)t=t[e=n.shift()];return delete t[r]}return!0}},9014:function(t,e){e.dset=function(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,a=e.length,s=t;o<a&&"__proto__"!==(i=e[o++])&&"constructor"!==i&&"prototype"!==i;)s=s[i]=o===a?n:typeof(r=s[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}},3304:function(t){var e="function"==typeof Float64Array?Float64Array:void 0;t.exports=e},7382:function(t,e,n){var r,i=n(5569),o=n(3304),a=n(8482);r=i()?o:a,t.exports=r},8482:function(t){t.exports=function(){throw new Error("not implemented")}},6322:function(t,e,n){var r,i=n(2508),o=n(5679),a=n(882);r=i()?o:a,t.exports=r},882:function(t){t.exports=function(){throw new Error("not implemented")}},5679:function(t){var e="function"==typeof Uint16Array?Uint16Array:void 0;t.exports=e},4773:function(t,e,n){var r,i=n(9773),o=n(3004),a=n(3078);r=i()?o:a,t.exports=r},3078:function(t){t.exports=function(){throw new Error("not implemented")}},3004:function(t){var e="function"==typeof Uint32Array?Uint32Array:void 0;t.exports=e},7980:function(t,e,n){var r,i=n(8114),o=n(6737),a=n(3357);r=i()?o:a,t.exports=r},3357:function(t){t.exports=function(){throw new Error("not implemented")}},6737:function(t){var e="function"==typeof Uint8Array?Uint8Array:void 0;t.exports=e},2684:function(t){var e="function"==typeof Float64Array?Float64Array:null;t.exports=e},5569:function(t,e,n){var r=n(3876);t.exports=r},3876:function(t,e,n){var r=n(1448),i=n(2684);t.exports=function(){var t,e;if("function"!=typeof i)return!1;try{e=new i([1,3.14,-3.14,NaN]),t=r(e)&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){t=!1}return t}},9048:function(t,e,n){var r=n(3763);t.exports=r},3763:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t,n){return null!=t&&e.call(t,n)}},7009:function(t,e,n){var r=n(6784);t.exports=r},6784:function(t){t.exports=function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}},3123:function(t,e,n){var r=n(8481);t.exports=r},8481:function(t,e,n){var r=n(7009)();t.exports=function(){return r&&"symbol"==typeof Symbol.toStringTag}},2508:function(t,e,n){var r=n(3403);t.exports=r},3403:function(t,e,n){var r=n(768),i=n(9668),o=n(187);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},187:function(t){var e="function"==typeof Uint16Array?Uint16Array:null;t.exports=e},9773:function(t,e,n){var r=n(2822);t.exports=r},2822:function(t,e,n){var r=n(2744),i=n(3899),o=n(746);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},746:function(t){var e="function"==typeof Uint32Array?Uint32Array:null;t.exports=e},8114:function(t,e,n){var r=n(8066);t.exports=r},8066:function(t,e,n){var r=n(8279),i=n(3443),o=n(2731);t.exports=function(){var t,e;if("function"!=typeof o)return!1;try{e=new o(e=[1,3.14,-3.14,i+1,i+2]),t=r(e)&&1===e[0]&&3===e[1]&&e[2]===i-2&&0===e[3]&&1===e[4]}catch(e){t=!1}return t}},2731:function(t){var e="function"==typeof Uint8Array?Uint8Array:null;t.exports=e},1448:function(t,e,n){var r=n(1453);t.exports=r},1453:function(t,e,n){var r=n(6208),i="function"==typeof Float64Array;t.exports=function(t){return i&&t instanceof Float64Array||"[object Float64Array]"===r(t)}},9331:function(t,e,n){var r=n(7980),i={uint16:n(6322),uint8:r};t.exports=i},5902:function(t,e,n){var r=n(4106);t.exports=r},4106:function(t,e,n){var r,i,o=n(9331);(i=new o.uint16(1))[0]=4660,r=52===new o.uint8(i.buffer)[0],t.exports=r},768:function(t,e,n){var r=n(3823);t.exports=r},3823:function(t,e,n){var r=n(6208),i="function"==typeof Uint16Array;t.exports=function(t){return i&&t instanceof Uint16Array||"[object Uint16Array]"===r(t)}},2744:function(t,e,n){var r=n(2326);t.exports=r},2326:function(t,e,n){var r=n(6208),i="function"==typeof Uint32Array;t.exports=function(t){return i&&t instanceof Uint32Array||"[object Uint32Array]"===r(t)}},8279:function(t,e,n){var r=n(208);t.exports=r},208:function(t,e,n){var r=n(6208),i="function"==typeof Uint8Array;t.exports=function(t){return i&&t instanceof Uint8Array||"[object Uint8Array]"===r(t)}},6315:function(t){t.exports=1023},1686:function(t){t.exports=2147483647},3105:function(t){t.exports=2146435072},3449:function(t){t.exports=2147483648},6988:function(t){t.exports=-1023},9777:function(t){t.exports=1023},3690:function(t){t.exports=-1074},2918:function(t,e,n){var r=n(4772).NEGATIVE_INFINITY;t.exports=r},4165:function(t){var e=Number.POSITIVE_INFINITY;t.exports=e},6488:function(t){t.exports=22250738585072014e-324},9668:function(t){t.exports=65535},3899:function(t){t.exports=4294967295},3443:function(t){t.exports=255},7011:function(t,e,n){var r=n(812);t.exports=r},812:function(t,e,n){var r=n(4165),i=n(2918);t.exports=function(t){return t===r||t===i}},1883:function(t,e,n){var r=n(1797);t.exports=r},1797:function(t){t.exports=function(t){return t!=t}},513:function(t,e,n){var r=n(5760);t.exports=r},5760:function(t){t.exports=function(t){return Math.abs(t)}},5848:function(t,e,n){var r=n(677);t.exports=r},677:function(t,e,n){var r=n(3449),i=n(1686),o=n(7838),a=n(1921),s=n(2490),u=[0,0];t.exports=function(t,e){var n,c;return o.assign(t,u,1,0),n=u[0],n&=i,c=a(e),s(n|=c&=r,u[1])}},5500:function(t,e,n){var r=n(8397);t.exports=r},8397:function(t,e,n){var r=n(4165),i=n(2918),o=n(6315),a=n(9777),s=n(6988),u=n(3690),c=n(1883),l=n(7011),d=n(5848),f=n(4948),p=n(8478),h=n(7838),v=n(2490),y=[0,0],m=[0,0];t.exports=function(t,e){var n,g;return 0===t||c(t)||l(t)?t:(f(y,t),e+=y[1],(e+=p(t=y[0]))<u?d(0,t):e>a?t<0?i:r:(e<=s?(e+=52,g=2220446049250313e-31):g=1,h(m,t),n=m[0],n&=2148532223,g*v(n|=e+o<<20,m[1])))}},4772:function(t,e,n){var r=n(7548);t.exports=r},7548:function(t){t.exports=Number},8478:function(t,e,n){var r=n(4500);t.exports=r},4500:function(t,e,n){var r=n(1921),i=n(3105),o=n(6315);t.exports=function(t){var e=r(t);return(e=(e&i)>>>20)-o|0}},2490:function(t,e,n){var r=n(9639);t.exports=r},4445:function(t,e,n){var r,i,o;!0===n(5902)?(i=1,o=0):(i=0,o=1),r={HIGH:i,LOW:o},t.exports=r},9639:function(t,e,n){var r=n(4773),i=n(7382),o=n(4445),a=new i(1),s=new r(a.buffer),u=o.HIGH,c=o.LOW;t.exports=function(t,e){return s[u]=t,s[c]=e,a[0]}},5646:function(t,e,n){var r;r=!0===n(5902)?1:0,t.exports=r},1921:function(t,e,n){var r=n(6285);t.exports=r},6285:function(t,e,n){var r=n(4773),i=n(7382),o=n(5646),a=new i(1),s=new r(a.buffer);t.exports=function(t){return a[0]=t,s[o]}},9024:function(t,e,n){var r=n(6488),i=n(7011),o=n(1883),a=n(513);t.exports=function(t,e,n,s){return o(t)||i(t)?(e[s]=t,e[s+n]=0,e):0!==t&&a(t)<r?(e[s]=4503599627370496*t,e[s+n]=-52,e):(e[s]=t,e[s+n]=0,e)}},4948:function(t,e,n){var r=n(7576),i=n(9422);r(i,"assign",n(9024)),t.exports=i},9422:function(t,e,n){var r=n(9024);t.exports=function(t){return r(t,[0,0],1,0)}},5239:function(t,e,n){var r=n(4773),i=n(7382),o=n(5782),a=new i(1),s=new r(a.buffer),u=o.HIGH,c=o.LOW;t.exports=function(t,e,n,r){return a[0]=t,e[r]=s[u],e[r+n]=s[c],e}},7838:function(t,e,n){var r=n(7576),i=n(4010);r(i,"assign",n(5239)),t.exports=i},5782:function(t,e,n){var r,i,o;!0===n(5902)?(i=1,o=0):(i=0,o=1),r={HIGH:i,LOW:o},t.exports=r},4010:function(t,e,n){var r=n(5239);t.exports=function(t){return r(t,[0,0],1,0)}},7576:function(t,e,n){var r=n(7063);t.exports=r},7063:function(t,e,n){var r=n(6691);t.exports=function(t,e,n){r(t,e,{configurable:!1,enumerable:!1,writable:!1,value:n})}},2073:function(t){var e=Object.defineProperty;t.exports=e},1680:function(t){var e="function"==typeof Object.defineProperty?Object.defineProperty:null;t.exports=e},1471:function(t,e,n){var r=n(1680);t.exports=function(){try{return r({},"x",{}),!0}catch(t){return!1}}},6691:function(t,e,n){var r,i=n(1471),o=n(2073),a=n(1309);r=i()?o:a,t.exports=r},1309:function(t){var e=Object.prototype,n=e.toString,r=e.__defineGetter__,i=e.__defineSetter__,o=e.__lookupGetter__,a=e.__lookupSetter__;t.exports=function(t,s,u){var c,l,d,f;if("object"!=typeof t||null===t||"[object Array]"===n.call(t))throw new TypeError("invalid argument. First argument must be an object. Value: `"+t+"`.");if("object"!=typeof u||null===u||"[object Array]"===n.call(u))throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+u+"`.");if((l="value"in u)&&(o.call(t,s)||a.call(t,s)?(c=t.__proto__,t.__proto__=e,delete t[s],t[s]=u.value,t.__proto__=c):t[s]=u.value),d="get"in u,f="set"in u,l&&(d||f))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return d&&r&&r.call(t,s,u.get),f&&i&&i.call(t,s,u.set),t}},6208:function(t,e,n){var r,i=n(3123),o=n(7407),a=n(4210);r=i()?a:o,t.exports=r},7407:function(t,e,n){var r=n(173);t.exports=function(t){return r.call(t)}},4210:function(t,e,n){var r=n(9048),i=n(1403),o=n(173);t.exports=function(t){var e,n,a;if(null==t)return o.call(t);n=t[i],e=r(t,i);try{t[i]=void 0}catch(e){return o.call(t)}return a=o.call(t),e?t[i]=n:delete t[i],a}},173:function(t){var e=Object.prototype.toString;t.exports=e},1403:function(t){var e="function"==typeof Symbol?Symbol.toStringTag:"";t.exports=e},7843:function(t){t.exports=function(t,e,n,r,i){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:i;return t===i?n:t}},374:function(t,e,n){n.r(e),n.d(e,{default:function(){return o}});for(var r=[],i=0;i<64;)r[i]=0|4294967296*Math.sin(++i%Math.PI);function o(t){var e,n,o,a=[e=1732584193,n=4023233417,~e,~n],s=[],u=unescape(encodeURI(t))+"",c=u.length;for(t=--c/4+2|15,s[--t]=8*c;~c;)s[c>>2]|=u.charCodeAt(c)<<8*c--;for(i=u=0;i<t;i+=16){for(c=a;u<64;c=[o=c[3],e+((o=c[0]+[e&n|~e&o,o&e|~o&n,e^n^o,n^(e|~o)][c=u>>4]+r[u]+~~s[i|15&[u,5*u+1,3*u+5,7*u][c]])<<(c=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*c+u++%4])|o>>>-c),e,n])e=0|c[1],n=c[2];for(u=4;u;)a[--u]+=c[u]}for(t="";u<32;)t+=(a[u>>3]>>4*(1^u++)&15).toString(16);return t}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}return n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(2870)}()})}}),Sn={};d(Sn,{tsubMiddleware:()=>xn});var Pn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/routing-middleware/index.js"(){_n=p(jn()),xn=function(t){return function(e){var n=e.payload,r=e.integration,i=e.next;new _n.Store(t).getRulesByDestinationName(r).forEach(function(t){for(var e=t.matchers,r=t.transformers,o=0;o<e.length;o++)if(_n.matches(n.obj,e[o])&&(n.obj=_n.transform(n.obj,r[o]),null===n.obj))return i(null)}),i(n)}}}});function On(t,e){var n,r;return"boolean"==typeof(null==e?void 0:e.enabled)?e.enabled:null===(r=null===(n=null==t?void 0:t.__default)||void 0===n?void 0:n.enabled)||void 0===r||r}var In=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/lib/is-plan-event-enabled.js"(){}});function An(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function En(t,e){return void 0===e&&(e=!1),e?btoa(t).replace(/=/g,""):void 0}function Mn(t,e,n,r){return y(this,void 0,void 0,function(){var i,o,a,s,u,c;return m(this,function(l){switch(l.label){case 0:i=An(e),o=En(i,r),a=fn(),s="".concat(a,"/integrations/").concat(null!=o?o:i,"/").concat(n,"/").concat(null!=o?o:i,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,gn(s)];case 2:return l.sent(),function(t,e,n){var r,i;try{var o=(null!==(i=null===(r=null===window||void 0===window?void 0:window.performance)||void 0===r?void 0:r.getEntriesByName(t,"resource"))&&void 0!==i?i:[])[0];o&&e.stats.gauge("legacy_destination_time",Math.round(o.duration),g([n],o.duration<100?["cached"]:[],!0))}catch(t){}}(s,t,e),[3,4];case 3:throw u=l.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(e),"failed"]),u;case 4:return c=window["".concat(i,"Deps")],[4,Promise.all(c.map(function(t){return gn(a+t+".gz")}))];case 5:return l.sent(),window["".concat(i,"Loader")](),[2,window["".concat(i,"Integration")]]}})})}var Nn,Fn,Cn,Tn,Dn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/ajs-destination/loader.js"(){b(),hn(),bn()}}),Rn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/ajs-destination/utils.js"(){Nn=function(t,e){var n,r=e.type,i=e.bundlingStatus,o=e.versionSettings,a="unbundled"!==i&&("browser"===r||(null===(n=null==o?void 0:o.componentTypes)||void 0===n?void 0:n.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&a},Fn=function(t,e){var n=!1===e.All&&void 0===e[t];return!1===e[t]||n}}}),Ln={};function qn(t,e){return y(this,void 0,void 0,function(){var n,r=this;return m(this,function(i){switch(i.label){case 0:return n=[],Dt()?[2,e]:[4,Ue(function(){return e.length>0&&Tt()},function(){return y(r,void 0,void 0,function(){var r,i;return m(this,function(o){switch(o.label){case 0:return(r=e.pop())?[4,_t(r,t)]:[2];case 1:return i=o.sent(),i instanceof ne||n.push(r),[2]}})})})];case 1:return i.sent(),n.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}function zn(t,n,r,i,o,a){var s,u;if(void 0===r&&(r={}),void 0===i&&(i={}),Ft())return[];n.plan&&((i=null!=i?i:{}).plan=n.plan);var c=null!==(u=null===(s=n.middlewareSettings)||void 0===s?void 0:s.routingRules)&&void 0!==u?u:[],l=n.integrations,d=i.integrations,f=vn(n,null!=i?i:{}),p=null==a?void 0:a.reduce(function(t,n){var r;return e(e({},t),((r={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,r))},{}),h=new Set(g(g([],Object.keys(l).filter(function(t){return Nn(t,l[t])}),!0),Object.keys(p||{}).filter(function(t){return N(l[t])||N(null==d?void 0:d[t])}),!0));return Array.from(h).filter(function(t){return!Fn(t,r)}).map(function(e){var n=function(t){var e,n,r,i;return null!==(i=null!==(n=null===(e=null==t?void 0:t.versionSettings)||void 0===e?void 0:e.override)&&void 0!==n?n:null===(r=null==t?void 0:t.versionSettings)||void 0===r?void 0:r.version)&&void 0!==i?i:"latest"}(l[e]),r=new Tn(e,n,t,f[e],i,null==p?void 0:p[e]);return c.filter(function(t){return t.destinationName===e}).length>0&&o&&r.addMiddleware(o),r})}d(Ln,{LegacyDestination:()=>Tn,ajsDestinations:()=>zn});var Un=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/ajs-destination/index.js"(){b(),Cn=p(qe()),Rt(),ue(),Ct(),Mt(),In(),yn(),Ve(),ce(),ve(),$e(),Dn(),Mt(),Rn(),kn(),Z(),Tn=function(){function t(t,n,r,i,o,a){void 0===i&&(i={});var s=this;this.options={},this.type="destination",this.middleware=[],this.initializePromise=K(),this.flushing=!1,this.name=t,this.version=n,this.settings=e({},i),this.disableAutoISOConversion=o.disableAutoISOConversion||!1,this.integrationSource=a,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.initializePromise.promise.then(function(t){return s._initialized=t},function(){}),this.options=o,this.buffer=o.disableClientPersistence?new X(4,[]):new oe(4,"".concat(r,":dest-").concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return!!this._ready},t.prototype.ready=function(){var t=this;return this.initializePromise.promise.then(function(){var e;return null!==(e=t.onReady)&&void 0!==e?e:Promise.resolve()})},t.prototype.load=function(t,e){var n;return y(this,void 0,void 0,function(){var r,i,o,a=this;return m(this,function(s){switch(s.label){case 0:if(this._ready||void 0!==this.onReady)return[2];s.label=1;case 1:return s.trys.push([1,5,,6]),null===(n=this.integrationSource)||void 0===n?[3,2]:(i=n,[3,4]);case 2:return[4,Mn(t,this.name,this.version,this.options.obfuscate)];case 3:i=s.sent(),s.label=4;case 4:return r=i,this.integration=function(t,e,n){var r;"Integration"in t?(t({user:function(){return n.user()},addIntegration:function(){}}),r=t.Integration):r=t;var i=new r(e);return i.analytics=n,i}(r,this.settings,e),[3,6];case 5:throw o=s.sent(),wn(t,{integrationName:this.name,methodName:"load",type:"classic",didError:!0}),o;case 6:this.onReady=new Promise(function(t){a.integration.once("ready",function(){a._ready=!0,t(!0)})}),this.integration.on("initialize",function(){a.initializePromise.resolve(!0)});try{wn(t,{integrationName:this.name,methodName:"initialize",type:"classic"}),this.integration.initialize()}catch(e){throw wn(t,{integrationName:this.name,methodName:"initialize",type:"classic",didError:!0}),this.initializePromise.resolve(!1),e}return[2]}})})},t.prototype.unload=function(t,e){return function(t,e,n){return y(this,void 0,void 0,function(){var r,i,o;return m(this,function(a){return r=fn(),i=An(t),o=En(t,n),[2,(s="".concat(r,"/integrations/").concat(null!=o?o:i,"/").concat(e,"/").concat(null!=o?o:i,".dynamic.js.gz"),u=mn(s),void 0!==u&&u.remove(),Promise.resolve())];var s,u})})}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.middleware=(t=this.middleware).concat.apply(t,e)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(Dt()||!0!==this._ready||!0!==this._initialized)},t.prototype.send=function(t,n,r){var i,o;return y(this,void 0,void 0,function(){var a,s,u,c,l,d;return m(this,function(f){switch(f.label){case 0:return this.shouldBuffer(t)?(this.buffer.push(t),this.scheduleFlush(),[2,t]):(a=null===(o=null===(i=this.options)||void 0===i?void 0:i.plan)||void 0===o?void 0:o.track,s=t.event.event,a&&s&&"Segment.io"!==this.name&&(u=a[s],On(a,u)?t.updateEvent("integrations",e(e({},t.event.integrations),null==u?void 0:u.integrations)):(t.updateEvent("integrations",e(e({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new lt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),(null==u?void 0:u.enabled)&&!1===(null==u?void 0:u.integrations[this.name])&&t.cancel(new lt({retry:!1,reason:"Event ".concat(s," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),[4,Qe(this.name,t.event,this.middleware)]);case 1:if(null===(c=f.sent()))return[2,t];l=new n(c,{traverse:!this.disableAutoISOConversion}),wn(t,{integrationName:this.name,methodName:r,type:"classic"}),f.label=2;case 2:return f.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,r,l)]:[3,4];case 3:f.sent(),f.label=4;case 4:return[3,6];case 5:throw d=f.sent(),wn(t,{integrationName:this.name,methodName:r,type:"classic",didError:!0}),d;case 6:return[2,t]}})})},t.prototype.track=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Track,"track")]})})},t.prototype.page=function(t){var e;return y(this,void 0,void 0,function(){return m(this,function(n){switch(n.label){case 0:return(null===(e=this.integration)||void 0===e?void 0:e._assumesPageview)&&!this._initialized&&this.integration.initialize(),[4,this.initializePromise.promise];case 1:return n.sent(),[2,this.send(t,Cn.Page,"page")]}})})},t.prototype.identify=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Identify,"identify")]})})},t.prototype.alias=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Alias,"alias")]})})},t.prototype.group=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){return[2,this.send(t,Cn.Group,"group")]})})},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout(function(){return y(t,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:return Dt()||!0!==this._ready||!0!==this._initialized?(this.scheduleFlush(),[2]):(this.flushing=!0,t=this,[4,qn(this,this.buffer)]);case 1:return t.buffer=e.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},5e3*Math.random())},t}()}}),Bn=l({"../../../../node_modules/@segment/analytics.js-video-plugins/dist/index.umd.js"(t,e){var n,r;n=window,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){n.r(e);var r="function"==typeof fetch?fetch.bind():function(t,e){return e=e||{},new Promise(function(n,r){var i=new XMLHttpRequest;for(var o in i.open(e.method||"get",t,!0),e.headers)i.setRequestHeader(o,e.headers[o]);function a(){var t,e=[],n=[],r={};return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(i,o,a){e.push(o=o.toLowerCase()),n.push([o,a]),t=r[o],r[o]=t?t+","+a:a}),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:a,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]))},headers:{keys:function(){return e},entries:function(){return n},get:function(t){return r[t.toLowerCase()]},has:function(t){return t.toLowerCase()in r}}}}i.withCredentials="include"==e.credentials,i.onload=function(){n(a())},i.onerror=r,i.send(e.body)})};e.default=r},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pluginName=e}return r(t,[{key:"track",value:function(t,e){window.analytics.track(t,e,{integration:{name:this.pluginName}})}}]),t}();e.default=i},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.YouTubeAnalytics=e.VimeoAnalytics=void 0;var r=o(n(3)),i=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}e.VimeoAnalytics=r.default,e.YouTubeAnalytics=i.default},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"VimeoAnalytics"));return r.authToken=n,r.player=t,r.metadata={content:{},playback:{videoPlayer:"Vimeo"}},r.mostRecentHeartbeat=0,r.isPaused=!1,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"initialize",value:function(){var t=this,e={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var n in e)this.registerHandler(n,e[n]);this.player.getVideoId().then(function(e){t.retrieveMetadata({id:e})}).catch(console.error)}},{key:"registerHandler",value:function(t,e){var n=this;this.player.on(t,function(t){n.updateMetadata(t),e.call(n,t)})}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var t=this.mostRecentHeartbeat,e=this.metadata.playback.position;e!==t&&e-t>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(e))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(t){var e=this;return new Promise(function(n,r){var o=t.id;(0,i.default)("https://api.vimeo.com/videos/"+o,{headers:{Authorization:"Bearer "+e.authToken}}).then(function(t){return t.ok?t.json():r(t)}).then(function(t){e.metadata.content.title=t.name,e.metadata.content.description=t.description,e.metadata.content.publisher=t.user.name,e.metadata.playback.position=0,e.metadata.playback.totalLength=t.duration}).catch(function(t){return console.error("Request to Vimeo API Failed with: ",t),r(t)})})}},{key:"updateMetadata",value:function(t){var e=this;return new Promise(function(n,r){e.player.getVolume().then(function(r){r&&(e.metadata.playback.sound=100*r),e.metadata.playback.position=t.seconds,n()}).catch(r)})}}]),e}(o(n(1)).default);e.default=a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=o(n(0));function o(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,"YoutubeAnalytics"));return r.player=t,r.apiKey=n,r.playerLoaded=!1,r.playbackStarted=!1,r.contentStarted=!1,r.isPaused=!1,r.isBuffering=!1,r.isSeeking=!1,r.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},r.metadata=[{playback:{video_player:"youtube"},content:{}}],r.playlistIndex=0,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(t){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(t){var e=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=e,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),t.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var t=this;return new Promise(function(e,n){var r=t.player.getVideoData(),o=t.player.getPlaylist()||[r.video_id],a=o.join();(0,i.default)("https://www.googleapis.com/youtube/v3/videos?id="+a+"&part=snippet,contentDetails&key="+t.apiKey).then(function(t){if(!t.ok){var e=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw e.response=t,e}return t.json()}).then(function(n){t.metadata=[];for(var r=0,i=0;i<o.length;i++){var a=n.items[i];t.metadata.push({content:{title:a.snippet.title,description:a.snippet.description,keywords:a.snippet.tags,channel:a.snippet.channelTitle,airdate:a.snippet.publishedAt}}),r+=s(a.contentDetails.duration)}for(i=0;i<o.length;i++)t.metadata[i].playback={total_length:r,video_player:"youtube"};e()}).catch(function(e){t.metadata=o.map(function(t){return{playback:{video_player:"youtube"},content:{}}}),n(e)})})}},{key:"handleBuffer",value:function(){var t=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),t&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var e=this.player.getPlaylist();e&&0===this.player.getCurrentTime()&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===e.length-1&&0===this.player.getPlaylistIndex()&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),-1===this.playlistIndex&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var t=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(t?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var t=this.player.getPlaylistIndex(),e=this.player.getPlaylist();(e&&t===e.length-1||-1===t)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var t=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,e=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(t-e)>2e3}}]),e}(o(n(1)).default);function s(t){var e=t.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return e=e.slice(1).map(function(t){if(null!=t)return t.replace(/\D/,"")}),3600*(parseInt(e[0])||0)+60*(parseInt(e[1])||0)+(parseInt(e[2])||0)}e.default=a}])},"object"==typeof t&&"object"==typeof e?e.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof t?t.analyticsVideoPlugins=r():n.analyticsVideoPlugins=r()}}),Vn={};function Kn(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return[4,Promise.resolve().then(()=>p(Bn()))];case 1:return e=n.sent(),t._plugins=e,[2]}})})}d(Vn,{loadLegacyVideoPlugins:()=>Kn});var Hn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/legacy-video-plugins/index.js"(){b()}}),Jn={};function Gn(t,n){function r(r){var i=t,o=r.event.event;if(i&&o){var a=i[o];if(!On(i,a))return r.updateEvent("integrations",e(e({},r.event.integrations),{All:!1,"Segment.io":!0})),r;var s=function(t,e){var n,r;if(!t||!Object.keys(t))return{};var i=t.integrations?Object.keys(t.integrations).filter(function(e){return!1===t.integrations[e]}):[],o=[];return(null!==(n=e.remotePlugins)&&void 0!==n?n:[]).forEach(function(t){i.forEach(function(e){t.creationName==e&&o.push(t.name)})}),(null!==(r=e.remotePlugins)&&void 0!==r?r:[]).reduce(function(t,e){return e.settings.subscriptions&&o.includes(e.name)&&e.settings.subscriptions.forEach(function(n){return t["".concat(e.name," ").concat(n.partnerAction)]=!1}),t},{})}(a,n);r.updateEvent("integrations",e(e(e({},r.event.integrations),null==a?void 0:a.integrations),s))}return r}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:r,alias:r,track:r,identify:r,group:r}}d(Jn,{schemaFilter:()=>Gn});var Wn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/schema-filter/index.js"(){b(),In()}}),Yn={};function Qn(t,e,n){var r;return y(this,void 0,void 0,function(){var i,o,a,s,u=this;return m(this,function(c){switch(c.label){case 0:return Ft()?[2,[]]:(i=fn(),o=null!==(r=e.enabledMiddleware)&&void 0!==r?r:{},a=Object.entries(o).filter(function(t){t[0];return t[1]}).map(function(t){return t[0]}),s=a.map(function(e){return y(u,void 0,void 0,function(){var r,o,a,s;return m(this,function(u){switch(u.label){case 0:r=e.replace("@segment/",""),o=r,n&&(o=btoa(r).replace(/=/g,"")),a="".concat(i,"/middleware/").concat(o,"/latest/").concat(o,".js.gz"),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,gn(a)];case 2:return u.sent(),[2,window["".concat(r,"Middleware")]];case 3:return s=u.sent(),t.log("error",s),t.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(s)]);case 1:return[2,c.sent().filter(Boolean)]}})})}d(Yn,{remoteMiddlewares:()=>Qn});var Zn=c({"../../../../node_modules/@segment/analytics-next/dist/pkg/plugins/remote-middleware/index.js"(){b(),Ct(),bn(),hn()}}),$n={};d($n,{DestinationSegment:()=>Ni,default:()=>qi,destinationSegment:()=>Li});var Xn=Object.defineProperty;((t,e)=>{for(var n in e)Xn(t,n,{get:e[n],enumerable:!0})})({},{Level:()=>er});var tr,er=((tr=er||{})[tr.ERROR=0]="ERROR",tr[tr.WARN=1]="WARN",tr[tr.INFO=2]="INFO",tr[tr.DEBUG=3]="DEBUG",tr);function nr(t){return Array.isArray(t)}function rr(t){return void 0!==t}function ir(t){return"object"==typeof t&&null!==t&&!nr(t)&&"[object Object]"===Object.prototype.toString.call(t)}function or(t){return"string"==typeof t}function ar(t,e="",n){const r=e.split(".");let i=t;for(let t=0;t<r.length;t++){const e=r[t];if("*"===e&&nr(i)){const e=r.slice(t+1).join("."),o=[];for(const t of i){const r=ar(t,e,n);o.push(r)}return o}if(i=i instanceof Object?i[e]:void 0,void 0===i)break}return rr(i)?i:n}function sr(t){return function(t){return"boolean"==typeof t}(t)||or(t)||function(t){return"number"==typeof t&&!Number.isNaN(t)}(t)||!rr(t)||nr(t)&&t.every(sr)||ir(t)&&Object.values(t).every(sr)}function ur(t){return sr(t)?t:void 0}function cr(t,e,n){return async function(...r){try{return await t(...r)}catch(t){if(!e)return;return await e(t)}finally{await(null==n?void 0:n())}}}async function lr(t,e={},n={}){var r;if(!rr(t))return;const i=ir(t)&&t.consent||n.consent||(null==(r=n.collector)?void 0:r.consent),o=nr(e)?e:[e];for(const e of o){const r=await cr(dr)(t,e,{...n,consent:i});if(rr(r))return r}}async function dr(t,e,n={}){const{collector:r,consent:i}=n;return(nr(e)?e:[e]).reduce(async(e,o)=>{const a=await e;if(a)return a;const s=or(o)?{key:o}:o;if(!Object.keys(s).length)return;const{condition:u,consent:c,fn:l,key:d,loop:f,map:p,set:h,validate:v,value:y}=s;if(u&&!await cr(u)(t,o,r))return;if(c&&!function(t,e={},n={}){const r={...e,...n},i={};let o=!t||0===Object.keys(t).length;return Object.keys(r).forEach(e=>{r[e]&&(i[e]=!0,t&&t[e]&&(o=!0))}),!!o&&i}(c,i))return y;let m=rr(y)?y:t;if(l&&(m=await cr(l)(t,o,n)),d&&(m=ar(t,d,y)),f){const[e,r]=f,i="this"===e?[t]:await lr(t,e,n);nr(i)&&(m=(await Promise.all(i.map(t=>lr(t,r,n)))).filter(rr))}else p?m=await Object.entries(p).reduce(async(e,[r,i])=>{const o=await e,a=await lr(t,i,n);return rr(a)&&(o[r]=a),o},Promise.resolve({})):h&&(m=await Promise.all(h.map(e=>dr(t,e,n))));v&&!await cr(v)(m)&&(m=void 0);const g=ur(m);return rr(g)?g:ur(y)},Promise.resolve(void 0))}function fr(t,e,n,r){var i,o=[t,e,n,r],a=N(t)?t.event:t;if(!a||!A(a))throw new Error("Event missing");var s=N(t)?null!==(i=t.properties)&&void 0!==i?i:{}:N(e)?e:{},u={};return M(n)||(u=null!=n?n:{}),N(t)&&!M(e)&&(u=null!=e?e:{}),[a,s,u,o.find(M)]}function pr(t,e,n,r,i){var o,a,s=null,u=null,c=[t,e,n,r,i],l=c.filter(A);1===l.length?A(c[1])?(u=c[1],s=null):(u=l[0],s=null):2===l.length&&("string"==typeof c[0]&&(s=c[0]),"string"==typeof c[1]&&(u=c[1]));var d=c.find(M),f=c.filter(N);return 1===f.length?N(c[2])?(a={},o=c[2]):N(c[3])?(o={},a=c[3]):(o=f[0],a={}):2===f.length&&(o=f[0],a=f[1]),[s,u,null!=o?o:o={},null!=a?a:a={},d]}b(),Mt();var hr=function(t){return function(){for(var e,n,r,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var a={},s=["callback","options","traits","id"],u=0,c=i;u<c.length;u++){var l=c[u],d=s.pop();if("id"===d){if(A(l)||E(l)){a.id=l.toString();continue}if(null==l)continue;d=s.pop()}if("traits"!==d&&"options"!==d||null!=l&&!N(l)||(a[d]=l),M(l)){a.callback=l;break}}return[null!==(e=a.id)&&void 0!==e?e:t.id(),null!==(n=a.traits)&&void 0!==n?n:{},null!==(r=a.options)&&void 0!==r?r:{},a.callback]}};function vr(t,e,n,r){E(t)&&(t=t.toString()),E(e)&&(e=e.toString());var i=[t,e,n,r],o=i.filter(A),a=o[0],s=void 0===a?t:a,u=o[1],c=void 0===u?null:u,l=i.filter(N)[0];return[s,c,void 0===l?{}:l,i.find(M)]}Rt(),ue(),Mt(),Z(),b(),ft();var yr=function(t,e,n,r,i,o){return{__t:"bpc",c:e,p:r,u:t,s:n,t:i,r:o}},mr=Object.keys(yr("","","","","",""));function gr(t){if(e=t,"object"!==Object.prototype.toString.call(e).slice(8,-1).toLowerCase())return!1;var e;if("bpc"!==t.__t)return!1;for(var n in t)if(!mr.includes(n))return!1;return!0}var br=function(t){var e,n,r=t.c,i=t.p,o=t.s,a=t.u,s=t.r,u=t.t,c=r?function(t){try{return new URL(t).pathname}catch(e){return"/"===t[0]?t:"/"+t}}(r):i,l=r?function(t,e){return t.indexOf("?")>-1?t:t+e}(r,o):-1===(n=(e=a).indexOf("#"))?e:e.slice(0,n);return{path:c,referrer:s,search:o,title:u,url:l}},wr=function(){var t=document.querySelector("link[rel='canonical']");return yr(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)};b(),b();var _r=function(t,n){void 0===n&&(n=br(wr()));var r,i,o,a=t.context;"page"===t.type&&(r=t.properties&&(i=t.properties,o=Object.keys(n),Object.assign.apply(Object,g([{}],o.map(function(t){var e;if(i&&Object.prototype.hasOwnProperty.call(i,t))return(e={})[t]=i[t],e}),!1))),t.properties=e(e(e({},n),t.properties),t.name?{name:t.name}:{})),a.page=e(e(e({},n),r),a.page)};Mt();var xr=function(t){function e(e){var n=t.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(ot())},onEventMethodCall:function(t){var e=t.options;n.maybeUpdateAnonId(e)},onFinishedEvent:function(t){return n.addIdentity(t),t}})||this;return n.user=e,n}return h(e,t),e.prototype.maybeUpdateAnonId=function(t){(null==t?void 0:t.anonymousId)&&this.user.anonymousId(t.anonymousId)},e.prototype.addIdentity=function(t){this.user.id()&&(t.userId=this.user.id()),this.user.anonymousId()&&(t.anonymousId=this.user.anonymousId())},e.prototype.track=function(e,n,r,i,o){var a=t.prototype.track.call(this,e,n,r,i);return _r(a,o),a},e.prototype.page=function(e,n,r,i,o,a){var s=t.prototype.page.call(this,e,n,r,i,o);return _r(s,a),s},e.prototype.screen=function(e,n,r,i,o,a){var s=t.prototype.screen.call(this,e,n,r,i,o);return _r(s,a),s},e.prototype.identify=function(e,n,r,i,o){var a=t.prototype.identify.call(this,e,n,r,i);return _r(a,o),a},e.prototype.group=function(e,n,r,i,o){var a=t.prototype.group.call(this,e,n,r,i);return _r(a,o),a},e.prototype.alias=function(e,n,r,i,o){var a=t.prototype.alias.call(this,e,n,r,i);return _r(a,o),a},e}(q),kr=function(t){return"addMiddleware"in t&&"destination"===t.type};b(),ve(),Mt(),Rt();var jr=function(t){function e(e){return t.call(this,"string"==typeof e?new oe(4,e):e)||this}return h(e,t),e.prototype.flush=function(){return y(this,void 0,void 0,function(){return m(this,function(e){return Dt()?[2,[]]:[2,t.prototype.flush.call(this)]})})},e}(kt);function Sr(t){for(var e=t.constructor.prototype,n=0,r=Object.getOwnPropertyNames(e);n<r.length;n++){var i=r[n];if("constructor"!==i){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&"function"==typeof o.value&&(t[i]=t[i].bind(t))}}return t}function Pr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}b(),ft(),b();var Or=function t(e,n){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=Pr({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in i)i[a]&&(o+="; "+a,!0!==i[a]&&(o+="="+i[a].split(";")[0]));return document.cookie=t+"="+e.write(r,t)+o}}return Object.create({set:r,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(r[s]=e.read(a,s),t===s)break}catch(t){}}return t?r[t]:r}},remove:function(t,e){r(t,"",Pr({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,Pr({},this.attributes,e))},withConverter:function(e){return t(Pr({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Ir=Or;function Ar(t){var e=function(t){try{return new URL(t)}catch(t){return}}(t);if(e)for(var n=function(t){var e=t.hostname.split("."),n=e[e.length-1],r=[];if(4===e.length&&parseInt(n,10)>0)return r;if(e.length<=1)return r;for(var i=e.length-2;i>=0;--i)r.push(e.slice(i).join("."));return r}(e),r=0;r<n.length;++r){var i="__tld__",o=n[r],a={domain:"."+o};try{if(Ir.set(i,"1",a),Ir.get(i))return Ir.remove(i,a),o}catch(t){return}}}var Er=function(){function t(n){void 0===n&&(n=t.defaults),this.options=e(e({},t.defaults),n)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:365,domain:Ar(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(t){var e;try{var n=Ir.get(t);if(null==n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(t){return null}},t.prototype.set=function(t,e){"string"==typeof e?Ir.set(t,e,this.opts()):null===e?Ir.remove(t,this.opts()):Ir.set(t,JSON.stringify(e),this.opts())},t.prototype.remove=function(t){return Ir.remove(t,this.opts())},t}(),Mr=function(){function t(){}return t.prototype.localStorageWarning=function(t,e){console.warn("Unable to access ".concat(t,", localStorage may be ").concat(e))},t.prototype.get=function(t){var e;try{var n=localStorage.getItem(t);if(null===n)return null;try{return null!==(e=JSON.parse(n))&&void 0!==e?e:null}catch(t){return null!=n?n:null}}catch(e){return this.localStorageWarning(t,"unavailable"),null}},t.prototype.set=function(t,e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){this.localStorageWarning(t,"full")}},t.prototype.remove=function(t){try{return localStorage.removeItem(t)}catch(e){this.localStorageWarning(t,"unavailable")}},t}(),Nr=function(){function t(){this.cache={}}return t.prototype.get=function(t){var e;return null!==(e=this.cache[t])&&void 0!==e?e:null},t.prototype.set=function(t,e){this.cache[t]=e},t.prototype.remove=function(t){delete this.cache[t]},t}(),Fr={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function Cr(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(t){return Object.values(Fr).includes(t)})}var Tr=function(t,e,n,r){console.warn("".concat(t.constructor.name,": Can't ").concat(e,' key "').concat(n,'" | Err: ').concat(r))},Dr=function(){function t(t){this.stores=t}return t.prototype.get=function(t){for(var e=null,n=0,r=this.stores;n<r.length;n++){var i=r[n];try{if(null!=(e=i.get(t)))return e}catch(e){Tr(i,"get",t,e)}}return null},t.prototype.set=function(t,e){this.stores.forEach(function(n){try{n.set(t,e)}catch(e){Tr(n,"set",t,e)}})},t.prototype.clear=function(t){this.stores.forEach(function(e){try{e.remove(t)}catch(n){Tr(e,"remove",t,n)}})},t.prototype.getAndSync=function(t){var e=this.get(t),n="number"==typeof e?e.toString():e;return this.set(t,n),n},t}();function Rr(t){return t.map(function(t){var e,n;switch(!function(t){return"object"==typeof t&&void 0!==t.name}(t)?e=t:(e=t.name,n=t.settings),e){case Fr.Cookie:return new Er(n);case Fr.LocalStorage:return new Mr;case Fr.Memory:return new Nr;default:throw new Error("Unknown Store Type: ".concat(t))}})}function Lr(t,e){return t.map(function(t){return e&&t===Fr.Cookie?{name:t,settings:e}:t})}var qr={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},zr=function(){function t(t,n){void 0===t&&(t=qr);var r,i,o,a,s=this;this.options={},this.id=function(t){if(s.options.disable)return null;var e=s.identityStore.getAndSync(s.idKey);void 0!==t&&(s.identityStore.set(s.idKey,t),t!==e&&null!==e&&null!==t&&s.anonymousId(null));var n=s.identityStore.getAndSync(s.idKey);if(n)return n;var r=s.legacyUserStore.get(qr.cookie.oldKey);return r?"object"==typeof r?r.id:r:null},this.anonymousId=function(t){var e,n;if(s.options.disable)return null;if(void 0===t){var r=null!==(e=s.identityStore.getAndSync(s.anonKey))&&void 0!==e?e:null===(n=s.legacySIO())||void 0===n?void 0:n[0];if(r)return r}return null===t?(s.identityStore.set(s.anonKey,null),s.identityStore.getAndSync(s.anonKey)):(s.identityStore.set(s.anonKey,null!=t?t:ot()),s.identityStore.getAndSync(s.anonKey))},this.traits=function(t){var e;if(!s.options.disable)return null===t&&(t={}),t&&s.traitsStore.set(s.traitsKey,null!=t?t:{}),null!==(e=s.traitsStore.get(s.traitsKey))&&void 0!==e?e:{}},this.options=e(e({},qr),t),this.cookieOptions=n,this.idKey=null!==(i=null===(r=t.cookie)||void 0===r?void 0:r.key)&&void 0!==i?i:qr.cookie.key,this.traitsKey=null!==(a=null===(o=t.localStorage)||void 0===o?void 0:o.key)&&void 0!==a?a:qr.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,n),this.legacyUserStore=this.createStorage(this.options,n,function(t){return t===Fr.Cookie}),this.traitsStore=this.createStorage(this.options,n,function(t){return t!==Fr.Cookie});var u=this.legacyUserStore.get(qr.cookie.oldKey);u&&"object"==typeof u&&(u.id&&this.id(u.id),u.traits&&this.traits(u.traits)),Sr(this)}return t.prototype.legacySIO=function(){var t=this.legacyUserStore.get("_sio");if(!t)return null;var e=t.split("----");return[e[0],e[1]]},t.prototype.identify=function(t,n){if(!this.options.disable){n=null!=n?n:{};var r=this.id();null!==r&&r!==t||(n=e(e({},this.traits()),n)),t&&this.id(t),this.traits(n)}},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.prototype.createStorage=function(t,e,n){var r=[Fr.LocalStorage,Fr.Cookie,Fr.Memory];return t.disable?new Dr([]):t.persist?(void 0!==t.storage&&null!==t.storage&&Cr(t.storage)&&(r=t.storage.stores),t.localStorageFallbackDisabled&&(r=r.filter(function(t){return t!==Fr.LocalStorage})),n&&(r=r.filter(n)),new Dr(Rr(Lr(r,e)))):new Dr([new Nr])},t.defaults=qr,t}(),Ur={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},Br=function(t){function n(n,r){void 0===n&&(n=Ur);var i=t.call(this,e(e({},Ur),n),r)||this;return i.anonymousId=function(t){},Sr(i),i}return h(n,t),n}(zr);ve(),Jt(),ce(),Kt(),ge(),b();Jt(),ge(),Zt();var Vr=function(t,e,n){n.getAndRemove(t).forEach(function(t){$r(e,t).catch(console.error)})},Kr=function(t,e){return y(void 0,void 0,void 0,function(){var n,r,i;return m(this,function(o){switch(o.label){case 0:n=0,r=e.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return n<r.length?(i=r[n],[4,$r(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},Hr=function(t,e){return y(void 0,void 0,void 0,function(){var n,r,i;return m(this,function(o){switch(o.label){case 0:n=0,r=e.getAndRemove("register"),o.label=1;case 1:return n<r.length?(i=r[n],[4,$r(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},Jr=Vr.bind(void 0,"on"),Gr=Vr.bind(void 0,"setAnonymousId"),Wr=function(t){if(Yr(t)){var e=t.pop();return br(e)}},Yr=function(t){return gr(t[t.length-1])},Qr=function(){return function(t,e,n,r){void 0===n&&(n=function(){}),void 0===r&&(r=console.error),this.method=t,this.resolve=n,this.reject=r,this.called=!1,this.args=e}}(),Zr=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._callMap={},this.add.apply(this,t)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(t){this._callMap=t},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e;return null!==(e=this.calls[t])&&void 0!==e?e:[]},t.prototype.getAndRemove=function(t){var e=this.get(t);return this.calls[t]=[],e},t.prototype.add=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach(function(e){["track","screen","alias","group","page","identify"].includes(e.method)&&!Yr(e.args)&&(e.args=g(g([],e.args,!0),[wr()],!1)),t.calls[e.method]?t.calls[e.method].push(e):t.calls[e.method]=[e]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var t;return(t=[]).concat.apply(t,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){if("npm"!==Gt()){var t=ye();if(Array.isArray(t)){var e=t.splice(0,t.length).map(function(t){var e=t[0],n=t.slice(1);return new Qr(e,n)});this.add.apply(this,e)}}},t}();function $r(t,e){return y(this,void 0,void 0,function(){var n,r;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,n=t[e.method].apply(t,e.args),"object"==typeof(o=n)&&null!==o&&"then"in o&&"function"==typeof o.then?[4,n]:[3,2]);case 1:i.sent(),i.label=2;case 2:return e.resolve(n),[3,4];case 3:return r=i.sent(),e.reject(r),[3,4];case 4:return[2]}var o})})}var Xr=function(){function t(t){var e=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=Ut,this._preInitBuffer=new Zr,this._promise=t(this._preInitBuffer),this._promise.then(function(t){var n=t[0],r=t[1];e.instance=n,e.ctx=r}).catch(function(){})}return t.prototype.then=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).then.apply(t,e)},t.prototype.catch=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).catch.apply(t,e)},t.prototype.finally=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this._promise).finally.apply(t,e)},t.prototype._createMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e.instance){var o=(n=e.instance)[t].apply(n,r);return Promise.resolve(o)}return new Promise(function(n,i){e._preInitBuffer.add(new Qr(t,r,n,i))})}},t.prototype._createChainableMethod=function(t){var e=this;return function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.instance?((n=e.instance)[t].apply(n,r),e):(e._preInitBuffer.add(new Qr(t,r)),e)}},t}();b(),Rt(),ce(),ve(),Be(),b(),Ht();b();var ti=function(t){function e(e,n){var r=t.call(this,e)||this;return r.retryTimeout=n,r.name="RateLimitError",r}return h(e,t),e}(Error);ue(),b();var ei=function(t){return e({"Content-Type":"text/plain"},"function"==typeof t?t():t)};function ni(t){return(encodeURI(JSON.stringify(t)).split(/%..|./).length-1)/1024}function ri(t,n){var r,i,o,a,s,u=[],c=!1,l=null!==(r=null==n?void 0:n.size)&&void 0!==r?r:10,d=null!==(i=null==n?void 0:n.timeout)&&void 0!==i?i:5e3,f=0;function p(e){var r;if(0!==e.length){var i=null===(r=e[0])||void 0===r?void 0:r.writeKey,o=e.map(function(t){var e=t;e.sentAt;return v(e,["sentAt"])});return zt("https://".concat(t,"/b"),{credentials:null==n?void 0:n.credentials,keepalive:(null==n?void 0:n.keepalive)||c,headers:ei(null==n?void 0:n.headers),method:"post",body:JSON.stringify({writeKey:i,batch:o,sentAt:(new Date).toISOString()}),priority:null==n?void 0:n.priority}).then(function(t){var e;if(t.status>=500)throw new Error("Bad response from server: ".concat(t.status));if(429===t.status){var n=null===(e=t.headers)||void 0===e?void 0:e.get("x-ratelimit-reset"),r="string"==typeof n?1e3*parseInt(n):d;throw new ti("Rate limit exceeded: ".concat(t.status),r)}})}}function h(t){var r;return void 0===t&&(t=1),y(this,void 0,void 0,function(){var i;return m(this,function(o){return u.length?(i=u,u=[],[2,null===(r=p(i))||void 0===r?void 0:r.catch(function(r){var o;ne.system().log("error","Error sending batch",r),t<=(null!==(o=null==n?void 0:n.maxRetries)&&void 0!==o?o:10)&&("RateLimitError"===r.name&&(f=r.retryTimeout),u.push.apply(u,i),u.map(function(n){if("_metadata"in n){var r=n;r._metadata=e(e({},r._metadata),{retryCount:t})}}),g(t+1))})]):[2]})})}function g(t){void 0===t&&(t=1),o||(o=setTimeout(function(){o=void 0,h(t).catch(console.error)},f||d),f=0)}return a=function(t){if((c=t)&&u.length){var e=(n=u,r=[],i=0,n.forEach(function(t){ni(r[i])>=64&&i++,r[i]?r[i].push(t):r[i]=[t]}),r).map(p);Promise.all(e).catch(console.error)}var n,r,i},s=!1,window.addEventListener("pagehide",function(){s||a(s=!0)}),document.addEventListener("visibilitychange",function(){if("hidden"==document.visibilityState){if(s)return;s=!0}else s=!1;a(s)}),{dispatch:function(t,e){return y(this,void 0,void 0,function(){var t;return m(this,function(r){return u.push(e),t=u.length>=l||function(t){return ni(t)>=450}(u)||(null==n?void 0:n.keepalive)&&function(t){return ni(t)>=54}(u),[2,t||c?h():g()]})})}}}function ii(t,n,r,i,o){var a,s=t.user();delete n.options,n.writeKey=null==r?void 0:r.apiKey,n.userId=n.userId||s.id(),n.anonymousId=n.anonymousId||s.anonymousId(),n.sentAt=new Date;var u=t.queue.failedInitializations||[];u.length>0&&(n._metadata={failedInitializations:u}),null!=o&&(o.attempts>1&&(n._metadata=e(e({},n._metadata),{retryCount:o.attempts})),o.attempts++);var c=[],l=[];for(var d in i){var f=i[d];"Segment.io"===d&&c.push(d),"bundled"===f.bundlingStatus&&c.push(d),"unbundled"===f.bundlingStatus&&l.push(d)}for(var p=0,h=(null==r?void 0:r.unbundledIntegrations)||[];p<h.length;p++){var v=h[p];l.includes(v)||l.push(v)}var y=null!==(a=null==r?void 0:r.maybeBundledConfigIds)&&void 0!==a?a:{},m=[];return c.sort().forEach(function(t){var e;(null!==(e=y[t])&&void 0!==e?e:[]).forEach(function(t){m.push(t)})}),!1!==(null==r?void 0:r.addBundledMetadata)&&(n._metadata=e(e({},n._metadata),{bundled:c.sort(),unbundled:l.sort(),bundledIds:m})),n}function oi(t,e){return y(this,void 0,void 0,function(){var n,r=this;return m(this,function(i){switch(i.label){case 0:return n=[],Dt()?[2,e]:[4,Ue(function(){return e.length>0&&!Dt()},function(){return y(r,void 0,void 0,function(){var r,i;return m(this,function(o){switch(o.label){case 0:return(r=e.pop())?[4,_t(r,t)]:[2];case 1:return i=o.sent(),i instanceof ne||n.push(r),[2]}})})})];case 1:return i.sent(),n.map(function(t){return e.pushWithBackoff(t)}),[2,e]}})})}function ai(t,e,n,r){var i=this;t||setTimeout(function(){return y(i,void 0,void 0,function(){var t,i;return m(this,function(o){switch(o.label){case 0:return t=!0,[4,oi(n,e)];case 1:return i=o.sent(),t=!1,e.todo>0&&r(t,i,n,r),[2]}})})},5e3*Math.random())}Ht(),b(),b(),Rt(),ue(),Mt(),Ve(),$t();var si=function(t){return"Segment.io"===t.name};function ui(t,e,n){var r,i,o;window.addEventListener("pagehide",function(){u.push.apply(u,Array.from(c)),c.clear()});var a,s=null!==(r=null==e?void 0:e.apiKey)&&void 0!==r?r:"",u=t.options.disableClientPersistence?new X(t.queue.queue.maxAttempts,[]):new oe(t.queue.queue.maxAttempts,"".concat(s,":dest-Segment.io")),c=new Set,l=!1,d=null!==(i=null==e?void 0:e.apiHost)&&void 0!==i?i:Wt,f=null!==(o=null==e?void 0:e.protocol)&&void 0!==o?o:"https",p="".concat(f,"://").concat(d),h=null==e?void 0:e.deliveryStrategy,v=h&&"strategy"in h&&"batching"===h.strategy?ri(d,h.config):(a=null==h?void 0:h.config,{dispatch:function(t,e){return zt(t,{credentials:null==a?void 0:a.credentials,keepalive:null==a?void 0:a.keepalive,headers:ei(null==a?void 0:a.headers),method:"post",body:JSON.stringify(e),priority:null==a?void 0:a.priority}).then(function(t){var e;if(t.status>=500)throw new Error("Bad response from server: ".concat(t.status));if(429===t.status){var n=null===(e=t.headers)||void 0===e?void 0:e.get("x-ratelimit-reset"),r=n?1e3*parseInt(n):5e3;throw new ti("Rate limit exceeded: ".concat(t.status),r)}})}});function g(r){return y(this,void 0,void 0,function(){var i,o;return m(this,function(a){return Dt()?(u.push(r),ai(l,u,b,ai),[2,r]):(c.add(r),i=r.event.type.charAt(0),o=ze(r.event).json(),"track"===r.event.type&&delete o.traits,"alias"===r.event.type&&(o=function(t,e){var n,r,i,o,a=t.user();return e.previousId=null!==(i=null!==(r=null!==(n=e.previousId)&&void 0!==n?n:e.from)&&void 0!==r?r:a.id())&&void 0!==i?i:a.anonymousId(),e.userId=null!==(o=e.userId)&&void 0!==o?o:e.to,delete e.from,delete e.to,e}(t,o)),u.getAttempts(r)>=u.maxAttempts?(c.delete(r),[2,r]):[2,v.dispatch("".concat(p,"/").concat(i),ii(t,o,e,n,r)).then(function(){return r}).catch(function(t){if(r.log("error","Error sending event",t),"RateLimitError"===t.name){var e=t.retryTimeout;u.pushWithBackoff(r,e)}else u.pushWithBackoff(r);return ai(l,u,b,ai),r}).finally(function(){c.delete(r)})])})})}var b={metadata:{writeKey:s,apiHost:d,protocol:f},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:g,identify:g,page:g,alias:g,group:g,screen:g};return u.todo&&ai(l,u,b,ai),b}var ci="This is being deprecated and will be not be available in future releases of Analytics JS",li=qt(),di=null==li?void 0:li.analytics;var fi=function(){function t(t,e){var n;this.timeout=300,this._getSegmentPluginMetadata=function(){var t;return null===(t=e.plugins.find(si))||void 0===t?void 0:t.metadata},this.writeKey=t.writeKey;this.cdnSettings=null!==(n=t.cdnSettings)&&void 0!==n?n:{integrations:{"Segment.io":{apiKey:""}}},this.cdnURL=t.cdnURL}return Object.defineProperty(t.prototype,"apiHost",{get:function(){var t,e;return null===(e=null===(t=this._getSegmentPluginMetadata)||void 0===t?void 0:t.call(this))||void 0===e?void 0:e.apiHost},enumerable:!1,configurable:!0}),t}();function pi(){console.warn(ci)}var hi,vi=function(t){function n(n,r,i,o,a){var s,u,c=this;(c=t.call(this)||this)._debug=!1,c.initialized=!1,c.user=function(){return c._user},c.init=c.initialize.bind(c),c.log=pi,c.addIntegrationMiddleware=pi,c.listeners=pi,c.addEventListener=pi,c.removeAllListeners=pi,c.removeListener=pi,c.removeEventListener=pi,c.hasListeners=pi,c.add=pi,c.addIntegration=pi;var l=null==r?void 0:r.cookie,d=null!==(s=null==r?void 0:r.disableClientPersistence)&&void 0!==s&&s;c.queue=null!=i?i:function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var r=e?10:1,i=n?new X(r,[]):new oe(r,t);return new jr(i)}("".concat(n.writeKey,":event-queue"),null==r?void 0:r.retryQueue,d),c.settings=new fi(n,c.queue);var f=null==r?void 0:r.storage;return c._universalStorage=c.createStore(d,f,l),c._user=null!=o?o:new zr(e({persist:!d,storage:null==r?void 0:r.storage},null==r?void 0:r.user),l).load(),c._group=null!=a?a:new Br(e({persist:!d,storage:null==r?void 0:r.storage},null==r?void 0:r.group),l).load(),c.eventFactory=new xr(c._user),c.integrations=null!==(u=null==r?void 0:r.integrations)&&void 0!==u?u:{},c.options=null!=r?r:{},Sr(c),c}return h(n,t),n.prototype.createStore=function(t,e,n){return t?new Dr([new Nr]):e&&Cr(e)?new Dr(Rr(Lr(e.stores,n))):new Dr(Rr([Fr.LocalStorage,{name:Fr.Cookie,settings:n},Fr.Memory]))},Object.defineProperty(n.prototype,"storage",{get:function(){return this._universalStorage},enumerable:!1,configurable:!0}),n.prototype.track=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u=this;return m(this,function(c){return e=Wr(t),n=fr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=this.eventFactory.track(r,i,o,this.integrations,e),[2,this._dispatch(s,a).then(function(t){return u.emit("track",r,t.event.properties,t.event.options),t})]})})},n.prototype.page=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u,c=this;return m(this,function(l){return e=Wr(t),n=pr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=this.eventFactory.page(r,i,o,a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return c.emit("page",r,i,t.event.properties,t.event.options),t})]})})},n.prototype.identify=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u=this;return m(this,function(c){return e=Wr(t),n=hr(this._user).apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],this._user.identify(r,i),s=this.eventFactory.identify(this._user.id(),this._user.traits(),o,this.integrations,e),[2,this._dispatch(s,a).then(function(t){return u.emit("identify",t.event.userId,t.event.traits,t.event.options),t})]})})},n.prototype.group=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Wr(e);if(0===e.length)return this._group;var i=hr(this._group).apply(void 0,e),o=i[0],a=i[1],s=i[2],u=i[3];this._group.identify(o,a);var c=this._group.id(),l=this._group.traits(),d=this.eventFactory.group(c,l,s,this.integrations,r);return this._dispatch(d,u).then(function(e){return t.emit("group",e.event.groupId,e.event.traits,e.event.options),e})},n.prototype.alias=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u=this;return m(this,function(c){return e=Wr(t),n=vr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=this.eventFactory.alias(r,i,o,this.integrations,e),[2,this._dispatch(s,a).then(function(t){return u.emit("alias",r,i,t.event.options),t})]})})},n.prototype.screen=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r,i,o,a,s,u,c=this;return m(this,function(l){return e=Wr(t),n=pr.apply(void 0,t),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=this.eventFactory.screen(r,i,o,a,this.integrations,e),[2,this._dispatch(u,s).then(function(t){return c.emit("screen",r,i,t.event.properties,t.event.options),t})]})})},n.prototype.trackClick=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.link).call.apply(n,g([this],t,!1))]}})})},n.prototype.trackLink=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.link).call.apply(n,g([this],t,!1))]}})})},n.prototype.trackSubmit=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.form).call.apply(n,g([this],t,!1))]}})})},n.prototype.trackForm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n;return m(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>(We(),He))];case 1:return e=r.sent(),[2,(n=e.form).call.apply(n,g([this],t,!1))]}})})},n.prototype.register=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r=this;return m(this,function(i){switch(i.label){case 0:return e=ne.system(),n=t.map(function(t){return r.queue.register(e,t,r)}),[4,Promise.all(n)];case 1:return i.sent(),[2,e]}})})},n.prototype.deregister=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return y(this,void 0,void 0,function(){var e,n,r=this;return m(this,function(i){switch(i.label){case 0:return e=ne.system(),n=t.map(function(t){var n=r.queue.plugins.find(function(e){return e.name===t});if(n)return r.queue.deregister(e,n,r);e.log("warn","plugin ".concat(t," not found"))}),[4,Promise.all(n)];case 1:return i.sent(),[2,e]}})})},n.prototype.debug=function(t){return!1===t&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=t,this},n.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},n.prototype.timeout=function(t){this.settings.timeout=t},n.prototype._dispatch=function(t,e){return y(this,void 0,void 0,function(){var n;return m(this,function(r){return(n=new ne(t)).stats.increment("analytics_js.invoke",1,[t.type]),Dt()&&!this.options.retryQueue?[2,n]:[2,It(n,this.queue,this,{callback:e,debug:this._debug,timeout:this.settings.timeout})]})})},n.prototype.addSourceMiddleware=function(t){return y(this,void 0,void 0,function(){var e=this;return m(this,function(n){switch(n.label){case 0:return[4,this.queue.criticalTasks.run(function(){return y(e,void 0,void 0,function(){var e,n,r;return m(this,function(i){switch(i.label){case 0:return[4,Promise.resolve().then(()=>($e(),Ye))];case 1:return e=i.sent().sourceMiddlewarePlugin,n={},this.queue.plugins.forEach(function(t){if("destination"===t.type)return n[t.name]=!0}),r=e(t,n),[4,this.register(r)];case 2:return i.sent(),[2]}})})})];case 1:return n.sent(),[2,this]}})})},n.prototype.addDestinationMiddleware=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.queue.plugins.filter(kr).forEach(function(n){"*"!==t&&n.name.toLowerCase()!==t.toLowerCase()||n.addMiddleware.apply(n,e)}),Promise.resolve(this)},n.prototype.setAnonymousId=function(t){return this._user.anonymousId(t)},n.prototype.queryString=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return!1===this.options.useQueryString?[2,[]]:[4,Promise.resolve().then(()=>(pn(),rn))];case 1:return[2,(0,e.sent().queryString)(this,t)]}})})},n.prototype.use=function(t){return t(this),this},n.prototype.ready=function(t){return void 0===t&&(t=function(t){return t}),y(this,void 0,void 0,function(){return m(this,function(e){return[2,Promise.all(this.queue.plugins.map(function(t){return t.ready?t.ready():Promise.resolve()})).then(function(e){return t(e),e})]})})},n.prototype.noConflict=function(){var t;return console.warn(ci),t=null!=di?di:this,window[he]=t,this},n.prototype.normalize=function(t){return console.warn(ci),this.eventFactory.normalize(t)},Object.defineProperty(n.prototype,"failedInitializations",{get:function(){return console.warn(ci),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"VERSION",{get:function(){return Ut},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,e){return y(this,void 0,void 0,function(){return m(this,function(t){return console.warn(ci),[2,Promise.resolve(this)]})})},n.prototype.pageview=function(t){return y(this,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return console.warn(ci),[4,this.page({path:t})];case 1:return e.sent(),[2,this]}})})},Object.defineProperty(n.prototype,"plugins",{get:function(){var t;return console.warn(ci),null!==(t=this._plugins)&&void 0!==t?t:{}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Integrations",{get:function(){return console.warn(ci),this.queue.plugins.filter(function(t){return"destination"===t.type}).reduce(function(t,e){var n="".concat(e.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),r=window[n];if(!r)return t;var i=r.Integration;return i?(t[e.name]=i,t):(t[e.name]=r,t)},{})},enumerable:!1,configurable:!0}),n.prototype.push=function(t){var e=t.shift();e&&!this[e]||this[e].apply(this,t)},n}(H),yi=function(t){function e(){var e=t.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return e.initialized=!0,e}return h(e,t),e}(vi);function mi(){return"undefined"!=typeof process&&process.env?process.env:{}}function gi(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){return(e=navigator.userAgentData)?t?[2,e.getHighEntropyValues(t).catch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}function bi(){if(hi)return hi;var t=Ar(window.location.href);return hi={expires:31536e6,secure:!1,path:"/"},t&&(hi.domain=t),hi}b(),hn(),ue(),yn(),Z(),b(),Jt(),Zt(),nn(),b();var wi=new(function(){return function(){var t=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(e,n){return y(t,void 0,void 0,function(){var t;return m(this,function(e){switch(e.label){case 0:this.instance=n,e.label=1;case 1:return e.trys.push([1,3,,4]),t=this,[4,gi(this.instance.options.highEntropyValuesClientHints)];case 2:return t.userAgentData=e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(n){var r,i,o=n.event.context,a=o.page.search||"",s="object"==typeof a?function(t){try{var e=new URLSearchParams;return Object.entries(t).forEach(function(t){var n=t[0],r=t[1];Array.isArray(r)?r.forEach(function(t){return e.append(n,t)}):e.append(n,r)}),e.toString()}catch(t){return""}}(a):a;o.userAgent=navigator.userAgent,o.userAgentData=t.userAgentData;var u=navigator.userLanguage||navigator.language;void 0===o.locale&&void 0!==u&&(o.locale=u),null!==(r=o.library)&&void 0!==r||(o.library={name:"analytics.js",version:"".concat("web"===Gt()?"next":"npm:next","-").concat(Ut)}),s&&!o.campaign&&(o.campaign=function(t){return t.startsWith("?")&&(t=t.substring(1)),(t=t.replace(/\?/g,"&")).split("&").reduce(function(t,e){var n=e.split("="),r=n[0],i=n[1],o=void 0===i?"":i;if(r.includes("utm_")&&r.length>4){var a=r.slice(4);"campaign"===a&&(a="name"),t[a]=en(o)}return t},{})}(s));var c=function(){var t=Ir.get("_ga");if(t&&t.startsWith("amp"))return t}();c&&(o.amp={id:c}),function(t,n,r){var i,o=new Dr(r?[]:[new Er(bi())]),a=o.get("s:context.referrer"),s=null!==(i=function(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1));for(var n=0,r=(t=t.replace(/\?/g,"&")).split("&");n<r.length;n++){var i=r[n].split("="),o=i[0],a=i[1];if(e[o])return{id:a,type:e[o]}}}(t))&&void 0!==i?i:a;s&&(n&&(n.referrer=e(e({},n.referrer),s)),o.set("s:context.referrer",s))}(s,o,null!==(i=t.instance.options.disableClientPersistence)&&void 0!==i&&i);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){}return n},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}}());b(),bn(),hn(),$e(),ue(),kn(),Z();var _i,xi,ki=function(){function t(t,e){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=K(),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=e,this.name=t,this.type=e.type,this.alternativeNames.push(e.name)}return t.prototype.addMiddleware=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];"destination"===this.type&&(t=this.middleware).push.apply(t,e)},t.prototype.transform=function(t){return y(this,void 0,void 0,function(){var e;return m(this,function(n){switch(n.label){case 0:return[4,Qe(this.name,t.event,this.middleware)];case 1:return null===(e=n.sent())&&t.cancel(new lt({retry:!1,reason:"dropped by destination middleware"})),[2,new ne(e)]}})})},t.prototype._createMethod=function(t){var e=this;return function(n){return y(e,void 0,void 0,function(){var e,r;return m(this,function(i){switch(i.label){case 0:return this.action[t]?(e=n,"destination"!==this.type?[3,2]:[4,this.transform(n)]):[2,n];case 1:e=i.sent(),i.label=2;case 2:return i.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!i.sent())throw new Error("Something prevented the destination from getting ready");return wn(n,{integrationName:this.action.name,methodName:t,type:"action"}),[4,this.action[t](e)];case 4:return i.sent(),[3,6];case 5:throw r=i.sent(),wn(n,{integrationName:this.action.name,methodName:t,type:"action",didError:!0}),r;case 6:return[2,n]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return y(this,void 0,void 0,function(){return m(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]}})})},t.prototype.load=function(t,e){return y(this,void 0,void 0,function(){var n,r,i,o;return m(this,function(a){switch(a.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];a.label=1;case 1:return a.trys.push([1,3,,4]),wn(t,{integrationName:this.action.name,methodName:"load",type:"action"}),n=this.action.load(t,e),i=(r=this.loadPromise).resolve,[4,n];case 2:return i.apply(r,[a.sent()]),[2,n];case 3:throw o=a.sent(),wn(t,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(o),o;case 4:return[2]}})})},t.prototype.unload=function(t,e){var n,r;return null===(r=(n=this.action).unload)||void 0===r?void 0:r.call(n,t,e)},t}();function ji(t,e){return y(this,void 0,void 0,function(){var n,r,i,o,a,s;return m(this,function(u){switch(u.label){case 0:if(u.trys.push([0,9,,10]),n=new RegExp("https://cdn.segment.(com|build)"),r=dn(),!e)return[3,6];i=t.url.split("/"),o=i[i.length-2],a=t.url.replace(o,btoa(o).replace(/=/g,"")),u.label=1;case 1:return u.trys.push([1,3,,5]),[4,gn(a.replace(n,r))];case 2:return u.sent(),[3,5];case 3:return u.sent(),[4,gn(t.url.replace(n,r))];case 4:return u.sent(),[3,5];case 5:return[3,8];case 6:return[4,gn(t.url.replace(n,r))];case 7:u.sent(),u.label=8;case 8:return"function"==typeof window[t.libraryName]?[2,window[t.libraryName]]:[3,10];case 9:throw s=u.sent(),console.error("Failed to create PluginFactory",t),s;case 10:return[2]}})})}function Si(t,n,r,i,o,a){var s,u,c;return y(this,void 0,void 0,function(){var l,d,f,p=this;return m(this,function(h){switch(h.label){case 0:return l=[],d=null!==(u=null===(s=t.middlewareSettings)||void 0===s?void 0:s.routingRules)&&void 0!==u?u:[],f=(null!==(c=t.remotePlugins)&&void 0!==c?c:[]).map(function(t){return y(p,void 0,void 0,function(){var s,u,c,f,p,h,v;return m(this,function(y){switch(y.label){case 0:if(function(t,e){var n=t[e.creationName],r=t[e.name];return!1===t.All&&!n&&!r||!1===n||!1===r}(n,t))return[2];y.label=1;case 1:return y.trys.push([1,6,,7]),(u=null==a?void 0:a.find(function(e){return e.pluginName===t.name}))?[3,3]:[4,ji(t,null==i?void 0:i.obfuscate)];case 2:u=y.sent(),y.label=3;case 3:return(s=u)?(c=r[t.name],[4,s(e(e({},t.settings),c))]):[3,5];case 4:f=y.sent(),function(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];t.forEach(function(t){e.forEach(function(e){var n;if(void 0===t[e])throw new Error("Plugin: ".concat(null!==(n=t.name)&&void 0!==n?n:"unknown"," missing required function ").concat(e))})})}(p=Array.isArray(f)?f:[f]),h=d.filter(function(e){return e.destinationName===t.creationName}),p.forEach(function(e){var n=new ki(t.creationName,e);h.length&&o&&n.addMiddleware(o),l.push(n)}),y.label=5;case 5:return[3,7];case 6:return v=y.sent(),console.warn("Failed to load Remote Plugin",v),wn(ne.system(),{integrationName:t.name,methodName:"load",type:"action",didError:!0}),[3,7];case 7:return[2]}})})}),[4,Promise.all(f)];case 1:return h.sent(),[2,l.filter(Boolean)]}})})}Kt();var Pi=null!==(_i=(xi=qt()).__SEGMENT_INSPECTOR__)&&void 0!==_i?_i:xi.__SEGMENT_INSPECTOR__={};function Oi(t,e,n){return y(this,void 0,void 0,function(){return m(this,function(r){switch(r.label){case 0:return[4,Ii(t,e)];case 1:return r.sent(),function(t,e){Object.keys(e.calls).forEach(function(n){e.getAndRemove(n).forEach(function(e){setTimeout(function(){$r(t,e).catch(console.error)},0)})})}(t,n),[2]}})})}se(),ge(),Ht();var Ii=function(t,e){return y(void 0,void 0,void 0,function(){return m(this,function(n){switch(n.label){case 0:return e.includes("ajs_")?[4,t.queryString(e).catch(console.error)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})};function Ai(t,e,n,r,i,o,a){var s,u,c;return void 0===i&&(i=[]),y(this,void 0,void 0,function(){var l,d,f,p,h,v,b,w,_,x,k,j,S,P,O=this;return m(this,function(I){switch(I.label){case 0:return function(t,e){Gr(t,e),Jr(t,e)}(n,a),l=null==i?void 0:i.filter(function(t){return"object"==typeof t}),d=null==i?void 0:i.filter(function(t){return"function"==typeof t&&"string"==typeof t.pluginName}),function(t){var e,n,r;return"test"!==mi().NODE_ENV&&(null!==(r=null===(n=null===(e=t.middlewareSettings)||void 0===e?void 0:e.routingRules)||void 0===n?void 0:n.length)&&void 0!==r?r:0)>0}(e)?[4,Promise.resolve().then(()=>(Pn(),Sn)).then(function(t){return t.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return p=I.sent(),[3,3];case 2:p=void 0,I.label=3;case 3:return f=p,A=e,"test"!==mi().NODE_ENV&&Object.keys(A.integrations).length>1||o.length>0?[4,Promise.resolve().then(()=>(Un(),Ln)).then(function(i){return i.ajsDestinations(t,e,n.integrations,r,f,o)})]:[3,5];case 4:return v=I.sent(),[3,6];case 5:v=[],I.label=6;case 6:return h=v,e.legacyVideoPluginsEnabled?[4,Promise.resolve().then(()=>(Hn(),Vn)).then(function(t){return t.loadLegacyVideoPlugins(n)})]:[3,8];case 7:I.sent(),I.label=8;case 8:return(null===(s=r.plan)||void 0===s?void 0:s.track)?[4,Promise.resolve().then(()=>(Wn(),Jn)).then(function(t){var n;return t.schemaFilter(null===(n=r.plan)||void 0===n?void 0:n.track,e)})]:[3,10];case 9:return w=I.sent(),[3,11];case 10:w=void 0,I.label=11;case 11:return b=w,_=vn(e,r),[4,Si(e,n.integrations,_,r,f,d).catch(function(t){return console.error("Failed to load remote plugins",t),[]})];case 12:return x=I.sent(),k=g(g([wi],h,!0),x,!0),b&&k.push(b),!1===(null===(u=r.integrations)||void 0===u?void 0:u.All)&&!r.integrations["Segment.io"]||r.integrations&&!1===r.integrations["Segment.io"]?[3,14]:(S=(j=k).push,[4,ui(n,_["Segment.io"],e.integrations)]);case 13:S.apply(j,[I.sent()]),I.label=14;case 14:return[4,n.register.apply(n,g(g([],k,!1),l,!1))];case 15:return P=I.sent(),[4,Hr(n,a)];case 16:return I.sent(),Object.entries(null!==(c=e.enabledMiddleware)&&void 0!==c?c:{}).some(function(t){return t[1]})?[4,Promise.resolve().then(()=>(Zn(),Yn)).then(function(t){var i=t.remoteMiddlewares;return y(O,void 0,void 0,function(){var t,o;return m(this,function(a){switch(a.label){case 0:return[4,i(P,e,r.obfuscate)];case 1:return t=a.sent(),o=t.map(function(t){return n.addSourceMiddleware(t)}),[2,Promise.all(o)]}})})})]:[3,18];case 17:I.sent(),I.label=18;case 18:return[4,Kr(n,a)];case 19:return I.sent(),[2,P]}var A})})}function Ei(t,n,r){var i,o,a,s,u,c,l,d,f;return void 0===n&&(n={}),y(this,void 0,void 0,function(){var p,h,v,y,g,b,w,_,x,k;return m(this,function(m){switch(m.label){case 0:return!0===n.disable?[2,[new yi,ne.system()]]:(n.globalAnalyticsKey&&(P=n.globalAnalyticsKey,he=P),t.cdnURL&&ln(t.cdnURL),n.initialPageview&&r.add(new Qr("page",[])),p=function(){var t,e,n=null!==(t=window.location.hash)&&void 0!==t?t:"",r=null!==(e=window.location.search)&&void 0!==e?e:"";return r.length?r:n.replace(/(?=#).*(?=\?)/,"")}(),h=null!==(i=t.cdnURL)&&void 0!==i?i:dn(),null===(o=t.cdnSettings)||void 0===o?[3,1]:(y=o,[3,3]));case 1:return[4,(j=t.writeKey,S=h,zt("".concat(S,"/v1/projects/").concat(j,"/settings")).then(function(t){return t.ok?t.json():t.text().then(function(t){throw new Error(t)})}).catch(function(t){throw console.error(t.message),t}))];case 2:y=m.sent(),m.label=3;case 3:return v=y,n.updateCDNSettings&&(v=n.updateCDNSettings(v)),"function"!=typeof n.disable?[3,5]:[4,n.disable(v)];case 4:if(m.sent())return[2,[new yi,ne.system()]];m.label=5;case 5:return g=null===(s=null===(a=v.integrations["Segment.io"])||void 0===a?void 0:a.retryQueue)||void 0===s||s,n=e({retryQueue:g},n),function(t){var e;null===(e=Pi.attach)||void 0===e||e.call(Pi,t)}(b=new vi(e(e({},t),{cdnSettings:v,cdnURL:h}),n)),w=null!==(u=t.plugins)&&void 0!==u?u:[],_=null!==(c=t.classicIntegrations)&&void 0!==c?c:[],x=null===(l=n.integrations)||void 0===l?void 0:l["Segment.io"],ee.initRemoteMetrics(e(e({},v.metrics),{host:null!==(d=null==x?void 0:x.apiHost)&&void 0!==d?d:null===(f=v.metrics)||void 0===f?void 0:f.host,protocol:null==x?void 0:x.protocol})),[4,Ai(t.writeKey,v,b,n,w,_,r)];case 6:return k=m.sent(),b.initialized=!0,b.emit("initialize",t,n),[4,Oi(b,p,r)];case 7:return m.sent(),[2,[b,k]]}var j,S,P})})}var Mi=function(t){function e(){var e=this,n=K(),r=n.promise,i=n.resolve;return(e=t.call(this,function(t){return r.then(function(e){return Ei(e[0],e[1],t)})})||this)._resolveLoadStart=function(t,e){return i([t,e])},e}return h(e,t),e.prototype.load=function(t,e){return void 0===e&&(e={}),this._resolveLoadStart(t,e),this},e.load=function(t,n){return void 0===n&&(n={}),(new e).load(t,n)},e.standalone=function(t,n){return e.load({writeKey:t},n).then(function(t){return t[0]})},e}(Xr);ue();var Ni={},Fi={load:(t,e)=>Mi.load(t,e)};function Ci(t){var e;return null!=(e=null==t?void 0:t.analytics)?e:Fi}function Ti(t,e){const{apiKey:n,identify:r,group:i,consent:o,_state:a,...s}=e,u={initialPageview:!1,...s};return t.load({writeKey:n},u)}function Di(t){if(!t)return"";try{return JSON.stringify(t)}catch(t){return""}}var Ri,Li={type:"segment",config:{},init({config:t,env:e}){var n;if(!(null==(n=t.settings)?void 0:n.apiKey))return!1;const r=t.settings,i=Ci(e),o={lastIdentity:{},lastGroup:{},loaded:!1};return!!t.consent&&Object.keys(t.consent).length>0||(o.analytics=Ti(i,r),o.loaded=!0),{...t,settings:{...r,_state:o}}},async push(t,{config:e,rule:n,env:r,data:i,collector:o}){var a,s;const u=Ci(r),c=e.settings||{},l=c._state||{},d=function(t,e,n){return n.analytics?n.analytics:n.loaded?void 0:(n.analytics=Ti(t,e),n.loaded=!0,n.analytics)}(u,c,l);if(!d)return;const f=(null==n?void 0:n.settings)||{},p=function(t,e){const n=e.consent;if(!n||0===Object.keys(n).length)return;const r=t.consent;if(!ir(r))return;const i={};for(const[t,e]of Object.entries(n))t in r&&(i[e]=!0===r[t]);return 0!==Object.keys(i).length?{context:{consent:{categoryPreferences:i}}}:void 0}(t,c);if(void 0!==f.reset){("boolean"==typeof f.reset?f.reset:await lr(t,f.reset,{collector:o}))&&(d.reset(),l.lastIdentity={},l.lastGroup={})}const h=null!=(a=f.identify)?a:c.identify;if(void 0!==h){const e=await lr(t,h,{collector:o});ir(e)&&function(t,e,n,r){var i;const o=n.lastIdentity||{},a=or(e.userId)?e.userId:void 0,s=or(e.anonymousId)?e.anonymousId:void 0,u=ir(e.traits)&&!nr(e.traits)?e.traits:void 0;s&&s!==o.anonymousId&&t.setAnonymousId(s);const c=Di(u),l=a!==o.userId,d=c!==(null!=(i=o.traitsHash)?i:"");(l||void 0!==u&&d||s)&&(r?t.identify(a,u||{},r):t.identify(a,u||{}),n.lastIdentity={userId:a,anonymousId:null!=s?s:o.anonymousId,traitsHash:c})}(d,e,l,p)}const v=null!=(s=f.group)?s:c.group;if(void 0!==v){const e=await lr(t,v,{collector:o});ir(e)&&function(t,e,n,r){var i;const o=or(e.groupId)?e.groupId:void 0;if(!o)return;const a=ir(e.traits)&&!nr(e.traits)?e.traits:void 0,s=n.lastGroup||{},u=Di(a),c=o!==s.groupId,l=u!==(null!=(i=s.traitsHash)?i:"");(c||l)&&(r?t.group(o,a||{},r):t.group(o,a||{}),n.lastGroup={groupId:o,traitsHash:u})}(d,e,l,p)}if(void 0!==f.page&&await async function(t,e,n,r,i){if(!0===e)return void(i?t.page(void 0,void 0,void 0,i):t.page());const o=await lr(n,e,{collector:r});if(!ir(o))return;const a=o,s=or(a.category)?a.category:void 0,u=or(a.name)?a.name:void 0,c=ir(a.properties)&&!nr(a.properties)?a.properties:void 0;i?t.page(null!=s?s:null,null!=u?u:null,null!=c?c:{},i):void 0!==c?t.page(null!=s?s:null,null!=u?u:null,c):void 0!==u||void 0!==s?t.page(null!=s?s:null,null!=u?u:null):t.page()}(d,f.page,t,o,p),!0!==(null==n?void 0:n.silent)){const e=or(null==n?void 0:n.name)?n.name:t.name,r=ir(i)?i:{};p?d.track(e,r,p):d.track(e,r)}c._state=l},on(t,e){var n,r;if("consent"!==t||!e.data)return;const i=e.data,o=null==(n=e.config)?void 0:n.consent;if(!o||0===Object.keys(o).length)return;const a=(null==(r=e.config)?void 0:r.settings)||{},s=a._state||{},u=Ci(e.env);Object.keys(o).every(t=>!0===i[t])&&!s.loaded&&(s.analytics=Ti(u,a),s.loaded=!0,a._state=s)}},qi=Li;return Ri=$n,f(r({},"__esModule",{value:!0}),Ri)})();
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
@segment/analytics-next/dist/pkg/vendor/tsub/tsub.js:
|