window.DigitalFeedback['https://digitalfeedback.euro.confirmit.com/api/digitalfeedback/loader/prod/scenario?programKey=bIBWJz&scenarioId=12591&programVersion=184'] = function (api) {
(function(){
    var ctx = api();
    function getVal(x) { if (x instanceof Function) { return x(); } return x; }
 
    function userfunc4800(ctx, MyContainerInline, MyContainerModel, MySurveyID, target, cookieExpiration, showConsoleLog) {
var showLog = showConsoleLog == 1 ? true : false; 					// show console log
var DFProgramID = "2303/4800";										// source data information
var DFProgramVersion = "v2.67";										// script information
var logString = "Inline Feedback : " + DFProgramVersion + " "; 		// prefix console log entries
var cookieName = MySurveyID + "_ConfirmBasket";

ConfirmitHelper.ConfirmitLog(showLog, logString + ":Loading");

// 16/01/2026
// Added limiter 
/*
20/100 = only show to 20% of respondents
60/100 = only show to 60% of respondents
90/100 = only show to 90% of respondents	
*/


ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Checking");
if (document.location.host === 'us.rs-online.com' || document.location.host === 'mcstaging2-us.rs-online.com') {

	ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Checking USA");
	if (Math.random() < 75 / 100) {
		ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Pass");
	} else {
		ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Fail Exiting...");
		return;
	}

} else {

	ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Checking NON USA");
	if (Math.random() < 75 / 100) {
		ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Pass");
	} else {
		ConfirmitHelper.ConfirmitLog(showLog, logString + "Rate Limiter: Fail Exiting...");
		return;
	}

}


// Domain Check
if (document.location.host === 'mcstaging2-us.rs-online.com' || document.location.host === 'us.rs-online.com' || document.location.host === 'es.rs-online.com' || document.location.host === 'st1-es.rs-online.com' || document.location.host === 'uk.rs-online.com' || document.location.host === 'st1-uk.rs-online.com' || document.location.host === 'fr.rs-online.com' || document.location.host === 'st1-f1.rs-online.com' || document.location.host === 'it.rs-online.com' || document.location.host === 'st1-it.rs-online.com' || document.location.host === 'de.rs-online.com' || document.location.host === 'st1-de.rs-online.com' || document.location.host === 'at.rs-online.com' || document.location.host === 'st1-at.rs-online.com' || document.location.host === 'st1-ie.rs-online.com' || document.location.host === 'ie.rs-online.com' || document.location.host === 'hken.rs-online.com' || document.location.host === 'st1-hk01.rs-online.com' || document.location.host === 'hkcn.rs-online.com' || document.location.host === 'st1-hk02.rs-online.com' || document.location.host === 'twen.rs-online.com' || document.location.host === 'st1-tw01.rs-online.com' || document.location.host === 'jp.rs-online.com' || document.location.host === 'st1-jp.rs-online.com' || document.location.host === 'au.rs-online.com' || document.location.host === 'st1-au.rs-online.com' || document.location.host === 'ph.rs-online.com' || document.location.host === 'st1-ph.rs-online.com' || document.location.host === 'st1-sg.rs-online.com' || document.location.host === 'sg.rs-online.com' || document.location.host === 'nz.rs-online.com' || document.location.host === 'st1-nz.rs-online.com' || document.location.host === 'th.rs-online.com' || document.location.host === 'st1-th.rs-online.com' || document.location.host === 'st1-my.rs-online.com' || document.location.host === 'my.rs-online.com' || document.location.host === 'no.rs-online.com' || document.location.host === 'st1-no.rs-online.com' || document.location.host === 'se.rs-online.com' || document.location.host === 'st1-se.rs-online.com' || document.location.host === 'dk.rs-online.com' || document.location.host === 'st1-dk.rs-online.com' || document.location.host === 'pt.rs-online.com' || document.location.host === 'st1-pt.rs-online.com' || document.location.host === 'es.rs-online.com/web/' || document.location.host === 'st1-es.rs-online.com' || document.location.host === 'befr.rs-online.com' || document.location.host === 'st1-be01.rs-online.com' || document.location.host === 'benl.rs-online.com' || document.location.host === 'st1-be02.rs-online.com' || document.location.host === 'nl.rs-online.com' || document.location.host === 'st1-nl.rs-online.com' || document.location.host === 'hu.rs-online.com' || document.location.host === 'st1-hu.rs-online.com' || document.location.host === 'cz.rs-online.com' || document.location.host === 'st1-cz.rs-online.com' || document.location.host === 'pl.rs-online.com' || document.location.host === 'st1-pl.rs-online.com' || document.location.host === 'za.rs-online.com' || document.location.host === 'st1-za.rs-online.com' || document.location.host === 'demo.forsta.com') {
	ConfirmitHelper.ConfirmitLog(showLog, logString + "Correct domain, continuing");
	if (document.location.host === 'demo.forsta.com') { target = "#quick-nav" }

	// USA Specific Domain
	if (document.location.host === 'mcstaging2-us.rs-online.com' || document.location.host === 'us.rs-online.com') {
		// USA Specific Page
		ConfirmitHelper.ConfirmitLog(showLog, logString + "USA Domain: Found");
		const currentPath = window.location.pathname;
		const targetPath = '/checkout/onepage/success/';
		if (currentPath.includes(targetPath)) {
			// USA Specific Target
			ConfirmitHelper.ConfirmitLog(showLog, logString + "USA Domain: Checkout Page Found");
			target = ".checkout-success"
		} else {
			ConfirmitHelper.ConfirmitLog(showLog, logString + "USA Domain: Checkout Page NOT Found, exiting");
			return
		}
	}
} else {
	ConfirmitHelper.ConfirmitLog(showLog, logString + "Incorrect domain, exiting");
	return;
}

// Is the target on the page
if (document.querySelector(target)) {
	// does exist
	ConfirmitHelper.ConfirmitLog(showLog, logString + "Target exists continuing");
} else {
	// does NOT exist
	ConfirmitHelper.ConfirmitLog(showLog, logString + "Target NOT on page exiting");
	return;
}


// Check for Cookie Drop
if (ConfirmitHelper.getCookie(cookieName)) {
	ConfirmitHelper.ConfirmitLog(showLog, logString + MySurveyID + " survey cookie present, exiting as within cookie expiration");
	return;
}

// Calculate the language for the survey
var documentHREF = document.location.href;
var documentHOST = document.location.host;

var confLang = "9"; // Default Language
var MyMessage = "" 	// Message Placeholder
var MyPath = "0" // Path Choosen

var isOnAmericaPage = /us.rs-online.com/.test(documentHOST);
if (isOnAmericaPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "21";
}

var isOnSpainPage = /es.rs-online.com/.test(documentHOST);
if (isOnSpainPage) {
	confLang = "10";
	MyMessage = "<div id='myMessage'>Gracias por tu tiempo</div>";
	MyPath = "1";
}

var isOnFrenchPage = /fr.rs-online.com/.test(documentHOST);
if (isOnFrenchPage) {
	confLang = "12";
	MyMessage = "<div id='myMessage'>Merci infiniment du temps que vous nous avez consacré.</div>";
	MyPath = "2";
}

var isOnBEFRPage = /befr.rs-online.com/.test(documentHOST);
if (isOnBEFRPage) {
	confLang = "12";
	MyMessage = "<div id='myMessage'>Merci infiniment du temps que vous nous avez consacré.</div>";
	MyPath = "3";
}

var isOnBEFRPage2 = /be01.rs-online.com/.test(documentHOST);
if (isOnBEFRPage2) {
	confLang = "12";
	MyMessage = "<div id='myMessage'>Merci infiniment du temps que vous nous avez consacré.</div>";
	MyPath = "3.5";
}

var isOnUKPage = /uk.rs-online.com/.test(documentHOST);
if (isOnUKPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "4";
}

var isOnCZPage = /cz.rs-online.com/.test(documentHOST);
if (isOnCZPage) {
	confLang = "5";
	MyMessage = "<div id='myMessage'>Děkujeme za Váš čas. Nyní můžete toto okno zavřít.</div>";
	MyPath = "5";
}

var isOnPLPage = /pl.rs-online.com/.test(documentHOST);
if (isOnPLPage) {
	confLang = "21";
	MyMessage = "<div id='myMessage'>Dziękujemy za poświęcony czas. Można teraz zamknąć to okno.</div>";
	MyPath = "6";
}

var isOnHUPage = /hu.rs-online.com/.test(documentHOST);
if (isOnHUPage) {
	confLang = "14";
	MyMessage = "<div id='myMessage'>Köszönjük, hogy időt szánt ránk! Most már bezárhatja az ablakot.</div>";
	MyPath = "7";
}

var isOnNLPage = /nl.rs-online.com/.test(documentHOST);
if (isOnNLPage) {
	confLang = "19";
	MyMessage = "<div id='myMessage'>Hartelijk dank voor uw tijd. U kunt dit venster nu sluiten.</div>";
	MyPath = "8";
}

var isOnBENLPage = /benl.rs-online.com/.test(documentHOST);
if (isOnBENLPage) {
	confLang = "19";
	MyMessage = "<div id='myMessage'>Hartelijk dank voor uw tijd. U kunt dit venster nu sluiten.</div>";
	MyPath = "9";
}

var isOnBENLPage2 = /be02.rs-online.com/.test(documentHOST);
if (isOnBENLPage2) {
	confLang = "19";
	MyMessage = "<div id='myMessage'>Hartelijk dank voor uw tijd. U kunt dit venster nu sluiten.</div>";
	MyPath = "9.5";
}

var isOnPTPage = /pt.rs-online.com/.test(documentHOST);
if (isOnPTPage) {
	confLang = "22";
	MyMessage = "<div id='myMessage'>Agradecemos o seu tempo. Já pode fechar esta janela.</div>";
	MyPath = "10";
}

var isOnDanishPage = /dk.rs-online.com/.test(documentHOST);
if (isOnDanishPage) {
	confLang = "6";
	MyMessage = "<div id='myMessage'>Mange tak for din tid. Du kan nu lukke dette vindue.</div>";
	MyPath = "11";
}

var isOnSwedishPage = /se.rs-online.com/.test(documentHOST);
if (isOnSwedishPage) {
	confLang = "29";
	MyMessage = "<div id='myMessage'>Tack så mycket för att du tog dig tid. Du kan nu stänga fönstret.</div>";
	MyPath = "12";
}

var isOnNorwegianPage = /no.rs-online.com/.test(documentHOST);
if (isOnNorwegianPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "13";
}

var isOnMalaysiaPage = /my.rs-online.com/.test(documentHOST);
if (isOnMalaysiaPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "14";
}

var isOnThaiPage = /th.rs-online.com/.test(documentHOST);
if (isOnThaiPage) {
	confLang = "30";
	MyMessage = "<div id='myMessage'>ขอบคุณเป็นอย่างยิ่งที่กรุณาสละเวลา คุณจะปิดหน้าต่างนี้ก็ได้.</div>";
	MyPath = "15";
}

var isOnNZPage = /nz.rs-online.com/.test(documentHOST);
if (isOnNZPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "16";
}

var isOnSGPage = /sg.rs-online.com/.test(documentHOST);
if (isOnSGPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "17";
}

var isOnPHPage = /ph.rs-online.com/.test(documentHOST);
if (isOnPHPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "18";
}

var isOnAUPage = /au.rs-online.com/.test(documentHOST);
if (isOnAUPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "19";
}

var isOnZAPage = /za.rs-online.com/.test(documentHOST);
if (isOnZAPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time.</div>";
	MyPath = "20";
}

var isOnJapanesePage = /jp.rs-online.com/.test(documentHOST);
if (isOnJapanesePage) {
	confLang = "17";
	MyMessage = "<div id='myMessage'>アンケートへのご協力、誠にありがとうございました。 アールエスコンポーネンツ</div>";
	MyPath = "21";
}

var isOnChinesePage = /cn.rs-online.com/.test(documentHOST);
if (isOnChinesePage) {
	confLang = "31748";
	MyMessage = "<div id='myMessage'>非常感謝您付出的時間。現在您可以關閉此視窗。</div>";
	MyPath = "22";
}

var isOnTWCNPage = /twcn.rs-online.com/.test(documentHOST);
if (isOnTWCNPage) {
	confLang = "31748";
	MyMessage = "<div id='myMessage'>非常感謝您付出的時間。現在您可以關閉此視窗。</div>";
	MyPath = "23";
}

var isOnHKCNPage = /hkcn.rs-online.com/.test(documentHOST);
if (isOnHKCNPage) {
	confLang = "31748";
	MyMessage = "<div id='myMessage'>非常感謝您付出的時間。現在您可以關閉此視窗。</div>";
	MyPath = "24";
}

var isOnHKCNPage2 = /hk02.rs-online.com/.test(documentHOST);
if (isOnHKCNPage2) {
	confLang = "31748";
	MyMessage = "<div id='myMessage'>非常感謝您付出的時間。現在您可以關閉此視窗。</div>";
	MyPath = "24.5";
}

var isOnTWENPage = /twen.rs-online.com/.test(documentHOST);
if (isOnTWENPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time</div>";
	MyPath = "25";
}

var isOnTWENPage2 = /tw01.rs-online.com/.test(documentHOST);
if (isOnTWENPage2) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time</div>";
	MyPath = "25.5";
}

var isOnHKENPage = /hken.rs-online.com/.test(documentHOST);
if (isOnHKENPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time</div>";
	MyPath = "26";
}

var isOnHKENPage2 = /hk01.rs-online.com/.test(documentHOST);
if (isOnHKENPage2) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time</div>";
	MyPath = "26.5";
}

var isOnIrishPage = /ie.rs-online.com/.test(documentHOST);
if (isOnIrishPage) {
	confLang = "9";
	MyMessage = "<div id='myMessage'>Thank you for your time</div>";
	MyPath = "27";
}

var isOnGermanPage = /de.rs-online.com/.test(documentHOST);
if (isOnGermanPage) {
	confLang = "7";
	MyMessage = "<div id='myMessage'>Vielen Dank für Ihre Zeit. Sie können dieses Fenster jetzt schließen.</div>";
	MyPath = "28";
}

var isOnATPage = /at.rs-online.com/.test(documentHOST);
if (isOnATPage) {
	confLang = "7";
	MyMessage = "<div id='myMessage'>Vielen Dank für Ihre Zeit. Sie können dieses Fenster jetzt schließen.</div>";
	MyPath = "29";
}

var isOnITPage = /it.rs-online.com/.test(documentHOST);
if (isOnITPage) {
	confLang = "16";
	MyMessage = "<div id='myMessage'>La ringraziamo per il Suo contributo. Ora può chiudere questa finestra.</div>";
	MyPath = "30";
}

var dObj = {};

dObj.l = confLang;
dObj.DFSource = "Web_InlineCheckout";
dObj.DFID = DFProgramID;
dObj.DFVersion = DFProgramVersion;
dObj.DFPageRef = document.referrer;
dObj.DFPageURL = document.location.href.toLowerCase();
dObj.DFHost = document.location.host;
dObj.pageURL = documentHREF;
dObj.hostName = documentHOST;
dObj.DFSiteLanguage = window.navigator.language;		// There is no language variable on the site so pipe in the browser lang
dObj.DFSiteUserLanguages = window.navigator.languages;	// Available user languages in browser
dObj.DFSiteUserLanguage = window.navigator.language;	// Active user language

dObj.DFScreenWidth = window.screen.width;
dObj.DFScreenHeight = window.screen.height;
dObj.DFScreenisExtended = window.screen.isExtended
dObj.DFScreenOrientation = window.screen.orientation.type
dObj.DFScreenViewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
dObj.DFScreenViewportHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)
dObj.DFdpr = window.devicePixelRatio

// 12/06/2026: Read the previous session values
dObj.DFsave_basket_btn = sessionStorage.getItem("F_save-basket") || false;
dObj.DFdownload_csv = sessionStorage.getItem("F_download-csv") || false;
dObj.DFprint_btn = sessionStorage.getItem("F_print-btn") || false;
dObj.DFshare_basket_btn = sessionStorage.getItem("F_share-basket-btn") || false;

// Clear the values as not needed anymore
sessionStorage.removeItem("F_save-basket");
sessionStorage.removeItem("F_download-csv");
sessionStorage.removeItem("F_print-btn");
sessionStorage.removeItem("F_share-basket-btn");

// Capture Page information START
if (document.location.host !== 'demo.forsta.com') {

	// America Capture Custom information
	if (isOnAmericaPage) {

		// InvoiceID
		var element_x0A = document.querySelector(".checkout-success span").innerText.toString().trim();
		if (typeof (element_x0A) != 'undefined' && element_x0A != null) {
			//var x0A = document.querySelector(".checkout-success span").innerText.toString().trim();
			var x0A = document.querySelector(".order-number").innerText.toString().trim();
			if (x0A) { dObj.DFInvoiceID = x0A; }
		}

		// Customer Name
		var element_x99 = document.querySelector(".customer-name");
		if (typeof (element_x99) != 'undefined' && element_x99 != null) {
			var x99 = document.querySelector(".customer-name").children[1].innerHTML.trim();
			if (x99) { dObj.UsernameIDFlag = x99; }
		}
	}

	// DFInvoiceID
	var element_x01 = document.querySelector('[data-testid="order-reference-number"]')
	if (typeof (element_x01) != 'undefined' && element_x01 != null) {
		var x01 = document.querySelector('[data-testid="order-reference-number"]').innerHTML.trim();
		if (x01) { dObj.DFInvoiceID = x01; }
	}

	// UsernameIDFlag
	var element_x99 = document.querySelector('[data-testid="site-header-customer-name"]')
	if (typeof (element_x99) != 'undefined' && element_x99 != null) {
		var x99 = document.querySelector('[data-testid="site-header-customer-name"]').innerHTML.trim();
		if (x99) { dObj.UsernameIDFlag = x99; }
	}

	// DFEmailAddress
	var element_x02 = document.querySelector('[data-testid="email-address-value"]')
	if (typeof (element_x02) != 'undefined' && element_x02 != null) {
		var x02 = document.querySelector('[data-testid="email-address-value"]').innerHTML.trim();
		if (x02) { dObj.DFEmailAddress = x02; }
	}

	// DFCardProvider
	var element_x03 = document.querySelector('[data-testid="payment-card-brand"]')
	if (typeof (element_x03) != 'undefined' && element_x03 != null) {
		var x03 = document.querySelector('[data-testid="payment-card-brand"]').getAttribute("data-card-provider").trim();
		if (x03) { dObj.DFCardProvider = x03; }
	}

	// DFBasketCount
	var element_x04 = document.querySelector('[data-testid="products-list"] > header > div')
	if (typeof (element_x04) != 'undefined' && element_x04 != null) {
		var x04 = document.querySelector('[data-testid="products-list"] > header > div').children[1].innerText.toString().split(' ')[0];
		if (x04) { dObj.DFBasketCount = x04; }
	}

	// DFDelivery Options
	//var x06 = document.querySelector('[data-testid="delivery-option"]').innerHTML.trim();
	//if(x06){dObj.DFBasketDeliveryOption = x06;} 

	// DFDelivery Price
	var element_x07 = document.querySelector('[data-testid="delivery-option"]')
	if (typeof (element_x07) != 'undefined' && element_x07 != null) {
		var x07 = parseFloat(document.querySelector('[data-testid="delivery-option"] [data-testid="price"]').innerText.trim())
		if (x07) { dObj.DFBasketDeliveryPrice = x07; }
	}

	// 05/06/2026 - Capture Basket Values
	// Logic to change for America
	if (isOnAmericaPage) {

		// Get the DataLayer section...
		const purchaseEvent = dataLayer.find(d => d.event === "purchase");

		const grandTotal = purchaseEvent?.ecommerce?.value;
		dObj.DFBasketgrandTotalWithTax = grandTotal.toFixed(2);

		const shipping = purchaseEvent?.ecommerce?.shipping;
		dObj.DFBasketshipping = shipping.toFixed(2);

		//dObj.DFBaskettax = 

		const net = purchaseEvent?.ecommerce?.value - purchaseEvent?.ecommerce?.tax;
		dObj.DFBasketdisplayNet = net.toFixed(2);

		//dObj.DFBasketdisplayGross = 

		const currency = purchaseEvent?.ecommerce?.currency;
		dObj.DFBasketcurrencyCode = currency;

	}else{
		dObj.DFBasketgrandTotalWithTax = Number(rs.web.digitalData.grandTotalWithTax).toFixed(2);
		dObj.DFBasketshipping = Number(rs.web.digitalData.shipping).toFixed(2);
		dObj.DFBaskettax = Number(rs.web.digitalData.tax).toFixed(2);
		dObj.DFBasketdisplayNet = Number(rs.web.digitalData.displayNet).toFixed(2);
		dObj.DFBasketdisplayGross = Number(rs.web.digitalData.displayGross).toFixed(2);
		dObj.DFBasketcurrencyCode = rs.web.digitalData.currencyCode;
	}

	// 16/10/2025
	// Capture product counts - START
	let countOver = 0;
	let countThreshold = 20;

	const prodQualityVals = document.querySelectorAll('[data-testid="product-quantity"]');

	if (prodQualityVals) {
		prodQualityVals.forEach(el => {
			const value = parseInt(el.textContent.trim(), 10);
			if (!isNaN(value) && value >= countThreshold) {
				countOver++;
			}
		});
	}

	ConfirmitHelper.ConfirmitLog(showLog, logString + "Found " + countOver + " over threshold");

	// If found then store the reference
	if (countOver > 0) {
		dObj.DFBasketLargeOrderCount = countOver;
		dObj.DFBasketLargeOrderThresh = countThreshold;
	}
	// Capture product counts - END

	/************************************************
	CHECK for RS PRO OPTION (FROM INSIDE checkout page) V1
	*************************************************/
	// function hasRSPro(items) {
	// 	return items.some(item =>
	// 		item.brand && item.brand.toUpperCase().includes("RS PRO")
	// 	);
	// }
	// var brand_RS_PRO = hasRSPro(rs.web.digitalData.products);
	// dObj.brand_RS_PRO = brand_RS_PRO;

	/************************************************
	CHECK for RS PRO OPTION (FROM INSIDE checkout page) V2
	*************************************************/
	// function hasRSPro(data) {
	// 	var brands = data["products.brand"];

	// 	if (!Array.isArray(brands)) return false;

	// 	return brands.some(brand =>
	// 		brand && brand.toUpperCase().includes("RS PRO")
	// 	);
	// }

	// var brand_RS_PRO = hasRSPro(rs.web.digitalData);
	// dObj.brand_RS_PRO = brand_RS_PRO;

}
// Capture Page information END

// Log output for debug purposes
ConfirmitHelper.ConfirmitLog(showLog, logString + JSON.stringify(dObj));
ConfirmitHelper.ConfirmitLog(showLog, logString + "Target: " + target);
ConfirmitHelper.ConfirmitLog(showLog, logString + "Lang Path: " + MyPath);

// Start the program
var dfInst = api();
dfInst.container(MyContainerInline, { target })
dfInst.survey(MySurveyID)
dfInst.data(dObj)
dfInst.show();

// Drop display Cookie
ConfirmitHelper.setCookie(cookieName, "1", { path: '/', expiry: parseInt(cookieExpiration) * 60, secure: true, samesite: 'None' });
ConfirmitHelper.ConfirmitLog(showLog, logString + ": Cookie Dropped - " + cookieName + " Time Delay (minutes): " + cookieExpiration);

ConfirmitHelper.ConfirmitLog(showLog, logString + "End of Script");

// Listen to specific survey event
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";

// Listen to message from child window
eventer(messageEvent, function (e) {
	var key = e.message ? "message" : "data";
	var data = e[key];

	//ConfirmitHelper.ConfirmitLog(showLog, logString + "the data: " + data);
	//ConfirmitHelper.ConfirmitLog(showLog, logString + "the key: " + key);

	if (key == "data" && data[0] == "mylink") {

		var y = data[1].split("__sid__=");
		var z = y[1].split("&");

		ConfirmitHelper.ConfirmitLog(showLog, logString + "the data 1: " + data[1]);
		ConfirmitHelper.ConfirmitLog(showLog, logString + "the data 2: " + y[1]);
		ConfirmitHelper.ConfirmitLog(showLog, logString + "the data 3: " + z[0]);

		var dObj2 = {};

		dObj2.__sid__ = z[0];

		ConfirmitHelper.ConfirmitLog(showLog, logString + "dObj2: " + JSON.stringify(dObj2));

		var dfInst2 = api();
		dfInst2.container(MyContainerModel, {})
		dfInst2.survey(MySurveyID)
		dfInst2.data(dObj2)
		dfInst2.show();

		ConfirmitHelper.ConfirmitLog(showLog, logString + "MyContainerModel: " + MyContainerModel);
		ConfirmitHelper.ConfirmitLog(showLog, logString + "MySurveyID: " + MySurveyID);

		// Kill the element on the page by replacing it with a message
		document.querySelector(".cf-container").innerHTML = MyMessage;

	}

}, false)
}



    userfunc4800(ctx, "Inline (Confirmation Page)", "Model (Confirmation Page)", "p790630892084", "#forsta_embedded_survey", -1, true)
})();
};