'use strict';

const core = require('./core-89b71307.js');
const lodash = require('./lodash-23b825de.js');

function constructIcon(displayIcon, iconOptions) {
    if (iconOptions) {
        iconOptions = lodash._.cloneDeep(iconOptions);
        const iconStyle = {
            width: iconOptions.width,
            height: iconOptions.height
        };
        delete iconOptions.width;
        delete iconOptions.height;
        return {
            displayIcon,
            iconElm: core.h("img", Object.assign({}, iconOptions, { style: iconStyle }))
        };
    }
    else {
        return { displayIcon: false, iconElm: null };
    }
}

exports.constructIcon = constructIcon;
