@abtasty/nps
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -1,1 +0,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=[{category:"layout",type:"radioImage",propName:"layout",label:"Select a layout",value:"popin",options:[{label:"Popin",value:"popin",src:"https://teddytor.abtasty.com/ressources/img/widget/d5f5d126-4f25-413a-976e-6ca5f4a4734d.svg"},{label:"Banner",value:"banner",src:"https://teddytor.abtasty.com/ressources/img/widget/362f101f-a906-482e-b3f4-67b33f643a20.svg"},{label:"Free",value:"free",src:"https://teddytor.abtasty.com/ressources/img/widget/e6d156a0-fd6f-4e07-8e35-e611c19151fd.svg"}]},{category:"layout",type:"radioImage",propName:"banner_position",label:"Select a layout",value:"bottom",conditions:[{field:"layout",value:"banner"}],options:[{label:{en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},value:"bottom",src:"https://widgets-images.abtasty.com/banner/bottom.png"},{label:{en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},value:"top",src:"https://widgets-images.abtasty.com/banner/top.png"}]},{category:"layout",type:"selectelement",propName:"nps_element_referrer",label:"Select an element as referrer",value:"body",conditions:[{field:"layout",value:"free"}]},{category:"layout",type:"select",propName:"nps_referrer_insert_type",value:"beforeend",conditions:[{field:"layout",value:"free"}],label:{en:"position relative to the element",fr:"position par rapport à l'élément",es:"posición relativa al elemento",de:"Position relativ zum Element"},options:[{label:{en:"Before begin",fr:"Avant",es:"Antes",de:"Vor"},value:"beforebegin"},{label:{en:"After begin",fr:"Au début",es:"Al principio",de:"Früh"},value:"afterbegin"},{label:{en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},value:"beforeend"},{label:{en:"After end",fr:"Après",es:"Después",de:"Nach"},value:"afterend"}]}];function t(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t<e.length;t++)a[t]=e[t];return a}return Array.from(e)}return[].concat(t([{type:"textarea",cateory:"content",label:"Question",propName:"question",value:"Quelle est la probabilité que vous recommandiez ce site à un proche ?"}]),t(e))}); | ||
!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 a=function(a){return e(a)||t(a)||n()},r=[{type:"hidden",category:"content",label:"NPS Campaign",propName:"npsCampaignId",value:!1},{type:"textarea",category:"content",label:"Question",propName:"question",value:{en:"How likely you are to recommand us to a friend",fr:"Quelle est la probabilité que vous recommandiez ce site à un proche ?"}},{type:"textarea",category:"content",label:"Feedback Question",propName:"feedbackQuestion",value:{en:"Thanks for your answer, anything else ?",fr:"Merci pour votre réponse, vous avez quelque chose à nous partager ?"}}],o=[{category:"layout",type:"radioImage",propName:"layout",label:"Select a layout",value:"popin",options:[{label:"Popin",value:"popin",src:"https://teddytor.abtasty.com/ressources/img/widget/d5f5d126-4f25-413a-976e-6ca5f4a4734d.svg"},{label:"Banner",value:"banner",src:"https://teddytor.abtasty.com/ressources/img/widget/362f101f-a906-482e-b3f4-67b33f643a20.svg"},{label:"Free",value:"free",src:"https://teddytor.abtasty.com/ressources/img/widget/e6d156a0-fd6f-4e07-8e35-e611c19151fd.svg"}]},{category:"layout",type:"radioImage",propName:"bannerPosition",label:"Select a layout",value:"bottom",conditions:[{field:"layout",value:"banner"}],options:[{label:{en:"Bottom",fr:"Bas",es:"Abajo",de:"Unten"},value:"bottom",src:"https://widgets-images.abtasty.com/banner/bottom.png"},{label:{en:"Top",fr:"Haut",es:"Arriba",de:"Oben"},value:"top",src:"https://widgets-images.abtasty.com/banner/top.png"}]},{category:"layout",type:"selectelement",propName:"npsElementReferrer",label:"Select an element as referrer",value:"body",conditions:[{field:"layout",value:"free"}]},{category:"layout",type:"select",propName:"npsReferrerInsertType",value:"beforeend",conditions:[{field:"layout",value:"free"}],label:{en:"position relative to the element",fr:"position par rapport à l'élément",es:"posición relativa al elemento",de:"Position relativ zum Element"},options:[{label:{en:"Before begin",fr:"Avant",es:"Antes",de:"Vor"},value:"beforebegin"},{label:{en:"After begin",fr:"Au début",es:"Al principio",de:"Früh"},value:"afterbegin"},{label:{en:"Before end",fr:"À la fin",es:"Al final",de:"Am ende"},value:"beforeend"},{label:{en:"After end",fr:"Après",es:"Después",de:"Nach"},value:"afterend"}]}];function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function s(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(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 u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(n,!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(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}})}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return 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}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var b={en:"Recurrence",fr:"Récurrence",es:"Recurrencia",de:"Wiederholung"},m={en:"".concat(b.en," of the display"),fr:"".concat(b.fr," de l'affichage"),es:"".concat(b.es," de la pantalla."),de:"".concat(b.de," der Anzeige")},h={en:"".concat(b.en," after closure"),fr:"".concat(b.fr," après fermeture"),es:"".concat(b.es," después del cierre"),de:"".concat(b.de," nach Schließung")},v={en:"".concat(b.en," after validation"),fr:"".concat(b.fr," après validation"),es:"".concat(b.es," después de la validación"),de:"".concat(b.de," nach der Validierung")},C={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},w="style",N={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"En 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"},O={category:"conditions",type:"group",label:b,collapsible:!0,children:[u({},N,{label:h,propName:"closingRecurrence"}),u({},N,{label:m,propName:"displayRecurrence"}),u({},N,{label:v,propName:"validationRecurrence"})]},E=[{label:{en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},value:"pageLoad"},{label:{en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},value:"exitIntent"},{label:{en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},value:"delay"},{label:{en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},value:"reengage"}],k={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:C,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"}]},S={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"}]},j={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"}]},P={category:"conditions",type:"number",propName:"".concat("triggerEvent","Delay"),label:{en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"",de:"Verzögerung vor dem Posten"},value:10,conditions:[{field:"triggerEvent",value:"delay"}]},A={category:"conditions",type:"group",label:C,collapsible:!0,children:[{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},options:E,propName:"triggerEvent",value:"pageLoad"}].concat(y([k,S,j,P]))},D=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]:"";i(this,e),this.testID=t,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerClassName="".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(),this.styleElement=this.getStyleTag()}return s(e,[{key:"insert",value:function(){return document.head.appendChild(this.styleElement),document.body.appendChild(this.domElement),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove("ab_hide"),this}},{key:"hide",value:function(){return this.domElement.classList.add("ab_hide"),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,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return a.push.apply(a,y(t)),a.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.widgetContainerClassName," ab_hide"),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,'">+</button>\n\t\t\t</div>'),e}},{key:"getStyleTag",value:function(e){var t=document.createElement("style");return t.type="text/css",t.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(e),t}}]),e}(),x=(function(e){function t(e,n){var a;return i(this,t),(a=f(this,g(t).call(this,e,n))).stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}p(t,D),s(t,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; opacity: 1; transition: opacity 0.25s ease;}\n\t\t.").concat(this.overlayClassName," {position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; background-color: black; opacity: 0.6;}\n\t\t.").concat(this.contentClassName," {position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background-color: white; width: auto; height: auto;}\n\t\t.").concat(this.closeButtonClassName," {position: absolute; top: 0; right: 0; color: black; background: none; border: none; transform: rotate(45deg); cursor: pointer; outline: none;}")}}])}(),function(e){function t(e,n,a){var r;return i(this,t),(r=f(this,g(t).call(this,e,n))).position=a,r.stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}p(t,D),s(t,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {position: fixed; ").concat(this.position,": 0; left: 0; width: 100%; height: auto; z-index: 9999; opacity: 1; transition: opacity 0.25s ease; background-color: white;}\n\t\t.").concat(this.overlayClassName," {display: none;}\n\t\t.").concat(this.closeButtonClassName," {position: absolute; top: 0; right: 0; color: black; background: none; border: none; transform: rotate(45deg); cursor: pointer; outline: none;}")}}])}(),{category:w,type:"group",label:{en:"Background",fr:"Fond",es:"Fondo",de:"Hintergrund"},collapsible:!0,children:[{category:w,type:"colorpicker",label:{en:"Background color",fr:"Couleur de fond",es:"Color de fondo",de:"Hintergrundfarbe"},propName:"backgroundColor",value:"rgba(255, 255, 255, 1)"},{category:w,type:"mediaupload",label:{en:"Background image",fr:"Image de fond",es:"Imagen de fondo",de:"Hintergrundbild"},propName:"backgroundImage",value:""},{category:w,type:"slider",label:{en:"Background opacity",fr:"Opacité du fond",es:"Opacidad de fondo",de:"Hintergrundopazität"},propName:"backgroundOpacity",value:75,unit:"%"}]}),T=[O,A];var B=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 _(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 R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(n,!0).forEach(function(t){B(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var z=[{field:"themeType",value:"theme"}],I={category:"style",type:"group",collapsible:!0,conditions:z},q={category:"style",type:"radioImage",propName:"themeType",label:"Select the type",value:"theme",options:[{label:"Theme",value:"theme",src:"https://huaweimobileservices.com/wp-content/uploads/2018/08/themes-icon.png"},{label:"Custom CSS",value:"customCss",src:"https://pluralsight.imgix.net/paths/path-icons/css-c9b214f0d7.png?w=140"}]},L={category:"style",type:"radio",propName:"theme",label:"Select the theme",value:"light",conditions:z,options:[{label:"Light",value:"lightTheme"},{label:"Dark",value:"darkTheme"}]},F=R({},{category:w,type:"group",label:{en:"Border",fr:"Contour",es:"Borde",de:"Grenze"},collapsible:!0,children:[{category:w,type:"slider",label:{en:"Border width",fr:"Épaisseur du contour",es:"Espesor del contorno.",de:"Dicke der Kontur"},propName:"borderWidth",value:0,unit:"px"},{category:w,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)"},{category:w,type:"slider",label:{en:"Border radius",fr:"Arrondi du contour",es:"Contorno redondeado",de:"Abgerundeter Umriss"},propName:"borderRadius",value:0,unit:"px"}]},{conditions:z}),H=R({},x,{conditions:z}),U=R({},I,{label:{en:"Container",fr:"Conteneur",es:"Container",de:"Container"},children:[{category:"style",type:"slider",label:{en:"Padding",fr:"Padding",es:"Padding",de:"Padding"},propName:"paddingContainer",value:0,unit:"px"},{category:"style",type:"slider",label:{en:"Space container",fr:"Espace contenaur",es:"Espacio alrededor",de:"Raum herum"},propName:"marginContainer",value:0,unit:"px"},{category:"style",type:"switch",label:{en:"Drop shadow",fr:"Ombre portée",es:"Sombra",de:"Schatten"},propName:"dropShadow",value:!1},{category:"style",type:"slider",label:{en:"Shadow opacity",fr:"Opacité de l'ombre",es:"Opacidad de las sombras",de:"Schattenopazität"},propName:"marginContainer",value:0,unit:"%",conditions:[{field:"dropShadow",value:!0}]}]}),W=[q,L].concat([F,H,U]);return[].concat(a(T),a(r),a(o),a(W))}); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var s=e[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,n,s){return n&&t(e.prototype,n),s&&t(e,s),e}}();var e=function(){function e(t,n,s,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.testID=t||"000000",this.widgetContainer=n,this.innerHTML=s||"",this.uniqueStyles=i||"",this.popinClassName="ab_popin_"+t+"_"+n,this.contentClassName=this.popinClassName+"_content",this.overlayClassName=this.popinClassName+"_overlay",this.closeButtonClassName=this.popinClassName+"_close_button",this.domElement=this.getDom(),this.styleElement=this.getStyleTag()}return t(e,[{key:"insert",value:function(){return document.head.appendChild(this.styleElement),document.body.appendChild(this.domElement),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove("ab_hide"),this}},{key:"hide",value:function(){return this.domElement.classList.add("ab_hide"),this}},{key:"init",value:function(){return this.insert(),this.addEvents(),this}},{key:"addEvents",value:function(){var t=this;return this.domElement.querySelectorAll("\n\t\t."+this.closeButtonClassName+",\n\t\t."+this.overlayClassName+"\n\t\t").forEach(function(e){e.addEventListener("click",function(){t.hide()},!0)}),this}},{key:"getDom",value:function(){var t=document.createElement("div");return t.className=this.popinClassName+" ab_hide",t.innerHTML='\n\t\t\t<div class="'+this.overlayClassName+'"></div>\n\t\t\t<div class="'+this.contentClassName+'">\n\t\t\t\t<button class="'+this.closeButtonClassName+'">+</button>\n\t\t\t\t'+this.innerHTML+"\n\t\t\t</div>",t}},{key:"getStyleTag",value:function(){var t=document.createElement("style");return t.type="text/css",t.textContent="\n\t\t\t.ab_hide {opacity: 0 !important; pointer-events: none;}\n\t\t\t."+this.popinClassName+" {position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; opacity: 1; transition: opacity 0.25s ease;}\n\t\t\t."+this.overlayClassName+" {position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; background-color: black; opacity: 0.6;}\n\t\t\t."+this.contentClassName+" {position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background-color: white; width: auto; height: auto;}\n\t\t\t."+this.closeButtonClassName+" {position: absolute; top: 0; right: 0; color: black; background: none; border: none; transform: rotate(45deg); cursor: pointer; outline: none;}\n\t\t\t"+this.uniqueStyles,t}}]),e}(),n=function(){function t(t,e){for(var n=0;n<e.length;n++){var s=e[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,n,s){return n&&t(e.prototype,n),s&&t(e,s),e}}();var s=function(){function t(e,n,s,i,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.testID=e||"000000",this.widgetContainer=n,this.innerHTML=i||"",this.uniqueStyles=a||"",this.position=s||"bottom",this.bannerClassName="ab_banner_"+e+"_"+n,this.contentClassName=this.bannerClassName+"_content",this.closeButtonClassName=this.bannerClassName+"_close_button",this.domElement=this.getDom(),this.styleElement=this.getStyleTag()}return n(t,[{key:"insert",value:function(){return document.head.appendChild(this.styleElement),document.body.appendChild(this.domElement),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove("ab_hide"),this}},{key:"hide",value:function(){return this.domElement.classList.add("ab_hide"),this}},{key:"init",value:function(){return this.insert(),this.addEvents(),this}},{key:"addEvents",value:function(){var t=this;return this.domElement.querySelector("\n\t\t."+this.closeButtonClassName+"\n\t\t").addEventListener("click",function(){t.hide()},!0),this}},{key:"getDom",value:function(){var t=document.createElement("div");return t.className=this.bannerClassName+" ab_hide",t.innerHTML='\n\t\t\t<button class="'+this.closeButtonClassName+'">+</button>\n\t\t\t<div class="'+this.contentClassName+'">\n\t\t\t\t'+this.innerHTML+"\n\t\t\t</div>",t}},{key:"getStyleTag",value:function(){var t=document.createElement("style");return t.type="text/css",t.textContent="\n\t\t\t.ab_hide {opacity: 0 !important; pointer-events: none;}\n\t\t\t."+this.bannerClassName+" {position: fixed; "+this.position+": 0; left: 0; width: 100%; height: auto; z-index: 9999; opacity: 1; transition: opacity 0.25s ease; background-color: white;}\n\t\t\t."+this.closeButtonClassName+" {position: absolute; top: 0; right: 0; color: black; background: none; border: none; transform: rotate(45deg); cursor: pointer; outline: none;}\n\t\t\t"+this.uniqueStyles,t}}]),t}(),i=function(){function t(t,e){for(var n=0;n<e.length;n++){var s=e[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}return function(e,n,s){return n&&t(e.prototype,n),s&&t(e,s),e}}();var a=function(){function t(e,n,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.question=e,this.maxNote=n,this.testID=s,this.npsClassName="nps_container_"+s,this.questionClassName=this.npsClassName+"_question",this.notesClassName=this.npsClassName+"_notes"}return i(t,[{key:"sendNote",value:function(t){console.log(t)}},{key:"getNotesElement",value:function(){var t=this,e=document.createElement("div");e.className=this.notesClassName;for(var n=this.maxNote;n>0;){var s=document.createElement("button");s.dataset.note=n,s.innerHTML+="<span>"+n+"</span>",s.addEventListener("click",function(e){t.sendNote(e.target.dataset.note)},{passive:!0,capture:!0}),e.insertAdjacentElement("afterbegin",s),n-=1}return e}},{key:"getQuestionElement",value:function(){var t=document.createElement("p");return t.className=this.questionClassName,t.textContent=this.question,t}},{key:"getContainer",value:function(){var t=document.createElement("div");return t.className=this.npsClassName,t}},{key:"getNPSElement",value:function(){var t=this.getContainer(),e=this.getQuestionElement(),n=this.getNotesElement();return t.appendChild(e),t.appendChild(n),t}},{key:"insertNPS",value:function(t,e){var n=this.getNPSElement();document.querySelector(t).insertAdjacentElement(e,n)}}]),t}();console.log(DATA);var o=DATA,r=o.layout,l=o.question,u=o.banner_position,c=o.nps_element_referrer,h=o.nps_referrer_insert_type,m=void 0,d=void 0;switch(r){case"popin":(m=new e(123456,"NPS")).init(),d=m.domElement.querySelector("."+m.contentClassName);break;case"banner":(m=new s(123456,"NPS",u)).init(),d=m.domElement.querySelector("."+m.contentClassName);break;default:d=document.querySelector(c)}var v=new a(l,10,123456);d.insertAdjacentElement(h,v.getNPSElement()),m&&m.show()}(); | ||
!function(){"use strict";var t,e=(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 O(r||[]);return o._invoke=function(t,e,n){var r=u;return function(a,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===a)throw o;return _()}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===u)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=l(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 l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u="suspendedStart",h="suspendedYield",d="executing",f="completed",p={};function m(){}function y(){}function g(){}var v={};v[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==n&&r.call(w,o)&&(v=w);var E=g.prototype=m.prototype=Object.create(v);function N(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function C(t){var e;this._invoke=function(n,a){function o(){return new Promise(function(e,o){!function e(n,a,o,i){var s=l(t[n],t,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,i)},function(t){e("throw",t,o,i)}):Promise.resolve(u).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=l(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 k(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 O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(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:_}}function _(){return{value:e,done:!0}}return y.prototype=E.constructor=g,g.constructor=y,g[s]=y.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},N(C.prototype),C.prototype[i]=function(){return this},t.AsyncIterator=C,t.async=function(e,n,r,a){var o=new C(c(e,n,r,a));return t.isGeneratorFunction(n)?o:o.next().then(function(t){return t.done?t.value:o.next()})},N(E),E[s]="Generator",E[o]=function(){return this},E.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=T,O.prototype={constructor:O,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"),l=r.call(i,"finallyLoc");if(c&&l){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(!l)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:T(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)}}(t={exports:{}},t.exports),t.exports);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};function r(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 a=function(t){return function(){var e=this,n=arguments;return new Promise(function(a,o){var i=t.apply(e,n);function s(t){r(i,a,o,s,c,"next",t)}function c(t){r(i,a,o,s,c,"throw",t)}s(void 0)})}};function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l(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 u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(n,!0).forEach(function(e){c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function h(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}})}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return 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}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var m="Recurrence",y="Récurrence",g="Recurrencia",v="Wiederholung",b={en:"".concat(m," of the display"),fr:"".concat(y," de l'affichage"),es:"".concat(g," de la pantalla."),de:"".concat(v," der Anzeige")},w={en:"".concat(m," after closure"),fr:"".concat(y," après fermeture"),es:"".concat(g," después del cierre"),de:"".concat(v," nach Schließung")},E={en:"".concat(m," after validation"),fr:"".concat(y," après validation"),es:"".concat(g," después de la validación"),de:"".concat(v," nach der Validierung")},N={en:"Trigger",fr:"Déclencheur",es:"Desencadenar",de:"Auslösen"},C={category:"conditions",type:"select",options:[{label:{en:"Every time",fr:"Tout le temps",es:"Cada vez",de:"Jedes Mal"},value:"-1"},{label:{en:"Every session",fr:"Chaque session",es:"En 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"},S=(u({},C,{label:w,propName:"closingRecurrence"}),u({},C,{label:b,propName:"displayRecurrence"}),u({},C,{label:E,propName:"validationRecurrence"}),[{label:{en:"Page load",fr:"Chargement de la page",es:"Carga de página",de:"Seite laden"},value:"pageLoad"},{label:{en:"Click",fr:"Clic",es:"Clic",de:"Klicken"},value:"click"},{label:{en:"Exit intent",fr:"Avant fermeture de l'onglet",es:"Intención de salida",de:"Absicht beenden"},value:"exitIntent"},{label:{en:"Delay",fr:"Délai",es:"Retrasar",de:"Verzögern"},value:"delay"},{label:{en:"Reengage (after inactivity)",fr:"Réengagement (après inactivité)",es:"Despues de inactividad",de:"Nach Untätigkeit"},value:"reengage"}]),k={category:"conditions",type:"selectelement",propName:"".concat("triggerEvent","Click"),label:N,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"}]},x={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"}]},O={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"}]},T={category:"conditions",type:"number",propName:"".concat("triggerEvent","Delay"),label:{en:"Trigger event delay (in seconds)",fr:"Délai avant l'affichage (en secondes)",es:"",de:"Verzögerung vor dem Posten"},value:10,conditions:[{field:"triggerEvent",value:"delay"}]},_=([{category:"conditions",type:"select",label:{en:"Triggers on",fr:"Se déclenche au",es:"Disparadores en",de:"Löst aus"},options:S,propName:"triggerEvent",value:"pageLoad"}].concat(p([k,x,O,T])),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]:"";o(this,t),this.testID=e,this.widgetContainer=n,this.basicClassName="ab_widget_container_".concat(n),this.widgetContainerClassName="".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(),this.styleElement=this.getStyleTag()}return s(t,[{key:"insert",value:function(){return document.head.appendChild(this.styleElement),document.body.appendChild(this.domElement),this}},{key:"remove",value:function(){return this.domElement.remove(),this.styleElement.remove(),this}},{key:"show",value:function(){return this.domElement.classList.remove("ab_hide"),this}},{key:"hide",value:function(){return this.domElement.classList.add("ab_hide"),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,p(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.widgetContainerClassName," ab_hide"),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,'">+</button>\n\t\t\t</div>'),t}},{key:"getStyleTag",value:function(t){var e=document.createElement("style");return e.type="text/css",e.textContent="\n\t\t\t.".concat(this.hideClassName," {opacity: 0 !important; pointer-events: none;}\n\t\t\t").concat(t),e}}]),t}()),j=function(t){function e(t,n){var r;return o(this,e),(r=f(this,d(e).call(this,t,n))).stringStyles=r.getStyles(),r.styleElement=r.getStyleTag(r.stringStyles),r}return h(e,_),s(e,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; opacity: 1; transition: opacity 0.25s ease;}\n\t\t.").concat(this.overlayClassName," {position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; background-color: black; opacity: 0.6;}\n\t\t.").concat(this.contentClassName," {position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background-color: white; width: auto; height: auto;}\n\t\t.").concat(this.closeButtonClassName," {position: absolute; top: 0; right: 0; color: black; background: none; border: none; transform: rotate(45deg); cursor: pointer; outline: none;}")}}]),e}(),P=function(t){function e(t,n,r){var a;return o(this,e),(a=f(this,d(e).call(this,t,n))).position=r,a.stringStyles=a.getStyles(),a.styleElement=a.getStyleTag(a.stringStyles),a}return h(e,_),s(e,[{key:"getStyles",value:function(){return"\n\t\t.".concat(this.widgetContainerClassName," {position: fixed; ").concat(this.position,": 0; left: 0; width: 100%; height: auto; z-index: 9999; opacity: 1; transition: opacity 0.25s ease; background-color: white;}\n\t\t.").concat(this.overlayClassName," {display: none;}\n\t\t.").concat(this.closeButtonClassName," {position: absolute; top: 0; right: 0; color: black; background: none; border: none; transform: rotate(45deg); cursor: pointer; outline: none;}")}}]),e}();var L=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function A(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 D=function(t,e,n){return e&&A(t.prototype,e),n&&A(t,n),t},I=function(){return Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")};var R=DATA,q=R.question,B=R.npsCampaignId,z=R.feedbackQuestion,G="https://nps.abtasty.com/api/",F=function(){return{abtastyIdentifier:"abtastyidentifier=".concat(top.ABTasty.accountSettings.identifier),accessToken:"access_token=".concat(ABTASTY_S.SERVER.token),testId:"testId=".concat(TEST_ID),variationId:"variationId=".concat(ABTASTY_S.STORE.currentVariation.id),name:"name=".concat(ABTASTY_S.STORE.test.name," - ").concat(ABTASTY_S.STORE.currentVariation.name),nps:"nps=".concat(q),feedback:"feedback=".concat(z),id:"id=".concat(B)}},M=function(){var t,e,n,r,a,o,i,s,c,l,u=F(),h=(e=(t=u).abtastyIdentifier,n=t.accessToken,r=t.testId,a=t.variationId,o=t.name,i=t.nps,s=t.feedback,"".concat(G,"setNPS.php?").concat(e,"&").concat(n,"&").concat(r,"&").concat(a,"&").concat(o,"&").concat(i,"&").concat(s));return c="GET",l=h,new Promise(function(t,e){var n=new XMLHttpRequest;n.open(c,l,!0),n.onload=function(){this.status>=200&&this.status<300?t(n.response):e({status:this.status,statusText:n.statusText})},n.onerror=function(){e({status:this.status,statusText:n.statusText})},n.send()})},Q=function(t){var e,n,r,a=function(t,e){var n=e.feedback,r=e.id,a=e.abtastyIdentifier,o="score=".concat(t);return"".concat(G,"collect.php?").concat(o,"&").concat(n,"&nps").concat(r,"&").concat(a)}(t,F());return e="GET",n=a,(r=new XMLHttpRequest).open(e,n,!1),r.send(null),r},V=function(){function t(e,n,r,a,o,i){L(this,t),this.question=e,this.feedbackQuestion=n,this.maxNote=r,this.testID=a,this.theme=o,this.legend=i,this.baseClassName="nps_container",this.npsClassName="".concat(this.baseClassName,"_").concat(a),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackClassName="".concat(this.baseClassName,"_feedback"),this.tastyStyleClassName="nps_tasty_style",this.cleanStyleClassName="nps_clean_style",this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}return D(t,[{key:"sendNote",value:function(t){return top.console.log("".concat(t,"/").concat(this.maxNote)),Q(t),this}},{key:"insertNPS",value:function(t,e){return document.querySelector("head").insertAdjacentElement("beforeend",this.styleElement),document.querySelector(t).insertAdjacentElement(e,this.npsElement),this}},{key:"removeNPS",value:function(){return this.npsElement.remove(),this.styleElement.remove(),this}},{key:"showFeedBack",value:function(t){var e=this.getFeedBackElement();return t.insertAdjacentElement("afterend",e),t.classList.add("ab_hide"),this}},{key:"getFeedBackElement",value:function(){var t=document.createElement("div");return t.className=this.feedbackClassName,t.innerHTML="\n\t\t<p>".concat(this.feedbackQuestion,'</p>\n\t\t<input type="text" class="').concat(this.feedbackClassName,'_input"></input>'),t}},{key:"getNotesElement",value:function(){var t=this,e=document.createElement("div");e.className=this.notesClassName;for(var n=this.maxNote;n>=0;){var r=document.createElement("button");r.dataset.note=n,r.innerHTML+="<span>".concat(n,"</span>"),r.addEventListener("click",function(n){t.sendNote(n.target.dataset.note),t.feedbackQuestion&&t.showFeedBack(e)},{passive:!0,capture:!0}),e.insertAdjacentElement("afterbegin",r),n-=1}return e}},{key:"getQuestionElement",value:function(){var t=document.createElement("p");return t.className=this.questionClassName,t.textContent=this.question,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.getContainer(),e=this.getQuestionElement(),n=this.getNotesElement();return t.appendChild(e),t.appendChild(n),t}},{key:"getCleanStyles",value:function(){return".".concat(this.minimumStyleClassName,", .").concat(this.minimumStyleClassName," * { all: initial; }")}},{key:"getTastyStyles",value:function(){return"\n\t\t.".concat(this.tastyStyleClassName,",\n\t\t.").concat(this.tastyStyleClassName," * {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t\n\t\t.").concat(this.tastyStyleClassName," {\n\t\t\twidth: 50em;\n\t\t\theight: 10em;\n\t\t\tpadding: 2.5em 8em;\n\t\t\tborder-radius: 8px;\n\t\t\talign-items: center;\n\t\t\tbackground-color: #1079ff;\n\t\t\tcolor: white;\n\t\t}\n\t\t\n\t\t.").concat(this.tastyStyleClassName," .").concat(this.questionClassName," {\n\t\t\tfont-size: 2em;\n\t\t}\n\t\t\n\t\t.").concat(this.tastyStyleClassName," .").concat(this.notesClassName," {\n\t\t\tflex-grow: 1;\n\t\t\tflex-direction: row;\n\t\t\tjustify-content: space-around;\n\t\t}\n\t\t\n\t\t.").concat(this.tastyStyleClassName," .").concat(this.notesClassName," button {\n\t\t\twidth: 3.5em;\n\t\t\theight: 3.5em;\n\t\t\tborder-radius: 8px;\n\t\t}\n\t\t\n\t\t.").concat(this.tastyStyleClassName," .").concat(this.notesClassName," button span {\n\t\t\tfont-size: 2em;\n\t\t}")}},{key:"getDefaultStyles",value:function(){return"\n\t\t.ab_hide { display: none; }\n\t\t.".concat(this.baseClassName,", .").concat(this.baseClassName," * {\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\tfont-size: 1vmin;\n\t\t\tline-height: 1;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tborder: none;\n\t\t}")}},{key:"getStyleElement",value:function(){var t=this.getDefaultStyles(),e="tasty"===this.theme?this.getTastyStyles():this.getCleanStyles(),n=document.createElement("style");return n.textContent="".concat(t," ").concat(e),n}}]),t}();function W(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 Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(r,!0).forEach(function(e){n(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}top.console.log(DATA,TEST_ID);var J=DATA,H=J.layout,U=J.question,X=J.bannerPosition,K=J.npsElementReferrer,Z=J.npsReferrerInsertType,$=J.npsCampaignId,tt=J.feedbackQuestion;function et(t){return nt.apply(this,arguments)}function nt(){return(nt=a(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,M();case 3:a=t.sent,o=Y({},r,{npsCampaignId:JSON.parse(a).id}),i=new CustomEvent("asyncWidgetDataObtained",{detail:o}),top.dispatchEvent(i);case 7:case"end":return t.stop()}},t)}))).apply(this,arguments)}!function(){if(!I&&!$)return top.console.error("The NPS is not linked to any NPS campaign"),!1;var t,e;switch(!$&&I&&(ABTASTY_S.PLUGINS.currentWidgetNeedAsyncSave=!0,top.addEventListener("widgetsave",et,{once:!0})),H){case"popin":(t=new j(TEST_ID,"NPS")).init(),e=t.domElement.querySelector(".".concat(t.contentClassName));break;case"banner":(t=new P(TEST_ID,"NPS",X)).init(),e=t.domElement.querySelector(".".concat(t.contentClassName));break;default:t=!1,e=document.querySelector(K)}var n=new V(U,tt,10,TEST_ID);e.insertAdjacentElement(Z,n.getNPSElement()),t&&t.show()}()}(); |
{ | ||
"name": "@abtasty/nps", | ||
"description": "Allow you to add a custom NPS on your website", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"main": "dist/main.js", | ||
@@ -23,2 +23,5 @@ "form": "dist/form.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.4.0", | ||
"@babel/plugin-transform-runtime": "^7.4.0", | ||
"@babel/preset-env": "^7.4.2", | ||
"cssnano": "^3.10.0", | ||
@@ -34,7 +37,5 @@ "postcss-cssnext": "^3.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel": "^6.23.0", | ||
"babel-core": "^6.26.0", | ||
"rollup": "^0.55.1", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^8.1.4", | ||
"rollup-plugin-eslint": "^4.0.0", | ||
@@ -46,4 +47,5 @@ "rollup-plugin-node-resolve": "^3.0.2", | ||
"dependencies": { | ||
"@abtasty/widget-utils": "^1.12.2" | ||
"@abtasty/widget-utils": "^1.12.3-4", | ||
"@babel/runtime": "^7.4.2" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42304
148
2
20
1
+ Added@babel/runtime@^7.4.2
+ Added@babel/runtime@7.26.0(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)