@abtasty/nps 0.5.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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 l=function(e){return a(e)||i(e)||s()};var c=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 l(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 O()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var s=x(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 l=c(e,t,n);if("normal"===l.type){if(r=n.done?f:d,l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=f,n.method="throw",n.arg=l.arg)}}}(e,n,i),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;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(B([])));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 l=c(e[o],e,a);if("throw"!==l.type){var u=l.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(l.arg)}(o,a,n,i)})}return n=n?n.then(i,i):i()}}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 h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=c(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 N(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(N,this),this.reset(!0)}function B(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:O}}function O(){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(l(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=B,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 l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)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:B(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),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).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"},x={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")},N={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"},B="style",O="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:N,propName:"closingRecurrence"}),z={category:"conditions",type:"group",label:S,collapsible:!0,children:[L({},j,{label:x,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(l([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:B,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:B,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)"},U={category:B,type:P,label:{en:"Border radius",fr:"Arrondi du contour",es:"Redondeo del contorno",de:"Rundung der Kontur"},propName:"borderRadius",value:0,unit:"px"},Y={category:B,type:P,label:{en:"Border thickness",fr:"Épaisseur du contour",es:"Grosor del contorno",de:"Konturendicke"},propName:"borderWidth",value:0,unit:"px"},Z=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]:"";c(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 ne("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),ne("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,l(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 c(this,t),(r=g(this,m(t).call(this,e,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}b(t,Z),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 c(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,Z),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 c(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,Z),d(t,[{key:"insert",value:function(){var e=this;return ne("head",function(t){return t.appendChild(e.styleElement)},function(e){return console.error(e)}),ne(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;c(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 X(){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 $(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,X();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 ee=function(){function e(){c(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,l(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}(),te=(function(){function e(t){var n=t.triggerEvent,r=t.triggerSelector,o=t.triggerDelay;c(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,$();case 5:o=e.sent,a=G("VisibilityObserver",ee),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 l(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&&ne("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)}),ne=function(e,t,n){var r,o=0;try{document.querySelector(e)}catch(t){var a="Selector «".concat(e,"» not valid.");return te(a),"function"==typeof n&&n(a)}r=setTimeout(function(){clearInterval(o);var t="Can't find element «".concat(e,"».");return te(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)},re='<a href="https://app2.abtasty.com/insights/nps" target="_blank">',oe={en:"".concat(re,"Access the NPS© results").concat("</a>"),fr:"".concat(re,"Accéder aux résultats du NPS©").concat("</a>"),es:"".concat(re,"Acceder a los resultados del NPS©").concat("</a>"),de:"".concat(re,"Zugang zu den NPS-Ergebnissen").concat("</a>")},ae={en:"Open-ended question",fr:"Question ouverte",es:"Pregunta abierta",de:"Offene Frage"},ie="\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",se={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(ie),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(ie),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}],ce=[{category:O,type:"hidden",propName:"__npsCampaignId",value:!1},{category:O,type:"paragraph",propName:"linkToNPSCampaignsList",text:oe},{category:O,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:O,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:O,type:"textarea",propName:"feedbackQuestion",label:ae,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:O,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:O,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:O,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:O,type:"checkbox",propName:"isLegend",label:{en:"Display key",fr:"Afficher un légende",es:"Mostrar una leyenda",de:"Legende anzeigen"},value:!1},{category:O,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:O,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}]}],ue=[{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"}]}],de=[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 pe=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 fe(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 he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(n,!0).forEach(function(t){pe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ge="rgba(255, 255, 255, 1)",me="rgb(33, 121, 129, 1)",ye=[{field:"themeType",value:"theme"}],be=[{field:"buttonsContrast",value:"full"}],ve=[{field:"buttonsContrast",value:"empty"}],ke={borderWidth:2,borderRadius:10,borderColor:me,backgroundColor:ge,overlayColor:"rgba(0, 0, 0, 0.6)",textColor:me,questionMargin:15,horizontalPaddingContainer:20,verticalPaddingContainer:15,horizontalMarginContainer:0,verticalMarginContainer:0,dropShadow:!1,shadowOpacity:0,buttonsHorizontalMargin:5,buttonsContrast:"full",buttonsShape:"roundsquare",buttonsBorderRadius:8,buttonsBackgroundColor_full:me,buttonsBackgroundColor_empty:ge,buttonsTextColor_full:ge,buttonsTextColor_empty:me,buttonsBorderColor_full:me,buttonsBorderColor_empty:me,buttonsBorderWidth_full:0,buttonsBorderWidth_empty:2,inputBackgroundColor:ge,inputBorderColor:me,inputBorderWidth:2,inputBorderRadius:8,inputTextColor:me,inputMarginWithButton:10,feedbackButtonBackgroundColor:ge,feedbackButtonBorderColor:me,feedbackButtonBorderWidth:2,feedbackButtonBorderRadius:8,feedbackButtonTextColor:me},we=[{themeValue:"lightTheme",defaultValues:he({},ke)},{themeValue:"darkTheme",defaultValues:he({},ke,{borderColor:me,backgroundColor:me,textColor:ge,buttonsContrast:"empty",buttonsBackgroundColor_full:ge,buttonsBackgroundColor_empty:me,buttonsTextColor_full:me,buttonsTextColor_empty:ge,buttonsBorderColor_full:ge,buttonsBorderColor_empty:ge,buttonsBorderWidth_full:2,buttonsBorderWidth_empty:2,inputBackgroundColor:me,inputBorderColor:ge,inputTextColor:ge,feedbackButtonBackgroundColor:me,feedbackButtonBorderColor:ge,feedbackButtonTextColor:ge})}],Ce={category:B,type:"group",collapsible:!0,conditions:ye},Se={category:B,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:ge},xe={category:B,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:me},Ne={category:B,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:me},Ee={category:B,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"},Te={category:B,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:ae,value:"displayFeedbackStep"},{label:{en:"Thanks",fr:"Remerciement",es:"Gracias",de:"Dank"},value:"displayThanksStep"}]},Be=he({},Q,{propName:"overlayColor",label:{en:"Overlay color",fr:"Couleur de l'arrière-plan",es:"Color del segundo plano",de:"Overlay-Farbe"}}),Oe={category:B,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")}]},Pe={category:B,type:"paragraph",propName:"customCssDetails",text:se,conditions:[{field:"themeType",value:"customCss"}]},_e={category:B,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:ye,options:[{label:he({},{en:"Light",fr:"Clair",es:"Claro",de:"Hell"},{fr:"Claire"}),value:"lightTheme"},{label:{en:"Dark",fr:"Sombre",es:"Oscuro",de:"Dunkel"},value:"darkTheme"}]},Ae=[he({},Ce,{label:{en:"Border",fr:"Contour",es:"Contorno",de:"Kontur"},conditions:ye,children:[Y,U,J]}),he({},Ce,{label:{en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},conditions:ye,children:[Q,Be]}),he({},Ce,{label:{en:"Container",fr:"Conteneur",es:"Caja",de:"Container"},children:[{category:B,type:"colorpicker",label:{en:"Text color",fr:"Couleur du texte",es:"Color del texto",de:"Textfarbe"},propName:"textColor",value:me},{category:B,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:B,type:P,label:{en:"Horizontal padding",fr:"Padding horizontal",es:"Relleno horizontal",de:"Horizontale Polsterung"},propName:"horizontalPaddingContainer",value:0,unit:"px"},{category:B,type:P,label:{en:"Vertical padding",fr:"Padding vertical",es:"Acolchado vertical",de:"Vertikale Polsterung"},propName:"verticalPaddingContainer",value:0,unit:"px"},{category:B,type:P,label:{en:"Horizontal margin",fr:"Marges horizontales",es:"Margen horizontal",de:"Horizontaler Rand"},propName:"horizontalMarginContainer",value:0,unit:"px"},{category:B,type:P,label:{en:"Vertical margin",fr:"Marges verticales",es:"Margen vertical",de:"Vertikaler Rand"},propName:"verticalMarginContainer",value:0,unit:"px"},{category:B,type:"switch",label:{en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},propName:"dropShadow",value:!1},{category:B,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}]}]}),he({},Ce,{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:B,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:B,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:B,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:B,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"}]},he({},Se,{conditions:be,propName:"".concat(Se.propName,"_full")}),he({},Se,{conditions:ve,propName:"".concat(Se.propName,"_empty")}),he({},xe,{conditions:be,propName:"".concat(xe.propName,"_full")}),he({},xe,{conditions:ve,propName:"".concat(xe.propName,"_empty")}),he({},Ne,{conditions:be,propName:"".concat(Ne.propName,"_full")}),he({},Ne,{conditions:ve,propName:"".concat(Ne.propName,"_empty")}),he({},Ee,{conditions:be,propName:"".concat(Ee.propName,"_full")}),he({},Ee,{conditions:ve,propName:"".concat(Ee.propName,"_empty")})]}),he({},Ce,{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:B,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:ge},{category:B,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:me},{category:B,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:B,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:B,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:me},{category:B,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"}]}),he({},Ce,{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:B,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:ge},{category:B,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:me},{category:B,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:B,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:B,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:me}]})];function Le(e,t,n){return e.map(function(e){var o=e.propName,a=e.conditions,i=t[o],s="".concat(n,"_").concat(o),l=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),c=he({},e,{value:i,propName:s});return l&&l.length&&(c.conditions=l),c})}var Re=we.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 he({},e,{conditions:[].concat(r(o),[{field:"theme",value:t}]),children:Le(a,n,t)})})}([].concat(Ae),t,n)}).flat(),je=[Te,Oe,Pe,_e].concat(r(Re));return[].concat(r(de),r(ce),r(ue),r(je))});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e=e||self).widgetForm=o()}(this,(function(){"use strict";var e=function(e,o){(null==o||o>e.length)&&(o=e.length);for(var t=0,l=new Array(o);t<o;t++)l[t]=e[t];return l};var o=function(o){if(Array.isArray(o))return e(o)};var t=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)};var l=function(o,t){if(o){if("string"==typeof o)return e(o,t);var l=Object.prototype.toString.call(o).slice(8,-1);return"Object"===l&&o.constructor&&(l=o.constructor.name),"Map"===l||"Set"===l?Array.from(l):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?e(o,t):void 0}};var n=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var a=function(e){return o(e)||t(e)||l(e)||n()};const i="style",r="content",_="conditions",c="text",p="textarea",d="switch",g="slider",s="group",m="https://widgets-images.abtasty.com/",u="rgba(247, 247, 247, 1)",y={category:_,type:g,min:1},b=[{...y,propName:"day",label:"widget_common_conditions_recurrence_ifOptionVariable_labelDays",value:5,max:395},{...y,propName:"week",label:"widget_common_conditions_recurrence_ifOptionVariable_labelWeeks",value:2,max:56},{...y,propName:"month",label:"widget_common_conditions_recurrence_ifOptionVariable_labelMonths",value:1,max:13}],v={category:_,type:"select",options:[{label:"widget_common_conditions_recurrence_option_everyTime",value:"everytime"},{label:"widget_common_conditions_recurrence_option_everySession",value:"session"},{label:"widget_common_conditions_recurrence_option_everyXDays",value:"day"},{label:"widget_common_conditions_recurrence_option_everyXWeeks",value:"week"},{label:"widget_common_conditions_recurrence_option_everyXMonths",value:"month"},{label:"widget_common_conditions_recurrence_option_once",value:"once"}],value:"everytime"},w={...v,label:"widget_common_conditions_recurrence_label_widgetDisplayed",propName:"displayRecurrence"},f=b.map(e=>({...e,propName:`${w.propName}_${e.propName}`,conditions:[{field:w.propName,value:e.propName}]})),h={...v,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterClosure",propName:"closingRecurrence"},N=b.map(e=>({...e,propName:`${h.propName}_${e.propName}`,conditions:[{field:h.propName,value:e.propName}]})),k={...v,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterSubmission",propName:"validationRecurrence"},x=b.map(e=>({...e,propName:`${k.propName}_${e.propName}`,conditions:[{field:k.propName,value:e.propName}]})),S={category:_,type:s,label:"widget_common_conditions_recurrence_blockTitle",collapsible:!0,children:[w,...f,h,...N,k,...x]},T={category:_,type:g,propName:"triggerEventDelay",label:"widget_common_conditions_triggering_delay_label",min:0,max:60,value:0},C={...T,propName:"triggerEventReengageDelay",value:10,max:180},E={category:_,type:"selectelement",propName:"triggerEventClick",value:"body"},B={...E,propName:"triggerEventElementVisible"},A={category:_,type:"textarea",label:"widget_common_conditions_triggering_option_customTrigger",propName:"triggerEventCustomScript",value:"/* In this example snippet, the widget will be triggered as soon as any scroll is detected.\nCreate your own by resolving resolve() with true (which does trigger) or false (which doesn't trigger) */\n\nfunction launchIfScroll() {\n\treturn new Promise(resolve => {\n\t\tdocument.addEventListener('scroll', () => resolve(true), {once: true});\n\t});\n}\n\nconst result = await launchIfScroll();\nreturn resolve(result);",rows:15},L={pageLoad:{label:"widget_common_conditions_triggering_option_pageload",value:"pageLoad"},direct:{label:"widget_common_conditions_triggering_option_asap",value:"direct"},exitIntent:{label:"widget_common_conditions_triggering_option_exitIntent",value:"exitIntent"},reengage:{label:"widget_common_conditions_triggering_option_afterXSecondsOfInactivity",value:"reengage"},click:{label:"widget_common_conditions_triggering_option_click",value:"click"},elementVisible:{label:"widget_common_conditions_triggering_option_elementVisible",value:"elementVisible"},customScript:{label:"widget_common_conditions_triggering_option_customTrigger",value:"script"}},I={category:_,type:"switch",propName:"isOncePerPageTrigger",value:!0,label:"widget_common_conditions_triggering_label_triggerOnlyOnce"},O={category:_,type:"switch",propName:"autoHide",value:!0,label:"widget_common_conditions_triggering_autohide_toggler_label_autoHideAfterRedirection"},R={category:_,type:g,propName:"timeHide",value:2,max:120,label:"widget_common_conditions_triggering_autohide_toggler_label_autoHideAfterXSeconds",conditions:[{field:"autoHide",value:!0}]},M={category:_,type:"select",label:"widget_common_conditions_triggering_label",options:Object.keys(L).map(e=>L[e]),propName:"triggerEvent",value:"pageLoad"};E.conditions=[{field:"triggerEvent",value:"click"}],C.conditions=[{field:"triggerEvent",value:"reengage"}],B.conditions=[{field:"triggerEvent",value:"elementVisible"}],A.conditions=[{field:"triggerEvent",value:"script"}],T.conditions=[{field:"triggerEvent",value:e=>"reengage"!==e}],I.conditions=[{field:"triggerEvent",value:e=>"click"===e||"script"===e}];const P={category:_,type:s,label:"widget_common_conditions_triggering_blockTitle",collapsible:!0,children:[M,...[E,B,A,I,C,T]]},V={category:"layout",type:"radioImage",propName:"layout",label:"widget_common_layout_label_selectALayout",value:"popin",style:"big",options:[{label:"widget_common_layout_option_modal",value:"popin",src:m+"layout/icon-layout-modal.png"},{label:"widget_common_layout_option_topBanner",value:"bannerTop",src:m+"layout/icon-layout-topBanner.png"},{label:"widget_common_layout_option_bottomBanner",value:"bannerBottom",src:m+"layout/icon-layout-bottomBanner.png"},{label:"widget_common_layout_option_freePlacement",value:"free",src:m+"layout/icon-layout-freePlacement.png"}]},D={category:"layout",type:"selectelement",propName:"elementReferrer",label:"widget_common_layout_label_selectElementContainWidget",value:"body"},Q={category:"layout",type:"radio",propName:"referrerInsertType",value:"afterbegin",label:"widget_common_layout_positioning_label_selectPosition",options:[{label:"widget_common_layout_positioning_option_before",value:"beforebegin"},{label:"widget_common_layout_positioning_option_atTheBeginning",value:"afterbegin"},{label:"widget_common_layout_positioning_option_atTheEnd",value:"beforeend"},{label:"widget_common_layout_positioning_option_after",value:"afterend"}]},Y=[{field:"layout",value:"free"}];D.conditions=Y,Q.conditions=Y;const $={category:"layout",type:s,label:"widget_common_tabName_layout",collapsible:!0,children:[V,D,Q]},j={category:i,type:"colorpicker",label:"widget_common_style_container_label_backgroundColor",propName:"backgroundColor",value:u},H={category:i,type:"colorpicker",label:"widget_common_style_border_label_borderColor",propName:"borderColor",value:"rgba(0, 127, 145, 1)"},W={category:i,type:g,label:"widget_common_style_border_label_borderRadius",propName:"borderRadius",value:4,unit:"px"},X={category:i,type:g,label:"widget_common_style_border_label_borderThickness",propName:"borderWidth",value:2,min:0,max:50,unit:"px"},q={category:i,type:"colorpicker",label:"widget_common_style_text_label_textColor",propName:"textColor",value:"rgba(57, 57, 57, 1)"},F={category:i,type:"radioImage",label:"widget_common_style_text_label_textAlignment",propName:"textAlign",value:"center",style:"little",options:[{label:"widget_common_style_text_textAlignment_option_left",value:"left",src:m+"style/icon-text-alignLeft.png"},{label:"widget_common_style_text_textAlignment_option_center",value:"center",src:m+"style/icon-text-alignCenter.png"},{label:"widget_common_style_text_textAlignment_option_right",value:"right",src:m+"style/icon-text-alignRight.png"}]},z={category:i,type:"areainput"},U={...z,label:"widget_common_style_container_label_margin",propName:"containerMargin",value:[{top:0,left:0,bottom:0,right:0}]},G={...z,label:"widget_common_style_container_label_padding",propName:"containerPadding",value:[{top:35,left:60,bottom:35,right:60}]},J={category:i,type:"switch",label:"widget_common_style_container_dropShadow_blockTitle",propName:"dropShadow",value:!1},K={category:i,type:"colorpicker",label:"widget_common_style_container_dropShadow_label_color",propName:"dropShadowColor",value:"rgba(57, 57, 57, 0.25);"},Z={category:i,type:g,label:"widget_common_style_container_dropShadow_label_blurRadius",propName:"dropShadowBlur",value:10,unit:"px"},ee={category:i,type:"switch",label:"widget_common_style_container_label_displayCloseButton",propName:"closeButton",value:!0},oe={category:i,type:"colorpicker",label:"widget_common_style_overlay_label_overlayColor",propName:"overlayColor",value:"rgba(0, 0, 0, 0.6)"},te={category:i,type:"switch",label:"widget_common_style_overlay_label_overlayClickable",propName:"overlayClickable",value:!0},le={category:i,type:g,label:"widget_common_style_buttons_label_buttonBorderThickness",propName:"buttonsBorderWidth",value:1,min:0,max:30,unit:"px"},ne={category:i,type:"colorpicker",label:"widget_common_style_buttons_label_buttonBorderColor",propName:"buttonsBorderColor",value:"rgba(87, 184, 199, 1)"},ae={category:i,type:g,label:"widget_common_style_buttons_label_buttonBorderRadius",propName:"buttonsBorderRadius",value:4,min:0,max:30,unit:"px"},ie={category:i,type:"colorpicker",label:"widget_common_style_buttons_label_buttonBackgroundColor",propName:"buttonsBackgroundColor",value:"rgba(0, 127, 145, 1)"},re={category:i,type:"colorpicker",label:"widget_common_style_buttons_label_buttonTextColor",propName:"buttonsTextColor",value:u},_e=[{field:X.propName,value:e=>e>0}];H.conditions=_e;const ce={category:i,type:s,label:"widget_common_style_blockTitle_border",collapsible:!0,children:[X,H,W]},pe={category:i,type:s,label:"widget_common_style_blockTitle_text",collapsible:!0,children:[F,q]},de=[{field:"dropShadow",value:!0}];K.conditions=de,Z.conditions=de;const ge={category:i,type:s,label:"widget_common_style_blockTitle_container",collapsible:!0,children:[U,G,j,J,K,Z,ee]},se={category:i,type:s,label:"widget_common_style_blockTitle_overlay",collapsible:!0,children:[oe,te],conditions:[{field:"layout",value:"popin"}]},me=[{field:le.propName,value:e=>e>0}];ne.conditions=me;const ue={category:i,type:s,label:"widget_common_style_blockTitle_buttons",collapsible:!0,children:[le,ne,ae,ie,re]};var ye=[{field:"isFeedBackQuestion",value:!0}],be=[{field:"isLegend",value:!0}],ve=[{category:r,type:p,propName:"question",label:"widget_nps_content_question_label",value:"widget_nps_content_question_default"},{category:r,type:d,propName:"isLegend",label:"widget_nps_content_legend_toggler_label_displayLegend",value:!1},{category:r,type:c,propName:"minLegend",label:"widget_nps_content_legend_label_minLegend",value:"widget_nps_content_legend_default_minLegend",conditions:be},{category:r,type:c,propName:"maxLegend",label:"widget_nps_content_legend_label_maxLegend",value:"widget_nps_content_legend_default_maxLegend",conditions:be},{category:r,type:d,propName:"isFeedBackQuestion",label:"widget_nps_content_oeq_toggler_label_askOpenEndedQuestion",value:!1},{category:r,type:p,propName:"feedbackQuestion",label:"widget_nps_style_preview_option_openEndedQuestion",value:"widget_nps_content_defaultOpenEndedQuestionValue",conditions:ye},{category:r,type:c,propName:"buttonText",label:"widget_nps_content_buttonText_label",value:"widget_nps_content_buttonText_default_send",conditions:ye},{category:r,type:d,propName:"isThankYouMessage",label:"widget_nps_content_tym_toggler_label_displayThankYouMessage",value:!1},{category:r,type:p,propName:"thankYouMessage",label:"widget_nps_content_tym_label_thankYouMessage",value:"widget_nps_content_tym_default_thankYouMessage",conditions:[{field:"isThankYouMessage",value:!0}]}],we=a($.children);P.collapsed=!1,O.label="widget_common_conditions_triggering_autohide_toggler_label_autoHideAfterSubmit",P.children.push(O),P.children.push(R);var fe=[P,S],he={category:i,type:s,label:{en:"Preview",fr:"Prévisualisation",es:"Previsualización",de:"Vorschau"},collapsible:!0,collapsed:!1,children:[{category:i,type:"radio",propName:"stepToShow",value:"displayNoteStep",label:"widget_nps_style_preview_label_selectStep",options:[{label:"widget_nps_style_preview_option_npsScore",value:"displayNoteStep"},{label:"widget_nps_style_preview_option_openEndedQuestion",value:"displayFeedbackStep"},{label:"widget_nps_style_preview_option_thankYouMessage",value:"displayThanksStep"}]}]},Ne={category:i,type:d,propName:"noStyles",value:!1,label:"widget_common_style_theme_option_custom"},ke=function(e){return!e.noStyles};pe.condition=ke,ue.condition=ke,ge.condition=ke,ce.condition=ke,se.condition=ke,he.collapsed=!1,pe.collapsed=!1;var xe=[he,Ne,pe,ue,ge,ce,se];return[].concat(a(fe),a(ve),a(we),a(xe))}));
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\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"===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.shadowOpacity,g=e.buttonsContrast,v=e.buttonsBorderRadius,y=e.buttonsShape,b=e.contentDirection,w=e.questionMargin,C=e.buttonsHorizontalMargin,k=e.inputBackgroundColor,E=e.inputBorderColor,S=e.inputBorderWidth,N=e.inputBorderRadius,x=e.inputTextColor,T=e.inputMarginWithButton,L=e.feedbackButtonBackgroundColor,A=e.feedbackButtonBorderColor,O=e.feedbackButtonBorderWidth,_=e.feedbackButtonBorderRadius,I=e.feedbackButtonTextColor,P=Object.entries(this.userStyles).filter(function(t){return i(t,1)[0].includes(g)}).reduce(function(t,e){var r=i(e,2),a=r[0],o=r[1],s=a.split("_".concat(g))[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},{}),B=P.buttonsBackgroundColor,R=P.buttonsTextColor,j=P.buttonsBorderColor,D=P.buttonsBorderWidth;switch(y){case"roundsquare":t="border-radius: ".concat(v,"px;");break;case"round":t="border-radius: 50%;";break;default:t=""}var Y=c?"box-shadow: 0px 5px 10px 2px rgba(0, 0, 0, ".concat(m/100,");"):"",F="#".concat(this.parentContainer.widgetContainerId," .").concat(this.npsClassName),q="\n\t\t\t".concat(F," .").concat(this.notesButtonsClassName," {\n\t\t\t\tmargin-left: ").concat(C,"px;\n\t\t\t\tmargin-right: ").concat(C,"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(F," .").concat(this.notesButtonsClassName," span {\n\t\t\t\tcolor: ").concat(R,";\n\t\t\t}");return"\n\t\t\tbody ".concat(F," {\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(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(Y,"\n\t\t\t}\n\t\t\t").concat(F," .").concat(this.questionClassName,",\n\t\t\t").concat(F," .").concat(this.feedbackQuestionClassName," ,\n\t\t\t").concat(F," .").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(F," .").concat(this.thankYouClassName," {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t\t").concat(F," .").concat(this.notesClassName," legend {\n\t\t\t\tcolor: ").concat(u,";\n\t\t\t}\n\t\t\t").concat(q,"\n\t\t\t").concat(F," .").concat(this.feedbackFormClassName," input {\n\t\t\t\tbackground-color: ").concat(k,";\n\t\t\t\tborder: ").concat(S,"px solid ").concat(E,";\n\t\t\t\tborder-radius: ").concat(N,"px;\n\t\t\t\tcolor: ").concat(x,";\n\t\t\t\tmargin-right: ").concat(T,"px;\n\t\t\t}\n\t\t\t").concat(F," .").concat(this.feedbackFormClassName," button {\n\t\t\t\tbackground-color: ").concat(L,";\n\t\t\t\tborder: ").concat(O,"px solid ").concat(A,";\n\t\t\t\tborder-radius: ").concat(_,"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(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}\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";var e=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",r=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function a(e,t,n,i){var s=t&&t.prototype instanceof h?t:h,r=Object.create(s.prototype),o=new C(i||[]);return r._invoke=function(e,t,n){var i="suspendedStart";return function(s,r){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===s)throw r;return S()}for(n.method=s,n.arg=r;;){var o=n.delegate;if(o){var a=b(o,n);if(a){if(a===l)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var h=c(e,t,n);if("normal"===h.type){if(i=n.done?"completed":"suspendedYield",h.arg===l)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(i="completed",n.method="throw",n.arg=h.arg)}}}(e,n,o),r}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=a;var l={};function h(){}function u(){}function d(){}var m={};m[s]=function(){return this};var g=Object.getPrototypeOf,p=g&&g(g(N([])));p&&p!==t&&n.call(p,s)&&(m=p);var v=d.prototype=h.prototype=Object.create(m);function f(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function y(e,t){var i;this._invoke=function(s,r){function o(){return new t((function(i,o){!function i(s,r,o,a){var l=c(e[s],e,r);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,o,a)}),(function(e){i("throw",e,o,a)})):t.resolve(u).then((function(e){h.value=e,o(h)}),(function(e){return i("throw",e,o,a)}))}a(l.arg)}(s,r,i,o)}))}return i=i?i.then(o,o):o()}}function b(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=c(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,l;var s=i.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function w(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 C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function N(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:S}}function S(){return{value:void 0,done:!0}}return u.prototype=v.constructor=d,d.constructor=u,d[o]=u.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},f(y.prototype),y.prototype[r]=function(){return this},e.AsyncIterator=y,e.async=function(t,n,i,s,r){void 0===r&&(r=Promise);var o=new y(a(t,n,i,s),r);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},f(v),v[o]="Generator",v[s]=function(){return this},v.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 i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=N,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function i(n,i){return o.type="throw",o.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s],o=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var a=n.call(r,"catchLoc"),c=n.call(r,"finallyLoc");if(a&&c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var r=s;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,l):this.complete(o)},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),l},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),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var s=i.arg;E(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:N(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function t(e,t,n,i,s,r,o){try{var a=e[r](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(i,s)}var n=function(e){return function(){var n=this,i=arguments;return new Promise((function(s,r){var o=e.apply(n,i);function a(e){t(o,s,r,a,c,"next",e)}function c(e){t(o,s,r,a,c,"throw",e)}a(void 0)}))}};const i=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor");const s=()=>{let e;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?e=window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?e=window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings&&(e=window.ABTasty.accountSettings.identifier),e):e},r=()=>!!window.ABTasty.getTestsOnPage()[TEST_ID]||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})(),o=()=>{if(i())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0},a="conditions",c="https://social-proof-api.abtasty.com/clients/",l=()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?"_"+e:""}`},h=()=>{const e=l();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")},u=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,d=(...e)=>{e.unshift(`[AB Tasty Widget] ${PACKAGE}:`),console.log(...e)},m=e=>{if(o()){const t=h();window.console.log(`%c${t} - QA Mode for campaign ${TEST_ID}\n${e}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}},g=e=>{const t={promise:null,resolve:null,reject:null,name:e};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t},p=(e,t,n)=>{let i=0,s=0;try{document.querySelector(e)}catch(t){const i=`Selector «${e}» not valid.`;return d(i),"function"==typeof n&&n(i)}function r(){clearInterval(s),clearTimeout(i)}return i=setTimeout(()=>{r();const t=`Can't find element «${e}».`;return d(t),"function"==typeof n&&n(t)},1e4),s=setInterval(()=>{const n=document.querySelector(e);return null!==n?(r(),"function"==typeof t&&t(n)):n},200),{clear:r}};async function v(e){let t;switch(e){case"IntersectionObserver":t=await("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||function(e){return new Promise((t,n)=>{const i=window.document.getElementsByTagName("script")[0],s=window.document.createElement("script");s.src=e,i.parentNode.insertBefore(s,i),s.onload=t,s.onerror=n})}("https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver"));break;default:t=!0}return t}class f{constructor({displayRecurrence:e,closingRecurrence:t,validationRecurrence:n},i){this.displayRecurrence=parseFloat(e),this.closingRecurrence=parseFloat(t),this.validationRecurrence=parseFloat(n),this.onSetCallback=i,this.widgetName=l(),this.uniqueId=u(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`}getGivenRecurrenceStorageParsed(e){try{const t=e.getItem("ABTastyWidgets");return JSON.parse(t)}catch(t){return e.removeItem("ABTastyWidgets"),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(e,t){const{[this.recurrenceKey]:n,...i}=t;return Object.entries(i).length?(e.setItem("ABTastyWidgets",JSON.stringify(i)),i):(e.removeItem("ABTastyWidgets"),!1)}removeSessionRecurrenceStorage(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}removeLocalRecurrenceStorage(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}getSessionRecurrence(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getLocalRecurrence(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getCurrentRecurrence(){const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}isOver(){const e=this.getLocalRecurrence(),t=(e?parseFloat(e.stamp):0)<(new Date).getTime();return t&&this.removeLocalRecurrenceStorage(),t&&!this.getLocalRecurrence()&&!this.getSessionRecurrence()}setRecurrence(e,t){const n=this.getTypeOfStorage(e);if(!n&&"object"!=typeof n)return!1;const{storageString:i,storageMethod:s}=n,r=this.getStamp(e),o={type:t,stamp:r},{type:a}=this.getCurrentRecurrence(),c=()=>{const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();let n;"session"===i?e?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===i&&(t?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const r=n?{[this.recurrenceKey]:o,...n}:{[this.recurrenceKey]:o};s.setItem("ABTastyWidgets",JSON.stringify(r)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!s)return!1;if(a&&"validation"!==t)if("closing"===t&&"validation"!==a)c();else{if("display"!==t||"validation"===a||"closing"===a)return!1;c()}else c();return r}setDisplayRecurrence(){this.setRecurrence(this.displayRecurrence,"display")}setClosingRecurrence(){this.setRecurrence(this.closingRecurrence,"closing")}setValidationRecurrence(){this.setRecurrence(this.validationRecurrence,"validation")}getStamp(e){return(new Date).getTime()+864e5*e}getTypeOfStorage(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}class y{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=this.startVisibilityObserver(),this.mutationObserver=this.startMutationObserver(),this.mouseOverEvent=this.mouseOverHandler()}intersectionHandler(e){e.forEach(e=>{e.isIntersecting?(this.existingTargets.forEach(t=>{t.element.isSameNode(e.target)&&(this.inViewportTargets.push(t),this.mouseOverEvent.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(t=>!t.element.isSameNode(e.target)||(this.mouseOverEvent.clear(),!1))})}startVisibilityObserver(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:0})}startMutationObserver(){const e=this.mutationObserver||new MutationObserver(this.checkElements.bind(this));return e.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),e}onMouseOver({target:e,path:t}){const n=this.inViewportTargets.find(({element:n,selector:i})=>{if(n.isSameNode(e))return!0;const s=[...e.querySelectorAll(i)];if(s.length&&s.includes(n))return!0;if(t.includes(n))return!0;const r=[...e.parentElement.children],o=r.findIndex(t=>t.isSameNode(e)),a=r.filter((e,t)=>t>o);if(a.length){if(a.includes(n))return!0;if(a.some(e=>[...e.querySelectorAll(i)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:e,element:t,uniqueId:i}=n,s=this.targets.find(t=>t.selector===e&&t.uniqueId===i);s&&s.resolve(t),this.clear(e,i)}}mouseOverHandler(){const e=["mouseover",e=>setTimeout(()=>this.onMouseOver(e),50),!0];return{start:()=>document.addEventListener(...e),clear:()=>document.removeEventListener(...e)}}isElementVisible(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}isElementOpaque(e){return"HTML"===function e(t,n){return n(t)||!t.parentElement?t:e(t.parentElement,n)}(e,e=>"0"===window.getComputedStyle(e).opacity).nodeName}isElementTopmost(e){const 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]];let i=!1,s=0;for(;!i&&s<n.length;){const t=document.elementFromPoint(...n[s]);i=e===t||e.contains(t),s+=1}return i}checkElements(){this.targets.forEach(({selector:e,uniqueId:t})=>{const n=document.querySelector(e);n&&!this.existingTargets.find(e=>e.element===n&&e.uniqueId===t)&&(this.existingTargets.push({element:n,selector:e,uniqueId:t}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:e,element:t})=>!!document.querySelector(e)||(this.visibilityObserver.unobserve(t),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:e,element:t,uniqueId:n})=>{if(t.matches(e)&&this.isElementVisible(t)){const i=this.targets.find(t=>t.selector===e&&t.uniqueId===n);return i&&i.resolve(t),this.clear(e,n),!1}return!0})}watch(e,t,n){this.targets.push({selector:e,resolve:t,uniqueId:n}),this.startMutationObserver(),this.checkElements()}clear(e,t){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:i})=>n!==e&&i!==t)),this.visibilityObserver.unobserve(document.querySelector(e)),0===this.targets.length&&this.mutationObserver.disconnect(),0===this.inViewportTargets.length&&this.mouseOverEvent.clear()}}class b{constructor({triggerEvent:e,triggerSelector:t,triggerDelay:n}){this.event=e,this.selector=t&&t.length?t:"body",this.delay=1e3*n,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[],this.elementsWaiters=[]}async onElementVisible({promise:e,resolve:t}){const n=g(this.event+"DomReady");this.promises.push(n);const i=await this.onPageLoad(n),s=await v("IntersectionObserver"),r=function(e,t){return ABTasty.widgetUtils||(ABTasty.widgetUtils={}),ABTasty.widgetUtils[e]||Object.assign(ABTasty.widgetUtils,{[e]:new t}),ABTasty.widgetUtils[e]}("VisibilityObserver",y);if(this.visibilityObservers.push(r),s&&i){const e=u();r.watch(this.selector,t,e)}return e}onPageLoad({promise:e,resolve:t}){const n=()=>"complete"===document.readyState;if(!n()){const e=["readystatechange",()=>n()&&t(!0),{passive:!0}];this.eventsListeners.push(e),document.addEventListener(...e)}return t(!0),e}onClick({promise:e,resolve:t}){const n=document.createElement("style");n.type="text/css",n.id="Click_"+u(),n.innerHTML=this.selector+" {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}",document.head.appendChild(n),this.elementsSelectors.push("#"+n.id);const i=e=>[...document.querySelectorAll(this.selector)].some(t=>t.isSameNode(e)||!!e.closest(this.selector)),s=["click",({target:e})=>i(e)&&t(!0),{passive:!0,capture:!0}];return this.eventsListeners.push(s),document.addEventListener(...s),e}onExitIntent({promise:e,resolve:t}){const n=["mouseleave",async({clientY:e})=>{e<=0&&t(!0)},{passive:!0}],i=p("body",e=>{e.addEventListener(...n),this.eventsListeners.push([e,...n]),this.elementsWaiters=this.elementsWaiters.filter(e=>e!==i)});return this.elementsWaiters.push(i),e}onReengage({promise:e,resolve:t}){const n=this.delay;let i=n;const s=[()=>(i=n,i),{passive:!0}];["click","mousemove","scroll","keypress"].forEach(e=>{document.addEventListener(e,...s),this.eventsListeners.push([e,...s])});const r=setInterval(()=>{i<=0?t(!0):i-=100},100);return this.intervals.push(r),e}onCustomTrigger({promise:e,resolve:t}){const{triggerEventCustomScript:n}=DATA;return new Function(`return new Promise(async resolve => {${n}})`)().then(e=>e&&t(!0)),e}getSocialProofPurchases({promise:e,resolve:t}){const n=window.ABTastyProductKey,i=s(),{viewInterval:r,triggerSocialProofMinPurchases:o,spNoTrim:a}=DATA;return n||(m("Not able to find ABTastyProductKey, impossible to call the API."),t(!1)),n&&i?fetch(`${c}${i}/metrics/i?key=${n}${a?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e=>(e=>{if(void 0===r||void 0===o)return!1;const t=e[r]&&e[r]>=o;return t||m(`Widget will not be shown, product has been purchased ${e[r]} times while ${o} are required`),t})(e)&&t(e[r])).catch(()=>m("Failed to fetch datas from server.")):t(!1),e}getSocialProofPageViews({promise:e,resolve:t}){const n=encodeURIComponent(""+window.location.pathname),i=s(),{viewInterval:r,triggerSocialProofMinPageViews:o}=DATA;return n&&i?fetch(`${c}${i}/metrics/pv?key=${n}`).then(e=>e.ok&&e.json()).then(e=>(e=>{if(void 0===r||void 0===o)return!1;const t=e[r]&&e[r]>=o;return t||m(`Widget will not be shown, page has been seen ${e[r]} times while ${o} are required`),t})(e)&&t(e[r])).catch(()=>m("Failed to fetch datas from server.")):t(!1),e}clear(){if(this.elementsSelectors.length&&(this.elementsSelectors.forEach(e=>{document.querySelector(e)&&document.querySelector(e).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(e=>{const[t,...n]="string"==typeof e[0]?[document,...e]:e;t&&n.length>1&&t.removeEventListener(...n)}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(e=>clearInterval(e)),this.intervals=[]),this.observers.length&&(this.observers.forEach(e=>e.disconnect()),this.observers=[]),this.visibilityObservers.length){const e=u();this.visibilityObservers.forEach(t=>t.clear(this.selector,e)),this.visibilityObservers=[]}return this.promises.length&&(this.promises.forEach(e=>e.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this}async isTriggered(){this.clear();const e=g(this.event);this.promises.push(e);const t={direct:()=>!0,pageLoad:()=>this.onPageLoad(e),click:()=>this.onClick(e),exitIntent:()=>this.onExitIntent(e),reengage:()=>this.onReengage(e),elementVisible:()=>this.onElementVisible(e),script:()=>this.onCustomTrigger(e),socialProofPurchases:()=>this.getSocialProofPurchases(e),socialProofPageViews:()=>this.getSocialProofPageViews(e)},n=!Object.prototype.hasOwnProperty.call(t,this.event)||await t[this.event]();return this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const e=g(this.event+"Delay");return this.promises.push(e),setTimeout(()=>{e.resolve(!0),this.clear()},this.delay),e.promise})():n}}class w{constructor(e,t,n){this.recurrence=e,this.isWidgetApplied=t,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=["abtasty_resetActionTracking",this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(e){const t=r(),{type:n}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1},i=()=>e&&"display"===n||this.recurrenceIsDone();return!this.isWidgetApplied()&&t&&i()?(this.clearWatcher(),this.callback("rebuild",e)):(!this.isWidgetApplied()||t&&i())&&(this.isWidgetApplied()||t)||(this.clearWatcher(),this.callback("remove",e),this.watch()),this}eventHandler(){let e=r();return[250,500].forEach(t=>setTimeout(()=>500===t&&r()===e?this:(e=r(),this.decisionHandler(!1)),t)),this}observerHandler(e){const t=e.some(({removedNodes:e})=>e&&e.length),n=e.some(({addedNodes:e})=>e&&e.length);return t||n?(this.decisionHandler(!0),this):this}watch(){if(i())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const e=p("body",t=>{const n=[t,{childList:!0,subtree:!0}];this.observer.observe(...n),this.elementsWaiters=this.elementsWaiters.filter(t=>t!==e)});return this.elementsWaiters.push(e),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}class E{constructor(){this.children=void 0,this.uniqueId=u(),this.widgetName=l(),this.prettyName=h(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:t,validationRecurrence:n}=DATA;if(i()||!e&&!t&&!n)return!1;const s={everytime:()=>-1,session:()=>0,once:()=>395,day:e=>DATA[e+"_day"],week:e=>7*DATA[e+"_week"],month:e=>30.5*DATA[e+"_month"]},r={};return e&&(r.displayRecurrence=s[e]("displayRecurrence")),t&&(r.closingRecurrence=s[t]("closingRecurrence")),n&&(r.validationRecurrence=s[n]("validationRecurrence")),r})(),this.triggerParams=(()=>{let{triggerEvent:e}=DATA;const{triggerEventClick:t,triggerEventReengageDelay:n,socialProofContentType:s,triggerEventElementVisible:r,triggerEventDelay:o}=DATA;if(i()||!e&&!s)return!1;const a={click:()=>t,elementVisible:()=>r},c=Object.prototype.hasOwnProperty.call(a,e)?a[e]():"body",l="reengage"===e?n:o;return s&&(e=1===s?"socialProofPurchases":"socialProofPageViews"),{triggerEvent:e,triggerSelector:c,triggerDelay:l}})(),this.recurrence=!!this.recurrenceParams&&new f(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new b(this.triggerParams),this.pageWatcher=new w(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:e,triggerEvent:t}=DATA;return!(!e||!["click","script"].includes(t))||["pageLoad","direct","reengage","socialProofPurchases","socialProofPageViews","elementVisible"].some(e=>e===t)})(),this.basicClassName="ab_widget_container_"+this.widgetName,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=this.basicClassName+"_content",this.overlayClassName=this.basicClassName+"_overlay",this.closeButtonClassName=this.basicClassName+"_close_button",this.hideClassName="ab_hide_"+this.uniqueId,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.elementsWaiters=[]}clearGivenClearables(){this.eventsListeners.length&&(this.eventsListeners.forEach(e=>document.removeEventListener(...e)),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(e=>clearInterval(e)),this.intervals=[]),this.observers.length&&(this.observers.forEach(e=>e.disconnect()),this.observers=[]),this.promises.length&&(this.promises.forEach(e=>e.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[])}isWidgetApplied(){return this.domElement&&!!this.domElement.closest("html")}removeOldDomElement(){const e=document.getElementById(this.widgetContainerId);return e&&e.remove(),this}async insert(){const e=(e,t,n)=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e!==t),m(e),n(e)},t=new Promise((t,n)=>{const i=p("head",e=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e!==i),t(e.appendChild(this.styleElement))},t=>e(t,i,n));this.elementsWaiters.push(i)}),n=new Promise((t,n)=>{const{layout:i,elementReferrer:s,referrerInsertType:r}=DATA,{selector:o,position:a}="string"==typeof i&&"free"===i&&"string"==typeof s&&"string"==typeof r?{selector:s,position:r}:{selector:"body",position:"beforeend"},c=p(o,e=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e!==c),this.removeOldDomElement(),t(e.insertAdjacentElement(a,this.domElement))},t=>e(t,c,n));this.elementsWaiters.push(c)});return Promise.all([n,t]).then(()=>this)}remove(){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():i()||this.init().then(({response:e})=>e?this.show():this),this}show(){return this.hasBeenShown||i()||window.ABTastyEvent(this.prettyName+" displayed",null,TEST_ID),this.closedByUser=!1,this.domElement.classList.remove(this.hideClassName),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(),this}hide(){return this.hasBeenShown&&!i()&&window.ABTastyEvent(this.prettyName+" closed",null,TEST_ID),this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}async init(e){if(!i()&&!r())return!1;if(this.trigger&&this.trigger.promises.length)return!1;const t=this.recurrence&&this.recurrence.isOver();if(this.recurrence&&!t)return this.pageWatcher.watch(),!1;this.pageWatcher.watch();const n=i()||!this.trigger||this.trigger&&await this.trigger.isTriggered();return!!n&&(await this.insert(),this.addCloseEvent(),i()||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(n),{container:this,response:n})}onPageChange(e,t){const n=()=>this.init().then(({response:e})=>e&&this.show());switch(t||(this.hasBeenShown=!1),e){case"remove":this.isWidgetApplied()?this.remove():(this.trigger&&this.trigger.clear(),this.pageWatcher.watch());break;case"rebuild":this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():this.insert().then(e=>e.show()):n()}}addCloseEvent(...e){const{closeButton:t,overlayClickable:n,layout:i}=DATA,s=[];if(void 0!==n&&n&&void 0!==i&&"popin"===i&&s.push("."+this.overlayClassName),void 0!==t&&t&&s.push("."+this.closeButtonClassName),!s.length)return this;const r=this.domElement.querySelectorAll(s.join(", "));return r.length?(e.push(...r),e.forEach(e=>{e.addEventListener("click",()=>{this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(),setTimeout(()=>this.remove(),1e3)},{passive:!0,once:!0})}),this):this}getDom(){const{closeButton:e,layout:t}=DATA,n=document.createElement("div");return n.className=`${this.basicClassName} ${this.hideClassName}`,n.id=this.widgetContainerId,n.innerHTML=`\n\t\t\t${void 0!==t&&"popin"===t?`<div class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t\t${e?`<button class="${this.closeButtonClassName}" ${i()?"data-abtasty-actionnable":""}><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,n}getStyleTag(e=""){const{noStyles:t,layout:n}=DATA,{backgroundColor:s,backgroundImage:r,borderColor:o,borderRadius:a,borderWidth:c,textColor:l,textAlign:h,overlayColor:u,dropShadow:d,dropShadowColor:m,dropShadowBlur:g,containerMargin:p,containerPadding:v,closeButton:f,buttonsBorderWidth:y,buttonsBorderColor:b,buttonsBorderRadius:w,buttonsBackgroundColor:E,buttonsTextColor:C}=t?{}:DATA,N=document.createElement("style");N.type="text/css",i()&&N.setAttribute("abtasty-script-added","true");const S=`background-color: ${void 0!==s?s:"rgba(255, 255, 255, 1)"};`,_=void 0!==r?`background-image: url(${r});`:"",T=void 0!==a?`border-radius: ${a}px;`:"",x=void 0!==c&&c?`border-width: ${c}px; border-style: solid;`:"",k=[o,c].every(e=>void 0!==e)&&c?`border-color: ${o};`:"",A=void 0!==l?`color: ${l}; fill: ${l};`:"",$=void 0!==h?`text-align: ${h};`:"",L=void 0!==d&&d?`box-shadow: 0 5px ${g}px 0 ${m};`:"",I=p instanceof Array&&1===p.length&&p[0],P=I?`margin: ${I.top}px ${I.right}px ${I.bottom}px ${I.left}px;`:"",O=I?`margin: calc(${I.top}px * 0.5) calc(${I.right}px * 0.5) calc(${I.bottom}px * 0.5) calc(${I.left}px * 0.5);`:"",R=v instanceof Array&&1===v.length&&v[0],B=R?`padding: ${R.top}px ${R.right}px ${R.bottom}px ${R.left}px;`:"",W=R?`padding: calc(${R.top}px * 0.5) calc(${R.right}px * 0.5) calc(${R.bottom}px * 0.5) calc(${R.left}px * 0.5);`:"",D=void 0!==y&&y?`border-width: ${y}px; border-style: solid;`:"",j=[b,y].every(e=>void 0!==e)&&y?`border-color: ${b};`:"",q=void 0!==w?`border-radius: ${w}px;`:"",V=void 0!==E?`background-color: ${E};`:"",M=void 0!==C?`color: ${C};`:"",F=void 0!==n&&"popin"===n?[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==u?u:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""):"",H=t||void 0!==f&&f?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;","top: 8px;","right: 8px;","width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","outline: none;","padding: 0;","margin: 0;","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;","width: 16px;","height: 16px;",A,"}"].join(""):"";return N.textContent=[`.${this.hideClassName} {`,"opacity: 0 !important;","pointer-events: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,S,_,T,x,k,A,$,L,P,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;",B,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a, `,`#${this.widgetContainerId} .${this.contentClassName} > * button {`,D,j,q,V,M,"}","@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,O,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,W,"}","}",F,H,""+e].join(""),N}}class C extends E{constructor(){super(),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;","z-index: 9999;","opacity: 1;","transition: opacity 0.25s ease;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;","left: 50%;","top: 50%;","transform: translate(-50%, -50%);","width: auto;","height: auto;","}","@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join("")}}class N extends E{constructor(){super(),this.position="string"==typeof DATA.layout&&"bannerTop"===DATA.layout?"top":"bottom",this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"position: fixed;",this.position+": 0;","left: 0;","width: 100%;","height: auto;","z-index: 9999;","opacity: 1;","transition: opacity 0.25s ease;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class S extends E{constructor(){super(),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const _=()=>{const{layout:e}=DATA;let t;switch(e){case"popin":t=new C;break;case"bannerTop":case"bannerBottom":t=new N;break;case"free":t=new S;break;default:t=new E}return t},T={category:a,type:"slider",min:1},x=[{...T,propName:"day",label:"widget_common_conditions_recurrence_ifOptionVariable_labelDays",value:5,max:395},{...T,propName:"week",label:"widget_common_conditions_recurrence_ifOptionVariable_labelWeeks",value:2,max:56},{...T,propName:"month",label:"widget_common_conditions_recurrence_ifOptionVariable_labelMonths",value:1,max:13}],k={category:a,type:"select",options:[{label:"widget_common_conditions_recurrence_option_everyTime",value:"everytime"},{label:"widget_common_conditions_recurrence_option_everySession",value:"session"},{label:"widget_common_conditions_recurrence_option_everyXDays",value:"day"},{label:"widget_common_conditions_recurrence_option_everyXWeeks",value:"week"},{label:"widget_common_conditions_recurrence_option_everyXMonths",value:"month"},{label:"widget_common_conditions_recurrence_option_once",value:"once"}],value:"everytime"},A={...k,label:"widget_common_conditions_recurrence_label_widgetDisplayed",propName:"displayRecurrence"},$=(x.map(e=>({...e,propName:`${A.propName}_${e.propName}`,conditions:[{field:A.propName,value:e.propName}]})),{...k,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterClosure",propName:"closingRecurrence"}),L=(x.map(e=>({...e,propName:`${$.propName}_${e.propName}`,conditions:[{field:$.propName,value:e.propName}]})),{...k,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterSubmission",propName:"validationRecurrence"}),I=(x.map(e=>({...e,propName:`${L.propName}_${e.propName}`,conditions:[{field:L.propName,value:e.propName}]})),{pageLoad:{label:"widget_common_conditions_triggering_option_pageload",value:"pageLoad"},direct:{label:"widget_common_conditions_triggering_option_asap",value:"direct"},exitIntent:{label:"widget_common_conditions_triggering_option_exitIntent",value:"exitIntent"},reengage:{label:"widget_common_conditions_triggering_option_afterXSecondsOfInactivity",value:"reengage"},click:{label:"widget_common_conditions_triggering_option_click",value:"click"},elementVisible:{label:"widget_common_conditions_triggering_option_elementVisible",value:"elementVisible"},customScript:{label:"widget_common_conditions_triggering_option_customTrigger",value:"script"}});Object.keys(I).map(e=>I[e]);var P=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};function O(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var R=function(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),e},B=DATA,W=B.isFeedBackQuestion,D=B.isThankYouMessage,j=B.autoHide,q=B.timeHide,V=B.stepToShow,M=B.question,F=B.feedbackQuestion,H=B.buttonText,Y=B.thankYouMessage,G=B.isLegend,U=B.minLegend,z=B.maxLegend,K=B.noStyles,Q=function(){function e(t){var n=t.parentContainer;P(this,e),this.parentContainer=n,this.baseClassName="nps_container",this.className="".concat(this.baseClassName,"_").concat(n.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(n.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 R(e,[{key:"sendNote",value:function(){if(!i()&&!isNaN(this.currentNote)){try{window.abtasty.send("nps",{ns:this.currentNote,nf:this.userFeedback})}catch(e){m("Not able to send NPS hit due to old tag version (< 3.0)")}this.parentContainer.recurrence.setValidationRecurrence()}return this}},{key:"insertIn",value:function(e,t){return document.head.insertAdjacentElement("beforeend",this.styleElement),e.insertAdjacentElement(t,this.npsElement),this}},{key:"complete",value:function(){var e=this;return this.sendNote(),j?(setTimeout((function(){e.parentContainer.hide(),setTimeout((function(){e.parentContainer.remove(),e.showNotes(),e.currentNote=NaN,e.userFeedback="",e.feedbackElements.feedbackFormElement.querySelector("textarea").value=""}),1e3)}),1e3*q),this):this}},{key:"onClickNote",value:function(e){this.currentNote=Number(e.target.dataset.note),W&&F&&F.length?this.showFeedBack():D&&Y&&Y.length?this.showThankYouMessage():this.complete()}},{key:"onFeedbackSend",value:function(){D&&Y&&Y.length?this.showThankYouMessage():this.complete()}},{key:"showNotes",value:function(){var e=this;return this.npsContainer.childNodes.forEach((function(t){return t.classList.add(e.hideClassName)})),[this.questionElement,this.notesContainer].forEach((function(t){return t.classList.remove(e.hideClassName)})),this}},{key:"showFeedBack",value:function(){var e=this;return this.npsContainer.childNodes.forEach((function(t){return t.classList.add(e.hideClassName)})),Object.values(this.feedbackElements).forEach((function(t){return t.classList.remove(e.hideClassName)})),this}},{key:"showThankYouMessage",value:function(){var e=this;return this.npsContainer.childNodes.forEach((function(t){return t.classList.add(e.hideClassName)})),this.thankYouElement.classList.remove(this.hideClassName),this.complete(),this}},{key:"getThankYouElement",value:function(){var e=document.createElement("p");return e.className="".concat(this.thankYouClassName," ").concat(this.hideClassName),e.innerHTML=Y,i()&&"displayThanksStep"===V&&e.classList.remove(this.hideClassName),e}},{key:"getFeedBackElements",value:function(){var e=this,t=document.createElement("p");t.className="".concat(this.feedbackQuestionClassName," ").concat(this.hideClassName),t.innerHTML=F;var n=document.createElement("form");n.className="".concat(this.feedbackFormClassName," ").concat(this.hideClassName),n.addEventListener("submit",(function(e){return e.preventDefault()}),{passive:!1});var s=document.createElement("textarea");s.className="".concat(this.feedbackQuestionClassName,"_textarea");var r=document.createElement("button");return r.className="".concat(this.feedbackQuestionClassName,"_button"),r.innerHTML="<span>".concat(H,"</span>"),r.addEventListener("click",(function(){return e.userFeedback=s.value,e.onFeedbackSend()}),{passive:!0}),i()&&"displayFeedbackStep"===V&&[t,n].forEach((function(t){return t.classList.remove(e.hideClassName)})),n.appendChild(s),n.appendChild(r),{feedbackQuestionElement:t,feedbackFormElement:n}}},{key:"getNotesElement",value:function(){var e=this,t=document.createElement("div");t.className=this.notesClassName,i()&&"displayNoteStep"!==V&&t.classList.add(this.hideClassName);for(var n=10;n>=0;){var s=document.createElement("button");s.className=this.notesButtonsClassName,s.dataset.note=n,i()&&s.setAttribute("data-abtasty-actionnable",""),s.innerHTML+="<span>".concat(n,"</span>"),s.addEventListener("click",(function(t){return e.onClickNote(t)}),{passive:!0}),t.insertAdjacentElement("afterbegin",s),5===n&&s.insertAdjacentHTML("afterend","<br>"),n-=1}return G&&(t.insertAdjacentHTML("afterbegin","<legend>".concat(U,"</legend>")),t.insertAdjacentHTML("beforeend","<legend>".concat(z,"</legend>"))),t}},{key:"getQuestionElement",value:function(){var e=document.createElement("p");return e.className=this.questionClassName,e.innerHTML=M,i()&&"displayNoteStep"!==V&&e.classList.add(this.hideClassName),e}},{key:"getContainer",value:function(){var e=document.createElement("div");return e.className="".concat(this.baseClassName," ").concat(this.className),e}},{key:"getNPSElement",value:function(){var e=this;return this.npsContainer.appendChild(this.questionElement),this.npsContainer.appendChild(this.notesContainer),W&&Object.values(this.feedbackElements).forEach((function(t){e.npsContainer.appendChild(t)})),D&&this.npsContainer.appendChild(this.thankYouElement),this.npsContainer}},{key:"getStyleElement",value:function(){var e=document.createElement("style");if(e.type="text/css",i()&&e.setAttribute("abtasty-script-added","true"),K)e.textContent=["#".concat(this.parentContainer.widgetContainerId," .").concat(this.className," .").concat(this.hideClassName," {"),"display: none !important;","}"].join("");else{var t=DATA.containerPadding,n=t instanceof Array&&1===t.length&&t[0],s="#".concat(this.parentContainer.widgetContainerId," .").concat(this.className);e.textContent=["".concat(s," .").concat(this.hideClassName," {"),"display: none !important;","}","".concat(s,","),"".concat(s," * {"),"all: unset;","box-sizing: border-box;","font-size: 10px;","line-height: 1;","font-family: sans-serif;","}","".concat(s," > * {"),"display: block;","width: 100%;","}","".concat(s," .").concat(this.notesClassName," {"),"position: relative;","display: inline-block;","width: auto;","}","".concat(s," p {"),"margin-bottom: 15px;","font-size: 1.4em;","}","".concat(s," button {"),"vertical-align: middle;","cursor: pointer;","}","".concat(s," button span {"),"font-size: 1.4em;","pointer-events: none;","}","".concat(s," .").concat(this.notesClassName," button {"),"margin: 0 5px;","width: 30px;","height: 30px;","}","".concat(s," .").concat(this.feedbackFormClassName," span {"),"display: block;","padding: 6px 24px;","}",G?["".concat(s," legend {"),"position: absolute;","text-decoration: none;","border: none;","font-size: 1em;","}","".concat(s," legend:nth-of-type(2) {"),"left: auto;","right: 0;","}"].join(""):"","".concat(s," textarea {"),"display: block;","width: 100%;","min-width: 310px;","min-height: 60px;","font-size: 1.4em;","border: 1px solid grey;","border-radius: 4px;","resize: vertical;","margin-bottom: 10px;","text-align: left;","padding: 5px;","}","".concat(s," .").concat(this.thankYouClassName," {"),"margin-bottom: 0;","}","@media screen and (min-width: 580px) {","".concat(s," {"),"min-width: 560px;","}",G?["".concat(s," .").concat(this.notesClassName," {"),"padding-top: 22px","}","".concat(s," legend {"),"top: 0;","left: 0;","display: inline-block;","width: auto;","}"].join(""):"","".concat(s," br {"),"display: none","}","}","@media screen and (max-width: 579px) {","".concat(s," {"),"min-width: ".concat(240+(n.left+n.right/2),"px;"),"}","".concat(s," .").concat(this.notesClassName," button {"),"margin-bottom: 5px;","}","".concat(s," br {"),"display: block","}",G?["".concat(s," .").concat(this.notesClassName," {"),"padding-bottom: 35px;","}","".concat(s," legend {"),"bottom: 0;","left: 50%;","transform: translateX(-50%)","}","".concat(s," legend:nth-of-type(1) {"),"bottom: 15px;","}","".concat(s," legend:nth-of-type(2) {"),"left: 50%;","right: unset;","}","".concat(s," legend:nth-of-type(1)::before {"),'content: "0: ";',"}","".concat(s," legend:nth-of-type(2)::before{"),'content: "10: ";',"}"].join(""):"","".concat(s," textarea {"),"min-width: auto;","}","}"].join("")}return e}}]),e}();function X(){return(X=n(e.mark((function t(){var n,i,s;return e.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=_(),i=n.domElement.querySelector(".".concat(n.contentClassName)),s=new Q({parentContainer:n}),n.children=s,s.insertIn(i,"beforeend"),n.init().then((function(e){return e.response&&n.show()})),e.abrupt("return",{parentContainer:n,NPS:s});case 8:case"end":return e.stop()}}),t)})))).apply(this,arguments)}!function(){X.apply(this,arguments)}()}();
package/package.json CHANGED
@@ -1,47 +1,44 @@
1
- {
2
- "name": "@abtasty/nps",
3
- "description": "Allow you to add a custom NPS on your website",
4
- "version": "0.5.3",
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
- "devDependencies": {
21
- "@babel/core": "^7.4.0",
22
- "@babel/plugin-transform-classes": "^7.5.5",
23
- "@babel/plugin-transform-runtime": "^7.4.0",
24
- "@babel/preset-env": "^7.4.2",
25
- "concurrently": "^3.5.0",
26
- "cssnano": "^3.10.0",
27
- "eslint": "^4.16.0",
28
- "eslint-config-airbnb-base": "^12.1.0",
29
- "eslint-config-prettier": "^2.9.0",
30
- "eslint-import-resolver-node": "^0.3.2",
31
- "eslint-plugin-import": "^2.8.0",
32
- "postcss-cssnext": "^3.1.0",
33
- "rollup": "^0.55.1",
34
- "rollup-plugin-babel": "^4.3.2",
35
- "rollup-plugin-commonjs": "^8.1.4",
36
- "rollup-plugin-eslint": "^4.0.0",
37
- "rollup-plugin-node-resolve": "^3.0.2",
38
- "rollup-plugin-postcss": "^1.2.7",
39
- "rollup-plugin-pug": "^0.1.6",
40
- "rollup-plugin-uglify": "^3.0.0",
41
- "rollup-watch": "^4.3.1"
42
- },
43
- "dependencies": {
44
- "@abtasty/widget-utils": "1.12.7",
45
- "@babel/runtime": "^7.4.2"
46
- }
47
- }
1
+ {
2
+ "name": "@abtasty/nps",
3
+ "description": "Allow you to add a custom NPS on your website",
4
+ "version": "1.0.0",
5
+ "form": "dist/form.js",
6
+ "main": "dist/main.js",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "repository": "abtasty/widget",
11
+ "author": "Jonathan Granger",
12
+ "license": "MIT",
13
+ "scripts": {
14
+ "start": "concurrently --kill-others \"npm run watch\" \"npm run serve\"",
15
+ "watch": "rollup -c --watch",
16
+ "build": "rollup -c",
17
+ "serve": "widget serve",
18
+ "prepare": "npm run build"
19
+ },
20
+ "devDependencies": {
21
+ "@babel/core": "^7.8.4",
22
+ "@babel/plugin-transform-classes": "^7.8.3",
23
+ "@babel/plugin-transform-runtime": "^7.8.3",
24
+ "@babel/preset-env": "^7.8.4",
25
+ "@babel/runtime": "^7.4.2",
26
+ "concurrently": "^5.1.0",
27
+ "eslint": "^6.8.0",
28
+ "eslint-config-airbnb-base": "^14.1.0",
29
+ "eslint-config-prettier": "^6.10.1",
30
+ "eslint-import-resolver-node": "^0.3.2",
31
+ "eslint-plugin-import": "^2.8.0",
32
+ "rollup": "^2.6.1",
33
+ "rollup-plugin-babel": "^4.3.3",
34
+ "rollup-plugin-eslint": "^7.0.0"
35
+ },
36
+ "dependencies": {
37
+ "@abtasty/widget-utils": "1.16.5",
38
+ "@babel/plugin-proposal-object-rest-spread": "^7.8.3",
39
+ "@rollup/plugin-commonjs": "^11.0.1",
40
+ "@rollup/plugin-node-resolve": "^7.0.0",
41
+ "babel-eslint": "^10.0.3",
42
+ "rollup-plugin-terser": "^5.2.0"
43
+ }
44
+ }