<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body style="margin:0;{{& style}}">
<script src="https://yandex.ru/ads/system/preview.js"></script>
<script id="extra" type="application/json">
    ${AUCTION_DC_PARAMS}
</script>
<div id="media" ></div>
<script>
    var data = {{& any}};

    try {
        var d = JSON.parse(document.getElementById("extra").innerHTML);
        var dcParams = d.data_params || {};
        data["AUCTION_DC_PARAMS"] = d;
        for (var c in dcParams) {
            if (c !== "misc" && dcParams[c] && dcParams[c].click_url) {
                data.clickUrl = dcParams[c].click_url.image_orig;
            }
        }
    } catch (e) {}

    var api = new window.Ya.PcodePreview({
        nonce: 'NONCE_REPLACE_PLACEHOLDER',
    });
    var media = document.getElementById('media');
    media.style = `width: ${data.width}px; height: ${data.height}px`
    api.render([{
        elementId: 'media',
        data: {
            media: {
                'type': data.bundle.name,
                'params': data
            }
        }
    }])
</script>
</body>
</html>
