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C,EAAA,EAC1H,CAAE,KAAM,WAAY,KAAM,WAAY,OAAQ,gBAAiB,MAAQA,GAAMA,EAAG,KAAOA,GAAM,wBAAwB,mBAAmBA,CAAC,CAAC,EAAA,EAC1I,CAAE,KAAM,MAAO,KAAM,OAAQ,OAAQ,WAAY,MAAQA,GAAMC,EAAOD,CAAC,EAAG,KAAOA,GAAMA,CAAA,CACxF,EAEO,SAASE,EAAYC,EAAc,CACzC,OAAOJ,EAAmB,KAAMK,GAAMA,EAAE,OAASD,CAAI,GAAK,IAC3D,CAEA,SAASF,EAAOI,EAAqB,CACpC,GAAI,CACH,MAAMC,EAAI,IAAI,IAAID,CAAG,EACrB,OAAOC,EAAE,KAAK,QAAQ,SAAU,EAAE,GAAKA,EAAE,WAAa,IAAMA,EAAE,SAAS,QAAQ,MAAO,EAAE,EAAI,GAC7F,MAAQ,CACP,OAAOD,CACR,CACD","names":["size","svg","root","path","root_1","path_1","root_2","path_2","root_3","path_3","root_4","path_4","root_5","path_5","root_6","$$props","$$render","consequent_1","consequent_2","consequent_4","alternate","$.set_attribute","PROFILE_LINKS_MAX","PROFILE_LINK_HANDLE_MAX","PROFILE_LINK_URL_MAX","PROFILE_LINK_KINDS","v","hostOf","linkKindDef","kind","k","url","u"],"sources":["../../../../../../src/lib/components/ProfileLinkIcon.svelte","../../../../../../src/lib/profile-links.ts"],"sourcesContent":["<script lang=\"ts\">\n\t/** Mono-tone glyph for a profile link kind. Inherits `currentColor`. */\n\tlet { kind, size = 15 }: { kind: string; size?: number } = $props();\n</script>\n\n<svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n\t{#if kind === 'x'}\n\t\t<path d=\"M18.9 2H22l-7 8 8.2 12h-6.4l-5-6.6L6 22H2.9l7.5-8.6L2.5 2h6.6l4.5 6 5.3-6zm-1.1 18h1.8L7.3 3.9H5.4L17.8 20z\" />\n\t{:else if kind === 'reddit'}\n\t\t<path d=\"M22 12.1a2.2 2.2 0 0 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 4.1-.4 5.4z\" />\n\t{:else if kind === 'telegram'}\n\t\t<path d=\"M21.9 4.6 18.7 19.7c-.2 1.1-.9 1.3-1.8.8l-5-3.7-2.4 2.3c-.3.3-.5.5-1 .5l.4-5.1 9.2-8.3c.4-.4-.1-.6-.6-.2L6.1 13.2 1.2 11.7c-1.1-.3-1.1-1.1.2-1.6L20.5 2.7c.9-.3 1.7.2 1.4 1.9z\" />\n\t{:else if kind === 'onlyfans'}\n\t\t<path d=\"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 14.5a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9z\" />\n\t{:else}\n\t\t<path d=\"M10.6 13.4a1 1 0 0 1 0 1.4 4 4 0 0 1-5.7 0l-1.7-1.7a4 4 0 0 1 0-5.7l2.8-2.8a4 4 0 0 1 5.7 0 1 1 0 0 1-1.4 1.4 2 2 0 0 0-2.9 0L4.6 8.8a2 2 0 0 0 0 2.9l1.7 1.7a2 2 0 0 0 2.9 0 1 1 0 0 1 1.4 0zm2.8-2.8a1 1 0 0 1 0-1.4 4 4 0 0 1 5.7 0l1.7 1.7a4 4 0 0 1 0 5.7l-2.8 2.8a4 4 0 0 1-5.7 0 1 1 0 0 1 1.4-1.4 2 2 0 0 0 2.9 0l2.8-2.8a2 2 0 0 0 0-2.9l-1.7-1.7a2 2 0 0 0-2.9 0 1 1 0 0 1-1.4 0z\" />\n\t{/if}\n</svg>\n","/** Social links on the public profile: reddit / x / instagram / telegram /\n *  onlyfans handles + one free https url. Client-safe (form + render share\n *  it); the server validates with the same functions before saving. */\n\nexport type ProfileLinkKind = 'reddit' | 'x' | 'instagram' | 'telegram' | 'onlyfans' | 'url';\nexport interface ProfileLink {\n\tkind: ProfileLinkKind;\n\t/** the handle for a network, the full https url for 'url' */\n\tvalue: string;\n}\n\nexport const PROFILE_LINKS_MAX = 5;\nexport const PROFILE_LINK_HANDLE_MAX = 40;\nexport const PROFILE_LINK_URL_MAX = 200;\n\nexport const PROFILE_LINK_KINDS: {\n\tkind: ProfileLinkKind;\n\tname: string;\n\t/** what the settings field shows before the input */\n\tprefix: string;\n\t/** rendered label on the profile pill */\n\tlabel: (v: string) => string;\n\thref: (v: string) => string;\n}[] = [\n\t{ kind: 'reddit', name: 'reddit', prefix: 'reddit.com/u/', label: (v) => `u/${v}`, href: (v) => `https://www.reddit.com/user/${encodeURIComponent(v)}` },\n\t{ kind: 'x', name: 'x', prefix: 'x.com/', label: (v) => `@${v}`, href: (v) => `https://x.com/${encodeURIComponent(v)}` },\n\t{ kind: 'instagram', name: 'instagram', prefix: 'instagram.com/', label: (v) => `@${v}`, href: (v) => `https://www.instagram.com/${encodeURIComponent(v)}` },\n\t{ kind: 'telegram', name: 'telegram', prefix: 't.me/', label: (v) => v, href: (v) => `https://t.me/${encodeURIComponent(v)}` },\n\t{ kind: 'onlyfans', name: 'onlyfans', prefix: 'onlyfans.com/', label: (v) => v, href: (v) => `https://onlyfans.com/${encodeURIComponent(v)}` },\n\t{ kind: 'url', name: 'link', prefix: 'https://', label: (v) => hostOf(v), href: (v) => v }\n];\n\nexport function linkKindDef(kind: string) {\n\treturn PROFILE_LINK_KINDS.find((k) => k.kind === kind) ?? null;\n}\n\nfunction hostOf(url: string): string {\n\ttry {\n\t\tconst u = new URL(url);\n\t\treturn u.host.replace(/^www\\./, '') + (u.pathname !== '/' ? u.pathname.replace(/\\/$/, '') : '');\n\t} catch {\n\t\treturn url;\n\t}\n}\n\nconst HANDLE_RE = /^[a-z0-9_.-]{1,40}$/i;\n/** link shorteners + the usual scam hosts: a free url may not point here */\nconst BLOCKED_HOSTS = ['bit.ly', 'tinyurl.com', 't.co', 'goo.gl', 'is.gd', 'cutt.ly', 'rb.gy', 'shorturl.at', 'tiny.cc', 'linktr.ee.'];\n\n/** Trim, strip a pasted prefix (@, u/, full url) and lowercase where the\n *  network is case-insensitive. Returns null when it isn't a usable handle. */\nexport function normalizeHandle(kind: ProfileLinkKind, raw: string): string | null {\n\tlet v = raw.trim();\n\t// a pasted full url → take the last path segment\n\tconst m = v.match(/^(?:https?:\\/\\/)?(?:www\\.)?(?:reddit\\.com\\/(?:u|user)\\/|x\\.com\\/|twitter\\.com\\/|instagram\\.com\\/|t\\.me\\/|onlyfans\\.com\\/)([^/?#]+)/i);\n\tif (m) v = m[1];\n\tv = v.replace(/^@/, '').replace(/^u\\//i, '').replace(/\\/+$/, '');\n\tif (kind === 'reddit' || kind === 'x') v = v.toLowerCase();\n\tif (!HANDLE_RE.test(v)) return null;\n\treturn v;\n}\n\nexport function normalizeUrl(raw: string): string | null {\n\tlet v = raw.trim();\n\tif (!v) return null;\n\tif (!/^https?:\\/\\//i.test(v)) v = 'https://' + v;\n\tlet u: URL;\n\ttry {\n\t\tu = new URL(v);\n\t} catch {\n\t\treturn null;\n\t}\n\tif (u.protocol !== 'https:') return null;\n\tif (!u.hostname.includes('.') || /\\s/.test(v)) return null;\n\tif (BLOCKED_HOSTS.some((h) => u.hostname === h || u.hostname.endsWith('.' + h))) return null;\n\tu.hash = '';\n\tconst out = u.toString();\n\treturn out.length > PROFILE_LINK_URL_MAX ? null : out;\n}\n\n/** Validate + normalise a whole list. Returns the clean list or an error\n *  message for the form. One entry per kind. */\nexport function cleanProfileLinks(input: unknown): { ok: true; links: ProfileLink[] } | { ok: false; error: string } {\n\tif (!Array.isArray(input)) return { ok: true, links: [] };\n\tconst out: ProfileLink[] = [];\n\tconst seen = new Set<string>();\n\tfor (const raw of input) {\n\t\tif (!raw || typeof raw !== 'object') continue;\n\t\tconst kind = (raw as { kind?: unknown }).kind;\n\t\tconst value = (raw as { value?: unknown }).value;\n\t\tif (typeof kind !== 'string' || typeof value !== 'string' || !linkKindDef(kind)) continue;\n\t\tconst k = kind as ProfileLinkKind;\n\t\tif (!value.trim()) continue; // an empty field is \"remove\"\n\t\tif (seen.has(k)) return { ok: false, error: `only one ${linkKindDef(k)!.name} link` };\n\t\tconst v = k === 'url' ? normalizeUrl(value) : normalizeHandle(k, value);\n\t\tif (!v) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: k === 'url' ? \"that's not a url. https only, no spaces, no shorteners.\" : `that's not a ${linkKindDef(k)!.name} handle. letters, numbers, _ . - only.`\n\t\t\t};\n\t\t}\n\t\tseen.add(k);\n\t\tout.push({ kind: k, value: v });\n\t\tif (out.length > PROFILE_LINKS_MAX) return { ok: false, error: `max ${PROFILE_LINKS_MAX} links` };\n\t}\n\treturn { ok: true, links: out };\n}\n"],"version":3}