PageSourceSearch

https://www.metzgerei-graenitz.de/theme/901323ea31a4188dcb76d82932…/mediameets-fb-pixel.js?1789709787

js metzgerei-graenitz.de collected 2026-09-26 07:29:01 UTC 19,891 bytes, 1 lines download raw bytes

1(()=>{"use strict";class t{static isSupported(){return"undefined"!==document.cookie}static setItem(t,e,i){if(null==t)throw Error("You must specify a key to set a cookie");let n=new Date;n.setTime(n.getTime()+864e5*i);let r="";"https:"===location.protocol&&(r="secure"),document.cookie=`${t}=${e};expires=${n.toUTCString()};path=/;sameSite=lax;${r}`}static getItem(t){if(!t)return!1;let e=t+"=",i=document.cookie.split(";");for(let t=0;t<i.length;t++){let n=i[t];for(;" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(e))return n.substring(e.length,n.length)}return!1}static removeItem(t){document.cookie=`${t}= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/`}static key(){return""}static clear(){}}class e{constructor(t){this.routes=t}loadContext(t){fetch(this.routes.customer,{method:"POST",headers:{"Content-Type":"application/json"}}).then(t=>t.json()).then(e=>{t(e)})}loadCart(t){fetch(this.routes.cart,{method:"POST",headers:{"Content-Type":"application/json"}}).then(t=>t.json()).then(e=>{t(e)})}loadOrder(t,e){fetch(this.routes.order,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({orderId:t})}).then(t=>t.json()).then(t=>{e(t)})}loadProduct(t,e){fetch(this.routes.product,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({productId:t})}).then(t=>t.json()).then(t=>{e(t)})}}class i{constructor(){this.data=window.mediameetsFacebookPixelData}get(t){return this.data.has(t)?this.data.get(t):null}}class n{constructor(t){this.active=!0,this.plugin=t,this.apiService=new e(t.options.routes)}supports(t,e){return this.warn("Method 'supports' was not overridden by `"+this.constructor.name+"`. Default return set to false."),!1}execute(){this.warn("Method 'execute' was not overridden by `"+this.constructor.name+"`.")}disable(){this.active=!1}initEvent(t){return new t(this.plugin)}warn(t){console.warn("[Facebook Pixel Plugin (media:meets GmbH)] "+t)}getStorageKey(t){return"mediameetsFacebookPixel."+t}}class r extends n{execute(){let t=this.events(),e=window.PluginManager,i=e.getPluginList();Object.keys(t).forEach(n=>{void 0!==i[n]&&e.getPluginInstances(n).forEach(e=>{Object.keys(t[n]).forEach(i=>{e.$emitter.subscribe(i,t[n][i])})})})}events(){this.warn("Method 'events' was not overridden by `"+this.constructor.name+"`.")}}class s{static getContents(t){let e=[];return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"products")&&t.products.forEach(function(t){e.push({id:t.productNumber,quantity:1})}),e}}var o,a=new Uint8Array(16);let c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var u=[],d=0;d<256;++d)u.push((d+256).toString(16).substr(1));let h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]).toLowerCase();if(!("string"==typeof i&&c.test(i)))throw TypeError("Stringified UUID is invalid");return i},l=function(t,e,i){var n=(t=t||{}).random||(t.rng||function(){if(!o&&!(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(a)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var r=0;r<16;++r)e[i+r]=n[r];return e}return h(n)};class p{constructor(t){this.apiService=new e(t.options.routes),this.plugin=t}generateEventId(){return this.plugin.isExternalIdDeduplication()?null:l()}setupEventIdForJS(t){return this.plugin.isExternalIdDeduplication()?null:{eventID:t}}callConversionApi(t){let e=this.plugin.options;!0===e.config.useConversionApi&&""!==e.conversionApi.endpoint&&fetch(e.conversionApi.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:t,customer:this.plugin.customer,event_source_url:this.getEventSourceUrl()})})}getEventSourceUrl(){let t=[window.location.href,document.location.href,document.URL,document.documentURI],e="";for(let i of t)if("string"==typeof i&&""!==i){e=i;break}if("string"==typeof e&&""!==e)return e;let i=document.querySelector('link[rel="canonical"]');return i&&"string"==typeof(e=i.href)&&""!==e?e:""}}class g{constructor(t,e,i){this.name=t,this.data=e,this.id=i,this.time=Math.floor(Date.now()/1e3)}}class f extends p{track(t,e){if(!window.fbq)return;let i="Search",n={search_string:t,content_type:"product",contents:s.getContents(e),currency:this.plugin.options.shop.currency,value:0},r=this.generateEventId();window.fbq("track",i,n,this.setupEventIdForJS(r)),this.callConversionApi([new g(i,n,r)])}}class v extends r{supports(){return!0}events(){return{SearchWidget:{handleInputEvent:this._trackEvent.bind(this)}}}_trackEvent(t){this.active&&this.initEvent(f).track(t.detail.value)}}
1class m extends n{supports(t,e){return"search"===t&&"search"===e}execute(){if(!this.active)return;let t=new URLSearchParams(window.location.search);if(!t.has("search"))return;let e=new i().get("listing");this.initEvent(f).track(t.get("search"),e)}}class y{static getContents(t){let e=[];return Object.values(t.lineItems).forEach(function(t){e.push({id:t.productNumber,quantity:t.quantity})}),e}static getTotalItems(t){let e=0;return Object.values(t.lineItems).forEach(function(t){e+=t.quantity}),e}static getProductByNumber(t,e){let i=null;return Object.values(t.lineItems).forEach(function(t){t.productNumber===e&&(i=t)}),i}static getProductById(t,e){let i=null;return Object.values(t.lineItems).forEach(function(t){t.referencedId===e&&(i=t)}),i}}class w extends p{track(t,e){if(!window.fbq)return;e=void 0===e?1:e;let i=(t.totalPrice/t.quantity*e).toFixed(2),n="AddToCart",r={content_type:"product",content_name:t.label,value:i,currency:this.plugin.options.shop.currency,contents:[{id:t.productNumber,quantity:e}]},s=this.generateEventId();window.fbq("track",n,r,this.setupEventIdForJS(s)),this.callConversionApi([new g(n,r,s)])}}class _ extends r{supports(){return!0}events(){return{AddToCart:{beforeFormSubmit:this._cacheAddedProduct.bind(this),offCanvasOpened:this._trackAddedProduct.bind(this)},OffCanvasCart:{offCanvasOpened:this._trackAddedProduct.bind(this)}}}_cacheAddedProduct(t){if(!this.active)return;let e=this;t.detail.forEach((t,i)=>{i.endsWith("[referencedId]")&&(e.added.id=t),i.endsWith("[quantity]")&&(e.added.quantity=t)})}_trackAddedProduct(){if(!this.active||null===this.added.id)return;let t=null===this.added.quantity?1:this.added.quantity,e=this;this.apiService.loadCart(function(i){let n=y.getProductById(i,e.added.id);e._reset(),null!==n&&e.initEvent(w).track(n,t)})}_reset(){this.added.id=null,this.added.quantity=null}constructor(...t){super(...t),this.added={id:null,quantity:null}}}class b{constructor(){this._storage={}}setItem(t,e){return this._storage[t]=e}getItem(t){return Object.prototype.hasOwnProperty.call(this._storage,t)?this._storage[t]:null}removeItem(t){return delete this._storage[t]}key(t){return Object.values(this._storage)[t]||null}clear(){return this._storage={}}}class C{constructor(){this._storage=null,this._chooseStorage(),this._validateStorage()}_chooseStorage(){return C._isSupported("localStorage")?this._storage=window.localStorage:C._isSupported("sessionStorage")?this._storage=window.sessionStorage:t.isSupported()?this._storage=t:this._storage=new b}static _isSupported(t){try{let e="__storage_test";return window[t].setItem(e,"1"),window[t].removeItem(e),!0}catch(t){return!1}}_validateStorage(){if("function"!=typeof this._storage.setItem)throw Error('The storage must have a "setItem" function');if("function"!=typeof this._storage.getItem)throw Error('The storage must have a "getItem" function');if("function"!=typeof this._storage.removeItem)throw Error('The storage must have a "removeItem" function');if("function"!=typeof this._storage.key)throw Error('The storage must have a "key" function');if("function"!=typeof this._storage.clear)throw Error('The storage must have a "clear" function')}getStorage(){return this._storage}}let k=Object.freeze(new C).getStorage();class I extends n{supports(t,e){return"checkout"===t&&"cartpage"===e}execute(){if(!this.active)return;let t=k.getItem(this.storageKey);"string"==typeof t&&this._trackAddedProduct(t),k.removeItem(this.storageKey);let e=document.querySelector(".cart-add-product");e&&e.addEventListener("submit",this._storeProductNumber.bind(this))}_storeProductNumber(t){let e=t.currentTarget.querySelector("#addProductInput");k.setItem(this.storageKey,e.value)}_trackAddedProduct(t){let e=this;this.apiService.loadCart(function(i){let n=y.getProductByNumber(i,t);null!==n&&e.initEvent(w).track(n,1)})}constructor(...t){super(...t),this.storageKey=this.getStorageKey("productAddedToCartByNumber")}}class S extends p{track(t){if(!window.fbq)return;let e="ViewCategory",i={content_category:t.path,category_name:t.name,category_id:t.id,content_type:"product",contents:s.getContents(t),currency:this.plugin.options.shop.currency,value:0},n=this.generateEventId();window.fbq("trackCustom",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}
1class E extends n{supports(t,e){return"navigation"===t&&("home"===e||"index"===e)}execute(){if(!this.active)return;let t=new i().get("listing");null!==t&&this.initEvent(S).track(t)}}class x extends p{track(t){if(!window.fbq)return;let e={content_category:t.category,content_type:"product",content_name:t.name,contents:[{id:t.productNumber,quantity:1}],currency:this.plugin.options.shop.currency,value:t.price},i="ViewContent",n=this.generateEventId(),r="ViewProduct",s=this.generateEventId();window.fbq("track",i,e,this.setupEventIdForJS(n)),window.fbq("trackCustom",r,e,this.setupEventIdForJS(s)),this.callConversionApi([new g(i,e,n),new g(r,e,s)])}}class P extends p{track(t){if(!window.fbq)return;let e="CustomizeProduct",i={content_category:t.category,content_type:"product",content_name:t.name,contents:[{id:t.productNumber,quantity:1}],currency:this.plugin.options.shop.currency,value:t.price},n=this.generateEventId();window.fbq("track",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}class T extends n{supports(t,e){return"product"===t&&"index"===e}execute(){if(!this.active)return;let t=new i().get("product");null!==t&&(this.initEvent(x).track(t),this._handleCustomizeProductEvent(t))}_handleCustomizeProductEvent(t){let e=this.getStorageKey("customizedProduct");1===parseInt(k.getItem(e),10)&&(k.removeItem(e),this.initEvent(P).track(t))}}class q extends r{supports(){return!0}events(){return{VariantSwitch:{onChange:this._storeCustomization.bind(this)}}}_storeCustomization(){this.active&&k.setItem(this.getStorageKey("customizedProduct"),1)}}class A extends n{supports(t,e){return"checkout"===t&&"cartpage"===e}execute(){let t=document.querySelector(".begin-checkout-btn");t&&t.addEventListener("click",this._onBeginCheckout.bind(this))}_onBeginCheckout(){this.active&&k.setItem(this.getStorageKey("initiateCheckout"),1)}}class O extends r{supports(){return!0}events(){return{OffCanvasCart:{offCanvasOpened:this._offCanvasOpened.bind(this)}}}_offCanvasOpened(){let t=document.querySelector(".begin-checkout-btn");t&&t.addEventListener("click",this._onBeginCheckout.bind(this))}_onBeginCheckout(){this.active&&k.setItem(this.getStorageKey("initiateCheckout"),1)}}class j extends p{track(){window.fbq&&this.apiService.loadCart(this._onCartLoaded.bind(this))}_onCartLoaded(t){if(null===t)return;let e="InitiateCheckout",i={content_type:"product",value:this.plugin.options.config.includeShippingCosts?t.totalPrice:t.positionPrice,currency:this.plugin.options.shop.currency,contents:y.getContents(t),num_items:y.getTotalItems(t)},n=this.generateEventId();window.fbq("track",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}class F extends p{track(){if(!window.fbq)return;let t="PageView",e=this.generateEventId();window.fbq("track",t,{},this.setupEventIdForJS(e)),this.callConversionApi([new g(t,{},e)])}}class N extends n{supports(){return!0}execute(){this.active&&(this._handlePageViewEvent(),this._handleInitiateCheckoutEvent())}_handlePageViewEvent(){this.initEvent(F).track()}_handleInitiateCheckoutEvent(){let t=this.getStorageKey("initiateCheckout");1===parseInt(k.getItem(t),10)&&(k.removeItem(t),this.initEvent(j).track())}}class M extends p{track(){window.fbq&&this.apiService.loadCart(this._onCartLoaded.bind(this))}_onCartLoaded(t){if(null===t)return;let e="AddPaymentInfo",i={content_type:"product",value:this.plugin.options.config.includeShippingCosts?t.totalPrice:t.positionPrice,currency:this.plugin.options.shop.currency,contents:y.getContents(t)},n=this.generateEventId();window.fbq("track",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}class L extends n{supports(t,e){return"accountpayment"===t&&"paymentoverview"===e}execute(){this.active&&this.initEvent(M).track()}}class J extends n{supports(t,e){return"checkout"===t&&"confirmpage"===e}execute(){this._handleAddedPaymentInfo();let t=document.querySelector("#changePaymentForm");t&&t.addEventListener("change",this._onChangePaymentForm.bind(this))}_onChangePaymentForm(){this.active&&k.setItem(this.getStorageKey("addedPaymentInfo"),1)}_handleAddedPaymentInfo(){let t=this.getStorageKey("addedPaymentInfo");1===parseInt(k.getItem(t),10)&&(k.removeItem(t),this.initEvent(M).track())}}class U extends p{track(){if(!window.fbq)return;let t=new i().get("order");if(null===t){let t=new URLSearchParams(window.location.search);if(!t.has("orderId"))return;this.apiService.loadOrder(t.get("orderId"),this._onLoadOrder.bind(this))}else this._onLoadOrder(t)}_onLoadOrder(t){if(null===t)return;let e="Purchase",i={content_type:"product",value:this.plugin.options.config.includeShippingCosts?t.totalPrice:t.positionPrice,currency:this.plugin.options.shop.currency,contents:y.getContents(t),num_items:y.getTotalItems(t)},n=t.orderNumber;window.fbq("track",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}
1class K extends n{supports(t,e){return"checkout"===t&&"finishpage"===e}execute(){this.active&&this.initEvent(U).track()}}class B extends p{track(){if(!window.fbq)return;let t=this.generateEventId(),e="CustomerHasAccount";window.fbq("trackCustom",e,{},this.setupEventIdForJS(t)),this.callConversionApi([new g(e,{},t)])}}class V extends p{track(t){if(!window.fbq)return;let e="FrequentShopper",i={total_orders:t.orderCount},n=this.generateEventId();window.fbq("trackCustom",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}class z extends n{supports(t){return["accountprofile","address","accountpayment","accountorder"].includes(t)}execute(){this.active&&this.apiService.loadContext(this._onContextLoaded.bind(this))}_onContextLoaded(t){Object.prototype.hasOwnProperty.call(t,"customer")&&(!1===t.guest&&this.initEvent(B).track(),t.orderCount>=2&&this.initEvent(V).track(t.customer))}}class D extends p{track(t){if(!window.fbq)return;let e="AddToWishlist",i={content_type:"product",content_name:t.label,value:t.price,currency:this.plugin.options.shop.currency,contents:[{id:t.productNumber,quantity:1}]},n=this.generateEventId();window.fbq("track",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}class R extends r{supports(){return!0}events(){return{WishlistStorage:{"Wishlist/onProductAdded":this._trackAddedProduct.bind(this)}}}_trackAddedProduct(t){if(!this.active||!t.detail.productId)return;let e=this;this.apiService.loadProduct(t.detail.productId,function(t){e.initEvent(D).track(t)})}}class $ extends p{track(){window.fbq&&this.apiService.loadCart(this._trackOnLoadCart.bind(this))}_trackOnLoadCart(t){if(null===t)return;let e="CompleteRegistration",i={content_type:"product",value:this.plugin.options.config.includeShippingCosts?t.totalPrice:t.positionPrice,currency:this.plugin.options.shop.currency,contents:y.getContents(t),num_items:y.getTotalItems(t)},n=this.generateEventId();window.fbq("track",e,i,this.setupEventIdForJS(n)),this.callConversionApi([new g(e,i,n)])}}
1class W extends n{supports(){return!0}execute(){if(!this.active)return;let t=new i().get("events");null!==t&&t.includes("CompleteRegistration")&&this.initEvent($).track()}}class G extends window.PluginBaseClass{static #t=this.options={config:{privacyMode:"integrate",pixelIds:"",autoConfig:!0,advancedMatching:!1,includeShippingCosts:!0,useConversionApi:!1,disablePushState:!1,conversionApiDeduplication:"eventid"},shop:{controller:"",action:"",currency:""},routes:{cart:"",customer:"",order:"",product:""},conversionApi:{endpoint:""}};init(){this.pixelInitialized=!1,this.cookieName="mediameets-facebook-pixel-enabled",this.apiService=new e(this.options.routes),this.customer=null;let t=this.isConsentMode();t&&this._subscribeToCookieConsentManager(),(t&&this._consentGiven()||this.isAlwaysActiveMode())&&this.start()}start(){if(!0===this.pixelInitialized){this._startTriggers();return}this.pixelInitialized=!0;let t=!0===this.options.config.advancedMatching;if(t){let e=this,n=new i().get("customer");null===n?this.apiService.loadContext(function(i){if(null===i||!Object.prototype.hasOwnProperty.call(i,"customer")){e._initPixel();return}e._initPixel(t?i.customer:null)}):e._initPixel(t&&Object.prototype.hasOwnProperty.call(n,"customer")?n.customer:null);return}this._initPixel()}stop(){this._removeCookies(),this._disableTriggers()}_initPixel(t){this._injectPixelCode(),this.customer=t;let e=this.options.config;if(!Object.prototype.hasOwnProperty.call(e,"pixelIds"))return;let i=e.pixelIds.split(",").map(function(t){return t.trim()});0!==i.length&&(!0===e.disablePushState&&(window.fbq.disablePushState=!0),i.forEach(i=>{window.fbq("set","autoConfig",!0===e.autoConfig,i),window.fbq("init",i,t)}),this._startTriggers())}_startTriggers(){this.triggers=[],this._registerAllTriggers(),this._executeTriggers()}_registerAllTriggers(){this._registerTrigger(N),this._registerTrigger(L),this._registerTrigger(J),this._registerTrigger(_),this._registerTrigger(I),this._registerTrigger(q),this._registerTrigger(O),this._registerTrigger(A),this._registerTrigger(E),this._registerTrigger(K),this._registerTrigger(v),this._registerTrigger(m),this._registerTrigger(T),this._registerTrigger(z),this._registerTrigger(R),this._registerTrigger(W)}_registerTrigger(t){this.triggers.push(new t(this))}_executeTriggers(){let t=this;this.triggers.forEach(e=>{e.supports(t.options.shop.controller,t.options.shop.action)&&e.execute()})}_disableTriggers(){this.triggers.forEach(t=>{t.disable()})}_subscribeToCookieConsentManager(){document.$emitter.subscribe("CookieConfiguration_Update",this.handleCookieUpdate.bind(this))}handleCookieUpdate(t){let e=t.detail;if(Object.prototype.hasOwnProperty.call(e,this.cookieName)){if(e[this.cookieName]){this.start();return}this.stop()}}isConsentMode(){return"integrate"===this.options.config.privacyMode}isAlwaysActiveMode(){return"active"===this.options.config.privacyMode}isExternalIdDeduplication(){return"externalid"===this.options.config.conversionApiDeduplication}_consentGiven(){return!!this.isConsentMode()&&t.getItem(this.cookieName)}_removeCookies(){let e=document.cookie.split(";"),i=/^_fbp/;e.forEach(e=>{let n=e.split("=")[0].trim();n.match(i)&&t.removeItem(n)})}_injectPixelCode(){var t,e,i,n,r,s,o;t=window,e=document,i="script",n="https://connect.facebook.net/en_US/fbevents.js",t.fbq||(r=t.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},t._fbq||(t._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],(s=e.createElement(i)).async=!0,s.src=n,(o=e.getElementsByTagName(i)[0]).parentNode.insertBefore(s,o))}}window.PluginManager.register("mediameetsFacebookPixel",G,"[data-mediameets-facebook-pixel-options]")})();

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.