{"version":3,"file":"Main.js","sources":["../../Private/Assets/Helper/MediaInit.js","../../Private/Assets/Helper/triggerEvent.js","../../Private/Assets/Audio/Embed.js","../../Private/Assets/Helper/addEvent.js","../../Private/Assets/Helper/getAriaLabel.js","../../Private/Assets/Video/Embed.js","../../Private/Assets/Helper/Lightbox.js","../../Private/Assets/Video/Lightbox.js","../../Private/Assets/Helper/iFrame.js","../../Private/Assets/Youtube/Preview.js","../../Private/Assets/Vimeo/Embed.js","../../Private/Assets/Vimeo/Lightbox.js","../../Private/Assets/Youtube/Embed.js","../../Private/Assets/Youtube/Lightbox.js"],"sourcesContent":["const BASE = 'jonnitto-prettyembed';\nconst INIT_CLASS = `${BASE}--init`;\nconst SLIM_CLASS = `${BASE}--slim`;\nconst PLAY_CLASS = `${BASE}--play`;\n\nconst VIDEOS = Array.from(document.querySelectorAll(`.${BASE}--video video:not([autoplay])`));\nconst AUDIOS = Array.from(document.querySelectorAll(`.${BASE}--audio audio:not([autoplay])`));\nconst ELEMENTS = [].concat(VIDEOS, AUDIOS);\n\nfunction init(element, autoplay = true, callback) {\n    const CLASS_LIST = element.parentNode.classList;\n    if (CLASS_LIST.contains(INIT_CLASS)) {\n        return;\n    }\n\n    if (typeof callback == 'function') {\n        callback();\n    }\n\n    if (element.hasAttribute('data-controls')) {\n        element.setAttribute('controls', true);\n    }\n\n    if (!element.hasAttribute('controls')) {\n        CLASS_LIST.add(SLIM_CLASS);\n        element.addEventListener('click', () => {\n            const play = !CLASS_LIST.contains(PLAY_CLASS);\n            CLASS_LIST[play ? 'add' : 'remove'](PLAY_CLASS);\n            if (play) {\n                element.play();\n            } else {\n                element.pause();\n            }\n        });\n    }\n\n    if (element.hasAttribute('data-streaming')) {\n        const SRC = element.getAttribute('data-streaming');\n        if (element.canPlayType('application/vnd.apple.mpegurl')) {\n            element.src = SRC;\n            addClassAndPlay(element, autoplay, CLASS_LIST);\n        } else {\n            if (typeof Hls === 'undefined') {\n                const HLS_SCRIPT = document.createElement('script');\n                HLS_SCRIPT.src = '/_Resources/Static/Packages/Jonnitto.PrettyEmbedHelper/Scripts/Hls.js?v=1';\n                document.head.appendChild(HLS_SCRIPT);\n                HLS_SCRIPT.addEventListener('load', () => {\n                    setTimeout(() => {\n                        loadHls(element, SRC);\n                        addClassAndPlay(element, autoplay, CLASS_LIST);\n                    }, 100);\n                });\n            } else {\n                loadHls(element, SRC);\n                addClassAndPlay(element, autoplay, CLASS_LIST);\n            }\n        }\n    } else {\n        addClassAndPlay(element, autoplay, CLASS_LIST);\n    }\n}\n\nfunction addClassAndPlay(element, autoplay, classList) {\n    classList.add(INIT_CLASS);\n    if (autoplay) {\n        classList.add(PLAY_CLASS);\n        setTimeout(() => {\n            element.play();\n        }, 0);\n    }\n}\n\nfunction pause(elements = ELEMENTS, current = null) {\n    elements.forEach((element) => {\n        if (element != current) {\n            if (!element.hasAttribute('controls')) {\n                element.parentNode.classList.remove(PLAY_CLASS);\n            }\n            element.pause();\n        }\n    });\n}\n\nfunction loadHls(element, src) {\n    if (Hls.isSupported()) {\n        const HLS = new Hls();\n        HLS.loadSource(src);\n        HLS.attachMedia(element);\n    }\n}\n\nELEMENTS.forEach((element) => {\n    element.addEventListener('play', (event) => {\n        pause(ELEMENTS, event.target);\n    });\n});\n\nexport { init, pause };\n","export default function (options) {\n    let event;\n    if (!options) {\n        options = {};\n    }\n    if (window.CustomEvent) {\n        event = new CustomEvent('prettyembed', { detail: options });\n    } else {\n        event = document.createEvent('CustomEvent');\n        event.initCustomEvent('prettyembed', true, true, options);\n    }\n    document.dispatchEvent(event);\n}\n","import { init } from '../Helper/MediaInit';\nimport triggerEvent from '../Helper/triggerEvent';\n\nconst elements = document.querySelectorAll('.jonnitto-prettyembed--audio audio');\nArray.from(elements).forEach((element) => {\n    init(element, false);\n    triggerEvent({\n        type: 'audio',\n        style: 'inline',\n        src: (() => {\n            const SOURCE = element.querySelector('source');\n            return SOURCE ? SOURCE.src : null;\n        })(),\n    });\n});\n","function matches(element, selector) {\n    return (\n        element.matches ||\n        element.matchesSelector ||\n        element.msMatchesSelector ||\n        element.mozMatchesSelector ||\n        element.webkitMatchesSelector ||\n        element.oMatchesSelector\n    ).call(element, selector);\n}\n\nfunction closest(element, selector) {\n    let ancestor = element;\n\n    do {\n        if (matches(ancestor, selector)) {\n            return ancestor;\n        }\n        ancestor = ancestor.parentElement || ancestor.parentNode;\n    } while (ancestor !== null && ancestor.nodeType === 1);\n    return null;\n}\n\nexport default function (selector, callback) {\n    document.documentElement.addEventListener('click', (event) => {\n        const ELEMENT = closest(event.target, selector);\n        if (!ELEMENT || typeof callback != 'function') {\n            return;\n        }\n        callback.call(ELEMENT, event);\n    });\n}\n","export default function (node) {\n    return node.getAttribute('aria-label');\n}\n","import { init } from '../Helper/MediaInit';\nimport addEvent from '../Helper/addEvent';\nimport triggerEvent from '../Helper/triggerEvent';\nimport getAriaLabel from '../Helper/getAriaLabel';\n\nconst SELECTOR = '.jonnitto-prettyembed--video.jonnitto-prettyembed--inline video';\n\naddEvent(SELECTOR, function (event) {\n    event.preventDefault();\n    init(this, true, () => {\n        triggerEvent({\n            type: 'video',\n            style: 'inline',\n            title: getAriaLabel(this),\n            src: (() => {\n                const SOURCE = this.querySelector('source');\n                return SOURCE ? SOURCE.src : null;\n            })(),\n        });\n    });\n});\n","import addEvent from './addEvent';\n\nconst HTML_ELEMENT = document.documentElement;\nconst BODY_ELEMENT = document.body;\nconst BASE_CLASS = 'jonnitto-prettyembed';\nconst LIGHTBOX_CLASS = `${BASE_CLASS}__lightbox`;\nconst ID = LIGHTBOX_CLASS;\nconst VISIBLE_CLASS = `-${LIGHTBOX_CLASS}`;\nconst VISIBLE_CLASS_LIST = HTML_ELEMENT.classList;\nconst INNER_CLASS = `${BASE_CLASS}__inner`;\nconst CLOSE_CLASS = `${BASE_CLASS}__close`;\nconst CONTENT_CLASS = `${BASE_CLASS}__content`;\nconst LIGHTBOX = document.createElement('div');\n\nLIGHTBOX.className = LIGHTBOX_CLASS;\nLIGHTBOX.innerHTML = `\n<div class=\"${INNER_CLASS}\">\n    <button type=\"button\" class=\"${CLOSE_CLASS}\">&times;</button>\n    <div id=\"${ID}\" class=\"${BASE_CLASS} ${CONTENT_CLASS}\"></div>\n</div>`;\n\nlet lighboxContent = false;\nlet timeout = null;\n\nfunction resetContent() {\n    // Reset the content to the default class\n    lighboxContent.className = `${BASE_CLASS} ${CONTENT_CLASS}`;\n    // Remove style attribute\n    lighboxContent.removeAttribute('style');\n    // Clear all content\n    lighboxContent.innerHTML = '';\n}\n\nfunction get(type, paddingTop) {\n    if (!lighboxContent) {\n        BODY_ELEMENT.appendChild(LIGHTBOX);\n        lighboxContent = document.getElementById(ID);\n    }\n    resetContent();\n    if (typeof type != 'object') {\n        type = type ? [type] : [];\n    }\n    type.forEach((item) => {\n        lighboxContent.classList.add(`${BASE_CLASS}--${item}`);\n    });\n\n    if (paddingTop) {\n        lighboxContent.style.paddingTop = paddingTop;\n    }\n    return lighboxContent;\n}\n\nfunction show(callback) {\n    clearTimeout(timeout);\n    timeout = setTimeout(function () {\n        if (typeof callback == 'function') {\n            callback();\n        }\n        VISIBLE_CLASS_LIST.add(VISIBLE_CLASS);\n    }, 100);\n}\n\nfunction closeLighbox() {\n    VISIBLE_CLASS_LIST.remove(VISIBLE_CLASS);\n    if (lighboxContent) {\n        clearTimeout(timeout);\n        timeout = setTimeout(resetContent, 300);\n    }\n}\n\nfunction closeLighboxOnESC(event) {\n    if (event.keyCode == 27) {\n        if (VISIBLE_CLASS_LIST.contains(VISIBLE_CLASS)) {\n            closeLighbox();\n        }\n    }\n}\n\nfunction init(selector, callback) {\n    if (typeof callback == 'function' && typeof selector == 'string') {\n        addEvent(selector, callback);\n    }\n}\n\n// Catch click event to prevent closing lightbox if some clicks on content\naddEvent(`.${CONTENT_CLASS}`, (event) => {\n    event.stopImmediatePropagation();\n});\n\n// Close lightbox on click on lightbox background or on close button\naddEvent(`.${LIGHTBOX_CLASS}`, closeLighbox);\naddEvent(`.${CLOSE_CLASS}`, closeLighbox);\n\n// Close on ESC\nHTML_ELEMENT.addEventListener('keyup', closeLighboxOnESC);\n\nexport { get, show, init };\n","import * as video from '../Helper/MediaInit';\nimport * as lightbox from '../Helper/Lightbox';\nimport triggerEvent from '../Helper/triggerEvent';\nimport getAriaLabel from '../Helper/getAriaLabel';\n\nconst BASE_CLASS = 'jonnitto-prettyembed';\nconst SELECTOR_CLASS = `.${BASE_CLASS}--video.${BASE_CLASS}--lightbox video`;\nlet timeout;\n\nlightbox.init(SELECTOR_CLASS, function (event) {\n    event.preventDefault();\n    clearTimeout(timeout);\n    video.pause();\n    const VIDEO_NODE = lightbox.get('video', false).appendChild(this.cloneNode(true));\n    if (this.dataset.controls == undefined) {\n        // As we have no controls, we need to add also the play and pause button\n        Array.from(this.parentNode.children).forEach((element) => {\n            if (element != this && !element.classList.contains(`${BASE_CLASS}__preview`)) {\n                VIDEO_NODE.parentNode.appendChild(element.cloneNode(true));\n            }\n        });\n    }\n    lightbox.show(() => {\n        video.init(VIDEO_NODE);\n        if (!this.dataset.init) {\n            this.dataset.init = true;\n            triggerEvent({\n                type: 'video',\n                style: 'lightbox',\n                title: getAriaLabel(this),\n                src: (() => {\n                    const SOURCE = this.querySelector('source');\n                    return SOURCE ? SOURCE.src : null;\n                })(),\n            });\n        }\n    });\n\n    timeout = setTimeout(function () {\n        // Make sure the VIDEO_NODE start playing\n        VIDEO_NODE.play();\n    }, 500);\n});\n","import addEvent from './addEvent';\nimport triggerEvent from './triggerEvent';\nimport getAriaLabel from './getAriaLabel';\nimport * as lightboxHelper from '../Helper/Lightbox';\n\nconst BASE = 'jonnitto-prettyembed';\n\nfunction markup(node) {\n    const DATA = node.dataset;\n    const FULLSCREEN = DATA.fs != null;\n    if (!DATA.embed) {\n        return false;\n    }\n\n    return `<iframe src=\"${DATA.embed}\" ${FULLSCREEN ? 'allowfullscreen ' : ''}frameborder=\"0\" allow=\"${\n        FULLSCREEN ? 'fullscreen; ' : ''\n    }accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"></iframe>`;\n}\n\nfunction replace(element, tagName) {\n    if (typeof element === 'object' && typeof tagName === 'string') {\n        const ORIGINAL_ELEMENT = element;\n        const ORIGINAL_TAG = ORIGINAL_ELEMENT.tagName;\n        const START_RX = new RegExp('^<' + ORIGINAL_TAG, 'i');\n        const END_RX = new RegExp(ORIGINAL_TAG + '>$', 'i');\n        const START_SUBST = '<' + tagName;\n        const END_SUBST = tagName + '>';\n        const WRAPPER = document.createElement('div');\n        WRAPPER.innerHTML = ORIGINAL_ELEMENT.outerHTML.replace(START_RX, START_SUBST).replace(END_RX, END_SUBST);\n        const NEW_ELEMENT = WRAPPER.firstChild;\n        element.parentNode.replaceChild(NEW_ELEMENT, element);\n        return NEW_ELEMENT;\n    }\n}\n\nfunction getImage(node) {\n    const IMAGE = node.querySelector('img');\n    return {\n        node: IMAGE || null,\n        src: IMAGE ? IMAGE.getAttribute('src') : null,\n    };\n}\n\nfunction getPaddingTop(node, fallback = '56.25%') {\n    // 56.25% is a 16:9 in percent\n\n    if (node.dataset.ratio) {\n        return node.dataset.ratio;\n    }\n\n    const IMAGE = getImage(node);\n    if (!IMAGE.node) {\n        return fallback;\n    }\n    const RATIO = (parseInt(IMAGE.node.naturalHeight) / parseInt(IMAGE.node.naturalWidth)) * 100;\n    if (typeof RATIO != 'number') {\n        return fallback;\n    }\n    return RATIO + '%';\n}\n\nfunction write(link, playClass, type) {\n    if (checkGdpr(link, type)) {\n        const IFRAME = markup(link);\n        const IMAGE = getImage(link);\n        if (!IFRAME) {\n            return;\n        }\n        const ELEMENT = replace(link, 'div');\n        ELEMENT.classList.add(playClass);\n        ELEMENT.style.paddingTop = getPaddingTop(link);\n        ELEMENT.innerHTML = IFRAME;\n\n        if (IMAGE.src) {\n            ELEMENT.setAttribute('data-img', IMAGE.src);\n        }\n        triggerEvent({\n            type: type,\n            style: 'inline',\n            title: getAriaLabel(link),\n            src: link.dataset.embed,\n        });\n    }\n}\n\nfunction checkGdpr(element, type) {\n    const GDPR = element.dataset.gdpr;\n\n    if (!GDPR) {\n        return true;\n    }\n    console.log({ GDPR });\n    const LOCAL_STORAGE = window.localStorage;\n    const STORAGE_KEY = `jonnittoprettyembed_gdpr_${type}`;\n\n    if (LOCAL_STORAGE[STORAGE_KEY] === 'true' || confirm(GDPR)) {\n        element.removeAttribute('data-gdpr');\n        LOCAL_STORAGE[STORAGE_KEY] = 'true';\n        return true;\n    }\n    return false;\n}\n\nfunction restore(element, playClass) {\n    const IMAGE = element.getAttribute('data-img') || false;\n    if (IMAGE) {\n        element.classList.remove(playClass);\n        element.removeAttribute('style');\n        element.innerHTML = `<img src=\"${IMAGE}\" />`;\n        replace(element, 'a');\n    }\n}\n\nfunction lightbox(type) {\n    const SELECTOR = `a.${BASE}--${type}.${BASE}--lightbox`;\n\n    lightboxHelper.init(SELECTOR, function (event) {\n        const HTML = markup(this);\n        if (HTML) {\n            event.preventDefault();\n            if (checkGdpr(this, type)) {\n                const PADDING_TOP = getPaddingTop(this);\n                lightboxHelper.get([type, 'iframe'], PADDING_TOP).innerHTML = HTML;\n                lightboxHelper.show(() => {\n                    if (!this.dataset.init) {\n                        this.dataset.init = true;\n                        triggerEvent({\n                            type: type,\n                            style: 'lightbox',\n                            title: getAriaLabel(this),\n                            src: this.dataset.embed,\n                        });\n                    }\n                });\n            }\n        }\n    });\n}\n\nfunction embed(type) {\n    const SELECTOR = `a.${BASE}--${type}.${BASE}--inline`;\n    const PLAY_CLASS = `${BASE}--play`;\n\n    addEvent(SELECTOR, function (event) {\n        event.preventDefault();\n        write(this, PLAY_CLASS, type);\n    });\n}\n\nexport { markup, replace, write, restore, lightbox, embed };\n","function fixPreview(img) {\n    let src = img.getAttribute('src');\n    if (img.naturalHeight <= 90 && img.naturalWidth <= 120 && src.indexOf('/default.jpg') == -1) {\n        src = src\n            .replace('mqdefault', 'default')\n            .replace('hqdefault', 'mqdefault')\n            .replace('sddefault', 'hqdefault')\n            .replace('maxresdefault', 'sddefault');\n        img.setAttribute('src', src);\n        setTimeout(() => {\n            img.onload = () => {\n                fixPreview(img);\n            };\n        }, 10);\n        setTimeout(() => {\n            fixPreview(img);\n        }, 5000);\n    }\n}\n\nfunction fixPreviews(images) {\n    if (typeof images === 'undefined') {\n        images = document.querySelectorAll('img.jonnitto-prettyembed__youtube-preview');\n    }\n    for (let i = images.length - 1; i >= 0; i--) {\n        fixPreview(images[i]);\n    }\n}\n\nwindow.addEventListener('load', () => {\n    fixPreviews();\n});\n","import { embed } from '../Helper/iFrame';\n\nembed('vimeo');\n","import { lightbox } from '../Helper/iFrame';\n\nlightbox('vimeo');\n","import { embed } from '../Helper/iFrame';\n\nembed('youtube');\n","import { lightbox } from '../Helper/iFrame';\n\nlightbox('youtube');\n"],"names":["BASE","INIT_CLASS","SLIM_CLASS","PLAY_CLASS","VIDEOS","Array","from","document","querySelectorAll","concat","AUDIOS","ELEMENTS","init","element","autoplay","callback","arguments","length","undefined","CLASS_LIST","parentNode","classList","contains","hasAttribute","setAttribute","add","addEventListener","play","pause","SRC","getAttribute","canPlayType","src","addClassAndPlay","Hls","HLS_SCRIPT","createElement","head","appendChild","setTimeout","loadHls","elements","current","forEach","remove","isSupported","HLS","loadSource","attachMedia","triggerEvent","options","event","window","CustomEvent","detail","createEvent","initCustomEvent","dispatchEvent","target","matches","selector","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","call","addEvent","documentElement","ELEMENT","ancestor","parentElement","nodeType","closest","getAriaLabel","node","SOURCE","type","style","querySelector","_this","this","preventDefault","title","HTML_ELEMENT","BODY_ELEMENT","body","BASE_CLASS","LIGHTBOX_CLASS","ID","VISIBLE_CLASS","VISIBLE_CLASS_LIST","INNER_CLASS","CLOSE_CLASS","CONTENT_CLASS","LIGHTBOX","className","innerHTML","lighboxContent","timeout","resetContent","removeAttribute","get","paddingTop","getElementById","_typeof","item","show","clearTimeout","closeLighbox","stopImmediatePropagation","keyCode","lightbox","video","VIDEO_NODE","cloneNode","dataset","controls","children","markup","DATA","FULLSCREEN","fs","embed","getImage","IMAGE","getPaddingTop","fallback","ratio","RATIO","parseInt","naturalHeight","naturalWidth","write","link","playClass","checkGdpr","IFRAME","tagName","ORIGINAL_ELEMENT","ORIGINAL_TAG","START_RX","RegExp","END_RX","START_SUBST","END_SUBST","WRAPPER","outerHTML","replace","NEW_ELEMENT","firstChild","replaceChild","GDPR","gdpr","console","log","LOCAL_STORAGE","localStorage","STORAGE_KEY","confirm","lightboxHelper","HTML","PADDING_TOP","SELECTOR","fixPreview","img","indexOf","onload","images","i","fixPreviews"],"mappings":";;;;;;yBAAA,IAAMA,EAAO,uBACPC,EAAgBD,GAAAA,OAAAA,EAAtB,UACME,EAAgBF,GAAAA,OAAAA,EAAtB,UACMG,EAAgBH,GAAAA,OAAAA,EAAtB,UAEMI,EAASC,MAAMC,KAAKC,SAASC,iBAAT,IAAAC,OAA8BT,EAA9B,mCACpBU,EAASL,MAAMC,KAAKC,SAASC,iBAAT,IAAAC,OAA8BT,EAA9B,mCACpBW,EAAW,GAAGF,OAAOL,EAAQM,GAEnC,SAASE,EAAKC,GAASC,IAAAA,6DAAiBC,EAAUC,UAAAC,OAAA,EAAAD,UAAA,QAAAE,EACxCC,EAAaN,EAAQO,WAAWC,UACtC,IAAIF,EAAWG,SAASrB,GAyBxB,GArBuB,mBAAZc,GACPA,IAGAF,EAAQU,aAAa,kBACrBV,EAAQW,aAAa,YAAY,GAGhCX,EAAQU,aAAa,cACtBJ,EAAWM,IAAIvB,GACfW,EAAQa,iBAAiB,SAAS,WACxBC,IAAAA,GAAQR,EAAWG,SAASnB,GAClCgB,EAAWQ,EAAO,MAAQ,UAAUxB,GAChCwB,EACAd,EAAQc,OAERd,EAAQe,YAKhBf,EAAQU,aAAa,kBAAmB,CACxC,IAAMM,EAAMhB,EAAQiB,aAAa,kBACjC,GAAIjB,EAAQkB,YAAY,iCACpBlB,EAAQmB,IAAMH,EACdI,EAAgBpB,EAASC,EAAUK,QAEnC,GAAmB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