{"version":3,"file":"nrkno-masthead-render.min.js","sources":["../node_modules/@nrk/core-toggle/core-toggle.cjs.js","../node_modules/@nrk/nrkno-login-connector/connector.js","../nrkno-masthead.js","../nrkno-masthead-initialize.js","../node_modules/@nrk/core-icons/core-icons.mjs"],"sourcesContent":["'use strict';\n\nvar name = \"@nrk/core-toggle\";\nvar version = \"2.2.2\";\n\nvar IS_BROWSER = typeof window !== 'undefined';\nvar IS_ANDROID = IS_BROWSER && /(android)/i.test(navigator.userAgent); // Bad, but needed\nvar IS_IOS = IS_BROWSER && /iPad|iPhone|iPod/.test(String(navigator.platform));\nvar HAS_EVENT_OPTIONS = (function (has) {\n if ( has === void 0 ) has = false;\n\n try { window.addEventListener('test', null, { get passive () { has = true; } }); } catch (e) {}\n return has\n})();\n\n/**\n* addEvent\n* @param {String} uuid An unique ID of the event to bind - ensurnes single instance\n* @param {String} type The type of event to bind\n* @param {Function} handler The function to call on event\n* @param {Boolean|Object} options useCapture or options object for addEventListener. Defaults to false\n*/\nfunction addEvent (uuid, type, handler, options) {\n if ( options === void 0 ) options = false;\n\n if (typeof window === 'undefined' || window[uuid = uuid + \"-\" + type]) { return } // Ensure single instance\n if (!HAS_EVENT_OPTIONS && typeof options === 'object') { options = Boolean(options.capture); } // Fix unsupported options\n var node = (type === 'resize' || type === 'load') ? window : document;\n node.addEventListener(window[uuid] = type, handler, options);\n}\n\n/**\n* dispatchEvent - with infinite loop prevention\n* @param {Element} elem The target object\n* @param {String} name The source object(s)\n* @param {Object} detail Detail object (bubbles and cancelable is set to true)\n* @return {Boolean} Whether the event was canceled\n*/\nvar IGNORE = 'prevent_recursive_dispatch_maximum_callstack';\nfunction dispatchEvent (element, name, detail) {\n if ( detail === void 0 ) detail = {};\n\n var ignore = \"\" + IGNORE + name;\n var event;\n\n if (element[ignore]) { return true } // We are already processing this event, so skip sending a new one\n else { element[ignore] = true; } // Add name to dispatching ignore\n\n if (typeof window.CustomEvent === 'function') {\n event = new window.CustomEvent(name, { bubbles: true, cancelable: true, detail: detail });\n } else {\n event = document.createEvent('CustomEvent');\n event.initCustomEvent(name, true, true, detail);\n }\n // IE reports incorrect event.defaultPrevented\n // but correct return value on element.dispatchEvent\n var result = element.dispatchEvent(event);\n element[ignore] = null; // Remove name from dispatching ignore\n\n return result // Follow W3C standard for return value\n}\n\n/**\n* getUUID\n* @return {String} A generated unique ID\n*/\nfunction getUUID (el) {\n return Date.now().toString(36) + Math.random().toString(36).slice(2, 5)\n}\n\n/**\n* queryAll\n* @param {String|NodeList|Array|Element} elements A CSS selector string, nodeList, element array, or single element\n* @return {Element[]} Array of elements\n*/\nfunction queryAll (elements, context) {\n if ( context === void 0 ) context = document;\n\n if (elements) {\n if (elements.nodeType) { return [elements] }\n if (typeof elements === 'string') { return [].slice.call(context.querySelectorAll(elements)) }\n if (elements.length) { return [].slice.call(elements) }\n }\n return []\n}\n\nvar UUID = (\"data-\" + name + \"-\" + version).replace(/\\W+/g, '-'); // Strip invalid attribute characters\nvar ARIA = IS_ANDROID ? 'data' : 'aria'; // Andriod has a bug and reads only label instead of content\nvar KEYS = { ESC: 27 };\n\nfunction toggle (toggles, open) {\n var options = typeof open === 'object' ? open : { open: open };\n if (IS_IOS) { document.documentElement.style.cursor = 'pointer'; } // Fix iOS events for closing popups (https://stackoverflow.com/a/16006333/8819615)\n\n return queryAll(toggles).map(function (toggle) {\n var content = getContentElement(toggle);\n var isOpen = toggle.getAttribute('aria-expanded') === 'true';\n var open = typeof options.open === 'boolean' ? options.open : (options.open === 'toggle' ? !isOpen : isOpen);\n var popup = String((options.hasOwnProperty('popup') ? options.popup : toggle.getAttribute(UUID)) || false);\n\n if (options.value) { toggle.innerHTML = options.value; } // Set innerHTML before updating aria-label\n if (popup !== 'false' && popup !== 'true') { toggle.setAttribute('aria-label', ((toggle.textContent) + \", \" + popup)); } // Only update aria-label if popup-mode\n\n toggle.setAttribute(UUID, popup); // aria-haspopup triggers forms mode in JAWS, therefore store in uuid\n toggle.setAttribute('aria-controls', content.id = content.id || getUUID());\n content.setAttribute((ARIA + \"-labelledby\"), toggle.id = toggle.id || getUUID());\n setOpen(toggle, open);\n return toggle\n })\n}\n\nfunction getContentElement (toggle) {\n return document.getElementById(toggle.getAttribute('aria-controls')) || toggle.nextElementSibling\n}\n\naddEvent(UUID, 'keydown', function (event) {\n if (event.keyCode !== KEYS.ESC) { return }\n for (var el = event.target; el; el = el.parentElement) {\n var toggle = (el.id && document.querySelector((\"[aria-controls=\\\"\" + (el.id) + \"\\\"]\"))) || el;\n\n if (toggle.getAttribute(UUID) !== 'false' && toggle.getAttribute('aria-expanded') === 'true') {\n event.preventDefault(); // Prevent leaving maximized window in Safari\n toggle.focus();\n return setOpen(toggle, false)\n }\n }\n}, true); // Use capture to enable checking defaultPrevented (from ESC key) in parents\n\naddEvent(UUID, 'click', function (ref) {\n var target = ref.target;\n var defaultPrevented = ref.defaultPrevented;\n\n if (defaultPrevented) { return false } // Do not toggle if someone run event.preventDefault()\n\n for (var el = target, item = (void 0); el; el = el.parentElement) {\n var toggle = item && el.id && document.querySelector((\"[\" + UUID + \"][aria-controls=\\\"\" + (el.id) + \"\\\"]\"));\n if ((el.nodeName === 'BUTTON' || el.nodeName === 'A') && !el.hasAttribute(UUID)) { item = el; } // interactive element clicked\n if (toggle) {\n dispatchEvent(toggle, 'toggle.select', {\n relatedTarget: getContentElement(toggle),\n currentTarget: item,\n value: item.textContent.trim()\n });\n break\n }\n }\n\n queryAll((\"[\" + UUID + \"]\")).forEach(function (toggle) {\n var open = toggle.getAttribute('aria-expanded') === 'true';\n var popup = toggle.getAttribute(UUID) !== 'false';\n var content = getContentElement(toggle);\n\n if (toggle.contains(target)) { setOpen(toggle, !open); } // Click on toggle\n else if (popup && open) { setOpen(toggle, content.contains(target)); } // Click in content or outside\n });\n});\n\nfunction setOpen (toggle, open) {\n var content = getContentElement(toggle);\n var isOpen = toggle.getAttribute('aria-expanded') === 'true';\n var willOpen = typeof open === 'boolean' ? open : (open === 'toggle' ? !isOpen : isOpen);\n var isUpdate = isOpen === willOpen || dispatchEvent(toggle, 'toggle', { relatedTarget: content, isOpen: isOpen, willOpen: willOpen });\n var nextOpen = isUpdate ? willOpen : toggle.getAttribute('aria-expanded') === 'true'; // dispatchEvent can change attributes\n var focus = !isOpen && nextOpen && content.querySelector('[autofocus]');\n\n if (focus) { setTimeout(function () { return focus && focus.focus(); }); } // Move focus on next render (if element stil exists)\n\n toggle.setAttribute('aria-expanded', nextOpen);\n content[nextOpen ? 'removeAttribute' : 'setAttribute']('hidden', '');\n}\n\nmodule.exports = toggle;\n","\n//#region Type definitions\n\n/**\n * @typedef {object} SessionOptions\n * @property {string} [redirectPath] \n * @property {string} [abortPath]\n */\n\n/**\n * @callback SessionFunction\n * @param {SessionOptions} [options] \n */\n\n/**\n * @typedef {object} Token\n * @property {string} accessToken\n * @property {string} expiresAt ex: 2019-04-30T12:13:14.123456Z\n */\n\n/**\n * Called with an unexpired token\n * @callback TokenCallback\n * @param {Error | null} [error] \n * @param {Token | null} [token] \n */\n\n /**\n * @callback TokenFunction\n * @param {TokenCallback} cb\n */\n\n/**\n * @typedef {object} Session\n * @property {SessionFunction} login redirects client to login page\n * @property {SessionFunction} logout redirects client to logout page\n * @property {TokenFunction} token\n */\n\n/**\n * @typedef {object} User\n * @property {string} name \n * @property {string} sessionState\n * @property {string} subject\n */\n\n /**\n * Called with unexpired token\n * @callback ConnectCallback\n * @param {User | false} user\n * @param {Session} session \n */\n\n //#endregion\n\n/**\n * Connect takes a callback that will be called after retrieving the users session\n * @param {ConnectCallback} callback Function that will be called\n * @example\n * connect((user, session) => {\n * if (user) {\n * console.log(`${user.name} is logged in`)\n * } else {\n * session.login({abortPath: '%2Fminside'})\n * }\n * })\n */\nexport function connect(callback) {\n const key = 'onLoginReady';\n // Add callback queue placeholder if needed\n if (window[key] === undefined) {\n window[key] = function() {\n (window[key].q = window[key].q || []).push(arguments);\n };\n }\n\n // load script if needed\n loadOnce('/logginn.js');\n\n // add callback\n window[key](callback);\n}\n\n/**\n * loadOnce loads the given script IFF it is not already present in the DOM.\n * @param {string} src URL for script\n * @returns {undefined}\n */\nfunction loadOnce(src) {\n const hasScript = document.querySelector(`script[src=\"${src}\"]`);\n\n if (hasScript){\n return;\n }\n\n const script = document.createElement('script');\n script.async = true;\n script.src = src;\n\n document.head.appendChild(script);\n}\n","import {\n nrkLogoNrk,\n nrkLogoNrkTv,\n nrkLogoNrkRadio,\n nrkLogoNrkP3Symbol,\n nrkLogoNrkSuper,\n nrkLogoYr,\n nrkChevronDown,\n nrkUserNotloggedin,\n nrkSearch\n} from '@nrk/core-icons'\n\n/**\n *\n * @typedef {Object} MastheadOptions\n * @property {boolean} [dark=false]\n * @property {boolean} [login=true]\n * @property {boolean} [search=true]\n * @property {boolean} [minimal=false]\n * @property {string} [nonce]\n *\n */\n\n/**\n * Masthead\n * @param {MastheadOptions} [options]\n * @returns {string} raw html markup\n */\nexport function Masthead (options) {\n const { dark = false, login = true, search = true, minimal = false } = options || {}\n return `
\n ${nrkLogoNrk}\n \n\n \n\n ${login ? `
\n \n \n
` : ''}\n
`\n}\n","import coreToggle from '@nrk/core-toggle'\nimport {\n nrkUserLoggedin,\n nrkClose\n} from '@nrk/core-icons'\nimport { connect } from '@nrk/nrkno-login-connector'\n\nexport function initialize () {\n if (typeof document === 'undefined') return\n coreToggle('.nrk-masthead__bars, .nrk-masthead__more', { popup: true })\n\n const loginLink = document.querySelector('.nrk-masthead__user a')\n if (loginLink) {\n connect((user) => {\n if (user) {\n const span = document.createElement('span')\n const canReplaceState = window.history && window.history.replaceState\n const isAutoLogin = window.location.search.indexOf('autoLogin=true') >= 0\n\n span.textContent = user.name\n loginLink.innerHTML = nrkUserLoggedin\n loginLink.appendChild(span)\n\n if (isAutoLogin) {\n const banner = document.body.insertAdjacentElement('afterbegin', document.createElement('div'))\n\n banner.className = 'nrk-masthead__auto-login-banner'\n banner.innerHTML = `Hei, du er nå logget inn på nrk.no, fordi du allerede er innlogget et annet sted hos NRK`\n banner.querySelector('button').addEventListener('click', () => banner.parentElement.removeChild(banner))\n banner.querySelector('strong').textContent = `Hei ${user.name}` // Use textContent for security\n\n if (canReplaceState) {\n const href = window.location.href.replace(/autoLogin=true&?/, '').replace(/[?|&]$/, '')\n window.history.replaceState(window.history.state, document.title, href)\n }\n }\n }\n loginLink.removeAttribute('hidden')\n })\n }\n}\n","export const nrk360 = ''\nexport const nrk404 = ''\nexport const nrkArrowLeftLong = ''\nexport const nrkArrowLeft = ''\nexport const nrkArrowRightLong = ''\nexport const nrkArrowRight = ''\nexport const nrkBellActive = ''\nexport const nrkBell = ''\nexport const nrkBookmarkActive = ''\nexport const nrkBookmark = ''\nexport const nrkBroadcast = ''\nexport const nrkCalendar = ''\nexport const nrkCategory = ''\nexport const nrkCheck = ''\nexport const nrkChevronDown = ''\nexport const nrkChevronLeft = ''\nexport const nrkChevronRight = ''\nexport const nrkChevronUp = ''\nexport const nrkCloseCircle = ''\nexport const nrkClose = ''\nexport const nrkComment = ''\nexport const nrkDice1Active = ''\nexport const nrkDice1 = ''\nexport const nrkDice2Active = ''\nexport const nrkDice2 = ''\nexport const nrkDice3Active = ''\nexport const nrkDice3 = ''\nexport const nrkDice4Active = ''\nexport const nrkDice4 = ''\nexport const nrkDice5Active = ''\nexport const nrkDice5 = ''\nexport const nrkDice6Active = ''\nexport const nrkDice6 = ''\nexport const nrkDownload = ''\nexport const nrkDuration = ''\nexport const nrkFullscreenActive = ''\nexport const nrkFullscreen = ''\nexport const nrkGallery = ''\nexport const nrkGeoActive = ''\nexport const nrkGeo = ''\nexport const nrkGeopointActive = ''\nexport const nrkGeopoint = ''\nexport const nrkGlobe = ''\nexport const nrkHardwareCamera = ''\nexport const nrkHardwareComputer = ''\nexport const nrkHardwareGame = ''\nexport const nrkHardwareMobile = ''\nexport const nrkHardwareRadio = ''\nexport const nrkHardwareSmartSpeaker = ''\nexport const nrkHardwareSmartWatch = ''\nexport const nrkHardwareSpeaker = ''\nexport const nrkHardwareTablet = ''\nexport const nrkHardwareTv = ''\nexport const nrkHardwareWatch = ''\nexport const nrkHeartActive = ''\nexport const nrkHeart = ''\nexport const nrkHelp = ''\nexport const nrkHomeActive = ''\nexport const nrkHome = ''\nexport const nrkInfo = ''\nexport const nrkLatestNewsActive = ''\nexport const nrkLatestNews = ''\nexport const nrkLink = ''\nexport const nrkLockActive = ''\nexport const nrkLock = ''\nexport const nrkLogoNrk1Colorblack = ''\nexport const nrkLogoNrk1Colorgrey = ''\nexport const nrkLogoNrk1Colorwhite = ''\nexport const nrkLogoNrk1 = ''\nexport const nrkLogoNrk2Colorblack = ''\nexport const nrkLogoNrk2Colorgrey = ''\nexport const nrkLogoNrk2Colorwhite = ''\nexport const nrkLogoNrk2 = ''\nexport const nrkLogoNrk3Colorblack = ''\nexport const nrkLogoNrk3Colorgrey = ''\nexport const nrkLogoNrk3Colorwhite = ''\nexport const nrkLogoNrk3 = ''\nexport const nrkLogoNrkAlltidNyheter = ''\nexport const nrkLogoNrkFolkemusikk = ''\nexport const nrkLogoNrkJazz = ''\nexport const nrkLogoNrkKlassisk = ''\nexport const nrkLogoNrkMp3Symbol = ''\nexport const nrkLogoNrkMp3 = ''\nexport const nrkLogoNrkNyheter = ''\nexport const nrkLogoNrkP1Pluss = ''\nexport const nrkLogoNrkP1 = ''\nexport const nrkLogoNrkP13Radioresepsjonen = ''\nexport const nrkLogoNrkP13 = ''\nexport const nrkLogoNrkP2 = ''\nexport const nrkLogoNrkP3NationalRapShow = ''\nexport const nrkLogoNrkP3Symbol = ''\nexport const nrkLogoNrkP3Urort = ''\nexport const nrkLogoNrkP3X = ''\nexport const nrkLogoNrkP3 = ''\nexport const nrkLogoNrkRadio = ''\nexport const nrkLogoNrkSapmi = ''\nexport const nrkLogoNrkSport = ''\nexport const nrkLogoNrkSuperSentrert = ''\nexport const nrkLogoNrkSuperSymbol = ''\nexport const nrkLogoNrkSuper = ''\nexport const nrkLogoNrkTegnspraakColorblack = ''\nexport const nrkLogoNrkTegnspraakColorgrey = ''\nexport const nrkLogoNrkTegnspraakColorwhite = ''\nexport const nrkLogoNrkTegnspraak = ''\nexport const nrkLogoNrkTv = ''\nexport const nrkLogoNrk = ''\nexport const nrkLogoYr = ''\nexport const nrkLongreadActive = ''\nexport const nrkLongread = ''\nexport const nrkMat = ''\nexport const nrkMedia404Notfound = ''\nexport const nrkMediaAirplayActive = ''\nexport const nrkMediaAirplay = ''\nexport const nrkMediaChromecastActive = ''\nexport const nrkMediaChromecast = ''\nexport const nrkMediaDirekteActive = ''\nexport const nrkMediaDirekte = ''\nexport const nrkMediaDirektetv = ''\nexport const nrkMediaFfw15sec = ''\nexport const nrkMediaFfw30sec = ''\nexport const nrkMediaFfw = ''\nexport const nrkMediaNext = ''\nexport const nrkMediaPause = ''\nexport const nrkMediaPictureInPictureActive = ''\nexport const nrkMediaPictureInPicture = ''\nexport const nrkMediaPlayFail = ''\nexport const nrkMediaPlay = ''\nexport const nrkMediaPrevious = ''\nexport const nrkMediaProgramguide = ''\nexport const nrkMediaRwd15sec = ''\nexport const nrkMediaRwd30sec = ''\nexport const nrkMediaRwd = ''\nexport const nrkMediaStop = ''\nexport const nrkMediaSubtitlesActive = ''\nexport const nrkMediaSubtitlesUnavailable = ''\nexport const nrkMediaSubtitles = ''\nexport const nrkMediaTheaterActive = ''\nexport const nrkMediaTheater = ''\nexport const nrkMediaTilgjengelighetGeoblocked = ''\nexport const nrkMediaTilgjengelighetIkkelengertilgjengelig = ''\nexport const nrkMediaTilgjengelighetKommer = ''\nexport const nrkMediaVolume1 = ''\nexport const nrkMediaVolume2 = ''\nexport const nrkMediaVolume3 = ''\nexport const nrkMediaVolumeMuted = ''\nexport const nrkMening = ''\nexport const nrkMinus = ''\nexport const nrkOffline = ''\nexport const nrkOpenInNew = ''\nexport const nrkPlus = ''\nexport const nrkPoll = ''\nexport const nrkReload = ''\nexport const nrkSearch = ''\nexport const nrkSettingsActive = ''\nexport const nrkSettings = ''\nexport const nrkSomeEmail = ''\nexport const nrkSomeEmbed = ''\nexport const nrkSomeFacebook = ''\nexport const nrkSomeGoogle = ''\nexport const nrkSomeInstagram = ''\nexport const nrkSomeShare = ''\nexport const nrkSomeSnapchat = ''\nexport const nrkSomeTommeloppActive = ''\nexport const nrkSomeTommelopp = ''\nexport const nrkSomeTwitter = ''\nexport const nrkSomeYoutube = ''\nexport const nrkSpinner = ''\nexport const nrkStarActive = ''\nexport const nrkStar = ''\nexport const nrkTilgjengelighetHorbarhet = ''\nexport const nrkTilgjengelighetLydtekst = ''\nexport const nrkTilgjengelighetSynstolking = ''\nexport const nrkTilgjengelighetTegnspraak = ''\nexport const nrkTilgjengelighet = ''\nexport const nrkUpload = ''\nexport const nrkUserLoggedin = ''\nexport const nrkUserNotloggedin = ''\nexport const nrkWarning = ''"],"names":["IS_BROWSER","window","IS_ANDROID","test","navigator","userAgent","IS_IOS","String","platform","HAS_EVENT_OPTIONS","has","addEventListener","passive","e","addEvent","uuid","type","handler","options","Boolean","capture","document","IGNORE","dispatchEvent","element","name","detail","event","ignore","CustomEvent","bubbles","cancelable","createEvent","initCustomEvent","result","getUUID","el","Date","now","toString","Math","random","slice","queryAll","elements","context","nodeType","call","querySelectorAll","length","UUID","replace","ARIA","KEYS","getContentElement","toggle","getElementById","getAttribute","nextElementSibling","setOpen","open","content","isOpen","willOpen","nextOpen","relatedTarget","focus","querySelector","setTimeout","setAttribute","keyCode","target","parentElement","id","preventDefault","ref","defaultPrevented","item","nodeName","hasAttribute","currentTarget","value","textContent","trim","forEach","popup","contains","toggles","documentElement","style","cursor","map","hasOwnProperty","innerHTML","connect","callback","const","key","undefined","q","push","arguments","src","script","createElement","async","head","appendChild","loadOnce","dark","minimal","search","login","coreToggle","loginLink","user","span","canReplaceState","history","replaceState","isAutoLogin","location","indexOf","banner","body","insertAdjacentElement","className","removeChild","href","state","title","removeAttribute"],"mappings":"iDAEA,IAGIA,EAA+B,oBAAXC,OACpBC,EAAaF,GAAc,aAAaG,KAAKC,UAAUC,WACvDC,EAASN,GAAc,mBAA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