');
}
return html;
});
}).catch(function () { return null; });
var hwerPre = document.createElement('link');
hwerPre.rel = 'preload';
hwerPre.as = 'fetch';
hwerPre.href = hwerUrl;
hwerPre.crossOrigin = 'anonymous';
document.head.appendChild(hwerPre);
}
// Closeburn stays on the clean host (like High Wycombe). Do not
// location.replace onto /closeburn/website/ — that folder is only the
// Hosting file path. The shared custom-domain prefetch below paints it.
// Chesterfield homepage: the shared shell is what Firebase serves for
// "/". Swap in the real page so Google sees the title, the opening
// sentence, and the game links in the main document.
var kbMirrorHome = '';
var kbMirrorName = '';
var kbMirrorAnyPath = false;
if (h === 'chesterfieldescaperooms.co.uk') {
kbMirrorHome = '/chesterfieldescapero/website/';
kbMirrorName = 'Chesterfield Escape Rooms';
} else if (h === 'coventryescaperooms.co.uk') {
kbMirrorHome = '/coventryscaperooms/website/';
kbMirrorName = 'Coventry Escape Rooms';
} else if (h === 'aylesburyescaperooms.com' || h === 'aylesburyescaperooms.co.uk') {
kbMirrorHome = '/aylesburyescaperooms/website/';
kbMirrorName = 'Aylesbury Escape Rooms';
} else if (h === 'sudburyescaperooms.uk') {
kbMirrorHome = '/sudburyescaperooms/website/';
kbMirrorName = 'Sudbury Escape Rooms';
} else if (h === 'chelmsfordescaperooms.co.uk') {
kbMirrorHome = '/chelmsfordescaperooms/website/';
kbMirrorName = 'Chelmsford Escape Rooms';
kbMirrorAnyPath = true;
} else if (h === 'maldonescaperooms.co.uk') {
kbMirrorHome = '/maldonescaperooms/website/';
kbMirrorName = 'Maldon Escape Rooms';
kbMirrorAnyPath = true;
} else if (h === 'bishopsstortfordescaperooms.co.uk') {
kbMirrorHome = '/bishopsstortfordescaperooms/website/';
kbMirrorName = "Bishop's Stortford Escape Rooms";
kbMirrorAnyPath = true;
}
var kbMirrorIsHome = path === '/' || path === '' || path === '/index.html';
if (kbMirrorHome && (kbMirrorIsHome || kbMirrorAnyPath)) {
var kbMirrorFile = kbMirrorIsHome
? 'index.html'
: String(path || '').replace(/^\/+/, '').replace(/\/+$/, '') + '/index.html';
fetch(kbMirrorHome + kbMirrorFile, { credentials: 'omit' })
.then(function (r) { return r.ok ? r.text() : ''; })
.then(function (html) {
if (!html || html.length < 8000 || html.indexOf(kbMirrorName) < 0) return;
if (/kb-boot-title/i.test(html)) return;
html = html.replace(/