New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@abtasty/widget-utils

Package Overview
Dependencies
Maintainers
24
Versions
215
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abtasty/widget-utils - npm Package Compare versions

Comparing version 1.12.8-1 to 1.12.8-2

2

dist/widget-utils.cjs.js

@@ -1,1 +0,1 @@

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var _defineProperty=_interopDefault(require("@babel/runtime/helpers/defineProperty")),_toConsumableArray=_interopDefault(require("@babel/runtime/helpers/toConsumableArray")),_classCallCheck=_interopDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass=_interopDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn=_interopDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf=_interopDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits=_interopDefault(require("@babel/runtime/helpers/inherits")),_regeneratorRuntime=_interopDefault(require("@babel/runtime/regenerator")),_asyncToGenerator=_interopDefault(require("@babel/runtime/helpers/asyncToGenerator")),_typeof=_interopDefault(require("@babel/runtime/helpers/typeof")),_objectWithoutProperties=_interopDefault(require("@babel/runtime/helpers/objectWithoutProperties")),backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},borderWidthTranslations={en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},paddingTranslations={en:"Padding",fr:"Padding",es:"Padding",de:"Padding"},horizontalPaddingTranslations={en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},verticalPaddingTranslations={en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},marginTranslations={en:"Margin",fr:"Marges",es:"Márgenes",de:"Spanne"},horiziontalMarginTranslations={en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},verticalMarginTranslations={en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},buttonsStylesTranslations={en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},buttonsContrastTranslations={en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},buttonsShapeTranslations={en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},buttonsBackgroundColorTranslations={en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},buttonsTextColorTranslations={en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},buttonsBorderColorTranslations={en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},buttonsBorderWidthTranslations={en:"Buttons border thickness",fr:"Épaisseur du contour des boutons",es:"Grosor del contorno de los botones",de:"Stärke des Umrisses der Schaltflächen"},buttonsBorderRadiusTranslations={en:"Buttons border radius",fr:"Arrondi de la bordure des boutons",es:"Redondeo del borde de los botones",de:"Konturradius der Buttons"},buttonTextTranslations={en:"Button text",fr:"Texte du bouton",es:"Texto del botón",de:"Button-Text"},autoHideAfterUserValidationTranslations={en:"Auto hide after user validation",fr:"Masquer automatiquement après la validation",es:"Ocultar automáticamente tras la validación",de:"Nach der Freigabe automatisch ausblenden"},hideAfterSecondsTranslations={en:"Hide after x seconds",fr:"Masquer après x secondes",es:"Ocultar tras x segundos",de:"Nach X Sekunden ausblenden"},fieldStylesTranslations={en:"Field style",fr:"Style du champ",es:"Estilo del campo",de:"Input-Styles"},questionTranslations={en:"Question",fr:"Question",es:"Pregunta",de:"Frage"},thanksTranslations={en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},customCssTranslations={en:"Custom CSS",fr:"CSS Personnalisé",es:"CSS personalizado",de:"Custom CSS"},notesTranslations={en:"Notes",fr:"Notes",es:"Notas",de:"Notiz"},selectLayoutTranslations={en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},popinTranslations={en:"Modal",fr:"Pop-in",es:"Pop-in",de:"Pop-in"},bannerTranslations={en:"Banner",fr:"Bannière",es:"Banner",de:"Banner"},inThePageTranslations={en:"In the page",fr:"Dans la page",es:"En la pagina",de:"In der Seite"},freePlacementTransitions={en:"Free placement",fr:"Placement libre",es:"Integrado",de:"Freie Platzierung "},adjustLayoutTranslations={en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},selectReferenceElementTranslations={en:"Select a reference element",fr:"Sélectionnez un élément de référence",es:"Seleccionar un elemento de referencia",de:"Wählen Sie ein Referenzelement"},relativePositionToElementTranslations={en:"Position in relation to the element",fr:"Position par rapport à l'élément",es:"Posición respecto al elemento",de:"Position relativ zum Element"},containerTranslations={en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},overlayOpacityTranslations={en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"},overlayColorTranslations={en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"},positionTranslations={en:"Position",fr:"Position",es:"Posición",de:"Position"},topTranslations={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},atTheTopTranslation={en:"At the top",fr:"En haut",es:"Arriba",de:"Oben"},bottomTranslations={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},atTheBottomTranslations={en:"At the bottom",fr:"En bas",es:"Abajo",de:"Unten"},leftTranslations={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},atTheLeftTranslations={en:"At the left",fr:"À gauche",es:"A la izquierda",de:"Reihe"},rightTranslations={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},atTheRightTranslations={en:"At the right",fr:"À droite",es:"Derecha",de:"Recht"},aboveTranslations={en:"Above",fr:"Au-dessus",es:"Arriba",de:"Spalte"},beforeTranslations={en:"Before",fr:"Avant",es:"Antes",de:"Vor"},atTheStartTranslations={en:"At the start",fr:"Au début",es:"Al principio",de:"Am Anfang"},atTheEndTranslations={en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},afterTranslations={en:"After",fr:"Après",es:"Después",de:"Hinter"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de visualización"),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," tras el cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," tras la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},dropShadowTranslations={en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},shadowOpacityTranslations={en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},textPositionTranslations={en:"Text position",fr:"Positionnement du contenu",es:"Posición del texto",de:"Ausrichtung des Inhalts"},themeTranslations={en:"Theme",fr:"Thème",es:"Tema",de:"Typ"},selectTheThemeTranslations={en:"Select an appearance",fr:"Sélectionner une apparence",es:"Seleccionar una apariencia",de:"Thema auswählen"},lightTranslations={en:"Light",fr:"Clair",es:"Claro",de:"Hell"},darkTranslations={en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},pageLoadTranslations={en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},clickTranslations={en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},delayTranslations={en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Au réengagement (après inactivité)",es:"En la reactivación (tras un periodo de inactividad)",de:"Nach Inaktivität"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},delayAfterExitIntentTranslations={en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},idleTimeoutBeforePostingTraslations={en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},triggerEventDelayTranslations={en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"Retraso antes de publicar",de:"Verzögerung vor dem Posten"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",WYSIWYG="wysiwyg",HIDDEN="hidden",ABTASTY_IMAGES_ROUTE="https://widgets-images.abtasty.com/",TAG_RESET_EVENT="abtasty_resetActionTracking",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}];function ownKeys(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:delayAfterExitIntentTranslations,min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:idleTimeoutBeforePostingTraslations,min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:triggerEventDelayTranslations,value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},_global=function(e){return e.ABTasty||Object.assign(e,{ABTasty:{widgetutils:{}}}),e.ABTasty.widgetutils||Object.assign(e.ABTasty,{widgetutils:{}}),e}("undefined"!=typeof global?global:window),_widgetutils=_global.ABTasty.widgetutils;function addGlobalUtil(e,t){return _widgetutils.hasOwnProperty(e)||Object.assign(_widgetutils,_defineProperty({},e,new t)),_widgetutils[e]}function syncRequest(e,t){var n=new XMLHttpRequest;return n.open(e,t,!1),n.send(null),n}function asyncRequest(e,t){return new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e,t,!0),o.onload=function(){this.status>=200&&this.status<300?n(o.response):r({status:this.status,statusText:o.statusText})},o.onerror=function(){r({status:this.status,statusText:o.statusText})},o.send()})}function loadJS(e){return new Promise(function(t,n){var r=window.document.getElementsByTagName("script")[0],o=window.document.createElement("script");o.src=e,r.parentNode.insertBefore(o,r),o.onload=t,o.onerror=n})}function findParent(e,t){return t(e)||!e.parentElement?e:findParent(e.parentElement,t)}var getWidgetName=function(){return"".concat(PACKAGE.replace("@abtasty/","")).concat(DATA&&DATA.type?"_".concat(DATA.type):"")},getUniqueId=function(){return"".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID)},getRecurrenceParams=function(){if(isOnEditor())return!1;var e=DATA;return{displayRecurrence:e.displayRecurrence,closingRecurrence:e.closingRecurrence,validationRecurrence:e.validationRecurrence}},getTriggerParams=function(){if(isOnEditor())return!1;var e,t=DATA,n=t.triggerEvent,r=t.triggerEventClick,o=t.triggerEventExitDelay,a=t.triggerEventDelay,s=t.triggerEventReengageDelay,i=r;switch(n){case"exitIntent":e=o;break;case"delay":e=a;break;case"reengage":e=s;break;default:e=0}return{triggerEvent:n,triggerSelector:i,triggerDelay:e}},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"},WidgetContainer=function(){function e(){_classCallCheck(this,e),this.uniqueId=getUniqueId(),this.widgetName=getWidgetName(),this.recurrenceParams=getRecurrenceParams(),this.triggerParams=getTriggerParams(),this.recurrence=!!this.recurrenceParams&&new Recurrence(this.recurrenceParams),this.trigger=!!this.triggerParams&&new Trigger(this.triggerParams),this.basicClassName="ab_widget_container_".concat(this.widgetName),this.widgetContainerId="".concat(this.basicClassName,"_").concat(this.uniqueId),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(this.uniqueId),this.domElement=this.getDom()}return _createClass(e,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement("body",function(t){return t.appendChild(e.domElement)},function(e){return console.error(e)}),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this}},{key:"hide",value:function(){return this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.recurrence||this.recurrence.isOver()){e.next=2;break}return e.abrupt("return",!1);case 2:if(e.t0=isOnEditor(),e.t0){e.next=10;break}if(e.t1=this.trigger,!e.t1){e.next=9;break}return e.next=8,this.trigger.isTriggered();case 8:e.t1=e.sent;case 9:e.t0=e.t1;case 10:if(e.t0){e.next=13;break}return e.abrupt("return",!1);case 13:return this.insert(),this.addCloseEvent(),e.abrupt("return",this);case 16:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"addCloseEvent",value:function(){for(var e=this,t=this.domElement.querySelectorAll("\n\t\t\t.".concat(this.overlayClassName,",\n\t\t\t.").concat(this.closeButtonClassName,"\n\t\t")),n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return r.push.apply(r,_toConsumableArray(t)),r.forEach(function(t){t.addEventListener("click",function(){e.recurrence&&e.recurrence.setClosingRecurrence(),e.hide()},{passive:!0,once:!0})}),this}},{key:"getDom",value:function(){var e=document.createElement("div");return e.className="".concat(this.basicClassName," ").concat(this.hideClassName),e.id=this.widgetContainerId,e.innerHTML='\n\t\t\t<div class="'.concat(this.overlayClassName,'"></div>\n\t\t\t<div class="').concat(this.contentClassName,'">\n\t\t\t\t<button class="').concat(this.closeButtonClassName,'" ').concat(isOnEditor()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),e}},{key:"getStyleTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("style");return t.type="text/css",isOnEditor()&&t.setAttribute("abtasty-script-added","true"),t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),Popin=function(e){function t(){var e;return _classCallCheck(this,t),(e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).stringStyles=e.getStyles(),e.styleElement=e.getStyleTag(e.stringStyles),e}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tposition: absolute;\n\t\t\tz-index: -1;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground-color: black;\n\t\t\topacity: 0.6;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.contentClassName," {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttop: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}\n\t\t\n\t\t@media screen and (max-width: 550px) and (orientation: portrait) {\n\t\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\t\tfont-size: 6vmin;\n\t\t\t}\n\t\t}")}}]),t}(),Banner=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,n.stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\t").concat(this.position,": 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}(),Free=function(e){function t(e,n){var r;return _classCallCheck(this,t),(r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,r.referrerElement=n,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return _inherits(t,WidgetContainer),_createClass(t,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement(this.referrerElement,function(t){return t.insertAdjacentElement(e.position,e.domElement)},function(e){return console.error(e)}),this}},{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tposition: relative;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}();function ownKeys$1(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var DISPLAY="display",CLOSING="closing",VALIDATION="validation",WIDGETS_STORAGE="ABTastyWidgets",Recurrence=function(){function e(t){var n=t.displayRecurrence,r=t.closingRecurrence,o=t.validationRecurrence;_classCallCheck(this,e),this.displayRecurrence=parseFloat(n),this.closingRecurrence=parseFloat(r),this.validationRecurrence=parseFloat(o),this.widgetName=getWidgetName(),this.uniqueId=getUniqueId(),this.recurrenceKey="".concat(this.widgetName,"_").concat(this.uniqueId)}return _createClass(e,[{key:"getGivenRecurrenceStorageParsed",value:function(e){try{var t=e.getItem(WIDGETS_STORAGE);return JSON.parse(t)}catch(t){return e.removeItem(WIDGETS_STORAGE),!1}}},{key:"getSessionRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}},{key:"getLocalRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}},{key:"removeGivenStorage",value:function(e,t){var n=this.recurrenceKey,r=(t[n],_objectWithoutProperties(t,[n].map(_toPropertyKey)));return Object.entries(r).length?(e.setItem(WIDGETS_STORAGE,JSON.stringify(r)),r):(e.removeItem(WIDGETS_STORAGE),!1)}},{key:"removeSessionRecurrenceStorage",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}},{key:"removeLocalRecurrenceStorage",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}},{key:"getSessionRecurrence",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getLocalRecurrence",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getCurrentRecurrence",value:function(){var e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}},{key:"isOver",value:function(){var e=this.getLocalRecurrence(),t=(e?parseFloat(e.stamp):0)<(new Date).getTime();return t&&this.removeLocalRecurrenceStorage(),t&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(e,t){var n=this,r=this.getTypeOfStorage(e);if(!r&&"object"!==_typeof(r))return!1;var o=this.getTypeOfStorage(e),a=o.storageString,s=o.storageMethod,i=this.getStamp(e),l={type:t,stamp:i},c=this.getCurrentRecurrence().type,u=function(){var e,t=n.getSessionRecurrence(),r=n.getLocalRecurrence();"session"===a?t?e=n.removeSessionRecurrenceStorage():(n.removeLocalRecurrenceStorage(),e=n.getSessionRecurrenceStorageParsed()):"local"===a&&(r?e=n.removeLocalRecurrenceStorage():(n.removeSessionRecurrenceStorage(),e=n.getLocalRecurrenceStorageParsed()));var o=e?_objectSpread$1(_defineProperty({},n.recurrenceKey,l),e):_defineProperty({},n.recurrenceKey,l);s.setItem(WIDGETS_STORAGE,JSON.stringify(o))};if(!s)return!1;if(c&&t!==VALIDATION)if(t===CLOSING&&c!==VALIDATION)u();else{if(t!==DISPLAY||c===VALIDATION||c===CLOSING)return!1;u()}else u();return i}},{key:"setDisplayRecurrence",value:function(){var e=DISPLAY;this.setRecurrence(this.displayRecurrence,e)}},{key:"setClosingRecurrence",value:function(){var e=CLOSING;this.setRecurrence(this.closingRecurrence,e)}},{key:"setValidationRecurrence",value:function(){var e=VALIDATION;this.setRecurrence(this.validationRecurrence,e)}},{key:"getStamp",value:function(e){return(new Date).getTime()+864e5*e}},{key:"getTypeOfStorage",value:function(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}]),e}();function addIntersectionPolyfill(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||loadJS("https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver")}function addPolyfill(e){return _addPolyfill.apply(this,arguments)}function _addPolyfill(){return(_addPolyfill=_asyncToGenerator(_regeneratorRuntime.mark(function e(t){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="IntersectionObserver"===e.t0?3:6;break;case 3:return e.next=5,addIntersectionPolyfill();case 5:return e.abrupt("return",e.sent);case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var originalBodyScroll,VisibilityObserver=function(){function e(){_classCallCheck(this,e),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return _createClass(e,[{key:"intersectionHandler",value:function(e){var t=this;e.forEach(function(e){e.isIntersecting?(t.existingTargets=t.existingTargets.filter(function(n){return n.element!==e.target||(t.inViewPortTargets.push(n),!1)}),t.checkElements()):t.inViewPortTargets=t.inViewPortTargets.filter(function(n){return n.element!==e.target||(t.existingTargets.push(n),!1)})})}},{key:"startVisibilityObserver",value:function(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:.5})}},{key:"startMutationObserver",value:function(){var e=new MutationObserver(this.checkElements.bind(this));return e.observe(document,{attributes:!0,childList:!0,subtree:!0}),e}},{key:"isElementVisible",value:function(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}},{key:"isElementOpaque",value:function(e){return"HTML"===findParent(e,function(e){return"0"===window.getComputedStyle(e).opacity}).nodeName}},{key:"isElementTopmost",value:function(e){for(var t=e.getBoundingClientRect(),n=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom]],r=!1,o=0;!r&&o<n.length;){var a,s=(a=document).elementFromPoint.apply(a,_toConsumableArray(n[o]));r=e===s||e.contains(s),o++}return r}},{key:"checkElements",value:function(){var e=this;this.targets=this.targets.filter(function(t){var n=document.querySelector(t.selector);return!n||(e.existingTargets.push(Object.assign(t,{element:n})),e.visibilityobserver.observe(n),!1)}),this.existingTargets=this.existingTargets.filter(function(t){return!!document.querySelector(t.selector)||(e.visibilityobserver.unobserve(t.element),e.targets.push(t),!1)}),this.inViewPortTargets=this.inViewPortTargets.filter(function(t){var n=t.element,r=t.resolve;return!e.isElementVisible(n)||(e.visibilityobserver.unobserve(n),r(n),!1)})}},{key:"watch",value:function(e,t){this.targets.push({selector:e,resolve:t})}}]),e}(),Trigger=function(){function e(t){var n=t.triggerEvent,r=t.triggerSelector,o=t.triggerDelay;_classCallCheck(this,e),this.event=n,this.selector=r&&r.length?r:"body",this.delay=o}return _createClass(e,[{key:"onElementVisible",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r,o,a;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onPageLoad();case 2:return r=t.sent,t.next=5,addPolyfill();case 5:o=t.sent,a=addGlobalUtil("VisibilityObserver",VisibilityObserver),o&&r&&a.watch(e.selector,n);case 8:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onPageLoad",value:function(){return new Promise(function(e,t){var n=function(){return"complete"===document.readyState};if(n())return e(!0);var r,o=setTimeout(function(){var e;return(e=document).removeEventListener.apply(e,a),t(!1)},15e3),a=["readystatechange",function(){return n()&&!clearTimeout(o)&&e(!0)},{passive:!0}];(r=document).addEventListener.apply(r,a)})}},{key:"onClick",value:function(){var e=this,t=document.createElement("style");return t.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(t),new Promise(function(n){var r,o=function(t){return _toConsumableArray(document.querySelectorAll(e.selector)).some(function(n){return n.isSameNode(t)||!!t.closest(e.selector)})},a=["click",function(e){var r,s=e.target;return!!o(s)&&(document.head.removeChild(t),(r=document).removeEventListener.apply(r,a),n(!0))},{passive:!0,capture:!0}];(r=document).addEventListener.apply(r,a)})}},{key:"onExitIntent",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=["mouseleave",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.delay){t.next=5;break}r=1e3*e.delay,setTimeout(function(){return n(!0)},r),t.next=6;break;case 5:return t.abrupt("return",n(!0));case 6:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),{passive:!0,once:!0}],t.next=4,e.onPageLoad();case 4:t.sent&&waitForElement("body",function(e){return e.addEventListener.apply(e,r)});case 6:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onDelay",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=1e3*e.delay,t.next=3,e.onPageLoad();case 3:t.sent&&setTimeout(function(){return n(!0)},r);case 5:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onReengage",value:function(){var e=this;return new Promise(function(t){var n=1e3*e.delay,r=n,o=["click","mousemove","scroll","keypress"],a=[function(){return r=n},{passive:!0}];o.forEach(function(e){var t;return(t=document).addEventListener.apply(t,[e].concat(a))});var s=setInterval(function(){r<=0?(t(!0),clearInterval(s),o.forEach(function(e){var t;return(t=document).removeEventListener.apply(t,[e].concat(a))})):r-=100},100)})}},{key:"isTriggered",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){var t;return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.event,e.next="pageLoad"===e.t0?3:"click"===e.t0?7:"exitIntent"===e.t0?11:"delay"===e.t0?15:"reengage"===e.t0?19:"elementVisible"===e.t0?23:27;break;case 3:return e.next=5,this.onPageLoad();case 5:return t=e.sent,e.abrupt("break",28);case 7:return e.next=9,this.onClick();case 9:return t=e.sent,e.abrupt("break",28);case 11:return e.next=13,this.onExitIntent();case 13:return t=e.sent,e.abrupt("break",28);case 15:return e.next=17,this.onDelay();case 17:return t=e.sent,e.abrupt("break",28);case 19:return e.next=21,this.onReengage();case 21:return t=e.sent,e.abrupt("break",28);case 23:return e.next=25,this.onElementVisible();case 25:return t=e.sent,e.abrupt("break",28);case 27:t=!1;case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}();function preventGlobalScroll(){waitForElement("body",function(e){originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"},function(e){return console.error(e)})}function allowGlobalScroll(){waitForElement("body",function(e){originalBodyScroll&&(e.style.overflowY=originalBodyScroll)},function(e){return console.error(e)})}var loadImage=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.src=e,r.onerror=function(t){var r=new Error("Image ".concat(e," is not loaded."));n(r)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var t,n=0;document.addEventListener("mousemove",function(e){n=e.clientY}),document.body.addEventListener("mouseleave",function r(o){o.clientY<=50&&(n=0,clearInterval(t),t=setTimeout(function(){0===n&&(e(),document.removeEventListener("mouseleave",r))},0))},!1)},log=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,n)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,n){var r,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return log(a),"function"==typeof n&&n(a)}r=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return log(t),"function"==typeof n&&n(t)},1e4),o=setInterval(function(){var n=document.querySelector(e);if(null!==n)return clearTimeout(r),clearInterval(o),"function"==typeof t&&t(n)},200)},getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,t,n){var r="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="expires="+o.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+t+"; "+r+";"+a+";path=/"},getAccountIdentifier=function(){if(window.ABTasty||window.ABTASTY_S)return window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings?window.ABTasty.accountSettings.identifier:void 0},getVisitorId=function(){return window.ABTasty&&window.ABTasty.visitor?window.ABTasty.visitor.id:void 0};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.loadImage=loadImage,exports.isTouch=isTouch,exports.exitIntent=exitIntent,exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie,exports.getAccountIdentifier=getAccountIdentifier,exports.getVisitorId=getVisitorId,exports.closingRecurrenceForm=closingRecurrenceForm,exports.displayRecurrenceForm=displayRecurrenceForm,exports.validationRecurrenceForm=validationRecurrenceForm,exports.recurrencesGroup=recurrencesGroup,exports.triggersForm=triggersForm,exports.triggersGroup=triggersGroup,exports.isOnEditor=isOnEditor,exports.addGlobalUtil=addGlobalUtil,exports.syncRequest=syncRequest,exports.asyncRequest=asyncRequest,exports.loadJS=loadJS,exports.findParent=findParent,exports.getWidgetName=getWidgetName,exports.getUniqueId=getUniqueId,exports.getRecurrenceParams=getRecurrenceParams,exports.getTriggerParams=getTriggerParams,exports.backgroundColorForm=backgroundColorForm,exports.backgroundImageForm=backgroundImageForm,exports.backgroundOpacityForm=backgroundOpacityForm,exports.backgroundsGroup=backgroundsGroup,exports.borderColorForm=borderColorForm,exports.borderRadiusForm=borderRadiusForm,exports.borderWidthForm=borderWidthForm,exports.bordersGroup=bordersGroup,exports.textColorForm=textColorForm,exports.Popin=Popin,exports.Banner=Banner,exports.Free=Free,exports.WidgetContainer=WidgetContainer,exports.Recurrence=Recurrence,exports.Trigger=Trigger,exports.backgroundTranslations=backgroundTranslations,exports.backgroundColorTranslations=backgroundColorTranslations,exports.backgroundImageTranslations=backgroundImageTranslations,exports.backgroundOpacityTranslations=backgroundOpacityTranslations,exports.borderTranslations=borderTranslations,exports.borderColorTranslations=borderColorTranslations,exports.borderRadiusTranslations=borderRadiusTranslations,exports.borderWidthTranslations=borderWidthTranslations,exports.paddingTranslations=paddingTranslations,exports.horizontalPaddingTranslations=horizontalPaddingTranslations,exports.verticalPaddingTranslations=verticalPaddingTranslations,exports.marginTranslations=marginTranslations,exports.horiziontalMarginTranslations=horiziontalMarginTranslations,exports.verticalMarginTranslations=verticalMarginTranslations,exports.buttonsStylesTranslations=buttonsStylesTranslations,exports.buttonsContrastTranslations=buttonsContrastTranslations,exports.buttonsShapeTranslations=buttonsShapeTranslations,exports.buttonsBackgroundColorTranslations=buttonsBackgroundColorTranslations,exports.buttonsTextColorTranslations=buttonsTextColorTranslations,exports.buttonsBorderColorTranslations=buttonsBorderColorTranslations,exports.buttonsBorderWidthTranslations=buttonsBorderWidthTranslations,exports.buttonsBorderRadiusTranslations=buttonsBorderRadiusTranslations,exports.buttonTextTranslations=buttonTextTranslations,exports.autoHideAfterUserValidationTranslations=autoHideAfterUserValidationTranslations,exports.hideAfterSecondsTranslations=hideAfterSecondsTranslations,exports.fieldStylesTranslations=fieldStylesTranslations,exports.questionTranslations=questionTranslations,exports.thanksTranslations=thanksTranslations,exports.customCssTranslations=customCssTranslations,exports.notesTranslations=notesTranslations,exports.selectLayoutTranslations=selectLayoutTranslations,exports.popinTranslations=popinTranslations,exports.bannerTranslations=bannerTranslations,exports.inThePageTranslations=inThePageTranslations,exports.freePlacementTransitions=freePlacementTransitions,exports.adjustLayoutTranslations=adjustLayoutTranslations,exports.selectReferenceElementTranslations=selectReferenceElementTranslations,exports.relativePositionToElementTranslations=relativePositionToElementTranslations,exports.containerTranslations=containerTranslations,exports.overlayOpacityTranslations=overlayOpacityTranslations,exports.overlayColorTranslations=overlayColorTranslations,exports.positionTranslations=positionTranslations,exports.topTranslations=topTranslations,exports.atTheTopTranslation=atTheTopTranslation,exports.bottomTranslations=bottomTranslations,exports.atTheBottomTranslations=atTheBottomTranslations,exports.leftTranslations=leftTranslations,exports.atTheLeftTranslations=atTheLeftTranslations,exports.rightTranslations=rightTranslations,exports.atTheRightTranslations=atTheRightTranslations,exports.aboveTranslations=aboveTranslations,exports.beforeTranslations=beforeTranslations,exports.atTheStartTranslations=atTheStartTranslations,exports.atTheEndTranslations=atTheEndTranslations,exports.afterTranslations=afterTranslations,exports.everydayTranslations=everydayTranslations,exports.everyWeekTranslations=everyWeekTranslations,exports.everyMonthTranslations=everyMonthTranslations,exports.everySessionTranslations=everySessionTranslations,exports.everytimeTranslations=everytimeTranslations,exports.oncePerUserTranslations=oncePerUserTranslations,exports.recurrenceTranslations=recurrenceTranslations,exports.displayRecurrenceTranslations=displayRecurrenceTranslations,exports.closingRecurrenceTranslations=closingRecurrenceTranslations,exports.validationRecurrenceTranslations=validationRecurrenceTranslations,exports.dropShadowTranslations=dropShadowTranslations,exports.shadowOpacityTranslations=shadowOpacityTranslations,exports.textColorTranslations=textColorTranslations,exports.closeButtonColorTranslations=closeButtonColorTranslations,exports.textPositionTranslations=textPositionTranslations,exports.themeTranslations=themeTranslations,exports.selectTheThemeTranslations=selectTheThemeTranslations,exports.lightTranslations=lightTranslations,exports.darkTranslations=darkTranslations,exports.pageLoadTranslations=pageLoadTranslations,exports.clickTranslations=clickTranslations,exports.exitIntentTranslations=exitIntentTranslations,exports.delayTranslations=delayTranslations,exports.reengageInactivityTranslations=reengageInactivityTranslations,exports.triggerOnTranslations=triggerOnTranslations,exports.triggerTranslations=triggerTranslations,exports.delayAfterExitIntentTranslations=delayAfterExitIntentTranslations,exports.idleTimeoutBeforePostingTraslations=idleTimeoutBeforePostingTraslations,exports.triggerEventDelayTranslations=triggerEventDelayTranslations,exports.STYLE=STYLE,exports.LAYOUT=LAYOUT,exports.CONTENT=CONTENT,exports.CONDITIONS=CONDITIONS,exports.GROUP=GROUP,exports.CHECKBOX=CHECKBOX,exports.COLOR_PICKER=COLOR_PICKER,exports.SEPARATOR=SEPARATOR,exports.DATE_PICKER=DATE_PICKER,exports.DATE_RANGE_PICKER=DATE_RANGE_PICKER,exports.SELECT=SELECT,exports.MEDIA_UPLOAD=MEDIA_UPLOAD,exports.NUMBER=NUMBER,exports.RADIO_BUTTON=RADIO_BUTTON,exports.RADIO_IMAGE=RADIO_IMAGE,exports.SLIDER=SLIDER,exports.SWITCH=SWITCH,exports.TEXT_FIELD=TEXT_FIELD,exports.TEXT_AREA=TEXT_AREA,exports.TIME_PICKER=TIME_PICKER,exports.SELECT_ELEMENT=SELECT_ELEMENT,exports.WYSIWYG=WYSIWYG,exports.HIDDEN=HIDDEN,exports.ABTASTY_IMAGES_ROUTE=ABTASTY_IMAGES_ROUTE,exports.TAG_RESET_EVENT=TAG_RESET_EVENT;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var _defineProperty=_interopDefault(require("@babel/runtime/helpers/defineProperty")),_toConsumableArray=_interopDefault(require("@babel/runtime/helpers/toConsumableArray")),_classCallCheck=_interopDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass=_interopDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn=_interopDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf=_interopDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits=_interopDefault(require("@babel/runtime/helpers/inherits")),_regeneratorRuntime=_interopDefault(require("@babel/runtime/regenerator")),_asyncToGenerator=_interopDefault(require("@babel/runtime/helpers/asyncToGenerator")),_typeof=_interopDefault(require("@babel/runtime/helpers/typeof")),_objectWithoutProperties=_interopDefault(require("@babel/runtime/helpers/objectWithoutProperties")),backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},borderWidthTranslations={en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},paddingTranslations={en:"Padding",fr:"Padding",es:"Padding",de:"Padding"},horizontalPaddingTranslations={en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},verticalPaddingTranslations={en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},marginTranslations={en:"Margin",fr:"Marges",es:"Márgenes",de:"Spanne"},horiziontalMarginTranslations={en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},verticalMarginTranslations={en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},buttonsStylesTranslations={en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},buttonsContrastTranslations={en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},buttonsShapeTranslations={en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},buttonsBackgroundColorTranslations={en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},buttonsTextColorTranslations={en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},buttonsBorderColorTranslations={en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},buttonsBorderWidthTranslations={en:"Buttons border thickness",fr:"Épaisseur du contour des boutons",es:"Grosor del contorno de los botones",de:"Stärke des Umrisses der Schaltflächen"},buttonsBorderRadiusTranslations={en:"Buttons border radius",fr:"Arrondi de la bordure des boutons",es:"Redondeo del borde de los botones",de:"Konturradius der Buttons"},buttonTextTranslations={en:"Button text",fr:"Texte du bouton",es:"Texto del botón",de:"Button-Text"},autoHideAfterUserValidationTranslations={en:"Auto hide after user validation",fr:"Masquer automatiquement après la validation",es:"Ocultar automáticamente tras la validación",de:"Nach der Freigabe automatisch ausblenden"},hideAfterSecondsTranslations={en:"Hide after x seconds",fr:"Masquer après x secondes",es:"Ocultar tras x segundos",de:"Nach X Sekunden ausblenden"},fieldStylesTranslations={en:"Field style",fr:"Style du champ",es:"Estilo del campo",de:"Input-Styles"},questionTranslations={en:"Question",fr:"Question",es:"Pregunta",de:"Frage"},thanksTranslations={en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},customCssTranslations={en:"Custom CSS",fr:"CSS Personnalisé",es:"CSS personalizado",de:"Custom CSS"},notesTranslations={en:"Notes",fr:"Notes",es:"Notas",de:"Notiz"},selectLayoutTranslations={en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},popinTranslations={en:"Modal",fr:"Pop-in",es:"Pop-in",de:"Pop-in"},bannerTranslations={en:"Banner",fr:"Bannière",es:"Banner",de:"Banner"},inThePageTranslations={en:"In the page",fr:"Dans la page",es:"En la pagina",de:"In der Seite"},freePlacementTransitions={en:"Free placement",fr:"Placement libre",es:"Integrado",de:"Freie Platzierung "},adjustLayoutTranslations={en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},selectReferenceElementTranslations={en:"Select a reference element",fr:"Sélectionnez un élément de référence",es:"Seleccionar un elemento de referencia",de:"Wählen Sie ein Referenzelement"},relativePositionToElementTranslations={en:"Position in relation to the element",fr:"Position par rapport à l'élément",es:"Posición respecto al elemento",de:"Position relativ zum Element"},containerTranslations={en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},overlayOpacityTranslations={en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"},overlayColorTranslations={en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"},positionTranslations={en:"Position",fr:"Position",es:"Posición",de:"Position"},topTranslations={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},atTheTopTranslation={en:"At the top",fr:"En haut",es:"Arriba",de:"Oben"},bottomTranslations={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},atTheBottomTranslations={en:"At the bottom",fr:"En bas",es:"Abajo",de:"Unten"},leftTranslations={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},atTheLeftTranslations={en:"At the left",fr:"À gauche",es:"A la izquierda",de:"Reihe"},rightTranslations={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},atTheRightTranslations={en:"At the right",fr:"À droite",es:"Derecha",de:"Recht"},aboveTranslations={en:"Above",fr:"Au-dessus",es:"Arriba",de:"Spalte"},beforeTranslations={en:"Before",fr:"Avant",es:"Antes",de:"Vor"},atTheStartTranslations={en:"At the start",fr:"Au début",es:"Al principio",de:"Am Anfang"},atTheEndTranslations={en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},afterTranslations={en:"After",fr:"Après",es:"Después",de:"Hinter"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de visualización"),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," tras el cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," tras la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},dropShadowTranslations={en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},shadowOpacityTranslations={en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},textPositionTranslations={en:"Text position",fr:"Positionnement du contenu",es:"Posición del texto",de:"Ausrichtung des Inhalts"},themeTranslations={en:"Theme",fr:"Thème",es:"Tema",de:"Typ"},selectTheThemeTranslations={en:"Select an appearance",fr:"Sélectionner une apparence",es:"Seleccionar una apariencia",de:"Thema auswählen"},lightTranslations={en:"Light",fr:"Clair",es:"Claro",de:"Hell"},darkTranslations={en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},pageLoadTranslations={en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},clickTranslations={en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},delayTranslations={en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Au réengagement (après inactivité)",es:"En la reactivación (tras un periodo de inactividad)",de:"Nach Inaktivität"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},delayAfterExitIntentTranslations={en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},idleTimeoutBeforePostingTraslations={en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},triggerEventDelayTranslations={en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"Retraso antes de publicar",de:"Verzögerung vor dem Posten"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",WYSIWYG="wysiwyg",HIDDEN="hidden",ABTASTY_IMAGES_ROUTE="https://widgets-images.abtasty.com/",TAG_RESET_EVENT="abtasty_resetActionTracking",REMOVE_WIDGET="remove",REBUILD_WIDGET="rebuild",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}];function ownKeys(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(r,!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:delayAfterExitIntentTranslations,min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:idleTimeoutBeforePostingTraslations,min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:triggerEventDelayTranslations,value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},_global=function(e){return e.ABTasty||Object.assign(e,{ABTasty:{widgetutils:{}}}),e.ABTasty.widgetutils||Object.assign(e.ABTasty,{widgetutils:{}}),e}("undefined"!=typeof global?global:window),_widgetutils=_global.ABTasty.widgetutils;function addGlobalUtil(e,t){return _widgetutils.hasOwnProperty(e)||Object.assign(_widgetutils,_defineProperty({},e,new t)),_widgetutils[e]}function syncRequest(e,t){var r=new XMLHttpRequest;return r.open(e,t,!1),r.send(null),r}function asyncRequest(e,t){return new Promise(function(r,n){var o=new XMLHttpRequest;o.open(e,t,!0),o.onload=function(){this.status>=200&&this.status<300?r(o.response):n({status:this.status,statusText:o.statusText})},o.onerror=function(){n({status:this.status,statusText:o.statusText})},o.send()})}function loadJS(e){return new Promise(function(t,r){var n=window.document.getElementsByTagName("script")[0],o=window.document.createElement("script");o.src=e,n.parentNode.insertBefore(o,n),o.onload=t,o.onerror=r})}function findParent(e,t){return t(e)||!e.parentElement?e:findParent(e.parentElement,t)}var getWidgetName=function(){return"".concat(PACKAGE.replace("@abtasty/","")).concat(DATA&&DATA.type?"_".concat(DATA.type):"")},getUniqueId=function(){return"".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID)},getRecurrenceParams=function(){if(isOnEditor())return!1;var e=DATA;return{displayRecurrence:e.displayRecurrence,closingRecurrence:e.closingRecurrence,validationRecurrence:e.validationRecurrence}},getTriggerParams=function(){if(isOnEditor())return!1;var e,t=DATA,r=t.triggerEvent,n=t.triggerEventClick,o=t.triggerEventExitDelay,a=t.triggerEventDelay,s=t.triggerEventReengageDelay,i=n;switch(r){case"exitIntent":e=o;break;case"delay":e=a;break;case"reengage":e=s;break;default:e=0}return{triggerEvent:r,triggerSelector:i,triggerDelay:e}},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"},WidgetContainer=function(){function e(){_classCallCheck(this,e),this.uniqueId=getUniqueId(),this.widgetName=getWidgetName(),this.recurrenceParams=getRecurrenceParams(),this.triggerParams=getTriggerParams(),this.recurrence=!!this.recurrenceParams&&new Recurrence(this.recurrenceParams),this.trigger=!!this.triggerParams&&new Trigger(this.triggerParams),this.basicClassName="ab_widget_container_".concat(this.widgetName),this.widgetContainerId="".concat(this.basicClassName,"_").concat(this.uniqueId),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(this.uniqueId),this.domElement=this.getDom()}return _createClass(e,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement("body",function(t){return t.appendChild(e.domElement)},function(e){return console.error(e)}),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this}},{key:"hide",value:function(){return this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.recurrence||this.recurrence.isOver()){e.next=2;break}return e.abrupt("return",!1);case 2:if(e.t0=isOnEditor(),e.t0){e.next=10;break}if(e.t1=this.trigger,!e.t1){e.next=9;break}return e.next=8,this.trigger.isTriggered();case 8:e.t1=e.sent;case 9:e.t0=e.t1;case 10:if(e.t0){e.next=13;break}return e.abrupt("return",!1);case 13:return this.insert(),this.addCloseEvent(),e.abrupt("return",this);case 16:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"addCloseEvent",value:function(){for(var e=this,t=this.domElement.querySelectorAll("\n\t\t\t.".concat(this.overlayClassName,",\n\t\t\t.").concat(this.closeButtonClassName,"\n\t\t")),r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.push.apply(n,_toConsumableArray(t)),n.forEach(function(t){t.addEventListener("click",function(){e.recurrence&&e.recurrence.setClosingRecurrence(),e.hide()},{passive:!0,once:!0})}),this}},{key:"getDom",value:function(){var e=document.createElement("div");return e.className="".concat(this.basicClassName," ").concat(this.hideClassName),e.id=this.widgetContainerId,e.innerHTML='\n\t\t\t<div class="'.concat(this.overlayClassName,'"></div>\n\t\t\t<div class="').concat(this.contentClassName,'">\n\t\t\t\t<button class="').concat(this.closeButtonClassName,'" ').concat(isOnEditor()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),e}},{key:"getStyleTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("style");return t.type="text/css",isOnEditor()&&t.setAttribute("abtasty-script-added","true"),t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),Popin=function(e){function t(){var e;return _classCallCheck(this,t),(e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).stringStyles=e.getStyles(),e.styleElement=e.getStyleTag(e.stringStyles),e}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tposition: absolute;\n\t\t\tz-index: -1;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground-color: black;\n\t\t\topacity: 0.6;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.contentClassName," {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttop: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}\n\t\t\n\t\t@media screen and (max-width: 550px) and (orientation: portrait) {\n\t\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\t\tfont-size: 6vmin;\n\t\t\t}\n\t\t}")}}]),t}(),Banner=function(e){function t(e){var r;return _classCallCheck(this,t),(r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\t").concat(this.position,": 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}(),Free=function(e){function t(e,r){var n;return _classCallCheck(this,t),(n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,n.referrerElement=r,n.stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}return _inherits(t,WidgetContainer),_createClass(t,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement(this.referrerElement,function(t){return t.insertAdjacentElement(e.position,e.domElement)},function(e){return console.error(e)}),this}},{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tposition: relative;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}();function ownKeys$1(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(r,!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys$1(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var DISPLAY="display",CLOSING="closing",VALIDATION="validation",WIDGETS_STORAGE="ABTastyWidgets",Recurrence=function(){function e(t){var r=t.displayRecurrence,n=t.closingRecurrence,o=t.validationRecurrence;_classCallCheck(this,e),this.displayRecurrence=parseFloat(r),this.closingRecurrence=parseFloat(n),this.validationRecurrence=parseFloat(o),this.widgetName=getWidgetName(),this.uniqueId=getUniqueId(),this.recurrenceKey="".concat(this.widgetName,"_").concat(this.uniqueId)}return _createClass(e,[{key:"getGivenRecurrenceStorageParsed",value:function(e){try{var t=e.getItem(WIDGETS_STORAGE);return JSON.parse(t)}catch(t){return e.removeItem(WIDGETS_STORAGE),!1}}},{key:"getSessionRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}},{key:"getLocalRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}},{key:"removeGivenStorage",value:function(e,t){var r=this.recurrenceKey,n=(t[r],_objectWithoutProperties(t,[r].map(_toPropertyKey)));return Object.entries(n).length?(e.setItem(WIDGETS_STORAGE,JSON.stringify(n)),n):(e.removeItem(WIDGETS_STORAGE),!1)}},{key:"removeSessionRecurrenceStorage",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}},{key:"removeLocalRecurrenceStorage",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}},{key:"getSessionRecurrence",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getLocalRecurrence",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getCurrentRecurrence",value:function(){var e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}},{key:"isOver",value:function(){var e=this.getLocalRecurrence(),t=(e?parseFloat(e.stamp):0)<(new Date).getTime();return t&&this.removeLocalRecurrenceStorage(),t&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(e,t){var r=this,n=this.getTypeOfStorage(e);if(!n&&"object"!==_typeof(n))return!1;var o=this.getTypeOfStorage(e),a=o.storageString,s=o.storageMethod,i=this.getStamp(e),l={type:t,stamp:i},c=this.getCurrentRecurrence().type,u=function(){var e,t=r.getSessionRecurrence(),n=r.getLocalRecurrence();"session"===a?t?e=r.removeSessionRecurrenceStorage():(r.removeLocalRecurrenceStorage(),e=r.getSessionRecurrenceStorageParsed()):"local"===a&&(n?e=r.removeLocalRecurrenceStorage():(r.removeSessionRecurrenceStorage(),e=r.getLocalRecurrenceStorageParsed()));var o=e?_objectSpread$1(_defineProperty({},r.recurrenceKey,l),e):_defineProperty({},r.recurrenceKey,l);s.setItem(WIDGETS_STORAGE,JSON.stringify(o))};if(!s)return!1;if(c&&t!==VALIDATION)if(t===CLOSING&&c!==VALIDATION)u();else{if(t!==DISPLAY||c===VALIDATION||c===CLOSING)return!1;u()}else u();return i}},{key:"setDisplayRecurrence",value:function(){var e=DISPLAY;this.setRecurrence(this.displayRecurrence,e)}},{key:"setClosingRecurrence",value:function(){var e=CLOSING;this.setRecurrence(this.closingRecurrence,e)}},{key:"setValidationRecurrence",value:function(){var e=VALIDATION;this.setRecurrence(this.validationRecurrence,e)}},{key:"getStamp",value:function(e){return(new Date).getTime()+864e5*e}},{key:"getTypeOfStorage",value:function(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}]),e}();function addIntersectionPolyfill(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||loadJS("https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver")}function addPolyfill(e){return _addPolyfill.apply(this,arguments)}function _addPolyfill(){return(_addPolyfill=_asyncToGenerator(_regeneratorRuntime.mark(function e(t){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="IntersectionObserver"===e.t0?3:6;break;case 3:return e.next=5,addIntersectionPolyfill();case 5:return e.abrupt("return",e.sent);case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var VisibilityObserver=function(){function e(){_classCallCheck(this,e),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return _createClass(e,[{key:"intersectionHandler",value:function(e){var t=this;e.forEach(function(e){e.isIntersecting?(t.existingTargets=t.existingTargets.filter(function(r){return r.element!==e.target||(t.inViewPortTargets.push(r),!1)}),t.checkElements()):t.inViewPortTargets=t.inViewPortTargets.filter(function(r){return r.element!==e.target||(t.existingTargets.push(r),!1)})})}},{key:"startVisibilityObserver",value:function(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:.5})}},{key:"startMutationObserver",value:function(){var e=new MutationObserver(this.checkElements.bind(this));return e.observe(document,{attributes:!0,childList:!0,subtree:!0}),e}},{key:"isElementVisible",value:function(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}},{key:"isElementOpaque",value:function(e){return"HTML"===findParent(e,function(e){return"0"===window.getComputedStyle(e).opacity}).nodeName}},{key:"isElementTopmost",value:function(e){for(var t=e.getBoundingClientRect(),r=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom]],n=!1,o=0;!n&&o<r.length;){var a,s=(a=document).elementFromPoint.apply(a,_toConsumableArray(r[o]));n=e===s||e.contains(s),o++}return n}},{key:"checkElements",value:function(){var e=this;this.targets=this.targets.filter(function(t){var r=document.querySelector(t.selector);return!r||(e.existingTargets.push(Object.assign(t,{element:r})),e.visibilityobserver.observe(r),!1)}),this.existingTargets=this.existingTargets.filter(function(t){return!!document.querySelector(t.selector)||(e.visibilityobserver.unobserve(t.element),e.targets.push(t),!1)}),this.inViewPortTargets=this.inViewPortTargets.filter(function(t){var r=t.element,n=t.resolve;return!e.isElementVisible(r)||(e.visibilityobserver.unobserve(r),n(r),!1)})}},{key:"watch",value:function(e,t){this.targets.push({selector:e,resolve:t})}}]),e}(),Trigger=function(){function e(t){var r=t.triggerEvent,n=t.triggerSelector,o=t.triggerDelay;_classCallCheck(this,e),this.event=r,this.selector=n&&n.length?n:"body",this.delay=o}return _createClass(e,[{key:"onElementVisible",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(r){var n,o,a;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onPageLoad();case 2:return n=t.sent,t.next=5,addPolyfill();case 5:o=t.sent,a=addGlobalUtil("VisibilityObserver",VisibilityObserver),o&&n&&a.watch(e.selector,r);case 8:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onPageLoad",value:function(){return new Promise(function(e,t){var r=function(){return"complete"===document.readyState};if(r())return e(!0);var n,o=setTimeout(function(){var e;return(e=document).removeEventListener.apply(e,a),t(!1)},15e3),a=["readystatechange",function(){return r()&&!clearTimeout(o)&&e(!0)},{passive:!0}];(n=document).addEventListener.apply(n,a)})}},{key:"onClick",value:function(){var e=this,t=document.createElement("style");return t.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(t),new Promise(function(r){var n,o=function(t){return _toConsumableArray(document.querySelectorAll(e.selector)).some(function(r){return r.isSameNode(t)||!!t.closest(e.selector)})},a=["click",function(e){var n,s=e.target;return!!o(s)&&(document.head.removeChild(t),(n=document).removeEventListener.apply(n,a),r(!0))},{passive:!0,capture:!0}];(n=document).addEventListener.apply(n,a)})}},{key:"onExitIntent",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(r){var n;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=["mouseleave",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(){var n;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.delay){t.next=5;break}n=1e3*e.delay,setTimeout(function(){return r(!0)},n),t.next=6;break;case 5:return t.abrupt("return",r(!0));case 6:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),{passive:!0,once:!0}],t.next=4,e.onPageLoad();case 4:t.sent&&waitForElement("body",function(e){return e.addEventListener.apply(e,n)});case 6:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onDelay",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(r){var n;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=1e3*e.delay,t.next=3,e.onPageLoad();case 3:t.sent&&setTimeout(function(){return r(!0)},n);case 5:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onReengage",value:function(){var e=this;return new Promise(function(t){var r=1e3*e.delay,n=r,o=["click","mousemove","scroll","keypress"],a=[function(){return n=r},{passive:!0}];o.forEach(function(e){var t;return(t=document).addEventListener.apply(t,[e].concat(a))});var s=setInterval(function(){n<=0?(t(!0),clearInterval(s),o.forEach(function(e){var t;return(t=document).removeEventListener.apply(t,[e].concat(a))})):n-=100},100)})}},{key:"isTriggered",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){var t;return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.event,e.next="pageLoad"===e.t0?3:"click"===e.t0?7:"exitIntent"===e.t0?11:"delay"===e.t0?15:"reengage"===e.t0?19:"elementVisible"===e.t0?23:27;break;case 3:return e.next=5,this.onPageLoad();case 5:return t=e.sent,e.abrupt("break",28);case 7:return e.next=9,this.onClick();case 9:return t=e.sent,e.abrupt("break",28);case 11:return e.next=13,this.onExitIntent();case 13:return t=e.sent,e.abrupt("break",28);case 15:return e.next=17,this.onDelay();case 17:return t=e.sent,e.abrupt("break",28);case 19:return e.next=21,this.onReengage();case 21:return t=e.sent,e.abrupt("break",28);case 23:return e.next=25,this.onElementVisible();case 25:return t=e.sent,e.abrupt("break",28);case 27:t=!1;case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}();function affected(){return!!window.ABTasty.getTestsOnPage()[TEST_ID]}var originalBodyScroll,PageWatcher=function(){function e(t,r,n){_classCallCheck(this,e),this.recurrence=t,this.isWidgetApplied=r,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.observerParams=[document.body,{childList:!0,subtree:!0}],this.eventListenerParams=[TAG_RESET_EVENT,this.eventHandler.bind(this),{passive:!0}]}return _createClass(e,[{key:"decisionHandler",value:function(){var e=affected();!this.isWidgetApplied()&&e&&this.recurrence.isOver()?(this.callback(REBUILD_WIDGET),this.clearWatcher()):!e&&this.isWidgetApplied()&&this.callback(REMOVE_WIDGET)}},{key:"eventHandler",value:function(){var e=this;return setTimeout(function(){e.decisionHandler()},250),this}},{key:"observerHandler",value:function(e){var t=e.some(function(e){var t=e.removedNodes;return t&&t.length}),r=e.some(function(e){var t=e.addedNodes;return t&&t.length});return t||r?(this.decisionHandler(),this):this}},{key:"watch",value:function(){var e,t;return(e=document).addEventListener.apply(e,_toConsumableArray(this.eventListenerParams)),(t=this.observer).observe.apply(t,_toConsumableArray(this.observerParams)),this}},{key:"clearWatcher",value:function(){var e;return(e=document).removeEventListener.apply(e,_toConsumableArray(this.eventListenerParams)),this.observer.disconnect(),this}}]),e}();function preventGlobalScroll(){waitForElement("body",function(e){originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"},function(e){return console.error(e)})}function allowGlobalScroll(){waitForElement("body",function(e){originalBodyScroll&&(e.style.overflowY=originalBodyScroll)},function(e){return console.error(e)})}var loadImage=function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){t(n)},n.src=e,n.onerror=function(t){var n=new Error("Image ".concat(e," is not loaded."));r(n)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var t,r=0;document.addEventListener("mousemove",function(e){r=e.clientY}),document.body.addEventListener("mouseleave",function n(o){o.clientY<=50&&(r=0,clearInterval(t),t=setTimeout(function(){0===r&&(e(),document.removeEventListener("mouseleave",n))},0))},!1)},log=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];r.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,r)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,r){var n,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return log(a),"function"==typeof r&&r(a)}n=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return log(t),"function"==typeof r&&r(t)},1e4),o=setInterval(function(){var r=document.querySelector(e);if(null!==r)return clearTimeout(n),clearInterval(o),"function"==typeof t&&t(r)},200)},getCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return o.substring(t.length,o.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,t,r){var n="";if(r){var o=new Date;o.setTime(o.getTime()+24*r*60*60*1e3),n="expires="+o.toUTCString()}var a="domain="+getHostname();document.cookie=e+"="+t+"; "+n+";"+a+";path=/"},getAccountIdentifier=function(){if(window.ABTasty||window.ABTASTY_S)return window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings?window.ABTasty.accountSettings.identifier:void 0},getVisitorId=function(){return window.ABTasty&&window.ABTasty.visitor?window.ABTasty.visitor.id:void 0};exports.preventGlobalScroll=preventGlobalScroll,exports.allowGlobalScroll=allowGlobalScroll,exports.loadImage=loadImage,exports.isTouch=isTouch,exports.exitIntent=exitIntent,exports.log=log,exports.domReady=domReady,exports.waitForElement=waitForElement,exports.getCookie=getCookie,exports.getHostname=getHostname,exports.setCookie=setCookie,exports.getAccountIdentifier=getAccountIdentifier,exports.getVisitorId=getVisitorId,exports.closingRecurrenceForm=closingRecurrenceForm,exports.displayRecurrenceForm=displayRecurrenceForm,exports.validationRecurrenceForm=validationRecurrenceForm,exports.recurrencesGroup=recurrencesGroup,exports.triggersForm=triggersForm,exports.triggersGroup=triggersGroup,exports.isOnEditor=isOnEditor,exports.addGlobalUtil=addGlobalUtil,exports.syncRequest=syncRequest,exports.asyncRequest=asyncRequest,exports.loadJS=loadJS,exports.findParent=findParent,exports.getWidgetName=getWidgetName,exports.getUniqueId=getUniqueId,exports.getRecurrenceParams=getRecurrenceParams,exports.getTriggerParams=getTriggerParams,exports.backgroundColorForm=backgroundColorForm,exports.backgroundImageForm=backgroundImageForm,exports.backgroundOpacityForm=backgroundOpacityForm,exports.backgroundsGroup=backgroundsGroup,exports.borderColorForm=borderColorForm,exports.borderRadiusForm=borderRadiusForm,exports.borderWidthForm=borderWidthForm,exports.bordersGroup=bordersGroup,exports.textColorForm=textColorForm,exports.Popin=Popin,exports.Banner=Banner,exports.Free=Free,exports.WidgetContainer=WidgetContainer,exports.Recurrence=Recurrence,exports.Trigger=Trigger,exports.PageWatcher=PageWatcher,exports.backgroundTranslations=backgroundTranslations,exports.backgroundColorTranslations=backgroundColorTranslations,exports.backgroundImageTranslations=backgroundImageTranslations,exports.backgroundOpacityTranslations=backgroundOpacityTranslations,exports.borderTranslations=borderTranslations,exports.borderColorTranslations=borderColorTranslations,exports.borderRadiusTranslations=borderRadiusTranslations,exports.borderWidthTranslations=borderWidthTranslations,exports.paddingTranslations=paddingTranslations,exports.horizontalPaddingTranslations=horizontalPaddingTranslations,exports.verticalPaddingTranslations=verticalPaddingTranslations,exports.marginTranslations=marginTranslations,exports.horiziontalMarginTranslations=horiziontalMarginTranslations,exports.verticalMarginTranslations=verticalMarginTranslations,exports.buttonsStylesTranslations=buttonsStylesTranslations,exports.buttonsContrastTranslations=buttonsContrastTranslations,exports.buttonsShapeTranslations=buttonsShapeTranslations,exports.buttonsBackgroundColorTranslations=buttonsBackgroundColorTranslations,exports.buttonsTextColorTranslations=buttonsTextColorTranslations,exports.buttonsBorderColorTranslations=buttonsBorderColorTranslations,exports.buttonsBorderWidthTranslations=buttonsBorderWidthTranslations,exports.buttonsBorderRadiusTranslations=buttonsBorderRadiusTranslations,exports.buttonTextTranslations=buttonTextTranslations,exports.autoHideAfterUserValidationTranslations=autoHideAfterUserValidationTranslations,exports.hideAfterSecondsTranslations=hideAfterSecondsTranslations,exports.fieldStylesTranslations=fieldStylesTranslations,exports.questionTranslations=questionTranslations,exports.thanksTranslations=thanksTranslations,exports.customCssTranslations=customCssTranslations,exports.notesTranslations=notesTranslations,exports.selectLayoutTranslations=selectLayoutTranslations,exports.popinTranslations=popinTranslations,exports.bannerTranslations=bannerTranslations,exports.inThePageTranslations=inThePageTranslations,exports.freePlacementTransitions=freePlacementTransitions,exports.adjustLayoutTranslations=adjustLayoutTranslations,exports.selectReferenceElementTranslations=selectReferenceElementTranslations,exports.relativePositionToElementTranslations=relativePositionToElementTranslations,exports.containerTranslations=containerTranslations,exports.overlayOpacityTranslations=overlayOpacityTranslations,exports.overlayColorTranslations=overlayColorTranslations,exports.positionTranslations=positionTranslations,exports.topTranslations=topTranslations,exports.atTheTopTranslation=atTheTopTranslation,exports.bottomTranslations=bottomTranslations,exports.atTheBottomTranslations=atTheBottomTranslations,exports.leftTranslations=leftTranslations,exports.atTheLeftTranslations=atTheLeftTranslations,exports.rightTranslations=rightTranslations,exports.atTheRightTranslations=atTheRightTranslations,exports.aboveTranslations=aboveTranslations,exports.beforeTranslations=beforeTranslations,exports.atTheStartTranslations=atTheStartTranslations,exports.atTheEndTranslations=atTheEndTranslations,exports.afterTranslations=afterTranslations,exports.everydayTranslations=everydayTranslations,exports.everyWeekTranslations=everyWeekTranslations,exports.everyMonthTranslations=everyMonthTranslations,exports.everySessionTranslations=everySessionTranslations,exports.everytimeTranslations=everytimeTranslations,exports.oncePerUserTranslations=oncePerUserTranslations,exports.recurrenceTranslations=recurrenceTranslations,exports.displayRecurrenceTranslations=displayRecurrenceTranslations,exports.closingRecurrenceTranslations=closingRecurrenceTranslations,exports.validationRecurrenceTranslations=validationRecurrenceTranslations,exports.dropShadowTranslations=dropShadowTranslations,exports.shadowOpacityTranslations=shadowOpacityTranslations,exports.textColorTranslations=textColorTranslations,exports.closeButtonColorTranslations=closeButtonColorTranslations,exports.textPositionTranslations=textPositionTranslations,exports.themeTranslations=themeTranslations,exports.selectTheThemeTranslations=selectTheThemeTranslations,exports.lightTranslations=lightTranslations,exports.darkTranslations=darkTranslations,exports.pageLoadTranslations=pageLoadTranslations,exports.clickTranslations=clickTranslations,exports.exitIntentTranslations=exitIntentTranslations,exports.delayTranslations=delayTranslations,exports.reengageInactivityTranslations=reengageInactivityTranslations,exports.triggerOnTranslations=triggerOnTranslations,exports.triggerTranslations=triggerTranslations,exports.delayAfterExitIntentTranslations=delayAfterExitIntentTranslations,exports.idleTimeoutBeforePostingTraslations=idleTimeoutBeforePostingTraslations,exports.triggerEventDelayTranslations=triggerEventDelayTranslations,exports.STYLE=STYLE,exports.LAYOUT=LAYOUT,exports.CONTENT=CONTENT,exports.CONDITIONS=CONDITIONS,exports.GROUP=GROUP,exports.CHECKBOX=CHECKBOX,exports.COLOR_PICKER=COLOR_PICKER,exports.SEPARATOR=SEPARATOR,exports.DATE_PICKER=DATE_PICKER,exports.DATE_RANGE_PICKER=DATE_RANGE_PICKER,exports.SELECT=SELECT,exports.MEDIA_UPLOAD=MEDIA_UPLOAD,exports.NUMBER=NUMBER,exports.RADIO_BUTTON=RADIO_BUTTON,exports.RADIO_IMAGE=RADIO_IMAGE,exports.SLIDER=SLIDER,exports.SWITCH=SWITCH,exports.TEXT_FIELD=TEXT_FIELD,exports.TEXT_AREA=TEXT_AREA,exports.TIME_PICKER=TIME_PICKER,exports.SELECT_ELEMENT=SELECT_ELEMENT,exports.WYSIWYG=WYSIWYG,exports.HIDDEN=HIDDEN,exports.ABTASTY_IMAGES_ROUTE=ABTASTY_IMAGES_ROUTE,exports.TAG_RESET_EVENT=TAG_RESET_EVENT,exports.REMOVE_WIDGET=REMOVE_WIDGET,exports.REBUILD_WIDGET=REBUILD_WIDGET;

@@ -1,1 +0,1 @@

import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _inherits from"@babel/runtime/helpers/inherits";import _regeneratorRuntime from"@babel/runtime/regenerator";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _typeof from"@babel/runtime/helpers/typeof";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},borderWidthTranslations={en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},paddingTranslations={en:"Padding",fr:"Padding",es:"Padding",de:"Padding"},horizontalPaddingTranslations={en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},verticalPaddingTranslations={en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},marginTranslations={en:"Margin",fr:"Marges",es:"Márgenes",de:"Spanne"},horiziontalMarginTranslations={en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},verticalMarginTranslations={en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},buttonsStylesTranslations={en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},buttonsContrastTranslations={en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},buttonsShapeTranslations={en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},buttonsBackgroundColorTranslations={en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},buttonsTextColorTranslations={en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},buttonsBorderColorTranslations={en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},buttonsBorderWidthTranslations={en:"Buttons border thickness",fr:"Épaisseur du contour des boutons",es:"Grosor del contorno de los botones",de:"Stärke des Umrisses der Schaltflächen"},buttonsBorderRadiusTranslations={en:"Buttons border radius",fr:"Arrondi de la bordure des boutons",es:"Redondeo del borde de los botones",de:"Konturradius der Buttons"},buttonTextTranslations={en:"Button text",fr:"Texte du bouton",es:"Texto del botón",de:"Button-Text"},autoHideAfterUserValidationTranslations={en:"Auto hide after user validation",fr:"Masquer automatiquement après la validation",es:"Ocultar automáticamente tras la validación",de:"Nach der Freigabe automatisch ausblenden"},hideAfterSecondsTranslations={en:"Hide after x seconds",fr:"Masquer après x secondes",es:"Ocultar tras x segundos",de:"Nach X Sekunden ausblenden"},fieldStylesTranslations={en:"Field style",fr:"Style du champ",es:"Estilo del campo",de:"Input-Styles"},questionTranslations={en:"Question",fr:"Question",es:"Pregunta",de:"Frage"},thanksTranslations={en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},customCssTranslations={en:"Custom CSS",fr:"CSS Personnalisé",es:"CSS personalizado",de:"Custom CSS"},notesTranslations={en:"Notes",fr:"Notes",es:"Notas",de:"Notiz"},selectLayoutTranslations={en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},popinTranslations={en:"Modal",fr:"Pop-in",es:"Pop-in",de:"Pop-in"},bannerTranslations={en:"Banner",fr:"Bannière",es:"Banner",de:"Banner"},inThePageTranslations={en:"In the page",fr:"Dans la page",es:"En la pagina",de:"In der Seite"},freePlacementTransitions={en:"Free placement",fr:"Placement libre",es:"Integrado",de:"Freie Platzierung "},adjustLayoutTranslations={en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},selectReferenceElementTranslations={en:"Select a reference element",fr:"Sélectionnez un élément de référence",es:"Seleccionar un elemento de referencia",de:"Wählen Sie ein Referenzelement"},relativePositionToElementTranslations={en:"Position in relation to the element",fr:"Position par rapport à l'élément",es:"Posición respecto al elemento",de:"Position relativ zum Element"},containerTranslations={en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},overlayOpacityTranslations={en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"},overlayColorTranslations={en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"},positionTranslations={en:"Position",fr:"Position",es:"Posición",de:"Position"},topTranslations={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},atTheTopTranslation={en:"At the top",fr:"En haut",es:"Arriba",de:"Oben"},bottomTranslations={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},atTheBottomTranslations={en:"At the bottom",fr:"En bas",es:"Abajo",de:"Unten"},leftTranslations={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},atTheLeftTranslations={en:"At the left",fr:"À gauche",es:"A la izquierda",de:"Reihe"},rightTranslations={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},atTheRightTranslations={en:"At the right",fr:"À droite",es:"Derecha",de:"Recht"},aboveTranslations={en:"Above",fr:"Au-dessus",es:"Arriba",de:"Spalte"},beforeTranslations={en:"Before",fr:"Avant",es:"Antes",de:"Vor"},atTheStartTranslations={en:"At the start",fr:"Au début",es:"Al principio",de:"Am Anfang"},atTheEndTranslations={en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},afterTranslations={en:"After",fr:"Après",es:"Después",de:"Hinter"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de visualización"),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," tras el cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," tras la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},dropShadowTranslations={en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},shadowOpacityTranslations={en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},textPositionTranslations={en:"Text position",fr:"Positionnement du contenu",es:"Posición del texto",de:"Ausrichtung des Inhalts"},themeTranslations={en:"Theme",fr:"Thème",es:"Tema",de:"Typ"},selectTheThemeTranslations={en:"Select an appearance",fr:"Sélectionner une apparence",es:"Seleccionar una apariencia",de:"Thema auswählen"},lightTranslations={en:"Light",fr:"Clair",es:"Claro",de:"Hell"},darkTranslations={en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},pageLoadTranslations={en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},clickTranslations={en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},delayTranslations={en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Au réengagement (après inactivité)",es:"En la reactivación (tras un periodo de inactividad)",de:"Nach Inaktivität"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},delayAfterExitIntentTranslations={en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},idleTimeoutBeforePostingTraslations={en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},triggerEventDelayTranslations={en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"Retraso antes de publicar",de:"Verzögerung vor dem Posten"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",WYSIWYG="wysiwyg",HIDDEN="hidden",ABTASTY_IMAGES_ROUTE="https://widgets-images.abtasty.com/",TAG_RESET_EVENT="abtasty_resetActionTracking",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}];function ownKeys(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:delayAfterExitIntentTranslations,min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:idleTimeoutBeforePostingTraslations,min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:triggerEventDelayTranslations,value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},_global=function(e){return e.ABTasty||Object.assign(e,{ABTasty:{widgetutils:{}}}),e.ABTasty.widgetutils||Object.assign(e.ABTasty,{widgetutils:{}}),e}("undefined"!=typeof global?global:window),_widgetutils=_global.ABTasty.widgetutils;function addGlobalUtil(e,t){return _widgetutils.hasOwnProperty(e)||Object.assign(_widgetutils,_defineProperty({},e,new t)),_widgetutils[e]}function syncRequest(e,t){var n=new XMLHttpRequest;return n.open(e,t,!1),n.send(null),n}function asyncRequest(e,t){return new Promise(function(n,r){var a=new XMLHttpRequest;a.open(e,t,!0),a.onload=function(){this.status>=200&&this.status<300?n(a.response):r({status:this.status,statusText:a.statusText})},a.onerror=function(){r({status:this.status,statusText:a.statusText})},a.send()})}function loadJS(e){return new Promise(function(t,n){var r=window.document.getElementsByTagName("script")[0],a=window.document.createElement("script");a.src=e,r.parentNode.insertBefore(a,r),a.onload=t,a.onerror=n})}function findParent(e,t){return t(e)||!e.parentElement?e:findParent(e.parentElement,t)}var getWidgetName=function(){return"".concat(PACKAGE.replace("@abtasty/","")).concat(DATA&&DATA.type?"_".concat(DATA.type):"")},getUniqueId=function(){return"".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID)},getRecurrenceParams=function(){if(isOnEditor())return!1;var e=DATA;return{displayRecurrence:e.displayRecurrence,closingRecurrence:e.closingRecurrence,validationRecurrence:e.validationRecurrence}},getTriggerParams=function(){if(isOnEditor())return!1;var e,t=DATA,n=t.triggerEvent,r=t.triggerEventClick,a=t.triggerEventExitDelay,o=t.triggerEventDelay,i=t.triggerEventReengageDelay,s=r;switch(n){case"exitIntent":e=a;break;case"delay":e=o;break;case"reengage":e=i;break;default:e=0}return{triggerEvent:n,triggerSelector:s,triggerDelay:e}},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"},WidgetContainer=function(){function e(){_classCallCheck(this,e),this.uniqueId=getUniqueId(),this.widgetName=getWidgetName(),this.recurrenceParams=getRecurrenceParams(),this.triggerParams=getTriggerParams(),this.recurrence=!!this.recurrenceParams&&new Recurrence(this.recurrenceParams),this.trigger=!!this.triggerParams&&new Trigger(this.triggerParams),this.basicClassName="ab_widget_container_".concat(this.widgetName),this.widgetContainerId="".concat(this.basicClassName,"_").concat(this.uniqueId),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(this.uniqueId),this.domElement=this.getDom()}return _createClass(e,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement("body",function(t){return t.appendChild(e.domElement)},function(e){return console.error(e)}),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this}},{key:"hide",value:function(){return this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.recurrence||this.recurrence.isOver()){e.next=2;break}return e.abrupt("return",!1);case 2:if(e.t0=isOnEditor(),e.t0){e.next=10;break}if(e.t1=this.trigger,!e.t1){e.next=9;break}return e.next=8,this.trigger.isTriggered();case 8:e.t1=e.sent;case 9:e.t0=e.t1;case 10:if(e.t0){e.next=13;break}return e.abrupt("return",!1);case 13:return this.insert(),this.addCloseEvent(),e.abrupt("return",this);case 16:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"addCloseEvent",value:function(){for(var e=this,t=this.domElement.querySelectorAll("\n\t\t\t.".concat(this.overlayClassName,",\n\t\t\t.").concat(this.closeButtonClassName,"\n\t\t")),n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return r.push.apply(r,_toConsumableArray(t)),r.forEach(function(t){t.addEventListener("click",function(){e.recurrence&&e.recurrence.setClosingRecurrence(),e.hide()},{passive:!0,once:!0})}),this}},{key:"getDom",value:function(){var e=document.createElement("div");return e.className="".concat(this.basicClassName," ").concat(this.hideClassName),e.id=this.widgetContainerId,e.innerHTML='\n\t\t\t<div class="'.concat(this.overlayClassName,'"></div>\n\t\t\t<div class="').concat(this.contentClassName,'">\n\t\t\t\t<button class="').concat(this.closeButtonClassName,'" ').concat(isOnEditor()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),e}},{key:"getStyleTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("style");return t.type="text/css",isOnEditor()&&t.setAttribute("abtasty-script-added","true"),t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),Popin=function(e){function t(){var e;return _classCallCheck(this,t),(e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).stringStyles=e.getStyles(),e.styleElement=e.getStyleTag(e.stringStyles),e}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tposition: absolute;\n\t\t\tz-index: -1;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground-color: black;\n\t\t\topacity: 0.6;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.contentClassName," {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttop: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}\n\t\t\n\t\t@media screen and (max-width: 550px) and (orientation: portrait) {\n\t\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\t\tfont-size: 6vmin;\n\t\t\t}\n\t\t}")}}]),t}(),Banner=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,n.stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\t").concat(this.position,": 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}(),Free=function(e){function t(e,n){var r;return _classCallCheck(this,t),(r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,r.referrerElement=n,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return _inherits(t,WidgetContainer),_createClass(t,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement(this.referrerElement,function(t){return t.insertAdjacentElement(e.position,e.domElement)},function(e){return console.error(e)}),this}},{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tposition: relative;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}();function ownKeys$1(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var DISPLAY="display",CLOSING="closing",VALIDATION="validation",WIDGETS_STORAGE="ABTastyWidgets",Recurrence=function(){function e(t){var n=t.displayRecurrence,r=t.closingRecurrence,a=t.validationRecurrence;_classCallCheck(this,e),this.displayRecurrence=parseFloat(n),this.closingRecurrence=parseFloat(r),this.validationRecurrence=parseFloat(a),this.widgetName=getWidgetName(),this.uniqueId=getUniqueId(),this.recurrenceKey="".concat(this.widgetName,"_").concat(this.uniqueId)}return _createClass(e,[{key:"getGivenRecurrenceStorageParsed",value:function(e){try{var t=e.getItem(WIDGETS_STORAGE);return JSON.parse(t)}catch(t){return e.removeItem(WIDGETS_STORAGE),!1}}},{key:"getSessionRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}},{key:"getLocalRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}},{key:"removeGivenStorage",value:function(e,t){var n=this.recurrenceKey,r=(t[n],_objectWithoutProperties(t,[n].map(_toPropertyKey)));return Object.entries(r).length?(e.setItem(WIDGETS_STORAGE,JSON.stringify(r)),r):(e.removeItem(WIDGETS_STORAGE),!1)}},{key:"removeSessionRecurrenceStorage",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}},{key:"removeLocalRecurrenceStorage",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}},{key:"getSessionRecurrence",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getLocalRecurrence",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getCurrentRecurrence",value:function(){var e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}},{key:"isOver",value:function(){var e=this.getLocalRecurrence(),t=(e?parseFloat(e.stamp):0)<(new Date).getTime();return t&&this.removeLocalRecurrenceStorage(),t&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(e,t){var n=this,r=this.getTypeOfStorage(e);if(!r&&"object"!==_typeof(r))return!1;var a=this.getTypeOfStorage(e),o=a.storageString,i=a.storageMethod,s=this.getStamp(e),l={type:t,stamp:s},c=this.getCurrentRecurrence().type,u=function(){var e,t=n.getSessionRecurrence(),r=n.getLocalRecurrence();"session"===o?t?e=n.removeSessionRecurrenceStorage():(n.removeLocalRecurrenceStorage(),e=n.getSessionRecurrenceStorageParsed()):"local"===o&&(r?e=n.removeLocalRecurrenceStorage():(n.removeSessionRecurrenceStorage(),e=n.getLocalRecurrenceStorageParsed()));var a=e?_objectSpread$1(_defineProperty({},n.recurrenceKey,l),e):_defineProperty({},n.recurrenceKey,l);i.setItem(WIDGETS_STORAGE,JSON.stringify(a))};if(!i)return!1;if(c&&t!==VALIDATION)if(t===CLOSING&&c!==VALIDATION)u();else{if(t!==DISPLAY||c===VALIDATION||c===CLOSING)return!1;u()}else u();return s}},{key:"setDisplayRecurrence",value:function(){var e=DISPLAY;this.setRecurrence(this.displayRecurrence,e)}},{key:"setClosingRecurrence",value:function(){var e=CLOSING;this.setRecurrence(this.closingRecurrence,e)}},{key:"setValidationRecurrence",value:function(){var e=VALIDATION;this.setRecurrence(this.validationRecurrence,e)}},{key:"getStamp",value:function(e){return(new Date).getTime()+864e5*e}},{key:"getTypeOfStorage",value:function(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}]),e}();function addIntersectionPolyfill(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||loadJS("https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver")}function addPolyfill(e){return _addPolyfill.apply(this,arguments)}function _addPolyfill(){return(_addPolyfill=_asyncToGenerator(_regeneratorRuntime.mark(function e(t){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="IntersectionObserver"===e.t0?3:6;break;case 3:return e.next=5,addIntersectionPolyfill();case 5:return e.abrupt("return",e.sent);case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var originalBodyScroll,VisibilityObserver=function(){function e(){_classCallCheck(this,e),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return _createClass(e,[{key:"intersectionHandler",value:function(e){var t=this;e.forEach(function(e){e.isIntersecting?(t.existingTargets=t.existingTargets.filter(function(n){return n.element!==e.target||(t.inViewPortTargets.push(n),!1)}),t.checkElements()):t.inViewPortTargets=t.inViewPortTargets.filter(function(n){return n.element!==e.target||(t.existingTargets.push(n),!1)})})}},{key:"startVisibilityObserver",value:function(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:.5})}},{key:"startMutationObserver",value:function(){var e=new MutationObserver(this.checkElements.bind(this));return e.observe(document,{attributes:!0,childList:!0,subtree:!0}),e}},{key:"isElementVisible",value:function(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}},{key:"isElementOpaque",value:function(e){return"HTML"===findParent(e,function(e){return"0"===window.getComputedStyle(e).opacity}).nodeName}},{key:"isElementTopmost",value:function(e){for(var t=e.getBoundingClientRect(),n=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom]],r=!1,a=0;!r&&a<n.length;){var o,i=(o=document).elementFromPoint.apply(o,_toConsumableArray(n[a]));r=e===i||e.contains(i),a++}return r}},{key:"checkElements",value:function(){var e=this;this.targets=this.targets.filter(function(t){var n=document.querySelector(t.selector);return!n||(e.existingTargets.push(Object.assign(t,{element:n})),e.visibilityobserver.observe(n),!1)}),this.existingTargets=this.existingTargets.filter(function(t){return!!document.querySelector(t.selector)||(e.visibilityobserver.unobserve(t.element),e.targets.push(t),!1)}),this.inViewPortTargets=this.inViewPortTargets.filter(function(t){var n=t.element,r=t.resolve;return!e.isElementVisible(n)||(e.visibilityobserver.unobserve(n),r(n),!1)})}},{key:"watch",value:function(e,t){this.targets.push({selector:e,resolve:t})}}]),e}(),Trigger=function(){function e(t){var n=t.triggerEvent,r=t.triggerSelector,a=t.triggerDelay;_classCallCheck(this,e),this.event=n,this.selector=r&&r.length?r:"body",this.delay=a}return _createClass(e,[{key:"onElementVisible",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r,a,o;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onPageLoad();case 2:return r=t.sent,t.next=5,addPolyfill();case 5:a=t.sent,o=addGlobalUtil("VisibilityObserver",VisibilityObserver),a&&r&&o.watch(e.selector,n);case 8:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onPageLoad",value:function(){return new Promise(function(e,t){var n=function(){return"complete"===document.readyState};if(n())return e(!0);var r,a=setTimeout(function(){var e;return(e=document).removeEventListener.apply(e,o),t(!1)},15e3),o=["readystatechange",function(){return n()&&!clearTimeout(a)&&e(!0)},{passive:!0}];(r=document).addEventListener.apply(r,o)})}},{key:"onClick",value:function(){var e=this,t=document.createElement("style");return t.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(t),new Promise(function(n){var r,a=function(t){return _toConsumableArray(document.querySelectorAll(e.selector)).some(function(n){return n.isSameNode(t)||!!t.closest(e.selector)})},o=["click",function(e){var r,i=e.target;return!!a(i)&&(document.head.removeChild(t),(r=document).removeEventListener.apply(r,o),n(!0))},{passive:!0,capture:!0}];(r=document).addEventListener.apply(r,o)})}},{key:"onExitIntent",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=["mouseleave",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.delay){t.next=5;break}r=1e3*e.delay,setTimeout(function(){return n(!0)},r),t.next=6;break;case 5:return t.abrupt("return",n(!0));case 6:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),{passive:!0,once:!0}],t.next=4,e.onPageLoad();case 4:t.sent&&waitForElement("body",function(e){return e.addEventListener.apply(e,r)});case 6:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onDelay",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=1e3*e.delay,t.next=3,e.onPageLoad();case 3:t.sent&&setTimeout(function(){return n(!0)},r);case 5:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onReengage",value:function(){var e=this;return new Promise(function(t){var n=1e3*e.delay,r=n,a=["click","mousemove","scroll","keypress"],o=[function(){return r=n},{passive:!0}];a.forEach(function(e){var t;return(t=document).addEventListener.apply(t,[e].concat(o))});var i=setInterval(function(){r<=0?(t(!0),clearInterval(i),a.forEach(function(e){var t;return(t=document).removeEventListener.apply(t,[e].concat(o))})):r-=100},100)})}},{key:"isTriggered",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){var t;return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.event,e.next="pageLoad"===e.t0?3:"click"===e.t0?7:"exitIntent"===e.t0?11:"delay"===e.t0?15:"reengage"===e.t0?19:"elementVisible"===e.t0?23:27;break;case 3:return e.next=5,this.onPageLoad();case 5:return t=e.sent,e.abrupt("break",28);case 7:return e.next=9,this.onClick();case 9:return t=e.sent,e.abrupt("break",28);case 11:return e.next=13,this.onExitIntent();case 13:return t=e.sent,e.abrupt("break",28);case 15:return e.next=17,this.onDelay();case 17:return t=e.sent,e.abrupt("break",28);case 19:return e.next=21,this.onReengage();case 21:return t=e.sent,e.abrupt("break",28);case 23:return e.next=25,this.onElementVisible();case 25:return t=e.sent,e.abrupt("break",28);case 27:t=!1;case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}();function preventGlobalScroll(){waitForElement("body",function(e){originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"},function(e){return console.error(e)})}function allowGlobalScroll(){waitForElement("body",function(e){originalBodyScroll&&(e.style.overflowY=originalBodyScroll)},function(e){return console.error(e)})}var loadImage=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.src=e,r.onerror=function(t){var r=new Error("Image ".concat(e," is not loaded."));n(r)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var t,n=0;document.addEventListener("mousemove",function(e){n=e.clientY}),document.body.addEventListener("mouseleave",function r(a){a.clientY<=50&&(n=0,clearInterval(t),t=setTimeout(function(){0===n&&(e(),document.removeEventListener("mouseleave",r))},0))},!1)},log=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,n)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,n){var r,a=0;try{document.querySelector(e)}catch(t){var o="Selector «".concat(e,"» not valid.");return log(o),"function"==typeof n&&n(o)}r=setTimeout(function(){clearInterval(a);var t="Can't find element «".concat(e,"».");return log(t),"function"==typeof n&&n(t)},1e4),a=setInterval(function(){var n=document.querySelector(e);if(null!==n)return clearTimeout(r),clearInterval(a),"function"==typeof t&&t(n)},200)},getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var a=n[r];" "==a.charAt(0);)a=a.substring(1);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,t,n){var r="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),r="expires="+a.toUTCString()}var o="domain="+getHostname();document.cookie=e+"="+t+"; "+r+";"+o+";path=/"},getAccountIdentifier=function(){if(window.ABTasty||window.ABTASTY_S)return window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings?window.ABTasty.accountSettings.identifier:void 0},getVisitorId=function(){return window.ABTasty&&window.ABTasty.visitor?window.ABTasty.visitor.id:void 0};export{preventGlobalScroll,allowGlobalScroll,loadImage,isTouch,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie,getAccountIdentifier,getVisitorId,closingRecurrenceForm,displayRecurrenceForm,validationRecurrenceForm,recurrencesGroup,triggersForm,triggersGroup,isOnEditor,addGlobalUtil,syncRequest,asyncRequest,loadJS,findParent,getWidgetName,getUniqueId,getRecurrenceParams,getTriggerParams,backgroundColorForm,backgroundImageForm,backgroundOpacityForm,backgroundsGroup,borderColorForm,borderRadiusForm,borderWidthForm,bordersGroup,textColorForm,Popin,Banner,Free,WidgetContainer,Recurrence,Trigger,backgroundTranslations,backgroundColorTranslations,backgroundImageTranslations,backgroundOpacityTranslations,borderTranslations,borderColorTranslations,borderRadiusTranslations,borderWidthTranslations,paddingTranslations,horizontalPaddingTranslations,verticalPaddingTranslations,marginTranslations,horiziontalMarginTranslations,verticalMarginTranslations,buttonsStylesTranslations,buttonsContrastTranslations,buttonsShapeTranslations,buttonsBackgroundColorTranslations,buttonsTextColorTranslations,buttonsBorderColorTranslations,buttonsBorderWidthTranslations,buttonsBorderRadiusTranslations,buttonTextTranslations,autoHideAfterUserValidationTranslations,hideAfterSecondsTranslations,fieldStylesTranslations,questionTranslations,thanksTranslations,customCssTranslations,notesTranslations,selectLayoutTranslations,popinTranslations,bannerTranslations,inThePageTranslations,freePlacementTransitions,adjustLayoutTranslations,selectReferenceElementTranslations,relativePositionToElementTranslations,containerTranslations,overlayOpacityTranslations,overlayColorTranslations,positionTranslations,topTranslations,atTheTopTranslation,bottomTranslations,atTheBottomTranslations,leftTranslations,atTheLeftTranslations,rightTranslations,atTheRightTranslations,aboveTranslations,beforeTranslations,atTheStartTranslations,atTheEndTranslations,afterTranslations,everydayTranslations,everyWeekTranslations,everyMonthTranslations,everySessionTranslations,everytimeTranslations,oncePerUserTranslations,recurrenceTranslations,displayRecurrenceTranslations,closingRecurrenceTranslations,validationRecurrenceTranslations,dropShadowTranslations,shadowOpacityTranslations,textColorTranslations,closeButtonColorTranslations,textPositionTranslations,themeTranslations,selectTheThemeTranslations,lightTranslations,darkTranslations,pageLoadTranslations,clickTranslations,exitIntentTranslations,delayTranslations,reengageInactivityTranslations,triggerOnTranslations,triggerTranslations,delayAfterExitIntentTranslations,idleTimeoutBeforePostingTraslations,triggerEventDelayTranslations,STYLE,LAYOUT,CONTENT,CONDITIONS,GROUP,CHECKBOX,COLOR_PICKER,SEPARATOR,DATE_PICKER,DATE_RANGE_PICKER,SELECT,MEDIA_UPLOAD,NUMBER,RADIO_BUTTON,RADIO_IMAGE,SLIDER,SWITCH,TEXT_FIELD,TEXT_AREA,TIME_PICKER,SELECT_ELEMENT,WYSIWYG,HIDDEN,ABTASTY_IMAGES_ROUTE,TAG_RESET_EVENT};
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _inherits from"@babel/runtime/helpers/inherits";import _regeneratorRuntime from"@babel/runtime/regenerator";import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _typeof from"@babel/runtime/helpers/typeof";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var backgroundTranslations={en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},backgroundColorTranslations={en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},backgroundImageTranslations={en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},backgroundOpacityTranslations={en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},borderTranslations={en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},borderColorTranslations={en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},borderRadiusTranslations={en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},borderWidthTranslations={en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},paddingTranslations={en:"Padding",fr:"Padding",es:"Padding",de:"Padding"},horizontalPaddingTranslations={en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},verticalPaddingTranslations={en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},marginTranslations={en:"Margin",fr:"Marges",es:"Márgenes",de:"Spanne"},horiziontalMarginTranslations={en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},verticalMarginTranslations={en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},buttonsStylesTranslations={en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},buttonsContrastTranslations={en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},buttonsShapeTranslations={en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},buttonsBackgroundColorTranslations={en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},buttonsTextColorTranslations={en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},buttonsBorderColorTranslations={en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},buttonsBorderWidthTranslations={en:"Buttons border thickness",fr:"Épaisseur du contour des boutons",es:"Grosor del contorno de los botones",de:"Stärke des Umrisses der Schaltflächen"},buttonsBorderRadiusTranslations={en:"Buttons border radius",fr:"Arrondi de la bordure des boutons",es:"Redondeo del borde de los botones",de:"Konturradius der Buttons"},buttonTextTranslations={en:"Button text",fr:"Texte du bouton",es:"Texto del botón",de:"Button-Text"},autoHideAfterUserValidationTranslations={en:"Auto hide after user validation",fr:"Masquer automatiquement après la validation",es:"Ocultar automáticamente tras la validación",de:"Nach der Freigabe automatisch ausblenden"},hideAfterSecondsTranslations={en:"Hide after x seconds",fr:"Masquer après x secondes",es:"Ocultar tras x segundos",de:"Nach X Sekunden ausblenden"},fieldStylesTranslations={en:"Field style",fr:"Style du champ",es:"Estilo del campo",de:"Input-Styles"},questionTranslations={en:"Question",fr:"Question",es:"Pregunta",de:"Frage"},thanksTranslations={en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},customCssTranslations={en:"Custom CSS",fr:"CSS Personnalisé",es:"CSS personalizado",de:"Custom CSS"},notesTranslations={en:"Notes",fr:"Notes",es:"Notas",de:"Notiz"},selectLayoutTranslations={en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},popinTranslations={en:"Modal",fr:"Pop-in",es:"Pop-in",de:"Pop-in"},bannerTranslations={en:"Banner",fr:"Bannière",es:"Banner",de:"Banner"},inThePageTranslations={en:"In the page",fr:"Dans la page",es:"En la pagina",de:"In der Seite"},freePlacementTransitions={en:"Free placement",fr:"Placement libre",es:"Integrado",de:"Freie Platzierung "},adjustLayoutTranslations={en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},selectReferenceElementTranslations={en:"Select a reference element",fr:"Sélectionnez un élément de référence",es:"Seleccionar un elemento de referencia",de:"Wählen Sie ein Referenzelement"},relativePositionToElementTranslations={en:"Position in relation to the element",fr:"Position par rapport à l'élément",es:"Posición respecto al elemento",de:"Position relativ zum Element"},containerTranslations={en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},overlayOpacityTranslations={en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"},overlayColorTranslations={en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"},positionTranslations={en:"Position",fr:"Position",es:"Posición",de:"Position"},topTranslations={en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},atTheTopTranslation={en:"At the top",fr:"En haut",es:"Arriba",de:"Oben"},bottomTranslations={en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},atTheBottomTranslations={en:"At the bottom",fr:"En bas",es:"Abajo",de:"Unten"},leftTranslations={en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},atTheLeftTranslations={en:"At the left",fr:"À gauche",es:"A la izquierda",de:"Reihe"},rightTranslations={en:"Right",fr:"Droite",es:"Derecha",de:"Recht"},atTheRightTranslations={en:"At the right",fr:"À droite",es:"Derecha",de:"Recht"},aboveTranslations={en:"Above",fr:"Au-dessus",es:"Arriba",de:"Spalte"},beforeTranslations={en:"Before",fr:"Avant",es:"Antes",de:"Vor"},atTheStartTranslations={en:"At the start",fr:"Au début",es:"Al principio",de:"Am Anfang"},atTheEndTranslations={en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},afterTranslations={en:"After",fr:"Après",es:"Después",de:"Hinter"},everydayTranslations={en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},everyWeekTranslations={en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},everyMonthTranslations={en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},everySessionTranslations={en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},everytimeTranslations={en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},oncePerUserTranslations={en:"Once per user (no recurrence)",fr:"Une fois par visiteur (pas de récurrence)",es:"Una vez por usuario (sin recurrencia)",de:"Einmal pro User (keine Wiederholung)"},recurrenceTranslations={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},displayRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," of the display"),fr:"".concat(recurrenceTranslations.fr," de l'affichage"),es:"".concat(recurrenceTranslations.es," de visualización"),de:"".concat(recurrenceTranslations.de," der Anzeige")},closingRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after closure"),fr:"".concat(recurrenceTranslations.fr," après fermeture"),es:"".concat(recurrenceTranslations.es," tras el cierre"),de:"".concat(recurrenceTranslations.de," nach Schließung")},validationRecurrenceTranslations={en:"".concat(recurrenceTranslations.en," after validation"),fr:"".concat(recurrenceTranslations.fr," après validation"),es:"".concat(recurrenceTranslations.es," tras la validación"),de:"".concat(recurrenceTranslations.de," nach der Validierung")},dropShadowTranslations={en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},shadowOpacityTranslations={en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},textColorTranslations={en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},closeButtonColorTranslations={en:"Close button color",fr:"Couleur du bouton de fermeture",es:"Color del botón de cierre",de:"Farbe der Schließen-Schaltfläche"},textPositionTranslations={en:"Text position",fr:"Positionnement du contenu",es:"Posición del texto",de:"Ausrichtung des Inhalts"},themeTranslations={en:"Theme",fr:"Thème",es:"Tema",de:"Typ"},selectTheThemeTranslations={en:"Select an appearance",fr:"Sélectionner une apparence",es:"Seleccionar una apariencia",de:"Thema auswählen"},lightTranslations={en:"Light",fr:"Clair",es:"Claro",de:"Hell"},darkTranslations={en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},pageLoadTranslations={en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},clickTranslations={en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},exitIntentTranslations={en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},delayTranslations={en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},reengageInactivityTranslations={en:"Reengage (after inactivity)",fr:"Au réengagement (après inactivité)",es:"En la reactivación (tras un periodo de inactividad)",de:"Nach Inaktivität"},triggerOnTranslations={en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},triggerTranslations={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},delayAfterExitIntentTranslations={en:"Delay after exit intent",fr:"Délai après intention de sortie",es:"Retraso después de la intención de salida",de:"Verzögerung nach Ausstiegsabsicht"},idleTimeoutBeforePostingTraslations={en:"Idle timeout before posting",fr:"Délai d'inactivité avant l'affichage",es:"Tiempo de espera inactivo antes de publicar",de:"Zeitüberschreitung vor dem Posten"},triggerEventDelayTranslations={en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"Retraso antes de publicar",de:"Verzögerung vor dem Posten"},STYLE="style",LAYOUT="layout",CONTENT="content",CONDITIONS="conditions",GROUP="group",CHECKBOX="checkbox",COLOR_PICKER="colorpicker",SEPARATOR="separator",DATE_PICKER="datepicker",DATE_RANGE_PICKER="dateRangePicker",SELECT="select",MEDIA_UPLOAD="mediaupload",NUMBER="number",RADIO_BUTTON="radio",RADIO_IMAGE="radioImage",SLIDER="slider",SWITCH="switch",TEXT_FIELD="text",TEXT_AREA="textarea",TIME_PICKER="timepicker",SELECT_ELEMENT="selectelement",WYSIWYG="wysiwyg",HIDDEN="hidden",ABTASTY_IMAGES_ROUTE="https://widgets-images.abtasty.com/",TAG_RESET_EVENT="abtasty_resetActionTracking",REMOVE_WIDGET="remove",REBUILD_WIDGET="rebuild",recurrencesOptions=[{label:everytimeTranslations,value:"-1"},{label:everySessionTranslations,value:"0"},{label:everydayTranslations,value:"1"},{label:everyWeekTranslations,value:"7"},{label:everyMonthTranslations,value:"30"},{label:oncePerUserTranslations,value:"365"}];function ownKeys(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var commons={category:CONDITIONS,type:SELECT,options:recurrencesOptions,value:"-1"},closingRecurrenceForm=_objectSpread({},commons,{label:closingRecurrenceTranslations,propName:"closingRecurrence"}),displayRecurrenceForm=_objectSpread({},commons,{label:displayRecurrenceTranslations,propName:"displayRecurrence"}),validationRecurrenceForm=_objectSpread({},commons,{label:validationRecurrenceTranslations,propName:"validationRecurrence"}),recurrencesGroup={category:CONDITIONS,type:GROUP,label:recurrenceTranslations,collapsible:!0,children:[displayRecurrenceForm,closingRecurrenceForm,validationRecurrenceForm]},triggersOptions=[{label:pageLoadTranslations,value:"pageLoad"},{label:clickTranslations,value:"click"},{label:exitIntentTranslations,value:"exitIntent"},{label:delayTranslations,value:"delay"},{label:reengageInactivityTranslations,value:"reengage"}],TRIGGER_EVENT="triggerEvent",triggerEventClick={category:CONDITIONS,type:SELECT_ELEMENT,propName:"".concat(TRIGGER_EVENT,"Click"),label:triggerTranslations,placeholder:{en:"Select an element in the webpage",fr:"Sélectionner un élément dans la page",es:"Selecciona un elemento en la página web",de:"Wählen Sie ein Element auf der Webseite aus"},conditions:[{field:TRIGGER_EVENT,value:"click"}]},triggerEventExitDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ExitDelay"),label:delayAfterExitIntentTranslations,min:0,max:120,value:0,conditions:[{field:TRIGGER_EVENT,value:"exitIntent"}]},triggerEventReengageDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"ReengageDelay"),label:idleTimeoutBeforePostingTraslations,min:1,max:120,value:10,conditions:[{field:TRIGGER_EVENT,value:"reengage"}]},triggerEventDelay={category:CONDITIONS,type:NUMBER,propName:"".concat(TRIGGER_EVENT,"Delay"),label:triggerEventDelayTranslations,value:10,conditions:[{field:TRIGGER_EVENT,value:"delay"}]},conditionalFields=[triggerEventClick,triggerEventExitDelay,triggerEventReengageDelay,triggerEventDelay],triggersForm={category:CONDITIONS,type:SELECT,label:triggerOnTranslations,options:triggersOptions,propName:TRIGGER_EVENT,value:"pageLoad"},triggersGroup={category:CONDITIONS,type:GROUP,label:triggerTranslations,collapsible:!0,children:[triggersForm].concat(_toConsumableArray(conditionalFields))},isOnEditor=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},_global=function(e){return e.ABTasty||Object.assign(e,{ABTasty:{widgetutils:{}}}),e.ABTasty.widgetutils||Object.assign(e.ABTasty,{widgetutils:{}}),e}("undefined"!=typeof global?global:window),_widgetutils=_global.ABTasty.widgetutils;function addGlobalUtil(e,t){return _widgetutils.hasOwnProperty(e)||Object.assign(_widgetutils,_defineProperty({},e,new t)),_widgetutils[e]}function syncRequest(e,t){var n=new XMLHttpRequest;return n.open(e,t,!1),n.send(null),n}function asyncRequest(e,t){return new Promise(function(n,r){var a=new XMLHttpRequest;a.open(e,t,!0),a.onload=function(){this.status>=200&&this.status<300?n(a.response):r({status:this.status,statusText:a.statusText})},a.onerror=function(){r({status:this.status,statusText:a.statusText})},a.send()})}function loadJS(e){return new Promise(function(t,n){var r=window.document.getElementsByTagName("script")[0],a=window.document.createElement("script");a.src=e,r.parentNode.insertBefore(a,r),a.onload=t,a.onerror=n})}function findParent(e,t){return t(e)||!e.parentElement?e:findParent(e.parentElement,t)}var getWidgetName=function(){return"".concat(PACKAGE.replace("@abtasty/","")).concat(DATA&&DATA.type?"_".concat(DATA.type):"")},getUniqueId=function(){return"".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID)},getRecurrenceParams=function(){if(isOnEditor())return!1;var e=DATA;return{displayRecurrence:e.displayRecurrence,closingRecurrence:e.closingRecurrence,validationRecurrence:e.validationRecurrence}},getTriggerParams=function(){if(isOnEditor())return!1;var e,t=DATA,n=t.triggerEvent,r=t.triggerEventClick,a=t.triggerEventExitDelay,o=t.triggerEventDelay,i=t.triggerEventReengageDelay,s=r;switch(n){case"exitIntent":e=a;break;case"delay":e=o;break;case"reengage":e=i;break;default:e=0}return{triggerEvent:n,triggerSelector:s,triggerDelay:e}},backgroundColorForm={category:STYLE,type:COLOR_PICKER,label:backgroundColorTranslations,propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},backgroundImageForm={category:STYLE,type:MEDIA_UPLOAD,label:backgroundImageTranslations,propName:"backgroundImage",value:""},backgroundOpacityForm={category:STYLE,type:SLIDER,label:backgroundOpacityTranslations,propName:"backgroundOpacity",value:75,unit:"%"},backgroundsGroup={category:STYLE,type:GROUP,label:backgroundTranslations,collapsible:!0,children:[backgroundColorForm,backgroundImageForm,backgroundOpacityForm]},borderColorForm={category:STYLE,type:COLOR_PICKER,label:borderColorTranslations,propName:"borderColor",value:"rgba(255, 255, 255, 1)"},borderRadiusForm={category:STYLE,type:SLIDER,label:borderRadiusTranslations,propName:"borderRadius",value:0,unit:"px"},borderWidthForm={category:STYLE,type:SLIDER,label:borderWidthTranslations,propName:"borderWidth",value:0,unit:"px"},bordersGroup={category:STYLE,type:GROUP,label:borderTranslations,collapsible:!0,children:[borderWidthForm,borderColorForm,borderRadiusForm]},textColorForm={category:STYLE,type:COLOR_PICKER,label:textColorTranslations,propName:"textColor",value:"rgba(255, 255, 255, 1)"},WidgetContainer=function(){function e(){_classCallCheck(this,e),this.uniqueId=getUniqueId(),this.widgetName=getWidgetName(),this.recurrenceParams=getRecurrenceParams(),this.triggerParams=getTriggerParams(),this.recurrence=!!this.recurrenceParams&&new Recurrence(this.recurrenceParams),this.trigger=!!this.triggerParams&&new Trigger(this.triggerParams),this.basicClassName="ab_widget_container_".concat(this.widgetName),this.widgetContainerId="".concat(this.basicClassName,"_").concat(this.uniqueId),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(this.uniqueId),this.domElement=this.getDom()}return _createClass(e,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement("body",function(t){return t.appendChild(e.domElement)},function(e){return console.error(e)}),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this}},{key:"hide",value:function(){return this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.recurrence||this.recurrence.isOver()){e.next=2;break}return e.abrupt("return",!1);case 2:if(e.t0=isOnEditor(),e.t0){e.next=10;break}if(e.t1=this.trigger,!e.t1){e.next=9;break}return e.next=8,this.trigger.isTriggered();case 8:e.t1=e.sent;case 9:e.t0=e.t1;case 10:if(e.t0){e.next=13;break}return e.abrupt("return",!1);case 13:return this.insert(),this.addCloseEvent(),e.abrupt("return",this);case 16:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"addCloseEvent",value:function(){for(var e=this,t=this.domElement.querySelectorAll("\n\t\t\t.".concat(this.overlayClassName,",\n\t\t\t.").concat(this.closeButtonClassName,"\n\t\t")),n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return r.push.apply(r,_toConsumableArray(t)),r.forEach(function(t){t.addEventListener("click",function(){e.recurrence&&e.recurrence.setClosingRecurrence(),e.hide()},{passive:!0,once:!0})}),this}},{key:"getDom",value:function(){var e=document.createElement("div");return e.className="".concat(this.basicClassName," ").concat(this.hideClassName),e.id=this.widgetContainerId,e.innerHTML='\n\t\t\t<div class="'.concat(this.overlayClassName,'"></div>\n\t\t\t<div class="').concat(this.contentClassName,'">\n\t\t\t\t<button class="').concat(this.closeButtonClassName,'" ').concat(isOnEditor()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),e}},{key:"getStyleTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("style");return t.type="text/css",isOnEditor()&&t.setAttribute("abtasty-script-added","true"),t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),Popin=function(e){function t(){var e;return _classCallCheck(this,t),(e=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).stringStyles=e.getStyles(),e.styleElement=e.getStyleTag(e.stringStyles),e}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tposition: absolute;\n\t\t\tz-index: -1;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground-color: black;\n\t\t\topacity: 0.6;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.contentClassName," {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttop: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}\n\t\t\n\t\t@media screen and (max-width: 550px) and (orientation: portrait) {\n\t\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\t\tfont-size: 6vmin;\n\t\t\t}\n\t\t}")}}]),t}(),Banner=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,n.stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}return _inherits(t,WidgetContainer),_createClass(t,[{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\tposition: fixed;\n\t\t\t").concat(this.position,": 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\tz-index: 9999;\n\t\t\topacity: 1;\n\t\t\ttransition: opacity 0.25s ease;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}(),Free=function(e){function t(e,n){var r;return _classCallCheck(this,t),(r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this))).position=e,r.referrerElement=n,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return _inherits(t,WidgetContainer),_createClass(t,[{key:"insert",value:function(){var e=this;return waitForElement("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),waitForElement(this.referrerElement,function(t){return t.insertAdjacentElement(e.position,e.domElement)},function(e){return console.error(e)}),this}},{key:"getStyles",value:function(){return"\n\t\t#".concat(this.widgetContainerId," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tposition: relative;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.overlayClassName," {\n\t\t\tdisplay: none;\n\t\t}\n\t\t#").concat(this.widgetContainerId," .").concat(this.closeButtonClassName," {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tcolor: black;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\ttransform: rotate(45deg);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tfont-size: 1.8em;\n\t\t}")}}]),t}();function ownKeys$1(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n}function _objectSpread$1(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys$1(n,!0).forEach(function(t){_defineProperty(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys$1(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var DISPLAY="display",CLOSING="closing",VALIDATION="validation",WIDGETS_STORAGE="ABTastyWidgets",Recurrence=function(){function e(t){var n=t.displayRecurrence,r=t.closingRecurrence,a=t.validationRecurrence;_classCallCheck(this,e),this.displayRecurrence=parseFloat(n),this.closingRecurrence=parseFloat(r),this.validationRecurrence=parseFloat(a),this.widgetName=getWidgetName(),this.uniqueId=getUniqueId(),this.recurrenceKey="".concat(this.widgetName,"_").concat(this.uniqueId)}return _createClass(e,[{key:"getGivenRecurrenceStorageParsed",value:function(e){try{var t=e.getItem(WIDGETS_STORAGE);return JSON.parse(t)}catch(t){return e.removeItem(WIDGETS_STORAGE),!1}}},{key:"getSessionRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}},{key:"getLocalRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}},{key:"removeGivenStorage",value:function(e,t){var n=this.recurrenceKey,r=(t[n],_objectWithoutProperties(t,[n].map(_toPropertyKey)));return Object.entries(r).length?(e.setItem(WIDGETS_STORAGE,JSON.stringify(r)),r):(e.removeItem(WIDGETS_STORAGE),!1)}},{key:"removeSessionRecurrenceStorage",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}},{key:"removeLocalRecurrenceStorage",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}},{key:"getSessionRecurrence",value:function(){var e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getLocalRecurrence",value:function(){var e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}},{key:"getCurrentRecurrence",value:function(){var e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}},{key:"isOver",value:function(){var e=this.getLocalRecurrence(),t=(e?parseFloat(e.stamp):0)<(new Date).getTime();return t&&this.removeLocalRecurrenceStorage(),t&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(e,t){var n=this,r=this.getTypeOfStorage(e);if(!r&&"object"!==_typeof(r))return!1;var a=this.getTypeOfStorage(e),o=a.storageString,i=a.storageMethod,s=this.getStamp(e),l={type:t,stamp:s},c=this.getCurrentRecurrence().type,u=function(){var e,t=n.getSessionRecurrence(),r=n.getLocalRecurrence();"session"===o?t?e=n.removeSessionRecurrenceStorage():(n.removeLocalRecurrenceStorage(),e=n.getSessionRecurrenceStorageParsed()):"local"===o&&(r?e=n.removeLocalRecurrenceStorage():(n.removeSessionRecurrenceStorage(),e=n.getLocalRecurrenceStorageParsed()));var a=e?_objectSpread$1(_defineProperty({},n.recurrenceKey,l),e):_defineProperty({},n.recurrenceKey,l);i.setItem(WIDGETS_STORAGE,JSON.stringify(a))};if(!i)return!1;if(c&&t!==VALIDATION)if(t===CLOSING&&c!==VALIDATION)u();else{if(t!==DISPLAY||c===VALIDATION||c===CLOSING)return!1;u()}else u();return s}},{key:"setDisplayRecurrence",value:function(){var e=DISPLAY;this.setRecurrence(this.displayRecurrence,e)}},{key:"setClosingRecurrence",value:function(){var e=CLOSING;this.setRecurrence(this.closingRecurrence,e)}},{key:"setValidationRecurrence",value:function(){var e=VALIDATION;this.setRecurrence(this.validationRecurrence,e)}},{key:"getStamp",value:function(e){return(new Date).getTime()+864e5*e}},{key:"getTypeOfStorage",value:function(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}]),e}();function addIntersectionPolyfill(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||loadJS("https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver")}function addPolyfill(e){return _addPolyfill.apply(this,arguments)}function _addPolyfill(){return(_addPolyfill=_asyncToGenerator(_regeneratorRuntime.mark(function e(t){return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next="IntersectionObserver"===e.t0?3:6;break;case 3:return e.next=5,addIntersectionPolyfill();case 5:return e.abrupt("return",e.sent);case 6:return e.abrupt("return",!0);case 7:case"end":return e.stop()}},e)}))).apply(this,arguments)}var VisibilityObserver=function(){function e(){_classCallCheck(this,e),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return _createClass(e,[{key:"intersectionHandler",value:function(e){var t=this;e.forEach(function(e){e.isIntersecting?(t.existingTargets=t.existingTargets.filter(function(n){return n.element!==e.target||(t.inViewPortTargets.push(n),!1)}),t.checkElements()):t.inViewPortTargets=t.inViewPortTargets.filter(function(n){return n.element!==e.target||(t.existingTargets.push(n),!1)})})}},{key:"startVisibilityObserver",value:function(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:.5})}},{key:"startMutationObserver",value:function(){var e=new MutationObserver(this.checkElements.bind(this));return e.observe(document,{attributes:!0,childList:!0,subtree:!0}),e}},{key:"isElementVisible",value:function(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}},{key:"isElementOpaque",value:function(e){return"HTML"===findParent(e,function(e){return"0"===window.getComputedStyle(e).opacity}).nodeName}},{key:"isElementTopmost",value:function(e){for(var t=e.getBoundingClientRect(),n=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom]],r=!1,a=0;!r&&a<n.length;){var o,i=(o=document).elementFromPoint.apply(o,_toConsumableArray(n[a]));r=e===i||e.contains(i),a++}return r}},{key:"checkElements",value:function(){var e=this;this.targets=this.targets.filter(function(t){var n=document.querySelector(t.selector);return!n||(e.existingTargets.push(Object.assign(t,{element:n})),e.visibilityobserver.observe(n),!1)}),this.existingTargets=this.existingTargets.filter(function(t){return!!document.querySelector(t.selector)||(e.visibilityobserver.unobserve(t.element),e.targets.push(t),!1)}),this.inViewPortTargets=this.inViewPortTargets.filter(function(t){var n=t.element,r=t.resolve;return!e.isElementVisible(n)||(e.visibilityobserver.unobserve(n),r(n),!1)})}},{key:"watch",value:function(e,t){this.targets.push({selector:e,resolve:t})}}]),e}(),Trigger=function(){function e(t){var n=t.triggerEvent,r=t.triggerSelector,a=t.triggerDelay;_classCallCheck(this,e),this.event=n,this.selector=r&&r.length?r:"body",this.delay=a}return _createClass(e,[{key:"onElementVisible",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r,a,o;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.onPageLoad();case 2:return r=t.sent,t.next=5,addPolyfill();case 5:a=t.sent,o=addGlobalUtil("VisibilityObserver",VisibilityObserver),a&&r&&o.watch(e.selector,n);case 8:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onPageLoad",value:function(){return new Promise(function(e,t){var n=function(){return"complete"===document.readyState};if(n())return e(!0);var r,a=setTimeout(function(){var e;return(e=document).removeEventListener.apply(e,o),t(!1)},15e3),o=["readystatechange",function(){return n()&&!clearTimeout(a)&&e(!0)},{passive:!0}];(r=document).addEventListener.apply(r,o)})}},{key:"onClick",value:function(){var e=this,t=document.createElement("style");return t.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(t),new Promise(function(n){var r,a=function(t){return _toConsumableArray(document.querySelectorAll(e.selector)).some(function(n){return n.isSameNode(t)||!!t.closest(e.selector)})},o=["click",function(e){var r,i=e.target;return!!a(i)&&(document.head.removeChild(t),(r=document).removeEventListener.apply(r,o),n(!0))},{passive:!0,capture:!0}];(r=document).addEventListener.apply(r,o)})}},{key:"onExitIntent",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=["mouseleave",function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.delay){t.next=5;break}r=1e3*e.delay,setTimeout(function(){return n(!0)},r),t.next=6;break;case 5:return t.abrupt("return",n(!0));case 6:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),{passive:!0,once:!0}],t.next=4,e.onPageLoad();case 4:t.sent&&waitForElement("body",function(e){return e.addEventListener.apply(e,r)});case 6:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onDelay",value:function(){var e=this;return new Promise(function(){var t=_asyncToGenerator(_regeneratorRuntime.mark(function t(n){var r;return _regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=1e3*e.delay,t.next=3,e.onPageLoad();case 3:t.sent&&setTimeout(function(){return n(!0)},r);case 5:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}())}},{key:"onReengage",value:function(){var e=this;return new Promise(function(t){var n=1e3*e.delay,r=n,a=["click","mousemove","scroll","keypress"],o=[function(){return r=n},{passive:!0}];a.forEach(function(e){var t;return(t=document).addEventListener.apply(t,[e].concat(o))});var i=setInterval(function(){r<=0?(t(!0),clearInterval(i),a.forEach(function(e){var t;return(t=document).removeEventListener.apply(t,[e].concat(o))})):r-=100},100)})}},{key:"isTriggered",value:function(){var e=_asyncToGenerator(_regeneratorRuntime.mark(function e(){var t;return _regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.event,e.next="pageLoad"===e.t0?3:"click"===e.t0?7:"exitIntent"===e.t0?11:"delay"===e.t0?15:"reengage"===e.t0?19:"elementVisible"===e.t0?23:27;break;case 3:return e.next=5,this.onPageLoad();case 5:return t=e.sent,e.abrupt("break",28);case 7:return e.next=9,this.onClick();case 9:return t=e.sent,e.abrupt("break",28);case 11:return e.next=13,this.onExitIntent();case 13:return t=e.sent,e.abrupt("break",28);case 15:return e.next=17,this.onDelay();case 17:return t=e.sent,e.abrupt("break",28);case 19:return e.next=21,this.onReengage();case 21:return t=e.sent,e.abrupt("break",28);case 23:return e.next=25,this.onElementVisible();case 25:return t=e.sent,e.abrupt("break",28);case 27:t=!1;case 28:return e.abrupt("return",t);case 29:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}();function affected(){return!!window.ABTasty.getTestsOnPage()[TEST_ID]}var originalBodyScroll,PageWatcher=function(){function e(t,n,r){_classCallCheck(this,e),this.recurrence=t,this.isWidgetApplied=n,this.callback=r,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.observerParams=[document.body,{childList:!0,subtree:!0}],this.eventListenerParams=[TAG_RESET_EVENT,this.eventHandler.bind(this),{passive:!0}]}return _createClass(e,[{key:"decisionHandler",value:function(){var e=affected();!this.isWidgetApplied()&&e&&this.recurrence.isOver()?(this.callback(REBUILD_WIDGET),this.clearWatcher()):!e&&this.isWidgetApplied()&&this.callback(REMOVE_WIDGET)}},{key:"eventHandler",value:function(){var e=this;return setTimeout(function(){e.decisionHandler()},250),this}},{key:"observerHandler",value:function(e){var t=e.some(function(e){var t=e.removedNodes;return t&&t.length}),n=e.some(function(e){var t=e.addedNodes;return t&&t.length});return t||n?(this.decisionHandler(),this):this}},{key:"watch",value:function(){var e,t;return(e=document).addEventListener.apply(e,_toConsumableArray(this.eventListenerParams)),(t=this.observer).observe.apply(t,_toConsumableArray(this.observerParams)),this}},{key:"clearWatcher",value:function(){var e;return(e=document).removeEventListener.apply(e,_toConsumableArray(this.eventListenerParams)),this.observer.disconnect(),this}}]),e}();function preventGlobalScroll(){waitForElement("body",function(e){originalBodyScroll=window.getComputedStyle(e).overflowY,e.style.overflowY="hidden"},function(e){return console.error(e)})}function allowGlobalScroll(){waitForElement("body",function(e){originalBodyScroll&&(e.style.overflowY=originalBodyScroll)},function(e){return console.error(e)})}var loadImage=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.src=e,r.onerror=function(t){var r=new Error("Image ".concat(e," is not loaded."));n(r)}})},isTouch=function(){return void 0!==window.ontouchstart},exitIntent=function(e){var t,n=0;document.addEventListener("mousemove",function(e){n=e.clientY}),document.body.addEventListener("mouseleave",function r(a){a.clientY<=50&&(n=0,clearInterval(t),t=setTimeout(function(){0===n&&(e(),document.removeEventListener("mouseleave",r))},0))},!1)},log=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(e=console).log.apply(e,n)},domReady=function(e){"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e)},waitForElement=function(e,t,n){var r,a=0;try{document.querySelector(e)}catch(t){var o="Selector «".concat(e,"» not valid.");return log(o),"function"==typeof n&&n(o)}r=setTimeout(function(){clearInterval(a);var t="Can't find element «".concat(e,"».");return log(t),"function"==typeof n&&n(t)},1e4),a=setInterval(function(){var n=document.querySelector(e);if(null!==n)return clearTimeout(r),clearInterval(a),"function"==typeof t&&t(n)},200)},getCookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var a=n[r];" "==a.charAt(0);)a=a.substring(1);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return""},getHostname=function(){var e=document.location.hostname.split("").reverse().join("");null===(e=e.match(/(?:[a-z]{2,4}\.[a-z]{2,3}|[a-z]{2,5})\.[a-z0-9\-]+(?:\.|$)/i))?e=document.location.hostname:("."!=e[0].substr(e[0].length-1)&&(e[0]+="."),e=e[0].split("").reverse().join(""));return e},setCookie=function(e,t,n){var r="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),r="expires="+a.toUTCString()}var o="domain="+getHostname();document.cookie=e+"="+t+"; "+r+";"+o+";path=/"},getAccountIdentifier=function(){if(window.ABTasty||window.ABTASTY_S)return window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings?window.ABTasty.accountSettings.identifier:void 0},getVisitorId=function(){return window.ABTasty&&window.ABTasty.visitor?window.ABTasty.visitor.id:void 0};export{preventGlobalScroll,allowGlobalScroll,loadImage,isTouch,exitIntent,log,domReady,waitForElement,getCookie,getHostname,setCookie,getAccountIdentifier,getVisitorId,closingRecurrenceForm,displayRecurrenceForm,validationRecurrenceForm,recurrencesGroup,triggersForm,triggersGroup,isOnEditor,addGlobalUtil,syncRequest,asyncRequest,loadJS,findParent,getWidgetName,getUniqueId,getRecurrenceParams,getTriggerParams,backgroundColorForm,backgroundImageForm,backgroundOpacityForm,backgroundsGroup,borderColorForm,borderRadiusForm,borderWidthForm,bordersGroup,textColorForm,Popin,Banner,Free,WidgetContainer,Recurrence,Trigger,PageWatcher,backgroundTranslations,backgroundColorTranslations,backgroundImageTranslations,backgroundOpacityTranslations,borderTranslations,borderColorTranslations,borderRadiusTranslations,borderWidthTranslations,paddingTranslations,horizontalPaddingTranslations,verticalPaddingTranslations,marginTranslations,horiziontalMarginTranslations,verticalMarginTranslations,buttonsStylesTranslations,buttonsContrastTranslations,buttonsShapeTranslations,buttonsBackgroundColorTranslations,buttonsTextColorTranslations,buttonsBorderColorTranslations,buttonsBorderWidthTranslations,buttonsBorderRadiusTranslations,buttonTextTranslations,autoHideAfterUserValidationTranslations,hideAfterSecondsTranslations,fieldStylesTranslations,questionTranslations,thanksTranslations,customCssTranslations,notesTranslations,selectLayoutTranslations,popinTranslations,bannerTranslations,inThePageTranslations,freePlacementTransitions,adjustLayoutTranslations,selectReferenceElementTranslations,relativePositionToElementTranslations,containerTranslations,overlayOpacityTranslations,overlayColorTranslations,positionTranslations,topTranslations,atTheTopTranslation,bottomTranslations,atTheBottomTranslations,leftTranslations,atTheLeftTranslations,rightTranslations,atTheRightTranslations,aboveTranslations,beforeTranslations,atTheStartTranslations,atTheEndTranslations,afterTranslations,everydayTranslations,everyWeekTranslations,everyMonthTranslations,everySessionTranslations,everytimeTranslations,oncePerUserTranslations,recurrenceTranslations,displayRecurrenceTranslations,closingRecurrenceTranslations,validationRecurrenceTranslations,dropShadowTranslations,shadowOpacityTranslations,textColorTranslations,closeButtonColorTranslations,textPositionTranslations,themeTranslations,selectTheThemeTranslations,lightTranslations,darkTranslations,pageLoadTranslations,clickTranslations,exitIntentTranslations,delayTranslations,reengageInactivityTranslations,triggerOnTranslations,triggerTranslations,delayAfterExitIntentTranslations,idleTimeoutBeforePostingTraslations,triggerEventDelayTranslations,STYLE,LAYOUT,CONTENT,CONDITIONS,GROUP,CHECKBOX,COLOR_PICKER,SEPARATOR,DATE_PICKER,DATE_RANGE_PICKER,SELECT,MEDIA_UPLOAD,NUMBER,RADIO_BUTTON,RADIO_IMAGE,SLIDER,SWITCH,TEXT_FIELD,TEXT_AREA,TIME_PICKER,SELECT_ELEMENT,WYSIWYG,HIDDEN,ABTASTY_IMAGES_ROUTE,TAG_RESET_EVENT,REMOVE_WIDGET,REBUILD_WIDGET};
{
"name": "@abtasty/widget-utils",
"version": "1.12.8-1",
"version": "1.12.8-2",
"main": "dist/widget-utils.cjs.js",

@@ -5,0 +5,0 @@ "module": "dist/widget-utils.esm.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc