import { h } from '../webmapgl.core.js';

function getMap(id) {
    return document.querySelector((id) ? `gl-map#${id}` : 'gl-map');
}
function getThumbnail(item) {
    if (item.image)
        return (h("ion-thumbnail", { slot: "start" },
            h("img", { src: item.image })));
}
function toArray(value, sep = ',') {
    if (!value)
        return [];
    if (Array.isArray(value))
        return value;
    return value.split(sep);
}
const getAbsoluteUrl = (function () {
    let a;
    return function (url) {
        if (!a)
            a = document.createElement('a');
        a.href = url;
        return a.href;
    };
})();

export { getMap as a, getAbsoluteUrl as b, toArray as c, getThumbnail as d };
