@abtasty/nps 0.4.10 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +52 -0
- package/dist/form.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +49 -47
package/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# NPS
|
2
|
+
|
3
|
+
This widget was generated using AB Tasty Widget CLI. You can find more infomation and documentation about widgets at https://abtasty.gitbooks.io/widget/.
|
4
|
+
|
5
|
+
## Preview your widget
|
6
|
+
|
7
|
+
Launch your widget in a new window and watch for changes.
|
8
|
+
```bash
|
9
|
+
npm start
|
10
|
+
```
|
11
|
+
|
12
|
+
## Main files
|
13
|
+
|
14
|
+
* `main.js`
|
15
|
+
Main source code of your widget
|
16
|
+
* `form.js`
|
17
|
+
Configuration form for your widget
|
18
|
+
* `icon.png`
|
19
|
+
Icon for your widget (recommended size: 200x200px)
|
20
|
+
|
21
|
+
You can specify each file location in the `package.json` like this:
|
22
|
+
```json
|
23
|
+
"main": "dist/main.js",
|
24
|
+
"form": "dist/form.js",
|
25
|
+
"icon": "icon.png",
|
26
|
+
```
|
27
|
+
|
28
|
+
## Included
|
29
|
+
|
30
|
+
* [Rollup.js](https://rollupjs.org/) module bundler (like Webpack but smaller and faster).
|
31
|
+
* ES6 support using [Babel](https://babeljs.io/).
|
32
|
+
* JavaScript Linting with [ESLint](http://eslint.org/) and [Airbnb style](https://github.com/airbnb/javascript).
|
33
|
+
* JavaScript minified with [UglifyJS](https://github.com/mishoo/UglifyJS2).
|
34
|
+
* [Prettier](https://prettier.io/) to format code.
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
**We heard your widget have an UI, so we allowed ourselves to include some extra:**
|
39
|
+
* [Pug](https://github.com/aMarCruz/rollup-plugin-pug) (aka Jade) to transforms html files into JS template.
|
40
|
+
* [PostCSS](https://github.com/egoist/rollup-plugin-postcss) to automatically append your CSS to head just using `import 'yourstyle.css'` and also use CSS plugins including:
|
41
|
+
* [CSSnext](http://cssnext.io/) to use the latest CSS syntax today.
|
42
|
+
* [cssnano](http://cssnano.co/) to minify CSS.
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
## Add your widget to AB Tasty
|
47
|
+
|
48
|
+
1. First, you'll need to have your widget on NPM:
|
49
|
+
* Create a minified bundle with `npm run build`
|
50
|
+
* Bump the version of your widget ([using semver](http://semver.org/)) with `npm version [patch|minor|major]`
|
51
|
+
* Publish it to NPM: `npm publish`
|
52
|
+
2. Once your widget is on NPM, you can now add it on AB Tasty at https://marketplace.abtasty.com/publish.
|
package/dist/form.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.widgetForm=t()}(this,function(){"use strict";var e=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var t=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var r=function(r){return e(r)||t(r)||n()};var o=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};var a=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var i=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var s=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var c=function(e){return a(e)||i(e)||s()};var l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e};function p(e,t){return e(t={exports:{}},t.exports),t.exports}var f=p(function(e){function t(n){"@babel/helpers - typeof";return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t});var h=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var g=function(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?h(e):t},m=p(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),y=p(function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t});var b=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)},v=p(function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),i=new T(r||[]);return a._invoke=function(e,t,n){var r=u;return function(o,a){if(r===p)throw new Error("Generator is already running");if(r===f){if("throw"===o)throw a;return B()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=N(i,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===u)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?f:d,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u="suspendedStart",d="suspendedYield",p="executing",f="completed",h={};function g(){}function m(){}function y(){}var b={};b[a]=function(){return this};var v=Object.getPrototypeOf,k=v&&v(v(O([])));k&&k!==n&&r.call(k,a)&&(b=k);var w=y.prototype=g.prototype=Object.create(b);function C(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function S(e,t){var n;this._invoke=function(o,a){function i(){return new t(function(n,i){!function n(o,a,i,s){var c=l(e[o],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then(function(e){n("next",e,i,s)},function(e){n("throw",e,i,s)}):t.resolve(d).then(function(e){u.value=e,i(u)},function(e){return n("throw",e,i,s)})}s(c.arg)}(o,a,n,i)})}return n=n?n.then(i,i):i()}}function N(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,N(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function O(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:B}}function B(){return{value:t,done:!0}}return m.prototype=w.constructor=y,y.constructor=m,y[s]=m.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},C(S.prototype),S.prototype[i]=function(){return this},e.AsyncIterator=S,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new S(c(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then(function(e){return e.done?e.value:i.next()})},C(w),w[s]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}});function k(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var w=function(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){k(a,r,o,i,s,"next",e)}function s(e){k(a,r,o,i,s,"throw",e)}i(void 0)})}},C={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"},S={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},N={en:"".concat(S.en," of the display"),fr:"".concat(S.fr," de l'affichage"),es:"".concat(S.es," de visualización"),de:"".concat(S.de," der Anzeige")},x={en:"".concat(S.en," after closure"),fr:"".concat(S.fr," après fermeture"),es:"".concat(S.es," tras el cierre"),de:"".concat(S.de," nach Schließung")},E={en:"".concat(S.en," after validation"),fr:"".concat(S.fr," après validation"),es:"".concat(S.es," tras la validación"),de:"".concat(S.de," nach der Validierung")},T={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},O="style",B="content",P="slider",_="https://widgets-images.abtasty.com/";function A(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 L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(n,!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var R,j={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada dÃa",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},I=L({},j,{label:x,propName:"closingRecurrence"}),z={category:"conditions",type:"group",label:S,collapsible:!0,children:[L({},j,{label:N,propName:"displayRecurrence"}),I,L({},j,{label:E,propName:"validationRecurrence"})]},D=[{label:{en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},value:"pageLoad"},{label:{en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},value:"exitIntent"},{label:{en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},value:"delay"},{label:{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"},value:"reengage"}],M={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:T,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:"triggerEvent",value:"click"}]},F={category:"conditions",type:"number",propName:"".concat("triggerEvent","ExitDelay"),label:{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"},min:0,max:120,value:0,conditions:[{field:"triggerEvent",value:"exitIntent"}]},q={category:"conditions",type:"number",propName:"".concat("triggerEvent","ReengageDelay"),label:{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"},min:1,max:120,value:10,conditions:[{field:"triggerEvent",value:"reengage"}]},V={category:"conditions",type:"number",propName:"".concat("triggerEvent","Delay"),label:{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"},value:10,conditions:[{field:"triggerEvent",value:"delay"}]},W={category:"conditions",type:"group",label:T,collapsible:!0,children:[{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},options:D,propName:"triggerEvent",value:"pageLoad"}].concat(c([M,F,q,V]))},H=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},K=((R="undefined"!=typeof global?global:window).ABTasty||Object.assign(R,{ABTasty:{widgetutils:{}}}),R.ABTasty.widgetutils||Object.assign(R.ABTasty,{widgetutils:{}}),R).ABTasty.widgetutils;function G(e,t){return K.hasOwnProperty(e)||Object.assign(K,o({},e,new t)),K[e]}var Q={category:O,type:"colorpicker",label:{en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},J={category:O,type:P,label:{en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},propName:"backgroundOpacity",value:75,unit:"%"},U={category:O,type:"colorpicker",label:{en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},propName:"borderColor",value:"rgba(255, 255, 255, 1)"},Y={category:O,type:P,label:{en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},propName:"borderRadius",value:0,unit:"px"},Z={category:O,type:P,label:{en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},propName:"borderWidth",value:0,unit:"px"},X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"000000",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";l(this,e),this.uniqueId=t,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerId="".concat(this.basicClassName,"_").concat(t),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(t),this.domElement=this.getDom()}return d(e,[{key:"insert",value:function(){var e=this;return re("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),re("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}},{key:"hide",value:function(){return this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){return this.insert(),this.addCloseEvent(),this}},{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,c(t)),r.forEach(function(t){t.addEventListener("click",function(){e.hide()},!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(H()?"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",H()&&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}();(function(e){function t(e,n){var r;return l(this,t),(r=g(this,m(t).call(this,e,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}b(t,X),d(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}")}}])})(),function(e){function t(e,n,r){var o;return l(this,t),(o=g(this,m(t).call(this,e,n))).position=r,o.stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}b(t,X),d(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}")}}])}(),function(e){function t(e,n,r,o){var a;return l(this,t),(a=g(this,m(t).call(this,e,n))).position=r,a.referrerElement=o,a.stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}b(t,X),d(t,[{key:"insert",value:function(){var e=this;return re("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),re(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}")}}])}(),function(){function e(t){var n=t.displayRecurrence,r=t.closingRecurrence,o=t.validationRecurrence,a=t.widgetName,i=t.uniqueId;l(this,e),this.displayRecurrence=parseFloat(n),this.closingRecurrence=parseFloat(r),this.validationRecurrence=parseFloat(o),this.storageName="Rec_".concat(a,"_").concat(i)}d(e,[{key:"getSessionRecurrenceStorage",value:function(){return sessionStorage.getItem(this.storageName)}},{key:"getLocalRecurrenceStorage",value:function(){return localStorage.getItem(this.storageName)}},{key:"removeSessionRecurrenceStorage",value:function(){return sessionStorage.removeItem(this.storageName)}},{key:"removeLocalRecurrenceStorage",value:function(){return localStorage.removeItem(this.storageName)}},{key:"getSessionRecurrence",value:function(){var e=this.getSessionRecurrenceStorage();try{return JSON.parse(e)}catch(e){return console.error("Cannot parse recurrence from storage, format is wrong, more details : ".concat(e)),!1}}},{key:"getLocalRecurrence",value:function(){var e=this.getLocalRecurrenceStorage();try{return JSON.parse(e)}catch(e){return console.error("Cannot parse recurrence from storage, format is wrong, more details : ".concat(e)),!1}}},{key:"getCurrentRecurrence",value:function(){return this.getSessionRecurrenceStorage()?this.getSessionRecurrence():this.getLocalRecurrenceStorage()?this.getLocalRecurrence():{type:!1}}},{key:"isOver",value:function(){var e=this.getLocalRecurrence(),t=(e?parseFloat(e.stamp):0)<(new Date).getTime();return t&&localStorage.removeItem(this.storageName),t&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(e,t){var n=this,r=this.getTypeOfStorage(e),o=this.getStamp(e),a={type:t,stamp:o},i=this.getCurrentRecurrence().type,s=function(){n.getSessionRecurrenceStorage()&&n.removeSessionRecurrenceStorage(),n.getLocalRecurrenceStorage()&&n.removeLocalRecurrenceStorage(),r.setItem(n.storageName,JSON.stringify(a))};if(!r)return!1;if(i&&"validation"!==t)if("closing"===t&&"validation"!==i)s();else{if("display"!==t||"validation"===i||"closing"===i)return!1;s()}else s();return o}},{key:"setDisplayRecurrence",value:function(){this.setRecurrence(this.displayRecurrence,"display")}},{key:"setClosingRecurrence",value:function(){this.setRecurrence(this.closingRecurrence,"closing")}},{key:"setValidationRecurrence",value:function(){this.setRecurrence(this.validationRecurrence,"validation")}},{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?window.localStorage:0===e&&window.sessionStorage)}}])}();function $(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(e="",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}));var e}function ee(e){return function(){return w(v.mark(function e(t){return v.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,$();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)}.apply(this,arguments)}var te=function(){function e(){l(this,e),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return d(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"===function e(t,n){return n(t)||!t.parentElement?t:e(t.parentElement,n)}(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,i=(a=document).elementFromPoint.apply(a,c(n[o]));r=e===i||e.contains(i),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}(),ne=(function(){function e(t){var n=t.triggerEvent,r=t.triggerSelector,o=t.triggerDelay;l(this,e),this.event=n,this.selector=r&&r.length?r:"body",this.delay=o}d(e,[{key:"onElementVisible",value:function(){var e,t=this;return new Promise((e=w(v.mark(function e(n){var r,o,a;return v.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.onPageLoad();case 2:return r=e.sent,e.next=5,ee();case 5:o=e.sent,a=G("VisibilityObserver",te),o&&r&&a.watch(t.selector,n);case 8:case"end":return e.stop()}},e)})),function(t){return e.apply(this,arguments)}))}},{key:"onPageLoad",value:function(){return new Promise(function(e,t){if("complete"===document.readyState)return e(!0);var n,r=["DOMContentLoaded",function(){return e(!0)},{passive:!0,once:!0}];(n=window).addEventListener.apply(n,r),setTimeout(function(){var e;return(e=window).removeEventListener.apply(e,r),t(!1)},15e3)})}},{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 c(document.querySelectorAll(e.selector)).some(function(n){return n.isSameNode(t)||!!t.closest(e.selector)})},a=["click",function(e){return!!o(e.target)&&(document.head.removeChild(t),n(!0))},{passive:!0,once:!0,capture:!0}];(r=document).addEventListener.apply(r,a)})}},{key:"onExitIntent",value:function(){var e,t=this;return new Promise((e=w(v.mark(function e(n){var r;return v.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=["mouseleave",function(){var e=w(v.mark(function e(){var r;return v.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.delay){e.next=5;break}r=1e3*t.delay,setTimeout(function(){return n(!0)},r),e.next=6;break;case 5:return e.abrupt("return",n(!0));case 6:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),{passive:!0,once:!0}],e.next=4,t.onPageLoad();case 4:e.sent&&re("body",function(e){return e.addEventListener.apply(e,r)});case 6:case"end":return e.stop()}},e)})),function(t){return e.apply(this,arguments)}))}},{key:"onDelay",value:function(){var e,t=this;return new Promise((e=w(v.mark(function e(n){var r;return v.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=1e3*t.delay,e.next=3,t.onPageLoad();case 3:e.sent&&setTimeout(function(){return n(!0)},r);case 5:case"end":return e.stop()}},e)})),function(t){return e.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 i=setInterval(function(){r<=0?(t(!0),clearInterval(i),o.forEach(function(e){var t;return(t=document).removeEventListener.apply(t,[e].concat(a))})):r-=100},100)})}},{key:"isTriggered",value:function(){var e=w(v.mark(function e(){var t;return v.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)}}()}])}(),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)}),re=function(e,t,n){var r,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return ne(a),"function"==typeof n&&n(a)}r=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return ne(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)},oe='<a href="https://app2.abtasty.com/insights/nps" target="_blank">',ae={en:"".concat(oe,"Access the NPS© results").concat("</a>"),fr:"".concat(oe,"Accéder aux résultats du NPS©").concat("</a>"),es:"".concat(oe,"Acceder a los resultados del NPS©").concat("</a>"),de:"".concat(oe,"Zugang zu den NPS-Ergebnissen").concat("</a>")},ie={en:"Open-ended question",fr:"Question ouverte",es:"Pregunta abierta",de:"Offene Frage"},se="\ndiv.nps_container\n\tp.nps_container_question\n\tdiv.nps_container_notes\n\t\tbutton.nps_container_notes_button[data-note]\n\t\t\tspan\n\n\tp.nps_container_question_feedback\n\tform.nps_container_question_feedback_form\n\t\tinput.nps_container_question_feedback_input\n\t\tbutton.nps_container_question_feedback_button\n\t\n\tp.nps_container_thanks",ce={en:"The variation CSS can be used to customize\nthe NPS widget.\n\nWe recommend using your browser’s development tools\nto test any changes.\n\nThe Document Object Model (DOM) of the NPS widget\nis as follows:\n".concat(se),fr:"Vous pouvez utiliser l'ajout CSS de la variation\npour personnaliser le Widget NPS.\n\nNous vous recommandons d’utiliser les outils de\ndéveloppement de votre navigateur pour tester vos modifications.\n\nLe Document Object Model (DOM) du widget NPS est le suivant:\n".concat(se),es:"Puedes utilizar el CSS de la variación\npara personalizar el Widget NPS.\n\nTe recomendamos que utilices las herramientas de desarrollo\nde tu navegador para probar las modificaciones.\n\nEl Document Object Model (DOM) del widget NPS es el siguiente:",de:"Sie können die 'CSS hinzufügen'-Funktion der\nVariation wählen, um den Style des NPS nach\nIhren Wünschen anzupassen.\n\nWir empfehlen Ihre Browser Developer Tools zu verwenden,\num Ihre Änderungen zu testen.\n\nHier ist die DOM-Struktur des NPS:"},le=[{field:"isFeedBackQuestion",value:!0}],ue=[{category:B,type:"hidden",propName:"__npsCampaignId",value:!1},{category:B,type:"paragraph",propName:"linkToNPSCampaignsList",text:ae},{category:B,type:"textarea",propName:"question",label:{en:"Question",fr:"Question",es:"Pregunta",de:"Frage"},value:{en:"How likely are you to recommend us to a friend or family member ?",fr:"Quelle est la probabilité que vous nous recommandiez à un proche ?",es:"¿ Cuál es la probabilidad de que nos recomiendes a alguien ?",de:"Wie hoch ist die Wahrscheinlichkeit, dass Sie uns weiterempfehlen?"}},{category:B,type:"checkbox",propName:"isFeedBackQuestion",label:{en:"Ask an open-ended question",fr:"Poser une question ouverte",es:"Hacer una pregunta abierta",de:"Eine offene Frage stellen"},value:!1},{category:B,type:"textarea",propName:"feedbackQuestion",label:ie,value:{en:"Would you like to leave a comment ?",fr:"Souhaitez-vous laisser un commentaire ?",es:"¿ Quieres dejar un comentario ?",de:"Möchten Sie einen Kommentar eingeben ?"},conditions:le},{category:B,type:"text",propName:"buttonText",label:{en:"Button text",fr:"Texte du bouton",es:"Texto del botón",de:"Button-Text"},value:{en:"Send",fr:"Envoyer",es:"Enviar",de:"Senden"},conditions:le},{category:B,type:"checkbox",propName:"isThankYouMessage",label:{en:"Display a thank you message",fr:"Afficher un message de remerciement",es:"Mostrar un mensaje de agradecimiento",de:"Den Besuchern eine Danke-Nachricht anzeigen"},value:!1},{category:B,type:"textarea",propName:"thankYouMessage",label:{en:"Thank you message",fr:"Message de remerciement",es:"Mensaje de agradecimiento",de:"Danke-Botschaft"},value:{en:"Thank you for your reply.",fr:"Merci d'avoir répondu.",es:"Gracias por tus respuestas.",de:"Vielen Dank für Ihr Feedback."},conditions:[{field:"isThankYouMessage",value:!0}]},{category:B,type:"checkbox",propName:"isLegend",label:{en:"Display key",fr:"Afficher un légende",es:"Mostrar una leyenda",de:"Legende anzeigen"},value:!1},{category:B,type:"text",propName:"zeroLegend",label:{en:"Key of the lowest rating",fr:"Légende de la note minimale",es:"Leyenda de la nota mÃnima",de:"Legende neben 0"},value:{en:"Very unlikely",fr:"Très faible",es:"Muy baja",de:"Sehr gering"},conditions:[{field:"isLegend",value:!0}]},{category:B,type:"text",propName:"tenLegend",label:{en:"Key of the highest rating",fr:"Légende de la note maximale",es:"Leyenda de la nota máxima",de:"Legende neben 10"},value:{en:"Very likely",fr:"Très élevée",es:"Muy alta",de:"Sehr hoch"},conditions:[{field:"isLegend",value:!0}]}],de=[{category:"layout",type:"radioImage",propName:"layout",label:{en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},value:"popin",options:[{label:{en:"Modal",fr:"Pop-in",es:"Pop-in",de:"Pop-in"},value:"popin",src:"".concat(_,"layout/popin.svg")},{label:{en:"Banner",fr:"Bannière",es:"Banner",de:"Banner"},value:"banner",src:"".concat(_,"banner/bottom.png")},{label:{en:"Free placement",fr:"Placement libre",es:"Integrado",de:"Freie Platzierung "},value:"free",src:"".concat(_,"layout/free.svg")}]},{category:"layout",type:"radioImage",propName:"bannerPosition",label:{en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},value:"bottom",conditions:[{field:"layout",value:"banner"}],options:[{label:{en:"At the bottom",fr:"En bas",es:"Abajo",de:"Unten"},value:"bottom",src:"".concat(_,"banner/bottom.png")},{label:{en:"At the top",fr:"En haut",es:"Arriba",de:"Oben"},value:"top",src:"".concat(_,"banner/top.png")}]},{category:"layout",type:"selectelement",propName:"npsElementReferrer",label:C,value:"body",conditions:[{field:"layout",value:"free"}]},{category:"layout",type:"select",propName:"npsReferrerInsertType",value:"beforeend",conditions:[{field:"layout",value:"free"}],label:C,options:[{label:{en:"Before",fr:"Avant",es:"Antes",de:"Vor"},value:"beforebegin"},{label:{en:"At the start",fr:"Au début",es:"Al principio",de:"Am Anfang"},value:"afterbegin"},{label:{en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},value:"beforeend"},{label:{en:"After",fr:"Après",es:"Después",de:"Hinter"},value:"afterend"}]},{category:"layout",type:"radio",propName:"contentDirection",value:"column",label:{en:"Text position",fr:"Positionnement du contenu",es:"Posición del texto",de:"Ausrichtung des Inhalts"},options:[{label:{en:"Above",fr:"Au-dessus",es:"Arriba",de:"Spalte"},value:"column"},{label:{en:"At the left",fr:"À gauche",es:"A la izquierda",de:"Reihe"},value:"row"}]}],pe=[z,W,{category:"conditions",type:"checkbox",propName:"autoHide",value:!0,label:{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"}},{category:"conditions",type:"number",propName:"timeHide",value:2,label:{en:"Hide after x seconds",fr:"Masquer après x secondes",es:"Ocultar tras x segundos",de:"Nach X Sekunden ausblenden"},conditions:[{field:"autoHide",value:!0}]}];var fe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function he(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 ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(n,!0).forEach(function(t){fe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var me="rgba(255, 255, 255, 1)",ye="rgb(33, 121, 129, 1)",be=[{field:"themeType",value:"theme"}],ve=[{field:"buttonsContrast",value:"full"}],ke=[{field:"buttonsContrast",value:"empty"}],we={borderWidth:2,borderRadius:10,borderColor:ye,backgroundColor:me,overlayColor:"rgba(0, 0, 0, 1)",overlayOpacity:50,textColor:ye,questionMargin:15,horizontalPaddingContainer:20,verticalPaddingContainer:15,horizontalMarginContainer:0,verticalMarginContainer:0,dropShadow:!1,shadowOpacity:0,buttonsHorizontalMargin:5,buttonsContrast:"full",buttonsShape:"roundsquare",buttonsBorderRadius:8,buttonsBackgroundColor_full:ye,buttonsBackgroundColor_empty:me,buttonsTextColor_full:me,buttonsTextColor_empty:ye,buttonsBorderColor_full:ye,buttonsBorderColor_empty:ye,buttonsBorderWidth_full:0,buttonsBorderWidth_empty:2,inputBackgroundColor:me,inputBorderColor:ye,inputBorderWidth:2,inputBorderRadius:8,inputTextColor:ye,inputMarginWithButton:10,feedbackButtonBackgroundColor:me,feedbackButtonBorderColor:ye,feedbackButtonBorderWidth:2,feedbackButtonBorderRadius:8,feedbackButtonTextColor:ye},Ce=[{themeValue:"lightTheme",defaultValues:ge({},we)},{themeValue:"darkTheme",defaultValues:ge({},we,{borderColor:ye,backgroundColor:ye,overlayOpacity:75,textColor:me,buttonsContrast:"empty",buttonsBackgroundColor_full:me,buttonsBackgroundColor_empty:ye,buttonsTextColor_full:ye,buttonsTextColor_empty:me,buttonsBorderColor_full:me,buttonsBorderColor_empty:me,buttonsBorderWidth_full:2,buttonsBorderWidth_empty:2,inputBackgroundColor:ye,inputBorderColor:me,inputTextColor:me,feedbackButtonBackgroundColor:ye,feedbackButtonBorderColor:me,feedbackButtonTextColor:me})}],Se={category:O,type:"group",collapsible:!0,conditions:be},Ne={category:O,type:"colorpicker",label:{en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},propName:"buttonsBackgroundColor",value:me},xe={category:O,type:"colorpicker",label:{en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},propName:"buttonsTextColor",value:ye},Ee={category:O,type:"colorpicker",label:{en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},propName:"buttonsBorderColor",value:ye},Te={category:O,type:P,label:{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"},propName:"buttonsBorderWidth",value:2,unit:"px"},Oe={category:O,type:"radio",propName:"stepToShow",value:"displayNoteStep",label:{en:"Section to be personalized",fr:"Partie à personnaliser",es:"Parte personalizable",de:"Schritt zur Bearbeitung"},options:[{label:{en:"Notes",fr:"Notes",es:"Notas",de:"Notiz"},value:"displayNoteStep"},{label:ie,value:"displayFeedbackStep"},{label:{en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},value:"displayThanksStep"}]},Be=ge({},Q,{propName:"overlayColor",label:{en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"}}),Pe=ge({},J,{propName:"overlayOpacity",label:{en:"Overlay opacity",fr:"Opacité de l'overlay",es:"Opacidad superpuesta",de:"Deckkraft überlagern"}}),_e={category:O,type:"radioImage",propName:"themeType",label:{en:"Type of personalization",fr:"Type de personnalisation",es:"Tipo de personalización",de:"Typ auswählen"},value:"theme",options:[{label:{en:"Theme",fr:"Thème",es:"Tema",de:"Typ"},value:"theme",src:"".concat(_,"style/theme.svg")},{label:{en:"Custom CSS",fr:"CSS Personnalisé",es:"CSS personalizado",de:"Custom CSS"},value:"customCss",src:"".concat(_,"style/custom.svg")}]},Ae={category:O,type:"paragraph",propName:"customCssDetails",text:ce,conditions:[{field:"themeType",value:"customCss"}]},Le={category:O,type:"radio",propName:"theme",label:{en:"Select an appearance",fr:"Sélectionner une apparence",es:"Seleccionar una apariencia",de:"Thema auswählen"},value:"lightTheme",conditions:be,options:[{label:ge({},{en:"Light",fr:"Clair",es:"Claro",de:"Hell"},{fr:"Claire"}),value:"lightTheme"},{label:{en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},value:"darkTheme"}]},Re=[ge({},Se,{label:{en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},conditions:be,children:[Z,Y,U]}),ge({},Se,{label:{en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},conditions:be,children:[Q,Be,Pe]}),ge({},Se,{label:{en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},children:[{category:O,type:"colorpicker",label:{en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},propName:"textColor",value:ye},{category:O,type:P,label:{en:"Question / Reply spacing",fr:"Espacement Question / Réponse",es:"Espaciado entre la pregunta y la respuesta",de:"Margin Frage/Antwort"},propName:"questionMargin",value:15,unit:"px"},{category:O,type:P,label:{en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},propName:"horizontalPaddingContainer",value:0,unit:"px"},{category:O,type:P,label:{en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},propName:"verticalPaddingContainer",value:0,unit:"px"},{category:O,type:P,label:{en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},propName:"horizontalMarginContainer",value:0,unit:"px"},{category:O,type:P,label:{en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},propName:"verticalMarginContainer",value:0,unit:"px"},{category:O,type:"switch",label:{en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},propName:"dropShadow",value:!1},{category:O,type:P,label:{en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},propName:"shadowOpacity",value:0,unit:"%",conditions:[{field:"dropShadow",value:!0}]}]}),ge({},Se,{label:{en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},conditions:[{field:"themeType",value:"theme"},{field:"stepToShow",value:"displayNoteStep"}],children:[{category:O,type:P,label:{en:"Margin between buttons",fr:"Espace entre les boutons",es:"Espacio entre los botones",de:"Abstand zwischen den Buttons"},propName:"buttonsHorizontalMargin",value:5,unit:"px"},{category:O,type:"radioImage",label:{en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},propName:"buttonsContrast",value:"full",options:[{value:"full",src:"".concat(_,"nps/button-contrast-1.svg")},{value:"empty",src:"".concat(_,"nps/button-contrast-2.svg")}]},{category:O,type:"radioImage",label:{en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},propName:"buttonsShape",value:"roundsquare",options:[{value:"square",src:"".concat(_,"nps/button-shape-1.svg")},{value:"roundsquare",src:"".concat(_,"nps/button-shape-2.svg")},{value:"round",src:"".concat(_,"nps/button-shape-3.svg")}]},{category:O,type:P,label:{en:"Buttons border radius",fr:"Arrondi de la bordure des boutons",es:"Redondeo del borde de los botones",de:"Konturradius der Buttons"},propName:"buttonsBorderRadius",value:8,unit:"px",min:1,conditions:[{field:"buttonsShape",value:"roundsquare"}]},ge({},Ne,{conditions:ve,propName:"".concat(Ne.propName,"_full")}),ge({},Ne,{conditions:ke,propName:"".concat(Ne.propName,"_empty")}),ge({},xe,{conditions:ve,propName:"".concat(xe.propName,"_full")}),ge({},xe,{conditions:ke,propName:"".concat(xe.propName,"_empty")}),ge({},Ee,{conditions:ve,propName:"".concat(Ee.propName,"_full")}),ge({},Ee,{conditions:ke,propName:"".concat(Ee.propName,"_empty")}),ge({},Te,{conditions:ve,propName:"".concat(Te.propName,"_full")}),ge({},Te,{conditions:ke,propName:"".concat(Te.propName,"_empty")})]}),ge({},Se,{label:{en:"Field style",fr:"Style du champ",es:"Estilo del campo",de:"Input-Styles"},conditions:[{field:"themeType",value:"theme"},{field:"stepToShow",value:"displayFeedbackStep"}],children:[{category:O,type:"colorpicker",label:{en:"Comment field background color",fr:"Couleur de fond du champ commentaire",es:"Color de fondo del campo Comentarios",de:"Hintergrundfarbe Feedback Input"},propName:"inputBackgroundColor",value:me},{category:O,type:"colorpicker",label:{en:"Comment field border color",fr:"Couleur de la bordure du champ commentaire",es:"Color del borde del campo Comentarios",de:"Konturfarbe Feedback Input"},propName:"inputBorderColor",value:ye},{category:O,type:P,label:{en:"Comment field border thickness",fr:"Épaisseur de la bordure du champ commentaire",es:"Grosor del borde del campo Comentarios",de:"Konturbreite Feedback Input"},propName:"inputBorderWidth",value:1,unit:"px"},{category:O,type:P,label:{en:"Comment field border radius",fr:"Arrondi de la bordure du champ commentaire",es:"Contorno del borde del campo Comentarios",de:"Konturradius Feedback Input"},propName:"inputBorderRadius",value:8,unit:"px"},{category:O,type:"colorpicker",label:{en:"Comment field text color",fr:"Couleur du texte du champ commentaire",es:"Color del texto del campo Comentarios",de:"Textfarbe Feedback Input"},propName:"inputTextColor",value:ye},{category:O,type:P,label:{en:"Spacing between the field and the send button",fr:"Espace entre le champ et le bouton d’envoi",es:"Espacio entre el campo y el botón de envÃo",de:"Abstand mit Button"},propName:"inputMarginWithButton",value:10,unit:"px"}]}),ge({},Se,{label:{en:"Send button style",fr:"Style du bouton d'envoi",es:"Estilo del botón de envÃo",de:"Style Abschicken-Button"},conditions:[{field:"themeType",value:"theme"},{field:"stepToShow",value:"displayFeedbackStep"}],children:[{category:O,type:"colorpicker",label:{en:"Send button background color",fr:"Couleur de fond du bouton d’envoi",es:"Color de fondo del botón de envÃo",de:"Hintergrundfarbe Abschicken-Button"},propName:"feedbackButtonBackgroundColor",value:me},{category:O,type:"colorpicker",label:{en:"Send button border color",fr:"Couleur de la bordure du bouton d’envoi",es:"Color del borde del botón de envÃo",de:"Konturfarbe Feedback Button"},propName:"feedbackButtonBorderColor",value:ye},{category:O,type:P,label:{en:"Send button border thickness",fr:"Épaisseur de la bordure du bouton d’envoi",es:"Grosor del borde del botón de envÃo",de:"Konturbreite Feedback Button"},propName:"feedbackButtonBorderWidth",value:1,unit:"px"},{category:O,type:P,label:{en:"Send button border radius",fr:"Arrondi de la bordure du bouton d'envoi",es:"Contorno del borde del botón de envÃo",de:"Konturradius Feedback Button"},propName:"feedbackButtonBorderRadius",value:8,unit:"px"},{category:O,type:"colorpicker",label:{en:"Send button text color",fr:"Couleur du texte du bouton d’envoi",es:"Color del texto del botón de envÃo",de:"Textfarbe Feedback Button"},propName:"feedbackButtonTextColor",value:ye}]})];function je(e,t,n){return e.map(function(e){var o=e.propName,a=e.conditions,i=t[o],s="".concat(n,"_").concat(o),c=function(e,t){return e&&e.length>0&&e.reduce(function(e,n){var o=n.field,a=n.value;return[].concat(r(e),[{field:"".concat(t,"_").concat(o),value:a}])},[])}(a,n),l=ge({},e,{value:i,propName:s});return c&&c.length&&(l.conditions=c),l})}var Ie=Ce.map(function(e){var t=e.themeValue,n=e.defaultValues;return function(e,t,n){return e.map(function(e){var o=e.conditions,a=e.children;return ge({},e,{conditions:[].concat(r(o),[{field:"theme",value:t}]),children:je(a,n,t)})})}([].concat(Re),t,n)}).flat(),ze=[Oe,_e,Ae,Le].concat(r(Ie));return[].concat(r(pe),r(ue),r(de),r(ze))});
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.widgetForm=t()}(this,function(){"use strict";var e=function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}};var t=function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var r=function(r){return e(r)||t(r)||n()};var o=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e};function a(e,t){return e(t={exports:{}},t.exports),t.exports}var i=a(function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),i=new T(r||[]);return a._invoke=function(e,t,n){var r=u;return function(o,a){if(r===p)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw a;return P()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=x(i,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===u)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?h:d,c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(e,n,i),a}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u="suspendedStart",d="suspendedYield",p="executing",h="completed",f={};function g(){}function v(){}function m(){}var y={};y[a]=function(){return this};var b=Object.getPrototypeOf,k=b&&b(b(O([])));k&&k!==n&&r.call(k,a)&&(y=k);var w=m.prototype=g.prototype=Object.create(y);function S(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function C(e){var t;this._invoke=function(n,o){function a(){return new Promise(function(t,a){!function t(n,o,a,i){var s=l(e[n],e,o);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then(function(e){t("next",e,a,i)},function(e){t("throw",e,a,i)}):Promise.resolve(u).then(function(e){c.value=e,a(c)},function(e){return t("throw",e,a,i)})}i(s.arg)}(n,o,t,a)})}return t=t?t.then(a,a):a()}}function x(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,x(e,n),"throw"===n.method))return f;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var o=l(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,f;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,f):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:P}}function P(){return{value:t,done:!0}}return v.prototype=w.constructor=m,m.constructor=v,m[s]=v.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},S(C.prototype),C.prototype[i]=function(){return this},e.AsyncIterator=C,e.async=function(t,n,r,o){var a=new C(c(t,n,r,o));return e.isGeneratorFunction(n)?a:a.next().then(function(e){return e.done?e.value:a.next()})},S(w),w[s]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=O,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),l=r.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),f}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}});function s(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}var c=function(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){s(a,r,o,i,c,"next",e)}function c(e){s(a,r,o,i,c,"throw",e)}i(void 0)})}};var l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var d=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e},p=a(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(r){return"function"==typeof Symbol&&"symbol"===t(Symbol.iterator)?e.exports=n=function(e){return t(e)}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":t(e)},n(r)}e.exports=n});var h=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e};var f=function(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?h(e):t},g=a(function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t}),v=a(function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t});var m=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)};var y=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o};var b=function(e,t){if(null==e)return{};var n,r,o=y(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o};var k=function(e){if(Array.isArray(e))return e};var w=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var S=function(e){return k(e)||t(e)||w()},C={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"},x={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},E={en:"".concat(x.en," of the display"),fr:"".concat(x.fr," de l'affichage"),es:"".concat(x.es," de visualización"),de:"".concat(x.de," der Anzeige")},N={en:"".concat(x.en," after closure"),fr:"".concat(x.fr," après fermeture"),es:"".concat(x.es," tras el cierre"),de:"".concat(x.de," nach Schließung")},T={en:"".concat(x.en," after validation"),fr:"".concat(x.fr," après validation"),es:"".concat(x.es," tras la validación"),de:"".concat(x.de," nach der Validierung")},O={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},P="style",B="content",A="slider",L="https://widgets-images.abtasty.com/",_="abtasty_resetActionTracking";function R(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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(n,!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var I,D={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},z=j({},D,{label:N,propName:"closingRecurrence"}),W={category:"conditions",type:"group",label:x,collapsible:!0,children:[j({},D,{label:E,propName:"displayRecurrence"}),z,j({},D,{label:T,propName:"validationRecurrence"})]},M=[{label:{en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},value:"pageLoad"},{label:{en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},value:"exitIntent"},{label:{en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},value:"delay"},{label:{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"},value:"reengage"}],F={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:O,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:"triggerEvent",value:"click"}]},q={category:"conditions",type:"number",propName:"".concat("triggerEvent","ExitDelay"),label:{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"},min:0,max:120,value:0,conditions:[{field:"triggerEvent",value:"exitIntent"}]},V={category:"conditions",type:"number",propName:"".concat("triggerEvent","ReengageDelay"),label:{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"},min:1,max:120,value:10,conditions:[{field:"triggerEvent",value:"reengage"}]},H={category:"conditions",type:"number",propName:"".concat("triggerEvent","Delay"),label:{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"},value:10,conditions:[{field:"triggerEvent",value:"delay"}]},G={category:"conditions",type:"group",label:O,collapsible:!0,children:[{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},options:M,propName:"triggerEvent",value:"pageLoad"}].concat(r([F,q,V,H]))},K=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")},Q=((I="undefined"!=typeof global?global:window).ABTasty||Object.assign(I,{ABTasty:{widgetutils:{}}}),I.ABTasty.widgetutils||Object.assign(I.ABTasty,{widgetutils:{}}),I).ABTasty.widgetutils;function U(e,t){return Q.hasOwnProperty(e)||Object.assign(Q,o({},e,new t)),Q[e]}var J=function(){return"".concat(PACKAGE.replace("@abtasty/","")).concat(DATA&&DATA.type?"_".concat(DATA.type):"")},Y=function(){return"".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID)},Z=function(){if(K())return!1;var e=DATA;return{displayRecurrence:e.displayRecurrence,closingRecurrence:e.closingRecurrence,validationRecurrence:e.validationRecurrence}},X=function(){if(K())return!1;var e,t=DATA,n=t.triggerEvent,r=t.triggerEventClick,o=t.triggerEventExitDelay,a=t.triggerEventDelay,i=t.triggerEventReengageDelay,s=r;switch(n){case"exitIntent":e=o;break;case"delay":e=a;break;case"reengage":e=i;break;default:e=0}return{triggerEvent:n,triggerSelector:s,triggerDelay:e}};function $(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(e="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver",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}));var e}function ee(e){return function(){return c(i.mark(function e(t){return i.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,$();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)}.apply(this,arguments)}var te={category:P,type:"colorpicker",label:{en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},ne={category:P,type:"colorpicker",label:{en:"Border color",fr:"Couleur du contour",es:"Color del contorno",de:"Farbe der Kontur"},propName:"borderColor",value:"rgba(255, 255, 255, 1)"},re={category:P,type:A,label:{en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},propName:"borderRadius",value:0,unit:"px"},oe={category:P,type:A,label:{en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},propName:"borderWidth",value:0,unit:"px"},ae=["pageLoad","delay","reengage"],ie=function(){function e(){var t=this;l(this,e),this.uniqueId=Y(),this.widgetName=J(),this.recurrenceParams=Z(),this.triggerParams=X(),this.recurrence=!!this.recurrenceParams&&new le(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new de(this.triggerParams),this.pageWatcher=new pe(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=!!this.trigger&&ae.some(function(e){return e===t.trigger.event}),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(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[]}return d(e,[{key:"clearGivenClearables",value:function(){this.eventsListeners.length&&(this.eventsListeners.forEach(function(e){var t;return(t=document).removeEventListener.apply(t,r(e))}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(function(e){return clearTimeout(e)}),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(function(e){return clearInterval(e)}),this.intervals=[]),this.observers.length&&(this.observers.forEach(function(e){return e.disconnect()}),this.observers=[]),this.promises.length&&(this.promises.forEach(function(e){return e.resolve(!1)}),this.promises=[])}},{key:"isWidgetApplied",value:function(){return this.domElement&&!!this.domElement.closest("html")}},{key:"insert",value:function(){var e=this;return fe("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),fe("body",function(t){return t.appendChild(e.domElement)},function(e){return console.error(e)}),this}},{key:"remove",value:function(){var e=this;return this.pageWatcher.clearWatcher(),this.domElement&&this.domElement.closest("html")&&this.domElement.remove(),this.styleElement&&this.styleElement.closest("html")&&this.styleElement.remove(),this.hasOncePerPageTrigger?this.pageWatcher.watch():this.init().then(function(t){return t&&e.show()}),this}},{key:"show",value:function(){return this.closedByUser=!1,this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,K()||this.pageWatcher.watch(),this}},{key:"hide",value:function(){return this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){var e=c(i.mark(function e(){var t;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.trigger||!this.trigger.promises.length){e.next=2;break}return e.abrupt("return",!1);case 2:if(t=this.recurrence&&this.recurrence.isOver(),!this.recurrence||t){e.next=6;break}return this.pageWatcher.watch(),e.abrupt("return",!1);case 6:if(K()||this.pageWatcher.watch(),e.t0=K()||!this.trigger,e.t0){e.next=15;break}if(e.t1=this.trigger,!e.t1){e.next=14;break}return e.next=13,this.trigger.isTriggered();case 13:e.t1=e.sent;case 14:e.t0=e.t1;case 15:if(e.t0){e.next=18;break}return e.abrupt("return",!1);case 18:return this.insert(),this.addCloseEvent(),e.abrupt("return",this);case 21:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"onPageChange",value:function(e,t){var n=this;switch(t||(this.hasBeenShown=!1),e){case"remove":this.isWidgetApplied()?this.remove():this.trigger.clear()&&this.pageWatcher.watch();break;case"rebuild":this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():this.insert().show():n.init().then(function(e){return e&&n.show()})}}},{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,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return o.push.apply(o,r(t)),o.forEach(function(t){t.addEventListener("click",function(){e.recurrence&&e.recurrence.setClosingRecurrence(),e.hide(),setTimeout(function(){return e.remove()},1e3)},{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(K()?"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",K()&&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}();(function(e){function t(){var e;return l(this,t),(e=f(this,g(t).call(this))).stringStyles=e.getStyles(),e.styleElement=e.getStyleTag(e.stringStyles),e}m(t,ie),d(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\twidth: auto;\n\t\t\theight: auto;\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}")}}])})(),function(e){function t(e){var n;return l(this,t),(n=f(this,g(t).call(this))).position=e,n.stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}m(t,ie),d(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\twidth: auto;\n\t\t\theight: auto;\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}")}}])}(),function(e){function t(e,n){var r;return l(this,t),(r=f(this,g(t).call(this))).position=e,r.referrerElement=n,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}m(t,ie),d(t,[{key:"insert",value:function(){var e=this;return fe("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),fe(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\twidth: auto;\n\t\t\theight: auto;\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}")}}])}();function se(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 ce(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===p(t)?t:String(t)}var le=function(){function e(t,n){var r=t.displayRecurrence,o=t.closingRecurrence,a=t.validationRecurrence;l(this,e),this.displayRecurrence=parseFloat(r),this.closingRecurrence=parseFloat(o),this.validationRecurrence=parseFloat(a),this.onSetCallback=n,this.widgetName=J(),this.uniqueId=Y(),this.recurrenceKey="".concat(this.widgetName,"_").concat(this.uniqueId)}return d(e,[{key:"getGivenRecurrenceStorageParsed",value:function(e){try{var t=e.getItem("ABTastyWidgets");return JSON.parse(t)}catch(t){return e.removeItem("ABTastyWidgets"),!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],b(t,[n].map(ce)));return Object.entries(r).length?(e.setItem("ABTastyWidgets",JSON.stringify(r)),r):(e.removeItem("ABTastyWidgets"),!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"!==p(r))return!1;var a=this.getTypeOfStorage(e),i=a.storageString,s=a.storageMethod,c=this.getStamp(e),l={type:t,stamp:c},u=this.getCurrentRecurrence().type,d=function(){var e,t=n.getSessionRecurrence(),r=n.getLocalRecurrence();"session"===i?t?e=n.removeSessionRecurrenceStorage():(n.removeLocalRecurrenceStorage(),e=n.getSessionRecurrenceStorageParsed()):"local"===i&&(r?e=n.removeLocalRecurrenceStorage():(n.removeSessionRecurrenceStorage(),e=n.getLocalRecurrenceStorageParsed()));var a=e?function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(n,!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}(o({},n.recurrenceKey,l),e):o({},n.recurrenceKey,l);s.setItem("ABTastyWidgets",JSON.stringify(a)),n.onSetCallback&&"function"==typeof n.onSetCallback&&n.onSetCallback()};if(!s)return!1;if(u&&"validation"!==t)if("closing"===t&&"validation"!==u)d();else{if("display"!==t||"validation"===u||"closing"===u)return!1;d()}else d();return c}},{key:"setDisplayRecurrence",value:function(){this.setRecurrence(this.displayRecurrence,"display")}},{key:"setClosingRecurrence",value:function(){this.setRecurrence(this.closingRecurrence,"closing")}},{key:"setValidationRecurrence",value:function(){this.setRecurrence(this.validationRecurrence,"validation")}},{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}(),ue=function(){function e(){l(this,e),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return d(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:0})}},{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"===function e(t,n){return n(t)||!t.parentElement?t:e(t.parentElement,n)}(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],[t.left+t.width/2,t.top],[t.left+t.width/2,t.bottom],[t.left,t.height/2],[t.right,t.height/2],[t.left+t.left/2,t.height/2]],o=!1,a=0;!o&&a<n.length;){var i,s=(i=document).elementFromPoint.apply(i,r(n[a]));o=e===s||e.contains(s),a++}return o}},{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})}},{key:"clear",value:function(e){var t=this.targets.filter(function(t){return t.selector!==e});0===t.length&&(this.existingTargets=[],this.inViewPortTargets=[],this.mutationobserver.disconnect(),this.visibilityobserver.unobserve(e)),this.targets.length>t&&(this.targets=t,this.visibilityobserver.unobserve(e))}}]),e}(),de=function(){function e(t){var n=t.triggerEvent,r=t.triggerSelector,o=t.triggerDelay;l(this,e),this.event=n,this.selector=r&&r.length?r:"body",this.delay=o,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[]}return d(e,[{key:"onElementVisible",value:(t=c(i.mark(function t(){var n,r,o,a;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.promiseDeferrer("onElementVisible"),this.promises.push(n),t.next=4,this.onPageLoad();case 4:return r=t.sent,t.next=7,ee("IntersectionObserver");case 7:return o=t.sent,a=U("VisibilityObserver",ue),this.visibilityObservers.push(a),o&&r&&a.watch(this.selector,n.resolve),t.abrupt("return",n.promise);case 12:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})},{key:"onPageLoad",value:function(){var t=e.promiseDeferrer("onPageLoad");this.promises.push(t);var n=function(){return"complete"===document.readyState};if(n())t.resolve(!0);else{var r,o=setTimeout(function(){return t.resolve(!1)},2e4),a=["readystatechange",function(){return n()&&!clearTimeout(o)&&!t.resolve(!0)},{passive:!0}];this.timeouts.push(o),this.eventsListeners.push(a),(r=document).addEventListener.apply(r,a)}return t.promise}},{key:"onClick",value:function(){var t,n=this,o=document.createElement("style");o.type="text/css",o.id="Click_".concat(Y()),o.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(o),this.elementsSelectors.push("#".concat(o.id));var a=e.promiseDeferrer("onClick");this.promises.push(a);var i=["click",function(e){return!!function(e){return r(document.querySelectorAll(n.selector)).some(function(t){return t.isSameNode(e)||!!e.closest(n.selector)})}(e.target)&&(a.resolve(!0),n.clear())},{passive:!0,capture:!0}];return this.eventsListeners.push(i),(t=document).addEventListener.apply(t,i),a.promise}},{key:"onExitIntent",value:function(){var t=this,n=e.promiseDeferrer("onExitIntent");this.promises.push(n);var r=["mouseleave",function(){var e=c(i.mark(function e(){var r,o;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.delay){e.next=6;break}r=1e3*t.delay,o=setTimeout(function(){n.resolve(!0)},r),t.timeouts.push(o),e.next=8;break;case 6:return n.resolve(!0),e.abrupt("return");case 8:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),{passive:!0,once:!0}];return fe("body",function(e){e.addEventListener.apply(e,r),t.eventsListeners.push([e].concat(r))}),n.promise}},{key:"onDelay",value:function(){var t=e.promiseDeferrer("onDelay");this.promises.push(t);var n=1e3*this.delay,r=setTimeout(function(){t.resolve(!0)},n);return this.timeouts.push(r),t.promise}},{key:"onReengage",value:function(){var t=this,n=e.promiseDeferrer("onReengage");this.promises.push(n);var r=1e3*this.delay,o=r,a=[function(){return o=r},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(function(e){var n;(n=document).addEventListener.apply(n,[e].concat(a)),t.eventsListeners.push([e].concat(a))});var i=setInterval(function(){o<=0?n.resolve(!0):o-=100},100);return this.intervals.push(i),n.promise}},{key:"clear",value:function(){var e=this;return this.elementsSelectors.length&&(this.elementsSelectors.forEach(function(e){document.querySelector(e)&&document.querySelector(e).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(function(e){var t="string"==typeof e[0]?[document].concat(r(e)):e,n=S(t),o=n[0],a=n.slice(1);o&&a.length>1&&o.removeEventListener.apply(o,r(a))}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(function(e){return clearTimeout(e)}),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(function(e){return clearInterval(e)}),this.intervals=[]),this.observers.length&&(this.observers.forEach(function(e){return e.disconnect()}),this.observers=[]),this.visibilityObservers.length&&(this.visibilityObservers.forEach(function(t){return t.clear(e.selector)}),this.visibilityObservers=[]),this.promises.length&&(this.promises.forEach(function(e){return e.resolve(!1)}),this.promises=[]),this}},{key:"isTriggered",value:function(){var e=c(i.mark(function e(){var t;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.clear(),e.t0=this.event,e.next="pageLoad"===e.t0?4:"click"===e.t0?9:"exitIntent"===e.t0?14:"delay"===e.t0?19:"reengage"===e.t0?24:"elementVisible"===e.t0?29:34;break;case 4:return e.next=6,this.onPageLoad();case 6:return t=e.sent,this.clear(),e.abrupt("break",35);case 9:return e.next=11,this.onClick();case 11:return t=e.sent,this.clear(),e.abrupt("break",35);case 14:return e.next=16,this.onExitIntent();case 16:return t=e.sent,this.clear(),e.abrupt("break",35);case 19:return e.next=21,this.onDelay();case 21:return t=e.sent,this.clear(),e.abrupt("break",35);case 24:return e.next=26,this.onReengage();case 26:return t=e.sent,this.clear(),e.abrupt("break",35);case 29:return e.next=31,this.onElementVisible();case 31:return t=e.sent,this.clear(),e.abrupt("break",35);case 34:t=!1;case 35:return e.abrupt("return",t);case 36:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}],[{key:"promiseDeferrer",value:function(e){var t={promise:null,resolve:null,reject:null,name:e};return t.promise=new Promise(function(e,n){t.resolve=e,t.reject=n}),t}}]),e;var t}();var pe=function(){function e(t,n,r){l(this,e),this.recurrence=t,this.isWidgetApplied=n,this.callback=r,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=[_,this.eventHandler.bind(this),{passive:!0}]}return d(e,[{key:"recurrenceIsDone",value:function(){return!this.recurrence||this.recurrence.isOver()}},{key:"decisionHandler",value:function(e){var t=this,n=!!window.ABTasty.getTestsOnPage()[TEST_ID],r=(this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1}).type,o=function(){return e&&"display"===r||t.recurrenceIsDone()};return!this.isWidgetApplied()&&n&&o()?(this.clearWatcher(),this.callback("rebuild",e)):(!this.isWidgetApplied()||n&&o())&&(this.isWidgetApplied()||n)||(this.clearWatcher(),this.callback("remove",e),this.watch()),this}},{key:"eventHandler",value:function(){var e=this;return setTimeout(function(){e.decisionHandler(!1)},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(!0),this):this}},{key:"watch",value:function(){var e,t=this;return this.clearWatcher(),(e=document).addEventListener.apply(e,r(this.eventListenerParams)),fe("body",function(e){var n,r=[e,{childList:!0,subtree:!0}];(n=t.observer).observe.apply(n,r)}),this}},{key:"clearWatcher",value:function(){var e;return(e=document).removeEventListener.apply(e,r(this.eventListenerParams)),this.observer.disconnect(),this}}]),e}(),he=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)},fe=function(e,t,n){var r,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return he(a),"function"==typeof n&&n(a)}r=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return he(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)},ge='<a href="https://app2.abtasty.com/insights/nps" target="_blank">',ve={en:"".concat(ge,"Access the NPS© results").concat("</a>"),fr:"".concat(ge,"Accéder aux résultats du NPS©").concat("</a>"),es:"".concat(ge,"Acceder a los resultados del NPS©").concat("</a>"),de:"".concat(ge,"Zugang zu den NPS-Ergebnissen").concat("</a>")},me={en:"Open-ended question",fr:"Question ouverte",es:"Pregunta abierta",de:"Offene Frage"},ye="\ndiv.nps_container\n\tp.nps_container_question\n\tdiv.nps_container_notes\n\t\tbutton.nps_container_notes_button[data-note]\n\t\t\tspan\n\n\tp.nps_container_question_feedback\n\tform.nps_container_question_feedback_form\n\t\tinput.nps_container_question_feedback_input\n\t\tbutton.nps_container_question_feedback_button\n\t\n\tp.nps_container_thanks",be={en:"The variation CSS can be used to customize\nthe NPS widget.\n\nWe recommend using your browser’s development tools\nto test any changes.\n\nThe Document Object Model (DOM) of the NPS widget\nis as follows:\n".concat(ye),fr:"Vous pouvez utiliser l'ajout CSS de la variation\npour personnaliser le Widget NPS.\n\nNous vous recommandons d’utiliser les outils de\ndéveloppement de votre navigateur pour tester vos modifications.\n\nLe Document Object Model (DOM) du widget NPS est le suivant:\n".concat(ye),es:"Puedes utilizar el CSS de la variación\npara personalizar el Widget NPS.\n\nTe recomendamos que utilices las herramientas de desarrollo\nde tu navegador para probar las modificaciones.\n\nEl Document Object Model (DOM) del widget NPS es el siguiente:",de:"Sie können die 'CSS hinzufügen'-Funktion der\nVariation wählen, um den Style des NPS nach\nIhren Wünschen anzupassen.\n\nWir empfehlen Ihre Browser Developer Tools zu verwenden,\num Ihre Änderungen zu testen.\n\nHier ist die DOM-Struktur des NPS:"},ke=[{field:"isFeedBackQuestion",value:!0}],we=[{category:B,type:"hidden",propName:"__npsCampaignId",value:!1},{category:B,type:"paragraph",propName:"linkToNPSCampaignsList",text:ve},{category:B,type:"textarea",propName:"question",label:{en:"Question",fr:"Question",es:"Pregunta",de:"Frage"},value:{en:"How likely are you to recommend us to a friend or family member ?",fr:"Quelle est la probabilité que vous nous recommandiez à un proche ?",es:"¿ Cuál es la probabilidad de que nos recomiendes a alguien ?",de:"Wie hoch ist die Wahrscheinlichkeit, dass Sie uns weiterempfehlen?"}},{category:B,type:"checkbox",propName:"isFeedBackQuestion",label:{en:"Ask an open-ended question",fr:"Poser une question ouverte",es:"Hacer una pregunta abierta",de:"Eine offene Frage stellen"},value:!1},{category:B,type:"textarea",propName:"feedbackQuestion",label:me,value:{en:"Would you like to leave a comment ?",fr:"Souhaitez-vous laisser un commentaire ?",es:"¿ Quieres dejar un comentario ?",de:"Möchten Sie einen Kommentar eingeben ?"},conditions:ke},{category:B,type:"text",propName:"buttonText",label:{en:"Button text",fr:"Texte du bouton",es:"Texto del botón",de:"Button-Text"},value:{en:"Send",fr:"Envoyer",es:"Enviar",de:"Senden"},conditions:ke},{category:B,type:"checkbox",propName:"isThankYouMessage",label:{en:"Display a thank you message",fr:"Afficher un message de remerciement",es:"Mostrar un mensaje de agradecimiento",de:"Den Besuchern eine Danke-Nachricht anzeigen"},value:!1},{category:B,type:"textarea",propName:"thankYouMessage",label:{en:"Thank you message",fr:"Message de remerciement",es:"Mensaje de agradecimiento",de:"Danke-Botschaft"},value:{en:"Thank you for your reply.",fr:"Merci d'avoir répondu.",es:"Gracias por tus respuestas.",de:"Vielen Dank für Ihr Feedback."},conditions:[{field:"isThankYouMessage",value:!0}]},{category:B,type:"checkbox",propName:"isLegend",label:{en:"Display key",fr:"Afficher un légende",es:"Mostrar una leyenda",de:"Legende anzeigen"},value:!1},{category:B,type:"text",propName:"zeroLegend",label:{en:"Key of the lowest rating",fr:"Légende de la note minimale",es:"Leyenda de la nota mínima",de:"Legende neben 0"},value:{en:"Very unlikely",fr:"Très faible",es:"Muy baja",de:"Sehr gering"},conditions:[{field:"isLegend",value:!0}]},{category:B,type:"text",propName:"tenLegend",label:{en:"Key of the highest rating",fr:"Légende de la note maximale",es:"Leyenda de la nota máxima",de:"Legende neben 10"},value:{en:"Very likely",fr:"Très élevée",es:"Muy alta",de:"Sehr hoch"},conditions:[{field:"isLegend",value:!0}]}],Se=[{category:"layout",type:"radioImage",propName:"layout",label:{en:"Select a layout",fr:"Sélectionnez une mise en page",es:"Seleccione un diseño",de:"Wählen Sie ein Layout"},value:"popin",options:[{label:{en:"Modal",fr:"Pop-in",es:"Pop-in",de:"Pop-in"},value:"popin",src:"".concat(L,"layout/popin.svg")},{label:{en:"Banner",fr:"Bannière",es:"Banner",de:"Banner"},value:"banner",src:"".concat(L,"banner/bottom.png")},{label:{en:"Free placement",fr:"Placement libre",es:"Integrado",de:"Freie Platzierung "},value:"free",src:"".concat(L,"layout/free.svg")}]},{category:"layout",type:"radioImage",propName:"bannerPosition",label:{en:"Adjust the layout",fr:"Ajuster le placement",es:"Ajustar la posición",de:"Position einstellen"},value:"bottom",conditions:[{field:"layout",value:"banner"}],options:[{label:{en:"At the bottom",fr:"En bas",es:"Abajo",de:"Unten"},value:"bottom",src:"".concat(L,"banner/bottom.png")},{label:{en:"At the top",fr:"En haut",es:"Arriba",de:"Oben"},value:"top",src:"".concat(L,"banner/top.png")}]},{category:"layout",type:"selectelement",propName:"npsElementReferrer",label:C,value:"body",conditions:[{field:"layout",value:"free"}]},{category:"layout",type:"select",propName:"npsReferrerInsertType",value:"beforeend",conditions:[{field:"layout",value:"free"}],label:C,options:[{label:{en:"Before",fr:"Avant",es:"Antes",de:"Vor"},value:"beforebegin"},{label:{en:"At the start",fr:"Au début",es:"Al principio",de:"Am Anfang"},value:"afterbegin"},{label:{en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},value:"beforeend"},{label:{en:"After",fr:"Après",es:"Después",de:"Hinter"},value:"afterend"}]},{category:"layout",type:"radio",propName:"contentDirection",value:"column",label:{en:"Text position",fr:"Positionnement du contenu",es:"Posición del texto",de:"Ausrichtung des Inhalts"},options:[{label:{en:"Above",fr:"Au-dessus",es:"Arriba",de:"Spalte"},value:"column"},{label:{en:"At the left",fr:"À gauche",es:"A la izquierda",de:"Reihe"},value:"row"}]}],Ce=[W,G,{category:"conditions",type:"checkbox",propName:"autoHide",value:!0,label:{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"}},{category:"conditions",type:"number",propName:"timeHide",value:2,label:{en:"Hide after x seconds",fr:"Masquer après x secondes",es:"Ocultar tras x segundos",de:"Nach X Sekunden ausblenden"},conditions:[{field:"autoHide",value:!0}]}];function xe(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 Ee(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(n,!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ne="rgba(255, 255, 255, 1)",Te="rgb(33, 121, 129, 1)",Oe=[{field:"themeType",value:"theme"}],Pe=[{field:"buttonsContrast",value:"full"}],Be=[{field:"buttonsContrast",value:"empty"}],Ae={borderWidth:2,borderRadius:10,borderColor:Te,backgroundColor:Ne,overlayColor:"rgba(0, 0, 0, 0.6)",textColor:Te,questionMargin:15,horizontalPaddingContainer:20,verticalPaddingContainer:15,horizontalMarginContainer:0,verticalMarginContainer:0,dropShadow:!1,shadowOpacity:0,buttonsHorizontalMargin:5,buttonsContrast:"full",buttonsShape:"roundsquare",buttonsBorderRadius:8,buttonsBackgroundColor_full:Te,buttonsBackgroundColor_empty:Ne,buttonsTextColor_full:Ne,buttonsTextColor_empty:Te,buttonsBorderColor_full:Te,buttonsBorderColor_empty:Te,buttonsBorderWidth_full:0,buttonsBorderWidth_empty:2,inputBackgroundColor:Ne,inputBorderColor:Te,inputBorderWidth:2,inputBorderRadius:8,inputTextColor:Te,inputMarginWithButton:10,feedbackButtonBackgroundColor:Ne,feedbackButtonBorderColor:Te,feedbackButtonBorderWidth:2,feedbackButtonBorderRadius:8,feedbackButtonTextColor:Te},Le=[{themeValue:"lightTheme",defaultValues:Ee({},Ae)},{themeValue:"darkTheme",defaultValues:Ee({},Ae,{borderColor:Te,backgroundColor:Te,textColor:Ne,buttonsContrast:"empty",buttonsBackgroundColor_full:Ne,buttonsBackgroundColor_empty:Te,buttonsTextColor_full:Te,buttonsTextColor_empty:Ne,buttonsBorderColor_full:Ne,buttonsBorderColor_empty:Ne,buttonsBorderWidth_full:2,buttonsBorderWidth_empty:2,inputBackgroundColor:Te,inputBorderColor:Ne,inputTextColor:Ne,feedbackButtonBackgroundColor:Te,feedbackButtonBorderColor:Ne,feedbackButtonTextColor:Ne})}],_e={category:P,type:"group",collapsible:!0,conditions:Oe},Re={category:P,type:"colorpicker",label:{en:"Buttons background color",fr:"Couleur de fond des boutons",es:"Color de fondo de los botones",de:"Hintergrundfarbe der Tasten"},propName:"buttonsBackgroundColor",value:Ne},je={category:P,type:"colorpicker",label:{en:"Buttons text color",fr:"Couleur de texte des boutons",es:"Color del texto de los botones",de:"Textfarbe der Schaltflächen"},propName:"buttonsTextColor",value:Te},Ie={category:P,type:"colorpicker",label:{en:"Buttons border color",fr:"Couleur du contour des boutons",es:"Color del contorno de los botones",de:"Farbe der Schaltflächenkontur"},propName:"buttonsBorderColor",value:Te},De={category:P,type:A,label:{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"},propName:"buttonsBorderWidth",value:2,unit:"px"},ze={category:P,type:"radio",propName:"stepToShow",value:"displayNoteStep",label:{en:"Section to be personalized",fr:"Partie à personnaliser",es:"Parte personalizable",de:"Schritt zur Bearbeitung"},options:[{label:{en:"Notes",fr:"Notes",es:"Notas",de:"Notiz"},value:"displayNoteStep"},{label:me,value:"displayFeedbackStep"},{label:{en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},value:"displayThanksStep"}]},We=Ee({},te,{propName:"overlayColor",label:{en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"}}),Me={category:P,type:"radioImage",propName:"themeType",label:{en:"Type of personalization",fr:"Type de personnalisation",es:"Tipo de personalización",de:"Typ auswählen"},value:"theme",options:[{label:{en:"Theme",fr:"Thème",es:"Tema",de:"Typ"},value:"theme",src:"".concat(L,"style/theme.svg")},{label:{en:"Custom CSS",fr:"CSS Personnalisé",es:"CSS personalizado",de:"Custom CSS"},value:"customCss",src:"".concat(L,"style/custom.svg")}]},Fe={category:P,type:"paragraph",propName:"customCssDetails",text:be,conditions:[{field:"themeType",value:"customCss"}]},qe={category:P,type:"radio",propName:"theme",label:{en:"Select an appearance",fr:"Sélectionner une apparence",es:"Seleccionar una apariencia",de:"Thema auswählen"},value:"lightTheme",conditions:Oe,options:[{label:Ee({},{en:"Light",fr:"Clair",es:"Claro",de:"Hell"},{fr:"Claire"}),value:"lightTheme"},{label:{en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},value:"darkTheme"}]},Ve=[Ee({},_e,{label:{en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},conditions:Oe,children:[oe,re,ne]}),Ee({},_e,{label:{en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},conditions:Oe,children:[te,We]}),Ee({},_e,{label:{en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},children:[{category:P,type:"colorpicker",label:{en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},propName:"textColor",value:Te},{category:P,type:A,label:{en:"Question / Reply spacing",fr:"Espacement Question / Réponse",es:"Espaciado entre la pregunta y la respuesta",de:"Margin Frage/Antwort"},propName:"questionMargin",value:15,unit:"px"},{category:P,type:A,label:{en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},propName:"horizontalPaddingContainer",value:0,unit:"px"},{category:P,type:A,label:{en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},propName:"verticalPaddingContainer",value:0,unit:"px"},{category:P,type:A,label:{en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},propName:"horizontalMarginContainer",value:0,unit:"px"},{category:P,type:A,label:{en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},propName:"verticalMarginContainer",value:0,unit:"px"},{category:P,type:"switch",label:{en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},propName:"dropShadow",value:!1},{category:P,type:A,label:{en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},propName:"shadowOpacity",value:0,unit:"%",conditions:[{field:"dropShadow",value:!0}]}]}),Ee({},_e,{label:{en:"Buttons style",fr:"Style des boutons",es:"Estilo de botón",de:"Schaltflächenstil"},conditions:[{field:"themeType",value:"theme"},{field:"stepToShow",value:"displayNoteStep"}],children:[{category:P,type:A,label:{en:"Margin between buttons",fr:"Espace entre les boutons",es:"Espacio entre los botones",de:"Abstand zwischen den Buttons"},propName:"buttonsHorizontalMargin",value:5,unit:"px"},{category:P,type:"radioImage",label:{en:"Buttons contrast",fr:"Contraste des boutons",es:"Contraste de los botones",de:"Kontrast der Tasten"},propName:"buttonsContrast",value:"full",options:[{value:"full",src:"".concat(L,"nps/button-contrast-1.svg")},{value:"empty",src:"".concat(L,"nps/button-contrast-2.svg")}]},{category:P,type:"radioImage",label:{en:"Buttons shape",fr:"Forme des boutons",es:"Forma de boton",de:"Knopfform"},propName:"buttonsShape",value:"roundsquare",options:[{value:"square",src:"".concat(L,"nps/button-shape-1.svg")},{value:"roundsquare",src:"".concat(L,"nps/button-shape-2.svg")},{value:"round",src:"".concat(L,"nps/button-shape-3.svg")}]},{category:P,type:A,label:{en:"Buttons border radius",fr:"Arrondi de la bordure des boutons",es:"Redondeo del borde de los botones",de:"Konturradius der Buttons"},propName:"buttonsBorderRadius",value:8,unit:"px",min:1,conditions:[{field:"buttonsShape",value:"roundsquare"}]},Ee({},Re,{conditions:Pe,propName:"".concat(Re.propName,"_full")}),Ee({},Re,{conditions:Be,propName:"".concat(Re.propName,"_empty")}),Ee({},je,{conditions:Pe,propName:"".concat(je.propName,"_full")}),Ee({},je,{conditions:Be,propName:"".concat(je.propName,"_empty")}),Ee({},Ie,{conditions:Pe,propName:"".concat(Ie.propName,"_full")}),Ee({},Ie,{conditions:Be,propName:"".concat(Ie.propName,"_empty")}),Ee({},De,{conditions:Pe,propName:"".concat(De.propName,"_full")}),Ee({},De,{conditions:Be,propName:"".concat(De.propName,"_empty")})]}),Ee({},_e,{label:{en:"Field style",fr:"Style du champ",es:"Estilo del campo",de:"Input-Styles"},conditions:[{field:"themeType",value:"theme"},{field:"stepToShow",value:"displayFeedbackStep"}],children:[{category:P,type:"colorpicker",label:{en:"Comment field background color",fr:"Couleur de fond du champ commentaire",es:"Color de fondo del campo Comentarios",de:"Hintergrundfarbe Feedback Input"},propName:"inputBackgroundColor",value:Ne},{category:P,type:"colorpicker",label:{en:"Comment field border color",fr:"Couleur de la bordure du champ commentaire",es:"Color del borde del campo Comentarios",de:"Konturfarbe Feedback Input"},propName:"inputBorderColor",value:Te},{category:P,type:A,label:{en:"Comment field border thickness",fr:"Épaisseur de la bordure du champ commentaire",es:"Grosor del borde del campo Comentarios",de:"Konturbreite Feedback Input"},propName:"inputBorderWidth",value:1,unit:"px"},{category:P,type:A,label:{en:"Comment field border radius",fr:"Arrondi de la bordure du champ commentaire",es:"Contorno del borde del campo Comentarios",de:"Konturradius Feedback Input"},propName:"inputBorderRadius",value:8,unit:"px"},{category:P,type:"colorpicker",label:{en:"Comment field text color",fr:"Couleur du texte du champ commentaire",es:"Color del texto del campo Comentarios",de:"Textfarbe Feedback Input"},propName:"inputTextColor",value:Te},{category:P,type:A,label:{en:"Spacing between the field and the send button",fr:"Espace entre le champ et le bouton d’envoi",es:"Espacio entre el campo y el botón de envío",de:"Abstand mit Button"},propName:"inputMarginWithButton",value:10,unit:"px"}]}),Ee({},_e,{label:{en:"Send button style",fr:"Style du bouton d'envoi",es:"Estilo del botón de envío",de:"Style Abschicken-Button"},conditions:[{field:"themeType",value:"theme"},{field:"stepToShow",value:"displayFeedbackStep"}],children:[{category:P,type:"colorpicker",label:{en:"Send button background color",fr:"Couleur de fond du bouton d’envoi",es:"Color de fondo del botón de envío",de:"Hintergrundfarbe Abschicken-Button"},propName:"feedbackButtonBackgroundColor",value:Ne},{category:P,type:"colorpicker",label:{en:"Send button border color",fr:"Couleur de la bordure du bouton d’envoi",es:"Color del borde del botón de envío",de:"Konturfarbe Feedback Button"},propName:"feedbackButtonBorderColor",value:Te},{category:P,type:A,label:{en:"Send button border thickness",fr:"Épaisseur de la bordure du bouton d’envoi",es:"Grosor del borde del botón de envío",de:"Konturbreite Feedback Button"},propName:"feedbackButtonBorderWidth",value:1,unit:"px"},{category:P,type:A,label:{en:"Send button border radius",fr:"Arrondi de la bordure du bouton d'envoi",es:"Contorno del borde del botón de envío",de:"Konturradius Feedback Button"},propName:"feedbackButtonBorderRadius",value:8,unit:"px"},{category:P,type:"colorpicker",label:{en:"Send button text color",fr:"Couleur du texte du bouton d’envoi",es:"Color del texto del botón de envío",de:"Textfarbe Feedback Button"},propName:"feedbackButtonTextColor",value:Te}]})];function He(e,t,n){return e.map(function(e){var o=e.propName,a=e.conditions,i=t[o],s="".concat(n,"_").concat(o),c=function(e,t){return e&&e.length>0&&e.reduce(function(e,n){var o=n.field,a=n.value;return[].concat(r(e),[{field:"".concat(t,"_").concat(o),value:a}])},[])}(a,n),l=Ee({},e,{value:i,propName:s});return c&&c.length&&(l.conditions=c),l})}var Ge=Le.map(function(e){var t=e.themeValue,n=e.defaultValues;return function(e,t,n){return e.map(function(e){var o=e.conditions,a=e.children;return Ee({},e,{conditions:[].concat(r(o),[{field:"theme",value:t}]),children:He(a,n,t)})})}([].concat(Ve),t,n)}).flat(),Ke=[ze,Me,Fe,qe].concat(r(Ge));return[].concat(r(Ce),r(we),r(Se),r(Ke))});
|
package/dist/main.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e=t(function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),i=new T(r||[]);return o._invoke=function(t,e,n){var r=l;return function(a,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===a)throw o;return A()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var s=S(i,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?f:h,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",f="completed",p={};function m(){}function g(){}function v(){}var y={};y[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(L([])));w&&w!==n&&r.call(w,o)&&(y=w);var C=v.prototype=m.prototype=Object.create(y);function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(t){var e;this._invoke=function(n,a){function o(){return new Promise(function(e,o){!function e(n,a,o,i){var s=u(t[n],t,a);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(l).then(function(t){c.value=t,o(c)},function(t){return e("throw",t,o,i)})}i(s.arg)}(n,a,e,o)})}return e=e?e.then(o,o):o()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var a=u(r,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,p;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function L(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:A}}function A(){return{value:e,done:!0}}return g.prototype=C.constructor=v,v.constructor=g,v[s]=g.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(C),t},t.awrap=function(t){return{__await:t}},k(E.prototype),E.prototype[i]=function(){return this},t.AsyncIterator=E,t.async=function(e,n,r,a){var o=new E(c(e,n,r,a));return t.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},k(C),C[s]="Generator",C[o]=function(){return this},C.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=L,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return s.type="throw",s.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;x(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t){if(Array.isArray(t))return t};var a=function(t,e){var n=[],r=!0,a=!1,o=void 0;try{for(var i,s=t[Symbol.iterator]();!(r=(i=s.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(a)throw o}}return n};var o=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var i=function(t,e){return r(t)||a(t,e)||o()};function s(t,e,n,r,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,a)}var c=function(t){return function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(t){s(o,r,a,i,c,"next",t)}function c(t){s(o,r,a,i,c,"throw",t)}i(void 0)})}};var u=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var l=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var h=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var d=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var f=function(t){return l(t)||h(t)||d()};var p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function m(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var g=function(t,e,n){return e&&m(t.prototype,e),n&&m(t,n),t},v=t(function(t){function e(n){"@babel/helpers - typeof";return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e});var y=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var b=function(t,e){return!e||"object"!==v(e)&&"function"!=typeof e?y(t):e},w=t(function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e}),C=t(function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e});var k=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&C(t,e)},E=t(function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),i=new T(r||[]);return o._invoke=function(t,e,n){var r=l;return function(a,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===a)throw o;return A()}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var s=S(i,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?f:h,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}(t,n,i),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",f="completed",p={};function m(){}function g(){}function v(){}var y={};y[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(L([])));w&&w!==n&&r.call(w,o)&&(y=w);var C=v.prototype=m.prototype=Object.create(y);function k(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(t,e){var n;this._invoke=function(a,o){function i(){return new e(function(n,i){!function n(a,o,i,s){var c=u(t[a],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then(function(t){n("next",t,i,s)},function(t){n("throw",t,i,s)}):e.resolve(h).then(function(t){l.value=t,i(l)},function(t){return n("throw",t,i,s)})}s(c.arg)}(a,o,n,i)})}return n=n?n.then(i,i):i()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var a=u(r,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,p;var o=a.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function L(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function n(){for(;++a<t.length;)if(r.call(t,a))return n.value=t[a],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:A}}function A(){return{value:e,done:!0}}return g.prototype=C.constructor=v,v.constructor=g,v[s]=g.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(C),t},t.awrap=function(t){return{__await:t}},k(E.prototype),E.prototype[i]=function(){return this},t.AsyncIterator=E,t.async=function(e,n,r,a,o){void 0===o&&(o=Promise);var i=new E(c(e,n,r,a),o);return t.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},k(C),C[s]="Generator",C[o]=function(){return this},C.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=L,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function a(r,a){return s.type="throw",s.arg=t,n.next=r,a&&(n.method="next",n.arg=e),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;x(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function S(t,e,n,r,a,o,i){try{var s=t[o](i),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,a)}var N=function(t){return function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(t){S(o,r,a,i,s,"next",t)}function s(t){S(o,r,a,i,s,"throw",t)}i(void 0)})}},x="Recurrence",T="Récurrence",L="Recurrencia",A="Wiederholung",O={en:"".concat(x," of the display"),fr:"".concat(T," de l'affichage"),es:"".concat(L," de visualización"),de:"".concat(A," der Anzeige")},_={en:"".concat(x," after closure"),fr:"".concat(T," après fermeture"),es:"".concat(L," tras el cierre"),de:"".concat(A," nach Schließung")},I={en:"".concat(x," after validation"),fr:"".concat(T," après validation"),es:"".concat(L," tras la validación"),de:"".concat(A," nach der Validierung")},P={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"};function B(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function R(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var j,D={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada dÃa",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},Y=(R({},D,{label:_,propName:"closingRecurrence"}),R({},D,{label:O,propName:"displayRecurrence"}),R({},D,{label:I,propName:"validationRecurrence"}),[{label:{en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},value:"pageLoad"},{label:{en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},value:"exitIntent"},{label:{en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},value:"delay"},{label:{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"},value:"reengage"}]),F={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:P,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:"triggerEvent",value:"click"}]},q={category:"conditions",type:"number",propName:"".concat("triggerEvent","ExitDelay"),label:{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"},min:0,max:120,value:0,conditions:[{field:"triggerEvent",value:"exitIntent"}]},M={category:"conditions",type:"number",propName:"".concat("triggerEvent","ReengageDelay"),label:{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"},min:1,max:120,value:10,conditions:[{field:"triggerEvent",value:"reengage"}]},z={category:"conditions",type:"number",propName:"".concat("triggerEvent","Delay"),label:{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"},value:10,conditions:[{field:"triggerEvent",value:"delay"}]},G=([{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},options:Y,propName:"triggerEvent",value:"pageLoad"}].concat(f([F,q,M,z])),function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")}),V=((j="undefined"!=typeof global?global:window).ABTasty||Object.assign(j,{ABTasty:{widgetutils:{}}}),j.ABTasty.widgetutils||Object.assign(j.ABTasty,{widgetutils:{}}),j).ABTasty.widgetutils;function U(t,e){return V.hasOwnProperty(t)||Object.assign(V,u({},t,new e)),V[t]}function Q(t,e){return new Promise(function(n,r){var a=new XMLHttpRequest;a.open(t,e,!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()})}var W=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"000000",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";p(this,t),this.uniqueId=e,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerId="".concat(this.basicClassName,"_").concat(e),this.contentClassName="".concat(this.basicClassName,"_content"),this.overlayClassName="".concat(this.basicClassName,"_overlay"),this.closeButtonClassName="".concat(this.basicClassName,"_close_button"),this.hideClassName="ab_hide_".concat(e),this.domElement=this.getDom()}return g(t,[{key:"insert",value:function(){var t=this;return rt("head",function(e){return e.appendChild(t.styleElement)},function(t){return console.error(t)}),rt("body",function(e){return e.appendChild(t.domElement)},function(t){return console.error(t)}),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}},{key:"hide",value:function(){return this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){return this.insert(),this.addCloseEvent(),this}},{key:"addCloseEvent",value:function(){for(var t=this,e=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,f(e)),r.forEach(function(e){e.addEventListener("click",function(){t.hide()},!0)}),this}},{key:"getDom",value:function(){var t=document.createElement("div");return t.className="".concat(this.basicClassName," ").concat(this.hideClassName),t.id=this.widgetContainerId,t.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(G()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),t}},{key:"getStyleTag",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement("style");return e.type="text/css",G()&&e.setAttribute("abtasty-script-added","true"),e.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(t),e}}]),t}(),H=function(t){function e(t,n){var r;return p(this,e),(r=b(this,w(e).call(this,t,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return k(e,W),g(e,[{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}")}}]),e}(),J=function(t){function e(t,n,r){var a;return p(this,e),(a=b(this,w(e).call(this,t,n))).position=r,a.stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}return k(e,W),g(e,[{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}")}}]),e}(),K=function(t){function e(t,n,r,a){var o;return p(this,e),(o=b(this,w(e).call(this,t,n))).position=r,o.referrerElement=a,o.stringStyles=o.getStyles(),o.styleElement=o.getStyleTag(o.stringStyles),o}return k(e,W),g(e,[{key:"insert",value:function(){var t=this;return rt("head",function(e){return e.appendChild(t.styleElement)},function(t){return console.error(t)}),rt(this.referrerElement,function(e){return e.insertAdjacentElement(t.position,t.domElement)},function(t){return console.error(t)}),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}")}}]),e}(),X=function(){function t(e){var n=e.displayRecurrence,r=e.closingRecurrence,a=e.validationRecurrence,o=e.widgetName,i=e.uniqueId;p(this,t),this.displayRecurrence=parseFloat(n),this.closingRecurrence=parseFloat(r),this.validationRecurrence=parseFloat(a),this.storageName="Rec_".concat(o,"_").concat(i)}return g(t,[{key:"getSessionRecurrenceStorage",value:function(){return sessionStorage.getItem(this.storageName)}},{key:"getLocalRecurrenceStorage",value:function(){return localStorage.getItem(this.storageName)}},{key:"removeSessionRecurrenceStorage",value:function(){return sessionStorage.removeItem(this.storageName)}},{key:"removeLocalRecurrenceStorage",value:function(){return localStorage.removeItem(this.storageName)}},{key:"getSessionRecurrence",value:function(){var t=this.getSessionRecurrenceStorage();try{return JSON.parse(t)}catch(t){return console.error("Cannot parse recurrence from storage, format is wrong, more details : ".concat(t)),!1}}},{key:"getLocalRecurrence",value:function(){var t=this.getLocalRecurrenceStorage();try{return JSON.parse(t)}catch(t){return console.error("Cannot parse recurrence from storage, format is wrong, more details : ".concat(t)),!1}}},{key:"getCurrentRecurrence",value:function(){return this.getSessionRecurrenceStorage()?this.getSessionRecurrence():this.getLocalRecurrenceStorage()?this.getLocalRecurrence():{type:!1}}},{key:"isOver",value:function(){var t=this.getLocalRecurrence(),e=(t?parseFloat(t.stamp):0)<(new Date).getTime();return e&&localStorage.removeItem(this.storageName),e&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(t,e){var n=this,r=this.getTypeOfStorage(t),a=this.getStamp(t),o={type:e,stamp:a},i=this.getCurrentRecurrence().type,s=function(){n.getSessionRecurrenceStorage()&&n.removeSessionRecurrenceStorage(),n.getLocalRecurrenceStorage()&&n.removeLocalRecurrenceStorage(),r.setItem(n.storageName,JSON.stringify(o))};if(!r)return!1;if(i&&"validation"!==e)if("closing"===e&&"validation"!==i)s();else{if("display"!==e||"validation"===i||"closing"===i)return!1;s()}else s();return a}},{key:"setDisplayRecurrence",value:function(){this.setRecurrence(this.displayRecurrence,"display")}},{key:"setClosingRecurrence",value:function(){this.setRecurrence(this.closingRecurrence,"closing")}},{key:"setValidationRecurrence",value:function(){this.setRecurrence(this.validationRecurrence,"validation")}},{key:"getStamp",value:function(t){return(new Date).getTime()+864e5*t}},{key:"getTypeOfStorage",value:function(t){return!(isNaN(t)||t<0||0!==t&&!t)&&(t>0?window.localStorage:0===t&&window.sessionStorage)}}]),t}();function Z(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(t="",new Promise(function(e,n){var r=window.document.getElementsByTagName("script")[0],a=window.document.createElement("script");a.src=t,r.parentNode.insertBefore(a,r),a.onload=e,a.onerror=n}));var t}function $(t){return function(){return N(E.mark(function t(e){return E.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e,t.next="IntersectionObserver"===t.t0?3:6;break;case 3:return t.next=5,Z();case 5:return t.abrupt("return",t.sent);case 6:return t.abrupt("return",!0);case 7:case"end":return t.stop()}},t)})).apply(this,arguments)}.apply(this,arguments)}var tt=function(){function t(){p(this,t),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return g(t,[{key:"intersectionHandler",value:function(t){var e=this;t.forEach(function(t){t.isIntersecting?(e.existingTargets=e.existingTargets.filter(function(n){return n.element!==t.target||(e.inViewPortTargets.push(n),!1)}),e.checkElements()):e.inViewPortTargets=e.inViewPortTargets.filter(function(n){return n.element!==t.target||(e.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 t=new MutationObserver(this.checkElements.bind(this));return t.observe(document,{attributes:!0,childList:!0,subtree:!0}),t}},{key:"isElementVisible",value:function(t){return this.isElementTopmost(t)&&this.isElementOpaque(t)}},{key:"isElementOpaque",value:function(t){return"HTML"===function t(e,n){return n(e)||!e.parentElement?e:t(e.parentElement,n)}(t,function(t){return"0"===window.getComputedStyle(t).opacity}).nodeName}},{key:"isElementTopmost",value:function(t){for(var e=t.getBoundingClientRect(),n=[[e.left,e.top],[e.right,e.top],[e.left,e.bottom],[e.right,e.bottom]],r=!1,a=0;!r&&a<n.length;){var o,i=(o=document).elementFromPoint.apply(o,f(n[a]));r=t===i||t.contains(i),a++}return r}},{key:"checkElements",value:function(){var t=this;this.targets=this.targets.filter(function(e){var n=document.querySelector(e.selector);return!n||(t.existingTargets.push(Object.assign(e,{element:n})),t.visibilityobserver.observe(n),!1)}),this.existingTargets=this.existingTargets.filter(function(e){return!!document.querySelector(e.selector)||(t.visibilityobserver.unobserve(e.element),t.targets.push(e),!1)}),this.inViewPortTargets=this.inViewPortTargets.filter(function(e){var n=e.element,r=e.resolve;return!t.isElementVisible(n)||(t.visibilityobserver.unobserve(n),r(n),!1)})}},{key:"watch",value:function(t,e){this.targets.push({selector:t,resolve:e})}}]),t}(),et=function(){function t(e){var n=e.triggerEvent,r=e.triggerSelector,a=e.triggerDelay;p(this,t),this.event=n,this.selector=r&&r.length?r:"body",this.delay=a}return g(t,[{key:"onElementVisible",value:function(){var t,e=this;return new Promise((t=N(E.mark(function t(n){var r,a,o;return E.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,$();case 5:a=t.sent,o=U("VisibilityObserver",tt),a&&r&&o.watch(e.selector,n);case 8:case"end":return t.stop()}},t)})),function(e){return t.apply(this,arguments)}))}},{key:"onPageLoad",value:function(){return new Promise(function(t,e){if("complete"===document.readyState)return t(!0);var n,r=["DOMContentLoaded",function(){return t(!0)},{passive:!0,once:!0}];(n=window).addEventListener.apply(n,r),setTimeout(function(){var t;return(t=window).removeEventListener.apply(t,r),e(!1)},15e3)})}},{key:"onClick",value:function(){var t=this,e=document.createElement("style");return e.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(e),new Promise(function(n){var r,a=function(e){return f(document.querySelectorAll(t.selector)).some(function(n){return n.isSameNode(e)||!!e.closest(t.selector)})},o=["click",function(t){return!!a(t.target)&&(document.head.removeChild(e),n(!0))},{passive:!0,once:!0,capture:!0}];(r=document).addEventListener.apply(r,o)})}},{key:"onExitIntent",value:function(){var t,e=this;return new Promise((t=N(E.mark(function t(n){var r;return E.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=["mouseleave",function(){var t=N(E.mark(function t(){var r;return E.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&&rt("body",function(t){return t.addEventListener.apply(t,r)});case 6:case"end":return t.stop()}},t)})),function(e){return t.apply(this,arguments)}))}},{key:"onDelay",value:function(){var t,e=this;return new Promise((t=N(E.mark(function t(n){var r;return E.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)})),function(e){return t.apply(this,arguments)}))}},{key:"onReengage",value:function(){var t=this;return new Promise(function(e){var n=1e3*t.delay,r=n,a=["click","mousemove","scroll","keypress"],o=[function(){return r=n},{passive:!0}];a.forEach(function(t){var e;return(e=document).addEventListener.apply(e,[t].concat(o))});var i=setInterval(function(){r<=0?(e(!0),clearInterval(i),a.forEach(function(t){var e;return(e=document).removeEventListener.apply(e,[t].concat(o))})):r-=100},100)})}},{key:"isTriggered",value:function(){var t=N(E.mark(function t(){var e;return E.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=this.event,t.next="pageLoad"===t.t0?3:"click"===t.t0?7:"exitIntent"===t.t0?11:"delay"===t.t0?15:"reengage"===t.t0?19:"elementVisible"===t.t0?23:27;break;case 3:return t.next=5,this.onPageLoad();case 5:return e=t.sent,t.abrupt("break",28);case 7:return t.next=9,this.onClick();case 9:return e=t.sent,t.abrupt("break",28);case 11:return t.next=13,this.onExitIntent();case 13:return e=t.sent,t.abrupt("break",28);case 15:return t.next=17,this.onDelay();case 17:return e=t.sent,t.abrupt("break",28);case 19:return t.next=21,this.onReengage();case 21:return e=t.sent,t.abrupt("break",28);case 23:return t.next=25,this.onElementVisible();case 25:return e=t.sent,t.abrupt("break",28);case 27:e=!1;case 28:return t.abrupt("return",e);case 29:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}]),t}(),nt=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(t=console).log.apply(t,n)},rt=function(t,e,n){var r,a=0;try{document.querySelector(t)}catch(e){var o="Selector «".concat(t,"» not valid.");return nt(o),"function"==typeof n&&n(o)}r=setTimeout(function(){clearInterval(a);var e="Can't find element «".concat(t,"».");return nt(e),"function"==typeof n&&n(e)},1e4),a=setInterval(function(){var n=document.querySelector(t);if(null!==n)return clearTimeout(r),clearInterval(a),"function"==typeof e&&e(n)},200)};var at=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function ot(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var it=function(t,e,n){return e&&ot(t.prototype,e),n&&ot(t,n),t},st="https://nps.abtasty.com/api/",ct=DATA.isFeedBackQuestion,ut=function(t,e){var n,r,a,o,i,s,c=e.question,u=e.__npsCampaignId,l=e.userFeedback,h=e.feedbackQuestion,d=window.ABTASTY_S?(n=ABTASTY_S.STORE,r=n.masterTest,a=n.test,o=n.currentVariation,i=n.tunnelParent,s=ABTASTY_S.EDITOR.getAtTestId,i?s()>i?"".concat(r.name," - ").concat(a.name):s()===i?"".concat(r.name," - ").concat(a.name," - ").concat(o.name):"":"".concat(r.name," - ").concat(o.name)):"",f=function(t,e,n){return ct?"editor"===t?n:"client"===t?e:"":""}(t,l,h);return{abtastyIdentifier:"abtastyidentifier=".concat(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}()),accessToken:"access_token=".concat(window.ABTASTY_S?ABTASTY_S.SERVER.token:""),testId:"testId=".concat(TEST_ID),variationId:"variationId=".concat(window.ABTASTY_S?ABTASTY_S.STORE.currentVariation.id:""),name:"name=".concat(d),nps:"nps=".concat(c),feedback:"feedback=".concat(f),id:"id=".concat(u),abtastyuserid:"abtastyuserid=".concat(window.ABTasty&&window.ABTasty.visitor?window.ABTasty.visitor.id:void 0)}},lt=function(t){if(t.__npsCampaignId)return!1;var e,n,r,a,o,i,s,c,u=ut("editor",t);return Q("GET",(n=(e=u).abtastyIdentifier,r=e.accessToken,a=e.testId,o=e.variationId,i=e.name,s=e.nps,c=e.feedback,"".concat(st,"setNPS.php?").concat(n,"&").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s,"&").concat(c)))},ht=function(t){var e=t.detail;if(!e.__npsCampaignId)return!1;var n,r,a,o,i,s,c,u,l,h=ut("editor",e);return Q("GET",(r=(n=h).id,a=n.abtastyIdentifier,o=n.accessToken,i=n.testId,s=n.variationId,c=n.name,u=n.nps,l=n.feedback,"".concat(st,"setNPS.php?").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s,"&").concat(c,"&").concat(u,"&").concat(l)))},dt=function(t,e){var n,r,a,o=DATA,i=o.question,s=o.__npsCampaignId,c=function(t,e){var n=e.feedback,r=e.id,a=e.abtastyIdentifier,o=e.abtastyuserid,i="score=".concat(t);return"".concat(st,"collect.php?").concat(i,"&").concat(n,"&nps").concat(r,"&").concat(a,"&").concat(o)}(t,ut("client",{question:i,__npsCampaignId:s,userFeedback:e}));return n="GET",r=c,(a=new XMLHttpRequest).open(n,r,!1),a.send(null),a};function ft(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}var pt=DATA,mt=pt.themeType,gt=pt.layout,vt=pt.isFeedBackQuestion,yt=pt.isThankYouMessage,bt=pt.isLegend,wt=pt.timeHide,Ct=pt.stepToShow,kt=function(){function t(e){var n=e.uniqueId,r=e.question,a=e.feedbackQuestion,o=e.userStyles,i=e.parentContainer,s=e.buttonText,c=e.thankYouMessage,u=e.zeroLegend,l=e.tenLegend,h=e.recurrence;at(this,t),this.uniqueId=n,this.question=r,this.feedbackQuestion=a,this.userStyles=o,this.parentContainer=i,this.buttonText=s,this.thankYouMessage=c,this.legend={zeroLegend:u,tenLegend:l},this.recurrence=h,this.baseClassName="nps_container",this.npsClassName="".concat(this.baseClassName,"_").concat(this.uniqueId),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackQuestionClassName="".concat(this.questionClassName,"_feedback"),this.feedbackFormClassName="".concat(this.questionClassName,"_feedback_form"),this.notesButtonsClassName="".concat(this.notesClassName,"_button"),this.thankYouClassName="".concat(this.baseClassName,"_thanks"),this.hideClassName="nps_".concat(this.uniqueId,"_display_none"),this.currentNote=NaN,this.userFeedback="",this.npsContainer=this.getContainer(),this.questionElement=this.getQuestionElement(),this.notesContainer=this.getNotesElement(),this.feedbackElements=this.getFeedBackElements(),this.thankYouElement=this.getThankYouElement(),this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}return it(t,[{key:"sendNote",value:function(){if(!G()&&!isNaN(this.currentNote)){dt(this.currentNote,this.userFeedback);try{window.abtasty.send("nps",{ns:this.currentNote,nf:this.userFeedback})}catch(t){}this.recurrence.setValidationRecurrence()}return this}},{key:"setExternalEvents",value:function(){var t=this,e={passive:!0,once:!0};return[this.parentContainer.overlayClassName,this.parentContainer.closeButtonClassName].forEach(function(n){t.parentContainer.domElement.querySelector(".".concat(n)).addEventListener("mouseup",function(){return t.recurrence.setClosingRecurrence()},e)}),this}},{key:"insert",value:function(t,e){return document.head.insertAdjacentElement("beforeend",this.styleElement),t.insertAdjacentElement(e,this.npsElement),this.setExternalEvents(),this}},{key:"remove",value:function(){return this.npsElement&&this.npsElement.remove(),this.styleElement&&this.styleElement.remove(),this}},{key:"complete",value:function(){var t=this;this.sendNote(),setTimeout(function(){t.parentContainer.hide(),setTimeout(function(){t.remove(),t.parentContainer.remove()},1e3)},1e3*wt)}},{key:"onClickNote",value:function(t){this.currentNote=Number(t.target.dataset.note),vt&&this.feedbackQuestion&&this.feedbackQuestion.length?this.showFeedBack():yt&&this.thankYouMessage&&this.thankYouMessage.length?this.showThankYouMessage():this.complete()}},{key:"onFeedbackSend",value:function(){yt&&this.thankYouMessage&&this.thankYouMessage.length?this.showThankYouMessage():this.complete()}},{key:"showFeedBack",value:function(){var t=this;return this.npsContainer.childNodes.forEach(function(e){return e.classList.add(t.hideClassName)}),Object.values(this.feedbackElements).forEach(function(e){return e.classList.remove(t.hideClassName)}),this}},{key:"showThankYouMessage",value:function(){var t=this;return this.npsContainer.childNodes.forEach(function(e){return e.classList.add(t.hideClassName)}),this.thankYouElement.classList.remove(this.hideClassName),this.complete(),this}},{key:"getThankYouElement",value:function(){var t=document.createElement("p");return t.className="".concat(this.thankYouClassName," ").concat(this.hideClassName),t.innerHTML=this.thankYouMessage,G()&&"displayThanksStep"===Ct&&t.classList.remove(this.hideClassName),t}},{key:"getFeedBackElements",value:function(){var t=this,e=document.createElement("p");e.className="".concat(this.feedbackQuestionClassName," ").concat(this.hideClassName),e.innerHTML=this.feedbackQuestion;var n=document.createElement("form");n.className="".concat(this.feedbackFormClassName," ").concat(this.hideClassName),n.addEventListener("submit",function(t){return t.preventDefault()},{passive:!1});var r=document.createElement("input");r.className="".concat(this.feedbackQuestionClassName,"_input"),r.type="text";var a=document.createElement("button");return a.className="".concat(this.feedbackQuestionClassName,"_button"),a.innerHTML=this.buttonText,a.addEventListener("click",function(){return t.userFeedback=r.value,t.onFeedbackSend()},{passive:!0}),G()&&"displayFeedbackStep"===Ct&&[e,n].forEach(function(e){return e.classList.remove(t.hideClassName)}),n.appendChild(r),n.appendChild(a),{feedbackQuestionElement:e,feedbackFormElement:n}}},{key:"getNotesElement",value:function(){var t=this,e=document.createElement("div");e.className=this.notesClassName,G()&&"displayNoteStep"!==Ct&&e.classList.add(this.hideClassName);for(var n=10;n>=0;){var r=document.createElement("button");r.className=this.notesButtonsClassName,r.dataset.note=n,G()&&r.setAttribute("data-abtasty-actionnable",""),r.innerHTML+="<span>".concat(n,"</span>"),r.addEventListener("click",function(e){return t.onClickNote(e)},{passive:!0}),e.insertAdjacentElement("afterbegin",r),5===n&&r.insertAdjacentHTML("afterend","<br>"),n-=1}return bt&&(e.insertAdjacentHTML("afterbegin","<legend>".concat(this.legend.zeroLegend,"</legend>")),e.insertAdjacentHTML("beforeend","<legend>".concat(this.legend.tenLegend,"</legend>"))),e}},{key:"getQuestionElement",value:function(){var t=document.createElement("p");return t.className=this.questionClassName,t.innerHTML=this.question,G()&&"displayNoteStep"!==Ct&&t.classList.add(this.hideClassName),t}},{key:"getContainer",value:function(){var t=document.createElement("div");return t.className="".concat(this.baseClassName," ").concat(this.npsClassName),t}},{key:"getNPSElement",value:function(){var t=this;return this.npsContainer.appendChild(this.questionElement),this.npsContainer.appendChild(this.notesContainer),vt&&Object.values(this.feedbackElements).forEach(function(e){t.npsContainer.appendChild(e)}),yt&&this.npsContainer.appendChild(this.thankYouElement),this.npsContainer}},{key:"getDefaultStyles",value:function(){var t="\n\t\t\t#".concat(this.parentContainer.widgetContainerId," .").concat(this.baseClassName,",\n\t\t\t#").concat(this.parentContainer.widgetContainerId," .").concat(this.baseClassName," *");return"\n\t\t".concat(t," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tmin-width: inherit;\n\t\t\tmin-height: inherit;\n\t\t\tmax-width: inherit;\n\t\t\tmax-height: inherit;\n\t\t\tline-height: 1;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tborder: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t#").concat(this.parentContainer.widgetContainerId," .").concat(this.hideClassName," {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t#").concat(this.parentContainer.widgetContainerId," .").concat(this.baseClassName," .").concat(this.notesButtonsClassName," span {\n\t\t\tpointer-events: none;\n\t\t}\n\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.closeButtonClassName," {\n\t\t\tpadding: 0;\n\t\t\tline-height: 1;\n\t\t}\n\t\t@media (orientation: landscape) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: .55vmax;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: landscape) and (max-width: 1280px) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: .7vmax;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: landscape) and (max-width: 800px) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: 1vmax;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: portrait) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: 1vmin;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: portrait) and (max-width: 550px) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: 2.2vmin;\n\t\t\t\tline-height: 1.3;\n\t\t\t\tmax-width: ").concat("popin"===gt?"85vw":"auto",";\n\t\t\t}\n\t\t}")}},{key:"getThemeDefaultStyles",value:function(){var t="popin"===gt?"75em":"auto",e="#".concat(this.parentContainer.widgetContainerId," .").concat(this.npsClassName);return"\n\t\t".concat(e,",\n\t\t").concat(e," * {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: nowrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t").concat(e," {\n\t\t\twidth: ").concat(t,";\n\t\t\talign-items: center;\n\t\t}\n\t\t").concat(e," .").concat(this.questionClassName,",\n\t\t").concat(e," .").concat(this.feedbackQuestionClassName,",\n\t\t").concat(e," .").concat(this.thankYouClassName," {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," {\n\t\t\tflex-direction: row;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," legend {\n\t\t\talign-self: center;\n\t\t\tfont-size: 1.5em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," legend:first-of-type {\n\t\t\tmargin-right: 1em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," legend:last-of-type {\n\t\t\tmargin-left: 1em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesButtonsClassName," {\n\t\t\twidth: 3.5em;\n\t\t\theight: 3.5em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesButtonsClassName," span {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t").concat(e," .").concat(this.feedbackFormClassName," {\n\t\t\tflex-direction: row;\n\t\t}\n\t\t").concat(e," .").concat(this.feedbackFormClassName," input {\n\t\t\twidth: 45em;\n\t\t\theight: 4em;\n\t\t\tpadding: 0 0.5em;\n\t\t}\n\t\t").concat(e," .").concat(this.feedbackFormClassName," button {\n\t\t\twidth: 10em;\n\t\t\tfont-size: 1.4em;\n\t\t}\n\t\t@media screen and (max-width: 550px) and (orientation: portrait) {\n\t\t\t").concat(e," .").concat(this.questionClassName,",\n\t\t\t").concat(e," .").concat(this.feedbackQuestionClassName," ,\n\t\t\t").concat(e," .").concat(this.thankYouClassName," {\n\t\t\t\tmax-width: 90%;\n\t\t\t\t align-self: flex-start;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 100%;\n\t\t\t\ttext-align: center;\n\t\t\t\tline-height: 5.5;\n\t\t\t\tposition: relative;\n\t\t\t\t").concat(bt?"padding-bottom: 4em;":"","\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesButtonsClassName," {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 4em;\n\t\t\t\theight: 4em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend {\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tfont-size: 1.25em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend:first-of-type {\n\t\t\t\tbottom: 1.2em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend:first-of-type::before {\n\t\t\t\tcontent: '0:';\n\t\t\t\tmargin-right: 0.4em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend:last-of-type::before {\n\t\t\t\tcontent: '10:';\n\t\t\t\tmargin-right: 0.4em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.feedbackFormClassName," {\n\t\t\t\tflex-direction: column;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.feedbackFormClassName," input {\n\t\t\t\tmargin: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 3em;\n\t\t\t\tfont-size: 1.8em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.feedbackFormClassName," button {\n\t\t\t\twidth: 50%;\n\t\t\t\theight: 2.7em;\n\t\t\t\tmargin-top: 1em;\n\t\t\t\talign-self: center;\n\t\t\t\tfont-size: 1.5em;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\t\t}")}},{key:"getUserStyles",value:function(){var t,e=this.userStyles,r=e.backgroundColor,a=e.borderColor,o=e.borderRadius,s=e.borderWidth,c=e.dropShadow,u=e.textColor,l=e.horizontalPaddingContainer,h=e.verticalPaddingContainer,d=e.horizontalMarginContainer,f=e.verticalMarginContainer,p=e.overlayColor,m=e.overlayOpacity,g=e.shadowOpacity,v=e.buttonsContrast,y=e.buttonsBorderRadius,b=e.buttonsShape,w=e.contentDirection,C=e.questionMargin,k=e.buttonsHorizontalMargin,E=e.inputBackgroundColor,S=e.inputBorderColor,N=e.inputBorderWidth,x=e.inputBorderRadius,T=e.inputTextColor,L=e.inputMarginWithButton,A=e.feedbackButtonBackgroundColor,O=e.feedbackButtonBorderColor,_=e.feedbackButtonBorderWidth,I=e.feedbackButtonBorderRadius,P=e.feedbackButtonTextColor,B=Object.entries(this.userStyles).filter(function(t){return i(t,1)[0].includes(v)}).reduce(function(t,e){var r=i(e,2),a=r[0],o=r[1],s=a.split("_".concat(v))[0],c=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ft(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ft(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t);return c[s]=o,c},{}),R=B.buttonsBackgroundColor,j=B.buttonsTextColor,D=B.buttonsBorderColor,Y=B.buttonsBorderWidth;switch(b){case"roundsquare":t="border-radius: ".concat(y,"px;");break;case"round":t="border-radius: 50%;";break;default:t=""}var F=c?"box-shadow: 0px 5px 10px 2px rgba(0, 0, 0, ".concat(g/100,");"):"",q="#".concat(this.parentContainer.widgetContainerId," .").concat(this.npsClassName),M="\n\t\t\t".concat(q," .").concat(this.notesButtonsClassName," {\n\t\t\t\tmargin-left: ").concat(k,"px;\n\t\t\t\tmargin-right: ").concat(k,"px;\n\t\t\t\tbackground-color: ").concat(R,";\n\t\t\t\tborder: ").concat(Y,"px solid ").concat(D,";\n\t\t\t\t").concat(t,"\n\t\t\t}\n\t\t\t").concat(q," .").concat(this.notesButtonsClassName," span {\n\t\t\t\tcolor: ").concat(j,";\n\t\t\t}");return"\n\t\t\tbody ".concat(q," {\n\t\t\t\tflex-direction: ").concat(w,";\n\t\t\t\tbackground-color: ").concat(r,";\n\t\t\t\tborder: ").concat(s,"px solid ").concat(a,";\n\t\t\t\tborder-radius: ").concat(o,"px;\n\t\t\t\tpadding: ").concat(h,"px ").concat(l,"px;\n\t\t\t\t").concat(F,"\n\t\t\t}\n\t\t\t").concat(q," .").concat(this.questionClassName,",\n\t\t\t").concat(q," .").concat(this.feedbackQuestionClassName," ,\n\t\t\t").concat(q," .").concat(this.thankYouClassName," {\n\t\t\t\tcolor: ").concat(u,";\n\t\t\t\tmargin-").concat("row"===w?"right":"bottom"," : ").concat(C,"px;\n\t\t\t}\n\t\t\t").concat(q," .").concat(this.thankYouClassName," {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t").concat(q," .").concat(this.notesClassName," legend {\n\t\t\t\tcolor: ").concat(u,";\n\t\t\t}\n\t\t\t").concat(M,"\n\t\t\t").concat(q," .").concat(this.feedbackFormClassName," input {\n\t\t\t\tbackground-color: ").concat(E,";\n\t\t\t\tborder: ").concat(N,"px solid ").concat(S,";\n\t\t\t\tborder-radius: ").concat(x,"px;\n\t\t\t\tcolor: ").concat(T,";\n\t\t\t\tmargin-right: ").concat(L,"px;\n\t\t\t}\n\t\t\t").concat(q," .").concat(this.feedbackFormClassName," button {\n\t\t\t\tbackground-color: ").concat(A,";\n\t\t\t\tborder: ").concat(_,"px solid ").concat(O,";\n\t\t\t\tborder-radius: ").concat(I,"px;\n\t\t\t\tcolor: ").concat(P,";\n\t\t\t}\n\t\t\tbody #").concat(this.parentContainer.widgetContainerId," {\n\t\t\t\tmargin: ").concat(f,"px ").concat(d,"px;\n\t\t\t}\n\t\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.overlayClassName," {\n\t\t\t\tbackground-color: ").concat(p,";\n\t\t\t\topacity: ").concat(m/100,";\n\t\t\t}\n\t\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.closeButtonClassName," {\n\t\t\t\ttop: ").concat(h,"px;\n\t\t\t\tright: ").concat(l,"px;\n\t\t\t}")}},{key:"getStyleElement",value:function(){var t="theme"===mt,e=this.getDefaultStyles(),n=t?this.getThemeDefaultStyles():"",r=t?this.getUserStyles():"",a=document.createElement("style");return a.type="text/css",G()&&a.setAttribute("abtasty-script-added","true"),a.textContent="".concat(e," ").concat(n," ").concat(r),a}}]),t}();function Et(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function St(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Et(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var Nt,xt="NPS",Tt=DATA,Lt=Tt.layout,At=Tt.bannerPosition,Ot=Tt.npsElementReferrer,_t=Tt.npsReferrerInsertType,It=Tt.contentDirection,Pt=Tt.__npsCampaignId,Bt=Tt.question,Rt=Tt.feedbackQuestion,jt=Tt.buttonText,Dt=Tt.thankYouMessage,Yt=Tt.zeroLegend,Ft=Tt.tenLegend,qt=Tt.themeType,Mt=Tt.theme,zt=Tt.triggerEvent,Gt=Tt.triggerEventClick,Vt=Tt.triggerEventDelay,Ut=Tt.triggerEventExitDelay,Qt=Tt.triggerEventReengageDelay,Wt=Tt.displayRecurrence,Ht=Tt.closingRecurrence,Jt=Tt.validationRecurrence,Kt="".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID);function Xt(t){return Zt.apply(this,arguments)}function Zt(){return(Zt=c(e.mark(function t(n){var r,a,o,i;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.detail,t.next=3,lt(r);case 3:if(a=t.sent){t.next=6;break}return t.abrupt("return",!1);case 6:return o=St({},r,{__npsCampaignId:JSON.parse(a).id}),i=new CustomEvent("asyncWidgetDataObtained",{detail:o}),top.dispatchEvent(i),t.abrupt("return",!0);case 10:case"end":return t.stop()}},t)}))).apply(this,arguments)}function $t(t,e){var n;switch(Lt){case"popin":n=new H(Kt,xt);break;case"banner":n=new J(Kt,xt,At);break;default:n=new K(Kt,xt,_t,Ot)}n.init();var r=n.domElement.querySelector(".".concat(n.contentClassName)),a=new kt({uniqueId:Kt,question:Bt,feedbackQuestion:Rt,userStyles:t,parentContainer:n,buttonText:jt,thankYouMessage:Dt,zeroLegend:Yt,tenLegend:Ft,recurrence:e});return a.insert(r,"beforeend"),n.show(),G()?ABTASTY_S.PLUGINS.NPS_Container_Class=n:e.setDisplayRecurrence(),{parentContainer:n,NPS:a}}function te(){return"customCss"!==qt&&St({},Object.entries(DATA).filter(function(t){return i(t,1)[0].includes(Mt)}).reduce(function(t,e){var n=i(e,2),r=n[0],a=n[1],o=r.split("".concat(Mt,"_"))[1],s=St({},t);return s[o]=a,s},{}),{contentDirection:It})}function ee(){return(ee=c(e.mark(function t(){var n,r,a,o,i;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(Pt){t.next=3;break}return top.console.error("\n\t\tThe NPS is not linked to any NPS campaign following a test duplicate.\n\t\tPlease go to ABTasty editor (https://app2.abtasty.com/edit/test/".concat(TEST_ID,"/editor) to generate a new NPS campaign.\n\t\t")),t.abrupt("return",!1);case 3:if((n=new X({displayRecurrence:Wt,closingRecurrence:Ht,validationRecurrence:Jt,widgetName:xt,uniqueId:Kt})).isOver()){t.next=7;break}return t.abrupt("return",!1);case 7:r=Gt,t.t0=zt,t.next="exitIntent"===t.t0?11:"delay"===t.t0?13:"reengage"===t.t0?15:17;break;case 11:return a=Ut,t.abrupt("break",19);case 13:return a=Vt,t.abrupt("break",19);case 15:return a=Qt,t.abrupt("break",19);case 17:return a=0,t.abrupt("break",19);case 19:return o=new et({triggerEvent:zt,triggerSelector:r,triggerDelay:a}),t.next=23,o.isTriggered();case 23:return(i=t.sent)&&$t(te(),n),t.abrupt("return",i);case 26:case"end":return t.stop()}},t)}))).apply(this,arguments)}G()?(!function(){if("onFirstWidgetSave"in ABTASTY_S.PLUGINS==0&&(ABTASTY_S.PLUGINS.onFirstWidgetSave=Xt),"editNPSCampaign"in ABTASTY_S.PLUGINS==0&&(ABTASTY_S.PLUGINS.editNPSCampaign=ht),"string"!=typeof Pt||Pt.length||top.console.log("Duplication case"),Pt||ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave){if(Pt&&!ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave){var t,e,n=["widgetsave",ABTASTY_S.PLUGINS.editNPSCampaign,{once:!0}];(t=top).removeEventListener.apply(t,n),(e=top).addEventListener.apply(e,n)}}else{var r,a,o=["widgetsave",ABTASTY_S.PLUGINS.onFirstWidgetSave,{once:!0}];(r=top).removeEventListener.apply(r,o),ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave=!0,(a=top).addEventListener.apply(a,o)}}(),(Nt=ABTASTY_S.PLUGINS.NPS_Container_Class)&&document.querySelector("".concat(Nt.widgetContainerId))&&Nt.remove(),$t(te())):function(){ee.apply(this,arguments)}()}();
|
1
|
+
!function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var e=t(function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n,r){var i=e&&e.prototype instanceof g?e:g,a=Object.create(i.prototype),o=new x(r||[]);return a._invoke=function(t,e,n){var r=l;return function(i,a){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw a;return O()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=E(o,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=u(t,e,n);if("normal"===c.type){if(r=n.done?p:h,c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}(t,n,o),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",h="suspendedYield",d="executing",p="completed",f={};function g(){}function m(){}function v(){}var y={};y[a]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(A([])));w&&w!==n&&r.call(w,a)&&(y=w);var k=v.prototype=g.prototype=Object.create(y);function C(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,i){function a(){return new Promise(function(e,a){!function e(n,i,a,o){var s=u(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,a,o)},function(t){e("throw",t,a,o)}):Promise.resolve(l).then(function(t){c.value=t,a(c)},function(t){return e("throw",t,a,o)})}o(s.arg)}(n,i,e,a)})}return e=e?e.then(a,a):a()}}function E(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return f;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var i=u(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,f;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,f):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function A(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return o.next=o}}return{next:O}}function O(){return{value:e,done:!0}}return m.prototype=k.constructor=v,v.constructor=m,v[s]=m.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},C(S.prototype),S.prototype[o]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i){var a=new S(c(e,n,r,i));return t.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},C(k),k[s]="Generator",k[a]=function(){return this},k.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=A,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var r=function(t){if(Array.isArray(t))return t};var i=function(t,e){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(t){i=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n};var a=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var o=function(t,e){return r(t)||i(t,e)||a()};function s(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}var c=function(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function o(t){s(a,r,i,o,c,"next",t)}function c(t){s(a,r,i,o,c,"throw",t)}o(void 0)})}};var u=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var l=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var h=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var d=function(t){return u(t)||l(t)||h()};var p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var g=function(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t},m=t(function(t){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(r){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=n=function(t){return e(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(r)}t.exports=n});var v=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var y=function(t,e){return!e||"object"!==m(e)&&"function"!=typeof e?v(t):e},b=t(function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e}),w=t(function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e});var k=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&w(t,e)};var C=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i};var S=function(t,e){if(null==t)return{};var n,r,i=C(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i};var E=function(t){return r(t)||l(t)||a()},T="Recurrence",N="Récurrence",x="Recurrencia",A="Wiederholung",O={en:"".concat(T," of the display"),fr:"".concat(N," de l'affichage"),es:"".concat(x," de visualización"),de:"".concat(A," der Anzeige")},P={en:"".concat(T," after closure"),fr:"".concat(N," après fermeture"),es:"".concat(x," tras el cierre"),de:"".concat(A," nach Schließung")},L={en:"".concat(T," after validation"),fr:"".concat(N," après validation"),es:"".concat(x," tras la validación"),de:"".concat(A," nach der Validierung")},I={en:"Trigger",fr:"Déclencheur",es:"Activador",de:"Trigger"},_="abtasty_resetActionTracking";function B(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?B(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var j,D={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Todo el tiempo",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"A cada sesión",de:"Jede Session"},value:"0"},{label:{en:"Everyday",fr:"Chaque jour",es:"Cada día",de:"Jeden Tag"},value:"1"},{label:{en:"Every week",fr:"Chaque semaine",es:"Cada semana",de:"Jede Woche"},value:"7"},{label:{en:"Every month",fr:"Chaque mois",es:"Cada mes",de:"Jeden Monat"},value:"30"},{label:{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)"},value:"365"}],value:"-1"},q=(R({},D,{label:P,propName:"closingRecurrence"}),R({},D,{label:O,propName:"displayRecurrence"}),R({},D,{label:L,propName:"validationRecurrence"}),[{label:{en:"Page load",fr:"Au chargement de la page",es:"Al cargar la página",de:"Beim Laden der Seite"},value:"pageLoad"},{label:{en:"Click",fr:"Au clic",es:"Al hacer clic",de:"Klick"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Antes de cerrar la pestaña",de:"Exit Intent"},value:"exitIntent"},{label:{en:"Delay",fr:"Après un délai",es:"Tras un retraso",de:"Verzögert"},value:"delay"},{label:{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"},value:"reengage"}]),Y={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:I,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:"triggerEvent",value:"click"}]},W={category:"conditions",type:"number",propName:"".concat("triggerEvent","ExitDelay"),label:{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"},min:0,max:120,value:0,conditions:[{field:"triggerEvent",value:"exitIntent"}]},M={category:"conditions",type:"number",propName:"".concat("triggerEvent","ReengageDelay"),label:{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"},min:1,max:120,value:10,conditions:[{field:"triggerEvent",value:"reengage"}]},F={category:"conditions",type:"number",propName:"".concat("triggerEvent","Delay"),label:{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"},value:10,conditions:[{field:"triggerEvent",value:"delay"}]},z=([{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche",es:"¿ Cuándo se activa? ",de:"Triggert bei"},options:q,propName:"triggerEvent",value:"pageLoad"}].concat(d([Y,W,M,F])),function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")}),G=((j="undefined"!=typeof global?global:window).ABTasty||Object.assign(j,{ABTasty:{widgetutils:{}}}),j.ABTasty.widgetutils||Object.assign(j.ABTasty,{widgetutils:{}}),j).ABTasty.widgetutils;function U(t,e){return G.hasOwnProperty(t)||Object.assign(G,n({},t,new e)),G[t]}function V(t,e){return new Promise(function(n,r){var i=new XMLHttpRequest;i.open(t,e,!0),i.onload=function(){this.status>=200&&this.status<300?n(i.response):r({status:this.status,statusText:i.statusText})},i.onerror=function(){r({status:this.status,statusText:i.statusText})},i.send()})}var H=function(){return"".concat(PACKAGE.replace("@abtasty/","")).concat(DATA&&DATA.type?"_".concat(DATA.type):"")},Q=function(){return"".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID)},J=function(){if(z())return!1;var t=DATA;return{displayRecurrence:t.displayRecurrence,closingRecurrence:t.closingRecurrence,validationRecurrence:t.validationRecurrence}},K=function(){if(z())return!1;var t,e=DATA,n=e.triggerEvent,r=e.triggerEventClick,i=e.triggerEventExitDelay,a=e.triggerEventDelay,o=e.triggerEventReengageDelay,s=r;switch(n){case"exitIntent":t=i;break;case"delay":t=a;break;case"reengage":t=o;break;default:t=0}return{triggerEvent:n,triggerSelector:s,triggerDelay:t}};function X(){return"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(t="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver",new Promise(function(e,n){var r=window.document.getElementsByTagName("script")[0],i=window.document.createElement("script");i.src=t,r.parentNode.insertBefore(i,r),i.onload=e,i.onerror=n}));var t}function Z(t){return function(){return c(e.mark(function t(n){return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=n,t.next="IntersectionObserver"===t.t0?3:6;break;case 3:return t.next=5,X();case 5:return t.abrupt("return",t.sent);case 6:return t.abrupt("return",!0);case 7:case"end":return t.stop()}},t)})).apply(this,arguments)}.apply(this,arguments)}var $=["pageLoad","delay","reengage"],tt=function(){function t(){var e=this;p(this,t),this.uniqueId=Q(),this.widgetName=H(),this.recurrenceParams=J(),this.triggerParams=K(),this.recurrence=!!this.recurrenceParams&&new ot(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new ct(this.triggerParams),this.pageWatcher=new ut(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=!!this.trigger&&$.some(function(t){return t===e.trigger.event}),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(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[]}return g(t,[{key:"clearGivenClearables",value:function(){this.eventsListeners.length&&(this.eventsListeners.forEach(function(t){var e;return(e=document).removeEventListener.apply(e,d(t))}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(function(t){return clearTimeout(t)}),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(function(t){return clearInterval(t)}),this.intervals=[]),this.observers.length&&(this.observers.forEach(function(t){return t.disconnect()}),this.observers=[]),this.promises.length&&(this.promises.forEach(function(t){return t.resolve(!1)}),this.promises=[])}},{key:"isWidgetApplied",value:function(){return this.domElement&&!!this.domElement.closest("html")}},{key:"insert",value:function(){var t=this;return ht("head",function(e){return e.appendChild(t.styleElement)},function(t){return console.error(t)}),ht("body",function(e){return e.appendChild(t.domElement)},function(t){return console.error(t)}),this}},{key:"remove",value:function(){var t=this;return this.pageWatcher.clearWatcher(),this.domElement&&this.domElement.closest("html")&&this.domElement.remove(),this.styleElement&&this.styleElement.closest("html")&&this.styleElement.remove(),this.hasOncePerPageTrigger?this.pageWatcher.watch():this.init().then(function(e){return e&&t.show()}),this}},{key:"show",value:function(){return this.closedByUser=!1,this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,z()||this.pageWatcher.watch(),this}},{key:"hide",value:function(){return this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}},{key:"init",value:function(){var t=c(e.mark(function t(){var n;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.trigger||!this.trigger.promises.length){t.next=2;break}return t.abrupt("return",!1);case 2:if(n=this.recurrence&&this.recurrence.isOver(),!this.recurrence||n){t.next=6;break}return this.pageWatcher.watch(),t.abrupt("return",!1);case 6:if(z()||this.pageWatcher.watch(),t.t0=z()||!this.trigger,t.t0){t.next=15;break}if(t.t1=this.trigger,!t.t1){t.next=14;break}return t.next=13,this.trigger.isTriggered();case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:if(t.t0){t.next=18;break}return t.abrupt("return",!1);case 18:return this.insert(),this.addCloseEvent(),t.abrupt("return",this);case 21:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"onPageChange",value:function(t,e){var n=this;switch(e||(this.hasBeenShown=!1),t){case"remove":this.isWidgetApplied()?this.remove():this.trigger.clear()&&this.pageWatcher.watch();break;case"rebuild":this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():this.insert().show():n.init().then(function(t){return t&&n.show()})}}},{key:"addCloseEvent",value:function(){for(var t=this,e=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),i=0;i<n;i++)r[i]=arguments[i];return r.push.apply(r,d(e)),r.forEach(function(e){e.addEventListener("click",function(){t.recurrence&&t.recurrence.setClosingRecurrence(),t.hide(),setTimeout(function(){return t.remove()},1e3)},{passive:!0,once:!0})}),this}},{key:"getDom",value:function(){var t=document.createElement("div");return t.className="".concat(this.basicClassName," ").concat(this.hideClassName),t.id=this.widgetContainerId,t.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(z()?"data-abtasty-actionnable":"",">+</button>\n\t\t\t</div>"),t}},{key:"getStyleTag",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=document.createElement("style");return e.type="text/css",z()&&e.setAttribute("abtasty-script-added","true"),e.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(t),e}}]),t}(),et=function(t){function e(){var t;return p(this,e),(t=y(this,b(e).call(this))).stringStyles=t.getStyles(),t.styleElement=t.getStyleTag(t.stringStyles),t}return k(e,tt),g(e,[{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\twidth: auto;\n\t\t\theight: auto;\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}")}}]),e}(),nt=function(t){function e(t){var n;return p(this,e),(n=y(this,b(e).call(this))).position=t,n.stringStyles=n.getStyles(),n.styleElement=n.getStyleTag(n.stringStyles),n}return k(e,tt),g(e,[{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\twidth: auto;\n\t\t\theight: auto;\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}")}}]),e}(),rt=function(t){function e(t,n){var r;return p(this,e),(r=y(this,b(e).call(this))).position=t,r.referrerElement=n,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return k(e,tt),g(e,[{key:"insert",value:function(){var t=this;return ht("head",function(e){return e.appendChild(t.styleElement)},function(t){return console.error(t)}),ht(this.referrerElement,function(e){return e.insertAdjacentElement(t.position,t.domElement)},function(t){return console.error(t)}),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\twidth: auto;\n\t\t\theight: auto;\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}")}}]),e}();function it(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function at(t){var e=function(t,e){if("object"!==m(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===m(e)?e:String(e)}var ot=function(){function t(e,n){var r=e.displayRecurrence,i=e.closingRecurrence,a=e.validationRecurrence;p(this,t),this.displayRecurrence=parseFloat(r),this.closingRecurrence=parseFloat(i),this.validationRecurrence=parseFloat(a),this.onSetCallback=n,this.widgetName=H(),this.uniqueId=Q(),this.recurrenceKey="".concat(this.widgetName,"_").concat(this.uniqueId)}return g(t,[{key:"getGivenRecurrenceStorageParsed",value:function(t){try{var e=t.getItem("ABTastyWidgets");return JSON.parse(e)}catch(e){return t.removeItem("ABTastyWidgets"),!1}}},{key:"getSessionRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}},{key:"getLocalRecurrenceStorageParsed",value:function(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}},{key:"removeGivenStorage",value:function(t,e){var n=this.recurrenceKey,r=(e[n],S(e,[n].map(at)));return Object.entries(r).length?(t.setItem("ABTastyWidgets",JSON.stringify(r)),r):(t.removeItem("ABTastyWidgets"),!1)}},{key:"removeSessionRecurrenceStorage",value:function(){var t=this.getSessionRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.sessionStorage,t)}},{key:"removeLocalRecurrenceStorage",value:function(){var t=this.getLocalRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.localStorage,t)}},{key:"getSessionRecurrence",value:function(){var t=this.getSessionRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}},{key:"getLocalRecurrence",value:function(){var t=this.getLocalRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}},{key:"getCurrentRecurrence",value:function(){var t=this.getSessionRecurrence(),e=this.getLocalRecurrence();return t||e||{type:!1}}},{key:"isOver",value:function(){var t=this.getLocalRecurrence(),e=(t?parseFloat(t.stamp):0)<(new Date).getTime();return e&&this.removeLocalRecurrenceStorage(),e&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}},{key:"setRecurrence",value:function(t,e){var r=this,i=this.getTypeOfStorage(t);if(!i&&"object"!==m(i))return!1;var a=this.getTypeOfStorage(t),o=a.storageString,s=a.storageMethod,c=this.getStamp(t),u={type:e,stamp:c},l=this.getCurrentRecurrence().type,h=function(){var t,e=r.getSessionRecurrence(),i=r.getLocalRecurrence();"session"===o?e?t=r.removeSessionRecurrenceStorage():(r.removeLocalRecurrenceStorage(),t=r.getSessionRecurrenceStorageParsed()):"local"===o&&(i?t=r.removeLocalRecurrenceStorage():(r.removeSessionRecurrenceStorage(),t=r.getLocalRecurrenceStorageParsed()));var a=t?function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?it(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}(n({},r.recurrenceKey,u),t):n({},r.recurrenceKey,u);s.setItem("ABTastyWidgets",JSON.stringify(a)),r.onSetCallback&&"function"==typeof r.onSetCallback&&r.onSetCallback()};if(!s)return!1;if(l&&"validation"!==e)if("closing"===e&&"validation"!==l)h();else{if("display"!==e||"validation"===l||"closing"===l)return!1;h()}else h();return c}},{key:"setDisplayRecurrence",value:function(){this.setRecurrence(this.displayRecurrence,"display")}},{key:"setClosingRecurrence",value:function(){this.setRecurrence(this.closingRecurrence,"closing")}},{key:"setValidationRecurrence",value:function(){this.setRecurrence(this.validationRecurrence,"validation")}},{key:"getStamp",value:function(t){return(new Date).getTime()+864e5*t}},{key:"getTypeOfStorage",value:function(t){return!(isNaN(t)||t<0||0!==t&&!t)&&(t>0?{storageString:"local",storageMethod:window.localStorage}:0===t&&{storageString:"session",storageMethod:window.sessionStorage})}}]),t}(),st=function(){function t(){p(this,t),this.targets=[],this.existingTargets=[],this.inViewPortTargets=[],this.visibilityobserver=this.startVisibilityObserver(),this.mutationobserver=this.startMutationObserver()}return g(t,[{key:"intersectionHandler",value:function(t){var e=this;t.forEach(function(t){t.isIntersecting?(e.existingTargets=e.existingTargets.filter(function(n){return n.element!==t.target||(e.inViewPortTargets.push(n),!1)}),e.checkElements()):e.inViewPortTargets=e.inViewPortTargets.filter(function(n){return n.element!==t.target||(e.existingTargets.push(n),!1)})})}},{key:"startVisibilityObserver",value:function(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:0})}},{key:"startMutationObserver",value:function(){var t=new MutationObserver(this.checkElements.bind(this));return t.observe(document,{attributes:!0,childList:!0,subtree:!0}),t}},{key:"isElementVisible",value:function(t){return this.isElementTopmost(t)&&this.isElementOpaque(t)}},{key:"isElementOpaque",value:function(t){return"HTML"===function t(e,n){return n(e)||!e.parentElement?e:t(e.parentElement,n)}(t,function(t){return"0"===window.getComputedStyle(t).opacity}).nodeName}},{key:"isElementTopmost",value:function(t){for(var e=t.getBoundingClientRect(),n=[[e.left,e.top],[e.right,e.top],[e.left,e.bottom],[e.right,e.bottom],[e.left+e.width/2,e.top],[e.left+e.width/2,e.bottom],[e.left,e.height/2],[e.right,e.height/2],[e.left+e.left/2,e.height/2]],r=!1,i=0;!r&&i<n.length;){var a,o=(a=document).elementFromPoint.apply(a,d(n[i]));r=t===o||t.contains(o),i++}return r}},{key:"checkElements",value:function(){var t=this;this.targets=this.targets.filter(function(e){var n=document.querySelector(e.selector);return!n||(t.existingTargets.push(Object.assign(e,{element:n})),t.visibilityobserver.observe(n),!1)}),this.existingTargets=this.existingTargets.filter(function(e){return!!document.querySelector(e.selector)||(t.visibilityobserver.unobserve(e.element),t.targets.push(e),!1)}),this.inViewPortTargets=this.inViewPortTargets.filter(function(e){var n=e.element,r=e.resolve;return!t.isElementVisible(n)||(t.visibilityobserver.unobserve(n),r(n),!1)})}},{key:"watch",value:function(t,e){this.targets.push({selector:t,resolve:e})}},{key:"clear",value:function(t){var e=this.targets.filter(function(e){return e.selector!==t});0===e.length&&(this.existingTargets=[],this.inViewPortTargets=[],this.mutationobserver.disconnect(),this.visibilityobserver.unobserve(t)),this.targets.length>e&&(this.targets=e,this.visibilityobserver.unobserve(t))}}]),t}(),ct=function(){function t(e){var n=e.triggerEvent,r=e.triggerSelector,i=e.triggerDelay;p(this,t),this.event=n,this.selector=r&&r.length?r:"body",this.delay=i,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[]}return g(t,[{key:"onElementVisible",value:(n=c(e.mark(function n(){var r,i,a,o;return e.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.promiseDeferrer("onElementVisible"),this.promises.push(r),e.next=4,this.onPageLoad();case 4:return i=e.sent,e.next=7,Z("IntersectionObserver");case 7:return a=e.sent,o=U("VisibilityObserver",st),this.visibilityObservers.push(o),a&&i&&o.watch(this.selector,r.resolve),e.abrupt("return",r.promise);case 12:case"end":return e.stop()}},n,this)})),function(){return n.apply(this,arguments)})},{key:"onPageLoad",value:function(){var e=t.promiseDeferrer("onPageLoad");this.promises.push(e);var n=function(){return"complete"===document.readyState};if(n())e.resolve(!0);else{var r,i=setTimeout(function(){return e.resolve(!1)},2e4),a=["readystatechange",function(){return n()&&!clearTimeout(i)&&!e.resolve(!0)},{passive:!0}];this.timeouts.push(i),this.eventsListeners.push(a),(r=document).addEventListener.apply(r,a)}return e.promise}},{key:"onClick",value:function(){var e,n=this,r=document.createElement("style");r.type="text/css",r.id="Click_".concat(Q()),r.innerHTML="".concat(this.selector," {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}"),document.head.appendChild(r),this.elementsSelectors.push("#".concat(r.id));var i=t.promiseDeferrer("onClick");this.promises.push(i);var a=["click",function(t){return!!function(t){return d(document.querySelectorAll(n.selector)).some(function(e){return e.isSameNode(t)||!!t.closest(n.selector)})}(t.target)&&(i.resolve(!0),n.clear())},{passive:!0,capture:!0}];return this.eventsListeners.push(a),(e=document).addEventListener.apply(e,a),i.promise}},{key:"onExitIntent",value:function(){var n=this,r=t.promiseDeferrer("onExitIntent");this.promises.push(r);var i=["mouseleave",function(){var t=c(e.mark(function t(){var i,a;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.delay){t.next=6;break}i=1e3*n.delay,a=setTimeout(function(){r.resolve(!0)},i),n.timeouts.push(a),t.next=8;break;case 6:return r.resolve(!0),t.abrupt("return");case 8:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}(),{passive:!0,once:!0}];return ht("body",function(t){t.addEventListener.apply(t,i),n.eventsListeners.push([t].concat(i))}),r.promise}},{key:"onDelay",value:function(){var e=t.promiseDeferrer("onDelay");this.promises.push(e);var n=1e3*this.delay,r=setTimeout(function(){e.resolve(!0)},n);return this.timeouts.push(r),e.promise}},{key:"onReengage",value:function(){var e=this,n=t.promiseDeferrer("onReengage");this.promises.push(n);var r=1e3*this.delay,i=r,a=[function(){return i=r},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(function(t){var n;(n=document).addEventListener.apply(n,[t].concat(a)),e.eventsListeners.push([t].concat(a))});var o=setInterval(function(){i<=0?n.resolve(!0):i-=100},100);return this.intervals.push(o),n.promise}},{key:"clear",value:function(){var t=this;return this.elementsSelectors.length&&(this.elementsSelectors.forEach(function(t){document.querySelector(t)&&document.querySelector(t).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(function(t){var e="string"==typeof t[0]?[document].concat(d(t)):t,n=E(e),r=n[0],i=n.slice(1);r&&i.length>1&&r.removeEventListener.apply(r,d(i))}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(function(t){return clearTimeout(t)}),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(function(t){return clearInterval(t)}),this.intervals=[]),this.observers.length&&(this.observers.forEach(function(t){return t.disconnect()}),this.observers=[]),this.visibilityObservers.length&&(this.visibilityObservers.forEach(function(e){return e.clear(t.selector)}),this.visibilityObservers=[]),this.promises.length&&(this.promises.forEach(function(t){return t.resolve(!1)}),this.promises=[]),this}},{key:"isTriggered",value:function(){var t=c(e.mark(function t(){var n;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this.clear(),t.t0=this.event,t.next="pageLoad"===t.t0?4:"click"===t.t0?9:"exitIntent"===t.t0?14:"delay"===t.t0?19:"reengage"===t.t0?24:"elementVisible"===t.t0?29:34;break;case 4:return t.next=6,this.onPageLoad();case 6:return n=t.sent,this.clear(),t.abrupt("break",35);case 9:return t.next=11,this.onClick();case 11:return n=t.sent,this.clear(),t.abrupt("break",35);case 14:return t.next=16,this.onExitIntent();case 16:return n=t.sent,this.clear(),t.abrupt("break",35);case 19:return t.next=21,this.onDelay();case 21:return n=t.sent,this.clear(),t.abrupt("break",35);case 24:return t.next=26,this.onReengage();case 26:return n=t.sent,this.clear(),t.abrupt("break",35);case 29:return t.next=31,this.onElementVisible();case 31:return n=t.sent,this.clear(),t.abrupt("break",35);case 34:n=!1;case 35:return t.abrupt("return",n);case 36:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()}],[{key:"promiseDeferrer",value:function(t){var e={promise:null,resolve:null,reject:null,name:t};return e.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),e}}]),t;var n}();var ut=function(){function t(e,n,r){p(this,t),this.recurrence=e,this.isWidgetApplied=n,this.callback=r,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=[_,this.eventHandler.bind(this),{passive:!0}]}return g(t,[{key:"recurrenceIsDone",value:function(){return!this.recurrence||this.recurrence.isOver()}},{key:"decisionHandler",value:function(t){var e=this,n=!!window.ABTasty.getTestsOnPage()[TEST_ID],r=(this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1}).type,i=function(){return t&&"display"===r||e.recurrenceIsDone()};return!this.isWidgetApplied()&&n&&i()?(this.clearWatcher(),this.callback("rebuild",t)):(!this.isWidgetApplied()||n&&i())&&(this.isWidgetApplied()||n)||(this.clearWatcher(),this.callback("remove",t),this.watch()),this}},{key:"eventHandler",value:function(){var t=this;return setTimeout(function(){t.decisionHandler(!1)},250),this}},{key:"observerHandler",value:function(t){var e=t.some(function(t){var e=t.removedNodes;return e&&e.length}),n=t.some(function(t){var e=t.addedNodes;return e&&e.length});return e||n?(this.decisionHandler(!0),this):this}},{key:"watch",value:function(){var t,e=this;return this.clearWatcher(),(t=document).addEventListener.apply(t,d(this.eventListenerParams)),ht("body",function(t){var n,r=[t,{childList:!0,subtree:!0}];(n=e.observer).observe.apply(n,r)}),this}},{key:"clearWatcher",value:function(){var t;return(t=document).removeEventListener.apply(t,d(this.eventListenerParams)),this.observer.disconnect(),this}}]),t}(),lt=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.unshift("[AB Tasty Widget] ".concat(PACKAGE,":")),(t=console).log.apply(t,n)},ht=function(t,e,n){var r,i=0;try{document.querySelector(t)}catch(e){var a="Selector «".concat(t,"» not valid.");return lt(a),"function"==typeof n&&n(a)}r=setTimeout(function(){clearInterval(i);var e="Can't find element «".concat(t,"».");return lt(e),"function"==typeof n&&n(e)},1e4),i=setInterval(function(){var n=document.querySelector(t);if(null!==n)return clearTimeout(r),clearInterval(i),"function"==typeof e&&e(n)},200)},dt="https://nps.abtasty.com/api/",pt=DATA.isFeedBackQuestion,ft=function(t,e){var n,r,i,a,o,s,c=e.question,u=e.__npsCampaignId,l=e.userFeedback,h=e.feedbackQuestion,d=window.ABTASTY_S?(n=ABTASTY_S.STORE,r=n.masterTest,i=n.test,a=n.currentVariation,o=n.tunnelParent,s=ABTASTY_S.EDITOR.getAtTestId,o?s()>o?"".concat(r.name," - ").concat(i.name):s()===o?"".concat(r.name," - ").concat(i.name," - ").concat(a.name):"":"".concat(r.name," - ").concat(a.name)):"",p=function(t,e,n){return pt?"editor"===t?n:"client"===t?e:"":""}(t,l,h);return{abtastyIdentifier:"abtastyidentifier=".concat(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}()),accessToken:"access_token=".concat(window.ABTASTY_S?ABTASTY_S.SERVER.token:""),testId:"testId=".concat(TEST_ID),variationId:"variationId=".concat(window.ABTASTY_S?ABTASTY_S.STORE.currentVariation.id:""),name:"name=".concat(d),nps:"nps=".concat(c),feedback:"feedback=".concat(p),id:"id=".concat(u),abtastyuserid:"abtastyuserid=".concat(window.ABTasty&&window.ABTasty.visitor?window.ABTasty.visitor.id:void 0)}},gt=function(t){if(t.__npsCampaignId)return!1;var e,n,r,i,a,o,s,c,u=ft("editor",t);return V("GET",(n=(e=u).abtastyIdentifier,r=e.accessToken,i=e.testId,a=e.variationId,o=e.name,s=e.nps,c=e.feedback,"".concat(dt,"setNPS.php?").concat(n,"&").concat(r,"&").concat(i,"&").concat(a,"&").concat(o,"&").concat(s,"&").concat(c)))},mt=function(t){var e=t.detail;if(!e.__npsCampaignId)return!1;var n,r,i,a,o,s,c,u,l,h=ft("editor",e);return V("GET",(r=(n=h).id,i=n.abtastyIdentifier,a=n.accessToken,o=n.testId,s=n.variationId,c=n.name,u=n.nps,l=n.feedback,"".concat(dt,"setNPS.php?").concat(r,"&").concat(i,"&").concat(a,"&").concat(o,"&").concat(s,"&").concat(c,"&").concat(u,"&").concat(l)))},vt=function(t,e){var n,r,i,a=DATA,o=a.question,s=a.__npsCampaignId,c=function(t,e){var n=e.feedback,r=e.id,i=e.abtastyIdentifier,a=e.abtastyuserid,o="score=".concat(t);return"".concat(dt,"collect.php?").concat(o,"&").concat(n,"&nps").concat(r,"&").concat(i,"&").concat(a)}(t,ft("client",{question:o,__npsCampaignId:s,userFeedback:e}));return n="GET",r=c,(i=new XMLHttpRequest).open(n,r,!1),i.send(null),i};function yt(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}var bt=DATA,wt=bt.themeType,kt=bt.layout,Ct=bt.isFeedBackQuestion,St=bt.isThankYouMessage,Et=bt.isLegend,Tt=bt.timeHide,Nt=bt.stepToShow,xt=function(){function t(e){var n=e.uniqueId,r=e.question,i=e.feedbackQuestion,a=e.userStyles,o=e.parentContainer,s=e.buttonText,c=e.thankYouMessage,u=e.zeroLegend,l=e.tenLegend,h=e.recurrence;p(this,t),this.uniqueId=n,this.question=r,this.feedbackQuestion=i,this.userStyles=a,this.parentContainer=o,this.buttonText=s,this.thankYouMessage=c,this.legend={zeroLegend:u,tenLegend:l},this.recurrence=h,this.baseClassName="nps_container",this.npsClassName="".concat(this.baseClassName,"_").concat(this.uniqueId),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackQuestionClassName="".concat(this.questionClassName,"_feedback"),this.feedbackFormClassName="".concat(this.questionClassName,"_feedback_form"),this.notesButtonsClassName="".concat(this.notesClassName,"_button"),this.thankYouClassName="".concat(this.baseClassName,"_thanks"),this.hideClassName="nps_".concat(this.uniqueId,"_display_none"),this.currentNote=NaN,this.userFeedback="",this.npsContainer=this.getContainer(),this.questionElement=this.getQuestionElement(),this.notesContainer=this.getNotesElement(),this.feedbackElements=this.getFeedBackElements(),this.thankYouElement=this.getThankYouElement(),this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}return g(t,[{key:"sendNote",value:function(){if(!z()&&!isNaN(this.currentNote)){vt(this.currentNote,this.userFeedback);try{window.abtasty.send("nps",{ns:this.currentNote,nf:this.userFeedback})}catch(t){}this.recurrence.setValidationRecurrence()}return this}},{key:"setExternalEvents",value:function(){var t=this,e={passive:!0,once:!0};return[this.parentContainer.overlayClassName,this.parentContainer.closeButtonClassName].forEach(function(n){t.parentContainer.domElement.querySelector(".".concat(n)).addEventListener("mouseup",function(){return t.recurrence.setClosingRecurrence()},e)}),this}},{key:"insert",value:function(t,e){return document.head.insertAdjacentElement("beforeend",this.styleElement),t.insertAdjacentElement(e,this.npsElement),this.setExternalEvents(),this}},{key:"remove",value:function(){return this.npsElement&&this.npsElement.remove(),this.styleElement&&this.styleElement.remove(),this}},{key:"complete",value:function(){var t=this;this.sendNote(),setTimeout(function(){t.parentContainer.hide(),setTimeout(function(){t.remove(),t.parentContainer.remove()},1e3)},1e3*Tt)}},{key:"onClickNote",value:function(t){this.currentNote=Number(t.target.dataset.note),Ct&&this.feedbackQuestion&&this.feedbackQuestion.length?this.showFeedBack():St&&this.thankYouMessage&&this.thankYouMessage.length?this.showThankYouMessage():this.complete()}},{key:"onFeedbackSend",value:function(){St&&this.thankYouMessage&&this.thankYouMessage.length?this.showThankYouMessage():this.complete()}},{key:"showFeedBack",value:function(){var t=this;return this.npsContainer.childNodes.forEach(function(e){return e.classList.add(t.hideClassName)}),Object.values(this.feedbackElements).forEach(function(e){return e.classList.remove(t.hideClassName)}),this}},{key:"showThankYouMessage",value:function(){var t=this;return this.npsContainer.childNodes.forEach(function(e){return e.classList.add(t.hideClassName)}),this.thankYouElement.classList.remove(this.hideClassName),this.complete(),this}},{key:"getThankYouElement",value:function(){var t=document.createElement("p");return t.className="".concat(this.thankYouClassName," ").concat(this.hideClassName),t.innerHTML=this.thankYouMessage,z()&&"displayThanksStep"===Nt&&t.classList.remove(this.hideClassName),t}},{key:"getFeedBackElements",value:function(){var t=this,e=document.createElement("p");e.className="".concat(this.feedbackQuestionClassName," ").concat(this.hideClassName),e.innerHTML=this.feedbackQuestion;var n=document.createElement("form");n.className="".concat(this.feedbackFormClassName," ").concat(this.hideClassName),n.addEventListener("submit",function(t){return t.preventDefault()},{passive:!1});var r=document.createElement("input");r.className="".concat(this.feedbackQuestionClassName,"_input"),r.type="text";var i=document.createElement("button");return i.className="".concat(this.feedbackQuestionClassName,"_button"),i.innerHTML=this.buttonText,i.addEventListener("click",function(){return t.userFeedback=r.value,t.onFeedbackSend()},{passive:!0}),z()&&"displayFeedbackStep"===Nt&&[e,n].forEach(function(e){return e.classList.remove(t.hideClassName)}),n.appendChild(r),n.appendChild(i),{feedbackQuestionElement:e,feedbackFormElement:n}}},{key:"getNotesElement",value:function(){var t=this,e=document.createElement("div");e.className=this.notesClassName,z()&&"displayNoteStep"!==Nt&&e.classList.add(this.hideClassName);for(var n=10;n>=0;){var r=document.createElement("button");r.className=this.notesButtonsClassName,r.dataset.note=n,z()&&r.setAttribute("data-abtasty-actionnable",""),r.innerHTML+="<span>".concat(n,"</span>"),r.addEventListener("click",function(e){return t.onClickNote(e)},{passive:!0}),e.insertAdjacentElement("afterbegin",r),5===n&&r.insertAdjacentHTML("afterend","<br>"),n-=1}return Et&&(e.insertAdjacentHTML("afterbegin","<legend>".concat(this.legend.zeroLegend,"</legend>")),e.insertAdjacentHTML("beforeend","<legend>".concat(this.legend.tenLegend,"</legend>"))),e}},{key:"getQuestionElement",value:function(){var t=document.createElement("p");return t.className=this.questionClassName,t.innerHTML=this.question,z()&&"displayNoteStep"!==Nt&&t.classList.add(this.hideClassName),t}},{key:"getContainer",value:function(){var t=document.createElement("div");return t.className="".concat(this.baseClassName," ").concat(this.npsClassName),t}},{key:"getNPSElement",value:function(){var t=this;return this.npsContainer.appendChild(this.questionElement),this.npsContainer.appendChild(this.notesContainer),Ct&&Object.values(this.feedbackElements).forEach(function(e){t.npsContainer.appendChild(e)}),St&&this.npsContainer.appendChild(this.thankYouElement),this.npsContainer}},{key:"getDefaultStyles",value:function(){var t="\n\t\t\t#".concat(this.parentContainer.widgetContainerId," .").concat(this.baseClassName,",\n\t\t\t#").concat(this.parentContainer.widgetContainerId," .").concat(this.baseClassName," *");return"\n\t\t".concat(t," {\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tmin-width: inherit;\n\t\t\tmin-height: inherit;\n\t\t\tmax-width: inherit;\n\t\t\tmax-height: inherit;\n\t\t\tline-height: 1;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tborder: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.overlayClassName," {\n\t\t\topacity: 1;\n\t\t}\n\t\t#").concat(this.parentContainer.widgetContainerId," .").concat(this.hideClassName," {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t#").concat(this.parentContainer.widgetContainerId," .").concat(this.baseClassName," .").concat(this.notesButtonsClassName," span {\n\t\t\tpointer-events: none;\n\t\t}\n\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.closeButtonClassName," {\n\t\t\tpadding: 0;\n\t\t\tline-height: 1;\n\t\t}\n\t\t@media (orientation: landscape) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: .55vmax;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: landscape) and (max-width: 1280px) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: .7vmax;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: landscape) and (max-width: 800px) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: 1vmax;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: portrait) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: 1vmin;\n\t\t\t}\n\t\t}\n\t\t@media (orientation: portrait) and (max-width: 550px) {\n\t\t\t").concat(t," {\n\t\t\t\tfont-size: 2.2vmin;\n\t\t\t\tline-height: 1.3;\n\t\t\t\tmax-width: ").concat("popin"===kt?"85vw":"auto",";\n\t\t\t}\n\t\t}")}},{key:"getThemeDefaultStyles",value:function(){var t="popin"===kt?"75em":"auto",e="#".concat(this.parentContainer.widgetContainerId," .").concat(this.npsClassName);return"\n\t\t".concat(e,",\n\t\t").concat(e," * {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: nowrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t").concat(e," {\n\t\t\twidth: ").concat(t,";\n\t\t\talign-items: center;\n\t\t}\n\t\t").concat(e," .").concat(this.questionClassName,",\n\t\t").concat(e," .").concat(this.feedbackQuestionClassName,",\n\t\t").concat(e," .").concat(this.thankYouClassName," {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," {\n\t\t\tflex-direction: row;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," legend {\n\t\t\talign-self: center;\n\t\t\tfont-size: 1.5em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," legend:first-of-type {\n\t\t\tmargin-right: 1em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesClassName," legend:last-of-type {\n\t\t\tmargin-left: 1em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesButtonsClassName," {\n\t\t\twidth: 3.5em;\n\t\t\theight: 3.5em;\n\t\t}\n\t\t").concat(e," .").concat(this.notesButtonsClassName," span {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t").concat(e," .").concat(this.feedbackFormClassName," {\n\t\t\tflex-direction: row;\n\t\t}\n\t\t").concat(e," .").concat(this.feedbackFormClassName," input {\n\t\t\twidth: 45em;\n\t\t\theight: 4em;\n\t\t\tpadding: 0 0.5em;\n\t\t}\n\t\t").concat(e," .").concat(this.feedbackFormClassName," button {\n\t\t\twidth: 10em;\n\t\t\tfont-size: 1.4em;\n\t\t}\n\t\t@media screen and (max-width: 550px) and (orientation: portrait) {\n\t\t\t").concat(e," .").concat(this.questionClassName,",\n\t\t\t").concat(e," .").concat(this.feedbackQuestionClassName," ,\n\t\t\t").concat(e," .").concat(this.thankYouClassName," {\n\t\t\t\tmax-width: 90%;\n\t\t\t\t align-self: flex-start;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 100%;\n\t\t\t\ttext-align: center;\n\t\t\t\tline-height: 5.5;\n\t\t\t\tposition: relative;\n\t\t\t\t").concat(Et?"padding-bottom: 4em;":"","\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesButtonsClassName," {\n\t\t\t\tdisplay: inline-block;\n\t\t\t\twidth: 4em;\n\t\t\t\theight: 4em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend {\n\t\t\t\tposition: absolute;\n\t\t\t\tbottom: 0;\n\t\t\t\tleft: 0;\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tfont-size: 1.25em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend:first-of-type {\n\t\t\t\tbottom: 1.2em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend:first-of-type::before {\n\t\t\t\tcontent: '0:';\n\t\t\t\tmargin-right: 0.4em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.notesClassName," legend:last-of-type::before {\n\t\t\t\tcontent: '10:';\n\t\t\t\tmargin-right: 0.4em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.feedbackFormClassName," {\n\t\t\t\tflex-direction: column;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.feedbackFormClassName," input {\n\t\t\t\tmargin: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 3em;\n\t\t\t\tfont-size: 1.8em;\n\t\t\t}\n\t\t\t").concat(e," .").concat(this.feedbackFormClassName," button {\n\t\t\t\twidth: 50%;\n\t\t\t\theight: 2.7em;\n\t\t\t\tmargin-top: 1em;\n\t\t\t\talign-self: center;\n\t\t\t\tfont-size: 1.5em;\n\t\t\t\tfont-weight: bold;\n\t\t\t}\n\t\t}")}},{key:"getUserStyles",value:function(){var t,e=this.userStyles,r=e.backgroundColor,i=e.borderColor,a=e.borderRadius,s=e.borderWidth,c=e.dropShadow,u=e.textColor,l=e.horizontalPaddingContainer,h=e.verticalPaddingContainer,d=e.horizontalMarginContainer,p=e.verticalMarginContainer,f=e.overlayColor,g=e.shadowOpacity,m=e.buttonsContrast,v=e.buttonsBorderRadius,y=e.buttonsShape,b=e.contentDirection,w=e.questionMargin,k=e.buttonsHorizontalMargin,C=e.inputBackgroundColor,S=e.inputBorderColor,E=e.inputBorderWidth,T=e.inputBorderRadius,N=e.inputTextColor,x=e.inputMarginWithButton,A=e.feedbackButtonBackgroundColor,O=e.feedbackButtonBorderColor,P=e.feedbackButtonBorderWidth,L=e.feedbackButtonBorderRadius,I=e.feedbackButtonTextColor,_=Object.entries(this.userStyles).filter(function(t){return o(t,1)[0].includes(m)}).reduce(function(t,e){var r=o(e,2),i=r[0],a=r[1],s=i.split("_".concat(m))[0],c=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yt(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},t);return c[s]=a,c},{}),B=_.buttonsBackgroundColor,R=_.buttonsTextColor,j=_.buttonsBorderColor,D=_.buttonsBorderWidth;switch(y){case"roundsquare":t="border-radius: ".concat(v,"px;");break;case"round":t="border-radius: 50%;";break;default:t=""}var q=c?"box-shadow: 0px 5px 10px 2px rgba(0, 0, 0, ".concat(g/100,");"):"",Y="#".concat(this.parentContainer.widgetContainerId," .").concat(this.npsClassName),W="\n\t\t\t".concat(Y," .").concat(this.notesButtonsClassName," {\n\t\t\t\tmargin-left: ").concat(k,"px;\n\t\t\t\tmargin-right: ").concat(k,"px;\n\t\t\t\tbackground-color: ").concat(B,";\n\t\t\t\tborder: ").concat(D,"px solid ").concat(j,";\n\t\t\t\t").concat(t,"\n\t\t\t}\n\t\t\t").concat(Y," .").concat(this.notesButtonsClassName," span {\n\t\t\t\tcolor: ").concat(R,";\n\t\t\t}");return"\n\t\t\tbody ".concat(Y," {\n\t\t\t\tflex-direction: ").concat(b,";\n\t\t\t\tbackground-color: ").concat(r,";\n\t\t\t\tborder: ").concat(s,"px solid ").concat(i,";\n\t\t\t\tborder-radius: ").concat(a,"px;\n\t\t\t\tpadding: ").concat(h,"px ").concat(l,"px;\n\t\t\t\t").concat(q,"\n\t\t\t}\n\t\t\t").concat(Y," .").concat(this.questionClassName,",\n\t\t\t").concat(Y," .").concat(this.feedbackQuestionClassName," ,\n\t\t\t").concat(Y," .").concat(this.thankYouClassName," {\n\t\t\t\tcolor: ").concat(u,";\n\t\t\t\tmargin-").concat("row"===b?"right":"bottom"," : ").concat(w,"px;\n\t\t\t}\n\t\t\t").concat(Y," .").concat(this.thankYouClassName," {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t").concat(Y," .").concat(this.notesClassName," legend {\n\t\t\t\tcolor: ").concat(u,";\n\t\t\t}\n\t\t\t").concat(W,"\n\t\t\t").concat(Y," .").concat(this.feedbackFormClassName," input {\n\t\t\t\tbackground-color: ").concat(C,";\n\t\t\t\tborder: ").concat(E,"px solid ").concat(S,";\n\t\t\t\tborder-radius: ").concat(T,"px;\n\t\t\t\tcolor: ").concat(N,";\n\t\t\t\tmargin-right: ").concat(x,"px;\n\t\t\t}\n\t\t\t").concat(Y," .").concat(this.feedbackFormClassName," button {\n\t\t\t\tbackground-color: ").concat(A,";\n\t\t\t\tborder: ").concat(P,"px solid ").concat(O,";\n\t\t\t\tborder-radius: ").concat(L,"px;\n\t\t\t\tcolor: ").concat(I,";\n\t\t\t}\n\t\t\tbody #").concat(this.parentContainer.widgetContainerId," {\n\t\t\t\tmargin: ").concat(p,"px ").concat(d,"px;\n\t\t\t}\n\t\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.overlayClassName," {\n\t\t\t\tbackground-color: ").concat(f,";\n\t\t\t}\n\t\t\tbody #").concat(this.parentContainer.widgetContainerId," .").concat(this.parentContainer.closeButtonClassName," {\n\t\t\t\ttop: ").concat(h,"px;\n\t\t\t\tright: ").concat(l,"px;\n\t\t\t}")}},{key:"getStyleElement",value:function(){var t="theme"===wt,e=this.getDefaultStyles(),n=t?this.getThemeDefaultStyles():"",r=t?this.getUserStyles():"",i=document.createElement("style");return i.type="text/css",z()&&i.setAttribute("abtasty-script-added","true"),i.textContent="".concat(e," ").concat(n," ").concat(r),i}}]),t}();function At(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function Ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?At(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):At(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var Pt,Lt="NPS",It=DATA,_t=It.layout,Bt=It.bannerPosition,Rt=It.npsElementReferrer,jt=It.npsReferrerInsertType,Dt=It.contentDirection,qt=It.__npsCampaignId,Yt=It.question,Wt=It.feedbackQuestion,Mt=It.buttonText,Ft=It.thankYouMessage,zt=It.zeroLegend,Gt=It.tenLegend,Ut=It.themeType,Vt=It.theme,Ht=It.triggerEvent,Qt=It.triggerEventClick,Jt=It.triggerEventDelay,Kt=It.triggerEventExitDelay,Xt=It.triggerEventReengageDelay,Zt=It.displayRecurrence,$t=It.closingRecurrence,te=It.validationRecurrence,ee="".concat(PLUGIN_ID.split("-")[0],"_").concat(TEST_ID);function ne(t){return re.apply(this,arguments)}function re(){return(re=c(e.mark(function t(n){var r,i,a,o;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.detail,t.next=3,gt(r);case 3:if(i=t.sent){t.next=6;break}return t.abrupt("return",!1);case 6:return a=Ot({},r,{__npsCampaignId:JSON.parse(i).id}),o=new CustomEvent("asyncWidgetDataObtained",{detail:a}),top.dispatchEvent(o),t.abrupt("return",!0);case 10:case"end":return t.stop()}},t)}))).apply(this,arguments)}function ie(t,e){var n;switch(_t){case"popin":n=new et(ee,Lt);break;case"banner":n=new nt(ee,Lt,Bt);break;default:n=new rt(ee,Lt,jt,Rt)}n.init();var r=n.domElement.querySelector(".".concat(n.contentClassName)),i=new xt({uniqueId:ee,question:Yt,feedbackQuestion:Wt,userStyles:t,parentContainer:n,buttonText:Mt,thankYouMessage:Ft,zeroLegend:zt,tenLegend:Gt,recurrence:e});return i.insert(r,"beforeend"),n.show(),z()?ABTASTY_S.PLUGINS.NPS_Container_Class=n:e.setDisplayRecurrence(),{parentContainer:n,NPS:i}}function ae(){return"customCss"!==Ut&&Ot({},Object.entries(DATA).filter(function(t){return o(t,1)[0].includes(Vt)}).reduce(function(t,e){var n=o(e,2),r=n[0],i=n[1],a=r.split("".concat(Vt,"_"))[1],s=Ot({},t);return s[a]=i,s},{}),{contentDirection:Dt})}function oe(){return(oe=c(e.mark(function t(){var n,r,i,a,o;return e.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(qt){t.next=3;break}return top.console.error("\n\t\tThe NPS is not linked to any NPS campaign following a test duplicate.\n\t\tPlease go to ABTasty editor (https://app2.abtasty.com/edit/test/".concat(TEST_ID,"/editor) to generate a new NPS campaign.\n\t\t")),t.abrupt("return",!1);case 3:if((n=new ot({displayRecurrence:Zt,closingRecurrence:$t,validationRecurrence:te,widgetName:Lt,uniqueId:ee})).isOver()){t.next=7;break}return t.abrupt("return",!1);case 7:r=Qt,t.t0=Ht,t.next="exitIntent"===t.t0?11:"delay"===t.t0?13:"reengage"===t.t0?15:17;break;case 11:return i=Kt,t.abrupt("break",19);case 13:return i=Jt,t.abrupt("break",19);case 15:return i=Xt,t.abrupt("break",19);case 17:return i=0,t.abrupt("break",19);case 19:return a=new ct({triggerEvent:Ht,triggerSelector:r,triggerDelay:i}),t.next=23,a.isTriggered();case 23:return(o=t.sent)&&ie(ae(),n),t.abrupt("return",o);case 26:case"end":return t.stop()}},t)}))).apply(this,arguments)}z()?(!function(){if("onFirstWidgetSave"in ABTASTY_S.PLUGINS==0&&(ABTASTY_S.PLUGINS.onFirstWidgetSave=ne),"editNPSCampaign"in ABTASTY_S.PLUGINS==0&&(ABTASTY_S.PLUGINS.editNPSCampaign=mt),"string"!=typeof qt||qt.length||top.console.log("Duplication case"),qt||ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave){if(qt&&!ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave){var t,e,n=["widgetsave",ABTASTY_S.PLUGINS.editNPSCampaign,{once:!0}];(t=top).removeEventListener.apply(t,n),(e=top).addEventListener.apply(e,n)}}else{var r,i,a=["widgetsave",ABTASTY_S.PLUGINS.onFirstWidgetSave,{once:!0}];(r=top).removeEventListener.apply(r,a),ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave=!0,(i=top).addEventListener.apply(i,a)}}(),(Pt=ABTASTY_S.PLUGINS.NPS_Container_Class)&&document.querySelector("".concat(Pt.widgetContainerId))&&Pt.remove(),ie(ae())):function(){oe.apply(this,arguments)}()}();
|
package/package.json
CHANGED
@@ -1,47 +1,49 @@
|
|
1
|
-
{
|
2
|
-
"name": "@abtasty/nps",
|
3
|
-
"description": "Allow you to add a custom NPS on your website",
|
4
|
-
"version": "0.
|
5
|
-
"main": "dist/main.js",
|
6
|
-
"form": "dist/form.js",
|
7
|
-
"icon": "icon.png",
|
8
|
-
"files": [
|
9
|
-
"dist"
|
10
|
-
],
|
11
|
-
"repository": "abtasty/widget",
|
12
|
-
"author": "Jonathan Granger",
|
13
|
-
"license": "MIT",
|
14
|
-
"scripts": {
|
15
|
-
"start": "concurrently --kill-others \"npm run watch\" \"npm run serve\"",
|
16
|
-
"watch": "rollup -c --watch",
|
17
|
-
"build": "rollup -c",
|
18
|
-
"serve": "widget serve"
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"@babel/
|
24
|
-
"@babel/
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"eslint
|
30
|
-
"eslint-
|
31
|
-
"eslint-
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"rollup
|
36
|
-
"rollup-plugin-
|
37
|
-
"rollup-plugin-
|
38
|
-
"rollup-plugin-
|
39
|
-
"rollup-plugin-
|
40
|
-
"rollup-plugin-
|
41
|
-
"rollup-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
1
|
+
{
|
2
|
+
"name": "@abtasty/nps",
|
3
|
+
"description": "Allow you to add a custom NPS on your website",
|
4
|
+
"version": "0.5.0",
|
5
|
+
"main": "dist/main.js",
|
6
|
+
"form": "dist/form.js",
|
7
|
+
"icon": "icon.png",
|
8
|
+
"files": [
|
9
|
+
"dist"
|
10
|
+
],
|
11
|
+
"repository": "abtasty/widget",
|
12
|
+
"author": "Jonathan Granger",
|
13
|
+
"license": "MIT",
|
14
|
+
"scripts": {
|
15
|
+
"start": "concurrently --kill-others \"npm run watch\" \"npm run serve\"",
|
16
|
+
"watch": "rollup -c --watch",
|
17
|
+
"build": "rollup -c",
|
18
|
+
"serve": "widget serve",
|
19
|
+
"prepare": "npm run build",
|
20
|
+
"postpublish": "echo 'Your widget is on NPM. You can now add your widget to AB Tasty Marketplace at https://marketplace.abtasty.com/add'"
|
21
|
+
},
|
22
|
+
"devDependencies": {
|
23
|
+
"@babel/core": "^7.4.0",
|
24
|
+
"@babel/plugin-transform-classes": "^7.5.5",
|
25
|
+
"@babel/plugin-transform-runtime": "^7.4.0",
|
26
|
+
"@babel/preset-env": "^7.4.2",
|
27
|
+
"concurrently": "^3.5.0",
|
28
|
+
"cssnano": "^3.10.0",
|
29
|
+
"eslint": "^4.16.0",
|
30
|
+
"eslint-config-airbnb-base": "^12.1.0",
|
31
|
+
"eslint-config-prettier": "^2.9.0",
|
32
|
+
"eslint-import-resolver-node": "^0.3.2",
|
33
|
+
"eslint-plugin-import": "^2.8.0",
|
34
|
+
"postcss-cssnext": "^3.1.0",
|
35
|
+
"rollup": "^0.55.1",
|
36
|
+
"rollup-plugin-babel": "^4.3.2",
|
37
|
+
"rollup-plugin-commonjs": "^8.1.4",
|
38
|
+
"rollup-plugin-eslint": "^4.0.0",
|
39
|
+
"rollup-plugin-node-resolve": "^3.0.2",
|
40
|
+
"rollup-plugin-postcss": "^1.2.7",
|
41
|
+
"rollup-plugin-pug": "^0.1.6",
|
42
|
+
"rollup-plugin-uglify": "^3.0.0",
|
43
|
+
"rollup-watch": "^4.3.1"
|
44
|
+
},
|
45
|
+
"dependencies": {
|
46
|
+
"@abtasty/widget-utils": "1.12.8",
|
47
|
+
"@babel/runtime": "^7.4.2"
|
48
|
+
}
|
49
|
+
}
|