@amplitude/experiment-tag 0.9.2 → 0.9.3
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* @amplitude/experiment-tag v0.9.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebExperiment={})}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=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++,n=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=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:l(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),l=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},u=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function d(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var f=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=d(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!f(u,c))return!1;var p=!0;return Object.keys(e).forEach((function(r){f(e[r],t[r])||(p=!1)})),p}for(var h=0;h<e.length;h++)if(!f(e[h],t[h]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var h=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=c({},this.identity.userProperties),r=c(c({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,a,s,l=r.userProperties||{};try{for(var u=d(Object.entries(e)),c=u.next();!c.done;c=u.next()){var f=p(c.value,2),h=f[0],v=f[1];switch(h){case"$set":try{for(var g=(i=void 0,d(Object.entries(v))),m=g.next();!m.done;m=g.next()){var y=p(m.value,2),b=y[0],w=y[1];l[b]=w}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var x=(a=void 0,d(Object.keys(v))),S=x.next();!S.done;S=x.next()){delete l[b=S.value]}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return c({},this.identity)},e.prototype.setIdentity=function(e){var t=c({},this.identity);this.identity=c({},e),f(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,g=function(){function e(){this.identityStore=new h,this.eventBridge=new u,this.applicationContextProvider=new s}return e.getInstance=function(t){return v.analyticsConnectorInstances||(v.analyticsConnectorInstances={}),v.analyticsConnectorInstances[t]||(v.analyticsConnectorInstances[t]=new e),v.analyticsConnectorInstances[t]},e}(),m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},m(e,t)};function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var b=function(){return b=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},b.apply(this,arguments)};function w(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function x(e,t){var r,n,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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=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++,n=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=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function S(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function k(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function E(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var C="is",P="is not",O="contains",M="does not contain",_="less",A="less or equal",I="greater",N="greater or equal",j="version less",T="version less or equal",V="version greater",U="version greater or equal",R="set is",L="set is not",F="set contains",D="set does not contain",B="set contains any",K="set does not contain any",q="regex match",z="regex does not match",W=-862048943,H=461845907,J=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,a=0;a<i;a++){var s=Q(r,a<<2);o=$(s,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,W),u=X(u,15),o^=u=Math.imul(u,H);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,W),u=X(u,15),o^=u=Math.imul(u,H);break;case 1:u^=r[l],u=Math.imul(u,W),u=X(u,15),o^=u=Math.imul(u,H)}return G(o^=n)>>>0},$=function(e,t){var r=e,n=t;return r=Math.imul(r,W),r=X(r,15),r=Math.imul(r,H),n=X(n^=r,13),(n=Math.imul(n,5))+-430675100|0},G=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},X=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Q=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Z(r)},Z=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Y=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},ee="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),te=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(ee).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),re=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var a=S(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=S(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=b(b(b({},t.metadata),s.metadata),i.metadata);i=b(b({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var a=S(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(i=void 0,S(l)),d=c.next();!d.done;d=c.next()){var p=d.value;if(!(u=this.matchCondition(e,p)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=Y(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return J(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var a=this.coerceString(Y(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var d=S(t.bucket.allocations),p=d.next();!p.done;p=d.next()){var f=p.value,h=f.range[0],v=f.range[1];if(u>=h&&u<v)try{for(var g=(i=void 0,S(f.distributions)),m=g.next();!m.done;m=g.next()){var y=m.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case C:case O:case _:case A:case I:case N:case j:case T:case V:case U:case R:case F:case B:return r;case P:case M:case D:case K:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case R:return this.setEquals(e,r);case L:return!this.setEquals(e,r);case F:return this.matchesSetContainsAll(e,r);case D:return!this.matchesSetContainsAll(e,r);case B:return this.matchesSetContainsAny(e,r);case K:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case C:return this.matchesIs(e,r);case P:return!this.matchesIs(e,r);case O:return this.matchesContains(e,r);case M:return!this.matchesContains(e,r);case _:case A:case I:case N:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case j:case T:case V:case U:return this.matchesComparable(e,t,r,(function(e){return te.parse(e)}),this.versionComparator);case q:return this.matchesRegex(e,r);case z:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,a=n(e),s=r.map((function(e){return n(e)})).filter((function(e){return void 0!==e}));return void 0===a||0===s.length?r.some((function(r){return o.comparator(e,t,r)})):s.some((function(e){return i(a,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case _:case j:return e<r;case A:case T:return e<=r;case I:case V:return e>r;case N:case U:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case _:case j:return n<0;case A:case T:return n<=0;case I:case V:return n>0;case N:case U:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(r))?[i]:void 0}catch(e){var i;return(i=this.coerceString(r))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case R:case L:case F:case D:case B:case K:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&E([],k(n),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),ne=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var a=[],s=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var n=ne(e,t,r);n&&a.push.apply(a,E([],k(n),!1))};try{for(var l=S(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return a.push(o),r.pop(),delete t[o.key],a}};const ie="function"==typeof Buffer,oe=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),ae=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),se=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(ae),le=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ue=String.fromCharCode.bind(String),ce=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),de=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),pe=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=ae[t>>18&63]+ae[t>>12&63]+ae[t>>6&63]+ae[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},fe="function"==typeof btoa?e=>btoa(e):ie?e=>Buffer.from(e,"binary").toString("base64"):pe,he=ie?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(ue.apply(null,e.subarray(r,r+4096)));return fe(t.join(""))},ve=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?ue(192|t>>>6)+ue(128|63&t):ue(224|t>>>12&15)+ue(128|t>>>6&63)+ue(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return ue(240|t>>>18&7)+ue(128|t>>>12&63)+ue(128|t>>>6&63)+ue(128|63&t)},ge=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,me=e=>e.replace(ge,ve),ye=ie?e=>Buffer.from(e,"utf8").toString("base64"):oe?e=>he(oe.encode(e)):e=>fe(me(e)),be=(e,t=!1)=>t?ce(ye(e)):ye(e),we=e=>be(e,!0),xe=e=>{if(e=e.replace(/\s+/g,""),!le.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=se[e.charAt(o++)]<<18|se[e.charAt(o++)]<<12|(r=se[e.charAt(o++)])<<6|(n=se[e.charAt(o++)]),i+=64===r?ue(t>>16&255):64===n?ue(t>>16&255,t>>8&255):ue(t>>16&255,t>>8&255,255&t);return i},Se=we;var ke=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return y(t,e),t}(Error),Ee=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return y(t,e),t}(Error),Ce=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return w(this,void 0,void 0,(function(){var r,n,i,o;return x(this,(function(a){switch(a.label){case 0:return r=Se(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=Se(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new ke(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),Pe=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return w(this,void 0,void 0,(function(){var t,r;return x(this,(function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=Se(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),Oe="undefined"!=typeof globalThis?globalThis:global||self,Me=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},_e=function(){var e=Me();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},Ae=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Oe.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Oe.clearInterval(this.poller),this.poller=void 0)},e}(),Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Ne=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){!function(r,n){var i="function",o="undefined",a="object",s="string",l="model",u="name",c="type",d="vendor",p="version",f="architecture",h="console",v="mobile",g="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",x="Apple",S="ASUS",k="BlackBerry",E="Browser",C="Chrome",P="Firefox",O="Google",M="Huawei",_="LG",A="Microsoft",I="Motorola",N="Opera",j="Samsung",T="Sharp",V="Sony",U="Xiaomi",R="Zebra",L="Facebook",F=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},D=function(e,t){return typeof e===s&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var r,o,s,l,u,c,d=0;d<t.length&&!u;){var p=t[d],f=t[d+1];for(r=o=0;r<p.length&&!u;)if(u=p[r++].exec(e))for(s=0;s<f.length;s++)c=u[++o],typeof(l=f[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},z=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(D(t[r][i],e))return"?"===r?n:r}else if(D(t[r],e))return"?"===r?n:r;return e},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,p],[/opios[\/ ]+([\w\.]+)/i],[p,[u,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[u,N]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],p],[/\bfocus\/([\w\.]+)/i],[p,[u,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[u,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[u,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[p,[u,P]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],p],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,L],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[u,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,C+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[p,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[u,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,p],[/(cobalt)\/([\w\.]+)/i],[u,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,B]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,j],[c,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,j],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,x],[c,v]],[/(ipad\d+,\d+)/i],[l,[d,x],[c,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,x],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,x],[c,g]],[/(macintosh);/i],[l,[d,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,M],[c,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,M],[c,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,U],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,U],[c,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,I],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,I],[c,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,_],[c,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,_],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,v]],[/(pixel c)\b/i],[l,[d,O],[c,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[c,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,V],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,V],[c,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,S],[c,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,S],[c,v]],[/(nexus 9)/i],[l,[d,"HTC"],[c,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,T],[c,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,g]],[/(surface duo)/i],[l,[d,A],[c,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,v]],[/(u304aa)/i],[l,[d,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,v]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,g]],[/(sprint) (\w+)/i],[d,l,[c,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,A],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,R],[c,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,R],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,h]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[l,[d,V],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,A],[c,h]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,j],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,_],[c,m]],[/(apple) ?tv/i],[d,[l,x+" TV"],[c,m]],[/crkey/i],[[l,C+"cast"],[d,O],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,T],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,V],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,U],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,R],[c,y]],[/(quest( 2)?)/i],[l,[d,L],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[p,z,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[p,z,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,p],[/\(bb(10);/i],[p,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[u,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[u,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,p],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,p]]},J=function(e,t){if(typeof e===a&&(t=e,e=n),!(this instanceof J))return new J(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),h=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(H,t):H;return this.getBrowser=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[f]=n,q.call(e,i,h.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[l]=n,e[c]=n,q.call(e,i,h.device),e},this.getEngine=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.engine),e},this.getOS=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?K(e,350):e,this},this.setUA(i),this};J.VERSION="0.7.33",J.BROWSER=F([u,p,"major"]),J.CPU=F([f]),J.DEVICE=F([l,d,c,h,v,m,g,y,b]),J.ENGINE=J.OS=F([u,p]),e.exports&&(t=e.exports=J),t.UAParser=J;var $=typeof r!==o&&(r.jQuery||r.Zepto);if($&&!$.ua){var G=new J;$.ua=G.getResult(),$.ua.get=function(){return G.getUA()},$.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var r in t)$.ua[r]=t[r]}}}("object"==typeof window?window:Ie)})),je=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,r,n,i,o,a,s,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(n=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===n?void 0:n.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,n,i,o;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(o=null===(i=null===(n=this.amplitudeInstance)||void 0===n?void 0:n._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name},e}(),Te=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),Ve=function(){return Ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ve.apply(this,arguments)};function Ue(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function Re(e,t){var r,n,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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=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++,n=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=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Le(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fe(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function De(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Be=function(e,t){var r,n;void 0===t&&(t=!1);var i=Ke(e,t),o=void 0,a=Oe.document.cookie.split("; ");try{for(var s=Le(a),l=s.next();!l.done;l=s.next()){var u=Fe(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}if(o)try{if(t){var p=atob(o);return JSON.parse(decodeURIComponent(p))}var f=o.split("."),h=void 0;return f.length>=2&&f[1]&&(h=atob(f[1])),{deviceId:f[0],userId:h}}catch(e){return}},Ke=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},qe=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Ue(this,void 0,void 0,(function(){return Re(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=Be(this.apiKey,!0);return(e||(e=Be(this.apiKey,!1))||(e=function(e){var t=Ke(e,!0);try{var r=Oe.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=Ke(e,!0);try{var r=Oe.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Ue(this,void 0,void 0,(function(){var t,r=this;return Re(this,(function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){Oe.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var ze,We,He=Oe.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},l=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:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},Je=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),$e={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){Oe.setTimeout((function(){n(new Ee("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}(Ue(void 0,void 0,void 0,(function(){var i,o;return Re(this,(function(a){switch(a.label){case 0:return[4,He(e,{method:t,headers:r,body:n})];case 1:return i=a.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=a.sent(),[2,o]}}))})),i)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(ze||(ze={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(We||(We={}));var Ge=function(e){return!e||e===We.FallbackInline||e===We.FallbackConfig||e===We.SecondaryInitialVariants},Xe={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:ze.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:$e},Qe="1.16.2",Ze=function(){function e(e,t){var r,n=this;this.isReady=new Promise((function(e){n.resolve=e})),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:Xe.instanceName;this.queue=new et(i),this.cache=new Ye(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),Ye=function(){function e(e){this.isSessionStorageAvailable=tt(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Oe.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],n=!1;return r&&r.variant===e.variant||(n=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),n},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=Oe.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Oe.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),et=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=_e(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=Oe.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=Le(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var i=n.value;try{if(!this.tracker(i))return}catch(e){return}}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(Oe.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Oe.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),Oe.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),tt=function(){var e=Me();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},rt=function(){function e(){this.globalScope=Me()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),nt=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Ve({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=Le(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=Le(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(r[s]):r[s])&&(i[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),it=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var a={};return t?a.key=t:r&&(a.key=r),r&&(a.value=r),i&&(a.metadata=i),n&&(a.payload=n),o&&(a.expKey=o),a}},ot=function(){function e(){this.globalScope=Me()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),at=function(e){return null==e},st=function(e){return!!at(e)||e&&0===Object.keys(e).length},lt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},ut=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return Ue(this,void 0,void 0,(function(){var n=this;return Re(this,(function(i){return this.done||(this.timeoutHandle=Oe.setTimeout((function(){return Ue(n,void 0,void 0,(function(){var n,i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),ct=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},dt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},pt=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),ft=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),ht=function(){function e(e,t){var r,n,i,o,a=this;this.engine=new re,this.isRunning=!1,this.apiKey=e,t=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=Le(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=Fe(o.value,2),s=a[0],l=a[1];at(l)||(n[s]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}(t),this.config=Ve(Ve(Ve({},Xe),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":Xe.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(n=null==t?void 0:t.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://flag.lab.eu.amplitude.com":Xe.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:Xe.flagConfigPollingIntervalMillis});var s=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===s,this.poller=new Ae((function(){return a.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=it(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new pt(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new ft(this.config.exposureTrackingProvider)),this.integrationManager=new Ze(this.config,this);var u,c=new Je(this.config.httpClient||$e);this.flagApi=new Pe(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Ce(this.apiKey,this.config.serverUrl,c);var d=s?"".concat(this.config.instanceName,"-").concat(s):this.config.instanceName;u=this.isWebExperiment?new ot:new rt,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new nt(i,r,it)}(this.apiKey,d,u),this.flags=function(e,t,r){void 0===r&&(r=new rt);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new nt(i,r)}(this.apiKey,d,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){var t,r,n;return Re(this,(function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(n=this.config.fetchOnStart)||void 0===n||n?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(r=i.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return Ue(this,arguments,void 0,(function(e,t){var r;return void 0===e&&(e=this.user),Re(this,(function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return this.config.debug&&(r instanceof Ee?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);lt(r)||delete e[t]}return Ve(Ve(Ve({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Ve({},this.user.user_properties);return Ve(Ve({},this.user),{user_properties:t})}return Ve({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Ve({},e.user_properties);this.user=Ve(Ve({},e),{user_properties:r})}else this.user=Ve({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=b({},e),o=[],a=t||Object.keys(i);try{for(var s=S(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=ne(u,i);c&&o.push.apply(o,E([],k(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,n,i;if(!e)return{};var o={user:e},a=Me();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Le(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var p=d[0],f={group_name:p},h=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[p];h&&Object.keys(h).length>0&&(f.group_properties=h),s[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(n),a=this.engine.evaluate(o,i),s={};try{for(var l=Le(Object.keys(a)),u=l.next();!u.done;u=l.next()){var c=u.value;s[c]=dt(a[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===ze.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===ze.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(lt(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],a=We.LocalEvaluation,s=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!at(o)&&!s)return{variant:ct(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:ct(o),source:a,hasDefaultVariant:!0}),!at(r))return{variant:ct(r),source:We.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!at(l))return{variant:ct(l),source:We.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=ct(this.config.fallbackVariant),c={variant:u,source:We.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return st(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!at(i)&&!o)return{variant:ct(i),source:We.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:ct(i),source:We.LocalStorage,hasDefaultVariant:!0}),!at(t))return{variant:ct(t),source:We.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=this.config.initialVariants[e];if(!at(a))return{variant:ct(a),source:We.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var s=ct(this.config.fallbackVariant),l={variant:s,source:We.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return st(s)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!at(i))return{variant:ct(i),source:We.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!at(o)&&!a)return{variant:ct(o),source:We.LocalStorage,hasDefaultVariant:!1};if(a&&(n={variant:ct(o),source:We.LocalStorage,hasDefaultVariant:!0}),!at(t))return{variant:ct(t),source:We.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=ct(this.config.fallbackVariant),l={variant:s,source:We.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return st(s)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return Ue(this,void 0,void 0,(function(){var i,o;return Re(this,(function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Ve({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Ue(this,void 0,void 0,(function(){var n,i,o,a,s,l,u;return Re(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Ve({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=Le(Object.keys(n)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=dt(n[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return Ue(this,void 0,void 0,(function(){var e,t,r;return Re(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:Qe,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof Ee))throw r;if(this.config.debug&&console.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return Ue(this,void 0,void 0,(function(){var r,n,i,o;return Re(this,(function(a){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return Ue(this,void 0,void 0,(function(){var r=this;return Re(this,(function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new ut(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Ue(r,void 0,void 0,(function(){return Re(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=Ve(Ve(Ve({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Ve(Ve(Ve(Ve({library:"experiment-js-client/".concat(Qe)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==ze.LocalStorage?this.variants.getAll():this.config.source==ze.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==ze.LocalStorage?this.config.initialVariants:this.config.source==ze.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,a,s,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},p=Ge(t.source);if(!p||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var f=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(p||(null==f?void 0:f.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),f&&(d.metadata=f),this.isWebExperiment){var h=Me();if(null==h?void 0:h.location)try{var v=h.location.href;d.metadata.url=v.split("?")[0]||""}catch(e){}}null===(c=this.exposureTrackingProvider)||void 0===c||c.track(d),this.integrationManager.track(d)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,a,s;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:a,properties:{key:t,variant:o,source:n},userProperties:(i={},i[a]=o,i)}}(this.addContext(this.getUser()),e,t,r);Ge(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,De([e],Fe(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ke)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),vt=function(){function e(e,t){var r,n,i;this.globalScope=Me(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new Ne.UAParser(this.userAgent).getResult(),this.localStorage=new rt,this.sessionStorage=new ot,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Ve({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Le(i.searchParams),a=o.next();!a.done;a=o.next()){var s=Fe(a.value,2),l=s[0],u=s[1];n[l]=De(De([],Fe(null!==(r=n[l])&&void 0!==r?r:[]),!1),Fe(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce((function(e,t){var r=Fe(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();Oe.experimentInstances={};var gt=Oe.experimentInstances,mt=function(e,t){return wt(e,t)},yt=function(e,t){return wt(e,t,(function(){return new qe(e,g.getInstance(bt(t)),1e4)}))},bt=function(e){return(null==e?void 0:e.instanceName)||Xe.instanceName},wt=function(e,t,r){var n=function(e,t){var r=bt(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=gt[n];return i||(i=function(e,t){return new ht(e,Ve(Ve({},t),{userProvider:new vt(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),gt[n]=i,i)},xt={initialize:mt,initializeWithAmplitudeAnalytics:yt},St=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(e){return[2]}))}))},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Ue(this,void 0,void 0,(function(){return Re(this,(function(e){return[2,this]}))}))},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return Xe.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),kt=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Te,AmplitudeIntegrationPlugin:qe,AmplitudeUserProvider:je,Experiment:xt,ExperimentClient:ht,get Source(){return ze},StubExperimentClient:St,initialize:mt,initializeWithAmplitudeAnalytics:yt});function Et(){return Et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Et.apply(null,arguments)}var Ct=["selector","action","value","attribute"],Pt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ot={revert:function(){}},Mt=new Map,_t=[];function At(e){var t=Mt.get(e);return t||(t={element:e,attributes:{}},Mt.set(e,t)),t}function It(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function Nt(e,t,r,n,i){var o=r(e),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:e,_positionTimeout:null,rateLimitCount:0,observer:new MutationObserver((function(){if(!(a.rateLimitCount>=10||(a.rateLimitCount++,setTimeout((function(){a.rateLimitCount=a.rateLimitCount-1,a.rateLimitCount<=0&&(a.rateLimitCount=0)}),1e3),"position"===t&&a._positionTimeout))){"position"===t&&(a._positionTimeout=setTimeout((function(){a._positionTimeout=null}),1e3));var n=r(e);"position"===t&&It(n,a.virtualValue)||n!==a.virtualValue&&(a.originalValue=n,i(a))}})),mutationRunner:i,setValue:n,getCurrentValue:r};return"position"===t&&e.parentNode?a.observer.observe(e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(e,function(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}(t)),a}function jt(e,t){var r=t.getCurrentValue(t.el);t.virtualValue=e,e&&"string"!=typeof e&&"string"!=typeof r?r&&It(r,e)||(t.isDirty=!0,Yt()):e!==r&&(t.isDirty=!0,Yt())}function Tt(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),jt(function(e){$t||($t=document.createElement("div"));return $t.innerHTML=e,$t.innerHTML}(t),e)}function Vt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach((function(e){return e.mutate(t)})),jt(Array.from(t).filter(Boolean).join(" "),e)}function Ut(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),jt(t,e)}function Rt(e){if("insertSelector"in e){var t,r=e.insertSelector,n=e.direction,i=document.querySelector(r);if(!i)return null;switch(n){case"prepend":t={parentNode:i,insertBeforeNode:i.firstChild};break;case"append":t={parentNode:i,insertBeforeNode:null};break;case"before":t={parentNode:i.parentElement,insertBeforeNode:i};break;case"after":t={parentNode:i.parentElement,insertBeforeNode:i.nextSibling}}return Et({},t,{insertNode:i,direction:n})}var o=e.parentSelector,a=e.insertBeforeSelector,s=document.querySelector(o);if(!s)return null;var l=a?document.querySelector(a):null;return a&&!l?null:{parentNode:s,insertBeforeNode:l}}function Lt(e){for(var t=e.originalValue,r=e.mutations.length-1;r>=0;r--){var n,i=e.mutations[r];if(!i.newPosition||!i.newPosition.parentNode.isConnected||!1===(null==(n=i.newPosition.insertBeforeNode)?void 0:n.isConnected)){var o=Rt(i.mutate());i.newPosition=o}if(i.newPosition){t=i.newPosition;break}}jt(t,e)}var Ft=function(e){return e.innerHTML},Dt=function(e,t){e.innerHTML=t};function Bt(e){var t=At(e);return t.html||(t.html=Nt(e,"html",Ft,Dt,Tt)),t.html}var Kt=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextSibling}},qt=function(e,t){if("insertNode"in t)return t.insertNode[t.direction](e),void(t.insertBeforeNode=e.nextSibling||null);t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode)||t.parentNode.insertBefore(e,t.insertBeforeNode)};function zt(e){var t=At(e);return t.position||(t.position=Nt(e,"position",Kt,qt,Lt)),t.position}var Wt=function(e,t){t?e.className=t:e.removeAttribute("class")},Ht=function(e){return e.className};function Jt(e){var t=At(e);return t.classes||(t.classes=Nt(e,"class",Ht,Wt,Vt)),t.classes}var $t,Gt;function Xt(e,t){var r,n=At(e);return n.attributes[t]||(n.attributes[t]=Nt(e,t,(r=t,function(e){var t;return null!=(t=e.getAttribute(r))?t:null}),function(e){return function(t,r){return null!==r?t.setAttribute(e,r):t.removeAttribute(e)}}(t),Ut)),n.attributes[t]}function Qt(e,t,r){if(r.isDirty){r.isDirty=!1;var n=r.virtualValue;r.mutations.length||function(e,t){var r,n=Mt.get(e);if(n)if("html"===t)null==(r=n.html)||null==(r=r.observer)||r.disconnect(),delete n.html;else if("class"===t){var i;null==(i=n.classes)||null==(i=i.observer)||i.disconnect(),delete n.classes}else if("position"===t){var o;null==(o=n.position)||null==(o=o.observer)||o.disconnect(),delete n.position}else{var a;null==(a=n.attributes)||null==(a=a[t])||null==(a=a.observer)||a.disconnect(),delete n.attributes[t]}}(e,t),r.setValue(e,n)}}function Zt(e,t){e.html&&Qt(t,"html",e.html),e.classes&&Qt(t,"class",e.classes),e.position&&Qt(t,"position",e.position),Object.keys(e.attributes).forEach((function(r){Qt(t,r,e.attributes[r])}))}function Yt(){Mt.forEach(Zt)}function er(e,t){var r=null;"html"===e.kind?r=Bt(t):"class"===e.kind?r=Jt(t):"attribute"===e.kind?r=Xt(t,e.attribute):"position"===e.kind&&(r=zt(t)),r&&(r.mutations.push(e),r.mutationRunner(r))}function tr(e){if(!("position"===e.kind&&e.elements.size>0)){var t=new Set(e.elements);document.querySelectorAll(e.selector).forEach((function(r){t.has(r)||(e.elements.add(r),er(e,r))}))}}function rr(e){var t=_t.indexOf(e),r=[];if("position"===e.kind)for(var n=_t.length-1;n>t;n--){var i=_t[n];if("position"===i.kind){var o=i.newPosition;if(o){var a=!("direction"in o)||"before"===o.direction,s=nr(o.insertBeforeNode,e.elements,a);if(o.insertBeforeNode=s,"insertNode"in o)if("before"===o.direction)null===s?(o.insertNode=o.parentNode,o.direction="append"):o.insertNode=s;else if("after"===o.direction){var l=new Set(Array.from(e.elements).concat(Array.from(i.elements))),u=ir(o.insertBeforeNode,l);null===u?(o.direction="prepend",o.insertNode=o.parentNode):o.insertNode=u}}}r.push(i),rr(i)}e.elements.forEach((function(t){return function(e,t){var r=null;if("html"===e.kind?r=Bt(t):"class"===e.kind?r=Jt(t):"attribute"===e.kind?r=Xt(t,e.attribute):"position"===e.kind&&(r=zt(t)),r){var n=r.mutations.indexOf(e);-1!==n&&r.mutations.splice(n,1),r.mutationRunner(r)}}(e,t)})),_t.splice(t,1);for(var c=function(){var e=r.pop();if(!e)return 1;ar(e),e.elements.forEach((function(t){return er(e,t)}))};r.length>0;)c()}function nr(e,t,r){for(var n=e;n instanceof Element&&t.has(n);)n=r?n.nextElementSibling:n.nextSibling;return n}function ir(e,t){for(var r=(null==e?void 0:e.previousElementSibling)||null;r instanceof Element&&t.has(r);)r=r.previousElementSibling;return r}function or(){_t.forEach(tr)}function ar(e){return"undefined"==typeof document?Ot:(_t.push(e),tr(e),{__mutation:e,revert:function(){rr(e)}})}function sr(e,t){return ar({kind:"html",elements:new Set,mutate:t,selector:e})}function lr(e,t){return ar({kind:"position",elements:new Set,mutate:t,selector:e})}function ur(e,t){return ar({kind:"class",elements:new Set,mutate:t,selector:e})}function cr(e,t,r){return Pt.test(t)?"class"===t||"className"===t?ur(e,(function(e){var t=r(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach((function(t){return e.add(t)}))})):ar({kind:"attribute",attribute:t,elements:new Set,mutate:r,selector:e}):Ot}"undefined"!=typeof document&&(Gt||(Gt=new MutationObserver((function(){or()}))),or(),Gt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}));var dr={html:sr,classes:ur,attribute:cr,position:lr,declarative:function(e){var t=e.selector,r=e.action,n=e.value,i=e.attribute,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,Ct);if("html"===i){if("append"===r)return sr(t,(function(e){return e+(null!=n?n:"")}));if("set"===r)return sr(t,(function(){return null!=n?n:""}))}else if("class"===i){if("append"===r)return ur(t,(function(e){n&&e.add(n)}));if("remove"===r)return ur(t,(function(e){n&&e.delete(n)}));if("set"===r)return ur(t,(function(e){e.clear(),n&&e.add(n)}))}else if("position"===i){if("set"===r){if("insertSelector"in o)return lr(t,(function(){return{insertSelector:o.insertSelector,direction:o.direction}}));if("parentSelector"in o)return lr(t,(function(){return{insertBeforeSelector:o.insertBeforeSelector,parentSelector:o.parentSelector}}))}}else{if("append"===r)return cr(t,i,(function(e){return null!==e?e+(null!=n?n:""):null!=n?n:""}));if("set"===r)return cr(t,i,(function(){return null!=n?n:""}));if("remove"===r)return cr(t,i,(function(){return null}))}return Ot}},pr=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,r,n){void 0===r&&(r=void 0);var i=this.messageToSubscriberGroup.get(e);i||(i={subscribers:[]},this.messageToSubscriberGroup.set(e,i),n&&this.subscriberGroupCallback.set(e,n));var o={identifier:r,callback:t};i.subscribers.push(o)},e.prototype.publish=function(e,t){var r,n=this.messageToSubscriberGroup.get(e);n&&(n.subscribers.forEach((function(e){t=t||{},e.callback(t)})),null===(r=this.subscriberGroupCallback.get(e))||void 0===r||r(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}(),fr=function(){function e(e){this.modal=null,this.options=e}return e.prototype.show=function(){var e=this;this.modal||("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){e.createModal(),e.attachEventListeners()})):(this.createModal(),this.attachEventListeners()))},e.prototype.hide=function(){var e,t;this.modal&&(this.modal.remove(),this.modal=null),null===(t=(e=this.options).onDismiss)||void 0===t||t.call(e)},e.prototype.createModal=function(){if(document.body){this.modal=document.createElement("div"),this.modal.className="amp-preview-modal";var e=document.createElement("div");e.className="amp-preview-modal-container",Object.entries(this.options.flags).forEach((function(t){var r=o(t,2),n=r[0],i=r[1],a=document.createElement("div");a.className="amp-preview-modal-row";var s=document.createElement("div");s.className="amp-preview-modal-icon",s.innerHTML='\n <svg class="amp-preview-modal-icon-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.1389 11.4324L18.2087 18.1956H6.04109L11.1109 11.4324V6.02794H13.1389V11.4324ZM16.1402 4H8.10959C7.68372 4 7.45051 4.4867 7.71414 4.82131L9.083 6.53492V10.7632L3.20198 18.6011C2.70514 19.2704 3.1817 20.2235 4.01316 20.2235H20.2366C21.0681 20.2235 21.5447 19.2704 21.0478 18.6011L15.1668 10.7632V6.53492L16.5357 4.82131C16.7993 4.4867 16.5661 4 16.1402 4Z" fill="currentColor"/>\n </svg>\n ';var l=document.createElement("span");l.className="amp-preview-modal-title",l.textContent=n;var u=document.createElement("div");u.className="amp-preview-modal-badge amp-preview-modal-preview-badge",u.innerHTML='\n <svg class="amp-preview-modal-preview-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z" fill="currentColor"/>\n </svg>\n Preview Mode\n ';var c=document.createElement("span");c.className="amp-preview-modal-badge amp-preview-modal-variant-badge amp-preview-modal-variant-".concat(i.toLowerCase());var d=document.createElement("span");d.className="amp-preview-modal-variant-dot",c.appendChild(d),c.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),e.appendChild(a)}));var t=document.createElement("button");t.className="amp-preview-modal-close",t.setAttribute("aria-label","Dismiss preview mode notification"),t.innerHTML="×",this.modal.appendChild(e),this.modal.appendChild(t),this.injectStyles(),document.body.appendChild(this.modal)}},e.prototype.attachEventListeners=function(){var e=this;if(this.modal){var t=this.modal.querySelector(".amp-preview-modal-close");t&&t.addEventListener("click",(function(){return e.hide()}))}},e.prototype.injectStyles=function(){if(!document.getElementById("amp-preview-modal-styles")){var e=document.createElement("style");e.id="amp-preview-modal-styles",e.textContent="\n .amp-preview-modal {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 10000;\n background-color: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n color: #2d3748;\n animation: amp-preview-modal-slide-in 0.3s ease-out;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 12px 16px;\n max-width: 600px;\n }\n \n @keyframes amp-preview-modal-slide-in {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n \n .amp-preview-modal-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n \n .amp-preview-modal-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n \n .amp-preview-modal-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .amp-preview-modal-icon-img {\n width: 16px;\n height: 16px;\n color: #718096;\n }\n \n .amp-preview-modal-title {\n font-weight: 600;\n color: #1a202c;\n font-size: 14px;\n white-space: nowrap;\n }\n \n /* Base badge styles */\n .amp-preview-modal-badge {\n background-color: #ffffff;\n color: #4a5568;\n padding: 4px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #e2e8f0;\n }\n \n .amp-preview-modal-preview-badge {\n color: #718096;\n }\n \n .amp-preview-modal-preview-icon {\n width: 14px;\n height: 14px;\n color: currentColor;\n }\n \n .amp-preview-modal-variant-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #68d391;\n flex-shrink: 0;\n }\n \n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n \n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n \n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n \n .amp-preview-modal-close {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 6px;\n color: #a0aec0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 18px;\n line-height: 1;\n width: 24px;\n height: 24px;\n transition: all 0.2s ease;\n align-self: flex-start;\n }\n \n .amp-preview-modal-close:hover {\n background-color: #f7fafc;\n color: #718096;\n }\n \n .amp-preview-modal-close:focus {\n outline: 2px solid #3182ce;\n outline-offset: 1px;\n }\n \n /* Dark mode support */\n @media (prefers-color-scheme: dark) {\n .amp-preview-modal {\n background-color: #2d3748;\n border-color: #4a5568;\n color: #e2e8f0;\n }\n \n .amp-preview-modal-title {\n color: #f7fafc;\n }\n \n .amp-preview-modal-badge {\n background-color: #2d3748;\n color: #e2e8f0;\n border-color: #4a5568;\n }\n \n .amp-preview-modal-preview-badge {\n color: #a0aec0;\n }\n \n .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n \n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n \n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n \n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n \n .amp-preview-modal-close {\n color: #718096;\n }\n \n .amp-preview-modal-close:hover {\n background-color: #4a5568;\n color: #e2e8f0;\n }\n }\n ",document.head.appendChild(e)}},e}();var hr={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:150},vr=function(){function e(r,n,i,s){void 0===i&&(i=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var r,n;try{var i=t.filter((function(e){return l.shouldProcessMutation(e)}));if(0===i.length)return;if(l.pendingMutations.length+i.length>e.MAX_PENDING_MUTATIONS)return(r=l.pendingMutations).push.apply(r,a([],o(i),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(n=l.pendingMutations).push.apply(n,a([],o(i),!1)),l.processMutationsDebounced()}catch(e){}},this.target=r,this.onMutations=n,this.filters=i,this.options=t(t({},hr),s),this.processMutationsDebounced=function(e,t,r){void 0===r&&(r={});var n=null,i=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];r.maxWait&&!i&&(i=setTimeout((function(){n&&(clearTimeout(n),n=null),i=null,e.apply(void 0,a([],o(s),!1))}),r.maxWait)),n&&clearTimeout(n),n=setTimeout((function(){i&&(clearTimeout(i),i=null),e.apply(void 0,a([],o(s),!1))}),t)};return s.cancel=function(){n&&clearTimeout(n),i&&clearTimeout(i),n=null,i=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every((function(t){return t(e)}))}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),gr=new re,mr=function(e,r,n,a,s){var l=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.setPageObjects=function(e){l.pageObjects=e},this.initSubscriptions=function(){l.options.useDefaultNavigationHandler&&l.setupLocationChangePublisher(),l.setupPageObjectSubscriptions()},this.addPageChangeSubscriber=function(e){return l.pageChangeSubscribers.add(e),function(){l.pageChangeSubscribers.delete(e)}},this.setupPageObjectSubscriptions=function(){var e,t,r=function(e,t){var r,n,o=function(t){l.messageBus.subscribe(t.trigger_type,(function(r){l.isPageObjectActive(t,r)?l.webExperimentClient.updateActivePages(e,t,!0):l.webExperimentClient.updateActivePages(e,t,!1)}),void 0,(function(e){var r,n;if(!("updateActivePages"in e&&e.updateActivePages||l.options.isVisualEditorMode)){if("url_change"===t.trigger_type){Object.values(l.webExperimentClient.appliedMutations).forEach((function(e){Object.values(e).forEach((function(e){e[Qr]&&Object.values(e[Qr]).forEach((function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)}))}))}));var o=l.webExperimentClient.appliedMutations;Object.keys(o).forEach((function(e){var t=o[e];Object.keys(t).forEach((function(e){t[e][Qr]&&(delete t[e][Qr],0===Object.keys(t[e]).length&&delete t[e])})),0===Object.keys(t).length&&delete o[e]}))}l.webExperimentClient.applyVariants()}var a=l.webExperimentClient.getActivePages();if(!l.areActivePagesEqual(a,l.lastNotifiedActivePages)){l.lastNotifiedActivePages=l.cloneActivePagesMap(a);try{for(var s=(r=void 0,i(l.pageChangeSubscribers)),u=s.next();!u.done;u=s.next())(0,u.value)({activePages:a})}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}))};try{for(var a=(r=void 0,i(Object.values(t))),s=a.next();!s.done;s=a.next())o(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}};try{for(var n=i(Object.entries(l.pageObjects)),a=n.next();!a.done;a=n.next()){var s=o(a.value,2);r(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},this.setupMutationObserverPublisher=function(){return new vr(l.globalScope.document.documentElement,(function(e){l.messageBus.publish("element_appeared",{mutationList:e})}),[]).observe()},this.setupLocationChangePublisher=function(){l.globalScope.addEventListener("popstate",(function(){l.messageBus.publish("url_change")}));var e,t,r=function(){l.messageBus.publish("url_change"),l.globalScope.webExperiment.previousUrl=l.globalScope.location.href};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e.apply(this,t);return r(),i},history.replaceState=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,e);return r(),i}},this.isPageObjectActive=function(e,t){if(e.conditions&&e.conditions.length>0&&!gr.evaluateConditions({context:{page:{url:l.globalScope.location.href}},result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":return t.name===e.trigger_value.name;case"analytics_event":var r=t;return r.event_type===e.trigger_value.event_type&&Object.entries(e.trigger_value.event_properties||{}).every((function(e){var t=o(e,2),n=t[0],i=t[1];return r.event_properties[n]===i}));case"element_appeared":var n=l.globalScope.document.querySelector(e.trigger_value.selector);if(n){var i=window.getComputedStyle(n);return"none"!==i.display&&"hidden"!==i.visibility}return!1;default:return!1}},this.cloneActivePagesMap=function(e){var r={};for(var n in e)for(var i in r[n]={},e[n])r[n][i]=t({},e[n][i]);return r},this.areActivePagesEqual=function(e,t){var r,n,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var u=i(s),c=u.next();!c.done;c=u.next()){var d=c.value,p=e[d],f=t[d];if(!f)return!1;var h=Object.keys(p),v=Object.keys(f);if(h.length!==v.length)return!1;try{for(var g=(o=void 0,i(h)),m=g.next();!m.done;m=g.next()){var y=m.value,b=p[y],w=f[y];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!0},this.webExperimentClient=e,this.messageBus=r,this.pageObjects=n,this.options=a,this.globalScope=s},yr={useDefaultNavigationHandler:!0},br="dclid",wr="fbclid",xr="gbraid",Sr="gclid",kr="ko_click_id",Er="li_fat_id",Cr="msclkid",Pr="rtd_cid",Or="ttclid",Mr="twclid",_r="wbraid",Ar={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ir=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Nr=function(){var e,t=Ir();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=jr(r[0]),i=jr(r[1]);return i?(e[n]=i,e):e}),{}):{}},jr=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Tr=function(){function e(e){this.options=t({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:if(!Ir())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return r(this,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(r=n.sent()))return[2,void 0];try{return void 0===(i=null!==(t=Vr(r))&&void 0!==t?t:Ur(r))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(i)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,i;return r(this,void 0,void 0,(function(){var r,o,a;return n(this,(function(n){return r=Ir(),o=null!==(i=null===(t=null==r?void 0:r.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==i?i:[],(a=o.find((function(t){return 0===t.indexOf(e+"=")})))?[2,a.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var r,o,a,s,l,u,c;return n(this,(function(n){try{r=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,a=void 0,(o=null!==t?r:-1)&&((s=new Date).setTime(s.getTime()+24*o*60*60*1e3),a=s),l="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),a&&(l+="; expires=".concat(a.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite)),(u=Ir())&&(u.document.cookie=l)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))},e}(),Vr=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},Ur=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},Rr=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,t(t(t(t({},Ar),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Nr();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=Nr();return(e={})[br]=t[br],e[wr]=t[wr],e[xr]=t[xr],e[Sr]=t[Sr],e[kr]=t[kr],e[Er]=t[Er],e[Cr]=t[Cr],e[Pr]=t[Pr],e[Or]=t[Or],e[Mr]=t[Mr],e[_r]=t[_r],e},e}();var Lr=function(e,t){var r;try{var n=null===(r=Br(e))||void 0===r?void 0:r.getItem(t);return n?JSON.parse(n):null}catch(t){return console.warn("Failed to get and parse JSON from ".concat(e,":"),t),null}},Fr=function(e,t,r){var n;try{var i=JSON.stringify(r);null===(n=Br(e))||void 0===n||n.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},Dr=function(e,t){var r;try{null===(r=Br(e))||void 0===r||r.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},Br=function(e){var t=Me();return t?t[e]:null},Kr="visual-editor-state",qr=function(){function e(){}return e.setup=function(){var t,r="closed",n=e.getStoredSession();if(n)return r="opening",void zr(n.injectSrc).then((function(){r="open"})).catch((function(e){console.warn("Failed to load overlay from stored session:",e),r="closed"}));null===(t=Me())||void 0===t||t.addEventListener("message",(function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return}catch(e){return}if("OpenOverlay"===e.data.type){if("closed"!==r||!t.test(new URL(e.data.context.injectSrc).hostname))return;r="opening",zr(e.data.context.injectSrc).then((function(){r="open"})).catch((function(){r="closed"}))}}))},e.getStoredSession=function(){var e=Lr("sessionStorage",Kr);if(!e)return null;try{if(!/^.*\.amplitude\.com$/.test(new URL(e.injectSrc).hostname))return null}catch(e){return null}return e},e}(),zr=function(e){return new Promise((function(t,r){var n=function(){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");o&&i.setAttribute("nonce",o.nonce||o.nonce||o.getAttribute("nonce")),i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){r({status:!1,message:"Failed to load the script ".concat(e)})})),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}};"complete"===document.readyState?n():window.addEventListener("load",n,{once:!0})}))},Wr=function(){var e,t,r=Me(),n=new URLSearchParams(null==r?void 0:r.location.search),a={};try{for(var s=i(n),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];a[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},Hr=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},Jr=function(e,t){var r,n,o=new URL(e);try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o.toString()},$r=function(e,t){return t=t.replace(/\/$/,""),e.some((function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var r=new RegExp("^".concat(e,"$"));return r.test(t)||r.test(t+"/")}))},Gr=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Gr)},Xr="mutate",Qr="inject",Zr="PREVIEW",Yr="amp-preview-mode",en="VISUAL_EDITOR";Oe.Experiment=kt;var tn=function(){function e(e,r,n,i){void 0===i&&(i={});var s,l=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.isVisualEditorMode=!1,this.previewFlags={};var u=Me();if(!u||!_e())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=u,this.apiKey=e,this.initialFlags=JSON.parse(r),this.pageObjects=JSON.parse(n),this.config=t(t(t({},yr),i),null!==(s=this.globalScope.experimentConfig)&&void 0!==s?s:{});var c,d,p=Wr(),f={};if(p[Zr]?Object.keys(p).forEach((function(e){"PREVIEW"!==e&&p[e]&&(f[e]=p[e])})):f=Lr("sessionStorage",Yr)||{},this.initialFlags.forEach((function(e){var t=e.key,r=e.variants,n=e.metadata,i=void 0===n?{}:n;if(l.flagVariantMap[t]={},Object.keys(r).forEach((function(e){l.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r}(r[e])})),t in f&&f[t]in r){l.previewFlags[t]=f[t];var o={metadata:{segmentName:"Preview"},variant:f[t]};e.segments=[o],i.evaluationMode="local"}"local"!==i.evaluationMode&&l.remoteFlagKeys.push(t),e.metadata=i})),Object.keys(this.previewFlags).length>0){if(p[Zr]){Fr("sessionStorage",Yr,this.previewFlags);var h=a(a([],o(Object.keys(this.previewFlags)),!1),[Zr],!1);this.globalScope.history.replaceState({},"",Jr(this.globalScope.location.href,h))}c={flags:this.previewFlags},d=new fr(c),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){d.show()})):d.show()}var v=JSON.stringify(this.initialFlags);this.experimentClient=xt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:v,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var g=this.experimentClient.all();this.localFlagKeys=Object.keys(g).filter((function(e){var t,r;return"local"===(null===(r=null===(t=g[e])||void 0===t?void 0:t.metadata)||void 0===r?void 0:r.evaluationMode)})),this.messageBus=new pr}return e.prototype.start=function(){return r(this,void 0,void 0,(function(){var e,r,a,s,l,u,c,d,p,f,h,v,m,y,b,w;return n(this,(function(n){switch(n.label){case 0:if(this.isRunning)return[2];if(HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},e=Wr(),this.isVisualEditorMode="true"===e[en]||null!==Lr("sessionStorage",Kr),this.subscriptionManager=new mr(this,this.messageBus,this.pageObjects,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode}),this.globalScope),this.subscriptionManager.initSubscriptions(),this.isVisualEditorMode)return qr.setup(),this.globalScope.history.replaceState({},"",Jr(this.globalScope.location.href,[en])),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,[2];this.messageBus.publish("url_change",{updateActivePages:!0}),r="EXP_".concat(this.apiKey.slice(0,10)),(a=Lr("localStorage",r)||{}).web_exp_id?a.web_exp_id&&a.device_id&&(delete a.device_id,Fr("localStorage",r,a)):(a.web_exp_id=a.device_id||Gr(),delete a.device_id,Fr("localStorage",r,a)),s=this.getVariants();try{for(l=i(Object.entries(s)),u=l.next();!u.done;u=l.next())c=o(u.value,2),d=c[0],p=c[1],this.remoteFlagKeys.includes(d)&&(null===(m=p.metadata)||void 0===m?void 0:m.blockingEvaluation)&&Object.keys(this.activePages).includes(d)&&(this.isRemoteBlocking=!0,this.applyAntiFlickerCss())}catch(e){h={error:e}}finally{try{u&&!u.done&&(v=l.return)&&v.call(l)}finally{if(h)throw h.error}}return this.globalScope.experimentIntegration||(f=g.getInstance("$default_instance"),this.globalScope.experimentIntegration=new qe(this.apiKey,f,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(a),this.isRemoteBlocking||null===(w=null===(b=(y=this.globalScope.document).getElementById)||void 0===b?void 0:b.call(y,"amp-exp-css"))||void 0===w||w.remove(),this.applyVariants({flagKeys:this.localFlagKeys}),0===this.remoteFlagKeys.length?(this.isRunning=!0,[2]):[4,this.fetchRemoteFlags()];case 1:return n.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,[2]}}))}))},e.getInstance=function(t,r,n,i){void 0===i&&(i={});var o=Me();if(!o)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(null==o?void 0:o.webExperiment)return o.webExperiment;var a=new e(t,r,n,i);return o.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.applyVariants=function(e){var t,r,n=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=Hr(this.globalScope.location.href);for(var a in(null===(t=this.urlExposureCache)||void 0===t?void 0:t[o])||(this.urlExposureCache={},this.urlExposureCache[o]={}),this.fireStoredRedirectImpressions(),i)if(!n||n.includes(a)){var s=i[a],l=s.key||"";if(this.appliedMutations[a]){var u=Object.keys(this.appliedMutations[a]);u.length>0&&!u.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(r=s.metadata)||void 0===r?void 0:r.deliveryMethod)){var c=Array.isArray(s.payload);if(("off"===s.key||"control"===s.key)&&(this.isActionActiveOnPage(a,void 0)&&this.exposureWithDedupe(a,s),"off"===s.key)){this.revertVariants({flagKeys:[a]});continue}c&&this.handleVariantAction(a,s)}}}},e.prototype.revertVariants=function(e){var t,r,n,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=i(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.appliedMutations[u];if(c){for(var d in c){var p=c[d];if(p)for(var f in p)for(var h in p[f])null===(o=null===(n=p[f][h])||void 0===n?void 0:n.revert)||void 0===o||o.call(n)}delete this.appliedMutations[u]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){var t=e.keyToVariant;if(t)for(var r in this.revertVariants({flagKeys:Object.keys(t)}),t){var n=t[r],i=this.flagVariantMap[r];if(!i)return;var o=i[n];if(!o)return;var a=o.payload;if(!a||!Array.isArray(a))return;this.handleVariantAction(r,o)}},e.prototype.getVariants=function(){var e,t,r={};try{for(var n=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=n.next();!s.done;s=n.next()){var l=s.value;r[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.setPageObjects=function(e){var t,r;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(r=this.subscriptionManager)||void 0===r||r.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.fetchRemoteFlags=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}}))}))},e.prototype.handleVariantAction=function(e,t){var r,n;try{for(var o=i(t.payload),a=o.next();!a.done;a=o.next()){var s=a.value;"redirect"===s.action?this.handleRedirect(s,e,t):s.action===Xr?this.handleMutate(s,e,t):s.action===Qr&&this.handleInject(s,e,t)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.handleRedirect=function(e,t,i){var o,a,s;if(this.isActionActiveOnPage(t,null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.scope)){var l=Hr(this.previousUrl||this.globalScope.document.referrer),u=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(Hr(this.globalScope.location.href)!==l){var c=function(e,t){var r=new URL(e),n=new URL(t),i=new URL(t);return r.searchParams.forEach((function(e,t){n.searchParams.has(t)||i.searchParams.append(t,e)})),i.toString()}(this.globalScope.location.href,u);this.globalScope.location.href!==c&&(this.storeRedirectImpressions(t,i,u),this.previousUrl=this.globalScope.location.href,function(e){return r(this,void 0,void 0,(function(){var t,r,i,o;return n(this,(function(n){switch(n.label){case 0:return t=new Tr({sameSite:"Lax"}),r=new Rr,i="AMP_".concat("MKTG","_ORIGINAL_").concat(e.substring(0,10)),[4,r.parse()];case 1:return o=n.sent(),[4,t.set(i,o)];case 2:return n.sent(),[2]}}))}))}(this.apiKey).then(),this.customRedirectHandler?this.customRedirectHandler(c):this.globalScope.location.replace(c))}}},e.prototype.handleMutate=function(e,r,n){var i,o,a,s,l,u=this,c=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=n.key||"";if(0!==c.length){var p={};c.forEach((function(e,t){var i,o,a,s,l,c,f,h,v,g,m;u.isActionActiveOnPage(r,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(u.exposureWithDedupe(r,n),(null===(m=null===(g=null===(v=u.appliedMutations[r])||void 0===v?void 0:v[d])||void 0===g?void 0:g[Xr])||void 0===m?void 0:m[t])||(p[t]=dr.declarative(e))):(null===(s=null===(a=null===(o=u.appliedMutations[r])||void 0===o?void 0:o[d])||void 0===a?void 0:a[Xr])||void 0===s?void 0:s[t])&&(null===(h=null===(f=null===(c=null===(l=u.appliedMutations[r])||void 0===l?void 0:l[d])||void 0===c?void 0:c[Xr])||void 0===f?void 0:f[t])||void 0===h||h.revert(),delete u.appliedMutations[r][d][Xr][t])})),null!==(o=(s=this.appliedMutations)[r])&&void 0!==o||(s[r]={}),null!==(a=(l=this.appliedMutations[r])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[r][d][Xr]=t(t({},this.appliedMutations[r][d][Xr]),p),0===Object.keys(this.appliedMutations[r][d][Xr]||{}).length&&delete this.appliedMutations[r][d][Xr],0===Object.keys(this.appliedMutations[r][d]||{}).length&&delete this.appliedMutations[r]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,u,c,d,p,f,h,v,g,m=this,y=i.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.scope)){var b=e.data.id;if(b&&"string"==typeof b&&0!==b.length&&(b=b.replace(/-/g,""),!this.appliedInjections.has(b))){var w,x=e.data.js;x&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(x,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var S,k=e.data.css;k&&(S=this.globalScope.document.createElement("style"))&&(S.innerHTML=k,S.id="css-".concat(b),this.globalScope.document.head.appendChild(S));var E,C=e.data.html;C&&(E=null!==(c=(new DOMParser).parseFromString(C,"text/html").body.firstElementChild)&&void 0!==c?c:void 0);var P={waitForElement:function(e){return r(this,void 0,void 0,(function(){var t;return n(this,(function(r){return(t=document.querySelector(e))?[2,t]:[2,new Promise((function(t){var r=new MutationObserver((function(){var n=document.querySelector(e);n&&(r.disconnect(),t(n))}));r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))]}))}))}};this.appliedInjections.add(b);try{var O=this.globalScope[b];O&&"function"==typeof O&&O(E,P,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(h=this.appliedMutations)[t])&&void 0!==d||(h[t]={}),null!==(p=(v=this.appliedMutations[t])[y])&&void 0!==p||(v[y]={}),null!==(f=(g=this.appliedMutations[t][y])[Qr])&&void 0!==f||(g[Qr]={}),this.appliedMutations[t][y][Qr][b]={revert:function(){var e;null===(e=P.remove)||void 0===e||e.call(P),null==S||S.remove(),null==w||w.remove(),m.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(u=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[y])||void 0===s?void 0:s[Qr])||void 0===l?void 0:l[0])||void 0===u||u.revert()},e.prototype.exposureWithDedupe=function(e,t,r){var n,i,o=Hr(this.globalScope.location.href);if(!((null===(i=null===(n=this.urlExposureCache)||void 0===n?void 0:n[o])||void 0===i?void 0:i[e])===t.key)){if(r){var a={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,a)}else this.experimentClient.exposure(e);this.urlExposureCache[o][e]=t.key}},e.prototype.applyAntiFlickerCss=function(){if(!this.globalScope.document.getElementById("amp-exp-css")){var e=document.createElement("style");e.id="amp-exp-css",e.innerText="* { visibility: hidden !important; background-image: none !important; }",document.head.appendChild(e),this.globalScope.window.setTimeout((function(){e.remove()}),1e3)}},e.prototype.updateActivePages=function(e,t,r){this.activePages[e]||(this.activePages[e]={}),r?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var r=this.activePages[e];return t?t.some((function(e){var t;return null!==(t=null==r?void 0:r[e])&&void 0!==t&&t})):!!r&&Object.values(r).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,t,r){var n="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),i=Lr("sessionStorage",n)||{};i[e]={redirectUrl:r,variant:t},Fr("sessionStorage",n,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),r=Lr("sessionStorage",t)||{};if(Object.keys(r).length>0)for(var n in r){var i=r[n],o=i.redirectUrl,a=i.variant,s=Hr(this.globalScope.location.href),l=Hr(o);$r([s],l)&&(this.exposureWithDedupe(n,a,!0),delete r[n])}Object.keys(r).length>0?this.globalScope.setTimeout((function(){var r=Lr("sessionStorage",t)||{};for(var n in r)e.exposureWithDedupe(n,r[n].variant,!0);Dr("sessionStorage",t)}),500):Dr("sessionStorage",t)},e}();e.initialize=function(e,t,r,n){tn.getInstance(e,t,r,n).start().finally((function(){var e;null===(e=document.getElementById("amp-exp-css"))||void 0===e||e.remove()}))},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
/* @amplitude/experiment-tag v0.9.3 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.9.3/files/LICENSE */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebExperiment={})}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=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++,n=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=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:l(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),l=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},u=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),c=function(){return c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function d(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var f=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var o=d(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!f(u,c))return!1;var p=!0;return Object.keys(e).forEach((function(r){f(e[r],t[r])||(p=!1)})),p}for(var h=0;h<e.length;h++)if(!f(e[h],t[h]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var h=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=c({},this.identity.userProperties),r=c(c({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,o,a,s,l=r.userProperties||{};try{for(var u=d(Object.entries(e)),c=u.next();!c.done;c=u.next()){var f=p(c.value,2),h=f[0],v=f[1];switch(h){case"$set":try{for(var g=(i=void 0,d(Object.entries(v))),m=g.next();!m.done;m=g.next()){var y=p(m.value,2),b=y[0],w=y[1];l[b]=w}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var x=(a=void 0,d(Object.keys(v))),S=x.next();!S.done;S=x.next()){delete l[b=S.value]}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return c({},this.identity)},e.prototype.setIdentity=function(e){var t=c({},this.identity);this.identity=c({},e),f(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,g=function(){function e(){this.identityStore=new h,this.eventBridge=new u,this.applicationContextProvider=new s}return e.getInstance=function(t){return v.analyticsConnectorInstances||(v.analyticsConnectorInstances={}),v.analyticsConnectorInstances[t]||(v.analyticsConnectorInstances[t]=new e),v.analyticsConnectorInstances[t]},e}(),m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},m(e,t)};function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var b=function(){return b=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},b.apply(this,arguments)};function w(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function x(e,t){var r,n,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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=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++,n=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=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function S(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function k(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function E(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var C="is",P="is not",O="contains",M="does not contain",_="less",A="less or equal",I="greater",N="greater or equal",j="version less",T="version less or equal",V="version greater",U="version greater or equal",R="set is",L="set is not",F="set contains",D="set does not contain",B="set contains any",K="set does not contain any",q="regex match",z="regex does not match",W=-862048943,H=461845907,J=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&n+1<e.length&&56320==(64512&e.charCodeAt(n+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n)),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128)}return Uint8Array.from(t)}(e),n=r.length,i=n>>2,o=t,a=0;a<i;a++){var s=Q(r,a<<2);o=$(s,o)}var l=i<<2,u=0;switch(n-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,W),u=X(u,15),o^=u=Math.imul(u,H);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,W),u=X(u,15),o^=u=Math.imul(u,H);break;case 1:u^=r[l],u=Math.imul(u,W),u=X(u,15),o^=u=Math.imul(u,H)}return G(o^=n)>>>0},$=function(e,t){var r=e,n=t;return r=Math.imul(r,W),r=X(r,15),r=Math.imul(r,H),n=X(n^=r,13),(n=Math.imul(n,5))+-430675100|0},G=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},X=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},Q=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Z(r)},Z=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Y=function(e,t){var r,n;if(t&&0!==t.length){try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e||void 0}},ee="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),te=function(){function e(e,t,r,n){void 0===n&&(n=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=n}return e.parse=function(t){if(t){var r=new RegExp(ee).exec(t);if(r){var n=Number(r[1]),i=Number(r[2]);if(!isNaN(n)&&!isNaN(i))return new e(n,i,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),re=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,n,i={},o={context:e,result:i};try{for(var a=S(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(i[l.key]=u)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},e.prototype.evaluateFlag=function(e,t){var r,n,i;try{for(var o=S(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(i=this.evaluateSegment(e,t,s)){var l=b(b(b({},t.metadata),s.metadata),i.metadata);i=b(b({},i),{metadata:l});break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.evaluateSegment=function(e,t,r){var n;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0:void 0!==(n=this.bucket(e,r))?t.variants[n]:void 0},e.prototype.evaluateConditions=function(e,t){var r,n,i,o;try{for(var a=S(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(i=void 0,S(l)),d=c.next();!d.done;d=c.next()){var p=d.value;if(!(u=this.matchCondition(e,p)))break}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=Y(e,t.selector);if(r){if(this.isSetOperator(t.op)){var n=this.coerceStringArray(r);return!!n&&this.matchSet(n,t.op,t.values)}var i=this.coerceString(r);return void 0!==i&&this.matchString(i,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return J(e)},e.prototype.bucket=function(e,t){var r,n,i,o;if(!t.bucket)return t.variant;var a=this.coerceString(Y(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var d=S(t.bucket.allocations),p=d.next();!p.done;p=d.next()){var f=p.value,h=f.range[0],v=f.range[1];if(u>=h&&u<v)try{for(var g=(i=void 0,S(f.distributions)),m=g.next();!m.done;m=g.next()){var y=m.value,b=y.range[0],w=y.range[1];if(c>=b&&c<w)return y.variant}}catch(e){i={error:e}}finally{try{m&&!m.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case C:case O:case _:case A:case I:case N:case j:case T:case V:case U:case R:case F:case B:return r;case P:case M:case D:case K:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case R:return this.setEquals(e,r);case L:return!this.setEquals(e,r);case F:return this.matchesSetContainsAll(e,r);case D:return!this.matchesSetContainsAll(e,r);case B:return this.matchesSetContainsAny(e,r);case K:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var n=this;switch(t){case C:return this.matchesIs(e,r);case P:return!this.matchesIs(e,r);case O:return this.matchesContains(e,r);case M:return!this.matchesContains(e,r);case _:case A:case I:case N:return this.matchesComparable(e,t,r,(function(e){return n.parseNumber(e)}),this.comparator);case j:case T:case V:case U:return this.matchesComparable(e,t,r,(function(e){return te.parse(e)}),this.versionComparator);case q:return this.matchesRegex(e,r);case z:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,n;try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,n,i){var o=this,a=n(e),s=r.map((function(e){return n(e)})).filter((function(e){return void 0!==e}));return void 0===a||0===s.length?r.some((function(r){return o.comparator(e,t,r)})):s.some((function(e){return i(a,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case _:case j:return e<r;case A:case T:return e<=r;case I:case V:return e>r;case N:case U:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var n=e.compareTo(r);switch(t){case _:case j:return n<0;case A:case T:return n<=0;case I:case V:return n>0;case N:case U:return n>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var n=JSON.parse(r);return Array.isArray(n)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(i=this.coerceString(r))?[i]:void 0}catch(e){var i;return(i=this.coerceString(r))?[i]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case R:case L:case F:case D:case B:case K:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),n=new Set(t);return r.size===n.size&&E([],k(n),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,n;if(e.length<t.length)return!1;try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,n;try{for(var i=S(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},e}(),ne=function(e,t,r){var n,i;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var a=[],s=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var n=ne(e,t,r);n&&a.push.apply(a,E([],k(n),!1))};try{for(var l=S(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return a.push(o),r.pop(),delete t[o.key],a}};const ie="function"==typeof Buffer,oe=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),ae=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),se=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(ae),le=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ue=String.fromCharCode.bind(String),ce=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),de=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),pe=e=>{let t,r,n,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|i,o+=ae[t>>18&63]+ae[t>>12&63]+ae[t>>6&63]+ae[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},fe="function"==typeof btoa?e=>btoa(e):ie?e=>Buffer.from(e,"binary").toString("base64"):pe,he=ie?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,n=e.length;r<n;r+=4096)t.push(ue.apply(null,e.subarray(r,r+4096)));return fe(t.join(""))},ve=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?ue(192|t>>>6)+ue(128|63&t):ue(224|t>>>12&15)+ue(128|t>>>6&63)+ue(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return ue(240|t>>>18&7)+ue(128|t>>>12&63)+ue(128|t>>>6&63)+ue(128|63&t)},ge=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,me=e=>e.replace(ge,ve),ye=ie?e=>Buffer.from(e,"utf8").toString("base64"):oe?e=>he(oe.encode(e)):e=>fe(me(e)),be=(e,t=!1)=>t?ce(ye(e)):ye(e),we=e=>be(e,!0),xe=e=>{if(e=e.replace(/\s+/g,""),!le.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,n,i="";for(let o=0;o<e.length;)t=se[e.charAt(o++)]<<18|se[e.charAt(o++)]<<12|(r=se[e.charAt(o++)])<<6|(n=se[e.charAt(o++)]),i+=64===r?ue(t>>16&255):64===n?ue(t>>16&255,t>>8&255):ue(t>>16&255,t>>8&255,255&t);return i},Se=we;var ke=function(e){function t(r,n){var i=e.call(this,n)||this;return i.statusCode=r,Object.setPrototypeOf(i,t.prototype),i}return y(t,e),t}(Error),Ee=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return y(t,e),t}(Error),Ce=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return w(this,void 0,void 0,(function(){var r,n,i,o;return x(this,(function(a){switch(a.label){case 0:return r=Se(JSON.stringify(e)),n={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(n["X-Amp-Exp-Flag-Keys"]=Se(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(n["X-Amp-Exp-Track"]=t.trackingOption),i=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&i.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&i.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:i.toString(),method:"GET",headers:n,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new ke(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),Pe=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return w(this,void 0,void 0,(function(){var t,r;return x(this,(function(n){switch(n.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=Se(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=n.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),Oe="undefined"!=typeof globalThis?globalThis:global||self,Me=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},_e=function(){var e=Me();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},Ae=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Oe.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Oe.clearInterval(this.poller),this.poller=void 0)},e}(),Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Ne=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){!function(r,n){var i="function",o="undefined",a="object",s="string",l="model",u="name",c="type",d="vendor",p="version",f="architecture",h="console",v="mobile",g="tablet",m="smarttv",y="wearable",b="embedded",w="Amazon",x="Apple",S="ASUS",k="BlackBerry",E="Browser",C="Chrome",P="Firefox",O="Google",M="Huawei",_="LG",A="Microsoft",I="Motorola",N="Opera",j="Samsung",T="Sharp",V="Sony",U="Xiaomi",R="Zebra",L="Facebook",F=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},D=function(e,t){return typeof e===s&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},K=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var r,o,s,l,u,c,d=0;d<t.length&&!u;){var p=t[d],f=t[d+1];for(r=o=0;r<p.length&&!u;)if(u=p[r++].exec(e))for(s=0;s<f.length;s++)c=u[++o],typeof(l=f[s])===a&&l.length>0?2===l.length?typeof l[1]==i?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==i||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):n:this[l[0]]=c?l[1].call(this,c,l[2]):n:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):n):this[l]=c||n;d+=2}},z=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(D(t[r][i],e))return"?"===r?n:r}else if(D(t[r],e))return"?"===r?n:r;return e},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},H={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,p],[/opios[\/ ]+([\w\.]+)/i],[p,[u,N+" Mini"]],[/\bopr\/([\w\.]+)/i],[p,[u,N]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,p],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[p,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[p,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[p,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],p],[/\bfocus\/([\w\.]+)/i],[p,[u,P+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[u,N+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[u,N+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[p,[u,P]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],p],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,p],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,L],p],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[u,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,C+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[p,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[u,P+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,p],[/(cobalt)\/([\w\.]+)/i],[u,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,B]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,j],[c,g]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,j],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,x],[c,v]],[/(ipad\d+,\d+)/i],[l,[d,x],[c,g]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,x],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,x],[c,g]],[/(macintosh);/i],[l,[d,x]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,M],[c,g]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,M],[c,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,U],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,U],[c,g]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,I],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,I],[c,g]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,_],[c,g]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,_],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,g]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,v]],[/(pixel c)\b/i],[l,[d,O],[c,g]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,O],[c,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,V],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,V],[c,g]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,g]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,g]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,S],[c,g]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,S],[c,v]],[/(nexus 9)/i],[l,[d,"HTC"],[c,g]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,g]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,T],[c,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,g]],[/(surface duo)/i],[l,[d,A],[c,g]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,v]],[/(u304aa)/i],[l,[d,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,g]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,g]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,g]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,g]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,g]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,g]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,g]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,g]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,g]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,g]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,g]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,v]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,g]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,g]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,g]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,g]],[/(sprint) (\w+)/i],[d,l,[c,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,A],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,R],[c,g]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,R],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,h]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,h]],[/(playstation [345portablevi]+)/i],[l,[d,V],[c,h]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,A],[c,h]],[/smart-tv.+(samsung)/i],[d,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,j],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,_],[c,m]],[/(apple) ?tv/i],[d,[l,x+" TV"],[c,m]],[/crkey/i],[[l,C+"cast"],[d,O],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,T],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,V],[c,m]],[/(mitv-\w{5}) bui/i],[l,[d,U],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,K],[l,K],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[d,l,[c,y]],[/droid.+; (glass) \d/i],[l,[d,O],[c,y]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,R],[c,y]],[/(quest( 2)?)/i],[l,[d,L],[c,y]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,g]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,g]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,p],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[p,z,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[p,z,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,p],[/\(bb(10);/i],[p,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[u,P+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[p,[u,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],p],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,p],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,p]]},J=function(e,t){if(typeof e===a&&(t=e,e=n),!(this instanceof J))return new J(e,t).getResult();var i=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),h=t?function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r}(H,t):H;return this.getBrowser=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:n}(e.version),e},this.getCPU=function(){var e={};return e[f]=n,q.call(e,i,h.cpu),e},this.getDevice=function(){var e={};return e[d]=n,e[l]=n,e[c]=n,q.call(e,i,h.device),e},this.getEngine=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.engine),e},this.getOS=function(){var e={};return e[u]=n,e[p]=n,q.call(e,i,h.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(e){return i=typeof e===s&&e.length>350?K(e,350):e,this},this.setUA(i),this};J.VERSION="0.7.33",J.BROWSER=F([u,p,"major"]),J.CPU=F([f]),J.DEVICE=F([l,d,c,h,v,m,g,y,b]),J.ENGINE=J.OS=F([u,p]),e.exports&&(t=e.exports=J),t.UAParser=J;var $=typeof r!==o&&(r.jQuery||r.Zepto);if($&&!$.ua){var G=new J;$.ua=G.getResult(),$.ua.get=function(){return G.getUA()},$.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var r in t)$.ua[r]=t[r]}}}("object"==typeof window?window:Ie)})),je=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,r,n,i,o,a,s,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(n=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===n?void 0:n.userId,version:null===(o=null===(i=this.amplitudeInstance)||void 0===i?void 0:i.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,n,i,o;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(o=null===(i=null===(n=this.amplitudeInstance)||void 0===n?void 0:n._ua)||void 0===i?void 0:i.browser)||void 0===o?void 0:o.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name},e}(),Te=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),Ve=function(){return Ve=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ve.apply(this,arguments)};function Ue(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))}function Re(e,t){var r,n,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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=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++,n=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=t.call(e,o)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Le(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fe(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function De(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Be=function(e,t){var r,n;void 0===t&&(t=!1);var i=Ke(e,t),o=void 0,a=Oe.document.cookie.split("; ");try{for(var s=Le(a),l=s.next();!l.done;l=s.next()){var u=Fe(l.value.split("=",2),2),c=u[0],d=u[1];c===i&&(o=decodeURIComponent(d))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}if(o)try{if(t){var p=atob(o);return JSON.parse(decodeURIComponent(p))}var f=o.split("."),h=void 0;return f.length>=2&&f[1]&&(h=atob(f[1])),{deviceId:f[0],userId:h}}catch(e){return}},Ke=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},qe=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Ue(this,void 0,void 0,(function(){return Re(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=Be(this.apiKey,!0);return(e||(e=Be(this.apiKey,!1))||(e=function(e){var t=Ke(e,!0);try{var r=Oe.localStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=Ke(e,!0);try{var r=Oe.sessionStorage.getItem(t);if(!r)return;var n=JSON.parse(r);if("object"!=typeof n)return;return n}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Ue(this,void 0,void 0,(function(){var t,r=this;return Re(this,(function(n){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){Oe.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var ze,We,He=Oe.fetch||function(e,t){return t=t||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],a=[],s={},l=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:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(l())},i.onerror=n,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(u,t.headers[u]);i.send(t.body||null)}))},Je=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),$e={request:function(e,t,r,n,i){return function(e,t){return null==t||t<=0?e:new Promise((function(r,n){Oe.setTimeout((function(){n(new Ee("Request timeout after "+t+" milliseconds"))}),t),e.then(r,n)}))}(Ue(void 0,void 0,void 0,(function(){var i,o;return Re(this,(function(a){switch(a.label){case 0:return[4,He(e,{method:t,headers:r,body:n})];case 1:return i=a.sent(),o={status:i.status},[4,i.text()];case 2:return o.body=a.sent(),[2,o]}}))})),i)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(ze||(ze={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(We||(We={}));var Ge=function(e){return!e||e===We.FallbackInline||e===We.FallbackConfig||e===We.SecondaryInitialVariants},Xe={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:ze.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:$e},Qe="1.16.2",Ze=function(){function e(e,t){var r,n=this;this.isReady=new Promise((function(e){n.resolve=e})),this.config=e,this.client=t;var i=null!==(r=e.instanceName)&&void 0!==r?r:Xe.instanceName;this.queue=new et(i),this.cache=new Ye(i)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,n,i={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?i={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(n=e.metadata)||void 0===n?void 0:n.deliveryMethod)&&(i={eventType:"$impression",eventProperties:e}),i},e}(),Ye=function(){function e(e){this.isSessionStorageAvailable=tt(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Oe.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],n=!1;return r&&r.variant===e.variant||(n=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),n},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=Oe.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Oe.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),et=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=_e(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=Oe.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=Le(this.inMemoryQueue),n=r.next();!n.done;n=r.next()){var i=n.value;try{if(!this.tracker(i))return}catch(e){return}}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(Oe.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Oe.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),Oe.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),tt=function(){var e=Me();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},rt=function(){function e(){this.globalScope=Me()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),nt=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Ve({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var n=Le(Object.keys(e)),i=n.next();!i.done;i=n.next()){var o=i.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,n=this.storage.get(this.namespace);try{r=JSON.parse(n)||{}}catch(e){return}var i={};try{for(var o=Le(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(r[s]):r[s])&&(i[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(i)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),it=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,n=e.payload,i=e.metadata,o=e.expKey;i&&i.experimentKey?o=i.experimentKey:o&&((i=i||{}).experimentKey=o);var a={};return t?a.key=t:r&&(a.key=r),r&&(a.value=r),i&&(a.metadata=i),n&&(a.payload=n),o&&(a.expKey=o),a}},ot=function(){function e(){this.globalScope=Me()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),at=function(e){return null==e},st=function(e){return!!at(e)||e&&0===Object.keys(e).length},lt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},ut=function(){function e(e,t,r,n){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=n}return e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return Ue(this,void 0,void 0,(function(){var n=this;return Re(this,(function(i){return this.done||(this.timeoutHandle=Oe.setTimeout((function(){return Ue(n,void 0,void 0,(function(){var n,i;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(n=t+1)<this.attempts&&(i=Math.min(r*this.scalar,this.max),this.backoff(e,n,i)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),ct=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},dt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},pt=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),ft=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),ht=function(){function e(e,t){var r,n,i,o,a=this;this.engine=new re,this.isRunning=!1,this.apiKey=e,t=function(e){var t,r;if(!e||"object"!=typeof e)return{};var n={};try{for(var i=Le(Object.entries(e)),o=i.next();!o.done;o=i.next()){var a=Fe(o.value,2),s=a[0],l=a[1];at(l)||(n[s]=l)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}(t),this.config=Ve(Ve(Ve({},Xe),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":Xe.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(n=null==t?void 0:t.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://flag.lab.eu.amplitude.com":Xe.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(i=t.flagConfigPollingIntervalMillis)&&void 0!==i?i:Xe.flagConfigPollingIntervalMillis});var s=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===s,this.poller=new Ae((function(){return a.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=it(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new pt(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new ft(this.config.exposureTrackingProvider)),this.integrationManager=new Ze(this.config,this);var u,c=new Je(this.config.httpClient||$e);this.flagApi=new Pe(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Ce(this.apiKey,this.config.serverUrl,c);var d=s?"".concat(this.config.instanceName,"-").concat(s):this.config.instanceName;u=this.isWebExperiment?new ot:new rt,this.variants=function(e,t,r){var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n);return new nt(i,r,it)}(this.apiKey,d,u),this.flags=function(e,t,r){void 0===r&&(r=new rt);var n=e.substring(e.length-6),i="amp-exp-".concat(t,"-").concat(n,"-flags");return new nt(i,r)}(this.apiKey,d,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){var t,r,n;return Re(this,(function(i){switch(i.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),i.label=1;case 1:return i.trys.push([1,6,,7]),t=this.doFlags(),null===(n=this.config.fetchOnStart)||void 0===n||n?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return i.sent(),[3,5];case 3:return[4,t];case 4:i.sent(),i.label=5;case 5:return[3,7];case 6:if(r=i.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return Ue(this,arguments,void 0,(function(e,t){var r;return void 0===e&&(e=this.user),Re(this,(function(n){switch(n.label){case 0:this.setUser(e||{}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return n.sent(),[3,4];case 3:if(r=n.sent(),this.config.throwOnError)throw r;return this.config.debug&&(r instanceof Ee?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,n;if(!this.apiKey)return{value:void 0};var i=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,i),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=i.variant)||void 0===r?void 0:r.key)||(null===(n=i.variant)||void 0===n?void 0:n.value))),i.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);lt(r)||delete e[t]}return Ve(Ve(Ve({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Ve({},this.user.user_properties);return Ve(Ve({},this.user),{user_properties:t})}return Ve({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Ve({},e.user_properties);this.user=Ve(Ve({},e),{user_properties:r})}else this.user=Ve({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,n=this.addContext(this.user),i=function(e,t){var r,n,i=b({},e),o=[],a=t||Object.keys(i);try{for(var s=S(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=ne(u,i);c&&o.push.apply(o,E([],k(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,n,i;if(!e)return{};var o={user:e},a=Me();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Le(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var p=d[0],f={group_name:p},h=null===(i=null===(n=e.group_properties)||void 0===n?void 0:n[c])||void 0===i?void 0:i[p];h&&Object.keys(h).length>0&&(f.group_properties=h),s[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(n),a=this.engine.evaluate(o,i),s={};try{for(var l=Le(Object.keys(a)),u=l.next();!u.done;u=l.next()){var c=u.value;s[c]=dt(a[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===ze.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===ze.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var n=this.flags.get(e);return(lt(n)||!r.variant&&n)&&(r=this.localEvaluationVariantAndSource(e,n,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var n,i={},o=this.evaluate([t.key])[e],a=We.LocalEvaluation,s=null===(n=null==o?void 0:o.metadata)||void 0===n?void 0:n.default;if(!at(o)&&!s)return{variant:ct(o),source:a,hasDefaultVariant:!1};if(s&&(i={variant:ct(o),source:a,hasDefaultVariant:!0}),!at(r))return{variant:ct(r),source:We.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var l=this.config.initialVariants[e];if(!at(l))return{variant:ct(l),source:We.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var u=ct(this.config.fallbackVariant),c={variant:u,source:We.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return st(u)?i:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,n={},i=this.variants.get(e),o=null===(r=null==i?void 0:i.metadata)||void 0===r?void 0:r.default;if(!at(i)&&!o)return{variant:ct(i),source:We.LocalStorage,hasDefaultVariant:!1};if(o&&(n={variant:ct(i),source:We.LocalStorage,hasDefaultVariant:!0}),!at(t))return{variant:ct(t),source:We.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var a=this.config.initialVariants[e];if(!at(a))return{variant:ct(a),source:We.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var s=ct(this.config.fallbackVariant),l={variant:s,source:We.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return st(s)?n:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,n={},i=this.config.initialVariants[e];if(!at(i))return{variant:ct(i),source:We.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!at(o)&&!a)return{variant:ct(o),source:We.LocalStorage,hasDefaultVariant:!1};if(a&&(n={variant:ct(o),source:We.LocalStorage,hasDefaultVariant:!0}),!at(t))return{variant:ct(t),source:We.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var s=ct(this.config.fallbackVariant),l={variant:s,source:We.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return st(s)?n:l},e.prototype.fetchInternal=function(e,t,r,n){return Ue(this,void 0,void 0,(function(){var i,o;return Re(this,(function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,n)];case 2:return i=a.sent(),[4,this.storeVariants(i,n)];case 3:return a.sent(),[2,i];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,n),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Ve({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Ue(this,void 0,void 0,(function(){var n,i,o,a,s,l,u;return Re(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Ve({timeoutMillis:t},r))];case 2:n=c.sent(),i={};try{for(o=Le(Object.keys(n)),a=o.next();!a.done;a=o.next())s=a.value,i[s]=dt(n[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",i),[2,i]}}))}))},e.prototype.doFlags=function(){return Ue(this,void 0,void 0,(function(){var e,t,r;return Re(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=n.sent(),n.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:Qe,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=n.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=n.sent())instanceof Ee))throw r;if(this.config.debug&&console.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return Ue(this,void 0,void 0,(function(){var r,n,i,o;return Re(this,(function(a){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),n=function(t){r=r.filter((function(e){return e!==t})),i.variants.put(t,e[t])},i=this,e)n(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return Ue(this,void 0,void 0,(function(){var r=this;return Re(this,(function(n){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new ut(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Ue(r,void 0,void 0,(function(){return Re(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),n=this.integrationManager.getUser(),i=Ve(Ve(Ve({},null==r?void 0:r.user_properties),n.user_properties),null==e?void 0:e.user_properties);return Ve(Ve(Ve(Ve({library:"experiment-js-client/".concat(Qe)},r),n),e),{user_properties:i})},e.prototype.addContextOrWait=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==ze.LocalStorage?this.variants.getAll():this.config.source==ze.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==ze.LocalStorage?this.config.initialVariants:this.config.source==ze.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,n,i,o,a,s,l,u,c;if(null===(i=null===(n=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===n?void 0:n.trackExposure)||void 0===i||i){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},p=Ge(t.source);if(!p||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var f=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(p||(null==f?void 0:f.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),f&&(d.metadata=f),this.isWebExperiment){var h=Me();if(null==h?void 0:h.location)try{var v=h.location.href;d.metadata.url=v.split("?")[0]||""}catch(e){}}null===(c=this.exposureTrackingProvider)||void 0===c||c.track(d),this.integrationManager.track(d)}}},e.prototype.legacyExposureInternal=function(e,t,r){var n,i,o,a,s;if(this.analyticsProvider){var l=function(e,t,r,n){var i,o=null==r?void 0:r.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:a,properties:{key:t,variant:o,source:n},userProperties:(i={},i[a]=o,i)}}(this.addContext(this.getUser()),e,t,r);Ge(r)||!(null==t?void 0:t.value)?null===(i=null===(n=this.analyticsProvider)||void 0===n?void 0:n.unsetUserProperty)||void 0===i||i.call(n,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,De([e],Fe(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ke)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),vt=function(){function e(e,t){var r,n,i;this.globalScope=Me(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(n=this.globalScope)||void 0===n?void 0:n.navigator.userAgent:void 0,this.ua=new Ne.UAParser(this.userAgent).getResult(),this.localStorage=new rt,this.sessionStorage=new ot,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(i=this.apiKey)||void 0===i?void 0:i.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,n,i,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Ve({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(i=null===(n=this.globalScope)||void 0===n?void 0:n.document)||void 0===i?void 0:i.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,n,i;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===n?void 0:n.cookie)||void 0===i?void 0:i.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var n={};try{var i=new URL(this.globalScope.location.href);try{for(var o=Le(i.searchParams),a=o.next();!a.done;a=o.next()){var s=Fe(a.value,2),l=s[0],u=s[1];n[l]=De(De([],Fe(null!==(r=n[l])&&void 0!==r?r:[]),!1),Fe(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(n).reduce((function(e,t){var r=Fe(t,2),n=r[0],i=r[1];return e[n]=1==i.length?i[0]:i,e}),{})}},e}();Oe.experimentInstances={};var gt=Oe.experimentInstances,mt=function(e,t){return wt(e,t)},yt=function(e,t){return wt(e,t,(function(){return new qe(e,g.getInstance(bt(t)),1e4)}))},bt=function(e){return(null==e?void 0:e.instanceName)||Xe.instanceName},wt=function(e,t,r){var n=function(e,t){var r=bt(t),n=null==t?void 0:t.internalInstanceNameSuffix;return n?"".concat(r,".").concat(e,".").concat(n):"".concat(r,".").concat(e)}(e,t),i=gt[n];return i||(i=function(e,t){return new ht(e,Ve(Ve({},t),{userProvider:new vt(null==t?void 0:t.userProvider,e)}))}(e,t),r&&i.addPlugin(r()),gt[n]=i,i)},xt={initialize:mt,initializeWithAmplitudeAnalytics:yt},St=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(e){return[2]}))}))},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Ue(this,void 0,void 0,(function(){return Re(this,(function(e){return[2,this]}))}))},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return Xe.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),kt=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Te,AmplitudeIntegrationPlugin:qe,AmplitudeUserProvider:je,Experiment:xt,ExperimentClient:ht,get Source(){return ze},StubExperimentClient:St,initialize:mt,initializeWithAmplitudeAnalytics:yt});function Et(){return Et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Et.apply(null,arguments)}var Ct=["selector","action","value","attribute"],Pt=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ot={revert:function(){}},Mt=new Map,_t=[];function At(e){var t=Mt.get(e);return t||(t={element:e,attributes:{}},Mt.set(e,t)),t}function It(e,t){return e.parentNode===t.parentNode&&e.insertBeforeNode===t.insertBeforeNode}function Nt(e,t,r,n,i){var o=r(e),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:e,_positionTimeout:null,rateLimitCount:0,observer:new MutationObserver((function(){if(!(a.rateLimitCount>=10||(a.rateLimitCount++,setTimeout((function(){a.rateLimitCount=a.rateLimitCount-1,a.rateLimitCount<=0&&(a.rateLimitCount=0)}),1e3),"position"===t&&a._positionTimeout))){"position"===t&&(a._positionTimeout=setTimeout((function(){a._positionTimeout=null}),1e3));var n=r(e);"position"===t&&It(n,a.virtualValue)||n!==a.virtualValue&&(a.originalValue=n,i(a))}})),mutationRunner:i,setValue:n,getCurrentValue:r};return"position"===t&&e.parentNode?a.observer.observe(e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(e,function(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}(t)),a}function jt(e,t){var r=t.getCurrentValue(t.el);t.virtualValue=e,e&&"string"!=typeof e&&"string"!=typeof r?r&&It(r,e)||(t.isDirty=!0,Yt()):e!==r&&(t.isDirty=!0,Yt())}function Tt(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),jt(function(e){$t||($t=document.createElement("div"));return $t.innerHTML=e,$t.innerHTML}(t),e)}function Vt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach((function(e){return e.mutate(t)})),jt(Array.from(t).filter(Boolean).join(" "),e)}function Ut(e){var t=e.originalValue;e.mutations.forEach((function(e){t=e.mutate(t)})),jt(t,e)}function Rt(e){if("insertSelector"in e){var t,r=e.insertSelector,n=e.direction,i=document.querySelector(r);if(!i)return null;switch(n){case"prepend":t={parentNode:i,insertBeforeNode:i.firstChild};break;case"append":t={parentNode:i,insertBeforeNode:null};break;case"before":t={parentNode:i.parentElement,insertBeforeNode:i};break;case"after":t={parentNode:i.parentElement,insertBeforeNode:i.nextSibling}}return Et({},t,{insertNode:i,direction:n})}var o=e.parentSelector,a=e.insertBeforeSelector,s=document.querySelector(o);if(!s)return null;var l=a?document.querySelector(a):null;return a&&!l?null:{parentNode:s,insertBeforeNode:l}}function Lt(e){for(var t=e.originalValue,r=e.mutations.length-1;r>=0;r--){var n,i=e.mutations[r];if(!i.newPosition||!i.newPosition.parentNode.isConnected||!1===(null==(n=i.newPosition.insertBeforeNode)?void 0:n.isConnected)){var o=Rt(i.mutate());i.newPosition=o}if(i.newPosition){t=i.newPosition;break}}jt(t,e)}var Ft=function(e){return e.innerHTML},Dt=function(e,t){e.innerHTML=t};function Bt(e){var t=At(e);return t.html||(t.html=Nt(e,"html",Ft,Dt,Tt)),t.html}var Kt=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextSibling}},qt=function(e,t){if("insertNode"in t)return t.insertNode[t.direction](e),void(t.insertBeforeNode=e.nextSibling||null);t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode)||t.parentNode.insertBefore(e,t.insertBeforeNode)};function zt(e){var t=At(e);return t.position||(t.position=Nt(e,"position",Kt,qt,Lt)),t.position}var Wt=function(e,t){t?e.className=t:e.removeAttribute("class")},Ht=function(e){return e.className};function Jt(e){var t=At(e);return t.classes||(t.classes=Nt(e,"class",Ht,Wt,Vt)),t.classes}var $t,Gt;function Xt(e,t){var r,n=At(e);return n.attributes[t]||(n.attributes[t]=Nt(e,t,(r=t,function(e){var t;return null!=(t=e.getAttribute(r))?t:null}),function(e){return function(t,r){return null!==r?t.setAttribute(e,r):t.removeAttribute(e)}}(t),Ut)),n.attributes[t]}function Qt(e,t,r){if(r.isDirty){r.isDirty=!1;var n=r.virtualValue;r.mutations.length||function(e,t){var r,n=Mt.get(e);if(n)if("html"===t)null==(r=n.html)||null==(r=r.observer)||r.disconnect(),delete n.html;else if("class"===t){var i;null==(i=n.classes)||null==(i=i.observer)||i.disconnect(),delete n.classes}else if("position"===t){var o;null==(o=n.position)||null==(o=o.observer)||o.disconnect(),delete n.position}else{var a;null==(a=n.attributes)||null==(a=a[t])||null==(a=a.observer)||a.disconnect(),delete n.attributes[t]}}(e,t),r.setValue(e,n)}}function Zt(e,t){e.html&&Qt(t,"html",e.html),e.classes&&Qt(t,"class",e.classes),e.position&&Qt(t,"position",e.position),Object.keys(e.attributes).forEach((function(r){Qt(t,r,e.attributes[r])}))}function Yt(){Mt.forEach(Zt)}function er(e,t){var r=null;"html"===e.kind?r=Bt(t):"class"===e.kind?r=Jt(t):"attribute"===e.kind?r=Xt(t,e.attribute):"position"===e.kind&&(r=zt(t)),r&&(r.mutations.push(e),r.mutationRunner(r))}function tr(e){if(!("position"===e.kind&&e.elements.size>0)){var t=new Set(e.elements);document.querySelectorAll(e.selector).forEach((function(r){t.has(r)||(e.elements.add(r),er(e,r))}))}}function rr(e){var t=_t.indexOf(e),r=[];if("position"===e.kind)for(var n=_t.length-1;n>t;n--){var i=_t[n];if("position"===i.kind){var o=i.newPosition;if(o){var a=!("direction"in o)||"before"===o.direction,s=nr(o.insertBeforeNode,e.elements,a);if(o.insertBeforeNode=s,"insertNode"in o)if("before"===o.direction)null===s?(o.insertNode=o.parentNode,o.direction="append"):o.insertNode=s;else if("after"===o.direction){var l=new Set(Array.from(e.elements).concat(Array.from(i.elements))),u=ir(o.insertBeforeNode,l);null===u?(o.direction="prepend",o.insertNode=o.parentNode):o.insertNode=u}}}r.push(i),rr(i)}e.elements.forEach((function(t){return function(e,t){var r=null;if("html"===e.kind?r=Bt(t):"class"===e.kind?r=Jt(t):"attribute"===e.kind?r=Xt(t,e.attribute):"position"===e.kind&&(r=zt(t)),r){var n=r.mutations.indexOf(e);-1!==n&&r.mutations.splice(n,1),r.mutationRunner(r)}}(e,t)})),_t.splice(t,1);for(var c=function(){var e=r.pop();if(!e)return 1;ar(e),e.elements.forEach((function(t){return er(e,t)}))};r.length>0;)c()}function nr(e,t,r){for(var n=e;n instanceof Element&&t.has(n);)n=r?n.nextElementSibling:n.nextSibling;return n}function ir(e,t){for(var r=(null==e?void 0:e.previousElementSibling)||null;r instanceof Element&&t.has(r);)r=r.previousElementSibling;return r}function or(){_t.forEach(tr)}function ar(e){return"undefined"==typeof document?Ot:(_t.push(e),tr(e),{__mutation:e,revert:function(){rr(e)}})}function sr(e,t){return ar({kind:"html",elements:new Set,mutate:t,selector:e})}function lr(e,t){return ar({kind:"position",elements:new Set,mutate:t,selector:e})}function ur(e,t){return ar({kind:"class",elements:new Set,mutate:t,selector:e})}function cr(e,t,r){return Pt.test(t)?"class"===t||"className"===t?ur(e,(function(e){var t=r(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach((function(t){return e.add(t)}))})):ar({kind:"attribute",attribute:t,elements:new Set,mutate:r,selector:e}):Ot}"undefined"!=typeof document&&(Gt||(Gt=new MutationObserver((function(){or()}))),or(),Gt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}));var dr={html:sr,classes:ur,attribute:cr,position:lr,declarative:function(e){var t=e.selector,r=e.action,n=e.value,i=e.attribute,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,Ct);if("html"===i){if("append"===r)return sr(t,(function(e){return e+(null!=n?n:"")}));if("set"===r)return sr(t,(function(){return null!=n?n:""}))}else if("class"===i){if("append"===r)return ur(t,(function(e){n&&e.add(n)}));if("remove"===r)return ur(t,(function(e){n&&e.delete(n)}));if("set"===r)return ur(t,(function(e){e.clear(),n&&e.add(n)}))}else if("position"===i){if("set"===r){if("insertSelector"in o)return lr(t,(function(){return{insertSelector:o.insertSelector,direction:o.direction}}));if("parentSelector"in o)return lr(t,(function(){return{insertBeforeSelector:o.insertBeforeSelector,parentSelector:o.parentSelector}}))}}else{if("append"===r)return cr(t,i,(function(e){return null!==e?e+(null!=n?n:""):null!=n?n:""}));if("set"===r)return cr(t,i,(function(){return null!=n?n:""}));if("remove"===r)return cr(t,i,(function(){return null}))}return Ot}},pr=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,r,n){void 0===r&&(r=void 0);var i=this.messageToSubscriberGroup.get(e);i||(i={subscribers:[]},this.messageToSubscriberGroup.set(e,i),n&&this.subscriberGroupCallback.set(e,n));var o={identifier:r,callback:t};i.subscribers.push(o)},e.prototype.publish=function(e,t){var r,n=this.messageToSubscriberGroup.get(e);n&&(n.subscribers.forEach((function(e){t=t||{},e.callback(t)})),null===(r=this.subscriberGroupCallback.get(e))||void 0===r||r(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}(),fr=function(){function e(e){this.modal=null,this.options=e}return e.prototype.show=function(){var e=this;this.modal||document.getElementById("amp-preview-modal")||("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){e.createModal(),e.attachEventListeners()})):(this.createModal(),this.attachEventListeners()))},e.prototype.hide=function(){var e,t;this.modal&&(this.modal.remove(),this.modal=null),null===(t=(e=this.options).onDismiss)||void 0===t||t.call(e)},e.prototype.createModal=function(){if(document.body){this.modal=document.createElement("div"),this.modal.id="amp-preview-modal",this.modal.className="amp-preview-modal";var e=document.createElement("div");e.className="amp-preview-modal-container",Object.entries(this.options.flags).forEach((function(t){var r=o(t,2),n=r[0],i=r[1],a=document.createElement("div");a.className="amp-preview-modal-row";var s=document.createElement("div");s.className="amp-preview-modal-icon",s.innerHTML='\n <svg class="amp-preview-modal-icon-img" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.1389 11.4324L18.2087 18.1956H6.04109L11.1109 11.4324V6.02794H13.1389V11.4324ZM16.1402 4H8.10959C7.68372 4 7.45051 4.4867 7.71414 4.82131L9.083 6.53492V10.7632L3.20198 18.6011C2.70514 19.2704 3.1817 20.2235 4.01316 20.2235H20.2366C21.0681 20.2235 21.5447 19.2704 21.0478 18.6011L15.1668 10.7632V6.53492L16.5357 4.82131C16.7993 4.4867 16.5661 4 16.1402 4Z" fill="currentColor"/>\n </svg>\n ';var l=document.createElement("span");l.className="amp-preview-modal-title",l.textContent=n;var u=document.createElement("div");u.className="amp-preview-modal-badge amp-preview-modal-preview-badge",u.innerHTML='\n <svg class="amp-preview-modal-preview-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z" fill="currentColor"/>\n </svg>\n Preview Mode\n ';var c=document.createElement("span");c.className="amp-preview-modal-badge amp-preview-modal-variant-badge amp-preview-modal-variant-".concat(i.toLowerCase());var d=document.createElement("span");d.className="amp-preview-modal-variant-dot",c.appendChild(d),c.appendChild(document.createTextNode(i)),a.appendChild(s),a.appendChild(l),a.appendChild(u),a.appendChild(c),e.appendChild(a)}));var t=document.createElement("button");t.className="amp-preview-modal-close",t.setAttribute("aria-label","Dismiss preview mode notification"),t.innerHTML="×",this.modal.appendChild(e),this.modal.appendChild(t),this.injectStyles(),document.body.appendChild(this.modal)}},e.prototype.attachEventListeners=function(){var e=this;if(this.modal){var t=this.modal.querySelector(".amp-preview-modal-close");t&&t.addEventListener("click",(function(){return e.hide()}))}},e.prototype.injectStyles=function(){if(!document.getElementById("amp-preview-modal-styles")){var e=document.createElement("style");e.id="amp-preview-modal-styles",e.textContent="\n .amp-preview-modal {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 10000;\n background-color: #ffffff;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.4;\n color: #2d3748;\n animation: amp-preview-modal-slide-in 0.3s ease-out;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 12px 16px;\n max-width: 600px;\n }\n\n @keyframes amp-preview-modal-slide-in {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n\n .amp-preview-modal-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .amp-preview-modal-row {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .amp-preview-modal-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .amp-preview-modal-icon-img {\n width: 16px;\n height: 16px;\n color: #718096;\n }\n\n .amp-preview-modal-title {\n font-weight: 600;\n color: #1a202c;\n font-size: 14px;\n white-space: nowrap;\n }\n\n /* Base badge styles */\n .amp-preview-modal-badge {\n background-color: #ffffff;\n color: #4a5568;\n padding: 4px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 6px;\n border: 1px solid #e2e8f0;\n }\n\n .amp-preview-modal-preview-badge {\n color: #718096;\n }\n\n .amp-preview-modal-preview-icon {\n width: 14px;\n height: 14px;\n color: currentColor;\n }\n\n .amp-preview-modal-variant-dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background-color: #68d391;\n flex-shrink: 0;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n border-radius: 6px;\n color: #a0aec0;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 18px;\n line-height: 1;\n width: 24px;\n height: 24px;\n transition: all 0.2s ease;\n align-self: flex-start;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #f7fafc;\n color: #718096;\n }\n\n .amp-preview-modal-close:focus {\n outline: 2px solid #3182ce;\n outline-offset: 1px;\n }\n\n /* Dark mode support */\n @media (prefers-color-scheme: dark) {\n .amp-preview-modal {\n background-color: #2d3748;\n border-color: #4a5568;\n color: #e2e8f0;\n }\n\n .amp-preview-modal-title {\n color: #f7fafc;\n }\n\n .amp-preview-modal-badge {\n background-color: #2d3748;\n color: #e2e8f0;\n border-color: #4a5568;\n }\n\n .amp-preview-modal-preview-badge {\n color: #a0aec0;\n }\n\n .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-a .amp-preview-modal-variant-dot {\n background-color: #68d391;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-b .amp-preview-modal-variant-dot {\n background-color: #fc8181;\n }\n\n .amp-preview-modal-variant-badge.amp-preview-modal-variant-testing .amp-preview-modal-variant-dot {\n background-color: #63b3ed;\n }\n\n .amp-preview-modal-close {\n color: #718096;\n }\n\n .amp-preview-modal-close:hover {\n background-color: #4a5568;\n color: #e2e8f0;\n }\n }\n ",document.head.appendChild(e)}},e}();var hr={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:150},vr=function(){function e(r,n,i,s){void 0===i&&(i=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var r,n;try{var i=t.filter((function(e){return l.shouldProcessMutation(e)}));if(0===i.length)return;if(l.pendingMutations.length+i.length>e.MAX_PENDING_MUTATIONS)return(r=l.pendingMutations).push.apply(r,a([],o(i),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(n=l.pendingMutations).push.apply(n,a([],o(i),!1)),l.processMutationsDebounced()}catch(e){}},this.target=r,this.onMutations=n,this.filters=i,this.options=t(t({},hr),s),this.processMutationsDebounced=function(e,t,r){void 0===r&&(r={});var n=null,i=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];r.maxWait&&!i&&(i=setTimeout((function(){n&&(clearTimeout(n),n=null),i=null,e.apply(void 0,a([],o(s),!1))}),r.maxWait)),n&&clearTimeout(n),n=setTimeout((function(){i&&(clearTimeout(i),i=null),e.apply(void 0,a([],o(s),!1))}),t)};return s.cancel=function(){n&&clearTimeout(n),i&&clearTimeout(i),n=null,i=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every((function(t){return t(e)}))}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),gr=new re,mr=function(e,r,n,a,s){var l=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.setPageObjects=function(e){l.pageObjects=e},this.initSubscriptions=function(){l.options.useDefaultNavigationHandler&&l.setupLocationChangePublisher(),l.setupPageObjectSubscriptions()},this.addPageChangeSubscriber=function(e){return l.pageChangeSubscribers.add(e),function(){l.pageChangeSubscribers.delete(e)}},this.setupPageObjectSubscriptions=function(){var e,t,r=function(e,t){var r,n,o=function(t){l.messageBus.subscribe(t.trigger_type,(function(r){l.isPageObjectActive(t,r)?l.webExperimentClient.updateActivePages(e,t,!0):l.webExperimentClient.updateActivePages(e,t,!1)}),void 0,(function(e){var r,n;if(!("updateActivePages"in e&&e.updateActivePages||l.options.isVisualEditorMode)){if("url_change"===t.trigger_type){Object.values(l.webExperimentClient.appliedMutations).forEach((function(e){Object.values(e).forEach((function(e){e[Qr]&&Object.values(e[Qr]).forEach((function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)}))}))}));var o=l.webExperimentClient.appliedMutations;Object.keys(o).forEach((function(e){var t=o[e];Object.keys(t).forEach((function(e){t[e][Qr]&&(delete t[e][Qr],0===Object.keys(t[e]).length&&delete t[e])})),0===Object.keys(t).length&&delete o[e]}))}l.webExperimentClient.applyVariants()}var a=l.webExperimentClient.getActivePages();if(!l.areActivePagesEqual(a,l.lastNotifiedActivePages)){l.lastNotifiedActivePages=l.cloneActivePagesMap(a);try{for(var s=(r=void 0,i(l.pageChangeSubscribers)),u=s.next();!u.done;u=s.next())(0,u.value)({activePages:a})}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}))};try{for(var a=(r=void 0,i(Object.values(t))),s=a.next();!s.done;s=a.next())o(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}};try{for(var n=i(Object.entries(l.pageObjects)),a=n.next();!a.done;a=n.next()){var s=o(a.value,2);r(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},this.setupMutationObserverPublisher=function(){return new vr(l.globalScope.document.documentElement,(function(e){l.messageBus.publish("element_appeared",{mutationList:e})}),[]).observe()},this.setupLocationChangePublisher=function(){l.globalScope.addEventListener("popstate",(function(){l.messageBus.publish("url_change")}));var e,t,r=function(){l.messageBus.publish("url_change"),l.globalScope.webExperiment.previousUrl=l.globalScope.location.href};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e.apply(this,t);return r(),i},history.replaceState=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,e);return r(),i}},this.isPageObjectActive=function(e,t){if(e.conditions&&e.conditions.length>0&&!gr.evaluateConditions({context:{page:{url:l.globalScope.location.href}},result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":return t.name===e.trigger_value.name;case"analytics_event":var r=t;return r.event_type===e.trigger_value.event_type&&Object.entries(e.trigger_value.event_properties||{}).every((function(e){var t=o(e,2),n=t[0],i=t[1];return r.event_properties[n]===i}));case"element_appeared":var n=l.globalScope.document.querySelector(e.trigger_value.selector);if(n){var i=window.getComputedStyle(n);return"none"!==i.display&&"hidden"!==i.visibility}return!1;default:return!1}},this.cloneActivePagesMap=function(e){var r={};for(var n in e)for(var i in r[n]={},e[n])r[n][i]=t({},e[n][i]);return r},this.areActivePagesEqual=function(e,t){var r,n,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var u=i(s),c=u.next();!c.done;c=u.next()){var d=c.value,p=e[d],f=t[d];if(!f)return!1;var h=Object.keys(p),v=Object.keys(f);if(h.length!==v.length)return!1;try{for(var g=(o=void 0,i(h)),m=g.next();!m.done;m=g.next()){var y=m.value,b=p[y],w=f[y];if(!w||b.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!0},this.webExperimentClient=e,this.messageBus=r,this.pageObjects=n,this.options=a,this.globalScope=s},yr={useDefaultNavigationHandler:!0},br="dclid",wr="fbclid",xr="gbraid",Sr="gclid",kr="ko_click_id",Er="li_fat_id",Cr="msclkid",Pr="rtd_cid",Or="ttclid",Mr="twclid",_r="wbraid",Ar={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ir=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Nr=function(){var e,t=Ir();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var r=t.split("=",2),n=jr(r[0]),i=jr(r[1]);return i?(e[n]=i,e):e}),{}):{}},jr=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},Tr=function(){function e(e){this.options=t({},e)}return e.prototype.isEnabled=function(){return r(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:if(!Ir())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),r="AMP_TEST",n.label=1;case 1:return n.trys.push([1,4,5,7]),[4,t.set(r,e.testValue)];case 2:return n.sent(),[4,t.get(r)];case 3:return[2,n.sent()===e.testValue];case 4:return n.sent(),[2,!1];case 5:return[4,t.remove(r)];case 6:return n.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return r(this,void 0,void 0,(function(){var r,i;return n(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(r=n.sent()))return[2,void 0];try{return void 0===(i=null!==(t=Vr(r))&&void 0!==t?t:Ur(r))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]):[2,JSON.parse(i)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(r)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,i;return r(this,void 0,void 0,(function(){var r,o,a;return n(this,(function(n){return r=Ir(),o=null!==(i=null===(t=null==r?void 0:r.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==i?i:[],(a=o.find((function(t){return 0===t.indexOf(e+"=")})))?[2,a.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var i;return r(this,void 0,void 0,(function(){var r,o,a,s,l,u,c;return n(this,(function(n){try{r=null!==(i=this.options.expirationDays)&&void 0!==i?i:0,a=void 0,(o=null!==t?r:-1)&&((s=new Date).setTime(s.getTime()+24*o*60*60*1e3),a=s),l="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),a&&(l+="; expires=".concat(a.toUTCString())),l+="; path=/",this.options.domain&&(l+="; domain=".concat(this.options.domain)),this.options.secure&&(l+="; Secure"),this.options.sameSite&&(l+="; SameSite=".concat(this.options.sameSite)),(u=Ir())&&(u.document.cookie=l)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2]}))}))},e}(),Vr=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},Ur=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},Rr=function(){function e(){}return e.prototype.parse=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,t(t(t(t({},Ar),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Nr();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=Nr();return(e={})[br]=t[br],e[wr]=t[wr],e[xr]=t[xr],e[Sr]=t[Sr],e[kr]=t[kr],e[Er]=t[Er],e[Cr]=t[Cr],e[Pr]=t[Pr],e[Or]=t[Or],e[Mr]=t[Mr],e[_r]=t[_r],e},e}();var Lr=function(e,t){var r;try{var n=null===(r=Br(e))||void 0===r?void 0:r.getItem(t);return n?JSON.parse(n):null}catch(t){return console.warn("Failed to get and parse JSON from ".concat(e,":"),t),null}},Fr=function(e,t,r){var n;try{var i=JSON.stringify(r);null===(n=Br(e))||void 0===n||n.setItem(t,i)}catch(t){console.warn("Failed to stringify and set JSON in ".concat(e,":"),t)}},Dr=function(e,t){var r;try{null===(r=Br(e))||void 0===r||r.removeItem(t)}catch(t){console.warn("Failed to remove item from ".concat(e,":"),t)}},Br=function(e){var t=Me();return t?t[e]:null},Kr="visual-editor-state",qr=function(){function e(){}return e.setup=function(){var t,r="closed",n=e.getStoredSession();if(n)return r="opening",void zr(n.injectSrc).then((function(){r="open"})).catch((function(e){console.warn("Failed to load overlay from stored session:",e),r="closed"}));null===(t=Me())||void 0===t||t.addEventListener("message",(function(e){var t=/^.*\.amplitude\.com$/;try{if(!e.origin||!t.test(new URL(e.origin).hostname))return}catch(e){return}if("OpenOverlay"===e.data.type){if("closed"!==r||!t.test(new URL(e.data.context.injectSrc).hostname))return;r="opening",zr(e.data.context.injectSrc).then((function(){r="open"})).catch((function(){r="closed"}))}}))},e.getStoredSession=function(){var e=Lr("sessionStorage",Kr);if(!e)return null;try{if(!/^.*\.amplitude\.com$/.test(new URL(e.injectSrc).hostname))return null}catch(e){return null}return e},e}(),zr=function(e){return new Promise((function(t,r){var n=function(){var n;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e;var o=document.querySelector("[nonce]");o&&i.setAttribute("nonce",o.nonce||o.nonce||o.getAttribute("nonce")),i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){r({status:!1,message:"Failed to load the script ".concat(e)})})),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}};"complete"===document.readyState?n():window.addEventListener("load",n,{once:!0})}))},Wr=function(){var e,t,r=Me(),n=new URLSearchParams(null==r?void 0:r.location.search),a={};try{for(var s=i(n),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];a[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},Hr=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},Jr=function(e,t){var r,n,o=new URL(e);try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o.toString()},$r=function(e,t){return t=t.replace(/\/$/,""),e.some((function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var r=new RegExp("^".concat(e,"$"));return r.test(t)||r.test(t+"/")}))},Gr=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Gr)},Xr="mutate",Qr="inject",Zr="PREVIEW",Yr="amp-preview-mode",en="VISUAL_EDITOR";Oe.Experiment=kt;var tn=function(){function e(e,r,n,i){void 0===i&&(i={});var s,l=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.isVisualEditorMode=!1,this.previewFlags={};var u=Me();if(!u||!_e())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=u,this.apiKey=e,this.initialFlags=JSON.parse(r),this.pageObjects=JSON.parse(n),this.config=t(t(t({},yr),i),null!==(s=this.globalScope.experimentConfig)&&void 0!==s?s:{});var c=Wr(),d={};if(c[Zr]?Object.keys(c).forEach((function(e){"PREVIEW"!==e&&c[e]&&(d[e]=c[e])})):d=Lr("sessionStorage",Yr)||{},this.initialFlags.forEach((function(e){var t=e.key,r=e.variants,n=e.metadata,i=void 0===n?{}:n;if(l.flagVariantMap[t]={},Object.keys(r).forEach((function(e){l.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r}(r[e])})),t in d&&d[t]in r){l.previewFlags[t]=d[t];var o={metadata:{segmentName:"Preview"},variant:d[t]};e.segments=[o],i.evaluationMode="local"}"local"!==i.evaluationMode&&l.remoteFlagKeys.push(t),e.metadata=i})),Object.keys(this.previewFlags).length>0&&c[Zr]){Fr("sessionStorage",Yr,this.previewFlags);var p=a(a([],o(Object.keys(this.previewFlags)),!1),[Zr],!1);this.globalScope.history.replaceState({},"",Jr(this.globalScope.location.href,p))}var f=JSON.stringify(this.initialFlags);this.experimentClient=xt.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:f,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var h=this.experimentClient.all();this.localFlagKeys=Object.keys(h).filter((function(e){var t,r;return"local"===(null===(r=null===(t=h[e])||void 0===t?void 0:t.metadata)||void 0===r?void 0:r.evaluationMode)})),this.messageBus=new pr}return e.prototype.start=function(){return r(this,void 0,void 0,(function(){var e,r,a,s,l,u,c,d,p,f,h,v,m,y,b,w;return n(this,(function(n){switch(n.label){case 0:if(this.isRunning)return[2];if(HTMLElement.prototype.removeChild=function(e){return e&&e.parentNode!==this?e:Node.prototype.removeChild.call(this,e)},e=Wr(),this.isVisualEditorMode="true"===e[en]||null!==Lr("sessionStorage",Kr),this.subscriptionManager=new mr(this,this.messageBus,this.pageObjects,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode}),this.globalScope),this.subscriptionManager.initSubscriptions(),this.isVisualEditorMode)return qr.setup(),this.globalScope.history.replaceState({},"",Jr(this.globalScope.location.href,[en])),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,[2];this.messageBus.publish("url_change",{updateActivePages:!0}),r="EXP_".concat(this.apiKey.slice(0,10)),(a=Lr("localStorage",r)||{}).web_exp_id?a.web_exp_id&&a.device_id&&(delete a.device_id,Fr("localStorage",r,a)):(a.web_exp_id=a.device_id||Gr(),delete a.device_id,Fr("localStorage",r,a)),s=this.getVariants();try{for(l=i(Object.entries(s)),u=l.next();!u.done;u=l.next())c=o(u.value,2),d=c[0],p=c[1],this.remoteFlagKeys.includes(d)&&(null===(m=p.metadata)||void 0===m?void 0:m.blockingEvaluation)&&Object.keys(this.activePages).includes(d)&&(this.isRemoteBlocking=!0,this.applyAntiFlickerCss())}catch(e){h={error:e}}finally{try{u&&!u.done&&(v=l.return)&&v.call(l)}finally{if(h)throw h.error}}return this.globalScope.experimentIntegration||(f=g.getInstance("$default_instance"),this.globalScope.experimentIntegration=new qe(this.apiKey,f,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(a),this.isRemoteBlocking||null===(w=null===(b=(y=this.globalScope.document).getElementById)||void 0===b?void 0:b.call(y,"amp-exp-css"))||void 0===w||w.remove(),this.applyVariants({flagKeys:this.localFlagKeys}),0===this.remoteFlagKeys.length?(this.isRunning=!0,[2]):[4,this.fetchRemoteFlags()];case 1:return n.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,[2]}}))}))},e.getInstance=function(t,r,n,i){void 0===i&&(i={});var o=Me();if(!o)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(null==o?void 0:o.webExperiment)return o.webExperiment;var a=new e(t,r,n,i);return o.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.applyVariants=function(e){var t,r;Object.keys(this.previewFlags).length>0&&function(e){var t=new fr(e);"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){t.show()})):t.show()}({flags:this.previewFlags});var n=(e||{}).flagKeys,i=this.getVariants();if(0!==Object.keys(i).length){var o=Hr(this.globalScope.location.href);for(var a in(null===(t=this.urlExposureCache)||void 0===t?void 0:t[o])||(this.urlExposureCache={},this.urlExposureCache[o]={}),this.fireStoredRedirectImpressions(),i)if(!n||n.includes(a)){var s=i[a],l=s.key||"";if(this.appliedMutations[a]){var u=Object.keys(this.appliedMutations[a]);u.length>0&&!u.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(r=s.metadata)||void 0===r?void 0:r.deliveryMethod)){var c=Array.isArray(s.payload);if(("off"===s.key||"control"===s.key)&&(this.isActionActiveOnPage(a,void 0)&&this.exposureWithDedupe(a,s),"off"===s.key)){this.revertVariants({flagKeys:[a]});continue}c&&this.handleVariantAction(a,s)}}}},e.prototype.revertVariants=function(e){var t,r,n,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=i(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.appliedMutations[u];if(c){for(var d in c){var p=c[d];if(p)for(var f in p)for(var h in p[f])null===(o=null===(n=p[f][h])||void 0===n?void 0:n.revert)||void 0===o||o.call(n)}delete this.appliedMutations[u]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){var t=e.keyToVariant;if(t)for(var r in this.revertVariants({flagKeys:Object.keys(t)}),t){var n=t[r],i=this.flagVariantMap[r];if(!i)return;var o=i[n];if(!o)return;var a=o.payload;if(!a||!Array.isArray(a))return;this.handleVariantAction(r,o)}},e.prototype.getVariants=function(){var e,t,r={};try{for(var n=i(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=n.next();!s.done;s=n.next()){var l=s.value;r[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.setPageObjects=function(e){var t,r;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(r=this.subscriptionManager)||void 0===r||r.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.fetchRemoteFlags=function(){return r(this,void 0,void 0,(function(){var e;return n(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}}))}))},e.prototype.handleVariantAction=function(e,t){var r,n;try{for(var o=i(t.payload),a=o.next();!a.done;a=o.next()){var s=a.value;"redirect"===s.action?this.handleRedirect(s,e,t):s.action===Xr?this.handleMutate(s,e,t):s.action===Qr&&this.handleInject(s,e,t)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.handleRedirect=function(e,t,i){var o,a,s;if(this.isActionActiveOnPage(t,null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.scope)){var l=Hr(this.previousUrl||this.globalScope.document.referrer),u=null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.url;if(Hr(this.globalScope.location.href)!==l){var c=function(e,t){var r=new URL(e),n=new URL(t),i=new URL(t);return r.searchParams.forEach((function(e,t){n.searchParams.has(t)||i.searchParams.append(t,e)})),i.toString()}(this.globalScope.location.href,u);this.globalScope.location.href!==c&&(this.storeRedirectImpressions(t,i,u),this.previousUrl=this.globalScope.location.href,function(e){return r(this,void 0,void 0,(function(){var t,r,i,o;return n(this,(function(n){switch(n.label){case 0:return t=new Tr({sameSite:"Lax"}),r=new Rr,i="AMP_".concat("MKTG","_ORIGINAL_").concat(e.substring(0,10)),[4,r.parse()];case 1:return o=n.sent(),[4,t.set(i,o)];case 2:return n.sent(),[2]}}))}))}(this.apiKey).then(),this.customRedirectHandler?this.customRedirectHandler(c):this.globalScope.location.replace(c))}}},e.prototype.handleMutate=function(e,r,n){var i,o,a,s,l,u=this,c=(null===(i=e.data)||void 0===i?void 0:i.mutations)||[],d=n.key||"";if(0!==c.length){var p={};c.forEach((function(e,t){var i,o,a,s,l,c,f,h,v,g,m;u.isActionActiveOnPage(r,null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.scope)?(u.exposureWithDedupe(r,n),(null===(m=null===(g=null===(v=u.appliedMutations[r])||void 0===v?void 0:v[d])||void 0===g?void 0:g[Xr])||void 0===m?void 0:m[t])||(p[t]=dr.declarative(e))):(null===(s=null===(a=null===(o=u.appliedMutations[r])||void 0===o?void 0:o[d])||void 0===a?void 0:a[Xr])||void 0===s?void 0:s[t])&&(null===(h=null===(f=null===(c=null===(l=u.appliedMutations[r])||void 0===l?void 0:l[d])||void 0===c?void 0:c[Xr])||void 0===f?void 0:f[t])||void 0===h||h.revert(),delete u.appliedMutations[r][d][Xr][t])})),null!==(o=(s=this.appliedMutations)[r])&&void 0!==o||(s[r]={}),null!==(a=(l=this.appliedMutations[r])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[r][d][Xr]=t(t({},this.appliedMutations[r][d][Xr]),p),0===Object.keys(this.appliedMutations[r][d][Xr]||{}).length&&delete this.appliedMutations[r][d][Xr],0===Object.keys(this.appliedMutations[r][d]||{}).length&&delete this.appliedMutations[r]}},e.prototype.handleInject=function(e,t,i){var o,a,s,l,u,c,d,p,f,h,v,g,m=this,y=i.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.scope)){var b=e.data.id;if(b&&"string"==typeof b&&0!==b.length&&(b=b.replace(/-/g,""),!this.appliedInjections.has(b))){var w,x=e.data.js;x&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(b,"(html, utils, id){").concat(x,"};"),w.id="js-".concat(b),this.globalScope.document.head.appendChild(w));var S,k=e.data.css;k&&(S=this.globalScope.document.createElement("style"))&&(S.innerHTML=k,S.id="css-".concat(b),this.globalScope.document.head.appendChild(S));var E,C=e.data.html;C&&(E=null!==(c=(new DOMParser).parseFromString(C,"text/html").body.firstElementChild)&&void 0!==c?c:void 0);var P={waitForElement:function(e){return r(this,void 0,void 0,(function(){var t;return n(this,(function(r){return(t=document.querySelector(e))?[2,t]:[2,new Promise((function(t){var r=new MutationObserver((function(){var n=document.querySelector(e);n&&(r.disconnect(),t(n))}));r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))]}))}))}};this.appliedInjections.add(b);try{var O=this.globalScope[b];O&&"function"==typeof O&&O(E,P,b)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(i.key,". Reason:"),e)}null!==(d=(h=this.appliedMutations)[t])&&void 0!==d||(h[t]={}),null!==(p=(v=this.appliedMutations[t])[y])&&void 0!==p||(v[y]={}),null!==(f=(g=this.appliedMutations[t][y])[Qr])&&void 0!==f||(g[Qr]={}),this.appliedMutations[t][y][Qr][b]={revert:function(){var e;null===(e=P.remove)||void 0===e||e.call(P),null==S||S.remove(),null==w||w.remove(),m.appliedInjections.delete(b)}},this.exposureWithDedupe(t,i)}}else null===(u=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[y])||void 0===s?void 0:s[Qr])||void 0===l?void 0:l[0])||void 0===u||u.revert()},e.prototype.exposureWithDedupe=function(e,t,r){var n,i,o=Hr(this.globalScope.location.href);if(!((null===(i=null===(n=this.urlExposureCache)||void 0===n?void 0:n[o])||void 0===i?void 0:i[e])===t.key)){if(r){var a={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,a)}else this.experimentClient.exposure(e);this.urlExposureCache[o][e]=t.key}},e.prototype.applyAntiFlickerCss=function(){if(!this.globalScope.document.getElementById("amp-exp-css")){var e=document.createElement("style");e.id="amp-exp-css",e.innerText="* { visibility: hidden !important; background-image: none !important; }",document.head.appendChild(e),this.globalScope.window.setTimeout((function(){e.remove()}),1e3)}},e.prototype.updateActivePages=function(e,t,r){this.activePages[e]||(this.activePages[e]={}),r?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var r=this.activePages[e];return t?t.some((function(e){var t;return null!==(t=null==r?void 0:r[e])&&void 0!==t&&t})):!!r&&Object.values(r).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,t,r){var n="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),i=Lr("sessionStorage",n)||{};i[e]={redirectUrl:r,variant:t},Fr("sessionStorage",n,i)},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT"),r=Lr("sessionStorage",t)||{};if(Object.keys(r).length>0)for(var n in r){var i=r[n],o=i.redirectUrl,a=i.variant,s=Hr(this.globalScope.location.href),l=Hr(o);$r([s],l)&&(this.exposureWithDedupe(n,a,!0),delete r[n])}Object.keys(r).length>0?this.globalScope.setTimeout((function(){var r=Lr("sessionStorage",t)||{};for(var n in r)e.exposureWithDedupe(n,r[n].variant,!0);Dr("sessionStorage",t)}),500):Dr("sessionStorage",t)},e}();e.initialize=function(e,t,r,n){tn.getInstance(e,t,r,n).start().finally((function(){var e;null===(e=document.getElementById("amp-exp-css"))||void 0===e||e.remove()}))},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/experiment-tag",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "Amplitude Experiment Javascript Snippet",
|
|
5
5
|
"author": "Amplitude",
|
|
6
6
|
"homepage": "https://github.com/amplitude/experiment-js-client",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"files": [
|
|
42
42
|
"dist"
|
|
43
43
|
],
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "2bc768704ca9d1164dbfbcdaefecb9883d41371c"
|
|
45
45
|
}
|