@absmartly/sdk-plugins 1.3.6 → 1.3.7

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 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ABsmartlySDKPlugins=t():e.ABsmartlySDKPlugins=t()}(this,()=>{return e={44:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},o=this&&this.__values||function(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.")},a=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var l=r(609),s=r(943),c=r(186),u=function(){function e(e){var t,r,n,i,o;if(this.initialized=!1,!e.context)throw new Error("[OverridesPluginLite] Context is required");this.config={context:e.context,cookieName:null!==(t=e.cookieName)&&void 0!==t?t:"absmartly_overrides",useQueryString:null===(r=e.useQueryString)||void 0===r||r,queryPrefix:null!==(n=e.queryPrefix)&&void 0!==n?n:"exp_",persistQueryToCookie:null!==(i=e.persistQueryToCookie)&&void 0!==i&&i,debug:null!==(o=e.debug)&&void 0!==o&&o},this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Initialized with config:",{cookieName:this.config.cookieName,useQueryString:this.config.useQueryString,queryPrefix:this.config.queryPrefix})}return e.prototype.ready=function(){return n(this,void 0,void 0,function(){var e,t,r,n,s,c,u,d,g,h,p;return i(this,function(i){if(this.initialized)return this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Already initialized"),[2];if(this.initialized=!0,this.registerWithContext(),this.registerGlobally(),e={},this.config.useQueryString&&"undefined"!=typeof window&&(e=this.getQueryStringOverrides(),this.config.persistQueryToCookie&&this.config.cookieName&&Object.keys(e).length>0&&this.persistOverridesToCookie(e)),0===Object.keys(e).length&&this.config.cookieName&&(e=this.getCookieOverrides()),0===Object.keys(e).length)return this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] No overrides found"),[2];try{for(t=o(Object.entries(e)),r=t.next();!r.done;r=t.next())n=a(r.value,2),s=n[0],c=n[1],u="number"==typeof c?c:c.variant,isNaN(u)?this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Skipping invalid variant for ".concat(s,": ").concat(u)):(null===(p=(h=this.config.context).override)||void 0===p||p.call(h,s,u),this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Override: ".concat(s," -> variant ").concat(u)))}catch(e){d={error:e}}finally{try{r&&!r.done&&(g=t.return)&&g.call(t)}finally{if(d)throw d.error}}return[2]})})},e.prototype.initialize=function(){return n(this,void 0,void 0,function(){return i(this,function(e){return[2,this.ready()]})})},e.prototype.getQueryStringOverrides=function(){if("undefined"==typeof window||!window.location)return{};var e=(0,c.getQueryStringOverrides)(this.config.queryPrefix);return this.config.debug&&Object.keys(e).length>0&&(0,l.logDebug)("[OverridesPluginLite] Query string overrides:",e),e},e.prototype.getCookieOverrides=function(){return"undefined"==typeof document?{}:(0,c.getCookieOverrides)(this.config.cookieName)},e.prototype.persistOverridesToCookie=function(e){if(this.config.cookieName&&"undefined"!=typeof document&&((0,c.persistOverridesToCookie)(e,{cookieName:this.config.cookieName}),this.config.debug)){var t=(0,c.serializeOverrides)(e);(0,l.logDebug)("[OverridesPluginLite] Persisted to cookie:",t)}},e.prototype.registerWithContext=function(){this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.overridesPlugin={name:"OverridesPluginLite",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides"],instance:this,timestamp:Date.now()},this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Registered with context at __plugins.overridesPlugin"))},e.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.config.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.config.context.__plugins.overridesPlugin,this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Unregistered from context"))},e.prototype.destroy=function(){this.initialized=!1,this.unregisterFromContext(),this.unregisterGlobally()},e.prototype.registerGlobally=function(){(0,s.registerPlugin)("overrides",{name:"OverridesPluginLite",version:"1.0.0",initialized:!0,timestamp:Date.now(),capabilities:["cookie-overrides","query-overrides"],instance:this}),this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Registered in global window.__ABSMARTLY_PLUGINS__")},e.prototype.unregisterGlobally=function(){(0,s.unregisterPlugin)("overrides"),this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Unregistered from global registry")},e}();t.OverridesPluginLite=u},91:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},o=this&&this.__read||function(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},a=this&&this.__spreadArray||function(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))},l=this&&this.__values||function(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.")};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiePlugin=void 0;var s=r(609),c=r(319),u=function(){function e(e){void 0===e&&(e={}),this.context=e.context,this.debug=e.debug||!1,this.cookieDomain=e.cookieDomain||".absmartly.com",this.cookiePath=e.cookiePath||"/",this.sameSite=e.sameSite||"Lax",this.secure=e.secure||!1,this.cookieExpiryDays=e.cookieExpiryDays||730,this.unitIdCookieName=e.unitIdCookieName||"abs",this.publicIdCookieName=e.publicIdCookieName||"abs_public",this.expiryCookieName=e.expiryCookieName||"abs_expiry",this.utmCookieName=e.utmCookieName||"abs_utm_params",this.utmParams=e.utmParamsList||["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],this.autoUpdateExpiry=!1!==e.autoUpdateExpiry,this.expiryCheckInterval=e.expiryCheckInterval||30}return e.prototype.debugLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&s.logDebug.apply(void 0,a(["[CookiePlugin]"],o(e),!1))},e.prototype.setCookie=function(e,t,r){var n=void 0!==r?r:this.cookieExpiryDays,i=(0,c.setCookie)(e,t,n,{domain:this.cookieDomain,path:this.cookiePath,sameSite:this.sameSite,secure:this.secure});return i&&this.debugLog("Set cookie ".concat(e,":"),t),i},e.prototype.deleteCookie=function(e){(0,c.deleteCookie)(e,{domain:this.cookieDomain,path:this.cookiePath})},e.prototype.getUnitId=function(){if(this.unitId)return this.unitId;var e=navigator.cookieEnabled,t=(0,c.isLocalStorageAvailable)(),r=null;return e&&(r=(0,c.getCookie)(this.unitIdCookieName)||(0,c.getCookie)(this.publicIdCookieName)),!r&&t&&(r=localStorage.getItem("abs_id")),r&&(this.unitId=r),r},e.prototype.setUnitId=function(e){this.unitId=e;var t=navigator.cookieEnabled,r=(0,c.isLocalStorageAvailable)();t&&(this.setCookie(this.unitIdCookieName,e),this.setCookie(this.publicIdCookieName,e),this.autoUpdateExpiry&&this.updateExpiryTimestamp()),r&&localStorage.setItem("abs_id",e),this.debugLog("Unit ID set:",e)},e.prototype.generateAndSetUnitId=function(){var e=(0,c.generateUniqueId)();return this.setUnitId(e),e},e.prototype.updateExpiryTimestamp=function(){if(navigator.cookieEnabled){var e=Date.now();this.setCookie(this.expiryCookieName,e.toString()),this.debugLog("Updated expiry timestamp:",e)}},e.prototype.isExpiryFresh=function(){if(!navigator.cookieEnabled)return!1;var e=(0,c.getCookie)(this.expiryCookieName);if(!e)return!1;try{var t=parseInt(e,10),r=(Date.now()-t)/864e5,n=r<=this.expiryCheckInterval;return this.debugLog("Expiry check:",{daysSinceSet:r,isFresh:n}),n}catch(e){return this.debugLog("Error parsing expiry cookie:",e),!1}},e.prototype.getUtmParams=function(){var e,t,r,n,i={},o=new URLSearchParams(window.location.search);try{for(var a=l(this.utmParams),s=a.next();!s.done;s=a.next()){var c=s.value;(h=o.get(c))&&(i[c]=h)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(0===Object.keys(i).length&&document.referrer)try{var u=new URL(document.referrer);try{for(var d=l(this.utmParams),g=d.next();!g.done;g=d.next()){var h;c=g.value,(h=u.searchParams.get(c))&&(i[c]=h)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}catch(e){this.debugLog("Error parsing referrer URL:",e)}if(0===Object.keys(i).length){var p=this.getStoredUtmParams();if(p)return p}return i},e.prototype.storeUtmParams=function(e){if(0!==Object.keys(e).length){var t={params:e,timestamp:Date.now()},r=navigator.cookieEnabled;if((0,c.isLocalStorageAvailable)())try{localStorage.setItem(this.utmCookieName,JSON.stringify(t)),this.debugLog("Stored UTM params in localStorage:",e)}catch(e){this.debugLog("Failed to store UTM params in localStorage:",e)}r&&(this.setCookie(this.utmCookieName,JSON.stringify(t),30),this.debugLog("Stored UTM params in cookie:",e))}},e.prototype.getStoredUtmParams=function(){var e=null,t=(0,c.isLocalStorageAvailable)(),r=navigator.cookieEnabled;if(t)try{e=localStorage.getItem(this.utmCookieName)}catch(e){this.debugLog("Failed to get UTM params from localStorage:",e)}if(!e&&r&&(e=(0,c.getCookie)(this.utmCookieName)),e)try{var n=JSON.parse(e);if(Date.now()-n.timestamp<2592e6)return n.params}catch(e){this.debugLog("Failed to parse stored UTM params:",e)}return null},e.prototype.applyUtmAttributesToContext=function(e){var t,r,n=e||this.context;if(n){var i=this.getUtmParams();Object.keys(i).length>0&&this.storeUtmParams(i);try{for(var a=l(Object.entries(i)),c=a.next();!c.done;c=a.next()){var u=o(c.value,2),d=u[0],g=u[1],h=d.slice(4);n.attribute(h,g),this.debugLog("Set attribute ".concat(h,":"),g)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}else(0,s.logDebug)("[CookiePlugin] No context available to apply UTM attributes")},e.prototype.clearAllCookies=function(){this.deleteCookie(this.unitIdCookieName),this.deleteCookie(this.publicIdCookieName),this.deleteCookie(this.expiryCookieName),this.deleteCookie(this.utmCookieName),(0,c.isLocalStorageAvailable)()&&(localStorage.removeItem("abs_id"),localStorage.removeItem(this.utmCookieName)),this.unitId=void 0,this.debugLog("All cookies and storage cleared")},e.prototype.ready=function(){return n(this,void 0,void 0,function(){var e;return i(this,function(t){return this.debugLog("Initializing CookiePlugin"),(e=this.getUnitId())?(this.debugLog("Using existing unit ID:",e),this.autoUpdateExpiry&&!this.isExpiryFresh()&&this.updateExpiryTimestamp()):(e=this.generateAndSetUnitId(),this.debugLog("Generated new unit ID:",e)),this.context&&this.applyUtmAttributesToContext(),this.debugLog("CookiePlugin initialized successfully"),[2]})})},e.prototype.initialize=function(){return n(this,void 0,void 0,function(){return i(this,function(e){return[2,this.ready()]})})},e.prototype.setContext=function(e){this.context=e,this.debugLog("Context set for CookiePlugin")},e.prototype.needsServerSideCookie=function(){var e=this.getUnitId(),t=navigator.cookieEnabled,r=(0,c.isLocalStorageAvailable)();if(e){if(t&&!this.isExpiryFresh())return this.debugLog("Existing ID present but expiry not fresh - need worker call"),!0}else if(t||r){var n=(0,c.getCookie)(this.expiryCookieName);return this.debugLog(n?"No existing ID but expiry cookie exists - need worker call":"No existing ID and no expiry cookie - need worker call"),!0}return!1},e.prototype.trackLanding=function(e){var t=e||this.context;if(t){var r=new URLSearchParams(window.location.search),n=this.utmParams.some(function(e){return r.get(e)}),i=document.referrer,o=i&&!i.includes(this.cookieDomain.replace(".","")),a=navigator.cookieEnabled||(0,c.isLocalStorageAvailable)(),l=!!((0,c.getCookie)(this.unitIdCookieName)||(0,c.getCookie)(this.publicIdCookieName)||(0,c.getCookie)(this.expiryCookieName)||(0,c.isLocalStorageAvailable)()&&localStorage.getItem("abs_id"));if(n||o||a&&!l){var u={referrer_url:i||"",landing_url:window.location.href,accepts_cookies:navigator.cookieEnabled,accepts_storage:(0,c.isLocalStorageAvailable)(),has_utm:n};this.debugLog("Tracking landing:",u),t.track("landing",u)}}else(0,s.logDebug)("[CookiePlugin] No context available for tracking landing")},e}();t.CookiePlugin=u},186:function(e,t){"use strict";var r=this&&this.__values||function(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.")},n=this&&this.__read||function(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 i(e,i){var o,a;if(void 0===e&&(e=t.DEFAULT_OVERRIDE_QUERY_PREFIX),"undefined"==typeof window&&!i)return{};var l=i||new URLSearchParams(window.location.search),s={};try{for(var c=r(l.entries()),u=c.next();!u.done;u=c.next()){var d=n(u.value,2),g=d[0],h=d[1];if(g.startsWith(e)){var p=g.substring(e.length);if(p){var f=h.split(","),y=parseInt(f[0],10);isNaN(y)||(1===f.length?s[p]=y:s[p]={variant:y,env:f[1]?parseInt(f[1],10):void 0,id:f[2]?parseInt(f[2],10):void 0})}}}}catch(e){o={error:e}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return s}function o(e){var t,i;if(!e)return{};var o={},a=e;if(e.includes("|")&&(a=(f=e.split("|"))[f.length-1]),!a)return{};var l=a.split(",");try{for(var s=r(l),c=s.next();!c.done;c=s.next()){var u=c.value,d=n(u.split(":"),2),g=d[0],h=d[1];if(g&&h){var p=decodeURIComponent(g),f=h.split("."),y=parseInt(f[0],10);isNaN(y)||(1===f.length?o[p]=y:o[p]={variant:y,env:f[1]?parseInt(f[1],10):void 0,id:f[2]?parseInt(f[2],10):void 0})}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return o}function a(e,n){var i,a;void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);var l=null!=n?n:"undefined"!=typeof document?document.cookie:"";if(!l)return{};var s=e+"=",c=l.split(";");try{for(var u=r(c),d=u.next();!d.done;d=u.next()){var g=d.value;if(0===(g=g.trim()).indexOf(s))return o(decodeURIComponent(g.substring(s.length)))}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return{}}function l(e){var t,i,o=[];try{for(var a=r(Object.entries(e)),l=a.next();!l.done;l=a.next()){var s=n(l.value,2),c=s[0],u=s[1],d=encodeURIComponent(c);if("number"==typeof u)o.push("".concat(d,":").concat(u));else{var g="".concat(d,":").concat(u.variant);void 0!==u.env&&(g+=".".concat(u.env)),void 0!==u.id&&(g+=".".concat(u.id)),o.push(g)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return o.join(",")}function s(e,r){if(void 0===r&&(r={}),"undefined"!=typeof document){var n=r.cookieName||t.DEFAULT_OVERRIDE_COOKIE_NAME,i=r.maxAge||86400,o=l(e);document.cookie="".concat(n,"=").concat(encodeURIComponent(o),";path=/;max-age=").concat(i)}}function c(e){var t,i,o={};try{for(var a=r(Object.entries(e)),l=a.next();!l.done;l=a.next()){var s=n(l.value,2),c=s[0],u=s[1];o[c]="number"==typeof u?u:u.variant}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERRIDE_QUERY_PREFIX=t.DEFAULT_OVERRIDE_COOKIE_NAME=void 0,t.getQueryStringOverrides=i,t.parseOverrideCookie=o,t.getCookieOverrides=a,t.serializeOverrides=l,t.persistOverridesToCookie=s,t.getOverrides=function(e,r,n,o){void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME),void 0===r&&(r=t.DEFAULT_OVERRIDE_QUERY_PREFIX);var l=i(r,n);return Object.keys(l).length>0?("undefined"!=typeof document&&s(l,{cookieName:e,maxAge:86400}),c(l)):c(a(e,o))},t.DEFAULT_OVERRIDE_COOKIE_NAME="absmartly_overrides",t.DEFAULT_OVERRIDE_QUERY_PREFIX="exp_"},196:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVitalsPlugin=t.CookiePlugin=t.BrowserCookieAdapter=t.OverridesPlugin=t.OverridesPluginFull=t.DOMChangesPlugin=t.DOMChangesPluginLite=void 0;var o=r(702);Object.defineProperty(t,"DOMChangesPluginLite",{enumerable:!0,get:function(){return o.DOMChangesPluginLite}}),Object.defineProperty(t,"DOMChangesPlugin",{enumerable:!0,get:function(){return o.DOMChangesPluginLite}});var a=r(977);Object.defineProperty(t,"OverridesPluginFull",{enumerable:!0,get:function(){return a.OverridesPluginFull}}),Object.defineProperty(t,"OverridesPlugin",{enumerable:!0,get:function(){return a.OverridesPluginFull}});var l=r(637);Object.defineProperty(t,"BrowserCookieAdapter",{enumerable:!0,get:function(){return l.BrowserCookieAdapter}});var s=r(91);Object.defineProperty(t,"CookiePlugin",{enumerable:!0,get:function(){return s.CookiePlugin}});var c=r(420);Object.defineProperty(t,"WebVitalsPlugin",{enumerable:!0,get:function(){return c.WebVitalsPlugin}}),i(r(574),t),i(r(639),t),t.default=o.DOMChangesPluginLite},214:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)},i=this&&this.__values||function(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.")},o=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.PendingChangeManager=void 0;var a=r(609),l=function(){function e(e,t){void 0===t&&(t=!1),this.applyFn=e,this.pending=new Map,this.observers=new Map,this.appliedSelectors=new Set,this.batchTimer=null,this.batchedWork=new Set,this.debug=t}return e.prototype.addPending=function(e){var t=e.change,r=e.observerRoot,i=r;r&&!document.querySelector(r)&&(this.debug&&(0,a.logDebug)("[ABsmartly] Observer root not found, using document:",r),i=void 0);var o="".concat(t.selector,"-").concat(i||"document");this.debug&&(0,a.logDebug)("[ABsmartly] Adding pending change for selector:",t.selector);var l=this.getObserverRoot(i).querySelector(t.selector);if(l)this.applyChange(l,n(n({},e),{observerRoot:i}));else{var s=this.pending.get(o)||[];s.push(n(n({},e),{observerRoot:i})),this.pending.set(o,s),this.ensureObserver(i)}},e.prototype.removePending=function(e,t,r){var n="".concat(e,"-").concat(r||"document"),i=this.pending.get(n);if(i){var o=i.filter(function(e){return e.experimentName!==t});0===o.length?this.pending.delete(n):this.pending.set(n,o)}this.checkObserverCleanup(r)},e.prototype.removeAllPending=function(e){var t,r;try{for(var n=i(this.pending.entries()),a=n.next();!a.done;a=n.next()){var l=o(a.value,2),s=l[0],c=l[1].filter(function(t){return t.experimentName!==e});0===c.length?this.pending.delete(s):this.pending.set(s,c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}this.cleanupObservers()},e.prototype.ensureObserver=function(e){var t=this,r=e||"document";if(!this.observers.has(r)){var n=this.getObserverRoot(e),i=new MutationObserver(function(r){t.handleMutations(r,e)});i.observe(n,{childList:!0,subtree:!0}),this.observers.set(r,i),this.debug&&(0,a.logDebug)("[ABsmartly] Started observer for root:",r)}},e.prototype.handleMutations=function(e,t){var r,n,a,l,s,c,u,d,g=this,h=[];try{for(var p=i(e),f=p.next();!f.done;f=p.next()){var y=f.value,v=function(e){var r,n,a,l;if(!(e instanceof Element))return"continue";var s=t||"document";try{for(var c=(r=void 0,i(m.pending.entries())),u=c.next();!u.done;u=c.next()){var d=o(u.value,2),p=d[0],f=d[1];if(p.endsWith("-".concat(s))){var y=function(t){var r,n,o=t.change;if(e.matches(o.selector))return h.push(function(){return g.applyChange(e,t)}),"continue";var a=e.querySelectorAll(o.selector),l=function(e){h.push(function(){return g.applyChange(e,t)})};try{for(var s=(r=void 0,i(a)),c=s.next();!c.done;c=s.next())l(c.value)}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}};try{for(var v=(a=void 0,i(f)),b=v.next();!b.done;b=v.next())y(b.value)}catch(e){a={error:e}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(a)throw a.error}}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}},m=this;try{for(var b=(a=void 0,i(y.addedNodes)),x=b.next();!x.done;x=b.next())v(x.value)}catch(e){a={error:e}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(a)throw a.error}}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}if(h.length>0)if("undefined"!=typeof requestAnimationFrame){requestAnimationFrame(function(){g.processBatchedWork()});try{for(var w=i(h),E=w.next();!E.done;E=w.next()){var S=E.value;this.batchedWork.add(S)}}catch(e){s={error:e}}finally{try{E&&!E.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}}else try{for(var C=i(h),A=C.next();!A.done;A=C.next())(S=A.value)()}catch(e){u={error:e}}finally{try{A&&!A.done&&(d=C.return)&&d.call(C)}finally{if(u)throw u.error}}},e.prototype.processBatchedWork=function(){var e,t,r=Array.from(this.batchedWork);this.batchedWork.clear(),this.batchTimer=null,this.debug&&r.length>0&&(0,a.logDebug)("[ABsmartly] Processing batched work:",r.length,"items");try{for(var n=i(r),o=n.next();!o.done;o=n.next())(0,o.value)()}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.applyChange=function(e,t){var r=t.change,n=t.experimentName,i=t.observerRoot,o="".concat(r.selector,"-").concat(i||"document","-").concat(n);if(!this.appliedSelectors.has(o)&&(this.debug&&(0,a.logDebug)("[ABsmartly] Applying pending change to element:",r.selector),this.applyFn(r,n,e))){this.appliedSelectors.add(o);var l="".concat(r.selector,"-").concat(i||"document"),s=this.pending.get(l);if(s){var c=s.filter(function(e){return e.experimentName!==n||e.change.selector!==r.selector});0===c.length?this.pending.delete(l):this.pending.set(l,c)}this.checkObserverCleanup(i)}},e.prototype.getObserverRoot=function(e){if(!e)return document.documentElement;var t=document.querySelector(e);return t||document.documentElement},e.prototype.checkObserverCleanup=function(e){var t,r,n=e||"document",o=!1;try{for(var l=i(this.pending.keys()),s=l.next();!s.done;s=l.next())if(s.value.endsWith("-".concat(n))){o=!0;break}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}if(!o){var c=this.observers.get(n);c&&(c.disconnect(),this.observers.delete(n),this.debug&&(0,a.logDebug)("[ABsmartly] Disconnected observer for root:",n))}},e.prototype.cleanupObservers=function(){var e,t,r,n,o,l,s=[];try{for(var c=i(this.observers.keys()),u=c.next();!u.done;u=c.next()){var d=u.value,g=!1;try{for(var h=(r=void 0,i(this.pending.keys())),p=h.next();!p.done;p=h.next())if(p.value.endsWith("-".concat(d))){g=!0;break}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}g||s.push(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var f=i(s),y=f.next();!y.done;y=f.next()){d=y.value;var v=this.observers.get(d);v&&(v.disconnect(),this.observers.delete(d),this.debug&&(0,a.logDebug)("[ABsmartly] Cleaned up observer for root:",d))}}catch(e){o={error:e}}finally{try{y&&!y.done&&(l=f.return)&&l.call(f)}finally{if(o)throw o.error}}},e.prototype.destroy=function(){var e,t;this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null);try{for(var r=i(this.observers.values()),n=r.next();!n.done;n=r.next())n.value.disconnect()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.observers.clear(),this.pending.clear(),this.appliedSelectors.clear(),this.batchedWork.clear(),this.debug&&(0,a.logDebug)("[ABsmartly] PendingChangeManager destroyed")},e.prototype.getPendingCount=function(){var e,t,r=0;try{for(var n=i(this.pending.values()),o=n.next();!o.done;o=n.next())r+=o.value.length}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e.prototype.getAppliedCount=function(){return this.appliedSelectors.size},e.prototype.hasPendingForExperiment=function(e){var t,r;try{for(var n=i(this.pending.values()),o=n.next();!o.done;o=n.next())if(o.value.some(function(t){return t.experimentName===e}))return!0}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},e}();t.PendingChangeManager=l},248:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=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])},n(e,t)},function(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=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},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},l=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},s=this&&this.__values||function(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.")},c=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPlugin=void 0;var u=r(44),d=r(609),g=r(186),h=function(e){function t(t){var r,n,i,o,a,l,s,c,u,g,h,p,f,y,v,m,b,x,w,E,S,C=e.call(this,{context:t.context,cookieName:t.cookieName,useQueryString:null!==(r=t.useQueryString)&&void 0!==r?r:"undefined"!=typeof window,queryPrefix:null!==(n=t.queryPrefix)&&void 0!==n?n:"exp_",persistQueryToCookie:null!==(i=t.persistQueryToCookie)&&void 0!==i&&i,debug:null!==(o=t.debug)&&void 0!==o&&o})||this;if(C.onExperimentsAddedCallbacks=[],!t.context)throw new Error("[OverridesPlugin] Context is required");C.isServerSide="undefined"==typeof window;var A,_=t.sdkEndpoint;if(_||((A=t.context)._endpoint?_=A._endpoint:(null===(a=A._config)||void 0===a?void 0:a.endpoint)?_=A._config.endpoint:(null===(l=A._dataProvider)||void 0===l?void 0:l._endpoint)?_=A._dataProvider._endpoint:(null===(s=A._options)||void 0===s?void 0:s.endpoint)&&(_=A._options.endpoint.replace("/v1",""))),!_&&!t.absmartlyEndpoint&&!((A=t.context)._endpoint||(null===(c=A._config)||void 0===c?void 0:c.endpoint)||(null===(u=A._dataProvider)||void 0===u?void 0:u._endpoint)||(null===(g=A._options)||void 0===g?void 0:g.endpoint)))throw new Error("[OverridesPlugin] SDK endpoint must be provided if not available from context");return C.fullConfig={context:t.context,cookieName:t.cookieName,cookieAdapter:t.cookieAdapter,cookieOptions:null!==(h=t.cookieOptions)&&void 0!==h?h:{path:"/"},useQueryString:null!==(p=t.useQueryString)&&void 0!==p?p:!C.isServerSide,queryPrefix:null!==(f=t.queryPrefix)&&void 0!==f?f:"exp_",envParam:null!==(y=t.envParam)&&void 0!==y?y:"env",persistQueryToCookie:null!==(v=t.persistQueryToCookie)&&void 0!==v&&v,url:t.url,absmartlyEndpoint:null!==(m=t.absmartlyEndpoint)&&void 0!==m?m:"",sdkEndpoint:_||"",domChangesFieldName:null!==(b=t.domChangesFieldName)&&void 0!==b?b:"__dom_changes",sdkApiKey:null!==(x=t.sdkApiKey)&&void 0!==x?x:"",application:null!==(w=t.application)&&void 0!==w?w:"",environment:null!==(E=t.environment)&&void 0!==E?E:"",debug:null!==(S=t.debug)&&void 0!==S&&S},C.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Initialized with config:",{isServerSide:C.isServerSide,cookieName:C.fullConfig.cookieName,useQueryString:C.fullConfig.useQueryString,queryPrefix:C.fullConfig.queryPrefix,envParam:C.fullConfig.envParam,persistQueryToCookie:C.fullConfig.persistQueryToCookie,sdkEndpoint:C.fullConfig.sdkEndpoint,absmartlyEndpoint:C.fullConfig.absmartlyEndpoint}),C}return i(t,e),t.prototype.ready=function(){return a(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return this.initialized?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Already initialized, skipping re-initialization"),[2]):(this.initialized=!0,this.registerWithContext(),e=this.getOverrides(),0===Object.keys(e.overrides).length?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No overrides found"),[2]):[4,this.applyOverridesWithFetching(e.overrides,e.devEnv)]);case 1:return t.sent(),[2]}})})},t.prototype.initialize=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,this.ready()]})})},t.prototype.getOverrides=function(){var e={overrides:{},devEnv:null};if(this.fullConfig.cookieName){var t=this.getEnhancedCookieOverrides();e.overrides=o({},t.overrides),e.devEnv=t.devEnv}if(this.fullConfig.useQueryString){var r=this.getEnhancedQueryStringOverrides();Object.keys(r.overrides).length>0&&(e.overrides=o(o({},e.overrides),r.overrides),null!==r.devEnv&&(e.devEnv=r.devEnv),this.fullConfig.persistQueryToCookie&&this.fullConfig.cookieName&&this.persistEnhancedOverridesToCookie(e))}return e},t.prototype.getEnhancedQueryStringOverrides=function(){try{var e=void 0;if(this.isServerSide){if(!this.fullConfig.url)return{overrides:{},devEnv:null};var t="string"==typeof this.fullConfig.url?new URL(this.fullConfig.url):this.fullConfig.url;e=new URLSearchParams(t.search)}else e=new URLSearchParams(window.location.search);var r=(0,g.getQueryStringOverrides)(this.fullConfig.queryPrefix,e),n=null;if(this.fullConfig.envParam){var i=e.get(this.fullConfig.envParam);i&&(n=i)}return this.fullConfig.debug&&Object.keys(r).length>0&&(0,d.logDebug)("[OverridesPlugin] Query string overrides:",r,"env:",n),{overrides:r,devEnv:n}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing query string:",e),{overrides:{},devEnv:null}}},t.prototype.getEnhancedCookieOverrides=function(){var e,t;if(!this.fullConfig.cookieName)return{overrides:{},devEnv:null};var r=null;if(this.fullConfig.cookieAdapter)r=this.fullConfig.cookieAdapter.get(this.fullConfig.cookieName);else if("undefined"!=typeof document){var n=this.fullConfig.cookieName+"=",i=document.cookie.split(";");try{for(var o=s(i),a=o.next();!a.done;a=o.next()){var l=a.value;if(0===(l=l.trim()).indexOf(n)){r=decodeURIComponent(l.substring(n.length));break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}this.fullConfig.debug&&r&&(0,d.logDebug)("[OverridesPlugin] Raw cookie value:",r);var c=this.parseEnhancedCookieValue(r);return this.fullConfig.debug&&Object.keys(c.overrides).length>0&&(0,d.logDebug)("[OverridesPlugin] Parsed cookie overrides:",c),c},t.prototype.parseEnhancedCookieValue=function(e){if(!e)return{overrides:{},devEnv:null};try{var t=null,r=e;if(e.startsWith("devEnv=")){var n=e.split("|");t=decodeURIComponent(n[0].substring(7)),r=n[1]||""}return{overrides:r?(0,g.parseOverrideCookie)(r):{},devEnv:t}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing overrides:",e),{overrides:{},devEnv:null}}},t.prototype.persistEnhancedOverridesToCookie=function(e){var t,r;if(this.fullConfig.cookieName){var n=[];e.devEnv&&n.push("devEnv=".concat(encodeURIComponent(e.devEnv)));var i=[];try{for(var a=s(Object.entries(e.overrides)),l=a.next();!l.done;l=a.next()){var u=c(l.value,2),g=u[0],h=u[1],p=encodeURIComponent(g);if("number"==typeof h)i.push("".concat(p,":").concat(h));else{var f=h,y="".concat(p,":").concat(f.variant);void 0!==f.env&&(y+=".".concat(f.env)),void 0!==f.id&&(y+=".".concat(f.id)),i.push(y)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}var v=n.length>0?"".concat(n.join("|"),"|").concat(i.join(",")):i.join(",");if(this.fullConfig.cookieAdapter){var m=o({},this.fullConfig.cookieOptions);this.isServerSide&&(void 0===m.httpOnly&&(m.httpOnly=!0),void 0===m.secure&&(m.secure=!0),void 0===m.sameSite&&(m.sameSite="lax")),this.fullConfig.cookieAdapter.set(this.fullConfig.cookieName,v,m)}else if("undefined"!=typeof document){m=this.fullConfig.cookieOptions||{};var b="".concat(this.fullConfig.cookieName,"=").concat(encodeURIComponent(v));m.path&&(b+=";path=".concat(m.path)),m.maxAge&&(b+=";max-age=".concat(m.maxAge));var x=m;if(x.expires){var w=x.expires instanceof Date?x.expires.toUTCString():x.expires;b+=";expires=".concat(w)}m.domain&&(b+=";domain=".concat(m.domain)),m.secure&&(b+=";secure"),m.sameSite&&(b+=";samesite=".concat(m.sameSite)),document.cookie=b}this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Persisted to cookie:",v)}},t.prototype.applyOverridesWithFetching=function(e,t){return a(this,void 0,void 0,function(){var r,n,i,o,a,u,g,h,p,f,y,v,m,b,x,w,E,S;return l(this,function(l){switch(l.label){case 0:(0,d.logDebug)("[OverridesPlugin] Initializing with overrides:",e),(0,d.logDebug)("[OverridesPlugin] Dev environment:",t),r=[],n=new Set;try{for(i=s(Object.entries(e)),o=i.next();!o.done;o=i.next())a=c(o.value,2),u=a[0],m=a[1],1===(g="number"==typeof m?{variant:m}:m).env?((0,d.logDebug)("[OverridesPlugin] ".concat(u," categorized as DEV experiment (env=1)")),r.push([u,g])):2===g.env&&g.id?((0,d.logDebug)("[OverridesPlugin] ".concat(u," categorized as DRAFT experiment (env=2, id=").concat(g.id,")")),n.add(g.id)):(0,d.logDebug)("[OverridesPlugin] ".concat(u," categorized as RUNNING experiment (env=").concat(g.env||0,")"))}catch(e){x={error:e}}finally{try{o&&!o.done&&(w=i.return)&&w.call(i)}finally{if(x)throw x.error}}return(0,d.logDebug)("[OverridesPlugin] Categorization summary:",{total_overrides:Object.keys(e).length,dev_experiments:r.length,draft_experiments:n.size,running_experiments:Object.keys(e).length-r.length-n.size,dev_environment:t}),n.size>0?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(n.size," DRAFT experiments from API")),[4,this.fetchFromAPI(Array.from(n))]):[3,2];case 1:l.sent(),l.label=2;case 2:return h=t||this.fullConfig.environment||null,r.length>0&&h?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(r.length," DEV experiments for environment: ").concat(h)),[4,this.fetchFromDevSDK(r,h)]):[3,4];case 3:return l.sent(),[3,5];case 4:r.length>0&&(0,d.logDebug)("[OverridesPlugin] Have ".concat(r.length," DEV experiments but NO devEnv specified - NOT fetching")),l.label=5;case 5:try{for(p=s(Object.entries(e)),f=p.next();!f.done;f=p.next())y=c(f.value,2),v=y[0],m=y[1],b="number"==typeof m?m:m.variant,this.fullConfig.context.override(v,b),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Override: ".concat(v," -> variant ").concat(b))}catch(e){E={error:e}}finally{try{f&&!f.done&&(S=p.return)&&S.call(p)}finally{if(E)throw E.error}}return[2]}})})},t.prototype.fetchFromAPI=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o,a;return l(this,function(l){switch(l.label){case 0:if(0===e.length)return this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No experiment IDs to fetch from API"),[2];(t=this.fullConfig.absmartlyEndpoint)||(t=this.fullConfig.sdkEndpoint.replace(".absmartly.io",".absmartly.com")),t.endsWith("/v1")&&(t=t.slice(0,-3)),t.startsWith("http")||(t="https://".concat(t)),r="".concat(t,"/v1/experiments?ids=").concat(e.join(",")),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching non-running experiments from API:",r),l.label=1;case 1:return l.trys.push([1,4,,5]),n={"Content-Type":"application/json"},this.fullConfig.sdkApiKey&&(n.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(r,{method:"GET",credentials:"include",headers:n,mode:"cors"})];case 2:return i=l.sent(),(0,d.logDebug)("[OverridesPlugin] API Response status:",i.status,i.statusText),i.ok?[4,i.json()]:((0,d.logDebug)("[OverridesPlugin] API request failed with status ".concat(i.status)),401===i.status&&(0,d.logDebug)("[OverridesPlugin] Check if you need to log in to the ABsmartly console first"),[2]);case 3:return(o=l.sent()).experiments&&(this.injectExperimentsIntoContext(o.experiments),this.notifyExperimentsAdded()),[3,5];case 4:return a=l.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from API:",a),[3,5];case 5:return[2]}})})},t.prototype.fetchFromDevSDK=function(e,t){return a(this,void 0,void 0,function(){var e,r,n,i,a,s,u;return l(this,function(l){switch(l.label){case 0:(e=this.fullConfig.sdkEndpoint).startsWith("http")||(e="https://".concat(e)),e.endsWith("/v1")&&(e=e.slice(0,-3)),r="".concat(e,"/v1/context?environment=").concat(encodeURIComponent(t)),this.fullConfig.application&&(r+="&application=".concat(encodeURIComponent(this.fullConfig.application))),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching development experiments from SDK:",r),l.label=1;case 1:return l.trys.push([1,4,,5]),n={},this.fullConfig.sdkApiKey&&(n.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(r,{method:"GET",headers:n})];case 2:return i=l.sent(),(0,d.logDebug)("[OverridesPlugin] DEV Response status:",i.status,i.statusText),i.ok?[4,i.json()]:((0,d.logDebug)("[OverridesPlugin] DEV SDK request failed with status ".concat(i.status)),[2]);case 3:return(a=l.sent()).experiments&&(s=Object.entries(a.experiments).map(function(e){var t=c(e,2),r=t[0],n=t[1];return o(o({},n),{name:r})}),this.injectExperimentsIntoContext(s),this.notifyExperimentsAdded()),[3,5];case 4:return u=l.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from dev SDK:",u),[3,5];case 5:return[2]}})})},t.prototype.injectExperimentsIntoContext=function(e){var t,r,n,i,a,l=this.fullConfig.context.data.bind(this.fullConfig.context),u=new Map;try{for(var g=s(e),h=g.next();!h.done;h=g.next()){var p=h.value,f={id:p.id,name:p.name,unitType:(null===(i=p.unit_type)||void 0===i?void 0:i.name)||"user_id",iteration:p.iteration||1,seedHi:0,seedLo:0,split:p.split||[],trafficSeedHi:0,trafficSeedLo:0,trafficSplit:[0,1],fullOnVariant:0,applications:(null===(a=p.applications)||void 0===a?void 0:a.map(function(e){var t;return{name:(null===(t=e.application)||void 0===t?void 0:t.name)||e.name}}))||[],variants:[],audience:p.audience||"",audienceStrict:p.audience_strict||!1};if(p.variants&&Array.isArray(p.variants))for(var y=0;y<p.variants.length;y++){var v=p.variants[y],m={name:v.name||"Variant ".concat(y),config:"string"==typeof v.config?v.config:JSON.stringify(v.config||{})};if(v.variables)m.variables=v.variables;else if(v.config)try{var b="string"==typeof v.config?JSON.parse(v.config):v.config,x=this.fullConfig.domChangesFieldName;b[x]&&(m.variables=((n={})[x]=b[x],n),(0,d.logDebug)("[OverridesPlugin] Variant ".concat(y," has DOM changes field '").concat(x,"'")))}catch(e){(0,d.logDebug)("[OverridesPlugin] Failed to parse variant config:",e)}f.variants[y]=m}u.set(p.name,f)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}this.fullConfig.context.data=function(){var e,t,r=l();if(!r)return r;var n=r.experiments||[],i=new Set(n.map(function(e){return e.name})),a=function(e,t){if(i.has(e)){var r=n.findIndex(function(t){return t.name===e});r>=0&&(n[r]=t)}else n.push(t)};try{for(var d=s(u),g=d.next();!g.done;g=d.next()){var h=c(g.value,2);a(h[0],h[1])}}catch(t){e={error:t}}finally{try{g&&!g.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}return o(o({},r),{experiments:n})},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Injected ".concat(e.length," experiments into context"))},t.prototype.onExperimentsAdded=function(e){this.onExperimentsAddedCallbacks.push(e)},t.prototype.notifyExperimentsAdded=function(){var e,t;this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Notifying ".concat(this.onExperimentsAddedCallbacks.length," listeners about new experiments"));try{for(var r=s(this.onExperimentsAddedCallbacks),n=r.next();!n.done;n=r.next()){var i=n.value;try{i()}catch(e){(0,d.logDebug)("[OverridesPlugin] Error in experiments added callback:",e)}}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t.prototype.registerWithContext=function(){this.fullConfig.context&&(this.fullConfig.context.__plugins||(this.fullConfig.context.__plugins={}),this.fullConfig.context.__plugins.overridesPlugin={name:"OverridesPlugin",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides","api-fetch","dev-environments"],instance:this,timestamp:Date.now()},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Registered with context at __plugins.overridesPlugin"))},t.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.fullConfig.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.fullConfig.context.__plugins.overridesPlugin,this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Unregistered from context"))},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.unregisterFromContext(),this.onExperimentsAddedCallbacks=[]},t}(u.OverridesPluginLite);t.OverridesPlugin=h},253:function(e,t,r){"use strict";var n=this&&this.__values||function(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.")},i=this&&this.__read||function(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},o=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLInjector=void 0;var a=r(609),l=r(973),s=function(){function e(e){void 0===e&&(e=!1),this.injectedIds=new Set,this.debug=e}return e.prototype.parseInjectionKey=function(e){var t,r;try{for(var i=n(["headStart","headEnd","bodyStart","bodyEnd"]),o=i.next();!o.done;o=i.next()){var l=o.value;if(e===l)return{location:l,priority:0};if(e.startsWith(l)){var s=e.substring(l.length),c=parseInt(s,10);if(!isNaN(c))return{location:l,priority:c}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return this.debug&&(0,a.logDebug)("[HTMLInjector] Invalid injection key:",e),null},e.prototype.collectInjections=function(e,t){var r,o,s,c,u,d,g,h;void 0===t&&(t=window.location.href);var p=new Map;try{for(var f=n(e),y=f.next();!y.done;y=f.next()){var v=i(y.value,2),m=v[0],b=v[1];try{for(var x=(s=void 0,n(b)),w=x.next();!w.done;w=x.next()){var E=i(w.value,2),S=E[0],C=E[1];if(C&&"object"==typeof C){if(C.urlFilter&&!l.URLMatcher.matches(C.urlFilter,t)){this.debug&&(0,a.logDebug)("[HTMLInjector] Skipping ".concat(m," variant ").concat(S," - URL filter doesn't match:"),{currentUrl:t,urlFilter:C.urlFilter});continue}var A=C.data;if(A&&"object"==typeof A)try{for(var _=(u=void 0,n(Object.entries(A))),k=_.next();!k.done;k=_.next()){var O=i(k.value,2),P=O[0],D=O[1];if("string"==typeof D){var T=this.parseInjectionKey(P);if(T){var L={code:D,priority:T.priority,location:T.location};p.has(T.location)||p.set(T.location,[]),p.get(T.location).push(L),this.debug&&(0,a.logDebug)("[HTMLInjector] Collected injection:",{experiment:m,variant:S,location:T.location,priority:T.priority,codeLength:D.length})}}else this.debug&&(0,a.logDebug)("[HTMLInjector] Skipping non-string injection code for key ".concat(P,":"),D)}}catch(e){u={error:e}}finally{try{k&&!k.done&&(d=_.return)&&d.call(_)}finally{if(u)throw u.error}}else this.debug&&(0,a.logDebug)("[HTMLInjector] Invalid injection data for ".concat(m," variant ").concat(S,":"),A)}else this.debug&&(0,a.logDebug)("[HTMLInjector] Invalid injection data for ".concat(m," variant ").concat(S,":"),C)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}try{for(var M=n(p),I=M.next();!I.done;I=M.next()){var N=i(I.value,2),j=N[0],R=N[1];R.sort(function(e,t){return t.priority-e.priority}),this.debug&&(0,a.logDebug)("[HTMLInjector] Sorted ".concat(j," injections by priority:"),{location:j,count:R.length,priorities:R.map(function(e){return e.priority})})}}catch(e){g={error:e}}finally{try{I&&!I.done&&(h=M.return)&&h.call(M)}finally{if(g)throw g.error}}return p},e.prototype.inject=function(e){var t,r,l,s;try{for(var c=n(e),u=c.next();!u.done;u=c.next()){var d=i(u.value,2),g=d[0],h=d[1],p="headStart"===g||"bodyStart"===g?o([],i(h),!1).reverse():h;try{for(var f=(l=void 0,n(p)),y=f.next();!y.done;y=f.next()){var v=y.value;this.injectAtLocation(g,v.code)}}catch(e){l={error:e}}finally{try{y&&!y.done&&(s=f.return)&&s.call(f)}finally{if(l)throw l.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}this.debug&&(0,a.logDebug)("[HTMLInjector] All injections complete")},e.prototype.injectAtLocation=function(e,t){var r=this.simpleHash(t),n="absmartly-inject-".concat(e,"-").concat(r);if(!this.injectedIds.has(n))try{switch(e){case"headStart":this.injectHeadStart(t,n);break;case"headEnd":this.injectHeadEnd(t,n);break;case"bodyStart":this.injectBodyStart(t,n);break;case"bodyEnd":this.injectBodyEnd(t,n)}this.injectedIds.add(n),this.debug&&(0,a.logDebug)("[HTMLInjector] Injected at ".concat(e,":"),{location:e,codeLength:t.length,injectionId:n})}catch(t){this.debug&&(0,a.logDebug)("[HTMLInjector] Error injecting at ".concat(e,":"),t)}},e.prototype.injectHeadStart=function(e,t){if(document.head){var r=this.createContainer(e,t);document.head.insertBefore(r,document.head.firstChild)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <head> element not found for headStart injection")},e.prototype.injectHeadEnd=function(e,t){if(document.head){var r=this.createContainer(e,t);document.head.appendChild(r)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <head> element not found for headEnd injection")},e.prototype.injectBodyStart=function(e,t){if(document.body){var r=this.createContainer(e,t);document.body.insertBefore(r,document.body.firstChild)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <body> element not found for bodyStart injection")},e.prototype.injectBodyEnd=function(e,t){if(document.body){var r=this.createContainer(e,t);document.body.appendChild(r)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <body> element not found for bodyEnd injection")},e.prototype.createContainer=function(e,t){var r=document.createElement("div");return r.id=t,r.setAttribute("data-absmartly-injection","true"),r.innerHTML=e,r},e.prototype.simpleHash=function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return Math.abs(t).toString(36)},e.prototype.destroy=function(){var e,t;try{for(var r=n(this.injectedIds),i=r.next();!i.done;i=r.next()){var o=i.value,l=document.getElementById(o);l&&l.remove()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.injectedIds.clear(),this.debug&&(0,a.logDebug)("[HTMLInjector] Destroyed and cleaned up all injections")},e}();t.HTMLInjector=s},319:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCookie=function(e){var t,r="; ".concat(document.cookie).split("; ".concat(e,"="));return 2===r.length&&(null===(t=r.pop())||void 0===t?void 0:t.split(";").shift())||null},t.setCookie=i,t.deleteCookie=function(e,t){void 0===t&&(t={}),i(e,"",-1,t)},t.generateUniqueId=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2)},t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.isLocalStorageAvailable=function(){try{var e="__localStorage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}};var n=r(609);function i(e,t,r,i){void 0===i&&(i={});try{var o=new Date;o.setTime(o.getTime()+24*r*60*60*1e3);var a="expires=".concat(o.toUTCString()),l=i.path||"/",s="".concat(e,"=").concat(t,";").concat(a,";path=").concat(l);i.domain&&"localhost"!==i.domain&&(s+=";domain=".concat(i.domain));var c=i.sameSite||"Lax";return s+=";SameSite=".concat(c),i.secure&&(s+=";Secure"),document.cookie=s,!0}catch(t){return(0,n.logDebug)("Unable to set cookie ".concat(e,":"),t),!1}}},356:function(e,t,r){"use strict";var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},i=this&&this.__values||function(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.")},o=this&&this.__read||function(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},a=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.VariantExtractor=void 0;var l=r(609),s=r(973),c=function(){function e(e,t,r){void 0===t&&(t="__dom_changes"),void 0===r&&(r=!1),this.cachedAllChanges=null,this.context=e,this.variableName=t,this.debug=r}return e.prototype.clearCache=function(){this.cachedAllChanges=null},e.prototype.extractAllChanges=function(){var e,t,r,n,s,c,u;if(this.cachedAllChanges)return this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Returning cached changes"),this.cachedAllChanges;var d=new Map;try{var g=this.context.data();if(this.debug&&(0,l.logDebug)("[VariantExtractor DEBUG] Raw context data structure:",{hasData:!!g,contextKeys:g?Object.keys(g):[],experimentCount:(null===(r=null==g?void 0:g.experiments)||void 0===r?void 0:r.length)||0,firstExperiment:(null===(n=null==g?void 0:g.experiments)||void 0===n?void 0:n[0])?{name:g.experiments[0].name,variantCount:(null===(s=g.experiments[0].variants)||void 0===s?void 0:s.length)||0,firstVariantStructure:(null===(c=g.experiments[0].variants)||void 0===c?void 0:c[0])?Object.keys(g.experiments[0].variants[0]):[]}:null,rawContextData:JSON.stringify(g).substring(0,500)+"..."}),this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Extracting changes from context:",{hasData:!!g,experimentCount:(null===(u=null==g?void 0:g.experiments)||void 0===u?void 0:u.length)||0}),null==g?void 0:g.experiments){this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Available experiments:",g.experiments.map(function(e){var t;return{name:e.name,hasVariants:!!e.variants,variantCount:(null===(t=e.variants)||void 0===t?void 0:t.length)||0}}));try{for(var h=i(g.experiments),p=h.next();!p.done;p=h.next()){var f=p.value,y=this.extractAllVariantsForExperiment(f);y.size>0?(d.set(f.name,y),this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Experiment '".concat(f.name,"' has DOM changes:"),{variantsWithChanges:Array.from(y.keys()),changesByVariant:Array.from(y.entries()).map(function(e){var t=o(e,2),r=t[0],n=t[1];return{variant:r,changeCount:n.length,changeTypes:a([],o(new Set(n.map(function(e){return e.type}))),!1)}})})):this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Experiment '".concat(f.name,"' has no DOM changes"))}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}}}catch(e){(0,l.logDebug)("[ABsmartly] Error extracting DOM changes:",e)}return this.cachedAllChanges=d,d},e.prototype.extractAllVariantsForExperiment=function(e){var t,r=new Map;if(this.debug&&(0,l.logDebug)("[DEBUG] Processing experiment: ".concat(e.name," with ").concat((null===(t=e.variants)||void 0===t?void 0:t.length)||0," variants")),!e.variants)return(0,l.logDebug)("[DEBUG] No variants found for experiment: ".concat(e.name)),r;for(var n=0;n<e.variants.length;n++){var i=e.variants[n];if(i){var o=null;if(i.config)try{var a="string"==typeof i.config?JSON.parse(i.config):i.config;(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] Parsed config for variant ").concat(n,":"),a),a&&a[this.variableName]?(o=a[this.variableName],(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✓ Found DOM changes in config[").concat(this.variableName,"]:"),o)):(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✗ No ").concat(this.variableName," field found in parsed config for variant ").concat(n))}catch(t){(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✗ Failed to parse variant.config for variant ").concat(n,":"),t,"Raw config:","string"==typeof i.config?i.config.substring(0,100):"")}else(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✗ No config field found for variant ").concat(n));if(o){var s=this.extractChangesFromData(o);s&&s.length>0&&r.set(n,s)}}}return r},e.prototype.extractChangesFromData=function(e){if(!e)return null;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return(0,l.logDebug)("[ABsmartly] Failed to parse DOM changes JSON:",e),null}if(e&&"object"==typeof e&&!Array.isArray(e)&&"changes"in e){var t=e;return this.parseChanges(t.changes)}return this.parseChanges(e)},e.prototype.getExperimentChanges=function(e){var t=this.extractAllChanges().get(e);if(!t||0===t.size)return null;var r=this.context.peek(e);return null==r?(this.debug&&(0,l.logDebug)("[ABsmartly] No variant selected for ".concat(e)),null):t.get(r)||null},e.prototype.parseChanges=function(e){var t,r;if(!e)return null;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return(0,l.logDebug)("[ABsmartly] Failed to parse DOM changes JSON:",e),null}if(!Array.isArray(e))return this.debug&&(0,l.logDebug)("[ABsmartly] DOM changes data is not an array"),null;var n=[];try{for(var o=i(e),a=o.next();!a.done;a=o.next()){var s=a.value;this.isValidChange(s)?n.push(s):this.debug&&(0,l.logDebug)("[ABsmartly] Invalid DOM change:",s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n.length>0?n:null},e.prototype.isValidChange=function(e){if(!e||"object"!=typeof e)return!1;var t=e;if(void 0===t.selector||null===t.selector||!t.type)return!1;if(!["text","html","style","class","attribute","javascript","move","create","delete","styleRules"].includes(t.type))return!1;switch(t.type){case"class":if(!t.add&&!t.remove)return!1;if(t.add&&!Array.isArray(t.add))return!1;if(t.remove&&!Array.isArray(t.remove))return!1;break;case"move":if(!t.targetSelector)return!1;break;case"create":if(!t.element||!t.targetSelector)return!1;break;case"style":case"attribute":if(!t.value||"object"!=typeof t.value)return!1}return!0},e.prototype.getAllVariantChanges=function(e){var t=this.extractAllChanges().get(e);if(!t)return[];for(var r=Math.max.apply(Math,a([],o(t.keys()),!1)),n=[],i=0;i<=r;i++)n.push(t.get(i)||[]);return n},e.prototype.getExperiment=function(e){try{var t=this.context.data();return t&&t.experiments&&t.experiments.find(function(t){return t.name===e})||null}catch(t){return this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Failed to get experiment '".concat(e,"' - context may not be ready:"),t),null}},e.prototype.getAllVariantsData=function(e){var t=new Map;try{var r=this.context.data();if(!(null==r?void 0:r.experiments))return t;var n=r.experiments.find(function(t){return t.name===e});if(!(null==n?void 0:n.variants))return t;for(var i=0;i<n.variants.length;i++){var o=n.variants[i];if(o){var a=null;if(o.variables&&o.variables[this.variableName])a=o.variables[this.variableName];else if(o.config)try{var s="string"==typeof o.config?JSON.parse(o.config):o.config;s&&s[this.variableName]&&(a=s[this.variableName])}catch(e){(0,l.logDebug)("[VariantExtractor] Failed to parse variant.config:",e)}if(a){if("string"==typeof a)try{a=JSON.parse(a)}catch(e){(0,l.logDebug)("[ABsmartly] Failed to parse DOM changes JSON:",e);continue}t.set(i,a)}else t.set(i,null)}}}catch(e){(0,l.logDebug)("[ABsmartly] Error getting all variants data:",e)}return t},e.prototype.anyVariantMatchesURL=function(e,t){var r,n;void 0===t&&(t=window.location.href);var a=this.getAllVariantsData(e),l=!1;try{for(var c=i(a),u=c.next();!u.done;u=c.next()){var d=o(u.value,2)[1];if(d&&"object"==typeof d&&!Array.isArray(d)&&"urlFilter"in d){var g=d;if(g.urlFilter&&(l=!0,s.URLMatcher.matches(g.urlFilter,t)))return!0}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return!l},e.prototype.extractAllInjectHTML=function(){var e,t,r=new Map;try{var n=this.context.data();if(this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Extracting __inject_html from context"),null==n?void 0:n.experiments)try{for(var o=i(n.experiments),a=o.next();!a.done;a=o.next()){var s=a.value,c=this.extractInjectHTMLForExperiment(s);c.size>0&&(r.set(s.name,c),this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Experiment '".concat(s.name,"' has HTML injections:"),{variantsWithInjections:Array.from(c.keys())}))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){(0,l.logDebug)("[ABsmartly] Error extracting __inject_html:",e)}return r},e.prototype.extractInjectHTMLForExperiment=function(e){var t=new Map;if(!e.variants)return t;for(var r=0;r<e.variants.length;r++){var i=e.variants[r];if(i){var o=null;if(i.variables&&i.variables.__inject_html)o=i.variables.__inject_html,this.debug&&(0,l.logDebug)("[VariantExtractor] Found __inject_html in variables for ".concat(e.name," variant ").concat(r));else if(i.config)try{var a="string"==typeof i.config?JSON.parse(i.config):i.config;a&&a.__inject_html&&(o=a.__inject_html,this.debug&&(0,l.logDebug)("[VariantExtractor] Found __inject_html in config for ".concat(e.name," variant ").concat(r)))}catch(t){(0,l.logDebug)("[VariantExtractor] Failed to parse variant.config for ".concat(e.name," variant ").concat(r,":"),t)}if(o&&"object"==typeof o&&!Array.isArray(o)){var s=o,c=s.urlFilter,u=n(s,["urlFilter"]),d={data:u,urlFilter:c||void 0};t.set(r,d),this.debug&&(0,l.logDebug)("[VariantExtractor] Extracted __inject_html for ".concat(e.name," variant ").concat(r,":"),{keys:Object.keys(u),hasUrlFilter:!!c})}else o&&this.debug&&(0,l.logDebug)("[VariantExtractor] Invalid __inject_html format in ".concat(e.name," variant ").concat(r),o)}}return t},e}();t.VariantExtractor=c},420:function(e,t,r){"use strict";var n,i=this&&this.__assign||function(){return i=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},i.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),i=0;i<r.length;i++)"default"!==r[i]&&o(t,e,r[i]);return a(t,e),t}),s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},c=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},u=this&&this.__read||function(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},d=this&&this.__spreadArray||function(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))},g=this&&this.__values||function(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.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVitalsPlugin=void 0;var h=r(609),p=function(){function e(e){void 0===e&&(e={}),this.webVitalsLoaded=!1,this.metricsTracked=!1,this.context=e.context,this.debug=e.debug||!1,this.trackWebVitals=!1!==e.trackWebVitals,this.trackPageMetrics=!1!==e.trackPageMetrics,this.autoTrack=!1!==e.autoTrack,"undefined"!=typeof window&&this.trackWebVitals&&(this.webVitalsPromise=this.loadWebVitalsLibrary(),this.debugLog("Started pre-loading web-vitals library"))}return e.prototype.debugLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&h.logDebug.apply(void 0,d(["[WebVitalsPlugin]"],u(e),!1))},e.prototype.setContext=function(e){this.context=e,this.debugLog("Context set for WebVitalsPlugin")},e.prototype.loadWebVitalsLibrary=function(){return s(this,void 0,void 0,function(){var e,t;return c(this,function(n){switch(n.label){case 0:if(this.webVitalsLoaded||"undefined"==typeof window)return[2,null];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return l(r(796))})];case 2:return e=n.sent(),this.webVitalsLoaded=!0,this.debugLog("Web Vitals library loaded from bundle"),[2,e];case 3:throw t=n.sent(),(0,h.logDebug)("[WebVitalsPlugin] Failed to load Web Vitals library:",t),t;case 4:return[2]}})})},e.prototype.trackWebVitalsMetrics=function(e){return s(this,void 0,void 0,function(){var t,r,n,o=this;return c(this,function(a){switch(a.label){case 0:if(!(t=e||this.context))return(0,h.logDebug)("[WebVitalsPlugin] No context available for tracking web vitals"),[2];if(!this.trackWebVitals)return[2];a.label=1;case 1:return a.trys.push([1,6,,7]),r=void 0,this.webVitalsPromise?[4,this.webVitalsPromise]:[3,3];case 2:return r=a.sent(),[3,5];case 3:return[4,this.loadWebVitalsLibrary()];case 4:r=a.sent(),a.label=5;case 5:return r?(r.onCLS(function(e){o.debugLog("CLS:",e),t.track("cls_score",i({},e))}),r.onLCP(function(e){o.debugLog("LCP:",e),t.track("lcp_score",i({},e))}),r.onFCP(function(e){o.debugLog("FCP:",e),t.track("fcp_score",i({},e))}),r.onINP(function(e){o.debugLog("INP:",e),t.track("inp_score",i({},e))}),r.onTTFB(function(e){o.debugLog("TTFB:",e),t.track("ttfb_score",i({},e))}),this.debugLog("Web Vitals tracking initialized"),[3,7]):((0,h.logDebug)("[WebVitalsPlugin] Web Vitals library not available"),[2]);case 6:return n=a.sent(),(0,h.logDebug)("[WebVitalsPlugin] Error tracking web vitals:",n),t.track("vitals_tracking_error",{error:n.message,type:n.name}),[3,7];case 7:return[2]}})})},e.prototype.trackPageMetricsData=function(e){var t=this,r=e||this.context;if(r){if(this.trackPageMetrics&&!this.metricsTracked)try{this.trackImmediateMetrics(r),"complete"===document.readyState?this.trackLoadMetrics(r):window.addEventListener("load",function(){return t.trackLoadMetrics(r)}),this.metricsTracked=!0}catch(e){(0,h.logDebug)("[WebVitalsPlugin] Error tracking page metrics:",e);try{r.track("metrics_tracking_error",{error:e.message,type:e.name})}catch(e){(0,h.logDebug)("[WebVitalsPlugin] Error reporting metrics tracking error:",e)}}}else(0,h.logDebug)("[WebVitalsPlugin] No context available for tracking page metrics")},e.prototype.trackImmediateMetrics=function(e){var t,r,n,i,o=performance.getEntriesByType("navigation")[0];if(o){var a={dns:o.domainLookupEnd-o.domainLookupStart,tcp:o.connectEnd-o.connectStart,ttfb:o.responseStart-o.requestStart,download:o.responseEnd-o.responseStart,total_fetch:o.responseEnd-o.requestStart};try{for(var l=g(Object.entries(a)),s=l.next();!s.done;s=l.next()){var c=u(s.value,2),d=c[0],h=c[1];e.track("page_timing_".concat(d),{value:h,unit:"ms"}),this.debugLog("Page timing ".concat(d,":"),h)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}var p={total_size:o.transferSize,header_size:o.transferSize-o.encodedBodySize,html_size:o.decodedBodySize,compressed_html_size:o.encodedBodySize};try{for(var f=g(Object.entries(p)),y=f.next();!y.done;y=f.next()){var v=u(y.value,2);d=v[0],h=v[1],e.track("page_".concat(d),{value:h,unit:"bytes"}),this.debugLog("Page ".concat(d,":"),h)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}if(o.encodedBodySize>0){var m=o.decodedBodySize/o.encodedBodySize;e.track("page_compression_ratio",{value:m}),this.debugLog("Compression ratio:",m)}}else this.debugLog("Navigation timing not available")},e.prototype.trackLoadMetrics=function(e){var t,r,n=performance.getEntriesByType("navigation")[0];if(n){var i=n.domComplete-n.responseEnd;e.track("page_timing_dom_processing",{value:i,metric:"DOM Processing",unit:"ms",rating:i<=500?"good":i<=1e3?"needs-improvement":"poor"}),this.debugLog("DOM processing:",i);var o=n.loadEventEnd-n.fetchStart;e.track("page_timing_total_load",{value:o,metric:"Total Load",unit:"ms",rating:o<=2e3?"good":o<=4e3?"needs-improvement":"poor"}),this.debugLog("Total load:",o);var a={elements:document.getElementsByTagName("*").length,imageCount:document.getElementsByTagName("img").length,scriptCount:document.getElementsByTagName("script").length,styleCount:document.getElementsByTagName("style").length,linkCount:document.getElementsByTagName("link").length};try{for(var l=g(Object.entries(a)),s=l.next();!s.done;s=l.next()){var c=u(s.value,2),d=c[0],h=c[1];e.track("dom_".concat(d),{value:h,metric:d,unit:"count",rating:h<=1e3?"good":h<=2e3?"needs-improvement":"poor"}),this.debugLog("DOM ".concat(d,":"),h)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}}},e.prototype.start=function(){return s(this,void 0,void 0,function(){return c(this,function(e){return this.debugLog("Starting WebVitalsPlugin"),this.context?(this.autoTrack&&(this.trackWebVitals&&this.trackWebVitalsMetrics(),this.trackPageMetrics&&this.trackPageMetricsData()),this.debugLog("WebVitalsPlugin started successfully"),[2]):(this.debugLog("No context available during start"),[2])})})},e.prototype.ready=function(){return s(this,void 0,void 0,function(){return c(this,function(e){return[2,this.start()]})})},e.prototype.initialize=function(){return s(this,void 0,void 0,function(){return c(this,function(e){return[2,this.start()]})})},e.prototype.reset=function(){this.metricsTracked=!1,this.debugLog("WebVitalsPlugin reset")},e}();t.WebVitalsPlugin=p},481:function(e,t,r){"use strict";var n=this&&this.__values||function(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.")},i=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMPersistenceManager=void 0;var o=r(609),a=function(){function e(e){this.watchedElements=new WeakMap,this.persistenceObserver=null,this.reapplyingElements=new Set,this.reapplyLogThrottle=new Map,this.appliedChanges=new Map,this.config=e}return e.prototype.watchElement=function(e,t,r){var i,a,l=this.watchedElements.get(e);l||(l=new Set,this.watchedElements.set(e,l)),l.add(t),this.appliedChanges.has(t)||this.appliedChanges.set(t,[]);var s=this.appliedChanges.get(t);if(!s.includes(r)&&(s.push(r),this.config.debug)){var c={};if(r.value&&"object"==typeof r.value)try{for(var u=n(Object.keys(r.value)),d=u.next();!d.done;d=u.next()){var g=d.value.replace(/([A-Z])/g,"-$1").toLowerCase();c[g]=e.style.getPropertyValue(g)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}(0,o.logDebug)("[WATCH-ELEMENT] Started watching element for persistence",{experimentName:t,selector:r.selector,element:e.tagName,changeType:r.type,value:r.value,currentStyles:"style"===r.type?c:void 0,timestamp:Date.now()})}this.persistenceObserver||this.setupPersistenceObserver()},e.prototype.unwatchElement=function(e,t){var r=this.watchedElements.get(e);r&&(r.delete(t),0===r.size&&this.watchedElements.delete(e))},e.prototype.unwatchExperiment=function(e){this.appliedChanges.delete(e)},e.prototype.getAppliedChanges=function(){return this.appliedChanges},e.prototype.clearAll=function(){this.appliedChanges.clear()},e.prototype.destroy=function(){this.persistenceObserver&&(this.persistenceObserver.disconnect(),this.persistenceObserver=null),this.appliedChanges.clear(),this.reapplyingElements.clear(),this.reapplyLogThrottle.clear()},e.prototype.setupPersistenceObserver=function(){var e=this;this.persistenceObserver||(this.config.debug&&(0,o.logDebug)("[PERSISTENCE-OBSERVER] Setting up persistence observer",{timestamp:Date.now()}),this.persistenceObserver=new MutationObserver(function(t){var r,a;e.config.debug&&(0,o.logDebug)("[MUTATION-DETECTED] Persistence observer detected mutations",{mutationCount:t.length,timestamp:Date.now()});var l=function(t){var r,a,l,s,c,u,d,g,h=t.target;if(e.reapplyingElements.has(h))return e.config.debug&&(0,o.logDebug)("[MUTATION-SKIP] Skipping mutation - currently reapplying",{element:h.tagName}),"continue";var p=e.watchedElements.get(h);if(p){if(e.config.debug){var f="mutation:".concat(h.tagName,":").concat(h.getAttribute("name")||h.className);(O=Date.now())-(P=e.reapplyLogThrottle.get(f)||0)>5e3&&((0,o.logDebug)("[MUTATION-ON-WATCHED] Mutation detected on watched element",{element:h.tagName,attributeName:t.attributeName,oldValue:t.oldValue,experiments:Array.from(p)}),e.reapplyLogThrottle.set(f,O))}try{for(var y=(r=void 0,n(p)),v=y.next();!v.done;v=y.next()){var m=v.value,b=e.appliedChanges.get(m);if(b)try{for(var x=(l=void 0,n(b)),w=x.next();!w.done;w=x.next()){var E=w.value,S=!1;if("style"===E.type&&"style"===t.attributeName&&!1!==E.persistStyle)S=e.checkStyleOverwritten(h,E.value);else if("attribute"===E.type&&!1!==E.persistAttribute){if(E.value&&"object"==typeof E.value)try{for(var C=(c=void 0,n(Object.keys(E.value))),A=C.next();!A.done;A=C.next()){var _=A.value;if(t.attributeName===_){S=e.checkAttributeOverwritten(h,E.value);break}}}catch(e){c={error:e}}finally{try{A&&!A.done&&(u=C.return)&&u.call(C)}finally{if(c)throw c.error}}}else"javascript"===E.type&&!0===E.persistScript&&E.value&&"string"==typeof E.value&&(S="style"===t.attributeName||"class"===t.attributeName);if(S){e.reapplyingElements.add(h);var k="".concat(m,"-").concat(E.selector),O=Date.now(),P=e.reapplyLogThrottle.get(k)||0;if(e.config.debug&&O-P>5e3&&((0,o.logDebug)("[REAPPLY-TRIGGERED] Reapplying after mutation (React/framework conflict detected)",{experimentName:m,selector:E.selector,element:h.tagName,changeType:E.type,timestamp:O}),e.reapplyLogThrottle.set(k,O),e.reapplyLogThrottle.size>100)){var D=O-6e4;try{for(var T=(d=void 0,n(e.reapplyLogThrottle.entries())),L=T.next();!L.done;L=T.next()){var M=i(L.value,2),I=M[0];M[1]<D&&e.reapplyLogThrottle.delete(I)}}catch(e){d={error:e}}finally{try{L&&!L.done&&(g=T.return)&&g.call(T)}finally{if(d)throw d.error}}}try{e.config.onReapply(E,m)}catch(t){e.config.debug&&(0,o.logDebug)("[REAPPLY-ERROR] Error during change re-application",{experimentName:m,selector:E.selector,changeType:E.type,error:t instanceof Error?t.message:String(t)})}finally{setTimeout(function(){e.reapplyingElements.delete(h)},0)}}}}catch(e){l={error:e}}finally{try{w&&!w.done&&(s=x.return)&&s.call(x)}finally{if(l)throw l.error}}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=y.return)&&a.call(y)}finally{if(r)throw r.error}}}};try{for(var s=n(t),c=s.next();!c.done;c=s.next())l(c.value)}catch(e){r={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}}),this.persistenceObserver.observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0}),this.config.debug&&(0,o.logDebug)("[PERSISTENCE-OBSERVER] Setup complete - now observing mutations",{target:"document.body",observedAttributes:"all (filtered in handler to style/class)",subtree:!0,timestamp:Date.now()}))},e.prototype.checkStyleOverwritten=function(e,t){var r,o;try{for(var a=n(Object.entries(t)),l=a.next();!l.done;l=a.next()){var s=i(l.value,2),c=s[0],u=s[1],d=c.replace(/([A-Z])/g,"-$1").toLowerCase(),g=e.style.getPropertyValue(d),h=e.style.getPropertyPriority(d);if(g!==u||u.includes("!important")&&!h)return!0}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.checkAttributeOverwritten=function(e,t){var r,o;try{for(var a=n(Object.entries(t)),l=a.next();!l.done;l=a.next()){var s=i(l.value,2),c=s[0],u=s[1];if(e.getAttribute(c)!==u)return!0}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1},e}();t.DOMPersistenceManager=a},574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},609:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)},i=this&&this.__read||function(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},o=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.logDebug=l,t.logChangeApplication=function(e,r,n,i,o){t.DEBUG&&l("".concat(o?"✓":"✗"," Applied ").concat(n," change to ").concat(i," element(s)"),{experimentName:e,selector:r,changeType:n,elementsCount:i,success:o})},t.logChangeRemoval=function(e,r,n,i){t.DEBUG&&l("Restored ".concat(i," element(s) to original state"),{experimentName:e,selector:r,changeType:n,elementsCount:i,action:"restore"})},t.logExperimentSummary=function(e,r,n,i){t.DEBUG&&l('Experiment "'.concat(e,'" summary'),{experimentName:e,totalChanges:r,successfulChanges:n,pendingChanges:i,successRate:r>0?"".concat(Math.round(n/r*100),"%"):"N/A"})},t.logStateOperation=function(e,r,n,i){t.DEBUG&&l("State ".concat(e," operation"),{operation:e,selector:r,changeType:n,experimentName:i})},t.logVisibilityEvent=function(e,r,n){t.DEBUG&&l(n?"Element became visible - experiment triggered":"Element visibility changed",{experimentName:e,selector:r.className||r.id||r.tagName,triggered:n,action:"visibility"})},t.logMessage=function(e,r,n){t.DEBUG&&l("Message ".concat(e,": ").concat(r),{direction:e,messageType:r,payload:n,bridge:"extension"})},t.logPerformance=function(e,r,i){t.DEBUG&&l("Performance: ".concat(e," took ").concat(r,"ms"),n({operation:e,duration:r,performance:!0},i))},t.logProductionWarn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,o([e],i(t),!1))};var a=r(834);function l(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t.DEBUG)if(2===e.length&&"string"==typeof e[0]&&"object"==typeof e[1]){var n=i(e,2),a=n[0],l=n[1];if(a.includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Performance:")&&(null==l?void 0:l.duration)&&l.duration<5)return;if(a.includes("Message sent:")||a.includes("Message received:"))return;var s=(new Date).toISOString(),c="[ABsmartly Debug]";console.log("".concat(c," [").concat(s,"] ").concat(a),l)}else if(1===e.length&&"string"==typeof e[0]){if((a=e[0]).includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Message sent:")||a.includes("Message received:"))return;s=(new Date).toISOString(),c="[ABsmartly Debug]",console.log("".concat(c," [").concat(s,"] ").concat(a))}else console.log.apply(console,o([],i(e),!1))}t.DEBUG=a.BUILD_DEBUG},637:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserCookieAdapter=void 0;var i=r(319),o=function(){function e(){}return e.prototype.get=function(e){var t=(0,i.getCookie)(e);return t?decodeURIComponent(t):null},e.prototype.set=function(e,t,r){var n="".concat(e,"=").concat(encodeURIComponent(t));r&&(r.path&&(n+="; path=".concat(r.path)),r.domain&&(n+="; domain=".concat(r.domain)),void 0!==r.maxAge&&(n+="; max-age=".concat(r.maxAge)),r.secure&&(n+="; secure"),r.sameSite&&(n+="; samesite=".concat(r.sameSite))),document.cookie=n},e.prototype.delete=function(e,t){this.set(e,"",n(n({},t),{maxAge:0}))},e}();t.BrowserCookieAdapter=o},639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StyleSheetManager=void 0;var n=r(609),i=function(){function e(e,t){void 0===t&&(t=!1),this.id=e,this.styleEl=null,this.rules=new Map,this.debug=t}return e.prototype.ensure=function(){if(!(this.styleEl&&document.head.contains(this.styleEl)||(this.styleEl=document.getElementById(this.id),this.styleEl))){var e=document.createElement("style");e.id=this.id,e.setAttribute("data-absmartly-styles","true"),document.head.appendChild(e),this.styleEl=e,this.debug&&(0,n.logDebug)("[ABsmartly] Created stylesheet: ".concat(this.id))}return this.styleEl},e.prototype.setRule=function(e,t){this.rules.set(e,t),this.render(),this.debug&&(0,n.logDebug)("[ABsmartly] Set CSS rule for ".concat(e))},e.prototype.deleteRule=function(e){this.rules.delete(e)&&(this.render(),this.debug&&(0,n.logDebug)("[ABsmartly] Deleted CSS rule for ".concat(e)))},e.prototype.hasRule=function(e){return this.rules.has(e)},e.prototype.clear=function(){var e=this.rules.size>0;this.rules.clear(),e&&(this.render(),this.debug&&(0,n.logDebug)("[ABsmartly] Cleared all CSS rules from ".concat(this.id)))},e.prototype.destroy=function(){this.clear(),this.styleEl&&document.head.contains(this.styleEl)&&(this.styleEl.remove(),this.styleEl=null,this.debug&&(0,n.logDebug)("[ABsmartly] Destroyed stylesheet: ".concat(this.id)))},e.prototype.render=function(){var e=this.ensure(),t=Array.from(this.rules.values()).join("\n\n");e.textContent=t},e.prototype.getRulesCount=function(){return this.rules.size},e.prototype.getCssText=function(){return Array.from(this.rules.values()).join("\n\n")},e}();t.StyleSheetManager=i},702:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},a=this&&this.__values||function(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.")},l=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMChangesPluginLite=void 0;var s=r(964),c=r(356),u=r(693),d=r(713),g=r(253),h=r(609),p=r(973),f=r(481),y=r(943),v=r(834),m=function(){function e(t){var r,n,i,o,a,l,u,p,y=this;if(this.mutationObserver=null,this.exposedExperiments=new Set,this.eventListeners=new Map,this.styleManagers=new Map,this.initialized=!1,this.persistenceManager=null,this.antiFlickerTimeout=null,this.antiFlickerStyleId="absmartly-antiflicker",this.originalPushState=null,this.originalReplaceState=null,this.popstateHandler=null,this.config={context:t.context,autoApply:null===(r=t.autoApply)||void 0===r||r,spa:null===(n=t.spa)||void 0===n||n,visibilityTracking:null===(i=t.visibilityTracking)||void 0===i||i,variableName:null!==(o=t.variableName)&&void 0!==o?o:"__dom_changes",debug:null!==(a=t.debug)&&void 0!==a&&a,hideUntilReady:null!==(l=t.hideUntilReady)&&void 0!==l&&l,hideTimeout:null!==(u=t.hideTimeout)&&void 0!==u?u:3e3,hideTransition:null!==(p=t.hideTransition)&&void 0!==p&&p},!this.config.context)throw new Error("[ABsmartly] Context is required");console.log("[ABsmartly] DOMChangesPluginLite v".concat(e.VERSION," initialized")),this.registerWithContext(!1),this.registerGlobally(!1),this.config.hideUntilReady&&this.hideContent(),this.domManipulator=new s.DOMManipulatorLite(this.config.debug,this),this.variantExtractor=new c.VariantExtractor(this.config.context,this.config.variableName,this.config.debug),this.exposureTracker=new d.ExposureTracker(this.config.context,this.config.debug),this.htmlInjector=new g.HTMLInjector(this.config.debug),this.persistenceManager=new f.DOMPersistenceManager({debug:this.config.debug,onReapply:function(e,t){(0,h.logDebug)("[DOMChangesPluginLite] Re-applying change due to mutation",{experimentName:t,selector:e.selector,type:e.type}),y.domManipulator.applyChange(e,t)}}),this.readyPromise=this.config.context.ready().then(function(){return(0,h.logDebug)("[DOMChangesPluginLite] Context is ready, starting initialization"),y.initialize()}).catch(function(e){throw(0,h.logDebug)("[DOMChangesPluginLite] ERROR during initialization:",e),e})}return e.prototype.ready=function(){return i(this,void 0,void 0,function(){return o(this,function(e){return[2,this.readyPromise]})})},e.prototype.initialize=function(){return i(this,void 0,void 0,function(){var t,r,n;return o(this,function(i){switch(i.label){case 0:if(this.initialized)return(0,h.logDebug)("Plugin already initialized"),[2];t=performance.now(),(0,h.logDebug)("Initializing ABsmartly DOM Changes Plugin Lite",{version:e.VERSION,config:{autoApply:this.config.autoApply,spa:this.config.spa,visibilityTracking:this.config.visibilityTracking,DEBUG:h.DEBUG}}),i.label=1;case 1:return i.trys.push([1,4,,5]),this.config.spa?(this.setupMutationObserver(),this.setupURLChangeListener()):(0,h.logDebug)("[DOMChangesPluginLite] SPA mode disabled - skipping body observer"),this.config.autoApply?[4,this.applyInjectionsAndChanges()]:[3,3];case 2:i.sent(),i.label=3;case 3:return this.initialized=!0,this.registerWithContext(),this.registerGlobally(),this.emit("initialized"),r=performance.now()-t,(0,h.logPerformance)("Plugin initialization",r),(0,h.logDebug)("[ABsmartly] DOM plugin lite loaded successfully (v".concat(e.VERSION,")")),this.config.debug&&(0,h.logDebug)("[ABsmartly] DOM Changes Plugin Lite initialized with debug mode"),[3,5];case 4:throw n=i.sent(),(0,h.logDebug)("[ABsmartly] Failed to initialize plugin:",n),this.emit("error",{type:"initialization_error",error:(null==n?void 0:n.message)||String(n)}),n;case 5:return[2]}})})},e.prototype.setupMutationObserver=function(){var e=this,t=new MutationObserver(function(t){var r,n,i,o,s,c,u,d,g,p,f;try{for(var y=a(t),v=y.next();!v.done;v=y.next()){var m=v.value;if("childList"===m.type)try{for(var b=(i=void 0,a(m.addedNodes)),x=b.next();!x.done;x=b.next()){var w=x.value;if(w.nodeType===Node.ELEMENT_NODE){var E=w,S=(null===(f=e.persistenceManager)||void 0===f?void 0:f.getAppliedChanges())||new Map;try{for(var C=(s=void 0,a(S)),A=C.next();!A.done;A=C.next()){var _=l(A.value,2),k=_[0],O=_[1];try{for(var P=(u=void 0,a(O)),D=P.next();!D.done;D=P.next()){var T=D.value;try{var L=E.matches(T.selector)?[E]:Array.from(E.querySelectorAll(T.selector));try{for(var M=(g=void 0,a(L)),I=M.next();!I.done;I=M.next()){var N=I.value;e.config.debug&&(0,h.logDebug)("[SPA-REAPPLY] Re-applying change to newly added element (React hydration recovery)",{experimentName:k,selector:T.selector,element:N.tagName,changeType:T.type}),e.domManipulator.applyChange(T,k)}}catch(e){g={error:e}}finally{try{I&&!I.done&&(p=M.return)&&p.call(M)}finally{if(g)throw g.error}}}catch(e){}}}catch(e){u={error:e}}finally{try{D&&!D.done&&(d=P.return)&&d.call(P)}finally{if(u)throw u.error}}}}catch(e){s={error:e}}finally{try{A&&!A.done&&(c=C.return)&&c.call(C)}finally{if(s)throw s.error}}}}}catch(e){i={error:e}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}}),r=function(){t.observe(document.body,{childList:!0,subtree:!0}),e.mutationObserver=t,(0,h.logDebug)("[DOMChangesPluginLite] MutationObserver started on document.body")};document.body?r():(new MutationObserver(function(e,t){document.body&&(t.disconnect(),r())}).observe(document.documentElement,{childList:!0}),(0,h.logDebug)("[DOMChangesPluginLite] Waiting for document.body..."))},e.prototype.setupURLChangeListener=function(){var e=this,t=function(){return i(e,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return e=window.location.href,(0,h.logDebug)("[ABsmartly] URL changed, re-evaluating experiments:",e),[4,this.removeAllChanges()];case 1:return t.sent(),[4,this.applyInjectionsAndChanges()];case 2:return t.sent(),[2]}})})};this.popstateHandler=t,window.addEventListener("popstate",this.popstateHandler),this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState;var r=this;history.pushState=function(e,n,i){r.originalPushState&&r.originalPushState.call(history,e,n,i),t()},history.replaceState=function(e,n,i){r.originalReplaceState&&r.originalReplaceState.call(history,e,n,i),t()},this.config.debug&&(0,h.logDebug)("[ABsmartly] URL change listener set up for SPA mode")},e.prototype.removeAllChanges=function(){return i(this,void 0,void 0,function(){return o(this,function(e){return this.exposedExperiments.clear(),this.styleManagers.clear(),this.persistenceManager&&this.persistenceManager.clearAll(),this.htmlInjector.destroy(),this.variantExtractor.clearCache(),this.config.debug&&(0,h.logDebug)("[ABsmartly] All change tracking cleared for URL change"),[2]})})},e.prototype.applyInjectionsAndChanges=function(){return i(this,void 0,void 0,function(){var e,t,r,n,i;return o(this,function(o){switch(o.label){case 0:e=performance.now(),t=window.location.href,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.config.context.ready()];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),(0,h.logDebug)("[ABsmartly] Failed to wait for context ready:",r),[2];case 4:return n=this.variantExtractor.extractAllInjectHTML(),[4,Promise.all([this.applyHTMLInjections(n,t),this.applyChanges()])];case 5:return o.sent(),i=performance.now()-e,(0,h.logPerformance)("Apply injections and changes (parallel)",i),this.config.debug&&(0,h.logDebug)("[ABsmartly] HTML injections and DOM changes applied in parallel",{duration:"".concat(i.toFixed(2),"ms"),currentURL:t}),[2]}})})},e.prototype.applyHTMLInjections=function(e){return i(this,arguments,void 0,function(e,t){var r;return void 0===t&&(t=window.location.href),o(this,function(n){return 0===e.size?(this.config.debug&&(0,h.logDebug)("[ABsmartly] No HTML injections found"),[2]):(r=this.htmlInjector.collectInjections(e,t),this.htmlInjector.inject(r),this.config.debug&&(0,h.logDebug)("[ABsmartly] HTML injections complete",{experimentsWithInjections:e.size,totalLocations:r.size,currentUrl:t}),[2])})})},e.prototype.applyChanges=function(e){return i(this,void 0,void 0,function(){var t,r,n,i,s,c,u,d,g,f,y,v,m,b,x,w,E,S,C,A,_,k,O,P,D,T,L,M,I,N,j,R,B,U,V,F,z,G,W,H,q,Q,J,Y,K,X,$,Z,ee,te,re,ne,ie,oe,ae;return o(this,function(o){switch(o.label){case 0:t=performance.now(),r=window.location.href,(0,h.logDebug)("Starting to apply changes",{specificExperiment:e||"all",url:r,action:"apply_start"}),this.config.debug&&((0,h.logDebug)("[ABsmartly] === DOM Changes Application Starting ==="),(0,h.logDebug)("[ABsmartly] Target:",e||"all experiments"),(0,h.logDebug)("[ABsmartly] Current URL:",r),(0,h.logDebug)("[ABsmartly] Context ready:",!0)),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.config.context.ready()];case 2:return o.sent(),[3,4];case 3:return n=o.sent(),(0,h.logDebug)("[ABsmartly] Failed to wait for context ready:",n),[2];case 4:this.variantExtractor.clearCache(),i=this.getAllExperimentsData(),s=0,c=new Map,(0,h.logDebug)("[APPLY-CHANGES] Experiments found with DOM changes:",{experimentNames:Array.from(i.keys()),totalCount:i.size,currentURL:r}),0===i.size&&(0,h.logDebug)("[APPLY-CHANGES] ⚠️ No experiments found with DOM changes - nothing to process");try{for(u=a(i),d=u.next();!d.done;d=u.next())if(g=l(d.value,2),f=g[0],y=g[1],(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] Starting to process experiment"),{experimentName:f,currentURL:r}),e&&f!==e)(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ⏭️ Skipping - filtering for different experiment"),{filteringFor:e});else if(null!=(v=this.config.context.peek(f)))if((0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] User assigned to variant ").concat(v)),m=y.variantData,b=y.urlFilter,x=y.globalDefaults,this.variantExtractor.anyVariantMatchesURL(f,r))if((0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ✓ At least one variant matches current URL")),w=this.shouldApplyVisualChanges(m,b,r),E=this.extractChangesFromData(m,x),S=this.extractAllVariantChanges(f),C=S.some(function(e){return e&&e.length>0}),C){if(A={total:(null==E?void 0:E.length)||0,success:0,pending:0},this.config.debug&&(0,h.logDebug)("[ABsmartly] Processing experiment '".concat(f,"' - User is in variant ").concat(v,":"),{experimentName:f,userVariant:v,urlMatches:w,changeCount:(null==E?void 0:E.length)||0,userVariantHasChanges:((null==E?void 0:E.length)||0)>0,changes:(null==E?void 0:E.map(function(e){return{type:e.type,selector:e.selector,trigger:e.trigger_on_view?"viewport":"immediate"}}))||[]}),E&&0!==E.length||this.config.debug&&(0,h.logDebug)("[ABsmartly] User is in control variant ".concat(v," with no changes, but will still track for SRM prevention"),{experimentName:f,currentVariant:v}),w&&E&&E.length>0)try{for(Z=void 0,_=a(E),k=_.next();!k.done;k=_.next())if("delete"===(Y=k.value).type&&Y.trigger_on_view)this.config.debug&&(0,h.logDebug)("[ABsmartly] Deferring delete change until after viewport trigger for '".concat(f,"'"),{selector:Y.selector});else if(this.domManipulator.applyChange(Y,f))s++,A.success++;else if("create"!==Y.type&&"styleRules"!==Y.type)try{0===document.querySelectorAll(Y.selector).length&&(this.config.spa||Y.waitForElement)&&A.pending++}catch(e){this.config.debug&&(0,h.logDebug)("[ABsmartly] Invalid selector: ".concat(Y.selector),e)}}catch(e){Z={error:e}}finally{try{k&&!k.done&&(ee=_.return)&&ee.call(_)}finally{if(Z)throw Z.error}}else E&&E.length>0&&(0,h.logDebug)("[ABsmartly] Experiment '".concat(f,"' variant ").concat(v," doesn't match URL filter or has no changes, but setting up tracking for SRM prevention"));if(O=!1,P=!1,D=this.variantExtractor.getAllVariantsData(f),this.config.debug){(0,h.logDebug)("[ABsmartly] Checking trigger types for experiment '".concat(f,"' on URL: ").concat(r),{allVariantsDataSize:D.size,allVariantChangesLength:S.length});try{for(te=void 0,T=a(D),L=T.next();!L.done;L=T.next())M=l(L.value,2),I=M[0],N=M[1],(0,h.logDebug)("[ABsmartly] Variant ".concat(I," data structure:"),{isArray:Array.isArray(N),isObject:"object"==typeof N,hasUrlFilter:N&&"object"==typeof N&&!Array.isArray(N)&&"urlFilter"in N,keys:N&&"object"==typeof N&&!Array.isArray(N)?Object.keys(N):"N/A"})}catch(e){te={error:e}}finally{try{L&&!L.done&&(re=T.return)&&re.call(T)}finally{if(te)throw te.error}}}try{for(ne=void 0,j=a(D),R=j.next();!R.done;R=j.next())if(B=l(R.value,2),U=B[0],V=B[1],(F=S[U])&&0!==F.length){if(z=!0,V&&"object"==typeof V&&!Array.isArray(V)&&"urlFilter"in(G=V)&&G.urlFilter&&(W=G,z=p.URLMatcher.matches(W.urlFilter,r),this.config.debug&&(0,h.logDebug)("[ABsmartly] Variant ".concat(U," has URL filter, matches: ").concat(z))),z){H=!1,q=!1;try{for(oe=void 0,Q=a(F),J=Q.next();!J.done;J=Q.next())(Y=J.value).trigger_on_view?H=!0:this.hasImmediateDomAnchor(Y)&&(q=!0)}catch(e){oe={error:e}}finally{try{J&&!J.done&&(ae=Q.return)&&ae.call(Q)}finally{if(oe)throw oe.error}}H&&(O=!0),q&&(P=!0),this.config.debug&&(0,h.logDebug)("[ABsmartly] Variant ".concat(U," matches URL - hasImmediate: ").concat(q,", hasViewport: ").concat(H),{experimentName:f,variantIndex:U,hasImmediateDomAnchor:q})}else this.config.debug&&(0,h.logDebug)("[ABsmartly] Variant ".concat(U," does NOT match URL - skipping"));if(O&&P)break}}catch(e){ne={error:e}}finally{try{R&&!R.done&&(ie=j.return)&&ie.call(j)}finally{if(ne)throw ne.error}}this.config.debug&&(0,h.logDebug)("[TRIGGER-DETECTION] [".concat(f,"] Final trigger decision for '").concat(f,"':"),{experimentName:f,userVariant:v,hasImmediateTrigger:P,hasViewportTrigger:O,willRegisterExperiment:O||P,userChangesCount:(null==E?void 0:E.length)||0,allVariantsChangesCount:S.map(function(e){return e.length})}),O||P?((0,h.logDebug)("[TRIGGER-DETECTION] [".concat(f,"] ✓ REGISTERING EXPERIMENT - Calling exposureTracker.registerExperiment()"),{experimentName:f,userVariant:v,hasImmediateTrigger:P,hasViewportTrigger:O,changesForUser:(null==E?void 0:E.length)||0,allVariantCounts:S.map(function(e,t){return{variant:t,count:e.length}})}),this.exposureTracker.registerExperiment(f,v||0,E||[],S,P,O)):(0,h.logDebug)("[TRIGGER-DETECTION] [".concat(f,"] ⚠️ No triggers detected - experiment will NOT be registered!"),{experimentName:f,userVariant:v,hasAnyChangesInAnyVariant:C,allVariantsChangesCount:S.map(function(e){return e.length})}),c.set(f,A),(0,h.logExperimentSummary)(f,A.total,A.success,A.pending)}else this.config.debug&&(0,h.logDebug)("[ABsmartly] Skipping experiment '".concat(f,"' - no variants have changes"));else(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ⏭️ Skipping - no variant matches URL: ").concat(r),{experimentName:f,currentURL:r});else(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ⏭️ Skipping - no variant assigned (peek returned ").concat(v,")"),{experimentName:f})}catch(e){X={error:e}}finally{try{d&&!d.done&&($=u.return)&&$.call(u)}finally{if(X)throw X.error}}return K=performance.now()-t,(0,h.logPerformance)("Apply changes",K,{totalApplied:s,experiments:c.size}),this.config.debug&&((0,h.logDebug)("[ABsmartly] === DOM Changes Application Complete ==="),(0,h.logDebug)("[ABsmartly] Summary:",{totalChangesApplied:s,experimentsProcessed:c.size,duration:"".concat(K.toFixed(2),"ms"),experiments:Array.from(c.entries()).map(function(e){var t=l(e,2),r=t[0],n=t[1];return{name:r,total:n.total,success:n.success,pending:n.pending,pendingReason:n.pending>0?"Elements not found yet (SPA mode will retry)":void 0}})})),this.config.hideUntilReady&&this.showContent(),(0,h.logDebug)("[ABsmartly] DOM changes applied"),this.emit("changes-applied",{count:s,experimentName:e}),[2]}})})},e.prototype.hasImmediateDomAnchor=function(e){try{return e.waitForElement?null!==document.querySelector(e.observerRoot||"body"):"create"===e.type?!!e.targetSelector&&null!==document.querySelector(e.targetSelector):null!==document.querySelector(e.selector)}catch(t){return this.config.debug&&(0,h.logDebug)("[ABsmartly] Failed to evaluate immediate DOM anchor:",{selector:e.selector,targetSelector:e.targetSelector,type:e.type,error:t}),!1}},e.prototype.getAllExperimentsData=function(){var e,t,r=new Map,n=this.variantExtractor.extractAllChanges();(0,h.logDebug)("[GET-EXPERIMENTS] Extracting experiment data from context",{experimentsWithChanges:Array.from(n.keys()),totalCount:n.size});try{for(var i=a(n),o=i.next();!o.done;o=i.next()){var s=l(o.value,1)[0],c=this.config.context.peek(s);if((0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] Checking experiment"),{experimentName:s,currentVariant:c,variantIsValid:null!=c}),null!=c){var u=this.variantExtractor.getAllVariantsData(s),d=u.get(c);this.config.debug&&(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] Variant data lookup:"),{experimentName:s,userVariant:c,variantDataExists:!!d,allVariantsInMap:Array.from(u.keys()),userVariantInMap:u.has(c)}),d||(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] ⚠️ User's variant ").concat(c," has no DOM changes (control variant)"),{availableVariants:Array.from(u.keys()),note:"Will still track for SRM prevention"}),(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] ✓ Including experiment (variant ").concat(c,")"));var g=null,p={};if(d&&"object"==typeof d&&!Array.isArray(d)&&"changes"in d){var f=d;g=f.urlFilter,p={waitForElement:f.waitForElement,persistStyle:f.persistStyle,persistAttribute:f.persistAttribute,persistScript:f.persistScript,important:f.important,observerRoot:f.observerRoot}}r.set(s,{variantData:d,urlFilter:g,globalDefaults:p})}else(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] ⏭️ Skipping - context.peek() returned ").concat(c))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e.prototype.extractChangesFromData=function(e,t){if(!e)return null;var r=null;return Array.isArray(e)?r=e:"object"==typeof e&&"changes"in e&&(r=e.changes),r&&0!==r.length?r.map(function(e){var r,i,o,a,l,s;return n(n({},e),{waitForElement:null!==(r=e.waitForElement)&&void 0!==r?r:t.waitForElement,persistStyle:null!==(i=e.persistStyle)&&void 0!==i?i:t.persistStyle,persistAttribute:null!==(o=e.persistAttribute)&&void 0!==o?o:t.persistAttribute,persistScript:null!==(a=e.persistScript)&&void 0!==a?a:t.persistScript,important:null!==(l=e.important)&&void 0!==l?l:t.important,observerRoot:null!==(s=e.observerRoot)&&void 0!==s?s:t.observerRoot})}):null},e.prototype.extractAllVariantChanges=function(e){for(var t=this.variantExtractor.getAllVariantChanges(e),r=this.variantExtractor.getAllVariantsData(e),i=[],o=function(e){var o=t[e],a=r.get(e);if(!o||0===o.length)return i.push([]),"continue";var l={};if(a&&"object"==typeof a&&!Array.isArray(a)&&"changes"in a){var s=a;l={waitForElement:s.waitForElement,persistStyle:s.persistStyle,persistAttribute:s.persistAttribute,persistScript:s.persistScript,important:s.important,observerRoot:s.observerRoot}}var c=o.map(function(e){var t,r,i,o,a,s;return n(n({},e),{waitForElement:null!==(t=e.waitForElement)&&void 0!==t?t:l.waitForElement,persistStyle:null!==(r=e.persistStyle)&&void 0!==r?r:l.persistStyle,persistAttribute:null!==(i=e.persistAttribute)&&void 0!==i?i:l.persistAttribute,persistScript:null!==(o=e.persistScript)&&void 0!==o?o:l.persistScript,important:null!==(a=e.important)&&void 0!==a?a:l.important,observerRoot:null!==(s=e.observerRoot)&&void 0!==s?s:l.observerRoot})});i.push(c)},a=0;a<t.length;a++)o(a);return i},e.prototype.shouldApplyVisualChanges=function(e,t,r){return!!e&&(!!Array.isArray(e)||!t||p.URLMatcher.matches(t,r))},e.prototype.hasChanges=function(e){return this.domManipulator.hasChanges(e)},e.prototype.applyChange=function(e,t){(0,h.logDebug)("Applying single change via public API",{experimentName:t,selector:e.selector,changeType:e.type});try{var r=this.domManipulator.applyChange(e,t);return r?this.emit("change_applied",{experimentName:t,change:e}):this.emit("change_failed",{experimentName:t,change:e,reason:"selector_not_found_or_apply_failed"}),r}catch(r){return(0,h.logDebug)("[ABsmartly] Error applying change:",r),this.emit("error",{type:"change_apply_error",experimentName:t,change:e,error:(null==r?void 0:r.message)||String(r)}),!1}},e.prototype.on=function(e,t){var r=this.eventListeners.get(e)||[];r.push(t),this.eventListeners.set(e,r)},e.prototype.off=function(e,t){if(t){var r=this.eventListeners.get(e)||[],n=r.indexOf(t);-1!==n&&r.splice(n,1)}else this.eventListeners.delete(e)},e.prototype.emit=function(e,t){var r,n,i=this.eventListeners.get(e)||[];try{for(var o=a(i),l=o.next();!l.done;l=o.next()){var s=l.value;try{s(t)}catch(t){(0,h.logDebug)("[ABsmartly] Error in event listener for ".concat(e,":"),t)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.getStyleManager=function(e){var t="absmartly-styles-".concat(e),r=this.styleManagers.get(e);return r||(r=new u.StyleSheetManager(t,this.config.debug),this.styleManagers.set(e,r)),r},e.prototype.buildCssRule=function(e,t,r){void 0===r&&(r=!0);var n=Object.entries(t).map(function(e){var t=l(e,2),n=t[0],i=t[1],o=n.replace(/([A-Z])/g,"-$1").toLowerCase(),a=r?" !important":"";return" ".concat(o,": ").concat(i).concat(a,";")}).join("\n");return"".concat(e," {\n").concat(n,"\n}")},e.prototype.buildStateRules=function(e,t,r){void 0===r&&(r=!0);var n=[];return t.normal&&n.push(this.buildCssRule(e,t.normal,r)),t.hover&&n.push(this.buildCssRule("".concat(e,":hover"),t.hover,r)),t.active&&n.push(this.buildCssRule("".concat(e,":active"),t.active,r)),t.focus&&n.push(this.buildCssRule("".concat(e,":focus"),t.focus,r)),n.join("\n\n")},e.prototype.refreshExperiments=function(){this.config.debug&&(0,h.logDebug)("[ABsmartly] Refreshing experiments and clearing cache"),this.variantExtractor.clearCache(),this.config.autoApply&&this.applyInjectionsAndChanges()},e.prototype.destroy=function(){var e,t;this.domManipulator.destroy(),this.exposureTracker.destroy(),this.htmlInjector.destroy();try{for(var r=a(this.styleManagers.values()),n=r.next();!n.done;n=r.next())n.value.destroy()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.styleManagers.clear(),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.persistenceManager&&(this.persistenceManager.destroy(),this.persistenceManager=null),null!==this.antiFlickerTimeout&&(clearTimeout(this.antiFlickerTimeout),this.antiFlickerTimeout=null);var i=document.getElementById(this.antiFlickerStyleId);i&&i.remove(),this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.popstateHandler&&(window.removeEventListener("popstate",this.popstateHandler),this.popstateHandler=null),this.eventListeners.clear(),this.exposedExperiments.clear(),this.unregisterFromContext(),this.unregisterGlobally(),this.initialized=!1,this.config.debug&&(0,h.logDebug)("[ABsmartly] DOM Changes Plugin Lite destroyed")},e.prototype.registerWithContext=function(t){void 0===t&&(t=!0),this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.domPlugin={name:"DOMChangesPluginLite",version:e.VERSION,initialized:t,capabilities:["spa","visibility"],instance:this,timestamp:Date.now()},this.config.context.__domPlugin=this.config.context.__plugins.domPlugin,this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite registered with context at __plugins.domPlugin (initialized=".concat(t,")")))},e.prototype.unregisterFromContext=function(){var e;this.config.context&&((null===(e=this.config.context.__plugins)||void 0===e?void 0:e.domPlugin)&&delete this.config.context.__plugins.domPlugin,this.config.context.__domPlugin&&delete this.config.context.__domPlugin,this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite unregistered from context"))},e.prototype.registerGlobally=function(t){void 0===t&&(t=!0),(0,y.registerPlugin)("dom",{name:"DOMChangesPluginLite",version:e.VERSION,initialized:t,timestamp:Date.now(),capabilities:["spa","visibility","auto-apply"],instance:this}),this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite registered in global window.__ABSMARTLY_PLUGINS__ (initialized=".concat(t,")"))},e.prototype.unregisterGlobally=function(){(0,y.unregisterPlugin)("dom"),this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite unregistered from global registry")},e.prototype.hideContent=function(){var e=this,t=this.config.hideUntilReady;if(t&&!document.getElementById(this.antiFlickerStyleId)){var r=document.createElement("style");r.id=this.antiFlickerStyleId;var n=!1!==this.config.hideTransition;r.textContent="\n ".concat(t,n?" {\n visibility: hidden !important;\n opacity: 0 !important;\n }\n ":" {\n visibility: hidden !important;\n }\n "),document.head.appendChild(r),this.antiFlickerTimeout=window.setTimeout(function(){e.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker timeout reached (".concat(e.config.hideTimeout,"ms), showing content")),e.showContent()},this.config.hideTimeout),this.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker enabled (selector: '".concat(t,"', transition: ").concat(n?this.config.hideTransition:"none",", timeout: ").concat(this.config.hideTimeout,"ms)"))}},e.prototype.showContent=function(){var e=this;null!==this.antiFlickerTimeout&&(clearTimeout(this.antiFlickerTimeout),this.antiFlickerTimeout=null);var t=document.getElementById(this.antiFlickerStyleId);if(t)if(!1!==this.config.hideTransition){var r=this.config.hideUntilReady;t.textContent="\n ".concat(r," {\n opacity: 0 !important;\n transition: opacity ").concat(this.config.hideTransition," !important;\n }\n "),t.offsetHeight,t.textContent="\n ".concat(r," {\n opacity: 1 !important;\n transition: opacity ").concat(this.config.hideTransition," !important;\n }\n ");var n=1e3*parseFloat(this.config.hideTransition);setTimeout(function(){t.remove(),e.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker fade-in complete, style removed")},n),this.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker fading in with transition: ".concat(this.config.hideTransition))}else t.remove(),this.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker removed, content now visible")},e.prototype.watchElement=function(e,t,r){this.persistenceManager&&this.persistenceManager.watchElement(e,t,r)},e.prototype.unwatchElement=function(e,t){this.persistenceManager&&this.persistenceManager.unwatchElement(e,t)},e.VERSION=v.BUILD_VERSION,e}();t.DOMChangesPluginLite=m},713:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},o=this&&this.__values||function(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.")},a=this&&this.__read||function(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},l=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.ExposureTracker=void 0;var s=r(609),c=function(){function e(e,t){void 0===t&&(t=!1),this.context=e,this.experiments=new Map,this.trackedElements=new Map,this.mutationObserver=null,this.placeholders=new Map,this.debug=t,this.setupIntersectionObserver()}return e.prototype.registerExperiment=function(e,t,r,n,i,c){var u,d,g,h,p,f,y,v;this.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] Registering experiment for exposure tracking"),{experimentName:e,currentVariant:t,hasImmediateTrigger:i,hasViewportTrigger:c,currentChangesCount:r.length,allVariantsCount:n.length,currentChangeTypes:r.map(function(e){return{type:e.type,selector:e.selector,trigger_on_view:e.trigger_on_view||!1}})});var m=new Set,b=new Set,x=new Map,w=new Set;try{for(var E=o(n),S=E.next();!S.done;S=E.next()){var C=S.value;try{for(var A=(g=void 0,o(C)),_=A.next();!_.done;_=A.next()){var k=_.value;k.trigger_on_view&&("move"===k.type?(x.has(k.selector)||x.set(k.selector,new Set),k.targetSelector&&x.get(k.selector).add(k.targetSelector)):"delete"===k.type?w.add(k.selector):m.add(k.selector))}}catch(e){g={error:e}}finally{try{_&&!_.done&&(h=A.return)&&h.call(A)}finally{if(g)throw g.error}}}}catch(e){u={error:e}}finally{try{S&&!S.done&&(d=E.return)&&d.call(E)}finally{if(u)throw u.error}}var O=function(r){for(var i,a,l=[],s=0;s<n.length;s++){var c=n[s].find(function(e){return"move"===e.type&&e.selector===r&&e.trigger_on_view});(null==c?void 0:c.targetSelector)&&l.push({targetSelector:c.targetSelector,position:c.position||"lastChild",variantIndex:s})}var u=l.findIndex(function(e){return e.variantIndex===t});if(u>=0){m.add(r);for(var d=0;d<l.length;d++){var g=l[d];d!==u&&P.createContainerPlaceholder(e,r,g.targetSelector,g.position)}}else{m.add(r);try{for(var h=(i=void 0,o(l)),p=h.next();!p.done;p=h.next())g=p.value,P.createContainerPlaceholder(e,r,g.targetSelector,g.position)}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}},P=this;try{for(var D=o(x),T=D.next();!T.done;T=D.next())O(a(T.value,1)[0])}catch(e){p={error:e}}finally{try{T&&!T.done&&(f=D.return)&&f.call(D)}finally{if(p)throw p.error}}var L=function(t){r.some(function(e){return"delete"===e.type&&e.selector===t&&e.trigger_on_view})?0===M.createInPlacePlaceholder(e,t)&&(m.add(t),M.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] Delete element doesn't exist yet - tracking selector for when it appears"),{selector:t})):m.add(t)},M=this;try{for(var I=o(w),N=I.next();!N.done;N=I.next())L(N.value)}catch(e){y={error:e}}finally{try{N&&!N.done&&(v=I.return)&&v.call(I)}finally{if(y)throw y.error}}var j={experimentName:e,variant:t,changes:r,allPossibleSelectors:new Set(l(l([],a(m),!1),a(b),!1)),triggered:!1,hasImmediateTrigger:i,hasViewportTrigger:c};this.experiments.set(e,j),this.debug&&(0,s.logDebug)("[ABsmartly] Experiment ".concat(e," will track selectors:"),Array.from(j.allPossibleSelectors)),i?((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓ HAS IMMEDIATE TRIGGER - triggering exposure NOW"),{experimentName:e,currentVariant:t,allVariantCounts:n.map(function(e,t){return{variant:t,count:e.length}})}),this.triggerExposure(e).catch(function(t){(0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✗ Failed to trigger exposure:"),t)})):c?((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓ HAS VIEWPORT TRIGGER - setting up viewport observers"),{experimentName:e,currentVariant:t,selectorsToWatch:Array.from(j.allPossibleSelectors),allVariantCounts:n.map(function(e,t){return{variant:t,count:e.length}})}),this.observeSelectors(e,j.allPossibleSelectors)):(0,s.logDebug)("[EXPOSURE] [".concat(e,"] ⚠️ No immediate or viewport trigger detected - experiment will NOT be exposed!"),{experimentName:e,currentVariant:t,hasImmediateTrigger:i,hasViewportTrigger:c,currentChanges:r.map(function(e){return{type:e.type,trigger_on_view:e.trigger_on_view}})})},e.prototype.createContainerPlaceholder=function(e,t,r,n){var i,o;void 0===n&&(n="lastChild");var a=document.querySelector(r);if(a){var l="".concat(e,"-").concat(t,"-").concat(r,"-").concat(n);if(!this.placeholders.has(l)){var c=document.createElement("span");switch(c.style.cssText="\n display: inline-block;\n width: 1px;\n height: 1px;\n position: relative;\n left: -1px;\n visibility: hidden;\n pointer-events: none;\n font-size: 0;\n line-height: 0;\n overflow: hidden;\n ",c.setAttribute("data-absmartly-placeholder","true"),c.setAttribute("data-absmartly-original-selector",t),c.setAttribute("data-absmartly-experiment",e),c.setAttribute("aria-hidden","true"),n){case"firstChild":a.insertBefore(c,a.firstChild);break;case"lastChild":default:a.appendChild(c);break;case"before":null===(i=a.parentElement)||void 0===i||i.insertBefore(c,a);break;case"after":null===(o=a.parentElement)||void 0===o||o.insertBefore(c,a.nextSibling)}this.placeholders.set(l,c),this.trackElement(c,e),this.debug&&(0,s.logDebug)("[ABsmartly] Created placeholder for ".concat(t," at ").concat(r," (").concat(n,")"))}}},e.prototype.createInPlacePlaceholder=function(e,t){var r,n=document.querySelectorAll(t);if(0===n.length)return this.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] No elements found for delete placeholder - will track selector instead"),{selector:t}),0;for(var i=0,o=0;o<n.length;o++){var a=n[o],l=t.replace(/[^a-zA-Z0-9-]/g,"_"),c="absmartly-delete-".concat(e,"-").concat(l,"-").concat(o),u="".concat(e,"-delete-").concat(t,"-").concat(o);if(!a.hasAttribute("data-absmartly-delete-placeholder")){var d=document.createElement("span");d.id=c,d.style.cssText="\n display: inline-block;\n width: 1px;\n height: 1px;\n position: relative;\n left: -1px;\n visibility: hidden;\n pointer-events: none;\n font-size: 0;\n line-height: 0;\n overflow: hidden;\n ",d.setAttribute("data-absmartly-placeholder","true"),d.setAttribute("data-absmartly-delete-placeholder","true"),d.setAttribute("data-absmartly-original-selector",t),d.setAttribute("data-absmartly-experiment",e),d.setAttribute("aria-hidden","true"),null===(r=a.parentElement)||void 0===r||r.insertBefore(d,a),a.remove(),this.placeholders.set(u,d),this.trackElement(d,e),i++,this.debug&&(0,s.logDebug)("[ABsmartly] Created in-place delete placeholder for ".concat(t," in experiment ").concat(e))}}return i},e.prototype.getOriginalParentForMove=function(e){var t=document.querySelector(e);return(null==t?void 0:t.parentElement)?this.getStableParentSelector(t.parentElement):null},e.prototype.getStableParentSelector=function(e){if(e.id)return"#".concat(e.id);if(e.className){var t=e.className.split(" ").filter(function(e){return e&&!e.startsWith("absmartly")});if(t.length>0)return".".concat(t[0])}var r=e.parentElement;if(r){var n=Array.from(r.children).indexOf(e);return"".concat(e.tagName.toLowerCase(),":nth-child(").concat(n+1,")")}return null},e.prototype.observeSelectors=function(e,t){var r,n,i,a;try{for(var l=o(t),s=l.next();!s.done;s=l.next()){var c=s.value,u=document.querySelectorAll(c);if(u.length>0)try{for(var d=(i=void 0,o(u)),g=d.next();!g.done;g=d.next()){var h=g.value;this.trackElement(h,e)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}else this.watchForSelector(c,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}},e.prototype.trackElement=function(e,t){this.trackedElements.has(e)?this.trackedElements.get(e).experiments.add(t):(this.trackedElements.set(e,{element:e,experiments:new Set([t]),isPlaceholder:e.hasAttribute("data-absmartly-placeholder")}),this.observer.observe(e))},e.prototype.watchForSelector=function(e,t){this.mutationObserver||this.setupMutationObserver()},e.prototype.setupIntersectionObserver=function(){var e=this;this.observer=new IntersectionObserver(function(t){var r,n;try{for(var i=o(t),a=i.next();!a.done;a=i.next()){var l=a.value;l.isIntersecting&&e.handleElementVisible(l.target)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},{threshold:.01,rootMargin:"0px"})},e.prototype.setupMutationObserver=function(){var e=this;this.mutationObserver=new MutationObserver(function(t){var r,n,i,a;try{for(var l=o(t),s=l.next();!s.done;s=l.next()){var c=s.value;try{for(var u=(i=void 0,o(c.addedNodes)),d=u.next();!d.done;d=u.next()){var g=d.value;g instanceof Element&&e.checkNewElement(g)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})},e.prototype.checkNewElement=function(e){var t,r,n,i,l,s;try{for(var c=o(this.experiments),u=c.next();!u.done;u=c.next()){var d=a(u.value,2),g=d[0],h=d[1];try{for(var p=(n=void 0,o(h.allPossibleSelectors)),f=p.next();!f.done;f=p.next()){var y=f.value;e.matches(y)&&this.trackElement(e,g);try{for(var v=(l=void 0,o(e.querySelectorAll(y))),m=v.next();!m.done;m=v.next()){var b=m.value;this.trackElement(b,g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(s=v.return)&&s.call(v)}finally{if(l)throw l.error}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}},e.prototype.handleElementVisible=function(e){var t,r,n=this.trackedElements.get(e);if(n){var i=function(t){var r=a.experiments.get(t);if(r&&!r.triggered&&(a.triggerExposure(t).catch(function(e){(0,s.logDebug)("[ABsmartly] Failed to trigger exposure for ".concat(t,":"),e)}),a.debug)){var i=n.isPlaceholder?e.getAttribute("data-absmartly-original-selector"):a.getElementSelector(e);(0,s.logDebug)("[ABsmartly] Triggering exposure for ".concat(t," via ").concat(i))}},a=this;try{for(var l=o(n.experiments),c=l.next();!c.done;c=l.next())i(c.value)}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}}},e.prototype.triggerExposure=function(e){return n(this,void 0,void 0,function(){var t,r;return i(this,function(n){switch(n.label){case 0:return(t=this.experiments.get(e))?t.triggered?((0,s.logDebug)("[EXPOSURE] [".concat(e,"] Already triggered, skipping")),[2]):((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓ CALLING context.treatment() to trigger exposure"),{experimentName:e,variant:t.variant}),[4,this.context.ready()]):((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✗ Cannot trigger - experiment not found in tracker")),[2]);case 1:return n.sent(),r=this.context.treatment(e),t.triggered=!0,(0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓✓ EXPOSURE TRIGGERED - context.treatment() completed"),{experimentName:e,variant:t.variant,treatment:r}),this.cleanupExperiment(e),[2]}})})},e.prototype.cleanupExperiment=function(e){var t,r,n,i;try{for(var l=o(this.trackedElements),s=l.next();!s.done;s=l.next()){var c=a(s.value,2),u=c[0],d=c[1];d.experiments.delete(e),0===d.experiments.size&&(this.observer.unobserve(u),this.trackedElements.delete(u))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var g=o(this.placeholders),h=g.next();!h.done;h=g.next()){var p=a(h.value,2),f=p[0],y=p[1];f.startsWith("".concat(e,"-"))&&(y.remove(),this.placeholders.delete(f))}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}var v=this.experiments.get(e);v&&v.allPossibleSelectors.clear(),Array.from(this.experiments.values()).every(function(e){return e.triggered})&&this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null)},e.prototype.getElementSelector=function(e){if(e.id)return"#".concat(e.id);if(e.className){var t=e.className.split(" ").filter(function(e){return e&&!e.startsWith("absmartly")});if(t.length>0)return".".concat(t.join("."))}return e.tagName.toLowerCase()},e.prototype.needsViewportTracking=function(e){var t,r=this.experiments.get(e);return null!==(t=null==r?void 0:r.hasViewportTrigger)&&void 0!==t&&t},e.prototype.isTriggered=function(e){var t,r=this.experiments.get(e);return null!==(t=null==r?void 0:r.triggered)&&void 0!==t&&t},e.prototype.destroy=function(){var e,t;this.observer.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect();try{for(var r=o(this.placeholders.values()),n=r.next();!n.done;n=r.next())n.value.remove()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.experiments.clear(),this.trackedElements.clear(),this.placeholders.clear(),this.debug&&(0,s.logDebug)("[ABsmartly] ExposureTracker destroyed")},e}();t.ExposureTracker=c},796:function(e,t){!function(e){"use strict";let t=-1;const r=e=>{addEventListener("pageshow",r=>{r.persisted&&(t=r.timeStamp,e(r))},!0)},n=(e,t,r,n)=>{let i,o;return a=>{t.value>=0&&(a||n)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},i=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},o=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},a=()=>{const e=o();return e?.activationStart??0},l=(e,r=-1)=>{const n=o();let i="navigate";return t>=0?i="back-forward-cache":n&&(document.prerendering||a()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:r,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},s=new WeakMap;function c(e,t){return s.get(e)||s.set(e,new t),s.get(e)}class u{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const d=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},g=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let h=-1;const p=new Set,f=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,y=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of p)e();isFinite(h)||(h="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",y,!0))}},v=()=>{if(h<0){const e=a(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;h=t??f(),addEventListener("visibilitychange",y,!0),addEventListener("prerenderingchange",y,!0),r(()=>{setTimeout(()=>{h=f()})})}return{get firstHiddenTime(){return h},onHidden(e){p.add(e)}}},m=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},b=[1800,3e3],x=(e,t={})=>{m(()=>{const o=v();let s,c=l("FCP");const u=d("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(u.disconnect(),t.startTime<o.firstHiddenTime&&(c.value=Math.max(t.startTime-a(),0),c.entries.push(t),s(!0)))});u&&(s=n(e,c,b,t.reportAllChanges),r(r=>{c=l("FCP"),s=n(e,c,b,t.reportAllChanges),i(()=>{c.value=performance.now()-r.timeStamp,s(!0)})}))})},w=[.1,.25];let E=0,S=1/0,C=0;const A=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),C=Math.max(C,t.interactionId),E=C?(C-S)/7+1:0)};let _;const k=()=>_?E:performance.interactionCount??0,O=()=>{"interactionCount"in performance||_||(_=d("event",A,{type:"event",buffered:!0,durationThreshold:0}))};let P=0;class D{u=[];l=new Map;p;m;v(){P=k(),this.u.length=0,this.l.clear()}T(){const e=Math.min(this.u.length-1,Math.floor((k()-P)/50));return this.u[e]}h(e){if(this.p?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.L){if(r?e.duration>r.L?(r.entries=[e],r.L=e.duration):e.duration===r.L&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],L:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.L-e.L),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.m?.(r)}}}const T=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=g(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},L=[200,500];class M{p;h(e){this.p?.(e)}}const I=[2500,4e3],N=[800,1800],j=e=>{document.prerendering?m(()=>j(e)):"complete"!==document.readyState?addEventListener("load",()=>j(e),!0):setTimeout(e)};e.CLSThresholds=w,e.FCPThresholds=b,e.INPThresholds=L,e.LCPThresholds=I,e.TTFBThresholds=N,e.onCLS=(e,t={})=>{const o=v();x(g(()=>{let a,s=l("CLS",0);const g=c(t,u),h=e=>{for(const t of e)g.h(t);g.i>s.value&&(s.value=g.i,s.entries=g.o,a())},p=d("layout-shift",h);p&&(a=n(e,s,w,t.reportAllChanges),o.onHidden(()=>{h(p.takeRecords()),a(!0)}),r(()=>{g.i=0,s=l("CLS",0),a=n(e,s,w,t.reportAllChanges),i(()=>a())}),setTimeout(a))}))},e.onFCP=x,e.onINP=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=v();m(()=>{O();let o,a=l("INP");const s=c(t,D),u=e=>{T(()=>{for(const t of e)s.h(t);const t=s.T();t&&t.L!==a.value&&(a.value=t.L,a.entries=t.entries,o())})},g=d("event",u,{durationThreshold:t.durationThreshold??40});o=n(e,a,L,t.reportAllChanges),g&&(g.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{u(g.takeRecords()),o(!0)}),r(()=>{s.v(),a=l("INP"),o=n(e,a,L,t.reportAllChanges)}))})},e.onLCP=(e,t={})=>{m(()=>{const o=v();let s,u=l("LCP");const h=c(t,M),p=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)h.h(t),t.startTime<o.firstHiddenTime&&(u.value=Math.max(t.startTime-a(),0),u.entries=[t],s())},f=d("largest-contentful-paint",p);if(f){s=n(e,u,I,t.reportAllChanges);const o=g(()=>{p(f.takeRecords()),f.disconnect(),s(!0)}),a=e=>{e.isTrusted&&(T(o),removeEventListener(e.type,a,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,a,{capture:!0});r(r=>{u=l("LCP"),s=n(e,u,I,t.reportAllChanges),i(()=>{u.value=performance.now()-r.timeStamp,s(!0)})})}})},e.onTTFB=(e,t={})=>{let i=l("TTFB"),s=n(e,i,N,t.reportAllChanges);j(()=>{const c=o();c&&(i.value=Math.max(c.responseStart-a(),0),i.entries=[c],s(!0),r(()=>{i=l("TTFB",0),s=n(e,i,N,t.reportAllChanges),s(!0)}))})}}(t)},834:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUILD_DEBUG=t.BUILD_VERSION=void 0,t.BUILD_VERSION="1.3.6",t.BUILD_DEBUG=!1},943:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=function(e,t){"undefined"!=typeof window&&(window.__ABSMARTLY_PLUGINS__||(window.__ABSMARTLY_PLUGINS__={}),window.__ABSMARTLY_PLUGINS__[e]=t)},t.unregisterPlugin=function(e){"undefined"!=typeof window&&window.__ABSMARTLY_PLUGINS__&&delete window.__ABSMARTLY_PLUGINS__[e]},t.isPluginRegistered=function(e){var t;return"undefined"!=typeof window&&!(!window.__ABSMARTLY_PLUGINS__||!(null===(t=window.__ABSMARTLY_PLUGINS__[e])||void 0===t?void 0:t.initialized))},t.getRegisteredPlugins=function(){return"undefined"==typeof window?{}:window.__ABSMARTLY_PLUGINS__||{}}},964:function(e,t,r){"use strict";var n=this&&this.__values||function(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.")},i=this&&this.__read||function(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},o=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMManipulatorLite=void 0;var a=r(609),l=r(214),s=function(){function e(e,t){void 0===e&&(e=!1);var r=this;this.appliedChanges=new Map,this.debug=e,this.plugin=t,this.pendingManager=new l.PendingChangeManager(function(e,t,n){return n?r.applyChangeToSpecificElement(e,t,n):r.applyChange(e,t)},e)}return e.prototype.executeUserJavaScript=function(e,t,r,n){var i="absmartly-experiment-".concat(r||"unknown",".js"),o="var _debug = (typeof _debug !== 'undefined' ? _debug : { debugLog: console.log.bind(console), debugWarn: console.warn.bind(console), debugError: console.error.bind(console) });\n";try{return new Function("element",o+e+"\n//# sourceURL=".concat(i))(t),!0}catch(g){var a=g instanceof Error?g.message:String(g);if(!(g instanceof EvalError||/unsafe-eval|Content Security Policy|CSP|refused to evaluate/i.test(a)))return this.reportJsExecutionFailure({experimentName:r,selector:n,reason:"runtime",error:a,stack:g instanceof Error?g.stack:void 0}),!1;try{var l="__absmartly_js_target_".concat(Date.now(),"_").concat(Math.floor(1e9*Math.random())),s="".concat(l,"_ran");window[l]=t,window[s]=!1;var c=document.createElement("script");c.textContent="(function(element){".concat(o).concat(e,"\n})(window['").concat(l,"']);\n")+"window['".concat(s,"'] = true;\n")+"try { delete window['".concat(l,"']; } catch(_e) { window['").concat(l,"'] = undefined; }\n")+"//# sourceURL=".concat(i),(document.head||document.documentElement).appendChild(c),c.remove();var u=!0===window[s];try{delete window[s]}catch(e){window[s]=void 0}return!!u||(this.reportJsExecutionFailure({experimentName:r,selector:n,reason:"csp",error:"CSP blocked dynamic script execution. eval(): ".concat(a,"; inline <script> did not execute (likely blocked by script-src without 'unsafe-inline').")}),!1)}catch(e){var d=e instanceof Error?e.message:String(e);return this.reportJsExecutionFailure({experimentName:r,selector:n,reason:"csp",error:"CSP blocked dynamic script execution. eval(): ".concat(a,"; inline <script>: ").concat(d),stack:e instanceof Error?e.stack:void 0}),!1}}},e.prototype.reportJsExecutionFailure=function(e){try{(0,a.logProductionWarn)("[ABsmartly] JavaScript DOM change failed (".concat(e.reason,') for "').concat(e.experimentName,'" selector "').concat(e.selector,'": ').concat(e.error),e.stack?{stack:e.stack}:void 0)}catch(e){}try{"undefined"!=typeof document&&"function"==typeof CustomEvent&&document.dispatchEvent(new CustomEvent("absmartly:js-error",{detail:e}))}catch(e){}},e.prototype.applyChange=function(e,t){var r,i,o,l,s,c,u,d,g,h,p,f,y,v,m=this;if(!e.enabled&&void 0!==e.enabled)return(0,a.logDebug)("Skipping disabled change for experiment: ".concat(t),{experimentName:t,selector:e.selector,changeType:e.type}),!1;var b=!!this.plugin.reapplyingElements&&Array.from(this.plugin.reapplyingElements).length>0,x=null===(d=null===(u=this.plugin.config)||void 0===u?void 0:u.context)||void 0===d?void 0:d.peek(t);this.debug&&(0,a.logDebug)("[DOM-APPLY] [".concat(t,"] ").concat(b?"RE-APPLYING":"APPLYING"," change"),{experimentName:t,userVariant:x,selector:e.selector,type:e.type,timestamp:Date.now(),callStack:null===(g=(new Error).stack)||void 0===g?void 0:g.split("\n").slice(2,4).join("\n")});try{if("styleRules"===e.type)return this.applyStyleRules(e,t);if("create"===e.type)return!!(e.element&&e.targetSelector&&this.createElement(e,t))&&(this.trackAppliedChange(t,e),(0,a.logChangeApplication)(t,e.targetSelector,e.type,1,!0),!0);var w=document.querySelectorAll(e.selector),E=[];if(0===w.length)return e.waitForElement||(null===(h=this.plugin.config)||void 0===h?void 0:h.spa)?(this.debug&&(0,a.logDebug)("[ABsmartly] Element not found, adding to pending: ".concat(e.selector)),this.pendingManager.addPending({change:e,experimentName:t,observerRoot:e.observerRoot}),!0):(this.debug&&(0,a.logDebug)("[ABsmartly] No elements found for selector: ".concat(e.selector)),(0,a.logDebug)("No elements found for selector",{experimentName:t,selector:e.selector,changeType:e.type}),!1);try{for(var S=n(w),C=S.next();!C.done;C=S.next()){var A=C.value;if(this.debug&&"style"===e.type){var _={};if(e.value&&"object"==typeof e.value)try{for(var k=(o=void 0,n(Object.keys(e.value))),O=k.next();!O.done;O=k.next())_[L=O.value.replace(/([A-Z])/g,"-$1").toLowerCase()]=A.style.getPropertyValue(L)}catch(e){o={error:e}}finally{try{O&&!O.done&&(l=k.return)&&l.call(k)}finally{if(o)throw o.error}}(0,a.logDebug)("[DOM-BEFORE-APPLY] Element styles before change",{experimentName:t,selector:e.selector,element:A.tagName,oldStyles:_,newStyles:e.value})}if(this.applyChangeToElement(A,e),this.debug&&"style"===e.type){var P={};if(e.value&&"object"==typeof e.value)try{for(var D=(s=void 0,n(Object.keys(e.value))),T=D.next();!T.done;T=D.next()){var L;P[L=T.value.replace(/([A-Z])/g,"-$1").toLowerCase()]=A.style.getPropertyValue(L)}}catch(e){s={error:e}}finally{try{T&&!T.done&&(c=D.return)&&c.call(D)}finally{if(s)throw s.error}}(0,a.logDebug)("[DOM-AFTER-APPLY] Element styles after change",{experimentName:t,selector:e.selector,element:A.tagName,appliedStyles:P})}if("javascript"===e.type)if(e.value){var M=null===(f=null===(p=this.plugin.config)||void 0===p?void 0:p.context)||void 0===f?void 0:f.peek(t);this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] Executing JavaScript change"),{experimentName:t,userVariant:M,selector:e.selector,element:A.tagName,code:String(e.value).substring(0,100)+"..."});var I=String(e.value);this.executeUserJavaScript(I,A,t,e.selector)&&(E.push(A),this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] ✓ JavaScript executed successfully"),{experimentName:t,userVariant:M,selector:e.selector,element:A.tagName,code:I}))}else(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] ✗ No JavaScript code provided in change.value"),{experimentName:t,selector:e.selector});else if("move"===e.type){var N=e.targetSelector||(e.value&&"object"==typeof e.value?e.value.targetSelector:null),j=e.position||(e.value&&"object"==typeof e.value?e.value.position:null);if(N){var R=document.querySelector(N);R?(this.moveElement(A,R,j),E.push(A)):this.debug&&(0,a.logDebug)("[ABsmartly] Move target not found: ".concat(N))}}else E.push(A);"style"===e.type&&e.persistStyle||"attribute"===e.type&&e.persistAttribute||"javascript"===e.type&&!0===e.persistScript||(null===(y=this.plugin.config)||void 0===y?void 0:y.spa)?this.plugin.watchElement(A,t,e):this.debug&&(0,a.logDebug)("[WATCH-SKIP] NOT watching element - no persist flag and SPA disabled",{experimentName:t,selector:e.selector,element:A.tagName,changeType:e.type,spaMode:null===(v=this.plugin.config)||void 0===v?void 0:v.spa})}}catch(e){r={error:e}}finally{try{C&&!C.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(E.length>0){this.trackAppliedChange(t,e),e.waitForElement&&this.pendingManager.removePending(e.selector,t,e.observerRoot);var B=E.some(function(e){var t;return null===(t=m.plugin.reapplyingElements)||void 0===t?void 0:t.has(e)});return B||(0,a.logChangeApplication)(t,e.selector,e.type,E.length,!0),!0}return(0,a.logChangeApplication)(t,e.selector,e.type,0,!1),!1}catch(r){return this.debug&&(0,a.logDebug)("[ABsmartly] Error applying DOM change:",r,e),(0,a.logDebug)("Error applying DOM change",{experimentName:t,selector:e.selector,changeType:e.type,error:r instanceof Error?r.message:"Unknown error"}),!1}},e.prototype.moveElement=function(e,t,r){var n,i,o;switch(r){case"before":null===(n=t.parentElement)||void 0===n||n.insertBefore(e,t);break;case"after":t.nextSibling?null===(i=t.parentElement)||void 0===i||i.insertBefore(e,t.nextSibling):null===(o=t.parentElement)||void 0===o||o.appendChild(e);break;case"firstChild":t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);break;default:t.appendChild(e)}},e.prototype.createElement=function(e,t){var r,i;if(!e.element||!e.targetSelector)return null;var o=document.querySelector(e.targetSelector);if(!o)return this.debug&&(0,a.logDebug)("[ABsmartly] Create target not found: ".concat(e.targetSelector)),null;var l=document.createElement("div");l.innerHTML=e.element;var s=Array.from(l.children);if(0===s.length)return null;try{for(var c=n(s),u=c.next();!u.done;u=c.next()){var d=u.value;this.moveElement(d,o,e.position)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return s[0]},e.prototype.applyStyleRules=function(e,t){try{var r=this.plugin.getStyleManager(t),n="".concat(e.selector,"::states"),i=void 0;if("string"==typeof e.value&&e.value.trim())i=e.value;else{if(!e.states)return!1;i=this.plugin.buildStateRules(e.selector,e.states,!1!==e.important)}return r.setRule(n,i),this.debug&&((0,a.logDebug)("[ABsmartly] Applied style rule: ".concat(n)),(0,a.logDebug)("[ABsmartly] CSS: ".concat(i))),this.trackAppliedChange(t,e),(0,a.logChangeApplication)(t,e.selector,"styleRules",1,!0),!0}catch(e){return this.debug&&(0,a.logDebug)("[ABsmartly] Error applying style rules:",e),!1}},e.prototype.applyChangeToElement=function(e,t){var r,l,s,c,u,d;switch(t.type){case"text":void 0!==t.value&&(e.textContent=String(t.value));break;case"html":void 0!==t.value&&(e.innerHTML=String(t.value));break;case"style":if(t.value&&"object"==typeof t.value)try{for(var g=n(Object.entries(t.value)),h=g.next();!h.done;h=g.next()){var p=i(h.value,2),f=p[0],y=p[1],v=f.replace(/([A-Z])/g,"-$1").toLowerCase(),m=!0===t.important?"important":"";e.style.setProperty(v,String(y),m)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(l=g.return)&&l.call(g)}finally{if(r)throw r.error}}break;case"class":t.add&&Array.isArray(t.add)&&(s=e.classList).add.apply(s,o([],i(t.add),!1)),t.remove&&Array.isArray(t.remove)&&(c=e.classList).remove.apply(c,o([],i(t.remove),!1));break;case"attribute":if(t.value&&"object"==typeof t.value)try{for(var b=n(Object.entries(t.value)),x=b.next();!x.done;x=b.next()){var w=i(x.value,2),E=w[0];null==(y=w[1])?e.removeAttribute(E):e.setAttribute(E,String(y))}}catch(e){u={error:e}}finally{try{x&&!x.done&&(d=b.return)&&d.call(b)}finally{if(u)throw u.error}}break;case"move":if(t.value&&"object"==typeof t.value){var S=t.value,C=document.querySelector(S.targetSelector);C?this.moveElement(e,C,S.position):this.debug&&(0,a.logDebug)("[ABsmartly] Move target not found: ".concat(S.targetSelector))}break;case"delete":e.remove()}},e.prototype.applyChangeToSpecificElement=function(e,t,r){var n;try{if(this.applyChangeToElement(r,e),"javascript"===e.type&&e.value){if(this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] Executing JavaScript on specific element"),{experimentName:t,selector:e.selector,element:r.tagName,code:String(e.value).substring(0,100)+"..."}),!this.executeUserJavaScript(String(e.value),r,t,e.selector))return!1;this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] ✓ JavaScript executed successfully"),{experimentName:t,selector:e.selector,element:r.tagName})}else if("move"===e.type){var i=e.targetSelector||(e.value&&"object"==typeof e.value?e.value.targetSelector:null),o=e.position||(e.value&&"object"==typeof e.value?e.value.position:null);if(i){var l=document.querySelector(i);if(!l)return!1;this.moveElement(r,l,o)}}return("style"===e.type&&e.persistStyle||"attribute"===e.type&&e.persistAttribute||"javascript"===e.type&&!0===e.persistScript||(null===(n=this.plugin.config)||void 0===n?void 0:n.spa))&&this.plugin.watchElement(r,t,e),!0}catch(e){return this.debug&&(0,a.logDebug)("[ABsmartly] Error applying change to specific element:",e),!1}},e.prototype.trackAppliedChange=function(e,t){var r=this.appliedChanges.get(e);r||(r=new Set,this.appliedChanges.set(e,r));var n="".concat(t.selector,"-").concat(t.type);r.add(n)},e.prototype.hasChanges=function(e){return this.appliedChanges.has(e)},e.prototype.clearTracking=function(e){e?this.appliedChanges.delete(e):this.appliedChanges.clear()},e.prototype.removeAllPending=function(e){this.pendingManager.removeAllPending(e)},e.prototype.destroy=function(){this.pendingManager.destroy(),this.appliedChanges.clear()},e}();t.DOMManipulatorLite=s},973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLMatcher=void 0;var n=r(609),i=function(){function e(){}return e.matches=function(e,t){void 0===t&&(t=window.location.href);var r=this.normalizeFilter(e),n=this.extractURLPart(t,r.matchType);return(!r.exclude||!this.matchesPatterns(r.exclude,n,r.mode))&&(!r.include||0!==r.include.length&&this.matchesPatterns(r.include,n,r.mode))},e.extractURLPart=function(e,t){void 0===t&&(t="path");try{var r=new URL(e);switch(t){case"full-url":return r.href;case"path":default:return r.pathname+r.hash;case"domain":return r.hostname;case"query":return r.search;case"hash":return r.hash}}catch(t){return(0,n.logDebug)("[ABsmartly] Failed to parse URL: ".concat(e),t),e}},e.matchesPatterns=function(e,t,r){var i=this;return void 0===r&&(r="simple"),e.some(function(e){if("regex"===r)try{return new RegExp(e).test(t)}catch(t){return(0,n.logDebug)("[ABsmartly] Invalid regex pattern: ".concat(e),t),!1}return i.matchSimplePattern(e,t)})},e.matchSimplePattern=function(e,t){var r=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");try{return new RegExp("^".concat(r,"$")).test(t)}catch(t){return(0,n.logDebug)("[ABsmartly] Invalid pattern: ".concat(e),t),!1}},e.normalizeFilter=function(e){return"string"==typeof e?{include:[e],exclude:[],mode:"simple",matchType:"path"}:Array.isArray(e)?{include:e.length>0?e:void 0,exclude:[],mode:"simple",matchType:"path"}:{include:e.include,exclude:e.exclude||[],mode:e.mode||"simple",matchType:e.matchType||"path"}},e}();t.URLMatcher=i},977:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=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])},n(e,t)},function(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginFull=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(248).OverridesPlugin);t.OverridesPluginFull=o}},t={},function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}(196);var e,t});
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ABsmartlySDKPlugins=t():e.ABsmartlySDKPlugins=t()}(this,()=>{return e={44:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},o=this&&this.__values||function(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.")},a=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginLite=void 0;var l=r(609),s=r(943),c=r(186),u=function(){function e(e){var t,r,n,i,o;if(this.initialized=!1,!e.context)throw new Error("[OverridesPluginLite] Context is required");this.config={context:e.context,cookieName:null!==(t=e.cookieName)&&void 0!==t?t:"absmartly_overrides",useQueryString:null===(r=e.useQueryString)||void 0===r||r,queryPrefix:null!==(n=e.queryPrefix)&&void 0!==n?n:"exp_",persistQueryToCookie:null!==(i=e.persistQueryToCookie)&&void 0!==i&&i,debug:null!==(o=e.debug)&&void 0!==o&&o},this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Initialized with config:",{cookieName:this.config.cookieName,useQueryString:this.config.useQueryString,queryPrefix:this.config.queryPrefix})}return e.prototype.ready=function(){return n(this,void 0,void 0,function(){var e,t,r,n,s,c,u,d,g,h,p;return i(this,function(i){if(this.initialized)return this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Already initialized"),[2];if(this.initialized=!0,this.registerWithContext(),this.registerGlobally(),e={},this.config.useQueryString&&"undefined"!=typeof window&&(e=this.getQueryStringOverrides(),this.config.persistQueryToCookie&&this.config.cookieName&&Object.keys(e).length>0&&this.persistOverridesToCookie(e)),0===Object.keys(e).length&&this.config.cookieName&&(e=this.getCookieOverrides()),0===Object.keys(e).length)return this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] No overrides found"),[2];try{for(t=o(Object.entries(e)),r=t.next();!r.done;r=t.next())n=a(r.value,2),s=n[0],c=n[1],u="number"==typeof c?c:c.variant,isNaN(u)?this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Skipping invalid variant for ".concat(s,": ").concat(u)):(null===(p=(h=this.config.context).override)||void 0===p||p.call(h,s,u),this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Override: ".concat(s," -> variant ").concat(u)))}catch(e){d={error:e}}finally{try{r&&!r.done&&(g=t.return)&&g.call(t)}finally{if(d)throw d.error}}return[2]})})},e.prototype.initialize=function(){return n(this,void 0,void 0,function(){return i(this,function(e){return[2,this.ready()]})})},e.prototype.getQueryStringOverrides=function(){if("undefined"==typeof window||!window.location)return{};var e=(0,c.getQueryStringOverrides)(this.config.queryPrefix);return this.config.debug&&Object.keys(e).length>0&&(0,l.logDebug)("[OverridesPluginLite] Query string overrides:",e),e},e.prototype.getCookieOverrides=function(){return"undefined"==typeof document?{}:(0,c.getCookieOverrides)(this.config.cookieName)},e.prototype.persistOverridesToCookie=function(e){if(this.config.cookieName&&"undefined"!=typeof document&&((0,c.persistOverridesToCookie)(e,{cookieName:this.config.cookieName}),this.config.debug)){var t=(0,c.serializeOverrides)(e);(0,l.logDebug)("[OverridesPluginLite] Persisted to cookie:",t)}},e.prototype.registerWithContext=function(){this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.overridesPlugin={name:"OverridesPluginLite",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides"],instance:this,timestamp:Date.now()},this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Registered with context at __plugins.overridesPlugin"))},e.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.config.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.config.context.__plugins.overridesPlugin,this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Unregistered from context"))},e.prototype.destroy=function(){this.initialized=!1,this.unregisterFromContext(),this.unregisterGlobally()},e.prototype.registerGlobally=function(){(0,s.registerPlugin)("overrides",{name:"OverridesPluginLite",version:"1.0.0",initialized:!0,timestamp:Date.now(),capabilities:["cookie-overrides","query-overrides"],instance:this}),this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Registered in global window.__ABSMARTLY_PLUGINS__")},e.prototype.unregisterGlobally=function(){(0,s.unregisterPlugin)("overrides"),this.config.debug&&(0,l.logDebug)("[OverridesPluginLite] Unregistered from global registry")},e}();t.OverridesPluginLite=u},91:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},o=this&&this.__read||function(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},a=this&&this.__spreadArray||function(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))},l=this&&this.__values||function(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.")};Object.defineProperty(t,"__esModule",{value:!0}),t.CookiePlugin=void 0;var s=r(609),c=r(319),u=function(){function e(e){void 0===e&&(e={}),this.context=e.context,this.debug=e.debug||!1,this.cookieDomain=e.cookieDomain||".absmartly.com",this.cookiePath=e.cookiePath||"/",this.sameSite=e.sameSite||"Lax",this.secure=e.secure||!1,this.cookieExpiryDays=e.cookieExpiryDays||730,this.unitIdCookieName=e.unitIdCookieName||"abs",this.publicIdCookieName=e.publicIdCookieName||"abs_public",this.expiryCookieName=e.expiryCookieName||"abs_expiry",this.utmCookieName=e.utmCookieName||"abs_utm_params",this.utmParams=e.utmParamsList||["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],this.autoUpdateExpiry=!1!==e.autoUpdateExpiry,this.expiryCheckInterval=e.expiryCheckInterval||30}return e.prototype.debugLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&s.logDebug.apply(void 0,a(["[CookiePlugin]"],o(e),!1))},e.prototype.setCookie=function(e,t,r){var n=void 0!==r?r:this.cookieExpiryDays,i=(0,c.setCookie)(e,t,n,{domain:this.cookieDomain,path:this.cookiePath,sameSite:this.sameSite,secure:this.secure});return i&&this.debugLog("Set cookie ".concat(e,":"),t),i},e.prototype.deleteCookie=function(e){(0,c.deleteCookie)(e,{domain:this.cookieDomain,path:this.cookiePath})},e.prototype.getUnitId=function(){if(this.unitId)return this.unitId;var e=navigator.cookieEnabled,t=(0,c.isLocalStorageAvailable)(),r=null;return e&&(r=(0,c.getCookie)(this.unitIdCookieName)||(0,c.getCookie)(this.publicIdCookieName)),!r&&t&&(r=localStorage.getItem("abs_id")),r&&(this.unitId=r),r},e.prototype.setUnitId=function(e){this.unitId=e;var t=navigator.cookieEnabled,r=(0,c.isLocalStorageAvailable)();t&&(this.setCookie(this.unitIdCookieName,e),this.setCookie(this.publicIdCookieName,e),this.autoUpdateExpiry&&this.updateExpiryTimestamp()),r&&localStorage.setItem("abs_id",e),this.debugLog("Unit ID set:",e)},e.prototype.generateAndSetUnitId=function(){var e=(0,c.generateUniqueId)();return this.setUnitId(e),e},e.prototype.updateExpiryTimestamp=function(){if(navigator.cookieEnabled){var e=Date.now();this.setCookie(this.expiryCookieName,e.toString()),this.debugLog("Updated expiry timestamp:",e)}},e.prototype.isExpiryFresh=function(){if(!navigator.cookieEnabled)return!1;var e=(0,c.getCookie)(this.expiryCookieName);if(!e)return!1;try{var t=parseInt(e,10),r=(Date.now()-t)/864e5,n=r<=this.expiryCheckInterval;return this.debugLog("Expiry check:",{daysSinceSet:r,isFresh:n}),n}catch(e){return this.debugLog("Error parsing expiry cookie:",e),!1}},e.prototype.getUtmParams=function(){var e,t,r,n,i={},o=new URLSearchParams(window.location.search);try{for(var a=l(this.utmParams),s=a.next();!s.done;s=a.next()){var c=s.value;(h=o.get(c))&&(i[c]=h)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(0===Object.keys(i).length&&document.referrer)try{var u=new URL(document.referrer);try{for(var d=l(this.utmParams),g=d.next();!g.done;g=d.next()){var h;c=g.value,(h=u.searchParams.get(c))&&(i[c]=h)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}catch(e){this.debugLog("Error parsing referrer URL:",e)}if(0===Object.keys(i).length){var p=this.getStoredUtmParams();if(p)return p}return i},e.prototype.storeUtmParams=function(e){if(0!==Object.keys(e).length){var t={params:e,timestamp:Date.now()},r=navigator.cookieEnabled;if((0,c.isLocalStorageAvailable)())try{localStorage.setItem(this.utmCookieName,JSON.stringify(t)),this.debugLog("Stored UTM params in localStorage:",e)}catch(e){this.debugLog("Failed to store UTM params in localStorage:",e)}r&&(this.setCookie(this.utmCookieName,JSON.stringify(t),30),this.debugLog("Stored UTM params in cookie:",e))}},e.prototype.getStoredUtmParams=function(){var e=null,t=(0,c.isLocalStorageAvailable)(),r=navigator.cookieEnabled;if(t)try{e=localStorage.getItem(this.utmCookieName)}catch(e){this.debugLog("Failed to get UTM params from localStorage:",e)}if(!e&&r&&(e=(0,c.getCookie)(this.utmCookieName)),e)try{var n=JSON.parse(e);if(Date.now()-n.timestamp<2592e6)return n.params}catch(e){this.debugLog("Failed to parse stored UTM params:",e)}return null},e.prototype.applyUtmAttributesToContext=function(e){var t,r,n=e||this.context;if(n){var i=this.getUtmParams();Object.keys(i).length>0&&this.storeUtmParams(i);try{for(var a=l(Object.entries(i)),c=a.next();!c.done;c=a.next()){var u=o(c.value,2),d=u[0],g=u[1],h=d.slice(4);n.attribute(h,g),this.debugLog("Set attribute ".concat(h,":"),g)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}}else(0,s.logDebug)("[CookiePlugin] No context available to apply UTM attributes")},e.prototype.clearAllCookies=function(){this.deleteCookie(this.unitIdCookieName),this.deleteCookie(this.publicIdCookieName),this.deleteCookie(this.expiryCookieName),this.deleteCookie(this.utmCookieName),(0,c.isLocalStorageAvailable)()&&(localStorage.removeItem("abs_id"),localStorage.removeItem(this.utmCookieName)),this.unitId=void 0,this.debugLog("All cookies and storage cleared")},e.prototype.ready=function(){return n(this,void 0,void 0,function(){var e;return i(this,function(t){return this.debugLog("Initializing CookiePlugin"),(e=this.getUnitId())?(this.debugLog("Using existing unit ID:",e),this.autoUpdateExpiry&&!this.isExpiryFresh()&&this.updateExpiryTimestamp()):(e=this.generateAndSetUnitId(),this.debugLog("Generated new unit ID:",e)),this.context&&this.applyUtmAttributesToContext(),this.debugLog("CookiePlugin initialized successfully"),[2]})})},e.prototype.initialize=function(){return n(this,void 0,void 0,function(){return i(this,function(e){return[2,this.ready()]})})},e.prototype.setContext=function(e){this.context=e,this.debugLog("Context set for CookiePlugin")},e.prototype.needsServerSideCookie=function(){var e=this.getUnitId(),t=navigator.cookieEnabled,r=(0,c.isLocalStorageAvailable)();if(e){if(t&&!this.isExpiryFresh())return this.debugLog("Existing ID present but expiry not fresh - need worker call"),!0}else if(t||r){var n=(0,c.getCookie)(this.expiryCookieName);return this.debugLog(n?"No existing ID but expiry cookie exists - need worker call":"No existing ID and no expiry cookie - need worker call"),!0}return!1},e.prototype.trackLanding=function(e){var t=e||this.context;if(t){var r=new URLSearchParams(window.location.search),n=this.utmParams.some(function(e){return r.get(e)}),i=document.referrer,o=i&&!i.includes(this.cookieDomain.replace(".","")),a=navigator.cookieEnabled||(0,c.isLocalStorageAvailable)(),l=!!((0,c.getCookie)(this.unitIdCookieName)||(0,c.getCookie)(this.publicIdCookieName)||(0,c.getCookie)(this.expiryCookieName)||(0,c.isLocalStorageAvailable)()&&localStorage.getItem("abs_id"));if(n||o||a&&!l){var u={referrer_url:i||"",landing_url:window.location.href,accepts_cookies:navigator.cookieEnabled,accepts_storage:(0,c.isLocalStorageAvailable)(),has_utm:n};this.debugLog("Tracking landing:",u),t.track("landing",u)}}else(0,s.logDebug)("[CookiePlugin] No context available for tracking landing")},e}();t.CookiePlugin=u},186:function(e,t){"use strict";var r=this&&this.__values||function(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.")},n=this&&this.__read||function(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 i(e,i){var o,a;if(void 0===e&&(e=t.DEFAULT_OVERRIDE_QUERY_PREFIX),"undefined"==typeof window&&!i)return{};var l=i||new URLSearchParams(window.location.search),s={};try{for(var c=r(l.entries()),u=c.next();!u.done;u=c.next()){var d=n(u.value,2),g=d[0],h=d[1];if(g.startsWith(e)){var p=g.substring(e.length);if(p){var f=h.split(","),y=parseInt(f[0],10);isNaN(y)||(1===f.length?s[p]=y:s[p]={variant:y,env:f[1]?parseInt(f[1],10):void 0,id:f[2]?parseInt(f[2],10):void 0})}}}}catch(e){o={error:e}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}return s}function o(e){var t,i;if(!e)return{};var o={},a=e;if(e.includes("|")&&(a=(f=e.split("|"))[f.length-1]),!a)return{};var l=a.split(",");try{for(var s=r(l),c=s.next();!c.done;c=s.next()){var u=c.value,d=n(u.split(":"),2),g=d[0],h=d[1];if(g&&h){var p=decodeURIComponent(g),f=h.split("."),y=parseInt(f[0],10);isNaN(y)||(1===f.length?o[p]=y:o[p]={variant:y,env:f[1]?parseInt(f[1],10):void 0,id:f[2]?parseInt(f[2],10):void 0})}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return o}function a(e,n){var i,a;void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME);var l=null!=n?n:"undefined"!=typeof document?document.cookie:"";if(!l)return{};var s=e+"=",c=l.split(";");try{for(var u=r(c),d=u.next();!d.done;d=u.next()){var g=d.value;if(0===(g=g.trim()).indexOf(s))return o(decodeURIComponent(g.substring(s.length)))}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}return{}}function l(e){var t,i,o=[];try{for(var a=r(Object.entries(e)),l=a.next();!l.done;l=a.next()){var s=n(l.value,2),c=s[0],u=s[1],d=encodeURIComponent(c);if("number"==typeof u)o.push("".concat(d,":").concat(u));else{var g="".concat(d,":").concat(u.variant);void 0!==u.env&&(g+=".".concat(u.env)),void 0!==u.id&&(g+=".".concat(u.id)),o.push(g)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return o.join(",")}function s(e,r){if(void 0===r&&(r={}),"undefined"!=typeof document){var n=r.cookieName||t.DEFAULT_OVERRIDE_COOKIE_NAME,i=r.maxAge||86400,o=l(e);document.cookie="".concat(n,"=").concat(encodeURIComponent(o),";path=/;max-age=").concat(i)}}function c(e){var t,i,o={};try{for(var a=r(Object.entries(e)),l=a.next();!l.done;l=a.next()){var s=n(l.value,2),c=s[0],u=s[1];o[c]="number"==typeof u?u:u.variant}}catch(e){t={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(t)throw t.error}}return o}Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_OVERRIDE_QUERY_PREFIX=t.DEFAULT_OVERRIDE_COOKIE_NAME=void 0,t.getQueryStringOverrides=i,t.parseOverrideCookie=o,t.getCookieOverrides=a,t.serializeOverrides=l,t.persistOverridesToCookie=s,t.getOverrides=function(e,r,n,o){void 0===e&&(e=t.DEFAULT_OVERRIDE_COOKIE_NAME),void 0===r&&(r=t.DEFAULT_OVERRIDE_QUERY_PREFIX);var l=i(r,n);return Object.keys(l).length>0?("undefined"!=typeof document&&s(l,{cookieName:e,maxAge:86400}),c(l)):c(a(e,o))},t.DEFAULT_OVERRIDE_COOKIE_NAME="absmartly_overrides",t.DEFAULT_OVERRIDE_QUERY_PREFIX="exp_"},196:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVitalsPlugin=t.CookiePlugin=t.BrowserCookieAdapter=t.OverridesPlugin=t.OverridesPluginFull=t.DOMChangesPlugin=t.DOMChangesPluginLite=void 0;var o=r(702);Object.defineProperty(t,"DOMChangesPluginLite",{enumerable:!0,get:function(){return o.DOMChangesPluginLite}}),Object.defineProperty(t,"DOMChangesPlugin",{enumerable:!0,get:function(){return o.DOMChangesPluginLite}});var a=r(977);Object.defineProperty(t,"OverridesPluginFull",{enumerable:!0,get:function(){return a.OverridesPluginFull}}),Object.defineProperty(t,"OverridesPlugin",{enumerable:!0,get:function(){return a.OverridesPluginFull}});var l=r(637);Object.defineProperty(t,"BrowserCookieAdapter",{enumerable:!0,get:function(){return l.BrowserCookieAdapter}});var s=r(91);Object.defineProperty(t,"CookiePlugin",{enumerable:!0,get:function(){return s.CookiePlugin}});var c=r(420);Object.defineProperty(t,"WebVitalsPlugin",{enumerable:!0,get:function(){return c.WebVitalsPlugin}}),i(r(574),t),i(r(639),t),t.default=o.DOMChangesPluginLite},214:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)},i=this&&this.__values||function(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.")},o=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.PendingChangeManager=void 0;var a=r(609),l=function(){function e(e,t){void 0===t&&(t=!1),this.applyFn=e,this.pending=new Map,this.observers=new Map,this.appliedSelectors=new Set,this.batchTimer=null,this.batchedWork=new Set,this.debug=t}return e.prototype.addPending=function(e){var t=e.change,r=e.observerRoot,i=r;r&&!document.querySelector(r)&&(this.debug&&(0,a.logDebug)("[ABsmartly] Observer root not found, using document:",r),i=void 0);var o="".concat(t.selector,"-").concat(i||"document");this.debug&&(0,a.logDebug)("[ABsmartly] Adding pending change for selector:",t.selector);var l=this.getObserverRoot(i).querySelector(t.selector);if(l)this.applyChange(l,n(n({},e),{observerRoot:i}));else{var s=this.pending.get(o)||[];s.push(n(n({},e),{observerRoot:i})),this.pending.set(o,s),this.ensureObserver(i)}},e.prototype.removePending=function(e,t,r){var n="".concat(e,"-").concat(r||"document"),i=this.pending.get(n);if(i){var o=i.filter(function(e){return e.experimentName!==t});0===o.length?this.pending.delete(n):this.pending.set(n,o)}this.checkObserverCleanup(r)},e.prototype.removeAllPending=function(e){var t,r;try{for(var n=i(this.pending.entries()),a=n.next();!a.done;a=n.next()){var l=o(a.value,2),s=l[0],c=l[1].filter(function(t){return t.experimentName!==e});0===c.length?this.pending.delete(s):this.pending.set(s,c)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}this.cleanupObservers()},e.prototype.ensureObserver=function(e){var t=this,r=e||"document";if(!this.observers.has(r)){var n=this.getObserverRoot(e),i=new MutationObserver(function(r){t.handleMutations(r,e)});i.observe(n,{childList:!0,subtree:!0}),this.observers.set(r,i),this.debug&&(0,a.logDebug)("[ABsmartly] Started observer for root:",r)}},e.prototype.handleMutations=function(e,t){var r,n,a,l,s,c,u,d,g=this,h=[];try{for(var p=i(e),f=p.next();!f.done;f=p.next()){var y=f.value,v=function(e){var r,n,a,l;if(!(e instanceof Element))return"continue";var s=t||"document";try{for(var c=(r=void 0,i(m.pending.entries())),u=c.next();!u.done;u=c.next()){var d=o(u.value,2),p=d[0],f=d[1];if(p.endsWith("-".concat(s))){var y=function(t){var r,n,o=t.change;if(e.matches(o.selector))return h.push(function(){return g.applyChange(e,t)}),"continue";var a=e.querySelectorAll(o.selector),l=function(e){h.push(function(){return g.applyChange(e,t)})};try{for(var s=(r=void 0,i(a)),c=s.next();!c.done;c=s.next())l(c.value)}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}};try{for(var v=(a=void 0,i(f)),b=v.next();!b.done;b=v.next())y(b.value)}catch(e){a={error:e}}finally{try{b&&!b.done&&(l=v.return)&&l.call(v)}finally{if(a)throw a.error}}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}},m=this;try{for(var b=(a=void 0,i(y.addedNodes)),x=b.next();!x.done;x=b.next())v(x.value)}catch(e){a={error:e}}finally{try{x&&!x.done&&(l=b.return)&&l.call(b)}finally{if(a)throw a.error}}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(r)throw r.error}}if(h.length>0)if("undefined"!=typeof requestAnimationFrame){requestAnimationFrame(function(){g.processBatchedWork()});try{for(var w=i(h),E=w.next();!E.done;E=w.next()){var S=E.value;this.batchedWork.add(S)}}catch(e){s={error:e}}finally{try{E&&!E.done&&(c=w.return)&&c.call(w)}finally{if(s)throw s.error}}}else try{for(var C=i(h),A=C.next();!A.done;A=C.next())(S=A.value)()}catch(e){u={error:e}}finally{try{A&&!A.done&&(d=C.return)&&d.call(C)}finally{if(u)throw u.error}}},e.prototype.processBatchedWork=function(){var e,t,r=Array.from(this.batchedWork);this.batchedWork.clear(),this.batchTimer=null,this.debug&&r.length>0&&(0,a.logDebug)("[ABsmartly] Processing batched work:",r.length,"items");try{for(var n=i(r),o=n.next();!o.done;o=n.next())(0,o.value)()}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.applyChange=function(e,t){var r=t.change,n=t.experimentName,i=t.observerRoot,o="".concat(r.selector,"-").concat(i||"document","-").concat(n);if(!this.appliedSelectors.has(o)&&(this.debug&&(0,a.logDebug)("[ABsmartly] Applying pending change to element:",r.selector),this.applyFn(r,n,e))){this.appliedSelectors.add(o);var l="".concat(r.selector,"-").concat(i||"document"),s=this.pending.get(l);if(s){var c=s.filter(function(e){return e.experimentName!==n||e.change.selector!==r.selector});0===c.length?this.pending.delete(l):this.pending.set(l,c)}this.checkObserverCleanup(i)}},e.prototype.getObserverRoot=function(e){if(!e)return document.documentElement;var t=document.querySelector(e);return t||document.documentElement},e.prototype.checkObserverCleanup=function(e){var t,r,n=e||"document",o=!1;try{for(var l=i(this.pending.keys()),s=l.next();!s.done;s=l.next())if(s.value.endsWith("-".concat(n))){o=!0;break}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}if(!o){var c=this.observers.get(n);c&&(c.disconnect(),this.observers.delete(n),this.debug&&(0,a.logDebug)("[ABsmartly] Disconnected observer for root:",n))}},e.prototype.cleanupObservers=function(){var e,t,r,n,o,l,s=[];try{for(var c=i(this.observers.keys()),u=c.next();!u.done;u=c.next()){var d=u.value,g=!1;try{for(var h=(r=void 0,i(this.pending.keys())),p=h.next();!p.done;p=h.next())if(p.value.endsWith("-".concat(d))){g=!0;break}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}g||s.push(d)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}try{for(var f=i(s),y=f.next();!y.done;y=f.next()){d=y.value;var v=this.observers.get(d);v&&(v.disconnect(),this.observers.delete(d),this.debug&&(0,a.logDebug)("[ABsmartly] Cleaned up observer for root:",d))}}catch(e){o={error:e}}finally{try{y&&!y.done&&(l=f.return)&&l.call(f)}finally{if(o)throw o.error}}},e.prototype.destroy=function(){var e,t;this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null);try{for(var r=i(this.observers.values()),n=r.next();!n.done;n=r.next())n.value.disconnect()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.observers.clear(),this.pending.clear(),this.appliedSelectors.clear(),this.batchedWork.clear(),this.debug&&(0,a.logDebug)("[ABsmartly] PendingChangeManager destroyed")},e.prototype.getPendingCount=function(){var e,t,r=0;try{for(var n=i(this.pending.values()),o=n.next();!o.done;o=n.next())r+=o.value.length}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e.prototype.getAppliedCount=function(){return this.appliedSelectors.size},e.prototype.hasPendingForExperiment=function(e){var t,r;try{for(var n=i(this.pending.values()),o=n.next();!o.done;o=n.next())if(o.value.some(function(t){return t.experimentName===e}))return!0}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return!1},e}();t.PendingChangeManager=l},248:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=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])},n(e,t)},function(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=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},o.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},l=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},s=this&&this.__values||function(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.")},c=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPlugin=void 0;var u=r(44),d=r(609),g=r(186),h=function(e){function t(t){var r,n,i,o,a,l,s,c,u,g,h,p,f,y,v,m,b,x,w,E,S,C=e.call(this,{context:t.context,cookieName:t.cookieName,useQueryString:null!==(r=t.useQueryString)&&void 0!==r?r:"undefined"!=typeof window,queryPrefix:null!==(n=t.queryPrefix)&&void 0!==n?n:"exp_",persistQueryToCookie:null!==(i=t.persistQueryToCookie)&&void 0!==i&&i,debug:null!==(o=t.debug)&&void 0!==o&&o})||this;if(C.onExperimentsAddedCallbacks=[],!t.context)throw new Error("[OverridesPlugin] Context is required");C.isServerSide="undefined"==typeof window;var A,_=t.sdkEndpoint;if(_||((A=t.context)._endpoint?_=A._endpoint:(null===(a=A._config)||void 0===a?void 0:a.endpoint)?_=A._config.endpoint:(null===(l=A._dataProvider)||void 0===l?void 0:l._endpoint)?_=A._dataProvider._endpoint:(null===(s=A._options)||void 0===s?void 0:s.endpoint)&&(_=A._options.endpoint.replace("/v1",""))),!_&&!t.absmartlyEndpoint&&!((A=t.context)._endpoint||(null===(c=A._config)||void 0===c?void 0:c.endpoint)||(null===(u=A._dataProvider)||void 0===u?void 0:u._endpoint)||(null===(g=A._options)||void 0===g?void 0:g.endpoint)))throw new Error("[OverridesPlugin] SDK endpoint must be provided if not available from context");return C.fullConfig={context:t.context,cookieName:t.cookieName,cookieAdapter:t.cookieAdapter,cookieOptions:null!==(h=t.cookieOptions)&&void 0!==h?h:{path:"/"},useQueryString:null!==(p=t.useQueryString)&&void 0!==p?p:!C.isServerSide,queryPrefix:null!==(f=t.queryPrefix)&&void 0!==f?f:"exp_",envParam:null!==(y=t.envParam)&&void 0!==y?y:"env",persistQueryToCookie:null!==(v=t.persistQueryToCookie)&&void 0!==v&&v,url:t.url,absmartlyEndpoint:null!==(m=t.absmartlyEndpoint)&&void 0!==m?m:"",sdkEndpoint:_||"",domChangesFieldName:null!==(b=t.domChangesFieldName)&&void 0!==b?b:"__dom_changes",sdkApiKey:null!==(x=t.sdkApiKey)&&void 0!==x?x:"",application:null!==(w=t.application)&&void 0!==w?w:"",environment:null!==(E=t.environment)&&void 0!==E?E:"",debug:null!==(S=t.debug)&&void 0!==S&&S},C.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Initialized with config:",{isServerSide:C.isServerSide,cookieName:C.fullConfig.cookieName,useQueryString:C.fullConfig.useQueryString,queryPrefix:C.fullConfig.queryPrefix,envParam:C.fullConfig.envParam,persistQueryToCookie:C.fullConfig.persistQueryToCookie,sdkEndpoint:C.fullConfig.sdkEndpoint,absmartlyEndpoint:C.fullConfig.absmartlyEndpoint}),C}return i(t,e),t.prototype.ready=function(){return a(this,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return this.initialized?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Already initialized, skipping re-initialization"),[2]):(this.initialized=!0,this.registerWithContext(),e=this.getOverrides(),0===Object.keys(e.overrides).length?(this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No overrides found"),[2]):[4,this.applyOverridesWithFetching(e.overrides,e.devEnv)]);case 1:return t.sent(),[2]}})})},t.prototype.initialize=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2,this.ready()]})})},t.prototype.getOverrides=function(){var e={overrides:{},devEnv:null};if(this.fullConfig.cookieName){var t=this.getEnhancedCookieOverrides();e.overrides=o({},t.overrides),e.devEnv=t.devEnv}if(this.fullConfig.useQueryString){var r=this.getEnhancedQueryStringOverrides();Object.keys(r.overrides).length>0&&(e.overrides=o(o({},e.overrides),r.overrides),null!==r.devEnv&&(e.devEnv=r.devEnv),this.fullConfig.persistQueryToCookie&&this.fullConfig.cookieName&&this.persistEnhancedOverridesToCookie(e))}return e},t.prototype.getEnhancedQueryStringOverrides=function(){try{var e=void 0;if(this.isServerSide){if(!this.fullConfig.url)return{overrides:{},devEnv:null};var t="string"==typeof this.fullConfig.url?new URL(this.fullConfig.url):this.fullConfig.url;e=new URLSearchParams(t.search)}else e=new URLSearchParams(window.location.search);var r=(0,g.getQueryStringOverrides)(this.fullConfig.queryPrefix,e),n=null;if(this.fullConfig.envParam){var i=e.get(this.fullConfig.envParam);i&&(n=i)}return this.fullConfig.debug&&Object.keys(r).length>0&&(0,d.logDebug)("[OverridesPlugin] Query string overrides:",r,"env:",n),{overrides:r,devEnv:n}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing query string:",e),{overrides:{},devEnv:null}}},t.prototype.getEnhancedCookieOverrides=function(){var e,t;if(!this.fullConfig.cookieName)return{overrides:{},devEnv:null};var r=null;if(this.fullConfig.cookieAdapter)r=this.fullConfig.cookieAdapter.get(this.fullConfig.cookieName);else if("undefined"!=typeof document){var n=this.fullConfig.cookieName+"=",i=document.cookie.split(";");try{for(var o=s(i),a=o.next();!a.done;a=o.next()){var l=a.value;if(0===(l=l.trim()).indexOf(n)){r=decodeURIComponent(l.substring(n.length));break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}this.fullConfig.debug&&r&&(0,d.logDebug)("[OverridesPlugin] Raw cookie value:",r);var c=this.parseEnhancedCookieValue(r);return this.fullConfig.debug&&Object.keys(c.overrides).length>0&&(0,d.logDebug)("[OverridesPlugin] Parsed cookie overrides:",c),c},t.prototype.parseEnhancedCookieValue=function(e){if(!e)return{overrides:{},devEnv:null};try{var t=null,r=e;if(e.startsWith("devEnv=")){var n=e.split("|");t=decodeURIComponent(n[0].substring(7)),r=n[1]||""}return{overrides:r?(0,g.parseOverrideCookie)(r):{},devEnv:t}}catch(e){return(0,d.logDebug)("[OverridesPlugin] Error parsing overrides:",e),{overrides:{},devEnv:null}}},t.prototype.persistEnhancedOverridesToCookie=function(e){var t,r;if(this.fullConfig.cookieName){var n=[];e.devEnv&&n.push("devEnv=".concat(encodeURIComponent(e.devEnv)));var i=[];try{for(var a=s(Object.entries(e.overrides)),l=a.next();!l.done;l=a.next()){var u=c(l.value,2),g=u[0],h=u[1],p=encodeURIComponent(g);if("number"==typeof h)i.push("".concat(p,":").concat(h));else{var f=h,y="".concat(p,":").concat(f.variant);void 0!==f.env&&(y+=".".concat(f.env)),void 0!==f.id&&(y+=".".concat(f.id)),i.push(y)}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}var v=n.length>0?"".concat(n.join("|"),"|").concat(i.join(",")):i.join(",");if(this.fullConfig.cookieAdapter){var m=o({},this.fullConfig.cookieOptions);this.isServerSide&&(void 0===m.httpOnly&&(m.httpOnly=!0),void 0===m.secure&&(m.secure=!0),void 0===m.sameSite&&(m.sameSite="lax")),this.fullConfig.cookieAdapter.set(this.fullConfig.cookieName,v,m)}else if("undefined"!=typeof document){m=this.fullConfig.cookieOptions||{};var b="".concat(this.fullConfig.cookieName,"=").concat(encodeURIComponent(v));m.path&&(b+=";path=".concat(m.path)),m.maxAge&&(b+=";max-age=".concat(m.maxAge));var x=m;if(x.expires){var w=x.expires instanceof Date?x.expires.toUTCString():x.expires;b+=";expires=".concat(w)}m.domain&&(b+=";domain=".concat(m.domain)),m.secure&&(b+=";secure"),m.sameSite&&(b+=";samesite=".concat(m.sameSite)),document.cookie=b}this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Persisted to cookie:",v)}},t.prototype.applyOverridesWithFetching=function(e,t){return a(this,void 0,void 0,function(){var r,n,i,o,a,u,g,h,p,f,y,v,m,b,x,w,E,S;return l(this,function(l){switch(l.label){case 0:(0,d.logDebug)("[OverridesPlugin] Initializing with overrides:",e),(0,d.logDebug)("[OverridesPlugin] Dev environment:",t),r=[],n=new Set;try{for(i=s(Object.entries(e)),o=i.next();!o.done;o=i.next())a=c(o.value,2),u=a[0],m=a[1],1===(g="number"==typeof m?{variant:m}:m).env?((0,d.logDebug)("[OverridesPlugin] ".concat(u," categorized as DEV experiment (env=1)")),r.push([u,g])):2===g.env&&g.id?((0,d.logDebug)("[OverridesPlugin] ".concat(u," categorized as DRAFT experiment (env=2, id=").concat(g.id,")")),n.add(g.id)):(0,d.logDebug)("[OverridesPlugin] ".concat(u," categorized as RUNNING experiment (env=").concat(g.env||0,")"))}catch(e){x={error:e}}finally{try{o&&!o.done&&(w=i.return)&&w.call(i)}finally{if(x)throw x.error}}return(0,d.logDebug)("[OverridesPlugin] Categorization summary:",{total_overrides:Object.keys(e).length,dev_experiments:r.length,draft_experiments:n.size,running_experiments:Object.keys(e).length-r.length-n.size,dev_environment:t}),n.size>0?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(n.size," DRAFT experiments from API")),[4,this.fetchFromAPI(Array.from(n))]):[3,2];case 1:l.sent(),l.label=2;case 2:return h=t||this.fullConfig.environment||null,r.length>0&&h?((0,d.logDebug)("[OverridesPlugin] Will fetch ".concat(r.length," DEV experiments for environment: ").concat(h)),[4,this.fetchFromDevSDK(r,h)]):[3,4];case 3:return l.sent(),[3,5];case 4:r.length>0&&(0,d.logDebug)("[OverridesPlugin] Have ".concat(r.length," DEV experiments but NO devEnv specified - NOT fetching")),l.label=5;case 5:try{for(p=s(Object.entries(e)),f=p.next();!f.done;f=p.next())y=c(f.value,2),v=y[0],m=y[1],b="number"==typeof m?m:m.variant,this.fullConfig.context.override(v,b),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Override: ".concat(v," -> variant ").concat(b))}catch(e){E={error:e}}finally{try{f&&!f.done&&(S=p.return)&&S.call(p)}finally{if(E)throw E.error}}return[2]}})})},t.prototype.fetchFromAPI=function(e){return a(this,void 0,void 0,function(){var t,r,n,i,o,a;return l(this,function(l){switch(l.label){case 0:if(0===e.length)return this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] No experiment IDs to fetch from API"),[2];(t=this.fullConfig.absmartlyEndpoint)||(t=this.fullConfig.sdkEndpoint.replace(".absmartly.io",".absmartly.com")),t.endsWith("/v1")&&(t=t.slice(0,-3)),t.startsWith("http")||(t="https://".concat(t)),r="".concat(t,"/v1/experiments?ids=").concat(e.join(",")),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching non-running experiments from API:",r),l.label=1;case 1:return l.trys.push([1,4,,5]),n={"Content-Type":"application/json"},this.fullConfig.sdkApiKey&&(n.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(r,{method:"GET",credentials:"include",headers:n,mode:"cors"})];case 2:return i=l.sent(),(0,d.logDebug)("[OverridesPlugin] API Response status:",i.status,i.statusText),i.ok?[4,i.json()]:((0,d.logDebug)("[OverridesPlugin] API request failed with status ".concat(i.status)),401===i.status&&(0,d.logDebug)("[OverridesPlugin] Check if you need to log in to the ABsmartly console first"),[2]);case 3:return(o=l.sent()).experiments&&(this.injectExperimentsIntoContext(o.experiments),this.notifyExperimentsAdded()),[3,5];case 4:return a=l.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from API:",a),[3,5];case 5:return[2]}})})},t.prototype.fetchFromDevSDK=function(e,t){return a(this,void 0,void 0,function(){var e,r,n,i,a,s,u;return l(this,function(l){switch(l.label){case 0:(e=this.fullConfig.sdkEndpoint).startsWith("http")||(e="https://".concat(e)),e.endsWith("/v1")&&(e=e.slice(0,-3)),r="".concat(e,"/v1/context?environment=").concat(encodeURIComponent(t)),this.fullConfig.application&&(r+="&application=".concat(encodeURIComponent(this.fullConfig.application))),this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Fetching development experiments from SDK:",r),l.label=1;case 1:return l.trys.push([1,4,,5]),n={},this.fullConfig.sdkApiKey&&(n.Authorization="ApiKey ".concat(this.fullConfig.sdkApiKey)),[4,fetch(r,{method:"GET",headers:n})];case 2:return i=l.sent(),(0,d.logDebug)("[OverridesPlugin] DEV Response status:",i.status,i.statusText),i.ok?[4,i.json()]:((0,d.logDebug)("[OverridesPlugin] DEV SDK request failed with status ".concat(i.status)),[2]);case 3:return(a=l.sent()).experiments&&(s=Object.entries(a.experiments).map(function(e){var t=c(e,2),r=t[0],n=t[1];return o(o({},n),{name:r})}),this.injectExperimentsIntoContext(s),this.notifyExperimentsAdded()),[3,5];case 4:return u=l.sent(),(0,d.logDebug)("[OverridesPlugin] Failed to fetch experiments from dev SDK:",u),[3,5];case 5:return[2]}})})},t.prototype.injectExperimentsIntoContext=function(e){var t,r,n,i,a,l=this.fullConfig.context.data.bind(this.fullConfig.context),u=new Map;try{for(var g=s(e),h=g.next();!h.done;h=g.next()){var p=h.value,f={id:p.id,name:p.name,unitType:(null===(i=p.unit_type)||void 0===i?void 0:i.name)||"user_id",iteration:p.iteration||1,seedHi:0,seedLo:0,split:p.split||[],trafficSeedHi:0,trafficSeedLo:0,trafficSplit:[0,1],fullOnVariant:0,applications:(null===(a=p.applications)||void 0===a?void 0:a.map(function(e){var t;return{name:(null===(t=e.application)||void 0===t?void 0:t.name)||e.name}}))||[],variants:[],audience:p.audience||"",audienceStrict:p.audience_strict||!1};if(p.variants&&Array.isArray(p.variants))for(var y=0;y<p.variants.length;y++){var v=p.variants[y],m={name:v.name||"Variant ".concat(y),config:"string"==typeof v.config?v.config:JSON.stringify(v.config||{})};if(v.variables)m.variables=v.variables;else if(v.config)try{var b="string"==typeof v.config?JSON.parse(v.config):v.config,x=this.fullConfig.domChangesFieldName;b[x]&&(m.variables=((n={})[x]=b[x],n),(0,d.logDebug)("[OverridesPlugin] Variant ".concat(y," has DOM changes field '").concat(x,"'")))}catch(e){(0,d.logDebug)("[OverridesPlugin] Failed to parse variant config:",e)}f.variants[y]=m}u.set(p.name,f)}}catch(e){t={error:e}}finally{try{h&&!h.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}this.fullConfig.context.data=function(){var e,t,r=l();if(!r)return r;var n=r.experiments||[],i=new Set(n.map(function(e){return e.name})),a=function(e,t){if(i.has(e)){var r=n.findIndex(function(t){return t.name===e});r>=0&&(n[r]=t)}else n.push(t)};try{for(var d=s(u),g=d.next();!g.done;g=d.next()){var h=c(g.value,2);a(h[0],h[1])}}catch(t){e={error:t}}finally{try{g&&!g.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}return o(o({},r),{experiments:n})},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Injected ".concat(e.length," experiments into context"))},t.prototype.onExperimentsAdded=function(e){this.onExperimentsAddedCallbacks.push(e)},t.prototype.notifyExperimentsAdded=function(){var e,t;this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Notifying ".concat(this.onExperimentsAddedCallbacks.length," listeners about new experiments"));try{for(var r=s(this.onExperimentsAddedCallbacks),n=r.next();!n.done;n=r.next()){var i=n.value;try{i()}catch(e){(0,d.logDebug)("[OverridesPlugin] Error in experiments added callback:",e)}}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t.prototype.registerWithContext=function(){this.fullConfig.context&&(this.fullConfig.context.__plugins||(this.fullConfig.context.__plugins={}),this.fullConfig.context.__plugins.overridesPlugin={name:"OverridesPlugin",version:"1.0.0",initialized:!0,capabilities:["cookie-overrides","query-overrides","api-fetch","dev-environments"],instance:this,timestamp:Date.now()},this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Registered with context at __plugins.overridesPlugin"))},t.prototype.unregisterFromContext=function(){var e,t;(null===(t=null===(e=this.fullConfig.context)||void 0===e?void 0:e.__plugins)||void 0===t?void 0:t.overridesPlugin)&&(delete this.fullConfig.context.__plugins.overridesPlugin,this.fullConfig.debug&&(0,d.logDebug)("[OverridesPlugin] Unregistered from context"))},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.unregisterFromContext(),this.onExperimentsAddedCallbacks=[]},t}(u.OverridesPluginLite);t.OverridesPlugin=h},253:function(e,t,r){"use strict";var n=this&&this.__values||function(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.")},i=this&&this.__read||function(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},o=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLInjector=void 0;var a=r(609),l=r(973),s=function(){function e(e){void 0===e&&(e=!1),this.injectedIds=new Set,this.debug=e}return e.prototype.parseInjectionKey=function(e){var t,r;try{for(var i=n(["headStart","headEnd","bodyStart","bodyEnd"]),o=i.next();!o.done;o=i.next()){var l=o.value;if(e===l)return{location:l,priority:0};if(e.startsWith(l)){var s=e.substring(l.length),c=parseInt(s,10);if(!isNaN(c))return{location:l,priority:c}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return this.debug&&(0,a.logDebug)("[HTMLInjector] Invalid injection key:",e),null},e.prototype.collectInjections=function(e,t){var r,o,s,c,u,d,g,h;void 0===t&&(t=window.location.href);var p=new Map;try{for(var f=n(e),y=f.next();!y.done;y=f.next()){var v=i(y.value,2),m=v[0],b=v[1];try{for(var x=(s=void 0,n(b)),w=x.next();!w.done;w=x.next()){var E=i(w.value,2),S=E[0],C=E[1];if(C&&"object"==typeof C){if(C.urlFilter&&!l.URLMatcher.matches(C.urlFilter,t)){this.debug&&(0,a.logDebug)("[HTMLInjector] Skipping ".concat(m," variant ").concat(S," - URL filter doesn't match:"),{currentUrl:t,urlFilter:C.urlFilter});continue}var A=C.data;if(A&&"object"==typeof A)try{for(var _=(u=void 0,n(Object.entries(A))),k=_.next();!k.done;k=_.next()){var P=i(k.value,2),O=P[0],D=P[1];if("string"==typeof D){var T=this.parseInjectionKey(O);if(T){var L={code:D,priority:T.priority,location:T.location};p.has(T.location)||p.set(T.location,[]),p.get(T.location).push(L),this.debug&&(0,a.logDebug)("[HTMLInjector] Collected injection:",{experiment:m,variant:S,location:T.location,priority:T.priority,codeLength:D.length})}}else this.debug&&(0,a.logDebug)("[HTMLInjector] Skipping non-string injection code for key ".concat(O,":"),D)}}catch(e){u={error:e}}finally{try{k&&!k.done&&(d=_.return)&&d.call(_)}finally{if(u)throw u.error}}else this.debug&&(0,a.logDebug)("[HTMLInjector] Invalid injection data for ".concat(m," variant ").concat(S,":"),A)}else this.debug&&(0,a.logDebug)("[HTMLInjector] Invalid injection data for ".concat(m," variant ").concat(S,":"),C)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(c=x.return)&&c.call(x)}finally{if(s)throw s.error}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}try{for(var M=n(p),I=M.next();!I.done;I=M.next()){var N=i(I.value,2),j=N[0],R=N[1];R.sort(function(e,t){return t.priority-e.priority}),this.debug&&(0,a.logDebug)("[HTMLInjector] Sorted ".concat(j," injections by priority:"),{location:j,count:R.length,priorities:R.map(function(e){return e.priority})})}}catch(e){g={error:e}}finally{try{I&&!I.done&&(h=M.return)&&h.call(M)}finally{if(g)throw g.error}}return p},e.prototype.inject=function(e){var t,r,l,s;try{for(var c=n(e),u=c.next();!u.done;u=c.next()){var d=i(u.value,2),g=d[0],h=d[1],p="headStart"===g||"bodyStart"===g?o([],i(h),!1).reverse():h;try{for(var f=(l=void 0,n(p)),y=f.next();!y.done;y=f.next()){var v=y.value;this.injectAtLocation(g,v.code)}}catch(e){l={error:e}}finally{try{y&&!y.done&&(s=f.return)&&s.call(f)}finally{if(l)throw l.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}this.debug&&(0,a.logDebug)("[HTMLInjector] All injections complete")},e.prototype.injectAtLocation=function(e,t){var r=this.simpleHash(t),n="absmartly-inject-".concat(e,"-").concat(r);if(!this.injectedIds.has(n))try{switch(e){case"headStart":this.injectHeadStart(t,n);break;case"headEnd":this.injectHeadEnd(t,n);break;case"bodyStart":this.injectBodyStart(t,n);break;case"bodyEnd":this.injectBodyEnd(t,n)}this.injectedIds.add(n),this.debug&&(0,a.logDebug)("[HTMLInjector] Injected at ".concat(e,":"),{location:e,codeLength:t.length,injectionId:n})}catch(t){this.debug&&(0,a.logDebug)("[HTMLInjector] Error injecting at ".concat(e,":"),t)}},e.prototype.injectHeadStart=function(e,t){if(document.head){var r=this.createContainer(e,t);document.head.insertBefore(r,document.head.firstChild)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <head> element not found for headStart injection")},e.prototype.injectHeadEnd=function(e,t){if(document.head){var r=this.createContainer(e,t);document.head.appendChild(r)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <head> element not found for headEnd injection")},e.prototype.injectBodyStart=function(e,t){if(document.body){var r=this.createContainer(e,t);document.body.insertBefore(r,document.body.firstChild)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <body> element not found for bodyStart injection")},e.prototype.injectBodyEnd=function(e,t){if(document.body){var r=this.createContainer(e,t);document.body.appendChild(r)}else this.debug&&(0,a.logDebug)("[HTMLInjector] <body> element not found for bodyEnd injection")},e.prototype.createContainer=function(e,t){var r=document.createElement("div");return r.id=t,r.setAttribute("data-absmartly-injection","true"),r.innerHTML=e,r},e.prototype.simpleHash=function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return Math.abs(t).toString(36)},e.prototype.destroy=function(){var e,t;try{for(var r=n(this.injectedIds),i=r.next();!i.done;i=r.next()){var o=i.value,l=document.getElementById(o);l&&l.remove()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.injectedIds.clear(),this.debug&&(0,a.logDebug)("[HTMLInjector] Destroyed and cleaned up all injections")},e}();t.HTMLInjector=s},319:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCookie=function(e){var t,r="; ".concat(document.cookie).split("; ".concat(e,"="));return 2===r.length&&(null===(t=r.pop())||void 0===t?void 0:t.split(";").shift())||null},t.setCookie=i,t.deleteCookie=function(e,t){void 0===t&&(t={}),i(e,"",-1,t)},t.generateUniqueId=function(){return Date.now().toString(36)+Math.random().toString(36).substring(2)},t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.isLocalStorageAvailable=function(){try{var e="__localStorage_test__";return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}};var n=r(609);function i(e,t,r,i){void 0===i&&(i={});try{var o=new Date;o.setTime(o.getTime()+24*r*60*60*1e3);var a="expires=".concat(o.toUTCString()),l=i.path||"/",s="".concat(e,"=").concat(t,";").concat(a,";path=").concat(l);i.domain&&"localhost"!==i.domain&&(s+=";domain=".concat(i.domain));var c=i.sameSite||"Lax";return s+=";SameSite=".concat(c),i.secure&&(s+=";Secure"),document.cookie=s,!0}catch(t){return(0,n.logDebug)("Unable to set cookie ".concat(e,":"),t),!1}}},356:function(e,t,r){"use strict";var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},i=this&&this.__values||function(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.")},o=this&&this.__read||function(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},a=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.VariantExtractor=void 0;var l=r(609),s=r(973),c=function(){function e(e,t,r){void 0===t&&(t="__dom_changes"),void 0===r&&(r=!1),this.cachedAllChanges=null,this.context=e,this.variableName=t,this.debug=r}return e.prototype.clearCache=function(){this.cachedAllChanges=null},e.prototype.extractAllChanges=function(){var e,t,r,n,s,c,u;if(this.cachedAllChanges)return this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Returning cached changes"),this.cachedAllChanges;var d=new Map;try{var g=this.context.data();if(this.debug&&(0,l.logDebug)("[VariantExtractor DEBUG] Raw context data structure:",{hasData:!!g,contextKeys:g?Object.keys(g):[],experimentCount:(null===(r=null==g?void 0:g.experiments)||void 0===r?void 0:r.length)||0,firstExperiment:(null===(n=null==g?void 0:g.experiments)||void 0===n?void 0:n[0])?{name:g.experiments[0].name,variantCount:(null===(s=g.experiments[0].variants)||void 0===s?void 0:s.length)||0,firstVariantStructure:(null===(c=g.experiments[0].variants)||void 0===c?void 0:c[0])?Object.keys(g.experiments[0].variants[0]):[]}:null,rawContextData:JSON.stringify(g).substring(0,500)+"..."}),this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Extracting changes from context:",{hasData:!!g,experimentCount:(null===(u=null==g?void 0:g.experiments)||void 0===u?void 0:u.length)||0}),null==g?void 0:g.experiments){this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Available experiments:",g.experiments.map(function(e){var t;return{name:e.name,hasVariants:!!e.variants,variantCount:(null===(t=e.variants)||void 0===t?void 0:t.length)||0}}));try{for(var h=i(g.experiments),p=h.next();!p.done;p=h.next()){var f=p.value,y=this.extractAllVariantsForExperiment(f);y.size>0?(d.set(f.name,y),this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Experiment '".concat(f.name,"' has DOM changes:"),{variantsWithChanges:Array.from(y.keys()),changesByVariant:Array.from(y.entries()).map(function(e){var t=o(e,2),r=t[0],n=t[1];return{variant:r,changeCount:n.length,changeTypes:a([],o(new Set(n.map(function(e){return e.type}))),!1)}})})):this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Experiment '".concat(f.name,"' has no DOM changes"))}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}}}catch(e){(0,l.logDebug)("[ABsmartly] Error extracting DOM changes:",e)}return this.cachedAllChanges=d,d},e.prototype.extractAllVariantsForExperiment=function(e){var t,r=new Map;if(this.debug&&(0,l.logDebug)("[DEBUG] Processing experiment: ".concat(e.name," with ").concat((null===(t=e.variants)||void 0===t?void 0:t.length)||0," variants")),!e.variants)return(0,l.logDebug)("[DEBUG] No variants found for experiment: ".concat(e.name)),r;for(var n=0;n<e.variants.length;n++){var i=e.variants[n];if(i){var o=null;if(i.config)try{var a="string"==typeof i.config?JSON.parse(i.config):i.config;(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] Parsed config for variant ").concat(n,":"),a),a&&a[this.variableName]?(o=a[this.variableName],(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✓ Found DOM changes in config[").concat(this.variableName,"]:"),o)):(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✗ No ").concat(this.variableName," field found in parsed config for variant ").concat(n))}catch(t){(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✗ Failed to parse variant.config for variant ").concat(n,":"),t,"Raw config:","string"==typeof i.config?i.config.substring(0,100):"")}else(0,l.logDebug)("[VariantExtractor DEBUG] [".concat(e.name,"] ✗ No config field found for variant ").concat(n));if(o){var s=this.extractChangesFromData(o);s&&s.length>0&&r.set(n,s)}}}return r},e.prototype.extractChangesFromData=function(e){if(!e)return null;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return(0,l.logDebug)("[ABsmartly] Failed to parse DOM changes JSON:",e),null}if(e&&"object"==typeof e&&!Array.isArray(e)&&"changes"in e){var t=e;return this.parseChanges(t.changes)}return this.parseChanges(e)},e.prototype.getExperimentChanges=function(e){var t=this.extractAllChanges().get(e);if(!t||0===t.size)return null;var r=this.context.peek(e);return null==r?(this.debug&&(0,l.logDebug)("[ABsmartly] No variant selected for ".concat(e)),null):t.get(r)||null},e.prototype.parseChanges=function(e){var t,r;if(!e)return null;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return(0,l.logDebug)("[ABsmartly] Failed to parse DOM changes JSON:",e),null}if(!Array.isArray(e))return this.debug&&(0,l.logDebug)("[ABsmartly] DOM changes data is not an array"),null;var n=[];try{for(var o=i(e),a=o.next();!a.done;a=o.next()){var s=a.value;this.isValidChange(s)?n.push(s):this.debug&&(0,l.logDebug)("[ABsmartly] Invalid DOM change:",s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n.length>0?n:null},e.prototype.isValidChange=function(e){if(!e||"object"!=typeof e)return!1;var t=e;if(void 0===t.selector||null===t.selector||!t.type)return!1;if(!["text","html","style","class","attribute","javascript","move","create","delete","styleRules"].includes(t.type))return!1;switch(t.type){case"class":if(!t.add&&!t.remove)return!1;if(t.add&&!Array.isArray(t.add))return!1;if(t.remove&&!Array.isArray(t.remove))return!1;break;case"move":if(!t.targetSelector)return!1;break;case"create":if(!t.element||!t.targetSelector)return!1;break;case"style":case"attribute":if(!t.value||"object"!=typeof t.value)return!1}return!0},e.prototype.getAllVariantChanges=function(e){var t=this.extractAllChanges().get(e);if(!t)return[];for(var r=Math.max.apply(Math,a([],o(t.keys()),!1)),n=[],i=0;i<=r;i++)n.push(t.get(i)||[]);return n},e.prototype.getExperiment=function(e){try{var t=this.context.data();return t&&t.experiments&&t.experiments.find(function(t){return t.name===e})||null}catch(t){return this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Failed to get experiment '".concat(e,"' - context may not be ready:"),t),null}},e.prototype.getAllVariantsData=function(e){var t=new Map;try{var r=this.context.data();if(!(null==r?void 0:r.experiments))return t;var n=r.experiments.find(function(t){return t.name===e});if(!(null==n?void 0:n.variants))return t;for(var i=0;i<n.variants.length;i++){var o=n.variants[i];if(o){var a=null;if(o.variables&&o.variables[this.variableName])a=o.variables[this.variableName];else if(o.config)try{var s="string"==typeof o.config?JSON.parse(o.config):o.config;s&&s[this.variableName]&&(a=s[this.variableName])}catch(e){(0,l.logDebug)("[VariantExtractor] Failed to parse variant.config:",e)}if(a){if("string"==typeof a)try{a=JSON.parse(a)}catch(e){(0,l.logDebug)("[ABsmartly] Failed to parse DOM changes JSON:",e);continue}t.set(i,a)}else t.set(i,null)}}}catch(e){(0,l.logDebug)("[ABsmartly] Error getting all variants data:",e)}return t},e.prototype.anyVariantMatchesURL=function(e,t){var r,n;void 0===t&&(t=window.location.href);var a=this.getAllVariantsData(e),l=!1;try{for(var c=i(a),u=c.next();!u.done;u=c.next()){var d=o(u.value,2)[1];if(d&&"object"==typeof d&&!Array.isArray(d)&&"urlFilter"in d){var g=d;if(g.urlFilter&&(l=!0,s.URLMatcher.matches(g.urlFilter,t)))return!0}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return!l},e.prototype.extractAllInjectHTML=function(){var e,t,r=new Map;try{var n=this.context.data();if(this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Extracting __inject_html from context"),null==n?void 0:n.experiments)try{for(var o=i(n.experiments),a=o.next();!a.done;a=o.next()){var s=a.value,c=this.extractInjectHTMLForExperiment(s);c.size>0&&(r.set(s.name,c),this.debug&&(0,l.logDebug)("[ABsmartly VariantExtractor] Experiment '".concat(s.name,"' has HTML injections:"),{variantsWithInjections:Array.from(c.keys())}))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){(0,l.logDebug)("[ABsmartly] Error extracting __inject_html:",e)}return r},e.prototype.extractInjectHTMLForExperiment=function(e){var t=new Map;if(!e.variants)return t;for(var r=0;r<e.variants.length;r++){var i=e.variants[r];if(i){var o=null;if(i.variables&&i.variables.__inject_html)o=i.variables.__inject_html,this.debug&&(0,l.logDebug)("[VariantExtractor] Found __inject_html in variables for ".concat(e.name," variant ").concat(r));else if(i.config)try{var a="string"==typeof i.config?JSON.parse(i.config):i.config;a&&a.__inject_html&&(o=a.__inject_html,this.debug&&(0,l.logDebug)("[VariantExtractor] Found __inject_html in config for ".concat(e.name," variant ").concat(r)))}catch(t){(0,l.logDebug)("[VariantExtractor] Failed to parse variant.config for ".concat(e.name," variant ").concat(r,":"),t)}if(o&&"object"==typeof o&&!Array.isArray(o)){var s=o,c=s.urlFilter,u=n(s,["urlFilter"]),d={data:u,urlFilter:c||void 0};t.set(r,d),this.debug&&(0,l.logDebug)("[VariantExtractor] Extracted __inject_html for ".concat(e.name," variant ").concat(r,":"),{keys:Object.keys(u),hasUrlFilter:!!c})}else o&&this.debug&&(0,l.logDebug)("[VariantExtractor] Invalid __inject_html format in ".concat(e.name," variant ").concat(r),o)}}return t},e}();t.VariantExtractor=c},420:function(e,t,r){"use strict";var n,i=this&&this.__assign||function(){return i=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},i.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),i=0;i<r.length;i++)"default"!==r[i]&&o(t,e,r[i]);return a(t,e),t}),s=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},c=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},u=this&&this.__read||function(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},d=this&&this.__spreadArray||function(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))},g=this&&this.__values||function(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.")};Object.defineProperty(t,"__esModule",{value:!0}),t.WebVitalsPlugin=void 0;var h=r(609),p=function(){function e(e){void 0===e&&(e={}),this.webVitalsLoaded=!1,this.metricsTracked=!1,this.context=e.context,this.debug=e.debug||!1,this.trackWebVitals=!1!==e.trackWebVitals,this.trackPageMetrics=!1!==e.trackPageMetrics,this.autoTrack=!1!==e.autoTrack,"undefined"!=typeof window&&this.trackWebVitals&&(this.webVitalsPromise=this.loadWebVitalsLibrary(),this.debugLog("Started pre-loading web-vitals library"))}return e.prototype.debugLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.debug&&h.logDebug.apply(void 0,d(["[WebVitalsPlugin]"],u(e),!1))},e.prototype.setContext=function(e){this.context=e,this.debugLog("Context set for WebVitalsPlugin")},e.prototype.loadWebVitalsLibrary=function(){return s(this,void 0,void 0,function(){var e,t;return c(this,function(n){switch(n.label){case 0:if(this.webVitalsLoaded||"undefined"==typeof window)return[2,null];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Promise.resolve().then(function(){return l(r(796))})];case 2:return e=n.sent(),this.webVitalsLoaded=!0,this.debugLog("Web Vitals library loaded from bundle"),[2,e];case 3:throw t=n.sent(),(0,h.logDebug)("[WebVitalsPlugin] Failed to load Web Vitals library:",t),t;case 4:return[2]}})})},e.prototype.trackWebVitalsMetrics=function(e){return s(this,void 0,void 0,function(){var t,r,n,o=this;return c(this,function(a){switch(a.label){case 0:if(!(t=e||this.context))return(0,h.logDebug)("[WebVitalsPlugin] No context available for tracking web vitals"),[2];if(!this.trackWebVitals)return[2];a.label=1;case 1:return a.trys.push([1,6,,7]),r=void 0,this.webVitalsPromise?[4,this.webVitalsPromise]:[3,3];case 2:return r=a.sent(),[3,5];case 3:return[4,this.loadWebVitalsLibrary()];case 4:r=a.sent(),a.label=5;case 5:return r?(r.onCLS(function(e){o.debugLog("CLS:",e),t.track("cls_score",i({},e))}),r.onLCP(function(e){o.debugLog("LCP:",e),t.track("lcp_score",i({},e))}),r.onFCP(function(e){o.debugLog("FCP:",e),t.track("fcp_score",i({},e))}),r.onINP(function(e){o.debugLog("INP:",e),t.track("inp_score",i({},e))}),r.onTTFB(function(e){o.debugLog("TTFB:",e),t.track("ttfb_score",i({},e))}),this.debugLog("Web Vitals tracking initialized"),[3,7]):((0,h.logDebug)("[WebVitalsPlugin] Web Vitals library not available"),[2]);case 6:return n=a.sent(),(0,h.logDebug)("[WebVitalsPlugin] Error tracking web vitals:",n),t.track("vitals_tracking_error",{error:n.message,type:n.name}),[3,7];case 7:return[2]}})})},e.prototype.trackPageMetricsData=function(e){var t=this,r=e||this.context;if(r){if(this.trackPageMetrics&&!this.metricsTracked)try{this.trackImmediateMetrics(r),"complete"===document.readyState?this.trackLoadMetrics(r):window.addEventListener("load",function(){return t.trackLoadMetrics(r)}),this.metricsTracked=!0}catch(e){(0,h.logDebug)("[WebVitalsPlugin] Error tracking page metrics:",e);try{r.track("metrics_tracking_error",{error:e.message,type:e.name})}catch(e){(0,h.logDebug)("[WebVitalsPlugin] Error reporting metrics tracking error:",e)}}}else(0,h.logDebug)("[WebVitalsPlugin] No context available for tracking page metrics")},e.prototype.trackImmediateMetrics=function(e){var t,r,n,i,o=performance.getEntriesByType("navigation")[0];if(o){var a={dns:o.domainLookupEnd-o.domainLookupStart,tcp:o.connectEnd-o.connectStart,ttfb:o.responseStart-o.requestStart,download:o.responseEnd-o.responseStart,total_fetch:o.responseEnd-o.requestStart};try{for(var l=g(Object.entries(a)),s=l.next();!s.done;s=l.next()){var c=u(s.value,2),d=c[0],h=c[1];e.track("page_timing_".concat(d),{value:h,unit:"ms"}),this.debugLog("Page timing ".concat(d,":"),h)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}var p={total_size:o.transferSize,header_size:o.transferSize-o.encodedBodySize,html_size:o.decodedBodySize,compressed_html_size:o.encodedBodySize};try{for(var f=g(Object.entries(p)),y=f.next();!y.done;y=f.next()){var v=u(y.value,2);d=v[0],h=v[1],e.track("page_".concat(d),{value:h,unit:"bytes"}),this.debugLog("Page ".concat(d,":"),h)}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}if(o.encodedBodySize>0){var m=o.decodedBodySize/o.encodedBodySize;e.track("page_compression_ratio",{value:m}),this.debugLog("Compression ratio:",m)}}else this.debugLog("Navigation timing not available")},e.prototype.trackLoadMetrics=function(e){var t,r,n=performance.getEntriesByType("navigation")[0];if(n){var i=n.domComplete-n.responseEnd;e.track("page_timing_dom_processing",{value:i,metric:"DOM Processing",unit:"ms",rating:i<=500?"good":i<=1e3?"needs-improvement":"poor"}),this.debugLog("DOM processing:",i);var o=n.loadEventEnd-n.fetchStart;e.track("page_timing_total_load",{value:o,metric:"Total Load",unit:"ms",rating:o<=2e3?"good":o<=4e3?"needs-improvement":"poor"}),this.debugLog("Total load:",o);var a={elements:document.getElementsByTagName("*").length,imageCount:document.getElementsByTagName("img").length,scriptCount:document.getElementsByTagName("script").length,styleCount:document.getElementsByTagName("style").length,linkCount:document.getElementsByTagName("link").length};try{for(var l=g(Object.entries(a)),s=l.next();!s.done;s=l.next()){var c=u(s.value,2),d=c[0],h=c[1];e.track("dom_".concat(d),{value:h,metric:d,unit:"count",rating:h<=1e3?"good":h<=2e3?"needs-improvement":"poor"}),this.debugLog("DOM ".concat(d,":"),h)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}}},e.prototype.start=function(){return s(this,void 0,void 0,function(){return c(this,function(e){return this.debugLog("Starting WebVitalsPlugin"),this.context?(this.autoTrack&&(this.trackWebVitals&&this.trackWebVitalsMetrics(),this.trackPageMetrics&&this.trackPageMetricsData()),this.debugLog("WebVitalsPlugin started successfully"),[2]):(this.debugLog("No context available during start"),[2])})})},e.prototype.ready=function(){return s(this,void 0,void 0,function(){return c(this,function(e){return[2,this.start()]})})},e.prototype.initialize=function(){return s(this,void 0,void 0,function(){return c(this,function(e){return[2,this.start()]})})},e.prototype.reset=function(){this.metricsTracked=!1,this.debugLog("WebVitalsPlugin reset")},e}();t.WebVitalsPlugin=p},481:function(e,t,r){"use strict";var n=this&&this.__values||function(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.")},i=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMPersistenceManager=void 0;var o=r(609),a=function(){function e(e){this.watchedElements=new WeakMap,this.persistenceObserver=null,this.reapplyingElements=new Set,this.reapplyLogThrottle=new Map,this.appliedChanges=new Map,this.config=e}return e.prototype.watchElement=function(e,t,r){var i,a,l=this.watchedElements.get(e);l||(l=new Set,this.watchedElements.set(e,l)),l.add(t),this.appliedChanges.has(t)||this.appliedChanges.set(t,[]);var s=this.appliedChanges.get(t);if(!s.includes(r)&&(s.push(r),this.config.debug)){var c={};if(r.value&&"object"==typeof r.value)try{for(var u=n(Object.keys(r.value)),d=u.next();!d.done;d=u.next()){var g=d.value.replace(/([A-Z])/g,"-$1").toLowerCase();c[g]=e.style.getPropertyValue(g)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}(0,o.logDebug)("[WATCH-ELEMENT] Started watching element for persistence",{experimentName:t,selector:r.selector,element:e.tagName,changeType:r.type,value:r.value,currentStyles:"style"===r.type?c:void 0,timestamp:Date.now()})}this.persistenceObserver||this.setupPersistenceObserver()},e.prototype.unwatchElement=function(e,t){var r=this.watchedElements.get(e);r&&(r.delete(t),0===r.size&&this.watchedElements.delete(e))},e.prototype.unwatchExperiment=function(e){this.appliedChanges.delete(e)},e.prototype.getAppliedChanges=function(){return this.appliedChanges},e.prototype.clearAll=function(){this.appliedChanges.clear()},e.prototype.destroy=function(){this.persistenceObserver&&(this.persistenceObserver.disconnect(),this.persistenceObserver=null),this.appliedChanges.clear(),this.reapplyingElements.clear(),this.reapplyLogThrottle.clear()},e.prototype.setupPersistenceObserver=function(){var e=this;this.persistenceObserver||(this.config.debug&&(0,o.logDebug)("[PERSISTENCE-OBSERVER] Setting up persistence observer",{timestamp:Date.now()}),this.persistenceObserver=new MutationObserver(function(t){var r,a;e.config.debug&&(0,o.logDebug)("[MUTATION-DETECTED] Persistence observer detected mutations",{mutationCount:t.length,timestamp:Date.now()});var l=function(t){var r,a,l,s,c,u,d,g,h=t.target;if(e.reapplyingElements.has(h))return e.config.debug&&(0,o.logDebug)("[MUTATION-SKIP] Skipping mutation - currently reapplying",{element:h.tagName}),"continue";var p=e.watchedElements.get(h);if(p){if(e.config.debug){var f="mutation:".concat(h.tagName,":").concat(h.getAttribute("name")||h.className);(P=Date.now())-(O=e.reapplyLogThrottle.get(f)||0)>5e3&&((0,o.logDebug)("[MUTATION-ON-WATCHED] Mutation detected on watched element",{element:h.tagName,attributeName:t.attributeName,oldValue:t.oldValue,experiments:Array.from(p)}),e.reapplyLogThrottle.set(f,P))}try{for(var y=(r=void 0,n(p)),v=y.next();!v.done;v=y.next()){var m=v.value,b=e.appliedChanges.get(m);if(b)try{for(var x=(l=void 0,n(b)),w=x.next();!w.done;w=x.next()){var E=w.value,S=!1;if("style"===E.type&&"style"===t.attributeName&&!1!==E.persistStyle)S=e.checkStyleOverwritten(h,E.value);else if("attribute"===E.type&&!1!==E.persistAttribute){if(E.value&&"object"==typeof E.value)try{for(var C=(c=void 0,n(Object.keys(E.value))),A=C.next();!A.done;A=C.next()){var _=A.value;if(t.attributeName===_){S=e.checkAttributeOverwritten(h,E.value);break}}}catch(e){c={error:e}}finally{try{A&&!A.done&&(u=C.return)&&u.call(C)}finally{if(c)throw c.error}}}else"javascript"===E.type&&!0===E.persistScript&&E.value&&"string"==typeof E.value&&(S="style"===t.attributeName||"class"===t.attributeName);if(S){e.reapplyingElements.add(h);var k="".concat(m,"-").concat(E.selector),P=Date.now(),O=e.reapplyLogThrottle.get(k)||0;if(e.config.debug&&P-O>5e3&&((0,o.logDebug)("[REAPPLY-TRIGGERED] Reapplying after mutation (React/framework conflict detected)",{experimentName:m,selector:E.selector,element:h.tagName,changeType:E.type,timestamp:P}),e.reapplyLogThrottle.set(k,P),e.reapplyLogThrottle.size>100)){var D=P-6e4;try{for(var T=(d=void 0,n(e.reapplyLogThrottle.entries())),L=T.next();!L.done;L=T.next()){var M=i(L.value,2),I=M[0];M[1]<D&&e.reapplyLogThrottle.delete(I)}}catch(e){d={error:e}}finally{try{L&&!L.done&&(g=T.return)&&g.call(T)}finally{if(d)throw d.error}}}try{e.config.onReapply(E,m)}catch(t){e.config.debug&&(0,o.logDebug)("[REAPPLY-ERROR] Error during change re-application",{experimentName:m,selector:E.selector,changeType:E.type,error:t instanceof Error?t.message:String(t)})}finally{setTimeout(function(){e.reapplyingElements.delete(h)},0)}}}}catch(e){l={error:e}}finally{try{w&&!w.done&&(s=x.return)&&s.call(x)}finally{if(l)throw l.error}}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(a=y.return)&&a.call(y)}finally{if(r)throw r.error}}}};try{for(var s=n(t),c=s.next();!c.done;c=s.next())l(c.value)}catch(e){r={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}}),this.persistenceObserver.observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0}),this.config.debug&&(0,o.logDebug)("[PERSISTENCE-OBSERVER] Setup complete - now observing mutations",{target:"document.body",observedAttributes:"all (filtered in handler to style/class)",subtree:!0,timestamp:Date.now()}))},e.prototype.checkStyleOverwritten=function(e,t){var r,o;try{for(var a=n(Object.entries(t)),l=a.next();!l.done;l=a.next()){var s=i(l.value,2),c=s[0],u=s[1],d=c.replace(/([A-Z])/g,"-$1").toLowerCase(),g=e.style.getPropertyValue(d),h=e.style.getPropertyPriority(d);if(g!==u||u.includes("!important")&&!h)return!0}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.checkAttributeOverwritten=function(e,t){var r,o;try{for(var a=n(Object.entries(t)),l=a.next();!l.done;l=a.next()){var s=i(l.value,2),c=s[0],u=s[1];if(e.getAttribute(c)!==u)return!0}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return!1},e}();t.DOMPersistenceManager=a},574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},609:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)},i=this&&this.__read||function(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},o=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.DEBUG=void 0,t.logDebug=l,t.logChangeApplication=function(e,r,n,i,o){t.DEBUG&&l("".concat(o?"✓":"✗"," Applied ").concat(n," change to ").concat(i," element(s)"),{experimentName:e,selector:r,changeType:n,elementsCount:i,success:o})},t.logChangeRemoval=function(e,r,n,i){t.DEBUG&&l("Restored ".concat(i," element(s) to original state"),{experimentName:e,selector:r,changeType:n,elementsCount:i,action:"restore"})},t.logExperimentSummary=function(e,r,n,i){t.DEBUG&&l('Experiment "'.concat(e,'" summary'),{experimentName:e,totalChanges:r,successfulChanges:n,pendingChanges:i,successRate:r>0?"".concat(Math.round(n/r*100),"%"):"N/A"})},t.logStateOperation=function(e,r,n,i){t.DEBUG&&l("State ".concat(e," operation"),{operation:e,selector:r,changeType:n,experimentName:i})},t.logVisibilityEvent=function(e,r,n){t.DEBUG&&l(n?"Element became visible - experiment triggered":"Element visibility changed",{experimentName:e,selector:r.className||r.id||r.tagName,triggered:n,action:"visibility"})},t.logMessage=function(e,r,n){t.DEBUG&&l("Message ".concat(e,": ").concat(r),{direction:e,messageType:r,payload:n,bridge:"extension"})},t.logPerformance=function(e,r,i){t.DEBUG&&l("Performance: ".concat(e," took ").concat(r,"ms"),n({operation:e,duration:r,performance:!0},i))},t.logProductionWarn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];console.warn.apply(console,o([e],i(t),!1))};var a=r(834);function l(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(t.DEBUG)if(2===e.length&&"string"==typeof e[0]&&"object"==typeof e[1]){var n=i(e,2),a=n[0],l=n[1];if(a.includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Performance:")&&(null==l?void 0:l.duration)&&l.duration<5)return;if(a.includes("Message sent:")||a.includes("Message received:"))return;var s=(new Date).toISOString(),c="[ABsmartly Debug]";console.log("".concat(c," [").concat(s,"] ").concat(a),l)}else if(1===e.length&&"string"==typeof e[0]){if((a=e[0]).includes("Original state already stored"))return;if(a.includes("State store operation"))return;if(a.includes("Message sent:")||a.includes("Message received:"))return;s=(new Date).toISOString(),c="[ABsmartly Debug]",console.log("".concat(c," [").concat(s,"] ").concat(a))}else console.log.apply(console,o([],i(e),!1))}t.DEBUG=a.BUILD_DEBUG},637:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserCookieAdapter=void 0;var i=r(319),o=function(){function e(){}return e.prototype.get=function(e){var t=(0,i.getCookie)(e);return t?decodeURIComponent(t):null},e.prototype.set=function(e,t,r){var n="".concat(e,"=").concat(encodeURIComponent(t));r&&(r.path&&(n+="; path=".concat(r.path)),r.domain&&(n+="; domain=".concat(r.domain)),void 0!==r.maxAge&&(n+="; max-age=".concat(r.maxAge)),r.secure&&(n+="; secure"),r.sameSite&&(n+="; samesite=".concat(r.sameSite))),document.cookie=n},e.prototype.delete=function(e,t){this.set(e,"",n(n({},t),{maxAge:0}))},e}();t.BrowserCookieAdapter=o},639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StyleSheetManager=void 0;var n=r(609),i=function(){function e(e,t){void 0===t&&(t=!1),this.id=e,this.styleEl=null,this.rules=new Map,this.debug=t}return e.prototype.ensure=function(){if(!(this.styleEl&&document.head.contains(this.styleEl)||(this.styleEl=document.getElementById(this.id),this.styleEl))){var e=document.createElement("style");e.id=this.id,e.setAttribute("data-absmartly-styles","true"),document.head.appendChild(e),this.styleEl=e,this.debug&&(0,n.logDebug)("[ABsmartly] Created stylesheet: ".concat(this.id))}return this.styleEl},e.prototype.setRule=function(e,t){this.rules.set(e,t),this.render(),this.debug&&(0,n.logDebug)("[ABsmartly] Set CSS rule for ".concat(e))},e.prototype.deleteRule=function(e){this.rules.delete(e)&&(this.render(),this.debug&&(0,n.logDebug)("[ABsmartly] Deleted CSS rule for ".concat(e)))},e.prototype.hasRule=function(e){return this.rules.has(e)},e.prototype.clear=function(){var e=this.rules.size>0;this.rules.clear(),e&&(this.render(),this.debug&&(0,n.logDebug)("[ABsmartly] Cleared all CSS rules from ".concat(this.id)))},e.prototype.destroy=function(){this.clear(),this.styleEl&&document.head.contains(this.styleEl)&&(this.styleEl.remove(),this.styleEl=null,this.debug&&(0,n.logDebug)("[ABsmartly] Destroyed stylesheet: ".concat(this.id)))},e.prototype.render=function(){var e=this.ensure(),t=Array.from(this.rules.values()).join("\n\n");e.textContent=t},e.prototype.getRulesCount=function(){return this.rules.size},e.prototype.getCssText=function(){return Array.from(this.rules.values()).join("\n\n")},e}();t.StyleSheetManager=i},702:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=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},n.apply(this,arguments)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},a=this&&this.__values||function(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.")},l=this&&this.__read||function(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};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMChangesPluginLite=void 0;var s=r(964),c=r(356),u=r(693),d=r(713),g=r(253),h=r(609),p=r(973),f=r(481),y=r(943),v=r(834),m=function(){function e(t){var r,n,i,o,a,l,u,p,y=this;if(this.mutationObserver=null,this.exposedExperiments=new Set,this.eventListeners=new Map,this.styleManagers=new Map,this.initialized=!1,this.persistenceManager=null,this.antiFlickerTimeout=null,this.antiFlickerStyleId="absmartly-antiflicker",this.originalPushState=null,this.originalReplaceState=null,this.popstateHandler=null,this.config={context:t.context,autoApply:null===(r=t.autoApply)||void 0===r||r,spa:null===(n=t.spa)||void 0===n||n,visibilityTracking:null===(i=t.visibilityTracking)||void 0===i||i,variableName:null!==(o=t.variableName)&&void 0!==o?o:"__dom_changes",debug:null!==(a=t.debug)&&void 0!==a&&a,hideUntilReady:null!==(l=t.hideUntilReady)&&void 0!==l&&l,hideTimeout:null!==(u=t.hideTimeout)&&void 0!==u?u:3e3,hideTransition:null!==(p=t.hideTransition)&&void 0!==p&&p},!this.config.context)throw new Error("[ABsmartly] Context is required");console.log("[ABsmartly] DOMChangesPluginLite v".concat(e.VERSION," initialized")),this.registerWithContext(!1),this.registerGlobally(!1),this.config.hideUntilReady&&this.hideContent(),this.domManipulator=new s.DOMManipulatorLite(this.config.debug,this),this.variantExtractor=new c.VariantExtractor(this.config.context,this.config.variableName,this.config.debug),this.exposureTracker=new d.ExposureTracker(this.config.context,this.config.debug),this.htmlInjector=new g.HTMLInjector(this.config.debug),this.persistenceManager=new f.DOMPersistenceManager({debug:this.config.debug,onReapply:function(e,t){(0,h.logDebug)("[DOMChangesPluginLite] Re-applying change due to mutation",{experimentName:t,selector:e.selector,type:e.type}),y.domManipulator.applyChange(e,t)}}),this.readyPromise=this.config.context.ready().then(function(){return(0,h.logDebug)("[DOMChangesPluginLite] Context is ready, starting initialization"),y.initialize()}).catch(function(e){throw(0,h.logDebug)("[DOMChangesPluginLite] ERROR during initialization:",e),e})}return e.prototype.ready=function(){return i(this,void 0,void 0,function(){return o(this,function(e){return[2,this.readyPromise]})})},e.prototype.initialize=function(){return i(this,void 0,void 0,function(){var t,r,n;return o(this,function(i){switch(i.label){case 0:if(this.initialized)return(0,h.logDebug)("Plugin already initialized"),[2];t=performance.now(),(0,h.logDebug)("Initializing ABsmartly DOM Changes Plugin Lite",{version:e.VERSION,config:{autoApply:this.config.autoApply,spa:this.config.spa,visibilityTracking:this.config.visibilityTracking,DEBUG:h.DEBUG}}),i.label=1;case 1:return i.trys.push([1,4,,5]),this.config.spa?(this.setupMutationObserver(),this.setupURLChangeListener()):(0,h.logDebug)("[DOMChangesPluginLite] SPA mode disabled - skipping body observer"),this.config.autoApply?[4,this.applyInjectionsAndChanges()]:[3,3];case 2:i.sent(),i.label=3;case 3:return this.initialized=!0,this.registerWithContext(),this.registerGlobally(),this.emit("initialized"),r=performance.now()-t,(0,h.logPerformance)("Plugin initialization",r),(0,h.logDebug)("[ABsmartly] DOM plugin lite loaded successfully (v".concat(e.VERSION,")")),this.config.debug&&(0,h.logDebug)("[ABsmartly] DOM Changes Plugin Lite initialized with debug mode"),[3,5];case 4:throw n=i.sent(),(0,h.logDebug)("[ABsmartly] Failed to initialize plugin:",n),this.emit("error",{type:"initialization_error",error:(null==n?void 0:n.message)||String(n)}),n;case 5:return[2]}})})},e.prototype.setupMutationObserver=function(){var e=this,t=new MutationObserver(function(t){var r,n,i,o,s,c,u,d,g,p,f;try{for(var y=a(t),v=y.next();!v.done;v=y.next()){var m=v.value;if("childList"===m.type)try{for(var b=(i=void 0,a(m.addedNodes)),x=b.next();!x.done;x=b.next()){var w=x.value;if(w.nodeType===Node.ELEMENT_NODE){var E=w,S=(null===(f=e.persistenceManager)||void 0===f?void 0:f.getAppliedChanges())||new Map;try{for(var C=(s=void 0,a(S)),A=C.next();!A.done;A=C.next()){var _=l(A.value,2),k=_[0],P=_[1];try{for(var O=(u=void 0,a(P)),D=O.next();!D.done;D=O.next()){var T=D.value;try{var L=E.matches(T.selector)?[E]:Array.from(E.querySelectorAll(T.selector));try{for(var M=(g=void 0,a(L)),I=M.next();!I.done;I=M.next()){var N=I.value;e.config.debug&&(0,h.logDebug)("[SPA-REAPPLY] Re-applying change to newly added element (React hydration recovery)",{experimentName:k,selector:T.selector,element:N.tagName,changeType:T.type}),e.domManipulator.applyChange(T,k)}}catch(e){g={error:e}}finally{try{I&&!I.done&&(p=M.return)&&p.call(M)}finally{if(g)throw g.error}}}catch(e){}}}catch(e){u={error:e}}finally{try{D&&!D.done&&(d=O.return)&&d.call(O)}finally{if(u)throw u.error}}}}catch(e){s={error:e}}finally{try{A&&!A.done&&(c=C.return)&&c.call(C)}finally{if(s)throw s.error}}}}}catch(e){i={error:e}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}}),r=function(){t.observe(document.body,{childList:!0,subtree:!0}),e.mutationObserver=t,(0,h.logDebug)("[DOMChangesPluginLite] MutationObserver started on document.body")};document.body?r():(new MutationObserver(function(e,t){document.body&&(t.disconnect(),r())}).observe(document.documentElement,{childList:!0}),(0,h.logDebug)("[DOMChangesPluginLite] Waiting for document.body..."))},e.prototype.setupURLChangeListener=function(){var e=this,t=function(){return i(e,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return e=window.location.href,(0,h.logDebug)("[ABsmartly] URL changed, re-evaluating experiments:",e),[4,this.removeAllChanges()];case 1:return t.sent(),[4,this.applyInjectionsAndChanges()];case 2:return t.sent(),[2]}})})};this.popstateHandler=t,window.addEventListener("popstate",this.popstateHandler),this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState;var r=this;history.pushState=function(e,n,i){r.originalPushState&&r.originalPushState.call(history,e,n,i),t()},history.replaceState=function(e,n,i){r.originalReplaceState&&r.originalReplaceState.call(history,e,n,i),t()},this.config.debug&&(0,h.logDebug)("[ABsmartly] URL change listener set up for SPA mode")},e.prototype.removeAllChanges=function(){return i(this,void 0,void 0,function(){return o(this,function(e){return this.exposedExperiments.clear(),this.styleManagers.clear(),this.persistenceManager&&this.persistenceManager.clearAll(),this.htmlInjector.destroy(),this.variantExtractor.clearCache(),this.config.debug&&(0,h.logDebug)("[ABsmartly] All change tracking cleared for URL change"),[2]})})},e.prototype.applyInjectionsAndChanges=function(){return i(this,void 0,void 0,function(){var e,t,r,n,i;return o(this,function(o){switch(o.label){case 0:e=performance.now(),t=window.location.href,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.config.context.ready()];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),(0,h.logDebug)("[ABsmartly] Failed to wait for context ready:",r),[2];case 4:return n=this.variantExtractor.extractAllInjectHTML(),[4,Promise.all([this.applyHTMLInjections(n,t),this.applyChanges()])];case 5:return o.sent(),i=performance.now()-e,(0,h.logPerformance)("Apply injections and changes (parallel)",i),this.config.debug&&(0,h.logDebug)("[ABsmartly] HTML injections and DOM changes applied in parallel",{duration:"".concat(i.toFixed(2),"ms"),currentURL:t}),[2]}})})},e.prototype.applyHTMLInjections=function(e){return i(this,arguments,void 0,function(e,t){var r;return void 0===t&&(t=window.location.href),o(this,function(n){return 0===e.size?(this.config.debug&&(0,h.logDebug)("[ABsmartly] No HTML injections found"),[2]):(r=this.htmlInjector.collectInjections(e,t),this.htmlInjector.inject(r),this.config.debug&&(0,h.logDebug)("[ABsmartly] HTML injections complete",{experimentsWithInjections:e.size,totalLocations:r.size,currentUrl:t}),[2])})})},e.prototype.applyChanges=function(e){return i(this,void 0,void 0,function(){var t,r,n,i,s,c,u,d,g,f,y,v,m,b,x,w,E,S,C,A,_,k,P,O,D,T,L,M,I,N,j,R,B,U,V,F,z,G,W,H,q,Q,J,Y,K,X,$,Z,ee,te,re,ne,ie,oe,ae;return o(this,function(o){switch(o.label){case 0:t=performance.now(),r=window.location.href,(0,h.logDebug)("Starting to apply changes",{specificExperiment:e||"all",url:r,action:"apply_start"}),this.config.debug&&((0,h.logDebug)("[ABsmartly] === DOM Changes Application Starting ==="),(0,h.logDebug)("[ABsmartly] Target:",e||"all experiments"),(0,h.logDebug)("[ABsmartly] Current URL:",r),(0,h.logDebug)("[ABsmartly] Context ready:",!0)),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.config.context.ready()];case 2:return o.sent(),[3,4];case 3:return n=o.sent(),(0,h.logDebug)("[ABsmartly] Failed to wait for context ready:",n),[2];case 4:this.variantExtractor.clearCache(),i=this.getAllExperimentsData(),s=0,c=new Map,(0,h.logDebug)("[APPLY-CHANGES] Experiments found with DOM changes:",{experimentNames:Array.from(i.keys()),totalCount:i.size,currentURL:r}),0===i.size&&(0,h.logDebug)("[APPLY-CHANGES] ⚠️ No experiments found with DOM changes - nothing to process");try{for(u=a(i),d=u.next();!d.done;d=u.next())if(g=l(d.value,2),f=g[0],y=g[1],(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] Starting to process experiment"),{experimentName:f,currentURL:r}),e&&f!==e)(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ⏭️ Skipping - filtering for different experiment"),{filteringFor:e});else if(null!=(v=this.config.context.peek(f)))if((0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] User assigned to variant ").concat(v)),m=y.variantData,b=y.urlFilter,x=y.globalDefaults,this.variantExtractor.anyVariantMatchesURL(f,r))if((0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ✓ At least one variant matches current URL")),w=this.shouldApplyVisualChanges(m,b,r),E=this.extractChangesFromData(m,x),S=this.extractAllVariantChanges(f),C=S.some(function(e){return e&&e.length>0}),C){if(A={total:(null==E?void 0:E.length)||0,success:0,pending:0},this.config.debug&&(0,h.logDebug)("[ABsmartly] Processing experiment '".concat(f,"' - User is in variant ").concat(v,":"),{experimentName:f,userVariant:v,urlMatches:w,changeCount:(null==E?void 0:E.length)||0,userVariantHasChanges:((null==E?void 0:E.length)||0)>0,changes:(null==E?void 0:E.map(function(e){return{type:e.type,selector:e.selector,trigger:e.trigger_on_view?"viewport":"immediate"}}))||[]}),E&&0!==E.length||this.config.debug&&(0,h.logDebug)("[ABsmartly] User is in control variant ".concat(v," with no changes, but will still track for SRM prevention"),{experimentName:f,currentVariant:v}),w&&E&&E.length>0)try{for(Z=void 0,_=a(E),k=_.next();!k.done;k=_.next())if("delete"===(Y=k.value).type&&Y.trigger_on_view)this.config.debug&&(0,h.logDebug)("[ABsmartly] Deferring delete change until after viewport trigger for '".concat(f,"'"),{selector:Y.selector});else if(this.domManipulator.applyChange(Y,f))s++,A.success++;else if("create"!==Y.type&&"styleRules"!==Y.type)try{0===document.querySelectorAll(Y.selector).length&&(this.config.spa||Y.waitForElement)&&A.pending++}catch(e){this.config.debug&&(0,h.logDebug)("[ABsmartly] Invalid selector: ".concat(Y.selector),e)}}catch(e){Z={error:e}}finally{try{k&&!k.done&&(ee=_.return)&&ee.call(_)}finally{if(Z)throw Z.error}}else E&&E.length>0&&(0,h.logDebug)("[ABsmartly] Experiment '".concat(f,"' variant ").concat(v," doesn't match URL filter or has no changes, but setting up tracking for SRM prevention"));if(P=!1,O=!1,D=this.variantExtractor.getAllVariantsData(f),this.config.debug){(0,h.logDebug)("[ABsmartly] Checking trigger types for experiment '".concat(f,"' on URL: ").concat(r),{allVariantsDataSize:D.size,allVariantChangesLength:S.length});try{for(te=void 0,T=a(D),L=T.next();!L.done;L=T.next())M=l(L.value,2),I=M[0],N=M[1],(0,h.logDebug)("[ABsmartly] Variant ".concat(I," data structure:"),{isArray:Array.isArray(N),isObject:"object"==typeof N,hasUrlFilter:N&&"object"==typeof N&&!Array.isArray(N)&&"urlFilter"in N,keys:N&&"object"==typeof N&&!Array.isArray(N)?Object.keys(N):"N/A"})}catch(e){te={error:e}}finally{try{L&&!L.done&&(re=T.return)&&re.call(T)}finally{if(te)throw te.error}}}try{for(ne=void 0,j=a(D),R=j.next();!R.done;R=j.next())if(B=l(R.value,2),U=B[0],V=B[1],(F=S[U])&&0!==F.length){if(z=!0,V&&"object"==typeof V&&!Array.isArray(V)&&"urlFilter"in(G=V)&&G.urlFilter&&(W=G,z=p.URLMatcher.matches(W.urlFilter,r),this.config.debug&&(0,h.logDebug)("[ABsmartly] Variant ".concat(U," has URL filter, matches: ").concat(z))),z){H=!1,q=!1;try{for(oe=void 0,Q=a(F),J=Q.next();!J.done;J=Q.next())(Y=J.value).trigger_on_view?H=!0:this.hasImmediateDomAnchor(Y)&&(q=!0)}catch(e){oe={error:e}}finally{try{J&&!J.done&&(ae=Q.return)&&ae.call(Q)}finally{if(oe)throw oe.error}}H&&(P=!0),q&&(O=!0),this.config.debug&&(0,h.logDebug)("[ABsmartly] Variant ".concat(U," matches URL - hasImmediate: ").concat(q,", hasViewport: ").concat(H),{experimentName:f,variantIndex:U,hasImmediateDomAnchor:q})}else this.config.debug&&(0,h.logDebug)("[ABsmartly] Variant ".concat(U," does NOT match URL - skipping"));if(P&&O)break}}catch(e){ne={error:e}}finally{try{R&&!R.done&&(ie=j.return)&&ie.call(j)}finally{if(ne)throw ne.error}}this.config.debug&&(0,h.logDebug)("[TRIGGER-DETECTION] [".concat(f,"] Final trigger decision for '").concat(f,"':"),{experimentName:f,userVariant:v,hasImmediateTrigger:O,hasViewportTrigger:P,willRegisterExperiment:P||O,userChangesCount:(null==E?void 0:E.length)||0,allVariantsChangesCount:S.map(function(e){return e.length})}),P||O?((0,h.logDebug)("[TRIGGER-DETECTION] [".concat(f,"] ✓ REGISTERING EXPERIMENT - Calling exposureTracker.registerExperiment()"),{experimentName:f,userVariant:v,hasImmediateTrigger:O,hasViewportTrigger:P,changesForUser:(null==E?void 0:E.length)||0,allVariantCounts:S.map(function(e,t){return{variant:t,count:e.length}})}),this.exposureTracker.registerExperiment(f,v||0,E||[],S,O,P)):(0,h.logDebug)("[TRIGGER-DETECTION] [".concat(f,"] ⚠️ No triggers detected - experiment will NOT be registered!"),{experimentName:f,userVariant:v,hasAnyChangesInAnyVariant:C,allVariantsChangesCount:S.map(function(e){return e.length})}),c.set(f,A),(0,h.logExperimentSummary)(f,A.total,A.success,A.pending)}else this.config.debug&&(0,h.logDebug)("[ABsmartly] Skipping experiment '".concat(f,"' - no variants have changes"));else(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ⏭️ Skipping - no variant matches URL: ").concat(r),{experimentName:f,currentURL:r});else(0,h.logDebug)("[APPLY-CHANGES] [".concat(f,"] ⏭️ Skipping - no variant assigned (peek returned ").concat(v,")"),{experimentName:f})}catch(e){X={error:e}}finally{try{d&&!d.done&&($=u.return)&&$.call(u)}finally{if(X)throw X.error}}return K=performance.now()-t,(0,h.logPerformance)("Apply changes",K,{totalApplied:s,experiments:c.size}),this.config.debug&&((0,h.logDebug)("[ABsmartly] === DOM Changes Application Complete ==="),(0,h.logDebug)("[ABsmartly] Summary:",{totalChangesApplied:s,experimentsProcessed:c.size,duration:"".concat(K.toFixed(2),"ms"),experiments:Array.from(c.entries()).map(function(e){var t=l(e,2),r=t[0],n=t[1];return{name:r,total:n.total,success:n.success,pending:n.pending,pendingReason:n.pending>0?"Elements not found yet (SPA mode will retry)":void 0}})})),this.config.hideUntilReady&&this.showContent(),(0,h.logDebug)("[ABsmartly] DOM changes applied"),this.emit("changes-applied",{count:s,experimentName:e}),[2]}})})},e.prototype.hasImmediateDomAnchor=function(e){try{return e.waitForElement?null!==document.querySelector(e.observerRoot||"body"):"create"===e.type?!!e.targetSelector&&null!==document.querySelector(e.targetSelector):null!==document.querySelector(e.selector)}catch(t){return this.config.debug&&(0,h.logDebug)("[ABsmartly] Failed to evaluate immediate DOM anchor:",{selector:e.selector,targetSelector:e.targetSelector,type:e.type,error:t}),!1}},e.prototype.getAllExperimentsData=function(){var e,t,r=new Map,n=this.variantExtractor.extractAllChanges();(0,h.logDebug)("[GET-EXPERIMENTS] Extracting experiment data from context",{experimentsWithChanges:Array.from(n.keys()),totalCount:n.size});try{for(var i=a(n),o=i.next();!o.done;o=i.next()){var s=l(o.value,1)[0],c=this.config.context.peek(s);if((0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] Checking experiment"),{experimentName:s,currentVariant:c,variantIsValid:null!=c}),null!=c){var u=this.variantExtractor.getAllVariantsData(s),d=u.get(c);this.config.debug&&(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] Variant data lookup:"),{experimentName:s,userVariant:c,variantDataExists:!!d,allVariantsInMap:Array.from(u.keys()),userVariantInMap:u.has(c)}),d||(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] ⚠️ User's variant ").concat(c," has no DOM changes (control variant)"),{availableVariants:Array.from(u.keys()),note:"Will still track for SRM prevention"}),(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] ✓ Including experiment (variant ").concat(c,")"));var g=null,p={};if(d&&"object"==typeof d&&!Array.isArray(d)&&"changes"in d){var f=d;g=f.urlFilter,p={waitForElement:f.waitForElement,persistStyle:f.persistStyle,persistAttribute:f.persistAttribute,persistScript:f.persistScript,important:f.important,observerRoot:f.observerRoot}}r.set(s,{variantData:d,urlFilter:g,globalDefaults:p})}else(0,h.logDebug)("[GET-EXPERIMENTS] [".concat(s,"] ⏭️ Skipping - context.peek() returned ").concat(c))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e.prototype.extractChangesFromData=function(e,t){if(!e)return null;var r=null;return Array.isArray(e)?r=e:"object"==typeof e&&"changes"in e&&(r=e.changes),r&&0!==r.length?r.map(function(e){var r,i,o,a,l,s;return n(n({},e),{waitForElement:null!==(r=e.waitForElement)&&void 0!==r?r:t.waitForElement,persistStyle:null!==(i=e.persistStyle)&&void 0!==i?i:t.persistStyle,persistAttribute:null!==(o=e.persistAttribute)&&void 0!==o?o:t.persistAttribute,persistScript:null!==(a=e.persistScript)&&void 0!==a?a:t.persistScript,important:null!==(l=e.important)&&void 0!==l?l:t.important,observerRoot:null!==(s=e.observerRoot)&&void 0!==s?s:t.observerRoot})}):null},e.prototype.extractAllVariantChanges=function(e){for(var t=this.variantExtractor.getAllVariantChanges(e),r=this.variantExtractor.getAllVariantsData(e),i=[],o=function(e){var o=t[e],a=r.get(e);if(!o||0===o.length)return i.push([]),"continue";var l={};if(a&&"object"==typeof a&&!Array.isArray(a)&&"changes"in a){var s=a;l={waitForElement:s.waitForElement,persistStyle:s.persistStyle,persistAttribute:s.persistAttribute,persistScript:s.persistScript,important:s.important,observerRoot:s.observerRoot}}var c=o.map(function(e){var t,r,i,o,a,s;return n(n({},e),{waitForElement:null!==(t=e.waitForElement)&&void 0!==t?t:l.waitForElement,persistStyle:null!==(r=e.persistStyle)&&void 0!==r?r:l.persistStyle,persistAttribute:null!==(i=e.persistAttribute)&&void 0!==i?i:l.persistAttribute,persistScript:null!==(o=e.persistScript)&&void 0!==o?o:l.persistScript,important:null!==(a=e.important)&&void 0!==a?a:l.important,observerRoot:null!==(s=e.observerRoot)&&void 0!==s?s:l.observerRoot})});i.push(c)},a=0;a<t.length;a++)o(a);return i},e.prototype.shouldApplyVisualChanges=function(e,t,r){return!!e&&(!!Array.isArray(e)||!t||p.URLMatcher.matches(t,r))},e.prototype.hasChanges=function(e){return this.domManipulator.hasChanges(e)},e.prototype.applyChange=function(e,t){(0,h.logDebug)("Applying single change via public API",{experimentName:t,selector:e.selector,changeType:e.type});try{var r=this.domManipulator.applyChange(e,t);return r?this.emit("change_applied",{experimentName:t,change:e}):this.emit("change_failed",{experimentName:t,change:e,reason:"selector_not_found_or_apply_failed"}),r}catch(r){return(0,h.logDebug)("[ABsmartly] Error applying change:",r),this.emit("error",{type:"change_apply_error",experimentName:t,change:e,error:(null==r?void 0:r.message)||String(r)}),!1}},e.prototype.on=function(e,t){var r=this.eventListeners.get(e)||[];r.push(t),this.eventListeners.set(e,r)},e.prototype.off=function(e,t){if(t){var r=this.eventListeners.get(e)||[],n=r.indexOf(t);-1!==n&&r.splice(n,1)}else this.eventListeners.delete(e)},e.prototype.emit=function(e,t){var r,n,i=this.eventListeners.get(e)||[];try{for(var o=a(i),l=o.next();!l.done;l=o.next()){var s=l.value;try{s(t)}catch(t){(0,h.logDebug)("[ABsmartly] Error in event listener for ".concat(e,":"),t)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.getStyleManager=function(e){var t="absmartly-styles-".concat(e),r=this.styleManagers.get(e);return r||(r=new u.StyleSheetManager(t,this.config.debug),this.styleManagers.set(e,r)),r},e.prototype.buildCssRule=function(e,t,r){void 0===r&&(r=!0);var n=Object.entries(t).map(function(e){var t=l(e,2),n=t[0],i=t[1],o=n.replace(/([A-Z])/g,"-$1").toLowerCase(),a=r?" !important":"";return" ".concat(o,": ").concat(i).concat(a,";")}).join("\n");return"".concat(e," {\n").concat(n,"\n}")},e.prototype.buildStateRules=function(e,t,r){void 0===r&&(r=!0);var n=[];return t.normal&&n.push(this.buildCssRule(e,t.normal,r)),t.hover&&n.push(this.buildCssRule("".concat(e,":hover"),t.hover,r)),t.active&&n.push(this.buildCssRule("".concat(e,":active"),t.active,r)),t.focus&&n.push(this.buildCssRule("".concat(e,":focus"),t.focus,r)),n.join("\n\n")},e.prototype.refreshExperiments=function(){this.config.debug&&(0,h.logDebug)("[ABsmartly] Refreshing experiments and clearing cache"),this.variantExtractor.clearCache(),this.config.autoApply&&this.applyInjectionsAndChanges()},e.prototype.destroy=function(){var e,t;this.domManipulator.destroy(),this.exposureTracker.destroy(),this.htmlInjector.destroy();try{for(var r=a(this.styleManagers.values()),n=r.next();!n.done;n=r.next())n.value.destroy()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.styleManagers.clear(),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.persistenceManager&&(this.persistenceManager.destroy(),this.persistenceManager=null),null!==this.antiFlickerTimeout&&(clearTimeout(this.antiFlickerTimeout),this.antiFlickerTimeout=null);var i=document.getElementById(this.antiFlickerStyleId);i&&i.remove(),this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.popstateHandler&&(window.removeEventListener("popstate",this.popstateHandler),this.popstateHandler=null),this.eventListeners.clear(),this.exposedExperiments.clear(),this.unregisterFromContext(),this.unregisterGlobally(),this.initialized=!1,this.config.debug&&(0,h.logDebug)("[ABsmartly] DOM Changes Plugin Lite destroyed")},e.prototype.registerWithContext=function(t){void 0===t&&(t=!0),this.config.context&&(this.config.context.__plugins||(this.config.context.__plugins={}),this.config.context.__plugins.domPlugin={name:"DOMChangesPluginLite",version:e.VERSION,initialized:t,capabilities:["spa","visibility"],instance:this,timestamp:Date.now()},this.config.context.__domPlugin=this.config.context.__plugins.domPlugin,this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite registered with context at __plugins.domPlugin (initialized=".concat(t,")")))},e.prototype.unregisterFromContext=function(){var e;this.config.context&&((null===(e=this.config.context.__plugins)||void 0===e?void 0:e.domPlugin)&&delete this.config.context.__plugins.domPlugin,this.config.context.__domPlugin&&delete this.config.context.__domPlugin,this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite unregistered from context"))},e.prototype.registerGlobally=function(t){void 0===t&&(t=!0),(0,y.registerPlugin)("dom",{name:"DOMChangesPluginLite",version:e.VERSION,initialized:t,timestamp:Date.now(),capabilities:["spa","visibility","auto-apply"],instance:this}),this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite registered in global window.__ABSMARTLY_PLUGINS__ (initialized=".concat(t,")"))},e.prototype.unregisterGlobally=function(){(0,y.unregisterPlugin)("dom"),this.config.debug&&(0,h.logDebug)("[ABsmartly] DOMChangesPluginLite unregistered from global registry")},e.prototype.hideContent=function(){var e=this,t=this.config.hideUntilReady;if(t&&!document.getElementById(this.antiFlickerStyleId)){var r=document.createElement("style");r.id=this.antiFlickerStyleId;var n=!1!==this.config.hideTransition;r.textContent="\n ".concat(t,n?" {\n visibility: hidden !important;\n opacity: 0 !important;\n }\n ":" {\n visibility: hidden !important;\n }\n "),document.head.appendChild(r),this.antiFlickerTimeout=window.setTimeout(function(){e.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker timeout reached (".concat(e.config.hideTimeout,"ms), showing content")),e.showContent()},this.config.hideTimeout),this.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker enabled (selector: '".concat(t,"', transition: ").concat(n?this.config.hideTransition:"none",", timeout: ").concat(this.config.hideTimeout,"ms)"))}},e.prototype.showContent=function(){var e=this;null!==this.antiFlickerTimeout&&(clearTimeout(this.antiFlickerTimeout),this.antiFlickerTimeout=null);var t=document.getElementById(this.antiFlickerStyleId);if(t)if(!1!==this.config.hideTransition){var r=this.config.hideUntilReady;t.textContent="\n ".concat(r," {\n opacity: 0 !important;\n transition: opacity ").concat(this.config.hideTransition," !important;\n }\n "),t.offsetHeight,t.textContent="\n ".concat(r," {\n opacity: 1 !important;\n transition: opacity ").concat(this.config.hideTransition," !important;\n }\n ");var n=1e3*parseFloat(this.config.hideTransition);setTimeout(function(){t.remove(),e.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker fade-in complete, style removed")},n),this.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker fading in with transition: ".concat(this.config.hideTransition))}else t.remove(),this.config.debug&&(0,h.logDebug)("[ABsmartly] Anti-flicker removed, content now visible")},e.prototype.watchElement=function(e,t,r){this.persistenceManager&&this.persistenceManager.watchElement(e,t,r)},e.prototype.unwatchElement=function(e,t){this.persistenceManager&&this.persistenceManager.unwatchElement(e,t)},e.VERSION=v.BUILD_VERSION,e}();t.DOMChangesPluginLite=m},713:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,l)}s((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&l[0]?n.return:l[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,l[1])).done)return i;switch(n=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],n=0}finally{r=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}},o=this&&this.__values||function(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.")},a=this&&this.__read||function(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},l=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.ExposureTracker=void 0;var s=r(609),c=function(){function e(e,t){void 0===t&&(t=!1),this.context=e,this.experiments=new Map,this.trackedElements=new Map,this.mutationObserver=null,this.placeholders=new Map,this.debug=t,this.setupIntersectionObserver()}return e.prototype.registerExperiment=function(e,t,r,n,i,c){var u,d,g,h,p,f,y,v,m,b,x,w;this.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] Registering experiment for exposure tracking"),{experimentName:e,currentVariant:t,hasImmediateTrigger:i,hasViewportTrigger:c,currentChangesCount:r.length,allVariantsCount:n.length,currentChangeTypes:r.map(function(e){return{type:e.type,selector:e.selector,trigger_on_view:e.trigger_on_view||!1}})});var E=new Set,S=new Set,C=new Map,A=new Set,_=new Map;try{for(var k=o(n),P=k.next();!P.done;P=k.next()){var O=P.value;try{for(var D=(g=void 0,o(O)),T=D.next();!T.done;T=D.next()){var L=T.value;if(L.trigger_on_view)if("move"===L.type)C.has(L.selector)||C.set(L.selector,new Set),L.targetSelector&&C.get(L.selector).add(L.targetSelector);else if("delete"===L.type)A.add(L.selector);else if("create"===L.type)if(L.targetSelector){var M=L.position||"lastChild";(q=_.get(L.targetSelector))||(q=new Set,_.set(L.targetSelector,q)),q.add(M)}else this.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] Skipping create change with no targetSelector — manipulator can't apply it either"),{change:L});else E.add(L.selector)}}catch(e){g={error:e}}finally{try{T&&!T.done&&(h=D.return)&&h.call(D)}finally{if(g)throw g.error}}}}catch(e){u={error:e}}finally{try{P&&!P.done&&(d=k.return)&&d.call(k)}finally{if(u)throw u.error}}var I=function(r){for(var i,a,l=[],s=0;s<n.length;s++){var c=n[s].find(function(e){return"move"===e.type&&e.selector===r&&e.trigger_on_view});(null==c?void 0:c.targetSelector)&&l.push({targetSelector:c.targetSelector,position:c.position||"lastChild",variantIndex:s})}var u=l.findIndex(function(e){return e.variantIndex===t});if(u>=0){E.add(r);for(var d=0;d<l.length;d++){var g=l[d];d!==u&&N.createContainerPlaceholder(e,r,g.targetSelector,g.position)}}else{E.add(r);try{for(var h=(i=void 0,o(l)),p=h.next();!p.done;p=h.next())g=p.value,N.createContainerPlaceholder(e,r,g.targetSelector,g.position)}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}}},N=this;try{for(var j=o(C),R=j.next();!R.done;R=j.next())I(a(R.value,1)[0])}catch(e){p={error:e}}finally{try{R&&!R.done&&(f=j.return)&&f.call(j)}finally{if(p)throw p.error}}var B=function(t){r.some(function(e){return"delete"===e.type&&e.selector===t&&e.trigger_on_view})?0===U.createInPlacePlaceholder(e,t)&&(E.add(t),U.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] Delete element doesn't exist yet - tracking selector for when it appears"),{selector:t})):E.add(t)},U=this;try{for(var V=o(A),F=V.next();!F.done;F=V.next())B(F.value)}catch(e){y={error:e}}finally{try{F&&!F.done&&(v=V.return)&&v.call(V)}finally{if(y)throw y.error}}try{for(var z=o(_),G=z.next();!G.done;G=z.next()){var W=a(G.value,2),H=W[0],q=W[1],Q=!1;try{for(var J=(x=void 0,o(q)),Y=J.next();!Y.done;Y=J.next())M=Y.value,this.createContainerPlaceholder(e,"__create_placeholder__",H,M)&&(Q=!0)}catch(e){x={error:e}}finally{try{Y&&!Y.done&&(w=J.return)&&w.call(J)}finally{if(x)throw x.error}}Q||E.add(H)}}catch(e){m={error:e}}finally{try{G&&!G.done&&(b=z.return)&&b.call(z)}finally{if(m)throw m.error}}var K={experimentName:e,variant:t,changes:r,allPossibleSelectors:new Set(l(l([],a(E),!1),a(S),!1)),triggered:!1,hasImmediateTrigger:i,hasViewportTrigger:c};this.experiments.set(e,K),this.debug&&(0,s.logDebug)("[ABsmartly] Experiment ".concat(e," will track selectors:"),Array.from(K.allPossibleSelectors)),i?((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓ HAS IMMEDIATE TRIGGER - triggering exposure NOW"),{experimentName:e,currentVariant:t,allVariantCounts:n.map(function(e,t){return{variant:t,count:e.length}})}),this.triggerExposure(e).catch(function(t){(0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✗ Failed to trigger exposure:"),t)})):c?((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓ HAS VIEWPORT TRIGGER - setting up viewport observers"),{experimentName:e,currentVariant:t,selectorsToWatch:Array.from(K.allPossibleSelectors),allVariantCounts:n.map(function(e,t){return{variant:t,count:e.length}})}),this.observeSelectors(e,K.allPossibleSelectors)):(0,s.logDebug)("[EXPOSURE] [".concat(e,"] ⚠️ No immediate or viewport trigger detected - experiment will NOT be exposed!"),{experimentName:e,currentVariant:t,hasImmediateTrigger:i,hasViewportTrigger:c,currentChanges:r.map(function(e){return{type:e.type,trigger_on_view:e.trigger_on_view}})})},e.prototype.createContainerPlaceholder=function(e,t,r,n){var i,o;void 0===n&&(n="lastChild");var a=document.querySelector(r);if(!a)return!1;var l="".concat(e,"-").concat(t,"-").concat(r,"-").concat(n);if(this.placeholders.has(l))return!0;var c=document.createElement("span");switch(c.style.cssText="\n display: inline-block;\n width: 1px;\n height: 1px;\n position: relative;\n left: -1px;\n visibility: hidden;\n pointer-events: none;\n font-size: 0;\n line-height: 0;\n overflow: hidden;\n ",c.setAttribute("data-absmartly-placeholder","true"),c.setAttribute("data-absmartly-original-selector",t),c.setAttribute("data-absmartly-experiment",e),c.setAttribute("aria-hidden","true"),n){case"firstChild":a.insertBefore(c,a.firstChild);break;case"lastChild":default:a.appendChild(c);break;case"before":null===(i=a.parentElement)||void 0===i||i.insertBefore(c,a);break;case"after":null===(o=a.parentElement)||void 0===o||o.insertBefore(c,a.nextSibling)}return this.placeholders.set(l,c),this.trackElement(c,e),this.debug&&(0,s.logDebug)("[ABsmartly] Created placeholder for ".concat(t," at ").concat(r," (").concat(n,")")),!0},e.prototype.createInPlacePlaceholder=function(e,t){var r,n=document.querySelectorAll(t);if(0===n.length)return this.debug&&(0,s.logDebug)("[EXPOSURE] [".concat(e,"] No elements found for delete placeholder - will track selector instead"),{selector:t}),0;for(var i=0,o=0;o<n.length;o++){var a=n[o],l=t.replace(/[^a-zA-Z0-9-]/g,"_"),c="absmartly-delete-".concat(e,"-").concat(l,"-").concat(o),u="".concat(e,"-delete-").concat(t,"-").concat(o);if(!a.hasAttribute("data-absmartly-delete-placeholder")){var d=document.createElement("span");d.id=c,d.style.cssText="\n display: inline-block;\n width: 1px;\n height: 1px;\n position: relative;\n left: -1px;\n visibility: hidden;\n pointer-events: none;\n font-size: 0;\n line-height: 0;\n overflow: hidden;\n ",d.setAttribute("data-absmartly-placeholder","true"),d.setAttribute("data-absmartly-delete-placeholder","true"),d.setAttribute("data-absmartly-original-selector",t),d.setAttribute("data-absmartly-experiment",e),d.setAttribute("aria-hidden","true"),null===(r=a.parentElement)||void 0===r||r.insertBefore(d,a),a.remove(),this.placeholders.set(u,d),this.trackElement(d,e),i++,this.debug&&(0,s.logDebug)("[ABsmartly] Created in-place delete placeholder for ".concat(t," in experiment ").concat(e))}}return i},e.prototype.getOriginalParentForMove=function(e){var t=document.querySelector(e);return(null==t?void 0:t.parentElement)?this.getStableParentSelector(t.parentElement):null},e.prototype.getStableParentSelector=function(e){if(e.id)return"#".concat(e.id);if(e.className){var t=e.className.split(" ").filter(function(e){return e&&!e.startsWith("absmartly")});if(t.length>0)return".".concat(t[0])}var r=e.parentElement;if(r){var n=Array.from(r.children).indexOf(e);return"".concat(e.tagName.toLowerCase(),":nth-child(").concat(n+1,")")}return null},e.prototype.observeSelectors=function(e,t){var r,n,i,a;try{for(var l=o(t),s=l.next();!s.done;s=l.next()){var c=s.value,u=document.querySelectorAll(c);if(u.length>0)try{for(var d=(i=void 0,o(u)),g=d.next();!g.done;g=d.next()){var h=g.value;this.trackElement(h,e)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}else this.watchForSelector(c,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}},e.prototype.trackElement=function(e,t){this.trackedElements.has(e)?this.trackedElements.get(e).experiments.add(t):(this.trackedElements.set(e,{element:e,experiments:new Set([t]),isPlaceholder:e.hasAttribute("data-absmartly-placeholder")}),this.observer.observe(e))},e.prototype.watchForSelector=function(e,t){this.mutationObserver||this.setupMutationObserver()},e.prototype.setupIntersectionObserver=function(){var e=this;this.observer=new IntersectionObserver(function(t){var r,n;try{for(var i=o(t),a=i.next();!a.done;a=i.next()){var l=a.value;l.isIntersecting&&e.handleElementVisible(l.target)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},{threshold:.01,rootMargin:"0px"})},e.prototype.setupMutationObserver=function(){var e=this;this.mutationObserver=new MutationObserver(function(t){var r,n,i,a;try{for(var l=o(t),s=l.next();!s.done;s=l.next()){var c=s.value;try{for(var u=(i=void 0,o(c.addedNodes)),d=u.next();!d.done;d=u.next()){var g=d.value;g instanceof Element&&e.checkNewElement(g)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0})},e.prototype.checkNewElement=function(e){var t,r,n,i,l,s;try{for(var c=o(this.experiments),u=c.next();!u.done;u=c.next()){var d=a(u.value,2),g=d[0],h=d[1];try{for(var p=(n=void 0,o(h.allPossibleSelectors)),f=p.next();!f.done;f=p.next()){var y=f.value;e.matches(y)&&this.trackElement(e,g);try{for(var v=(l=void 0,o(e.querySelectorAll(y))),m=v.next();!m.done;m=v.next()){var b=m.value;this.trackElement(b,g)}}catch(e){l={error:e}}finally{try{m&&!m.done&&(s=v.return)&&s.call(v)}finally{if(l)throw l.error}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(t)throw t.error}}},e.prototype.handleElementVisible=function(e){var t,r,n=this.trackedElements.get(e);if(n){var i=function(t){var r=a.experiments.get(t);if(r&&!r.triggered&&(a.triggerExposure(t).catch(function(e){(0,s.logDebug)("[ABsmartly] Failed to trigger exposure for ".concat(t,":"),e)}),a.debug)){var i=n.isPlaceholder?e.getAttribute("data-absmartly-original-selector"):a.getElementSelector(e);(0,s.logDebug)("[ABsmartly] Triggering exposure for ".concat(t," via ").concat(i))}},a=this;try{for(var l=o(n.experiments),c=l.next();!c.done;c=l.next())i(c.value)}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}}},e.prototype.triggerExposure=function(e){return n(this,void 0,void 0,function(){var t,r;return i(this,function(n){switch(n.label){case 0:return(t=this.experiments.get(e))?t.triggered?((0,s.logDebug)("[EXPOSURE] [".concat(e,"] Already triggered, skipping")),[2]):((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓ CALLING context.treatment() to trigger exposure"),{experimentName:e,variant:t.variant}),[4,this.context.ready()]):((0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✗ Cannot trigger - experiment not found in tracker")),[2]);case 1:return n.sent(),r=this.context.treatment(e),t.triggered=!0,(0,s.logDebug)("[EXPOSURE] [".concat(e,"] ✓✓ EXPOSURE TRIGGERED - context.treatment() completed"),{experimentName:e,variant:t.variant,treatment:r}),this.cleanupExperiment(e),[2]}})})},e.prototype.cleanupExperiment=function(e){var t,r,n,i;try{for(var l=o(this.trackedElements),s=l.next();!s.done;s=l.next()){var c=a(s.value,2),u=c[0],d=c[1];d.experiments.delete(e),0===d.experiments.size&&(this.observer.unobserve(u),this.trackedElements.delete(u))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}try{for(var g=o(this.placeholders),h=g.next();!h.done;h=g.next()){var p=a(h.value,2),f=p[0],y=p[1];f.startsWith("".concat(e,"-"))&&(y.remove(),this.placeholders.delete(f))}}catch(e){n={error:e}}finally{try{h&&!h.done&&(i=g.return)&&i.call(g)}finally{if(n)throw n.error}}var v=this.experiments.get(e);v&&v.allPossibleSelectors.clear(),Array.from(this.experiments.values()).every(function(e){return e.triggered})&&this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null)},e.prototype.getElementSelector=function(e){if(e.id)return"#".concat(e.id);if(e.className){var t=e.className.split(" ").filter(function(e){return e&&!e.startsWith("absmartly")});if(t.length>0)return".".concat(t.join("."))}return e.tagName.toLowerCase()},e.prototype.needsViewportTracking=function(e){var t,r=this.experiments.get(e);return null!==(t=null==r?void 0:r.hasViewportTrigger)&&void 0!==t&&t},e.prototype.isTriggered=function(e){var t,r=this.experiments.get(e);return null!==(t=null==r?void 0:r.triggered)&&void 0!==t&&t},e.prototype.destroy=function(){var e,t;this.observer.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect();try{for(var r=o(this.placeholders.values()),n=r.next();!n.done;n=r.next())n.value.remove()}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.experiments.clear(),this.trackedElements.clear(),this.placeholders.clear(),this.debug&&(0,s.logDebug)("[ABsmartly] ExposureTracker destroyed")},e}();t.ExposureTracker=c},796:function(e,t){!function(e){"use strict";let t=-1;const r=e=>{addEventListener("pageshow",r=>{r.persisted&&(t=r.timeStamp,e(r))},!0)},n=(e,t,r,n)=>{let i,o;return a=>{t.value>=0&&(a||n)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},i=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},o=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},a=()=>{const e=o();return e?.activationStart??0},l=(e,r=-1)=>{const n=o();let i="navigate";return t>=0?i="back-forward-cache":n&&(document.prerendering||a()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:r,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},s=new WeakMap;function c(e,t){return s.get(e)||s.set(e,new t),s.get(e)}class u{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const d=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},g=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let h=-1;const p=new Set,f=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,y=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of p)e();isFinite(h)||(h="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",y,!0))}},v=()=>{if(h<0){const e=a(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;h=t??f(),addEventListener("visibilitychange",y,!0),addEventListener("prerenderingchange",y,!0),r(()=>{setTimeout(()=>{h=f()})})}return{get firstHiddenTime(){return h},onHidden(e){p.add(e)}}},m=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},b=[1800,3e3],x=(e,t={})=>{m(()=>{const o=v();let s,c=l("FCP");const u=d("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(u.disconnect(),t.startTime<o.firstHiddenTime&&(c.value=Math.max(t.startTime-a(),0),c.entries.push(t),s(!0)))});u&&(s=n(e,c,b,t.reportAllChanges),r(r=>{c=l("FCP"),s=n(e,c,b,t.reportAllChanges),i(()=>{c.value=performance.now()-r.timeStamp,s(!0)})}))})},w=[.1,.25];let E=0,S=1/0,C=0;const A=e=>{for(const t of e)t.interactionId&&(S=Math.min(S,t.interactionId),C=Math.max(C,t.interactionId),E=C?(C-S)/7+1:0)};let _;const k=()=>_?E:performance.interactionCount??0,P=()=>{"interactionCount"in performance||_||(_=d("event",A,{type:"event",buffered:!0,durationThreshold:0}))};let O=0;class D{u=[];l=new Map;p;m;v(){O=k(),this.u.length=0,this.l.clear()}T(){const e=Math.min(this.u.length-1,Math.floor((k()-O)/50));return this.u[e]}h(e){if(this.p?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.L){if(r?e.duration>r.L?(r.entries=[e],r.L=e.duration):e.duration===r.L&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],L:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.L-e.L),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.m?.(r)}}}const T=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=g(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},L=[200,500];class M{p;h(e){this.p?.(e)}}const I=[2500,4e3],N=[800,1800],j=e=>{document.prerendering?m(()=>j(e)):"complete"!==document.readyState?addEventListener("load",()=>j(e),!0):setTimeout(e)};e.CLSThresholds=w,e.FCPThresholds=b,e.INPThresholds=L,e.LCPThresholds=I,e.TTFBThresholds=N,e.onCLS=(e,t={})=>{const o=v();x(g(()=>{let a,s=l("CLS",0);const g=c(t,u),h=e=>{for(const t of e)g.h(t);g.i>s.value&&(s.value=g.i,s.entries=g.o,a())},p=d("layout-shift",h);p&&(a=n(e,s,w,t.reportAllChanges),o.onHidden(()=>{h(p.takeRecords()),a(!0)}),r(()=>{g.i=0,s=l("CLS",0),a=n(e,s,w,t.reportAllChanges),i(()=>a())}),setTimeout(a))}))},e.onFCP=x,e.onINP=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const i=v();m(()=>{P();let o,a=l("INP");const s=c(t,D),u=e=>{T(()=>{for(const t of e)s.h(t);const t=s.T();t&&t.L!==a.value&&(a.value=t.L,a.entries=t.entries,o())})},g=d("event",u,{durationThreshold:t.durationThreshold??40});o=n(e,a,L,t.reportAllChanges),g&&(g.observe({type:"first-input",buffered:!0}),i.onHidden(()=>{u(g.takeRecords()),o(!0)}),r(()=>{s.v(),a=l("INP"),o=n(e,a,L,t.reportAllChanges)}))})},e.onLCP=(e,t={})=>{m(()=>{const o=v();let s,u=l("LCP");const h=c(t,M),p=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)h.h(t),t.startTime<o.firstHiddenTime&&(u.value=Math.max(t.startTime-a(),0),u.entries=[t],s())},f=d("largest-contentful-paint",p);if(f){s=n(e,u,I,t.reportAllChanges);const o=g(()=>{p(f.takeRecords()),f.disconnect(),s(!0)}),a=e=>{e.isTrusted&&(T(o),removeEventListener(e.type,a,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,a,{capture:!0});r(r=>{u=l("LCP"),s=n(e,u,I,t.reportAllChanges),i(()=>{u.value=performance.now()-r.timeStamp,s(!0)})})}})},e.onTTFB=(e,t={})=>{let i=l("TTFB"),s=n(e,i,N,t.reportAllChanges);j(()=>{const c=o();c&&(i.value=Math.max(c.responseStart-a(),0),i.entries=[c],s(!0),r(()=>{i=l("TTFB",0),s=n(e,i,N,t.reportAllChanges),s(!0)}))})}}(t)},834:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUILD_DEBUG=t.BUILD_VERSION=void 0,t.BUILD_VERSION="1.3.7",t.BUILD_DEBUG=!1},943:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerPlugin=function(e,t){"undefined"!=typeof window&&(window.__ABSMARTLY_PLUGINS__||(window.__ABSMARTLY_PLUGINS__={}),window.__ABSMARTLY_PLUGINS__[e]=t)},t.unregisterPlugin=function(e){"undefined"!=typeof window&&window.__ABSMARTLY_PLUGINS__&&delete window.__ABSMARTLY_PLUGINS__[e]},t.isPluginRegistered=function(e){var t;return"undefined"!=typeof window&&!(!window.__ABSMARTLY_PLUGINS__||!(null===(t=window.__ABSMARTLY_PLUGINS__[e])||void 0===t?void 0:t.initialized))},t.getRegisteredPlugins=function(){return"undefined"==typeof window?{}:window.__ABSMARTLY_PLUGINS__||{}}},964:function(e,t,r){"use strict";var n=this&&this.__values||function(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.")},i=this&&this.__read||function(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},o=this&&this.__spreadArray||function(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))};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMManipulatorLite=void 0;var a=r(609),l=r(214),s=function(){function e(e,t){void 0===e&&(e=!1);var r=this;this.appliedChanges=new Map,this.debug=e,this.plugin=t,this.pendingManager=new l.PendingChangeManager(function(e,t,n){return n?r.applyChangeToSpecificElement(e,t,n):r.applyChange(e,t)},e)}return e.prototype.executeUserJavaScript=function(e,t,r,n){var i="absmartly-experiment-".concat(r||"unknown",".js"),o="var _debug = (typeof _debug !== 'undefined' ? _debug : { debugLog: console.log.bind(console), debugWarn: console.warn.bind(console), debugError: console.error.bind(console) });\n";try{return new Function("element",o+e+"\n//# sourceURL=".concat(i))(t),!0}catch(g){var a=g instanceof Error?g.message:String(g);if(!(g instanceof EvalError||/unsafe-eval|Content Security Policy|CSP|refused to evaluate/i.test(a)))return this.reportJsExecutionFailure({experimentName:r,selector:n,reason:"runtime",error:a,stack:g instanceof Error?g.stack:void 0}),!1;try{var l="__absmartly_js_target_".concat(Date.now(),"_").concat(Math.floor(1e9*Math.random())),s="".concat(l,"_ran");window[l]=t,window[s]=!1;var c=document.createElement("script");c.textContent="(function(element){".concat(o).concat(e,"\n})(window['").concat(l,"']);\n")+"window['".concat(s,"'] = true;\n")+"try { delete window['".concat(l,"']; } catch(_e) { window['").concat(l,"'] = undefined; }\n")+"//# sourceURL=".concat(i),(document.head||document.documentElement).appendChild(c),c.remove();var u=!0===window[s];try{delete window[s]}catch(e){window[s]=void 0}return!!u||(this.reportJsExecutionFailure({experimentName:r,selector:n,reason:"csp",error:"CSP blocked dynamic script execution. eval(): ".concat(a,"; inline <script> did not execute (likely blocked by script-src without 'unsafe-inline').")}),!1)}catch(e){var d=e instanceof Error?e.message:String(e);return this.reportJsExecutionFailure({experimentName:r,selector:n,reason:"csp",error:"CSP blocked dynamic script execution. eval(): ".concat(a,"; inline <script>: ").concat(d),stack:e instanceof Error?e.stack:void 0}),!1}}},e.prototype.reportJsExecutionFailure=function(e){try{(0,a.logProductionWarn)("[ABsmartly] JavaScript DOM change failed (".concat(e.reason,') for "').concat(e.experimentName,'" selector "').concat(e.selector,'": ').concat(e.error),e.stack?{stack:e.stack}:void 0)}catch(e){}try{"undefined"!=typeof document&&"function"==typeof CustomEvent&&document.dispatchEvent(new CustomEvent("absmartly:js-error",{detail:e}))}catch(e){}},e.prototype.applyChange=function(e,t){var r,i,o,l,s,c,u,d,g,h,p,f,y,v,m=this;if(!e.enabled&&void 0!==e.enabled)return(0,a.logDebug)("Skipping disabled change for experiment: ".concat(t),{experimentName:t,selector:e.selector,changeType:e.type}),!1;var b=!!this.plugin.reapplyingElements&&Array.from(this.plugin.reapplyingElements).length>0,x=null===(d=null===(u=this.plugin.config)||void 0===u?void 0:u.context)||void 0===d?void 0:d.peek(t);this.debug&&(0,a.logDebug)("[DOM-APPLY] [".concat(t,"] ").concat(b?"RE-APPLYING":"APPLYING"," change"),{experimentName:t,userVariant:x,selector:e.selector,type:e.type,timestamp:Date.now(),callStack:null===(g=(new Error).stack)||void 0===g?void 0:g.split("\n").slice(2,4).join("\n")});try{if("styleRules"===e.type)return this.applyStyleRules(e,t);if("create"===e.type)return!!(e.element&&e.targetSelector&&this.createElement(e,t))&&(this.trackAppliedChange(t,e),(0,a.logChangeApplication)(t,e.targetSelector,e.type,1,!0),!0);var w=document.querySelectorAll(e.selector),E=[];if(0===w.length)return e.waitForElement||(null===(h=this.plugin.config)||void 0===h?void 0:h.spa)?(this.debug&&(0,a.logDebug)("[ABsmartly] Element not found, adding to pending: ".concat(e.selector)),this.pendingManager.addPending({change:e,experimentName:t,observerRoot:e.observerRoot}),!0):(this.debug&&(0,a.logDebug)("[ABsmartly] No elements found for selector: ".concat(e.selector)),(0,a.logDebug)("No elements found for selector",{experimentName:t,selector:e.selector,changeType:e.type}),!1);try{for(var S=n(w),C=S.next();!C.done;C=S.next()){var A=C.value;if(this.debug&&"style"===e.type){var _={};if(e.value&&"object"==typeof e.value)try{for(var k=(o=void 0,n(Object.keys(e.value))),P=k.next();!P.done;P=k.next())_[L=P.value.replace(/([A-Z])/g,"-$1").toLowerCase()]=A.style.getPropertyValue(L)}catch(e){o={error:e}}finally{try{P&&!P.done&&(l=k.return)&&l.call(k)}finally{if(o)throw o.error}}(0,a.logDebug)("[DOM-BEFORE-APPLY] Element styles before change",{experimentName:t,selector:e.selector,element:A.tagName,oldStyles:_,newStyles:e.value})}if(this.applyChangeToElement(A,e),this.debug&&"style"===e.type){var O={};if(e.value&&"object"==typeof e.value)try{for(var D=(s=void 0,n(Object.keys(e.value))),T=D.next();!T.done;T=D.next()){var L;O[L=T.value.replace(/([A-Z])/g,"-$1").toLowerCase()]=A.style.getPropertyValue(L)}}catch(e){s={error:e}}finally{try{T&&!T.done&&(c=D.return)&&c.call(D)}finally{if(s)throw s.error}}(0,a.logDebug)("[DOM-AFTER-APPLY] Element styles after change",{experimentName:t,selector:e.selector,element:A.tagName,appliedStyles:O})}if("javascript"===e.type)if(e.value){var M=null===(f=null===(p=this.plugin.config)||void 0===p?void 0:p.context)||void 0===f?void 0:f.peek(t);this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] Executing JavaScript change"),{experimentName:t,userVariant:M,selector:e.selector,element:A.tagName,code:String(e.value).substring(0,100)+"..."});var I=String(e.value);this.executeUserJavaScript(I,A,t,e.selector)&&(E.push(A),this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] ✓ JavaScript executed successfully"),{experimentName:t,userVariant:M,selector:e.selector,element:A.tagName,code:I}))}else(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] ✗ No JavaScript code provided in change.value"),{experimentName:t,selector:e.selector});else if("move"===e.type){var N=e.targetSelector||(e.value&&"object"==typeof e.value?e.value.targetSelector:null),j=e.position||(e.value&&"object"==typeof e.value?e.value.position:null);if(N){var R=document.querySelector(N);R?(this.moveElement(A,R,j),E.push(A)):this.debug&&(0,a.logDebug)("[ABsmartly] Move target not found: ".concat(N))}}else E.push(A);"style"===e.type&&e.persistStyle||"attribute"===e.type&&e.persistAttribute||"javascript"===e.type&&!0===e.persistScript||(null===(y=this.plugin.config)||void 0===y?void 0:y.spa)?this.plugin.watchElement(A,t,e):this.debug&&(0,a.logDebug)("[WATCH-SKIP] NOT watching element - no persist flag and SPA disabled",{experimentName:t,selector:e.selector,element:A.tagName,changeType:e.type,spaMode:null===(v=this.plugin.config)||void 0===v?void 0:v.spa})}}catch(e){r={error:e}}finally{try{C&&!C.done&&(i=S.return)&&i.call(S)}finally{if(r)throw r.error}}if(E.length>0){this.trackAppliedChange(t,e),e.waitForElement&&this.pendingManager.removePending(e.selector,t,e.observerRoot);var B=E.some(function(e){var t;return null===(t=m.plugin.reapplyingElements)||void 0===t?void 0:t.has(e)});return B||(0,a.logChangeApplication)(t,e.selector,e.type,E.length,!0),!0}return(0,a.logChangeApplication)(t,e.selector,e.type,0,!1),!1}catch(r){return this.debug&&(0,a.logDebug)("[ABsmartly] Error applying DOM change:",r,e),(0,a.logDebug)("Error applying DOM change",{experimentName:t,selector:e.selector,changeType:e.type,error:r instanceof Error?r.message:"Unknown error"}),!1}},e.prototype.moveElement=function(e,t,r){var n,i,o;switch(r){case"before":null===(n=t.parentElement)||void 0===n||n.insertBefore(e,t);break;case"after":t.nextSibling?null===(i=t.parentElement)||void 0===i||i.insertBefore(e,t.nextSibling):null===(o=t.parentElement)||void 0===o||o.appendChild(e);break;case"firstChild":t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);break;default:t.appendChild(e)}},e.prototype.createElement=function(e,t){var r,i;if(!e.element||!e.targetSelector)return null;var o=document.querySelector(e.targetSelector);if(!o)return this.debug&&(0,a.logDebug)("[ABsmartly] Create target not found: ".concat(e.targetSelector)),null;var l=document.createElement("div");l.innerHTML=e.element;var s=Array.from(l.children);if(0===s.length)return null;try{for(var c=n(s),u=c.next();!u.done;u=c.next()){var d=u.value;this.moveElement(d,o,e.position)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return s[0]},e.prototype.applyStyleRules=function(e,t){try{var r=this.plugin.getStyleManager(t),n="".concat(e.selector,"::states"),i=void 0;if("string"==typeof e.value&&e.value.trim())i=e.value;else{if(!e.states)return!1;i=this.plugin.buildStateRules(e.selector,e.states,!1!==e.important)}return r.setRule(n,i),this.debug&&((0,a.logDebug)("[ABsmartly] Applied style rule: ".concat(n)),(0,a.logDebug)("[ABsmartly] CSS: ".concat(i))),this.trackAppliedChange(t,e),(0,a.logChangeApplication)(t,e.selector,"styleRules",1,!0),!0}catch(e){return this.debug&&(0,a.logDebug)("[ABsmartly] Error applying style rules:",e),!1}},e.prototype.applyChangeToElement=function(e,t){var r,l,s,c,u,d;switch(t.type){case"text":void 0!==t.value&&(e.textContent=String(t.value));break;case"html":void 0!==t.value&&(e.innerHTML=String(t.value));break;case"style":if(t.value&&"object"==typeof t.value)try{for(var g=n(Object.entries(t.value)),h=g.next();!h.done;h=g.next()){var p=i(h.value,2),f=p[0],y=p[1],v=f.replace(/([A-Z])/g,"-$1").toLowerCase(),m=!0===t.important?"important":"";e.style.setProperty(v,String(y),m)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(l=g.return)&&l.call(g)}finally{if(r)throw r.error}}break;case"class":t.add&&Array.isArray(t.add)&&(s=e.classList).add.apply(s,o([],i(t.add),!1)),t.remove&&Array.isArray(t.remove)&&(c=e.classList).remove.apply(c,o([],i(t.remove),!1));break;case"attribute":if(t.value&&"object"==typeof t.value)try{for(var b=n(Object.entries(t.value)),x=b.next();!x.done;x=b.next()){var w=i(x.value,2),E=w[0];null==(y=w[1])?e.removeAttribute(E):e.setAttribute(E,String(y))}}catch(e){u={error:e}}finally{try{x&&!x.done&&(d=b.return)&&d.call(b)}finally{if(u)throw u.error}}break;case"move":if(t.value&&"object"==typeof t.value){var S=t.value,C=document.querySelector(S.targetSelector);C?this.moveElement(e,C,S.position):this.debug&&(0,a.logDebug)("[ABsmartly] Move target not found: ".concat(S.targetSelector))}break;case"delete":e.remove()}},e.prototype.applyChangeToSpecificElement=function(e,t,r){var n;try{if(this.applyChangeToElement(r,e),"javascript"===e.type&&e.value){if(this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] Executing JavaScript on specific element"),{experimentName:t,selector:e.selector,element:r.tagName,code:String(e.value).substring(0,100)+"..."}),!this.executeUserJavaScript(String(e.value),r,t,e.selector))return!1;this.debug&&(0,a.logDebug)("[JAVASCRIPT] [".concat(t,"] ✓ JavaScript executed successfully"),{experimentName:t,selector:e.selector,element:r.tagName})}else if("move"===e.type){var i=e.targetSelector||(e.value&&"object"==typeof e.value?e.value.targetSelector:null),o=e.position||(e.value&&"object"==typeof e.value?e.value.position:null);if(i){var l=document.querySelector(i);if(!l)return!1;this.moveElement(r,l,o)}}return("style"===e.type&&e.persistStyle||"attribute"===e.type&&e.persistAttribute||"javascript"===e.type&&!0===e.persistScript||(null===(n=this.plugin.config)||void 0===n?void 0:n.spa))&&this.plugin.watchElement(r,t,e),!0}catch(e){return this.debug&&(0,a.logDebug)("[ABsmartly] Error applying change to specific element:",e),!1}},e.prototype.trackAppliedChange=function(e,t){var r=this.appliedChanges.get(e);r||(r=new Set,this.appliedChanges.set(e,r));var n="".concat(t.selector,"-").concat(t.type);r.add(n)},e.prototype.hasChanges=function(e){return this.appliedChanges.has(e)},e.prototype.clearTracking=function(e){e?this.appliedChanges.delete(e):this.appliedChanges.clear()},e.prototype.removeAllPending=function(e){this.pendingManager.removeAllPending(e)},e.prototype.destroy=function(){this.pendingManager.destroy(),this.appliedChanges.clear()},e}();t.DOMManipulatorLite=s},973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLMatcher=void 0;var n=r(609),i=function(){function e(){}return e.matches=function(e,t){void 0===t&&(t=window.location.href);var r=this.normalizeFilter(e),n=this.extractURLPart(t,r.matchType);return(!r.exclude||!this.matchesPatterns(r.exclude,n,r.mode))&&(!r.include||0!==r.include.length&&this.matchesPatterns(r.include,n,r.mode))},e.extractURLPart=function(e,t){void 0===t&&(t="path");try{var r=new URL(e);switch(t){case"full-url":return r.href;case"path":default:return r.pathname+r.hash;case"domain":return r.hostname;case"query":return r.search;case"hash":return r.hash}}catch(t){return(0,n.logDebug)("[ABsmartly] Failed to parse URL: ".concat(e),t),e}},e.matchesPatterns=function(e,t,r){var i=this;return void 0===r&&(r="simple"),e.some(function(e){if("regex"===r)try{return new RegExp(e).test(t)}catch(t){return(0,n.logDebug)("[ABsmartly] Invalid regex pattern: ".concat(e),t),!1}return i.matchSimplePattern(e,t)})},e.matchSimplePattern=function(e,t){var r=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*").replace(/\?/g,".");try{return new RegExp("^".concat(r,"$")).test(t)}catch(t){return(0,n.logDebug)("[ABsmartly] Invalid pattern: ".concat(e),t),!1}},e.normalizeFilter=function(e){return"string"==typeof e?{include:[e],exclude:[],mode:"simple",matchType:"path"}:Array.isArray(e)?{include:e.length>0?e:void 0,exclude:[],mode:"simple",matchType:"path"}:{include:e.include,exclude:e.exclude||[],mode:e.mode||"simple",matchType:e.matchType||"path"}},e}();t.URLMatcher=i},977:function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=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])},n(e,t)},function(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}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OverridesPluginFull=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(248).OverridesPlugin);t.OverridesPluginFull=o}},t={},function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}(196);var e,t});