Documentation for this module may be created at Module:BioboxPersonalPages/platforms/doc

local platforms = {
    homepage = {
        name = "homepage",
        paramBase = "homepage",
        altParams = {},
        archiveBase = "homepage-archive",
        pbdProp = "P52",
        urlFormat = "%s",
        label = "Official website",
        isFullWidth = true,
        maxCount = 2
    },
    blog = {
        name = "blog",
        paramBase = "blog",
        altParams = {},
        archiveBase = "blog-archive",
        pbdProp = "P635",
        urlFormat = "%s",
        label = "Blog",
        isFullWidth = true,
        maxCount = 2
    },
    facebook = {
        name = "facebook",
        paramBase = "facebook",
        altParams = {},
        archiveBase = "facebook-archive",
        pbdProp = "P350",
        urlFormat = "https://www.facebook.com/%s",
        icon = "Facebook f icon (2019).svg",
        label = "Facebook",
        category = "Facebook",
        maxCount = 4
    },
    vk = {
        name = "vk",
        paramBase = "vk",
        altParams = {},
        archiveBase = "vk-archive",
        pbdProp = "P355",
        urlFormat = "https://vk.com/%s",
        icon = "VK icon.svg",
        label = "VKontakte",
        category = "VKontakte",
        maxCount = 3
    },
    x = {
        name = "x",
        paramBase = "x",
        altParams = {"twitter"},
        archiveBase = "x-archive",
        altArchiveBases = {"twitter-archive"},
        pbdProp = "P137",
        urlFormat = "https://x.com/%s",
        icon = "X logo 2023.svg",
        label = "X handle",
        category = "X",
        maxCount = 3,
        extraFormatFunc = function(displayValue, entry)
            if entry.statement and entry.statement.qualifiers and entry.statement.qualifiers.P688 then
                local userId = entry.statement.qualifiers.P688[1].datavalue.value
                if userId then
                    displayValue = displayValue .. string.format('<br><small>#ID: [https://x.com/i/user/%s %s]</small>', userId, userId)
                end
            end
            return displayValue
        end
    },
    instagram = {
        name = "instagram",
        paramBase = "instagram",
        altParams = {"ig"},
        archiveBase = "instagram-archive",
        altArchiveBases = {"ig-archive"},
        pbdProp = "P349",
        urlFormat = "https://www.instagram.com/%s",
        icon = "Instagram logo 2016.svg",
        label = "Instagram",
        category = "Instagram",
        maxCount = 3
    },
    threads = {
        name = "threads",
        paramBase = "threads",
        altParams = {},
        archiveBase = "threads-archive",
        pbdProp = "P793",
        urlFormat = "https://www.threads.net/@%s",
        icon = "Threads logo.svg",
        label = "Threads",
        category = "Threads",
        maxCount = 3
    },
    telegram = {
        name = "telegram",
        paramBase = "telegram",
        altParams = {"tg"},
        archiveBase = "telegram-archive",
        altArchiveBases = {"tg-archive"},
        pbdProp = "P624",
        urlFormat = "https://t.me/%s",
        icon = "Telegram 2019 Logo.svg",
        label = "Telegram",
        category = "Telegram",
        maxCount = 3
    },
    linkedin = {
        name = "linkedin",
        paramBase = "linkedin",
        altParams = {},
        archiveBase = "linkedin-archive",
        pbdProp = "P352",
        urlFormat = "https://www.linkedin.com/in/%s",
        icon = "Linkedin icon.svg",
        label = "LinkedIn",
        category = "LinkedIn",
        maxCount = 3
    },
    youtube = {
        name = "youtube",
        types = {
            {
                paramBase = "youtube",
                altParams = {},
                archiveBase = "youtube-archive",
                pbdProp = "P791",
                urlFormat = "https://www.youtube.com/@%s",
                maxCount = 3
            },
            {
                paramBase = "youtubechannel",
                altParams = {},
                archiveBase = "youtubechannel-archive",
                pbdProp = "P375",
                urlFormat = "https://www.youtube.com/channel/%s",
                maxCount = 3
            }
        },
        icon = "YouTube full-color icon (2017).svg",
        label = "YouTube",
        category = "YouTube"
    },
    soundcloud = {
        name = "soundcloud",
        paramBase = "soundcloud",
        altParams = {},
        archiveBase = "soundcloud-archive",
        pbdProp = "P379",
        urlFormat = "https://soundcloud.com/%s",
        icon = "Soundcloud icon.svg",
        label = "SoundCloud",
        category = "SoundCloud",
        maxCount = 3
    },
    mixcloud = {
        name = "mixcloud",
        paramBase = "mixcloud",
        altParams = {},
        archiveBase = "mixcloud-archive",
        pbdProp = "P400",
        urlFormat = "https://www.mixcloud.com/%s",
        icon = "Mixcloud icon.svg",
        label = "MixCloud",
        category = "MixCloud",
        maxCount = 3
    },
    lastfm = {
        name = "lastfm",
        paramBase = "lastfm",
        altParams = {},
        archiveBase = "lastfm-archive",
        pbdProp = "P820",
        urlFormat = "https://www.last.fm/music/%s",
        icon = "Last.fm icon.svg",
        label = "Last.fm",
        category = "Last.fm",
        maxCount = 3
    },
    modelmayhem = {
        name = "modelmayhem",
        paramBase = "modelmayhem",
        altParams = {"mm"},
        archiveBase = "modelmayhem-archive",
        altArchiveBases = {"mm-archive"},
        pbdProp = "P411",
        urlFormat = "https://www.modelmayhem.com/%s",
        icon = "Modelmayhem icon.png",
        labelFunc = function()
            local frame = mw.getCurrentFrame()
            local abbrTemplate = frame:expandTemplate{ title = 'abbr', args = { 'MM', 'Model Mayhem' } }
            return '[[File:Modelmayhem icon.png|16px|alt=Model Mayhem|link=]] ' .. abbrTemplate .. ':'
        end,
        category = "Model Mayhem",
        maxCount = 3
    },
    tiktok = {
        name = "tiktok",
        paramBase = "tiktok",
        altParams = {},
        archiveBase = "tiktok-archive",
        pbdProp = "P369",
        urlFormat = "https://www.tiktok.com/@%s",
        icon = "Tiktok icon.svg",
        label = "TikTok",
        category = "TikTok",
        maxCount = 3
    },
    reddit = {
        name = "reddit",
        paramBase = "reddit",
        altParams = {},
        archiveBase = "reddit-archive",
        pbdProp = "P412",
        urlFormat = "https://www.reddit.com/user/%s",
        icon = "Reddit icon.svg",
        label = "Reddit",
        category = "Reddit",
        maxCount = 3
    }
}

local platformOrder = {
    "homepage",
    "blog",
    "facebook",
    "vk",
    "x",
    "instagram",
    "threads",
    "telegram",
    "linkedin",
    "youtube",
    "soundcloud",
    "mixcloud",
    "lastfm",
    "modelmayhem",
    "tiktok",
    "reddit"
}

return {
    platforms = platforms,
    platformOrder = platformOrder
}