export function getCookie( cname: string, cookie: string | undefined ): string | undefined { if (!cookie) { return undefined; } const name = cname + '='; return decodeURIComponent(cookie) .split(';') .find((entry) => entry.startsWith(name)) ?.substring(name.length); }