function ignAddThemeClassToDocument(theme) {
if (!theme) return;
const classPrefix = 'ign-theme-';
const html = document.querySelector('html');
const classes = html.className.split(' ');
for (let i = 0; i !== classes.length; i++) {
if (classes[i].indexOf(classPrefix) === 0) {
html.classList.remove(classes[i]);
}
}
html.classList.add(classPrefix + theme);
}
const template = document.querySelector('.ign-base-template.ign-template');
const templateScope = angular.element(template).scope();
templateScope.$watch('custom.theme', (value) => ignAddThemeClassToDocument(value));
window.addEventListener('message', (event) => {
if (event.data.theme) {
templateScope.custom.theme = event.data.theme;
}
});
templateScope.ignHeader = `Diablo 4 x RockLove Jewelry at the IGN Store`;
templateScope.actionButtonText = `See the Collection`;
templateScope.actionButtonUrl = `https://store.ign.com/collections/diablo?utm_source=piano&utm_campaign=piano`;
templateScope.ignSubTitle = ``;
templateScope.ignImage = `https://assets-prd.ignimgs.com/2023/08/10/kjryalrv01ork61lm4rxreieayrjfxpzv3zxtuwqmeq-1691707700686.jpg?fit=bounds&width=640`;
templateScope.ignText = `A limited collection of handcrafted jewelry based on the game is coming exclusively to the IGN Store. It’s from RockLove Jewelry and Blizzard Entertainment, and it includes a number of high quality pieces based on characters from the game.`;
templateScope.compactActionButton = `false` === 'true';
const wideBreakPoint = 640;
templateScope.ignIsWide = document.querySelector(".ign-base-template.ign-template").offsetWidth > wideBreakPoint;
const resizeObserver = new ResizeObserver(function(entries) {
const entry = entries[0];
if (!entry || !entry.contentRect) return;
templateScope.ignIsWide = entry.contentRect.width > wideBreakPoint;
});
resizeObserver.observe(document.querySelector(".ign-base-template.ign-template"));