1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FFBPLibrary=t():e.FFBPLibrary=t()}(self,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.r(t),e.d(t,{enableFBPixel:()=>i});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),$("#fabfacebookpixel_script").length&&(this.jsonEvents=JSON.parse($("#fabfacebookpixel_script").text()),this.facebookPixelId=this.jsonEvents.facebookPixelId,this.pixelDelay=1e3*this.jsonEvents.pixelDelay,this.isPixelEnabled=this.jsonEvents.isPixelEnabled,this.moduleVersion=this.jsonEvents.moduleVersion,this.isDebug=this.jsonEvents.isDebug,this.iubendaIntegration=this.jsonEvents.iubendaIntegration,this.executorUrl=this.jsonEvents.fabFacebookPixelExecutorUrl,this.addToCartUrl=this.jsonEvents.fabFacebookPixelAddToCartUrl,this.canonicalUrl=this.jsonEvents.canonicalUrl,this.customerGroups=this.jsonEvents.customerGroups,this.defaultCustomerGroup=this.jsonEvents.defaultCustomerGroup,this.actualCartProducts=this.jsonEvents.cartProducts,this.token="")}var t,o;return t=e,o=[{key:"submitEvent",value:function(e){var t=this;$.post(this.executorUrl,e).then((function(n){var o=n.eventId,a=t.decodeEvents(e.params);delete a.description,delete a.product_price,delete a.id_product;var i=t;setTimeout((function(){switch(i.callFBQInitialization(),e.type){case"ViewCategory":null!=o?fbq("trackCustom","ViewCategory",a,{eventID:o}):fbq("trackCustom","ViewCategory",a);break;case"PageView":null!=o?fbq("track","PageView",a,{eventID:o}):fbq("track","PageView",a);break;case"Search":null!=o?fbq("track","Search",a,{eventID:o}):fbq("track","Search",a);break;case"AddToCart":null!=a.eventID?fbq("track","AddToCart",a,{eventID:a.eventID}):fbq("track","AddToCart",a);break;case"InitiateCheckout":null!=o?fbq("track","InitiateCheckout",a,{eventID:o}):fbq("track","InitiateCheckout",a);break;case"ViewContent":null!=o?fbq("track","ViewContent",a,{eventID:o}):fbq("track","ViewContent",a);break;case"Purchase":null!=a.eventID?fbq("track","Purchase",a,{eventID:a.eventID}):fbq("track","Purchase",a);break;case"CompleteRegistration":null!=a.eventID?fbq("track","CompleteRegistration",a,{eventID:a.eventID}):fbq("track","CompleteRegistration",a)}}),t.pixelDelay)}))}},{key:"decodeEvents",value:function(e){for(var t in e)if(!Array.isArray(e[t])&&!Number.isInteger(e[t])){var n=document.createElement("textarea");n.innerHTML=e[t],e[t]=n.value}return e}},{key:"collectEventsFromPage",value:function(e,t){var n=this.jsonEvents.events;for(var o in n){var a=n[o];a.params=this.filterAndSubstituteParams(a.params,e),a.canonicalUrl=this.canonicalUrl,void 0!==t&&(a.canonicalUrl=t),this.submitEvent(a)}}},{key:"filterAndSubstituteParams",value:function(e,t){for(var n in t)for(var o in e)n==o&&(e[o]=t[n]);return e}},{key:"callFBQInitialization",value:function(){var e,t,n,o,a,i;e=window,t=document,n="script",e.fbq||(o=e.fbq=function(){o.callMethod?o.callMethod.apply(o,arguments):o.queue.push(arguments)},e._fbq||(e._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[],(a=t.createElement(n)).async=!0,a.src="https://connect.facebook.net/en_US/fbevents.js",(i=t.getElementsByTagName(n)[0]).parentNode.insertBefore(a,i)),fbq("init",this.facebookPixelId)}}],o&&n(t.prototype,o),Object.defineProperty(t,"prototype",{writable:!1}),e}(),a=0;function i(){var e=new o,t=1e3*e.pixelDelay;if(a=e.isDebug,r("Version :"+e.moduleVersion),r("Pixel is configured with a delay of :"+t+"ms"),e.isPixelEnabled&&null!=e.facebookPixelId)if(r("Facebook Pixel enabled and FBD not null"),"1"===e.iubendaIntegration){r("Iubenda integration is active");var n=function(e){var t=function(){for(var e=document.cookie.split(";"),t={},n=0;n<e.length;n++){var o=e[n],a=o.indexOf("="),i=unescape(o.slice(0,a)).trim(),r
1=unescape(o.slice(a+1));t[":"+i]=r}return t}();for(name in t){var n=t[name];if(0==name.indexOf(":_iub_cs")&&-1==name.indexOf("granular"))return n}}();if(void 0!==n&&null!=n){r("Iubenda cookie value exists and not null");var i=JSON.parse(n);void 0!==i.purposes&&(r("Cookie Content: "+JSON.stringify(i)),r("Purposes in cookie are found"),void 0!==i.purposes[4]&&!1!==i.purposes[4]&&(r('Purposes["4"] is'+i.purposes[4]),e.collectEventsFromPage()))}}else r("Iubenda integration is not active."),e.collectEventsFromPage()}function r(e){if(1==a){var t="Facebook Pixel Module - ";t=t+new Date+": "+e,console.log(t)}}return $(document).ready((function(){i()})),t})()));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.