diff --git a/pr-preview/pr-48/assets/countdown-CZs5Inhq.js.map b/pr-preview/pr-48/assets/countdown-CZs5Inhq.js.map index bd0185e..833c9bf 100644 --- a/pr-preview/pr-48/assets/countdown-CZs5Inhq.js.map +++ b/pr-preview/pr-48/assets/countdown-CZs5Inhq.js.map @@ -1 +1 @@ -{"version":3,"file":"countdown-CZs5Inhq.js","sources":["../../static/showcases/countdown.html?html-proxy&index=0.js","../../static/showcases/countdown.html?html-proxy&index=1.js"],"sourcesContent":["\n // Import the pillarbox library\n import pillarbox from '@srgssr/pillarbox-web';\n\n const ModalDialog = pillarbox.getComponent('ModalDialog');\n\n /**\n * Provides a countdown timer functionality within a modal dialog.\n */\n class Countdown extends ModalDialog {\n /**\n * Creates an instance of Countdown.\n *\n * @param {Player} player The video.js player instance\n * @param {Object} options Configuration options for the modal dialog\n */\n constructor(player, options) {\n const opts = pillarbox.obj.merge(options, {\n pauseOnOpen: false,\n fillAlways: true,\n temporary: false,\n uncloseable: true\n });\n\n super(player, opts);\n\n this.intervalId = undefined;\n this.reset = this.reset.bind(this);\n\n this.on(player, ['loadstart', 'playerreset', 'dispose', 'error'], this.reset);\n }\n\n /**\n * The CSS class name for the countdown modal dialog.\n *\n * @returns {string} The CSS class name\n */\n buildCSSClass() {\n return `pillarbox-countdown ${super.buildCSSClass()}`;\n }\n\n /**\n * Disposes of the countdown component.\n *\n * Cleans up any resources and event listeners.\n */\n dispose() {\n this.reset();\n this.off(this.player(), ['loadstart', 'playerreset', 'dispose', 'error'], this.reset);\n\n super.dispose();\n }\n\n /**\n * Resets the countdown timer.\n *\n * Clears the interval, closes the modal, and empties its content.\n */\n reset() {\n this.clearInterval(this.intervalId);\n this.close();\n this.empty();\n\n this.intervalId = undefined;\n }\n\n /**\n * Starts the countdown timer.\n *\n * @param {number} timestamp The target timestamp in milliseconds\n * @param {string} source The source to play when the countdown ends\n *\n * @returns {boolean} True if the countdown started successfully\n */\n start(timestamp, source) {\n this.reset();\n\n if (typeof timestamp !== 'number') return;\n\n this.intervalId = this.setInterval(() => {\n const remainingDuration = this.remainingDuration(timestamp);\n\n if (remainingDuration.totalInMilliseconds <= 0) {\n this.reset();\n this.player().src(source);\n\n return;\n }\n\n this.fillWith(`${remainingDuration.days\n }d ${remainingDuration.hours\n }h ${remainingDuration.minutes\n }m ${remainingDuration.seconds\n }s remaining`);\n }, 1_000);\n\n this.open();\n\n return true;\n }\n\n /**\n * The remaining duration until the target timestamp.\n *\n * @param {number} timestamp The target timestamp in milliseconds\n *\n * @returns {Object} An object containing the remaining days, hours, minutes, seconds, and total in milliseconds\n */\n remainingDuration(timestamp) {\n const SECONDS_IN_MS = 1_000;\n const MINUTES = 60 * SECONDS_IN_MS;\n const HOURS = 60 * MINUTES;\n const DAYS = 24 * HOURS;\n const totalInMilliseconds = timestamp - Date.now();\n\n let diff = totalInMilliseconds;\n // Calculate days, hours, minutes, and seconds\n let days = Math.floor(diff / (DAYS));\n diff -= days * (DAYS);\n\n let hours = Math.floor(diff / (HOURS));\n diff -= hours * (HOURS);\n\n let minutes = Math.floor(diff / (MINUTES));\n diff -= minutes * (MINUTES);\n\n let seconds = Math.floor(diff / SECONDS_IN_MS);\n\n return {\n days: days.toString().padStart(2, '0'),\n hours: hours.toString().padStart(2, '0'),\n minutes: minutes.toString().padStart(2, '0'),\n seconds: seconds.toString().padStart(2, '0'),\n totalInMilliseconds\n }\n }\n }\n\n // Register Countdown component\n pillarbox.registerComponent('Countdown', Countdown);\n\n // Create a pillarbox player instance with the currentChapter plugin\n const player = pillarbox(\n 'video-element-id',\n {\n fill: true,\n // Add the countdown component to the player\n countdown: true,\n }\n );\n\n // Listen for player errors\n player.on('error', () => {\n // Get the metadata associated with the error\n const { metadata = {} } = player.error() || {};\n\n // If the error is not of type STARTDATE we do nothing\n if (metadata.errorType !== 'STARTDATE') return;\n\n // Extract the validFrom property from the mediaData\n const {\n src: {\n mediaData: {\n chapters: [{ validFrom } = {}] = []\n } = {}\n } = {}\n } = metadata;\n const timestamp = new Date(validFrom).getTime();\n\n if (!player.countdown.start(timestamp, player.currentSource())) return;\n\n // Closes error display component to prevent overlapping\n if (player.errorDisplay && player.errorDisplay.opened()) {\n player.errorDisplay.close();\n }\n });\n\n // In the absence of media generating a STARTDATE error, this function\n // manually activates the countdown\n player.countdown.start(Date.now() + 5_977_235_000, { src: 'urn:rts:video:10894383', type: 'srgssr/urn' });\n\n // If a media sends a STARTDATE error, the countdown is automatically\n // activated, since the logic for activating the countdown is handled by\n // the error event handler\n // player.src({ src: 'urn:rts:video:10894383', type: 'srgssr/urn' });\n\n window.player = player;\n ","\n import pillarbox from '@srgssr/pillarbox-web';\n import '../../src/layout/header/core-demo-header-component.js';\n\n document.querySelector('#close-btn').addEventListener('click', () => {\n window.close();\n });\n\n window.pillarbox = pillarbox;\n "],"names":["ModalDialog","pillarbox","Countdown","player","options","opts","timestamp","source","remainingDuration","totalInMilliseconds","diff","days","hours","minutes","seconds","metadata","validFrom"],"mappings":"6DAIM,MAAMA,EAAcC,EAAU,aAAa,aAAa,EAKxD,MAAMC,UAAkBF,CAAY,CAOlC,YAAYG,EAAQC,EAAS,CAC3B,MAAMC,EAAOJ,EAAU,IAAI,MAAMG,EAAS,CACxC,YAAa,GACb,WAAY,GACZ,UAAW,GACX,YAAa,EACzB,CAAW,EAED,MAAMD,EAAQE,CAAI,EAElB,KAAK,WAAa,OAClB,KAAK,MAAQ,KAAK,MAAM,KAAK,IAAI,EAEjC,KAAK,GAAGF,EAAQ,CAAC,YAAa,cAAe,UAAW,OAAO,EAAG,KAAK,KAAK,CACtF,CAOQ,eAAgB,CACd,MAAO,uBAAuB,MAAM,cAAe,CAAA,EAC7D,CAOQ,SAAU,CACR,KAAK,MAAO,EACZ,KAAK,IAAI,KAAK,OAAQ,EAAE,CAAC,YAAa,cAAe,UAAW,OAAO,EAAG,KAAK,KAAK,EAEpF,MAAM,QAAS,CACzB,CAOQ,OAAQ,CACN,KAAK,cAAc,KAAK,UAAU,EAClC,KAAK,MAAO,EAC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AG9C,GAAIY,EAAS,YAAc,YAAa,OAGxC,KAAM,CACJ,IAAK,CACH,UAAW,CACT,SAAU,CAAC,CAAE,UAAAC,CAAW,EAAG,CAAE,CAAA,EAAI,CAAA,CAC/C,EAAgB,CAAA,CAChB,EAAc,CAAA,CACd,EAAYD,EACET,EAAY,IAAI,KAAKU,CAAS,EAAE,QAAS,EAE1Cb,EAAO,UAAU,MAAMG,EAAWH,EAAO,cAAa,CAAE,GAGzDA,EAAO,cAAgBA,EAAO,aAAa,OAAM,GACnDA,EAAO,aAAa,MAAO,CAErC,CAAO,EAIDA,EAAO,UAAU,MAAM,KAAK,IAAK,EAAG,UAAe,CAAE,IAAK,yBAA0B,KAAM,YAAY,CAAE,EAOxG,OAAO,OAASA,ECtLhB,SAAS,cAAc,YAAY,EAAE,iBAAiB,QAAS,IAAM,CACnE,OAAO,MAAO,CACtB,CAAO,EAED,OAAO,UAAYF"} \ No newline at end of file +{"version":3,"file":"countdown-CZs5Inhq.js","sources":["../../static/showcases/countdown.html?html-proxy&index=0.js","../../static/showcases/countdown.html?html-proxy&index=1.js"],"sourcesContent":["\n // Import the pillarbox library\n import pillarbox from '@srgssr/pillarbox-web';\n\n const ModalDialog = pillarbox.getComponent('ModalDialog');\n\n /**\n * Provides a countdown timer functionality within a modal dialog.\n */\n class Countdown extends ModalDialog {\n /**\n * Creates an instance of Countdown.\n *\n * @param {Player} player The video.js player instance\n * @param {Object} options Configuration options for the modal dialog\n */\n constructor(player, options) {\n const opts = pillarbox.obj.merge(options, {\n pauseOnOpen: false,\n fillAlways: true,\n temporary: false,\n uncloseable: true\n });\n\n super(player, opts);\n\n this.intervalId = undefined;\n this.reset = this.reset.bind(this);\n\n this.on(player, ['loadstart', 'playerreset', 'dispose', 'error'], this.reset);\n }\n\n /**\n * The CSS class name for the countdown modal dialog.\n *\n * @returns {string} The CSS class name\n */\n buildCSSClass() {\n return `pillarbox-countdown ${super.buildCSSClass()}`;\n }\n\n /**\n * Disposes of the countdown component.\n *\n * Cleans up any resources and event listeners.\n */\n dispose() {\n this.reset();\n this.off(this.player(), ['loadstart', 'playerreset', 'dispose', 'error'], this.reset);\n\n super.dispose();\n }\n\n /**\n * Resets the countdown timer.\n *\n * Clears the interval, closes the modal, and empties its content.\n */\n reset() {\n this.clearInterval(this.intervalId);\n this.close();\n this.empty();\n\n this.intervalId = undefined;\n }\n\n /**\n * Starts the countdown timer.\n *\n * @param {number} timestamp The target timestamp in milliseconds\n * @param {string} source The source to play when the countdown ends\n *\n * @returns {boolean} True if the countdown started successfully\n */\n start(timestamp, source) {\n this.reset();\n\n if (typeof timestamp !== 'number') return;\n\n this.intervalId = this.setInterval(() => {\n const remainingDuration = this.remainingDuration(timestamp);\n\n if (remainingDuration.totalInMilliseconds <= 0) {\n this.reset();\n this.player().src(source);\n\n return;\n }\n\n this.fillWith(`${remainingDuration.days\n }d ${remainingDuration.hours\n }h ${remainingDuration.minutes\n }m ${remainingDuration.seconds\n }s remaining`);\n }, 1_000);\n\n this.open();\n\n return true;\n }\n\n /**\n * The remaining duration until the target timestamp.\n *\n * @param {number} timestamp The target timestamp in milliseconds\n *\n * @returns {Object} An object containing the remaining days, hours, minutes, seconds, and total in milliseconds\n */\n remainingDuration(timestamp) {\n const SECONDS_IN_MS = 1_000;\n const MINUTES = 60 * SECONDS_IN_MS;\n const HOURS = 60 * MINUTES;\n const DAYS = 24 * HOURS;\n const totalInMilliseconds = timestamp - Date.now();\n\n let diff = totalInMilliseconds;\n // Calculate days, hours, minutes, and seconds\n let days = Math.floor(diff / DAYS);\n diff -= days * DAYS;\n\n let hours = Math.floor(diff / HOURS);\n diff -= hours * HOURS;\n\n let minutes = Math.floor(diff / MINUTES);\n diff -= minutes * MINUTES;\n\n let seconds = Math.floor(diff / SECONDS_IN_MS);\n\n return {\n days: days.toString().padStart(2, '0'),\n hours: hours.toString().padStart(2, '0'),\n minutes: minutes.toString().padStart(2, '0'),\n seconds: seconds.toString().padStart(2, '0'),\n totalInMilliseconds\n }\n }\n }\n\n // Register Countdown component\n pillarbox.registerComponent('Countdown', Countdown);\n\n // Create a pillarbox player instance with the currentChapter plugin\n const player = pillarbox(\n 'video-element-id',\n {\n fill: true,\n // Add the countdown component to the player\n countdown: true,\n }\n );\n\n // Listen for player errors\n player.on('error', () => {\n // Get the metadata associated with the error\n const { metadata = {} } = player.error() || {};\n\n // If the error is not of type STARTDATE we do nothing\n if (metadata.errorType !== 'STARTDATE') return;\n\n // Extract the validFrom property from the mediaData\n const {\n src: {\n mediaData: {\n chapters: [{ validFrom } = {}] = []\n } = {}\n } = {}\n } = metadata;\n const timestamp = new Date(validFrom).getTime();\n\n if (!player.countdown.start(timestamp, player.currentSource())) return;\n\n // Closes error display component to prevent overlapping\n if (player.errorDisplay && player.errorDisplay.opened()) {\n player.errorDisplay.close();\n }\n });\n\n // In the absence of media generating a STARTDATE error, this function\n // manually activates the countdown\n player.countdown.start(Date.now() + 5_977_235_000, { src: 'urn:rts:video:10894383', type: 'srgssr/urn' });\n\n // If a media sends a STARTDATE error, the countdown is automatically\n // activated, since the logic for activating the countdown is handled by\n // the error event handler\n // player.src({ src: 'urn:rts:video:10894383', type: 'srgssr/urn' });\n\n window.player = player;\n ","\n import pillarbox from '@srgssr/pillarbox-web';\n import '../../src/layout/header/core-demo-header-component.js';\n\n document.querySelector('#close-btn').addEventListener('click', () => {\n window.close();\n });\n\n window.pillarbox = pillarbox;\n "],"names":["ModalDialog","pillarbox","Countdown","player","options","opts","timestamp","source","remainingDuration","totalInMilliseconds","diff","days","hours","minutes","seconds","metadata","validFrom"],"mappings":"6DAIM,MAAMA,EAAcC,EAAU,aAAa,aAAa,EAKxD,MAAMC,UAAkBF,CAAY,CAOlC,YAAYG,EAAQC,EAAS,CAC3B,MAAMC,EAAOJ,EAAU,IAAI,MAAMG,EAAS,CACxC,YAAa,GACb,WAAY,GACZ,UAAW,GACX,YAAa,EACzB,CAAW,EAED,MAAMD,EAAQE,CAAI,EAElB,KAAK,WAAa,OAClB,KAAK,MAA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AAG,SAAS,EAAG,GAAG,EACvC,QAASC,EAAQ,SAAQ,EAAG,SAAS,EAAG,GAAG,EAC3C,QAASC,EAAQ,SAAQ,EAAG,SAAS,EAAG,GAAG,EAC3C,oBAAAL,CACZ,CACA,CACA,CAGMR,EAAU,kBAAkB,YAAaC,CAAS,EAGlD,MAAMC,EAASF,EACb,mBACA,CACE,KAAM,GAEN,UAAW,EACrB,CACO,EAGDE,EAAO,GAAG,QAAS,IAAM,CAEvB,KAAM,CAAE,SAAAY,EAAW,CAAE,CAAA,EAAKZ,EAAO,MAAO,GAAI,CAAE,EAG9C,GAAIY,EAAS,YAAc,YAAa,OAGxC,KAAM,CACJ,IAAK,CACH,UAAW,CACT,SAAU,CAAC,CAAE,UAAAC,CAAW,EAAG,CAAE,CAAA,EAAI,CAAA,CAC/C,EAAgB,CAAA,CAChB,EAAc,CAAA,CACd,EAAYD,EACET,EAAY,IAAI,KAAKU,CAAS,EAAE,QAAS,EAE1Cb,EAAO,UAAU,MAAMG,EAAWH,EAAO,cAAa,CAAE,GAGzDA,EAAO,cAAgBA,EAAO,aAAa,OAAM,GACnDA,EAAO,aAAa,MAAO,CAErC,CAAO,EAIDA,EAAO,UAAU,MAAM,KAAK,IAAK,EAAG,UAAe,CAAE,IAAK,yBAA0B,KAAM,YAAY,CAAE,EAOxG,OAAO,OAASA,ECtLhB,SAAS,cAAc,YAAY,EAAE,iBAAiB,QAAS,IAAM,CACnE,OAAO,MAAO,CACtB,CAAO,EAED,OAAO,UAAYF"} \ No newline at end of file diff --git a/pr-preview/pr-48/assets/index-Drld_34e.js b/pr-preview/pr-48/assets/index-pkCQMwAg.js similarity index 99% rename from pr-preview/pr-48/assets/index-Drld_34e.js rename to pr-preview/pr-48/assets/index-pkCQMwAg.js index 8756b50..d650956 100644 --- a/pr-preview/pr-48/assets/index-Drld_34e.js +++ b/pr-preview/pr-48/assets/index-pkCQMwAg.js @@ -985,14 +985,14 @@ https://github.com/highlightjs/highlight.js/issues/2277`),C=c,w=f),h===void 0&&( let diff = totalInMilliseconds; // Calculate days, hours, minutes, and seconds - let days = Math.floor(diff / (DAYS)); - diff -= days * (DAYS); + let days = Math.floor(diff / DAYS); + diff -= days * DAYS; - let hours = Math.floor(diff / (HOURS)); - diff -= hours * (HOURS); + let hours = Math.floor(diff / HOURS); + diff -= hours * HOURS; - let minutes = Math.floor(diff / (MINUTES)); - diff -= minutes * (MINUTES); + let minutes = Math.floor(diff / MINUTES); + diff -= minutes * MINUTES; let seconds = Math.floor(diff / SECONDS_IN_MS); @@ -1244,4 +1244,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),C=c,w=f),h===void 0&&( `},x(It,"properties",{debug:{type:Boolean,state:!0}}),x(It,"styles",[q,B(Cr)]);customElements.define("demo-header",It);class Eo extends j{constructor(){super(),this.route=v.currentRoute,v.addEventListener("routechanged",({detail:{route:n}})=>{var e;(e=this.route)==null||e.destroy(),this.route=n})}render(){return nn(`<${this.route.component}>`)}}x(Eo,"properties",{route:{state:!0}});customElements.define("route-outlet",Eo);const et=Se.loadPreferences();P.host=et.dataProviderHost;v.start({defaultPath:"examples"});v.queryParams.debug?(et.debug=v.queryParams.debug==="true",Se.savePreferences(et)):et.debug&&v.updateState({debug:"true"}); -//# sourceMappingURL=index-Drld_34e.js.map +//# sourceMappingURL=index-pkCQMwAg.js.map diff --git a/pr-preview/pr-48/assets/index-Drld_34e.js.map b/pr-preview/pr-48/assets/index-pkCQMwAg.js.map similarity index 69% rename from pr-preview/pr-48/assets/index-Drld_34e.js.map rename to pr-preview/pr-48/assets/index-pkCQMwAg.js.map index 222f62a..329cd4b 100644 --- a/pr-preview/pr-48/assets/index-Drld_34e.js.map +++ b/pr-preview/pr-48/assets/index-pkCQMwAg.js.map @@ -1 +1 @@ -{"version":3,"file":"index-Drld_34e.js","sources":["../../src/components/dialog/demo-dialog-component.js","../../src/layout/content/settings/preferences-provider.js","../../src/utils/il-provider.js","../../src/components/player/player.js","../../node_modules/lit-html/directives/class-map.js","../../src/layout/content/examples/load-media-form-component.js","../../src/components/content-link/content-link-component.js","../../src/layout/content/examples/examples.js","../../node_modules/lit-html/directives/map.js","../../node_modules/lit-html/directives/when.js","../../src/layout/content/examples/examples-page.js","../../src/components/spinner/spinner-component.js","../../src/components/intersection-observer/intersection-observer-component.js","../../src/components/scroll-to-top/scroll-to-top-component.js","../../src/utils/string-utils.js","../../src/layout/content/lists/lists-page-state-manager.js","../../src/layout/content/lists/lists-sections.js","../../src/layout/content/lists/lists-page.js","../../src/layout/content/search/search-bar-component.js","../../src/layout/content/search/search-page.js","../../src/components/toggle-switch/toggle-switch-component.js","../../src/layout/content/settings/settings-page.js","../../node_modules/highlight.js/lib/core.js","../../node_modules/highlight.js/es/languages/javascript.js","../../src/components/code-block/code-block.js","../../src/layout/content/showcase/showcase-component.js","../../static/showcases/start-time.html?raw","../../static/showcases/multi-player.html?raw","../../static/showcases/blocked-segment.html?raw","../../static/showcases/chapters.html?raw","../../static/showcases/skip-credits.html?raw","../../static/showcases/playlist.html?raw","../../static/showcases/quality-menu.html?raw","../../static/showcases/countdown.html?raw","../../src/layout/content/showcase/example-parser.js","../../src/layout/content/showcase/showcase-page.js","../../src/layout/header/demo-header-component.js","../../src/router/route-outlet-component.js","../../src/index.js"],"sourcesContent":["/**\n * Defines the behaviour of the demo dialog.\n *\n * @module\n */\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../theme/theme';\nimport componentCSS from './demo-dialog-component.scss?inline';\n\nexport class DemoDialog extends LitElement {\n static properties = {\n open: { type: Boolean, reflect: true }\n };\n\n static styles = [\n theme, animations, unsafeCSS(componentCSS)\n ];\n\n #dialog;\n\n constructor() {\n super();\n this.open = false;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('open')) {\n if (this.open) {\n this.#dialog.showModal();\n this.#dialog.classList.toggle('slide-up-fade-in', true);\n } else {\n this.#dialog.close();\n }\n }\n }\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n this.#dialog = this.shadowRoot.querySelector('dialog');\n }\n\n #onDialogClosed() {\n this.dispatchEvent(new CustomEvent('close'));\n }\n\n #onDialogClicked(e) {\n if (this.#dialog !== e.target) return;\n this.open = false;\n }\n\n render() {\n return html`\n e.target.classList.remove('slide-up-fade-in')}\">\n \n \n \n `;\n }\n}\n\ncustomElements.define('demo-dialog', DemoDialog);\n","/**\n * Utility class for loading and saving preferences to local storage.\n *\n * @class PreferencesProvider\n */\nclass PreferencesProvider {\n /**\n * Load preferences from local storage.\n *\n * @static\n * @returns {Object} An object representing the loaded preferences.\n */\n static loadPreferences() {\n return JSON.parse(localStorage.getItem('preferences')) || {};\n }\n\n /**\n * Save preferences to local storage.\n *\n * @static\n * @param {Object} preferences - An object representing the preferences to be saved.\n * @returns {void}\n */\n static savePreferences(preferences) {\n localStorage.setItem('preferences', JSON.stringify(preferences));\n }\n}\n\nexport default PreferencesProvider;\n","export const IL_DEFAULT_HOST = 'il.srgssr.ch';\n\nconst DEFAULT_QUERY_PARAMS = {\n vector: 'srgplay'\n};\nconst DEFAULT_SEARCH_PARAMS = {\n includeAggregations: false,\n includeSuggestions: false,\n sortBy: 'default',\n sortDir: 'desc',\n pageSize: 50,\n ...DEFAULT_QUERY_PARAMS\n};\nconst DEFAULT_SHOWLIST_PARAMS = {\n onlyActiveShows: true,\n ...DEFAULT_QUERY_PARAMS\n};\n\nconst toMedia = ({ title, urn, mediaType, date, duration }) => ({\n title, urn, mediaType, date, duration\n});\n\n/**\n * Class representing a provider for the integration layer.\n *\n * @class\n */\nclass ILProvider {\n #host;\n\n /**\n * Creates an instance of ILProvider.\n *\n * @param {string} [host='il.srgssr.ch'] - The hostname for the integration layer (without the protocol).\n */\n constructor(host = IL_DEFAULT_HOST) {\n this.host = host;\n }\n\n /**\n * Get the current hostname for the integration layer.\n *\n * @returns {string} the hostname for the integration layer.\n */\n get host() {\n return this.#host;\n }\n\n /**\n * Set the hostname for the integration layer (without the protocol). Forces\n * `il.srgssr.ch` if null, undefined or empty string is passed.\n *\n * @param {string} host The hostname for the integration layer,\n */\n set host(host) {\n this.#host = host || IL_DEFAULT_HOST;\n }\n\n /**\n * Performs a search for media content based on the provided business unit and query.\n *\n * @param {string} bu - The business unit for which the search is performed (rsi, rtr, rts, srf or swi).\n * @param {string} query - The search query.\n * @param {AbortSignal} [signal=undefined] - (Optional) An abort signal,\n * allows to abort the query through an abort controller.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the search results.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async search(bu, query, signal = undefined) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/searchResultMediaList`,\n { ...DEFAULT_SEARCH_PARAMS, q: query },\n signal\n );\n const toResults = (data) => data.searchResultMediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves a list of topics for the specified business unit and transmission type.\n *\n * @param {string} bu - The business unit for which to retrieve topics (rsi, rtr, rts, srf, or swi).\n * @param {string} [transmission='tv'] - The transmission type ('tv' or 'radio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the topics.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async topics(bu, transmission = 'tv') {\n const data = await this.#fetch(`/${bu.toLowerCase()}/topicList/${transmission}`);\n\n return data.topicList.map(\n ({ title, urn }) => ({ title, urn })\n );\n }\n\n /**\n * Retrieves the latest media content for a specific topic.\n *\n * @param {string} topicUrn - The URN (Unique Resource Name) of the topic.\n * @param {number} [pageSize=30] - The maximum number of episodes to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async latestByTopic(topicUrn, pageSize = 30) {\n const data = await this.#fetch(`/mediaList/latest/byTopicUrn/${topicUrn}`, { pageSize });\n\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves a list of shows for the specified business unit, transmission type, and ordering.\n *\n * @param {string} bu - The business unit for which to retrieve shows (rsi, rtr, rts, srf, or swi).\n * @param {string} [pageSize='unlimited'] - The maximum number of shows to retrieve. Use 'unlimited' for all shows.\n * @param {string} [transmission='tv'] - The transmission type ('tv' or 'radio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the shows.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async shows(bu, pageSize = 'unlimited', transmission = 'tv') {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/showList/${transmission}/alphabetical`,\n { ...DEFAULT_SHOWLIST_PARAMS, pageSize }\n );\n\n return data.showList.map(\n ({ title, urn }) => ({ title, urn })\n );\n }\n\n /**\n * Retrieves the latest media content for a specific show.\n *\n * @param {string} showUrn - The URN (Unique Resource Name) of the show.\n * @param {number} [pageSize=30] - The maximum number of episodes to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async latestByShow(showUrn, pageSize = 30) {\n const data = await this.#fetch(\n `/episodeComposition/latestByShow/byUrn/${showUrn}`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n\n const toResults = (data) => data.episodeList\n .map(({ mediaList }) => mediaList[0])\n .map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves editorial media content for the specified business unit.\n *\n * @param {string} bu - The business unit for which to retrieve editorial media (rsi, rtr, rts, srf, or swi).\n * @param {number} [pageSize=30] - The maximum number of editorial media items to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async editorial(bu, pageSize = 30) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/mediaList/video/editorial`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves livestream media content for the specified business unit and media type.\n *\n * @param {string} bu - The business unit for which to retrieve livestreams (rsi, rtr, rts, srf, or swi).\n * @param {string} [mediaType='video'] - The media type ('video' or 'audio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the livestream media content.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async livestreams(bu, mediaType = 'video') {\n const data = await this.#fetch(`/${bu.toLowerCase()}/mediaList/${mediaType}/livestreams`);\n\n return data.mediaList.map(toMedia);\n }\n\n /**\n * Retrieves scheduled livestream media content for the specified business unit.\n *\n * @param {string} bu - The business unit for which to retrieve scheduled livestreams (rsi, rtr, rts, srf, or swi).\n * @param {number} [pageSize=10] - The maximum number of scheduled livestreams to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async scheduledLivestream(bu, pageSize = 10) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/mediaList/video/scheduledLivestreams`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves media content for the livecenter for the specified business unit.\n *\n * @param {string} bu - The business unit for which to retrieve livecenter media (rsi, rtr, rts, srf, or swi).\n * @param {number} [pageSize=10] - The maximum number of livecenter media items to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async livecenter(bu, pageSize = 10) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/mediaList/video/scheduledLivestreams/livecenter`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves a list of channels for the specified business unit and transmission type.\n *\n * @param {string} bu - The business unit for which to retrieve channels (rsi, rtr, rts, srf, or swi).\n * @param {string} [transmission='radio'] - The transmission type ('tv' or 'radio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and ID of the channels.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async channels(bu, transmission = 'radio') {\n const data = await this.#fetch(`/${bu.toLowerCase()}/channelList/${transmission}`);\n\n return data.channelList.map(\n ({ title, id }) => ({ title, id })\n );\n }\n\n /**\n * Retrieves radio shows for the specified business unit and channel.\n *\n * @param {string} bu - The business unit for which to retrieve radio shows (rsi, rtr, rts, srf, or swi).\n * @param {string} channelId - The ID of the channel.\n * @param {string} [pageSize='unlimited'] - The maximum number of radio shows to retrieve. Use 'unlimited' for all shows.\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the radio shows.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async radioShowByChannel(bu, channelId, pageSize = 'unlimited') {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/showList/radio/alphabeticalByChannel/${channelId}`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n\n return data.showList.map(\n ({ title, urn }) => ({ title, urn })\n );\n }\n\n /**\n * Asynchronously fetches data from the IL for the specified path and parameters.\n *\n * @private\n * @param {string} path - The path to fetch data from.\n * @param {Object} [params=DEFAULT_QUERY_PARAMS] - (Optional) parameters for the request.\n * @param {AbortSignal} [signal=undefined] - (Optional) AbortSignal to abort the request.\n *\n * @returns {Promise<*>} A Promise that resolves to the JSON response data.\n *\n * @throws {Response} If the HTTP response is not ok (status code other than 2xx).\n * @throws {Error} If the fetch operation fails for any other reason.\n */\n async #fetch(path, params = DEFAULT_QUERY_PARAMS, signal = undefined) {\n const queryParams = new URLSearchParams(params).toString();\n const url = `https://${this.host}/integrationlayer/2.0/${path.replace(/^\\/+/, '')}?${queryParams}`;\n\n return fetch(url, { signal }).then(response => {\n if (!response.ok) {\n return Promise.reject(response);\n }\n\n return response.json();\n }).catch((reason) => {\n return Promise.reject(reason);\n });\n }\n\n /**\n * Generates a function that, when called, retrieves the next set of data and\n * returns a new object with updated results and the next function.\n *\n * @private\n * @template T - The type of data returned by the resultMapper function.\n *\n * @param {string} nextUrl - The URL for fetching the next set of data.\n * @param {(data: any) => T} resultMapper - A function to map the raw data to the desired format.\n *\n * @returns {(signal?: AbortSignal) => Promise<{ results: T, next: function }>} - A function that,\n * when called, retrieves the next set of data and returns a new object with updated results and the next function.\n */\n #nextProvider(nextUrl, resultMapper) {\n return async(signal = undefined) => {\n const nextData = await fetch(nextUrl, { signal }).then(response => {\n if (!response.ok) {\n return Promise.reject(response);\n }\n\n return response.json();\n }).catch((reason) => {\n return Promise.reject(reason);\n });\n\n const nextResults = resultMapper(nextData);\n\n return {\n results: nextResults,\n next: this.#nextProvider(nextData.next, resultMapper)\n };\n };\n }\n}\n\nexport default new ILProvider();\n","/**\n * Initialized the demo player.\n *\n * @module\n */\nimport '../dialog/demo-dialog-component';\nimport PreferencesProvider\n from '../../layout/content/settings/preferences-provider';\nimport router from '../../router/router';\nimport Pillarbox from '@srgssr/pillarbox-web';\nimport { IL_DEFAULT_HOST } from '../../utils/il-provider.js';\n\nconst DEMO_PLAYER_ID = 'demo-player';\nconst DEFAULT_OPTIONS = {\n restoreEl: true\n};\n\nconst preferencesToPlayerOptions = (preferences) => {\n return {\n muted: preferences.muted ?? true,\n autoplay: preferences.autoplay ?? false,\n debug: preferences.debug ?? false,\n srgOptions: {\n dataProviderHost: preferences.dataProviderHost ?? IL_DEFAULT_HOST\n }\n };\n};\n/**\n * Creates and configures a Pillarbox player.\n *\n * @param {Object} options - (Optional) options to customize the player behaviour.\n *\n * @returns {Object} The configured Pillarbox player instance.\n */\nconst createPlayer = (options = {}) => {\n window.player = new Pillarbox(DEMO_PLAYER_ID, {\n ...DEFAULT_OPTIONS,\n ...preferencesToPlayerOptions(PreferencesProvider.loadPreferences()),\n ...options\n });\n\n return window.player;\n};\n\n/**\n * Disposes of the Pillarbox video player instance.\n */\nconst destroyPlayer = () => {\n Pillarbox.getPlayer(DEMO_PLAYER_ID).dispose();\n window.player = null;\n};\n\n// Expose Pillarbox and player in the window object for debugging\nwindow.pillarbox = Pillarbox;\n// Configure the dialog\nconst playerDialog = document.querySelector('demo-dialog');\n\nconst toParams = (keySystems) => {\n const vendor = Object.keys(keySystems ?? {})[0];\n\n if (!vendor) {\n return {};\n }\n\n return {\n vendor,\n ...(vendor === 'com.apple.fps.1_0' ? keySystems[vendor] : { licenseUri: keySystems[vendor] })\n };\n};\n\nconst toKeySystem = (params) => {\n if (!params.vendor) {\n return undefined;\n }\n\n const { certificateUri, licenseUri } = params;\n\n if (params.vendor === 'com.apple.fps.1_0') {\n return { [params.vendor]: { certificateUri, licenseUri } };\n }\n\n return { [params.vendor]: licenseUri };\n};\n\nexport const asQueryParams = ({ src, type, keySystems }) => {\n return new URLSearchParams({ src, type, ...toParams(keySystems) }).toString();\n};\n\nplayerDialog.addEventListener('close', () => {\n destroyPlayer();\n router.updateState({}, ['src', 'type', 'vendor', 'certificateUri', 'licenseUri']);\n});\n\nconst loadPlayerFromRouter = (e) => {\n if (window.player) {\n return;\n }\n\n const params = e.detail.queryParams;\n\n if ('src' in params) {\n const { src, type } = params;\n const keySystems = toKeySystem(params);\n\n openPlayerModal({ src, type, keySystems });\n }\n};\n\nrouter.addEventListener('routechanged', loadPlayerFromRouter);\nrouter.addEventListener('queryparams', loadPlayerFromRouter);\n\n/**\n * Opens a modal containing a video player with specified source and type. Can only\n * load URN if the type 'srgssr/urn`is explicitly provided, otherwise the created\n * Pillarbox player tries to guess the type.\n *\n * @param {object} options - An object containing the source and type of the video to be played.\n * @param {string} options.src - The source URL of the video.\n * @param {string} [options.type] - (Optional) The type/format of the video (e.g., 'video/mp4').\n * @param {object} [options.keySystems] - (Optional) The DRM configuration for DRM protected sources.\n * @param {object} [options.playerOptions] - (Optional) Additional configuration for the player.\n * @param {Boolean} shouldUpdateRouter - Whether the router should be updated or not (Default: true).\n *\n * @returns {Object} The configured Pillarbox player instance.\n */\nexport const openPlayerModal = (\n { src, type, keySystems, playerOptions },\n shouldUpdateRouter = true\n) => {\n const player = createPlayer(playerOptions ?? {});\n\n playerDialog.open = true;\n player.src({ src, type, keySystems });\n\n if (shouldUpdateRouter) {\n router.updateState({\n src,\n ...(type ? { type } : {}),\n ...toParams(keySystems)\n });\n }\n\n return player;\n};\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport componentCSS from './load-media-form-component.scss?inline';\nimport { classMap } from 'lit/directives/class-map.js';\n\n/**\n * LoadMediaFormComponent is a LitElement that provides a user interface for loading media content.\n *\n * @element load-media-form\n *\n * @fires LoadMediaFormComponent#submit-media - Dispatched when the user submits media with the specified details.\n *\n * @prop {String} src - The URL or URN of the media content to be loaded.\n * @prop {{vendor: String, certificateUri: String, licenseUri: String}} drmSettings - DRM settings for the loaded media.\n */\nexport class LoadMediaFormComponent extends LitElement {\n static properties = {\n src: { type: String },\n drmSettings: { type: Object },\n drmSettingsShown: { state: true, type: Boolean }\n };\n\n static styles = [theme, animations, unsafeCSS(componentCSS)];\n\n constructor() {\n super();\n\n this.src = '';\n this.#initDrmSettings();\n }\n\n #initDrmSettings() {\n this.drmSettings = {\n vendor: '',\n certificateUri: '',\n licenseUri: ''\n };\n }\n\n #getSource() {\n try {\n return new URL(this.src).searchParams.get('urn') ?? this.src;\n } catch {\n return this.src;\n }\n }\n\n #submitMedia() {\n const src = this.#getSource()?.trim();\n const type = src.startsWith('urn:') ? 'srgssr/urn' : undefined;\n const keySystems = this.#keySystems;\n\n /**\n * Custom event dispatched by LoadMediaFormComponent when the user submits media.\n *\n * @event LoadMediaFormComponent#submit-media\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {string} detail.src - The URL or URN of the media content to be loaded.\n * @property {string | undefined} detail.type - The type of media. Undefined if the type cannot be determined.\n * @property {Object | undefined} detail.keySystems - DRM key systems for the loaded media.\n */\n this.dispatchEvent(new CustomEvent('submit-media', {\n detail: { src, type, keySystems }\n }));\n }\n\n #handleLoadBarKeyUp(event) {\n this.src = event.target.value;\n\n if (event.key === 'Enter' && this.src) {\n this.#submitMedia();\n }\n }\n\n get #keySystems() {\n if (!this.drmSettings?.vendor) {\n return undefined;\n }\n\n return this.#toKeySystem();\n }\n\n #toKeySystem() {\n const certificateUri = this.drmSettings.certificateUri?.trim();\n const licenseUri = this.drmSettings.licenseUri?.trim();\n\n if (this.drmSettings.vendor === 'com.apple.fps.1_0') {\n return { [this.drmSettings.vendor]: { certificateUri, licenseUri } };\n }\n\n return { [this.drmSettings.vendor]: licenseUri };\n }\n\n render() {\n const btnSettingsClassMap = {\n spin: this.drmSettingsShown === true,\n 'spin-back': this.drmSettingsShown === false\n };\n\n return html`\n
e.target.classList.remove('fade-in')}\">\n
\n insert_link\n \n \n
\n \n ${this.#drmSettingsTemplate()}\n\n \n
\n `;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('drmSettingsShown') && this.drmSettingsShown) {\n this.shadowRoot.querySelector('.drm-settings-container').classList.add('active');\n }\n }\n\n #onFormAnimationEnd(e) {\n e.target.classList.toggle('active', !e.target.classList.contains('fade-out-shrink'));\n e.target.classList.remove('fade-in-grow', 'fade-out-shrink');\n }\n\n #formAnimationClassMap() {\n return {\n 'fade-in-grow': this.drmSettingsShown === true,\n 'fade-out-shrink': this.drmSettingsShown === false\n };\n }\n\n #drmSettingsTemplate() {\n return html`\n
this.#onFormAnimationEnd(e)}\">\n

DRM Settings

\n \n { this.drmSettings.licenseUri = e.target.value; }}\">\n { this.drmSettings.certificateUri = e.target.value; }}\">\n \n
\n
\n `;\n }\n}\n\ncustomElements.define('load-media-form', LoadMediaFormComponent);\n","import router from '../../router/router';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport componentCSS from './content-link-component.scss?inline';\n\n/**\n * A component for rendering a content link.\n *\n * @prop {string} href - The URL to navigate to.\n * @prop {string} title - The title attribute for the link.\n *\n * @csspart a - The anchor element.\n * @csspart title - The title span within the anchor.\n * @csspart description - The slot for additional description content within the anchor.\n *\n * @example\n * \n * Additional Description Content\n * \n */\nexport class ContentLinkComponent extends LitElement {\n static properties = {\n href: {}\n };\n\n static styles = unsafeCSS(componentCSS);\n\n #onClick = (event) => {\n event.preventDefault();\n\n const url = new URL(`${window.location.origin}/${this.href}`);\n const queryParams = Object.fromEntries(url.searchParams.entries());\n\n router.navigateTo(url.pathname, queryParams);\n };\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n render() {\n return html`\n \n ${this.title}\n \n \n `;\n }\n}\n\ncustomElements.define('content-link', ContentLinkComponent);\n","const EXAMPLES = {\n SRGSSR: [\n {\n title: 'Horizontal video',\n src: 'urn:rts:video:14827306',\n type: 'srgssr/urn'\n },\n {\n title: 'Square video',\n src: 'urn:rts:video:8393241',\n type: 'srgssr/urn'\n },\n {\n title: 'Vertical video',\n src: 'urn:rts:video:13444390',\n type: 'srgssr/urn'\n },\n {\n title: 'Token-protected video',\n description: 'Ski alpin, Slalom Messieurs',\n src: 'urn:swisstxt:video:rts:c56ea781-99ad-40c3-8d9b-444cc5ac3aea',\n type: 'srgssr/urn'\n },\n {\n title: 'Superfluously token-protected video',\n description: 'Telegiornale flash',\n src: 'urn:rsi:video:15916771',\n type: 'srgssr/urn'\n },\n {\n title: 'DRM-protected video',\n description: 'Top Models 8870',\n src: 'urn:rts:video:13639837',\n type: 'srgssr/urn'\n },\n {\n title: 'Live video',\n description: 'SRF 1',\n src: 'urn:srf:video:c4927fcf-e1a0-0001-7edd-1ef01d441651',\n type: 'srgssr/urn'\n },\n {\n title: 'DVR video livestream',\n description: 'RTS 1',\n src: 'urn:rts:video:3608506',\n type: 'srgssr/urn'\n },\n {\n title: 'DVR audio livestream',\n description: 'Couleur 3 (DVR)',\n src: 'urn:rts:audio:3262363',\n type: 'srgssr/urn'\n },\n {\n title: 'On-demand audio stream',\n description: 'Il lavoro di TerraProject per una fotografia documentaria',\n src: 'urn:rsi:audio:8833144',\n type: 'srgssr/urn'\n },\n {\n title: 'Expired URN',\n description: 'Content that is not available anymore',\n src: 'urn:rts:video:13382911',\n type: 'srgssr/urn'\n },\n {\n title: 'Unknown URN',\n description: 'Content that does not exist',\n src: 'urn:srf:video:unknown',\n type: 'srgssr/urn'\n }\n ],\n HLS: [\n {\n title: 'VOD - HLS',\n description: 'Switzerland says sorry! The fondue invasion',\n src: 'https://swi-vod.akamaized.net/videoJson/47603186/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'VOD - HLS (short)',\n description: 'Des violents orages ont touché Ajaccio, chef-lieu de la Corse, jeudi',\n src: 'https://rts-vod-amd.akamaized.net/ww/13317145/f1d49f18-f302-37ce-866c-1c1c9b76a824/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Brain Farm Skate Phantom Flex',\n description: '4K video',\n src: 'https://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Video livestream - HLS',\n description: 'Couleur 3 en vidéo (live)',\n src: 'https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8?dw=0',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Video livestream with DVR - HLS',\n description: 'Couleur 3 en vidéo (DVR)',\n src: 'https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Video livestream with DVR and timestamps - HLS',\n description: 'Tageschau',\n src: 'https://tagesschau.akamaized.net/hls/live/2020115/tagesschau/tagesschau_1/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Audio livestream - HLS',\n description: 'Couleur 3 (DVR)',\n src: 'https://lsaplus.swisstxt.ch/audio/couleur3_96.stream/playlist.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Basic 4:3',\n description: '4x3 aspect ratio, H.264 @ 30Hz',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Basic 16:9',\n description: '16x9 aspect ratio, H.264 @ 30Hz',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Advanced 16:9 (TS)',\n description: '16x9 aspect ratio, H.264 @ 30Hz and 60Hz, Transport stream',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Advanced 16:9 (fMP4)',\n description: '16x9 aspect ratio, H.264 @ 30Hz and 60Hz, Fragmented MP4',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Advanced 16:9 (HEVC/H.264)',\n description: '16x9 aspect ratio, H.264 and HEVC @ 30Hz and 60Hz',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Atmos',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/adv_dv_atmos/main.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple WWDC Keynote 2023',\n src: 'https://events-delivery.apple.com/0105cftwpxxsfrpdwklppzjhjocakrsk/m3u8/vod_index-PQsoJoECcKHTYzphNkXohHsQWACugmET.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple tv trailer',\n description: 'Lot of audios and subtitles choices',\n src: 'https://play-edge.itunes.apple.com/WebObjects/MZPlayLocal.woa/hls/subscription/playlist.m3u8?cc=CH&svcId=tvs.vds.4021&a=1522121579&isExternal=true&brandId=tvs.sbd.4000&id=518077009&l=en-GB&aec=UHD\\n',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Multiple subtitles and audio tracks',\n description: 'On some devices codec may crash',\n src: 'https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: '4K, HEVC',\n src: 'https://cdn.bitmovin.com/content/encoding_test_dash_hls/4k/hls/4k_profile/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'VoD, single audio track',\n src: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'AES-128',\n src: 'https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/m3u8s/11331.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Fragmented MP4',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Alternate audio language',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Audio only',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.m3u8?filter=(type!=%22video%22)',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Trickplay',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/no-handler-origin/tears-of-steel/tears-of-steel-trickplay.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Limiting bandwidth use',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8?max_bitrate=800000',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Dynamic Track Selection',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8?filter=%28type%3D%3D%22audio%22%26%26systemBitrate%3C100000%29%7C%7C%28type%3D%3D%22video%22%26%26systemBitrate%3C1024000%29',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Pure live',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Timeshift (5 minutes)',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8?time_shift=300',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Live audio',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8?filter=(type!=%22video%22)',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Pure live (scte35)',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/scte35.isml/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'fMP4, clear',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-fmp4.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'fMP4, HEVC 4K',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-hevc.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Test1',\n description: 'Forced subtitles',\n src: 'https://prd.vod-srgssr.ch/origin/1053457/fr/master.m3u8?complexSubs=true',\n type: 'application/x-mpegURL'\n }\n ],\n DASH: [\n {\n title: 'VoD - Dash (H264)',\n src: 'https://storage.googleapis.com/wvmedia/clear/h264/tears/tears.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'VoD - Dash Widewine cenc (H264)',\n src: 'https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd',\n type: 'application/dash+xml',\n keySystems: {\n 'com.widevine.alpha': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'\n }\n },\n {\n title: 'VoD - Dash (H265)',\n src: 'https://storage.googleapis.com/wvmedia/clear/hevc/tears/tears.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'VoD - Dash widewine cenc (H265)',\n src: 'https://storage.googleapis.com/wvmedia/cenc/hevc/tears/tears.mpd',\n type: 'application/dash+xml',\n keySystems: {\n 'com.widevine.alpha': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'\n }\n },\n {\n title: 'VoD - Dash - MP4',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.mp4/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Fragmented MP4',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - TrickPlay',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/no-handler-origin/tears-of-steel/tears-of-steel-trickplay.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Tiled thumbnails (live/timeline)',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-tiled-thumbnails-timeline.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Accessibility - hard of hearing',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-hoh-subs.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Single - fragmented TTML',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-en.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Multiple - RFC 5646 language tags',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-rfc5646.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Multiple - fragmented TTML',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-ttml.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Audio only',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.mpd?filter=(type!=%22video%22)',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Multiple audio codecs',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-codec.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Alternate audio language',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Accessibility - audio description',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-desc-aud.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Pure live',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Timeshift (5 minutes)',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.mpd?time_shift=300',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - DVB DASH low latency',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live-low-latency.isml/.mpd',\n type: 'application/dash+xml'\n }\n ],\n MP4: [\n {\n title: 'VOD - MP4',\n description: 'The dig',\n src: 'https://media.swissinfo.ch/media/video/dddaff93-c2cd-4b6e-bdad-55f75a519480/rendition/154a844b-de1d-4854-93c1-5c61cd07e98c.mp4',\n type: 'video/mp4'\n },\n {\n title: 'AVC Progressive',\n src: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',\n type: 'video/mp4'\n }\n ],\n AOD: [\n {\n title: 'Audio HLS',\n description: 'Content with PTS rollover',\n src: 'https://cdn.rts.ch/audio-sample/playlist.m3u8',\n type: 'application/x-mpegURL'\n }\n ]\n};\n\nexport default EXAMPLES;\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++)}}export{o as map};\n//# sourceMappingURL=map.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n,r,t){return n?r(n):t?.(n)}export{n as when};\n//# sourceMappingURL=when.js.map\n","import router from '../../../router/router';\nimport { css, html, LitElement } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport './load-media-form-component';\nimport '../../../components/content-link/content-link-component';\nimport Examples from './examples';\nimport { map } from 'lit/directives/map.js';\nimport { when } from 'lit/directives/when.js';\nimport { asQueryParams, openPlayerModal } from '../../../components/player/player';\n\n/**\n * A web component that represents the examples page.\n *\n * @element examples-page\n */\nexport class ExamplesPage extends LitElement {\n static styles = [\n theme, animations, css`\n .example-section p {\n margin-bottom: 0;\n color: var(--color-5);\n font-size: var(--size-3);\n text-align: left;\n }`\n ];\n\n render() {\n return html`\n openPlayerModal(e.detail)}\">\n \n\n \n
e.target.classList.remove('fade-in')}\">\n ${map(Object.entries(Examples), ([section, examples]) => html`\n
\n

${section}

\n ${map(examples, example => html`\n \n ${when(example.description, () => html`\n ${example.title}\n `)}\n \n `)}\n
\n `)}\n
\n `;\n }\n}\n\ncustomElements.define('examples-page', ExamplesPage);\nrouter.addRoute('examples', 'examples-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport spinnerCss from './spinner-component.scss?inline';\nimport { animations } from '../../theme/theme';\n\n/**\n * A spinner component.\n *\n * @element loading-spinner\n */\nexport class SpinnerComponent extends LitElement {\n static properties = {\n loading: { type: Boolean, reflect: true }\n };\n\n static styles = [animations, unsafeCSS(spinnerCss)];\n\n constructor() {\n super();\n this.loading = false;\n }\n\n render() {\n return html`\n
\n
\n
\n `;\n }\n}\n\ncustomElements.define('loading-spinner', SpinnerComponent);\n","import { html, LitElement } from 'lit';\nimport { animations } from '../../theme/theme';\n\nconst DEFAULT_INT_OPTIONS = {\n root: null,\n rootMargin: '0px',\n threshold: 0.1\n};\n\n/**\n * Attach an Intersection Observer to a target element and execute a callback when it becomes visible.\n *\n * @param {Element} target - The target element to observe.\n * @param {Function} callback - The callback function to execute when the target is intersecting.\n * @param {Object} options - (Optional) Options to configure the Intersection Observer.\n * @param {Element} [options.root=null] - The element that is used as the viewport for checking visibility.\n * @param {string} [options.rootMargin='0px'] - Margin around the root. Can have values similar to CSS margin property.\n * @param {number} [options.threshold=0.1] - The threshold at which the callback will be triggered.\n */\nconst onIntersecting = (target, callback, options = DEFAULT_INT_OPTIONS) => {\n new IntersectionObserver((entries) => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n callback();\n }\n });\n }, options).observe(target);\n};\n\n/**\n * This web component acts as a sentinel for an Intersection Observer,\n * dispatching an 'intersecting' event when the observed element intersects\n * with the view.\n *\n * @element intersection-observer\n * @csspart sentinel - the sentinel element.\n *\n * @fires IntersectionObserverComponent#intersecting - Dispatched when the observed element intersects with the view.\n */\nexport class IntersectionObserverComponent extends LitElement {\n static styles = [\n animations\n ];\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n onIntersecting(\n this.renderRoot.querySelector('div'),\n () => {\n /**\n * Custom event dispatched by IntersectionObserverComponent when the observed element intersects\n * with the view.\n *\n * @event IntersectionObserverComponent#intersecting\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {string} detail.src - The URL or URN of the media content to be loaded.\n * @property {string | undefined} detail.type - The type of media. Undefined if the type cannot be determined.\n * @property {Object | undefined} detail.keySystems - DRM key systems for the loaded media.\n */\n this.dispatchEvent(new CustomEvent('intersecting'));\n }\n );\n }\n\n render() {\n return html`\n
\n `;\n }\n}\n\ncustomElements.define('intersection-observer', IntersectionObserverComponent);\n","import { css, html, LitElement } from 'lit';\nimport { animations, theme } from '../../theme/theme';\n\n/**\n * A custom web component that provides a button to scroll to the top of the page.\n *\n * @element scroll-to-top-button\n */\nexport class ScrollToTopComponent extends LitElement {\n static styles = [\n theme,\n animations,\n css`\n .scroll-to-top-button {\n position: fixed;\n right: 20px;\n bottom: 20px;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--size-7);\n height: var(--size-7);\n padding: 0;\n border: none;\n border-radius: var(--radius-round);\n }\n\n .scroll-to-top-button i {\n font-size: var(--size-8);\n }\n `];\n\n render() {\n return html`\n \n `;\n }\n}\n\ncustomElements.define('scroll-to-top-button', ScrollToTopComponent);\n","/**\n * Converts a given string to kebab case, spaces are replaced with hyphens\n * and all letters are converted to lowercase.\n *\n * @param {string} str - The input string to be converted to kebab case.\n * @returns {string} - The input string converted to kebab case.\n *\n * @example\n * const result = toKebabCase(\"Hello World\");\n * console.log(result); // Output: \"hello-world\"\n *\n * @example\n * const result = toKebabCase(\"CamelCase Example\");\n * console.log(result); // Output: \"camelcase-example\"\n */\nexport const toKebabCase = (str) => str.replace(/\\s+/g, '-').toLowerCase();\n","import { toKebabCase } from '../../../utils/string-utils';\n\n/**\n * Manages the state of a lists page, allowing navigation and retrieval of section data.\n *\n * @class\n */\nclass ListsPageStateManager {\n /**\n * Creates an instance of ListsPageStateManager.\n *\n * @constructor\n * @param {Array
} root - The root level of the lists page.\n */\n constructor(root) {\n /**\n * Stack to keep track of the traversal steps for navigation.\n *\n * @type {Array<{level: Array
, sectionIndex: number, nodeIndex: number}>}\n */\n this.stack = [];\n /**\n * The current level of the content tree.\n *\n * @type {Array
}\n */\n this.level = root;\n }\n\n /**\n * Initializes the state manager with the provided section, business unit, and nodes.\n *\n * @async\n * @param {string} section - The section to initialize.\n * @param {string} bu - The business unit associated with the section.\n * @param {string} nodes - A comma-separated string of nodes representing the initial state.\n * @returns {Promise} - A promise that resolves when initialization is complete.\n *\n * @example\n * // Example Usage:\n * await stateManager.initialize(\"radio-shows\", \"rts\", \"a9e7621504c6959e35c3ecbe7f6bed0446cdf8da,urn:rts:show:radio:9801398\");\n */\n async initialize(section, bu, nodes) {\n if (!section || !bu) {\n return;\n }\n\n const sectionIndex = this.#findSectionIndex(section);\n const nodeIndex = this.#findNodeIndex(this.level[sectionIndex].nodes, bu);\n\n await this.fetchNextState(sectionIndex, nodeIndex);\n await this.#processNodeString(nodes);\n }\n\n async #processNodeString(nodes) {\n for (const nodeStr of (nodes?.split(',') || [])) {\n const nodeIndex = this.#findNodeIndex(this.level[0].nodes, nodeStr);\n\n await this.fetchNextState(0, nodeIndex);\n }\n }\n\n /**\n * Fetches the next state based on the provided section index and node index.\n *\n * @param {number} sectionIndex - The index of the section.\n * @param {number} nodeIndex - The index of the node.\n * @returns {Promise} - A promise that resolves when the state is fetched.\n */\n async fetchNextState(sectionIndex, nodeIndex) {\n const section = this.level[sectionIndex];\n\n this.stack.push({ level: this.level, sectionIndex, nodeIndex });\n this.level = [await section.resolve(section.nodes[nodeIndex])];\n }\n\n /**\n * Fetches the previous state based on the provided stack index.\n *\n * @param {number} stackIndex - The index in the stack.\n */\n fetchPreviousState(stackIndex) {\n this.level = this.stack[stackIndex].level;\n this.stack.splice(stackIndex);\n }\n\n /**\n * Checks if the specified section at the given index is a leaf section.\n *\n * @param {number} sectionIndex - The index of the section.\n *\n * @returns {boolean} - True if the section is a leaf section, false otherwise.\n */\n isLeafSection(sectionIndex) {\n return this.level[sectionIndex]?.isLeaf();\n }\n\n /**\n * Retrieves the node at the specified section and node indices.\n *\n * @param {number} sectionIndex - The index of the section.\n * @param {number} nodeIndex - The index of the node.\n *\n * @returns {any} - The retrieved node.\n */\n retrieveNode(sectionIndex, nodeIndex) {\n return this.level[sectionIndex]?.nodes[nodeIndex];\n }\n\n /**\n * Gets the root level of the content tree.\n *\n * @returns {Array
} - The root level of the content tree.\n */\n get root() {\n return this.stack[0]?.level || this.level;\n }\n\n /**\n * Return the current state of this manager as query params that are parsable\n * by {@link #initialize}.\n *\n * @returns {{}|{bu: string, section: string, nodes?: string}} The current state as query params.\n */\n get params() {\n return ListsPageStateManager.#params(this.stack);\n }\n\n static #params(stack) {\n if (stack.length === 0) {\n return {};\n }\n\n const root = stack[0];\n const rootSection = root.level[root.sectionIndex];\n const nodes = stack.slice(1).map(n => {\n const node = n.level[n.sectionIndex].nodes[n.nodeIndex];\n\n return node.id || node.urn;\n });\n const params = {\n section: toKebabCase(rootSection.title),\n bu: rootSection.nodes[root.nodeIndex].toLowerCase()\n };\n\n if (nodes && nodes.length) {\n params.nodes = nodes.join(',');\n }\n\n return params;\n }\n\n paramsAt(sectionIndex, nodeIndex) {\n return ListsPageStateManager.#params(\n [...this.stack, { level: this.level, sectionIndex, nodeIndex }]\n );\n }\n\n /**\n * Finds the index of a section based on its title in kebab case.\n *\n * @private\n * @param {string} sectionStr - The section title to find.\n * @returns {number} - The index of the section.\n *\n * @example\n * const index = stateManager.#findSectionIndex(\"Products\");\n */\n #findSectionIndex(sectionStr) {\n const normalizedSectionStr = toKebabCase(sectionStr).toLowerCase();\n\n return this.level\n .map(s => toKebabCase(s.title).toLowerCase())\n .findIndex(title => title === normalizedSectionStr);\n }\n\n /**\n * Finds the index of a node based on its string representation.\n *\n * @private\n * @param {Array} nodes - The array of nodes to search.\n * @param {string} str - The string representation of the node to find.\n *\n * @returns {number} - The index of the node.\n */\n #findNodeIndex(nodes, str) {\n const normalizedStr = str.toLowerCase();\n\n return nodes\n .map(n => (n.urn || n.id || n.toString()).toLowerCase())\n .findIndex(n => n === normalizedStr);\n }\n}\n\nexport default ListsPageStateManager;\n","import ilProvider from '../../../utils/il-provider';\n\n/**\n * A section within the content hierarchy.\n *\n * @property {string} title - The title of the section node.\n * @property {string[]} values - An array of values associated with the section.\n * @property {function} resolve - A function that, when defined, resolves the next level\n * of the hierarchy asynchronously.\n */\nclass Section {\n /**\n * Creates an instance of Section.\n *\n * @param {Object} options - The options for creating the section.\n * @param {string} options.title - The title of the section.\n * @param {string[]} options.nodes - An array of nodes associated with the section.\n * @param {function} [options.resolve] - (Optional) A function that, when defined, resolves the next level\n * of the hierarchy asynchronously.\n * @param {function} [options.next] - (Optional) A function that, when defined, resolves the next level\n * of the hierarchy asynchronously.\n */\n constructor({\n title,\n nodes,\n resolve = undefined,\n next = undefined\n }) {\n this.title = title;\n this.nodes = nodes;\n this.resolve = resolve;\n this.next = next;\n }\n\n /**\n * Checks if the node is a leaf node (i.e., has no further levels to resolve).\n *\n * @returns {boolean} True if the node is a leaf node, false otherwise.\n */\n isLeaf() {\n return !this.resolve;\n }\n\n /**\n * Fetch more nodes from the next function if available.\n * @param signal\n * @returns {Promise<*>}\n */\n async fetchNext(signal = undefined) {\n if (!this.next) return;\n const data = await this.next(signal);\n\n this.next = data.next;\n this.nodes.push(...data.results);\n\n return data.results;\n }\n}\n\nconst toNodesAndNext = (data) => ({\n nodes: data.results,\n next: data.next\n});\n\n/**\n * An asynchronous tree-like structure that allows traversing the SRG SSR content\n * by category in a hierarchical fashion.\n *\n * @type {Section[]}\n */\nexport const listsSections = [\n new Section({\n title: 'TV Topics',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF', 'SWI'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Topics`,\n nodes: await ilProvider.topics(bu),\n resolve: async(topic) => new Section({\n title: topic.title,\n ...toNodesAndNext(await ilProvider.latestByTopic(topic.urn))\n })\n })\n }),\n new Section({\n title: 'TV Shows',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF', 'SWI'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Shows`,\n nodes: await ilProvider.shows(bu),\n resolve: async(show) => new Section({\n title: show.title,\n ...toNodesAndNext(await ilProvider.latestByShow(show.urn))\n })\n })\n }),\n new Section({\n title: 'TV Latest Videos',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Latest Videos`,\n ...toNodesAndNext(await ilProvider.editorial(bu))\n })\n }),\n new Section({\n title: 'TV Livestreams',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Livestreams`,\n nodes: await ilProvider.livestreams(bu)\n })\n }),\n new Section({\n title: 'Live web',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Live web`,\n ...toNodesAndNext(await ilProvider.scheduledLivestream(bu))\n })\n }),\n new Section({\n title: 'Live center',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Live center`,\n nodes: await ilProvider.livecenter(bu)\n })\n }),\n new Section({\n title: 'Radio Shows',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Radio Channels`,\n nodes: await ilProvider.channels(bu),\n resolve: async(channel) => new Section({\n title: `${channel.title} Radio shows`,\n nodes: await ilProvider.radioShowByChannel(bu, channel.id),\n resolve: async(show) => new Section({\n title: show.title,\n ...toNodesAndNext(await ilProvider.latestByShow(show.urn))\n })\n })\n })\n }),\n new Section({\n title: 'Radio Livestreams',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Radio Livestreams`,\n nodes: await ilProvider.livestreams(bu, 'audio')\n })\n })\n];\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport router from '../../../router/router';\nimport componentCSS from './lists-page.scss?inline';\nimport '../../../components/spinner/spinner-component';\nimport '../../../components/intersection-observer/intersection-observer-component';\nimport '../../../components/scroll-to-top/scroll-to-top-component';\nimport { map } from 'lit/directives/map.js';\nimport { when } from 'lit/directives/when.js';\nimport ListsPageStateManager from './lists-page-state-manager';\nimport { listsSections } from './lists-sections';\nimport Pillarbox from 'video.js';\n\nexport class ListsPage extends LitElement {\n static properties = {\n loading: { state: true, type: Boolean },\n stack: { state: true, type: Array },\n level: { state: true, type: Object },\n nextPage: { state: true, type: Function }\n };\n\n static styles = [\n theme, animations, unsafeCSS(componentCSS)\n ];\n\n /**\n * The abort controller for handling search cancellation.\n *\n * @private\n * @type {AbortController}\n */\n #abortController = new AbortController();\n /**\n * Keeps track of the state of the list page : the current level in display, as\n * well as the traversal stack.\n *\n * @private\n * @type {ListsPageStateManager}\n */\n #stateManager;\n /**\n * The reference to the query params changed event handler.\n *\n * @private\n * @type {Function}\n */\n #onQueryParamsChanged;\n\n constructor() {\n super();\n\n this.loading = false;\n this.#stateManager = new ListsPageStateManager(listsSections);\n this.#updateState();\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#onQueryParamsChanged = async(event) => {\n if (!event.detail.popstate) return;\n\n this.abortFetch();\n const manager = new ListsPageStateManager(this.#stateManager.root);\n const { section, bu, nodes } = event.detail.queryParams;\n\n this.loading = true;\n try {\n await manager.initialize(section, bu, nodes);\n this.#stateManager = manager;\n this.#updateState();\n } finally {\n this.loading = false;\n }\n };\n router.addEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.abortFetch();\n router.removeEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n this.#onQueryParamsChanged(\n { detail: { popstate: true, queryParams: router.queryParams } }\n );\n }\n\n #updateState() {\n this.stack = [...this.#stateManager.stack];\n this.level = [...this.#stateManager.level];\n }\n\n /**\n * Navigates to the specified section and node in the content tree.\n *\n * @param {number} sectionIndex - The index of the section.\n * @param {number} nodeIndex - The index of the node.\n */\n async navigateTo(sectionIndex, nodeIndex) {\n if (!this.#stateManager.isLeafSection(sectionIndex)) {\n this.abortFetch();\n this.loading = true;\n try {\n await this.#stateManager.fetchNextState(sectionIndex, nodeIndex);\n this.#updateState();\n } finally {\n this.loading = false;\n }\n }\n }\n\n /**\n * Aborts the previous fetch by cancelling the associated abort signal and\n * creates a new abort controller for the next fetch.\n *\n * @returns {AbortSignal} - The abort signal associated with the new fetch.\n */\n abortFetch() {\n this.#abortController?.abort('New search launched');\n this.#abortController = new AbortController();\n\n return this.#abortController.signal;\n }\n\n #toMediaButtonParams(node) {\n return new URLSearchParams({ ...router.queryParams, src: node.urn, type: 'srgssr/urn' }).toString();\n }\n\n #renderMediaButton(node) {\n const date = new Intl.DateTimeFormat('fr-CH').format(new Date(node.date));\n const duration = Pillarbox.formatTime(node.duration / 1000);\n\n return html`\n \n
\n ${node.mediaType === 'VIDEO' ? 'movie' : 'audiotrack'}\n  | ${date} | ${duration}\n
\n
\n `;\n }\n\n #toLevelParams(sectionIdx, nodeIdx) {\n const params = this.#stateManager.paramsAt(sectionIdx, nodeIdx);\n\n return new URLSearchParams(params).toString();\n }\n\n #renderLevelButton(node, sectionIdx, nodeIdx) {\n return html`\n \n \n `;\n }\n\n async #nextPage(section) {\n const signal = this.abortFetch();\n\n await section.fetchNext(signal);\n this.#updateState();\n }\n\n #renderNodes(nodes, sectionIdx) {\n const firstSection = this.level[0];\n const hasIntesectionObserver = this.level.length === 1 && firstSection.next;\n\n return html`\n ${map(nodes, (node, idx) => html`\n ${when(node.mediaType, () => this.#renderMediaButton(node, idx), () => this.#renderLevelButton(node, sectionIdx, idx))}\n `)}\n ${when(hasIntesectionObserver, () => html`\n this.#nextPage(firstSection)}\">\n \n `)}\n `;\n }\n\n async #onSectionsClicked(e) {\n const button = e.target.closest('content-link');\n\n if (this.loading || !('nodeIdx' in button.dataset)) return;\n\n const sectionIndex = button.dataset.sectionIdx;\n const nodeIndex = button.dataset.nodeIdx;\n\n await this.navigateTo(sectionIndex, nodeIndex);\n }\n\n #renderResults() {\n return html`\n
e.target.classList.remove('fade-in')}\"\n @click=\"${this.#onSectionsClicked.bind(this)}\">\n ${map(this.level, (section, idx) => html`\n
\n

${section.title}

\n ${this.#renderNodes(section.nodes, idx)}\n
\n `)}\n
\n `;\n }\n\n #renderSpinner() {\n return html`\n e.target.classList.remove('slide-up-fade-in')}\">\n \n `;\n }\n\n #renderScrollToTopBtn() {\n return html`\n `;\n }\n\n #onNavigationClicked(e) {\n if (e.target.tagName.toLowerCase() !== 'button') return;\n this.abortFetch();\n this.#stateManager.fetchPreviousState(e.target.dataset.navigationIdx);\n this.#updateState();\n router.updateState(this.#stateManager.params, ['section', 'bu', 'nodes']);\n }\n\n #renderNavigation() {\n return html`\n
\n ${when(this.stack.length > 0, () => html`\n \n `)}\n ${map(this.stack.slice(1), (step, idx) => html`\n chevron_right\n \n `)}\n
\n `;\n }\n\n render() {\n const renderScrollBtn = this.level.length === 1 && this.level[0].next;\n\n return html`\n ${this.#renderNavigation()}\n ${when(this.loading, this.#renderSpinner.bind(this), this.#renderResults.bind(this))}\n ${when(renderScrollBtn, this.#renderScrollToTopBtn.bind(this))}\n `;\n }\n}\n\ncustomElements.define('lists-page', ListsPage);\nrouter.addRoute('lists', 'lists-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport componentCSS from './search-bar-component.scss?inline';\nimport Pillarbox from 'video.js';\n\nconst DEFAULT_BU = 'rsi';\n\n/**\n * A search bar component for filtering content based on a query and business unit.\n *\n * @element search-bar\n *\n * @fires SearchBarComponent#change - Dispatched when the value of the search bar changes.\n */\nexport class SearchBarComponent extends LitElement {\n static properties = {\n bu: { type: String },\n query: { type: String }\n };\n\n static styles = [theme, animations, unsafeCSS(componentCSS)];\n\n constructor() {\n super();\n this.bu = DEFAULT_BU;\n this.query = '';\n }\n\n #handleSearchBarKeyUp() {\n this.query = this.renderRoot.querySelector('input').value;\n }\n\n #handleSelectChange(e) {\n this.bu = e.target.value;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (['bu', 'query'].some(property => _changedProperties.has(property))) {\n const query = this.query ?? '';\n const bu = this.bu ?? DEFAULT_BU;\n\n /**\n * Custom event dispatched by SearchBarComponent when the value of the bar changes.\n *\n * @event SearchBarComponent#change\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {string} detail.query - The query on the search bar.a\n * @property {string} detail.bu - The selected bu.\n */\n this.dispatchEvent(new CustomEvent('change', {\n detail: { query, bu }\n }));\n }\n }\n\n #clearSearchBar() {\n this.query = '';\n this.renderRoot.querySelector('input').value = '';\n }\n\n render() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n \n \n
\n `;\n }\n}\n\ncustomElements.define('search-bar', SearchBarComponent);\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport router from '../../../router/router';\nimport componentCSS from './search-page.scss?inline';\nimport './search-bar-component';\nimport ilProvider from '../../../utils/il-provider';\nimport '../../../components/spinner/spinner-component';\nimport '../../../components/intersection-observer/intersection-observer-component';\nimport '../../../components/scroll-to-top/scroll-to-top-component';\nimport '../../../components/content-link/content-link-component';\nimport { map } from 'lit/directives/map.js';\nimport Pillarbox from 'video.js';\nimport { when } from 'lit/directives/when.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport class SearchPage extends LitElement {\n static properties = {\n loading: {\n state: true,\n type: Boolean\n },\n results: {\n state: true,\n type: Array\n },\n nextPage: {\n state: true,\n type: Function\n }\n };\n\n static styles = [\n theme, animations, unsafeCSS(componentCSS)\n ];\n\n /**\n * The abort controller for handling search cancellation.\n *\n * @private\n * @type {AbortController}\n */\n #abortController = new AbortController();\n /**\n * The reference to the query params changed event handler.\n *\n * @private\n * @type {Function}\n */\n #onQueryParamsChanged;\n\n constructor() {\n super();\n\n this.loading = false;\n this.results = null;\n this.nextPage = null;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#onQueryParamsChanged = () => {\n const searchBar = this.renderRoot.querySelector('search-bar');\n\n searchBar.query = router.queryParams.query ?? '';\n searchBar.bu = router.queryParams.bu ?? 'rsi';\n };\n router.addEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.abortSearch();\n router.removeEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n async firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n const searchBar = this.renderRoot.querySelector('search-bar');\n\n this.#onQueryParamsChanged();\n await this.#search(searchBar.bu, searchBar.query);\n }\n\n async #onSearchBarChanged(bu, query) {\n router.updateState({ bu, ...(query ? { query } : {}) });\n await this.#search(bu, query);\n }\n\n /**\n * Performs a search based on the specified business unit and query. Performing\n * a new search will abort the previous search if it's ongoing and display a\n * loading spinner for the asynchronous operation.\n *\n * @param {string} bu - The selected business unit.\n * @param {string} query - The search query.\n *\n * @throws {Promise} - A rejected promise with the response object if\n * the fetch request for the search results fails.\n */\n async #search(bu, query) {\n const signal = this.abortSearch();\n\n if (!query) {\n [this.results, this.nextPage] = [null, null];\n\n return;\n }\n\n this.loading = true;\n try {\n const data = await ilProvider.search(bu, query, signal);\n\n [this.results, this.nextPage] = [data.results, data.next];\n } finally {\n this.loading = false;\n }\n }\n\n /**\n * Advances to the next page of search results and updates the UI accordingly.\n *\n * @throws {Promise} - A rejected promise with the response object if\n * the fetch request for the next page fails.\n */\n async #fetchNextPage() {\n const signal = this.abortSearch();\n const data = await this.nextPage(signal);\n\n this.nextPage = data.next;\n this.results = [...this.results, ...data.results];\n }\n\n /**\n * Aborts the previous search by cancelling the associated abort signal and\n * creates a new abort controller for the next search.\n *\n * @returns {AbortSignal} - The abort signal associated with the new search.\n */\n abortSearch() {\n this.#abortController?.abort('New search launched');\n this.#abortController = new AbortController();\n\n return this.#abortController.signal;\n }\n\n #toQueryParams(r) {\n return new URLSearchParams({\n ...router.queryParams,\n src: r.urn,\n type: 'srgssr/urn'\n }).toString();\n }\n\n #renderButton(r) {\n const date = new Intl.DateTimeFormat('fr-CH').format(new Date(r.date));\n const duration = Pillarbox.formatTime(r.duration / 1000);\n\n return html`\n \n
\n ${r.mediaType === 'VIDEO' ? 'movie' : 'audiotrack'}\n  | ${date} | ${duration}\n
\n
\n `;\n }\n\n #renderResults() {\n const resultsClassMap = {\n empty: this.results == null,\n 'no-results': this.results && this.results.length === 0,\n 'material-icons': !this.results || this.results.length === 0\n };\n\n return html`\n
e.target.classList.remove('fade-in')}\">\n ${map(this.results ?? [], this.#renderButton.bind(this))}\n ${when(this.nextPage, () => html`\n \n \n `)}\n
\n `;\n }\n\n #renderSpinner() {\n return html`\n e.target.classList.remove('slide-up-fade-in')}\">\n \n `;\n }\n\n #renderScrollToTopBtn() {\n return html`\n `;\n }\n\n render() {\n return html`\n this.#onSearchBarChanged(e.detail.bu, e.detail.query)}\">\n \n\n \n ${when(this.loading, this.#renderSpinner.bind(this), this.#renderResults.bind(this))}\n ${when(this.results?.length > 0, this.#renderScrollToTopBtn.bind(this))}\n `;\n }\n}\n\ncustomElements.define('search-page', SearchPage);\nrouter.addRoute('search', 'search-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { theme } from '../../theme/theme';\nimport componentCSS from './toggle-switch-component.scss?inline';\n\n/**\n * Custom element representing a toggle switch.\n *\n * @element toggle-switch\n *\n * @csspart switch - The container for the toggle switch.\n * @csspart slider - The slider button of the toggle switch.\n *\n * @prop {Boolean} checked - Reflects the current state of the toggle switch.\n * @prop {Boolean} disabled - Indicates whether the toggle switch is disabled.\n *\n * @attribute {String} role - ARIA role for accessibility, set to 'switch'.\n * @attribute {String} tabindex - ARIA tabindex for accessibility, set to '0'.\n *\n * @fires ToggleSwitchComponent#change\n *\n * @example\n * \n *\n * @customElement\n */\nexport class ToggleSwitchComponent extends LitElement {\n static formAssociated = true;\n static properties = {\n checked: { type: Boolean, reflect: true },\n disabled: { type: Boolean }\n };\n\n constructor() {\n super();\n this.checked = false;\n this.disabled = false;\n }\n\n static styles = [\n theme, unsafeCSS(componentCSS)\n ];\n\n #onKeyDown = (e) => {\n if (e.key === ' ') {\n e.preventDefault();\n this.toggle();\n }\n };\n\n #onClick = () => {\n this.toggle();\n };\n\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'switch');\n }\n\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n\n this.addEventListener('click', this.#onClick);\n this.addEventListener('keydown', this.#onKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('click', this.#onClick);\n this.removeEventListener('keydown', this.#onKeyDown);\n }\n\n toggle(force) {\n if (!this.disabled) {\n this.checked = force ?? !this.checked;\n }\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('checked')) {\n this.setAttribute('aria-checked', this.checked.toString());\n /**\n * Custom event dispatched when the state of the toggle switch changes.\n *\n * @event ToggleSwitchComponent#change\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {Boolean} detail.checked - The new state of the toggle switch.\n */\n this.dispatchEvent(new CustomEvent('change', { detail: { checked: this.checked } }));\n }\n }\n\n render() {\n return html`\n
\n
\n
\n `;\n }\n}\n\ncustomElements.define('toggle-switch', ToggleSwitchComponent);\n","import router from '../../../router/router';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport '../../../components/toggle-switch/toggle-switch-component.js';\nimport PreferencesProvider from './preferences-provider';\nimport componentCss from './settings-page.scss?inline';\nimport ilProvider from '../../../utils/il-provider.js';\n\n/**\n * A web component that represents the settings page.\n *\n * @element settings-page\n */\nexport class SettingsPage extends LitElement {\n static properties = {\n autoplay: { type: Boolean, state: true },\n muted: { type: Boolean, state: true },\n debug: { type: Boolean, state: true },\n dataProviderHost: { type: String, state: true }\n };\n\n static styles = [theme, animations, unsafeCSS(componentCss)];\n\n constructor() {\n super();\n const preferences = PreferencesProvider.loadPreferences();\n\n this.autoplay = preferences.autoplay ?? false;\n this.muted = preferences.muted ?? true;\n this.debug = preferences.debug ?? false;\n this.dataProviderHost = preferences.dataProviderHost;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n const preferences = PreferencesProvider.loadPreferences();\n\n [..._changedProperties.keys()]\n .filter(property => ['autoplay', 'muted', 'debug', 'dataProviderHost'].includes(property))\n .forEach((property) => {\n preferences[property] = this[property];\n });\n\n PreferencesProvider.savePreferences(preferences);\n\n if (_changedProperties.has('debug')) {\n router.replaceState(this.debug ? { debug: 'true' } : {});\n }\n\n if (_changedProperties.has('dataProviderHost')) {\n ilProvider.host = this.dataProviderHost;\n }\n }\n\n #renderToggle(property, label) {\n return html`\n
\n \n {\n this[property] = e.detail.checked;\n }}\">\n \n
\n `;\n }\n\n #renderInput(property, label) {\n return html`\n
\n \n {\n this[property] = e.target.value === '' ? undefined : e.target.value;\n }}\">\n
\n `;\n }\n\n render() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n

Player Settings

\n ${this.#renderToggle('autoplay', 'Autoplay')}\n ${this.#renderToggle('muted', 'Player starts muted')}\n ${this.#renderToggle('debug', 'Enable debug mode')}\n ${this.#renderInput('dataProviderHost', 'Data provider host')}\n
\n `;\n }\n}\n\ncustomElements.define('settings-page', SettingsPage);\nrouter.addRoute('settings', 'settings-page');\n","/* eslint-disable no-multi-assign */\n\nfunction deepFreeze(obj) {\n if (obj instanceof Map) {\n obj.clear =\n obj.delete =\n obj.set =\n function () {\n throw new Error('map is read-only');\n };\n } else if (obj instanceof Set) {\n obj.add =\n obj.clear =\n obj.delete =\n function () {\n throw new Error('set is read-only');\n };\n }\n\n // Freeze self\n Object.freeze(obj);\n\n Object.getOwnPropertyNames(obj).forEach((name) => {\n const prop = obj[name];\n const type = typeof prop;\n\n // Freeze prop if it is an object or function and also not already frozen\n if ((type === 'object' || type === 'function') && !Object.isFrozen(prop)) {\n deepFreeze(prop);\n }\n });\n\n return obj;\n}\n\n/** @typedef {import('highlight.js').CallbackResponse} CallbackResponse */\n/** @typedef {import('highlight.js').CompiledMode} CompiledMode */\n/** @implements CallbackResponse */\n\nclass Response {\n /**\n * @param {CompiledMode} mode\n */\n constructor(mode) {\n // eslint-disable-next-line no-undefined\n if (mode.data === undefined) mode.data = {};\n\n this.data = mode.data;\n this.isMatchIgnored = false;\n }\n\n ignoreMatch() {\n this.isMatchIgnored = true;\n }\n}\n\n/**\n * @param {string} value\n * @returns {string}\n */\nfunction escapeHTML(value) {\n return value\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\n/**\n * performs a shallow merge of multiple objects into one\n *\n * @template T\n * @param {T} original\n * @param {Record[]} objects\n * @returns {T} a single new object\n */\nfunction inherit$1(original, ...objects) {\n /** @type Record */\n const result = Object.create(null);\n\n for (const key in original) {\n result[key] = original[key];\n }\n objects.forEach(function(obj) {\n for (const key in obj) {\n result[key] = obj[key];\n }\n });\n return /** @type {T} */ (result);\n}\n\n/**\n * @typedef {object} Renderer\n * @property {(text: string) => void} addText\n * @property {(node: Node) => void} openNode\n * @property {(node: Node) => void} closeNode\n * @property {() => string} value\n */\n\n/** @typedef {{scope?: string, language?: string, sublanguage?: boolean}} Node */\n/** @typedef {{walk: (r: Renderer) => void}} Tree */\n/** */\n\nconst SPAN_CLOSE = '';\n\n/**\n * Determines if a node needs to be wrapped in \n *\n * @param {Node} node */\nconst emitsWrappingTags = (node) => {\n // rarely we can have a sublanguage where language is undefined\n // TODO: track down why\n return !!node.scope;\n};\n\n/**\n *\n * @param {string} name\n * @param {{prefix:string}} options\n */\nconst scopeToCSSClass = (name, { prefix }) => {\n // sub-language\n if (name.startsWith(\"language:\")) {\n return name.replace(\"language:\", \"language-\");\n }\n // tiered scope: comment.line\n if (name.includes(\".\")) {\n const pieces = name.split(\".\");\n return [\n `${prefix}${pieces.shift()}`,\n ...(pieces.map((x, i) => `${x}${\"_\".repeat(i + 1)}`))\n ].join(\" \");\n }\n // simple scope\n return `${prefix}${name}`;\n};\n\n/** @type {Renderer} */\nclass HTMLRenderer {\n /**\n * Creates a new HTMLRenderer\n *\n * @param {Tree} parseTree - the parse tree (must support `walk` API)\n * @param {{classPrefix: string}} options\n */\n constructor(parseTree, options) {\n this.buffer = \"\";\n this.classPrefix = options.classPrefix;\n parseTree.walk(this);\n }\n\n /**\n * Adds texts to the output stream\n *\n * @param {string} text */\n addText(text) {\n this.buffer += escapeHTML(text);\n }\n\n /**\n * Adds a node open to the output stream (if needed)\n *\n * @param {Node} node */\n openNode(node) {\n if (!emitsWrappingTags(node)) return;\n\n const className = scopeToCSSClass(node.scope,\n { prefix: this.classPrefix });\n this.span(className);\n }\n\n /**\n * Adds a node close to the output stream (if needed)\n *\n * @param {Node} node */\n closeNode(node) {\n if (!emitsWrappingTags(node)) return;\n\n this.buffer += SPAN_CLOSE;\n }\n\n /**\n * returns the accumulated buffer\n */\n value() {\n return this.buffer;\n }\n\n // helpers\n\n /**\n * Builds a span element\n *\n * @param {string} className */\n span(className) {\n this.buffer += ``;\n }\n}\n\n/** @typedef {{scope?: string, language?: string, children: Node[]} | string} Node */\n/** @typedef {{scope?: string, language?: string, children: Node[]} } DataNode */\n/** @typedef {import('highlight.js').Emitter} Emitter */\n/** */\n\n/** @returns {DataNode} */\nconst newNode = (opts = {}) => {\n /** @type DataNode */\n const result = { children: [] };\n Object.assign(result, opts);\n return result;\n};\n\nclass TokenTree {\n constructor() {\n /** @type DataNode */\n this.rootNode = newNode();\n this.stack = [this.rootNode];\n }\n\n get top() {\n return this.stack[this.stack.length - 1];\n }\n\n get root() { return this.rootNode; }\n\n /** @param {Node} node */\n add(node) {\n this.top.children.push(node);\n }\n\n /** @param {string} scope */\n openNode(scope) {\n /** @type Node */\n const node = newNode({ scope });\n this.add(node);\n this.stack.push(node);\n }\n\n closeNode() {\n if (this.stack.length > 1) {\n return this.stack.pop();\n }\n // eslint-disable-next-line no-undefined\n return undefined;\n }\n\n closeAllNodes() {\n while (this.closeNode());\n }\n\n toJSON() {\n return JSON.stringify(this.rootNode, null, 4);\n }\n\n /**\n * @typedef { import(\"./html_renderer\").Renderer } Renderer\n * @param {Renderer} builder\n */\n walk(builder) {\n // this does not\n return this.constructor._walk(builder, this.rootNode);\n // this works\n // return TokenTree._walk(builder, this.rootNode);\n }\n\n /**\n * @param {Renderer} builder\n * @param {Node} node\n */\n static _walk(builder, node) {\n if (typeof node === \"string\") {\n builder.addText(node);\n } else if (node.children) {\n builder.openNode(node);\n node.children.forEach((child) => this._walk(builder, child));\n builder.closeNode(node);\n }\n return builder;\n }\n\n /**\n * @param {Node} node\n */\n static _collapse(node) {\n if (typeof node === \"string\") return;\n if (!node.children) return;\n\n if (node.children.every(el => typeof el === \"string\")) {\n // node.text = node.children.join(\"\");\n // delete node.children;\n node.children = [node.children.join(\"\")];\n } else {\n node.children.forEach((child) => {\n TokenTree._collapse(child);\n });\n }\n }\n}\n\n/**\n Currently this is all private API, but this is the minimal API necessary\n that an Emitter must implement to fully support the parser.\n\n Minimal interface:\n\n - addText(text)\n - __addSublanguage(emitter, subLanguageName)\n - startScope(scope)\n - endScope()\n - finalize()\n - toHTML()\n\n*/\n\n/**\n * @implements {Emitter}\n */\nclass TokenTreeEmitter extends TokenTree {\n /**\n * @param {*} options\n */\n constructor(options) {\n super();\n this.options = options;\n }\n\n /**\n * @param {string} text\n */\n addText(text) {\n if (text === \"\") { return; }\n\n this.add(text);\n }\n\n /** @param {string} scope */\n startScope(scope) {\n this.openNode(scope);\n }\n\n endScope() {\n this.closeNode();\n }\n\n /**\n * @param {Emitter & {root: DataNode}} emitter\n * @param {string} name\n */\n __addSublanguage(emitter, name) {\n /** @type DataNode */\n const node = emitter.root;\n if (name) node.scope = `language:${name}`;\n\n this.add(node);\n }\n\n toHTML() {\n const renderer = new HTMLRenderer(this, this.options);\n return renderer.value();\n }\n\n finalize() {\n this.closeAllNodes();\n return true;\n }\n}\n\n/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n return concat('(?=', re, ')');\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction anyNumberOfTimes(re) {\n return concat('(?:', re, ')*');\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction optional(re) {\n return concat('(?:', re, ')?');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/**\n * @param { Array } args\n * @returns {object}\n */\nfunction stripOptionsFromArgs(args) {\n const opts = args[args.length - 1];\n\n if (typeof opts === 'object' && opts.constructor === Object) {\n args.splice(args.length - 1, 1);\n return opts;\n } else {\n return {};\n }\n}\n\n/** @typedef { {capture?: boolean} } RegexEitherOptions */\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args\n * @returns {string}\n */\nfunction either(...args) {\n /** @type { object & {capture?: boolean} } */\n const opts = stripOptionsFromArgs(args);\n const joined = '('\n + (opts.capture ? \"\" : \"?:\")\n + args.map((x) => source(x)).join(\"|\") + \")\";\n return joined;\n}\n\n/**\n * @param {RegExp | string} re\n * @returns {number}\n */\nfunction countMatchGroups(re) {\n return (new RegExp(re.toString() + '|')).exec('').length - 1;\n}\n\n/**\n * Does lexeme start with a regular expression match at the beginning\n * @param {RegExp} re\n * @param {string} lexeme\n */\nfunction startsWith(re, lexeme) {\n const match = re && re.exec(lexeme);\n return match && match.index === 0;\n}\n\n// BACKREF_RE matches an open parenthesis or backreference. To avoid\n// an incorrect parse, it additionally matches the following:\n// - [...] elements, where the meaning of parentheses and escapes change\n// - other escape sequences, so we do not misparse escape sequences as\n// interesting elements\n// - non-matching or lookahead parentheses, which do not capture. These\n// follow the '(' with a '?'.\nconst BACKREF_RE = /\\[(?:[^\\\\\\]]|\\\\.)*\\]|\\(\\??|\\\\([1-9][0-9]*)|\\\\./;\n\n// **INTERNAL** Not intended for outside usage\n// join logically computes regexps.join(separator), but fixes the\n// backreferences so they continue to match.\n// it also places each individual regular expression into it's own\n// match group, keeping track of the sequencing of those match groups\n// is currently an exercise for the caller. :-)\n/**\n * @param {(string | RegExp)[]} regexps\n * @param {{joinWith: string}} opts\n * @returns {string}\n */\nfunction _rewriteBackreferences(regexps, { joinWith }) {\n let numCaptures = 0;\n\n return regexps.map((regex) => {\n numCaptures += 1;\n const offset = numCaptures;\n let re = source(regex);\n let out = '';\n\n while (re.length > 0) {\n const match = BACKREF_RE.exec(re);\n if (!match) {\n out += re;\n break;\n }\n out += re.substring(0, match.index);\n re = re.substring(match.index + match[0].length);\n if (match[0][0] === '\\\\' && match[1]) {\n // Adjust the backreference.\n out += '\\\\' + String(Number(match[1]) + offset);\n } else {\n out += match[0];\n if (match[0] === '(') {\n numCaptures++;\n }\n }\n }\n return out;\n }).map(re => `(${re})`).join(joinWith);\n}\n\n/** @typedef {import('highlight.js').Mode} Mode */\n/** @typedef {import('highlight.js').ModeCallback} ModeCallback */\n\n// Common regexps\nconst MATCH_NOTHING_RE = /\\b\\B/;\nconst IDENT_RE = '[a-zA-Z]\\\\w*';\nconst UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\\\w*';\nconst NUMBER_RE = '\\\\b\\\\d+(\\\\.\\\\d+)?';\nconst C_NUMBER_RE = '(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)'; // 0x..., 0..., decimal, float\nconst BINARY_NUMBER_RE = '\\\\b(0b[01]+)'; // 0b...\nconst RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~';\n\n/**\n* @param { Partial & {binary?: string | RegExp} } opts\n*/\nconst SHEBANG = (opts = {}) => {\n const beginShebang = /^#![ ]*\\//;\n if (opts.binary) {\n opts.begin = concat(\n beginShebang,\n /.*\\b/,\n opts.binary,\n /\\b.*/);\n }\n return inherit$1({\n scope: 'meta',\n begin: beginShebang,\n end: /$/,\n relevance: 0,\n /** @type {ModeCallback} */\n \"on:begin\": (m, resp) => {\n if (m.index !== 0) resp.ignoreMatch();\n }\n }, opts);\n};\n\n// Common modes\nconst BACKSLASH_ESCAPE = {\n begin: '\\\\\\\\[\\\\s\\\\S]', relevance: 0\n};\nconst APOS_STRING_MODE = {\n scope: 'string',\n begin: '\\'',\n end: '\\'',\n illegal: '\\\\n',\n contains: [BACKSLASH_ESCAPE]\n};\nconst QUOTE_STRING_MODE = {\n scope: 'string',\n begin: '\"',\n end: '\"',\n illegal: '\\\\n',\n contains: [BACKSLASH_ESCAPE]\n};\nconst PHRASAL_WORDS_MODE = {\n begin: /\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/\n};\n/**\n * Creates a comment mode\n *\n * @param {string | RegExp} begin\n * @param {string | RegExp} end\n * @param {Mode | {}} [modeOptions]\n * @returns {Partial}\n */\nconst COMMENT = function(begin, end, modeOptions = {}) {\n const mode = inherit$1(\n {\n scope: 'comment',\n begin,\n end,\n contains: []\n },\n modeOptions\n );\n mode.contains.push({\n scope: 'doctag',\n // hack to avoid the space from being included. the space is necessary to\n // match here to prevent the plain text rule below from gobbling up doctags\n begin: '[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)',\n end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,\n excludeBegin: true,\n relevance: 0\n });\n const ENGLISH_WORD = either(\n // list of common 1 and 2 letter words in English\n \"I\",\n \"a\",\n \"is\",\n \"so\",\n \"us\",\n \"to\",\n \"at\",\n \"if\",\n \"in\",\n \"it\",\n \"on\",\n // note: this is not an exhaustive list of contractions, just popular ones\n /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, // contractions - can't we'd they're let's, etc\n /[A-Za-z]+[-][a-z]+/, // `no-way`, etc.\n /[A-Za-z][a-z]{2,}/ // allow capitalized words at beginning of sentences\n );\n // looking like plain text, more likely to be a comment\n mode.contains.push(\n {\n // TODO: how to include \", (, ) without breaking grammars that use these for\n // comment delimiters?\n // begin: /[ ]+([()\"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()\":]?([.][ ]|[ ]|\\))){3}/\n // ---\n\n // this tries to find sequences of 3 english words in a row (without any\n // \"programming\" type syntax) this gives us a strong signal that we've\n // TRULY found a comment - vs perhaps scanning with the wrong language.\n // It's possible to find something that LOOKS like the start of the\n // comment - but then if there is no readable text - good chance it is a\n // false match and not a comment.\n //\n // for a visual example please see:\n // https://github.com/highlightjs/highlight.js/issues/2827\n\n begin: concat(\n /[ ]+/, // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */\n '(',\n ENGLISH_WORD,\n /[.]?[:]?([.][ ]|[ ])/,\n '){3}') // look for 3 words in a row\n }\n );\n return mode;\n};\nconst C_LINE_COMMENT_MODE = COMMENT('//', '$');\nconst C_BLOCK_COMMENT_MODE = COMMENT('/\\\\*', '\\\\*/');\nconst HASH_COMMENT_MODE = COMMENT('#', '$');\nconst NUMBER_MODE = {\n scope: 'number',\n begin: NUMBER_RE,\n relevance: 0\n};\nconst C_NUMBER_MODE = {\n scope: 'number',\n begin: C_NUMBER_RE,\n relevance: 0\n};\nconst BINARY_NUMBER_MODE = {\n scope: 'number',\n begin: BINARY_NUMBER_RE,\n relevance: 0\n};\nconst REGEXP_MODE = {\n scope: \"regexp\",\n begin: /\\/(?=[^/\\n]*\\/)/,\n end: /\\/[gimuy]*/,\n contains: [\n BACKSLASH_ESCAPE,\n {\n begin: /\\[/,\n end: /\\]/,\n relevance: 0,\n contains: [BACKSLASH_ESCAPE]\n }\n ]\n};\nconst TITLE_MODE = {\n scope: 'title',\n begin: IDENT_RE,\n relevance: 0\n};\nconst UNDERSCORE_TITLE_MODE = {\n scope: 'title',\n begin: UNDERSCORE_IDENT_RE,\n relevance: 0\n};\nconst METHOD_GUARD = {\n // excludes method names from keyword processing\n begin: '\\\\.\\\\s*' + UNDERSCORE_IDENT_RE,\n relevance: 0\n};\n\n/**\n * Adds end same as begin mechanics to a mode\n *\n * Your mode must include at least a single () match group as that first match\n * group is what is used for comparison\n * @param {Partial} mode\n */\nconst END_SAME_AS_BEGIN = function(mode) {\n return Object.assign(mode,\n {\n /** @type {ModeCallback} */\n 'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },\n /** @type {ModeCallback} */\n 'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }\n });\n};\n\nvar MODES = /*#__PURE__*/Object.freeze({\n __proto__: null,\n APOS_STRING_MODE: APOS_STRING_MODE,\n BACKSLASH_ESCAPE: BACKSLASH_ESCAPE,\n BINARY_NUMBER_MODE: BINARY_NUMBER_MODE,\n BINARY_NUMBER_RE: BINARY_NUMBER_RE,\n COMMENT: COMMENT,\n C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE,\n C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE,\n C_NUMBER_MODE: C_NUMBER_MODE,\n C_NUMBER_RE: C_NUMBER_RE,\n END_SAME_AS_BEGIN: END_SAME_AS_BEGIN,\n HASH_COMMENT_MODE: HASH_COMMENT_MODE,\n IDENT_RE: IDENT_RE,\n MATCH_NOTHING_RE: MATCH_NOTHING_RE,\n METHOD_GUARD: METHOD_GUARD,\n NUMBER_MODE: NUMBER_MODE,\n NUMBER_RE: NUMBER_RE,\n PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE,\n QUOTE_STRING_MODE: QUOTE_STRING_MODE,\n REGEXP_MODE: REGEXP_MODE,\n RE_STARTERS_RE: RE_STARTERS_RE,\n SHEBANG: SHEBANG,\n TITLE_MODE: TITLE_MODE,\n UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE,\n UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE\n});\n\n/**\n@typedef {import('highlight.js').CallbackResponse} CallbackResponse\n@typedef {import('highlight.js').CompilerExt} CompilerExt\n*/\n\n// Grammar extensions / plugins\n// See: https://github.com/highlightjs/highlight.js/issues/2833\n\n// Grammar extensions allow \"syntactic sugar\" to be added to the grammar modes\n// without requiring any underlying changes to the compiler internals.\n\n// `compileMatch` being the perfect small example of now allowing a grammar\n// author to write `match` when they desire to match a single expression rather\n// than being forced to use `begin`. The extension then just moves `match` into\n// `begin` when it runs. Ie, no features have been added, but we've just made\n// the experience of writing (and reading grammars) a little bit nicer.\n\n// ------\n\n// TODO: We need negative look-behind support to do this properly\n/**\n * Skip a match if it has a preceding dot\n *\n * This is used for `beginKeywords` to prevent matching expressions such as\n * `bob.keyword.do()`. The mode compiler automatically wires this up as a\n * special _internal_ 'on:begin' callback for modes with `beginKeywords`\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\nfunction skipIfHasPrecedingDot(match, response) {\n const before = match.input[match.index - 1];\n if (before === \".\") {\n response.ignoreMatch();\n }\n}\n\n/**\n *\n * @type {CompilerExt}\n */\nfunction scopeClassName(mode, _parent) {\n // eslint-disable-next-line no-undefined\n if (mode.className !== undefined) {\n mode.scope = mode.className;\n delete mode.className;\n }\n}\n\n/**\n * `beginKeywords` syntactic sugar\n * @type {CompilerExt}\n */\nfunction beginKeywords(mode, parent) {\n if (!parent) return;\n if (!mode.beginKeywords) return;\n\n // for languages with keywords that include non-word characters checking for\n // a word boundary is not sufficient, so instead we check for a word boundary\n // or whitespace - this does no harm in any case since our keyword engine\n // doesn't allow spaces in keywords anyways and we still check for the boundary\n // first\n mode.begin = '\\\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?!\\\\.)(?=\\\\b|\\\\s)';\n mode.__beforeBegin = skipIfHasPrecedingDot;\n mode.keywords = mode.keywords || mode.beginKeywords;\n delete mode.beginKeywords;\n\n // prevents double relevance, the keywords themselves provide\n // relevance, the mode doesn't need to double it\n // eslint-disable-next-line no-undefined\n if (mode.relevance === undefined) mode.relevance = 0;\n}\n\n/**\n * Allow `illegal` to contain an array of illegal values\n * @type {CompilerExt}\n */\nfunction compileIllegal(mode, _parent) {\n if (!Array.isArray(mode.illegal)) return;\n\n mode.illegal = either(...mode.illegal);\n}\n\n/**\n * `match` to match a single expression for readability\n * @type {CompilerExt}\n */\nfunction compileMatch(mode, _parent) {\n if (!mode.match) return;\n if (mode.begin || mode.end) throw new Error(\"begin & end are not supported with match\");\n\n mode.begin = mode.match;\n delete mode.match;\n}\n\n/**\n * provides the default 1 relevance to all modes\n * @type {CompilerExt}\n */\nfunction compileRelevance(mode, _parent) {\n // eslint-disable-next-line no-undefined\n if (mode.relevance === undefined) mode.relevance = 1;\n}\n\n// allow beforeMatch to act as a \"qualifier\" for the match\n// the full match begin must be [beforeMatch][begin]\nconst beforeMatchExt = (mode, parent) => {\n if (!mode.beforeMatch) return;\n // starts conflicts with endsParent which we need to make sure the child\n // rule is not matched multiple times\n if (mode.starts) throw new Error(\"beforeMatch cannot be used with starts\");\n\n const originalMode = Object.assign({}, mode);\n Object.keys(mode).forEach((key) => { delete mode[key]; });\n\n mode.keywords = originalMode.keywords;\n mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));\n mode.starts = {\n relevance: 0,\n contains: [\n Object.assign(originalMode, { endsParent: true })\n ]\n };\n mode.relevance = 0;\n\n delete originalMode.beforeMatch;\n};\n\n// keywords that should have no default relevance value\nconst COMMON_KEYWORDS = [\n 'of',\n 'and',\n 'for',\n 'in',\n 'not',\n 'or',\n 'if',\n 'then',\n 'parent', // common variable name\n 'list', // common variable name\n 'value' // common variable name\n];\n\nconst DEFAULT_KEYWORD_SCOPE = \"keyword\";\n\n/**\n * Given raw keywords from a language definition, compile them.\n *\n * @param {string | Record | Array} rawKeywords\n * @param {boolean} caseInsensitive\n */\nfunction compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {\n /** @type {import(\"highlight.js/private\").KeywordDict} */\n const compiledKeywords = Object.create(null);\n\n // input can be a string of keywords, an array of keywords, or a object with\n // named keys representing scopeName (which can then point to a string or array)\n if (typeof rawKeywords === 'string') {\n compileList(scopeName, rawKeywords.split(\" \"));\n } else if (Array.isArray(rawKeywords)) {\n compileList(scopeName, rawKeywords);\n } else {\n Object.keys(rawKeywords).forEach(function(scopeName) {\n // collapse all our objects back into the parent object\n Object.assign(\n compiledKeywords,\n compileKeywords(rawKeywords[scopeName], caseInsensitive, scopeName)\n );\n });\n }\n return compiledKeywords;\n\n // ---\n\n /**\n * Compiles an individual list of keywords\n *\n * Ex: \"for if when while|5\"\n *\n * @param {string} scopeName\n * @param {Array} keywordList\n */\n function compileList(scopeName, keywordList) {\n if (caseInsensitive) {\n keywordList = keywordList.map(x => x.toLowerCase());\n }\n keywordList.forEach(function(keyword) {\n const pair = keyword.split('|');\n compiledKeywords[pair[0]] = [scopeName, scoreForKeyword(pair[0], pair[1])];\n });\n }\n}\n\n/**\n * Returns the proper score for a given keyword\n *\n * Also takes into account comment keywords, which will be scored 0 UNLESS\n * another score has been manually assigned.\n * @param {string} keyword\n * @param {string} [providedScore]\n */\nfunction scoreForKeyword(keyword, providedScore) {\n // manual scores always win over common keywords\n // so you can force a score of 1 if you really insist\n if (providedScore) {\n return Number(providedScore);\n }\n\n return commonKeyword(keyword) ? 0 : 1;\n}\n\n/**\n * Determines if a given keyword is common or not\n *\n * @param {string} keyword */\nfunction commonKeyword(keyword) {\n return COMMON_KEYWORDS.includes(keyword.toLowerCase());\n}\n\n/*\n\nFor the reasoning behind this please see:\nhttps://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419\n\n*/\n\n/**\n * @type {Record}\n */\nconst seenDeprecations = {};\n\n/**\n * @param {string} message\n */\nconst error = (message) => {\n console.error(message);\n};\n\n/**\n * @param {string} message\n * @param {any} args\n */\nconst warn = (message, ...args) => {\n console.log(`WARN: ${message}`, ...args);\n};\n\n/**\n * @param {string} version\n * @param {string} message\n */\nconst deprecated = (version, message) => {\n if (seenDeprecations[`${version}/${message}`]) return;\n\n console.log(`Deprecated as of ${version}. ${message}`);\n seenDeprecations[`${version}/${message}`] = true;\n};\n\n/* eslint-disable no-throw-literal */\n\n/**\n@typedef {import('highlight.js').CompiledMode} CompiledMode\n*/\n\nconst MultiClassError = new Error();\n\n/**\n * Renumbers labeled scope names to account for additional inner match\n * groups that otherwise would break everything.\n *\n * Lets say we 3 match scopes:\n *\n * { 1 => ..., 2 => ..., 3 => ... }\n *\n * So what we need is a clean match like this:\n *\n * (a)(b)(c) => [ \"a\", \"b\", \"c\" ]\n *\n * But this falls apart with inner match groups:\n *\n * (a)(((b)))(c) => [\"a\", \"b\", \"b\", \"b\", \"c\" ]\n *\n * Our scopes are now \"out of alignment\" and we're repeating `b` 3 times.\n * What needs to happen is the numbers are remapped:\n *\n * { 1 => ..., 2 => ..., 5 => ... }\n *\n * We also need to know that the ONLY groups that should be output\n * are 1, 2, and 5. This function handles this behavior.\n *\n * @param {CompiledMode} mode\n * @param {Array} regexes\n * @param {{key: \"beginScope\"|\"endScope\"}} opts\n */\nfunction remapScopeNames(mode, regexes, { key }) {\n let offset = 0;\n const scopeNames = mode[key];\n /** @type Record */\n const emit = {};\n /** @type Record */\n const positions = {};\n\n for (let i = 1; i <= regexes.length; i++) {\n positions[i + offset] = scopeNames[i];\n emit[i + offset] = true;\n offset += countMatchGroups(regexes[i - 1]);\n }\n // we use _emit to keep track of which match groups are \"top-level\" to avoid double\n // output from inside match groups\n mode[key] = positions;\n mode[key]._emit = emit;\n mode[key]._multi = true;\n}\n\n/**\n * @param {CompiledMode} mode\n */\nfunction beginMultiClass(mode) {\n if (!Array.isArray(mode.begin)) return;\n\n if (mode.skip || mode.excludeBegin || mode.returnBegin) {\n error(\"skip, excludeBegin, returnBegin not compatible with beginScope: {}\");\n throw MultiClassError;\n }\n\n if (typeof mode.beginScope !== \"object\" || mode.beginScope === null) {\n error(\"beginScope must be object\");\n throw MultiClassError;\n }\n\n remapScopeNames(mode, mode.begin, { key: \"beginScope\" });\n mode.begin = _rewriteBackreferences(mode.begin, { joinWith: \"\" });\n}\n\n/**\n * @param {CompiledMode} mode\n */\nfunction endMultiClass(mode) {\n if (!Array.isArray(mode.end)) return;\n\n if (mode.skip || mode.excludeEnd || mode.returnEnd) {\n error(\"skip, excludeEnd, returnEnd not compatible with endScope: {}\");\n throw MultiClassError;\n }\n\n if (typeof mode.endScope !== \"object\" || mode.endScope === null) {\n error(\"endScope must be object\");\n throw MultiClassError;\n }\n\n remapScopeNames(mode, mode.end, { key: \"endScope\" });\n mode.end = _rewriteBackreferences(mode.end, { joinWith: \"\" });\n}\n\n/**\n * this exists only to allow `scope: {}` to be used beside `match:`\n * Otherwise `beginScope` would necessary and that would look weird\n\n {\n match: [ /def/, /\\w+/ ]\n scope: { 1: \"keyword\" , 2: \"title\" }\n }\n\n * @param {CompiledMode} mode\n */\nfunction scopeSugar(mode) {\n if (mode.scope && typeof mode.scope === \"object\" && mode.scope !== null) {\n mode.beginScope = mode.scope;\n delete mode.scope;\n }\n}\n\n/**\n * @param {CompiledMode} mode\n */\nfunction MultiClass(mode) {\n scopeSugar(mode);\n\n if (typeof mode.beginScope === \"string\") {\n mode.beginScope = { _wrap: mode.beginScope };\n }\n if (typeof mode.endScope === \"string\") {\n mode.endScope = { _wrap: mode.endScope };\n }\n\n beginMultiClass(mode);\n endMultiClass(mode);\n}\n\n/**\n@typedef {import('highlight.js').Mode} Mode\n@typedef {import('highlight.js').CompiledMode} CompiledMode\n@typedef {import('highlight.js').Language} Language\n@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin\n@typedef {import('highlight.js').CompiledLanguage} CompiledLanguage\n*/\n\n// compilation\n\n/**\n * Compiles a language definition result\n *\n * Given the raw result of a language definition (Language), compiles this so\n * that it is ready for highlighting code.\n * @param {Language} language\n * @returns {CompiledLanguage}\n */\nfunction compileLanguage(language) {\n /**\n * Builds a regex with the case sensitivity of the current language\n *\n * @param {RegExp | string} value\n * @param {boolean} [global]\n */\n function langRe(value, global) {\n return new RegExp(\n source(value),\n 'm'\n + (language.case_insensitive ? 'i' : '')\n + (language.unicodeRegex ? 'u' : '')\n + (global ? 'g' : '')\n );\n }\n\n /**\n Stores multiple regular expressions and allows you to quickly search for\n them all in a string simultaneously - returning the first match. It does\n this by creating a huge (a|b|c) regex - each individual item wrapped with ()\n and joined by `|` - using match groups to track position. When a match is\n found checking which position in the array has content allows us to figure\n out which of the original regexes / match groups triggered the match.\n\n The match object itself (the result of `Regex.exec`) is returned but also\n enhanced by merging in any meta-data that was registered with the regex.\n This is how we keep track of which mode matched, and what type of rule\n (`illegal`, `begin`, end, etc).\n */\n class MultiRegex {\n constructor() {\n this.matchIndexes = {};\n // @ts-ignore\n this.regexes = [];\n this.matchAt = 1;\n this.position = 0;\n }\n\n // @ts-ignore\n addRule(re, opts) {\n opts.position = this.position++;\n // @ts-ignore\n this.matchIndexes[this.matchAt] = opts;\n this.regexes.push([opts, re]);\n this.matchAt += countMatchGroups(re) + 1;\n }\n\n compile() {\n if (this.regexes.length === 0) {\n // avoids the need to check length every time exec is called\n // @ts-ignore\n this.exec = () => null;\n }\n const terminators = this.regexes.map(el => el[1]);\n this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: '|' }), true);\n this.lastIndex = 0;\n }\n\n /** @param {string} s */\n exec(s) {\n this.matcherRe.lastIndex = this.lastIndex;\n const match = this.matcherRe.exec(s);\n if (!match) { return null; }\n\n // eslint-disable-next-line no-undefined\n const i = match.findIndex((el, i) => i > 0 && el !== undefined);\n // @ts-ignore\n const matchData = this.matchIndexes[i];\n // trim off any earlier non-relevant match groups (ie, the other regex\n // match groups that make up the multi-matcher)\n match.splice(0, i);\n\n return Object.assign(match, matchData);\n }\n }\n\n /*\n Created to solve the key deficiently with MultiRegex - there is no way to\n test for multiple matches at a single location. Why would we need to do\n that? In the future a more dynamic engine will allow certain matches to be\n ignored. An example: if we matched say the 3rd regex in a large group but\n decided to ignore it - we'd need to started testing again at the 4th\n regex... but MultiRegex itself gives us no real way to do that.\n\n So what this class creates MultiRegexs on the fly for whatever search\n position they are needed.\n\n NOTE: These additional MultiRegex objects are created dynamically. For most\n grammars most of the time we will never actually need anything more than the\n first MultiRegex - so this shouldn't have too much overhead.\n\n Say this is our search group, and we match regex3, but wish to ignore it.\n\n regex1 | regex2 | regex3 | regex4 | regex5 ' ie, startAt = 0\n\n What we need is a new MultiRegex that only includes the remaining\n possibilities:\n\n regex4 | regex5 ' ie, startAt = 3\n\n This class wraps all that complexity up in a simple API... `startAt` decides\n where in the array of expressions to start doing the matching. It\n auto-increments, so if a match is found at position 2, then startAt will be\n set to 3. If the end is reached startAt will return to 0.\n\n MOST of the time the parser will be setting startAt manually to 0.\n */\n class ResumableMultiRegex {\n constructor() {\n // @ts-ignore\n this.rules = [];\n // @ts-ignore\n this.multiRegexes = [];\n this.count = 0;\n\n this.lastIndex = 0;\n this.regexIndex = 0;\n }\n\n // @ts-ignore\n getMatcher(index) {\n if (this.multiRegexes[index]) return this.multiRegexes[index];\n\n const matcher = new MultiRegex();\n this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));\n matcher.compile();\n this.multiRegexes[index] = matcher;\n return matcher;\n }\n\n resumingScanAtSamePosition() {\n return this.regexIndex !== 0;\n }\n\n considerAll() {\n this.regexIndex = 0;\n }\n\n // @ts-ignore\n addRule(re, opts) {\n this.rules.push([re, opts]);\n if (opts.type === \"begin\") this.count++;\n }\n\n /** @param {string} s */\n exec(s) {\n const m = this.getMatcher(this.regexIndex);\n m.lastIndex = this.lastIndex;\n let result = m.exec(s);\n\n // The following is because we have no easy way to say \"resume scanning at the\n // existing position but also skip the current rule ONLY\". What happens is\n // all prior rules are also skipped which can result in matching the wrong\n // thing. Example of matching \"booger\":\n\n // our matcher is [string, \"booger\", number]\n //\n // ....booger....\n\n // if \"booger\" is ignored then we'd really need a regex to scan from the\n // SAME position for only: [string, number] but ignoring \"booger\" (if it\n // was the first match), a simple resume would scan ahead who knows how\n // far looking only for \"number\", ignoring potential string matches (or\n // future \"booger\" matches that might be valid.)\n\n // So what we do: We execute two matchers, one resuming at the same\n // position, but the second full matcher starting at the position after:\n\n // /--- resume first regex match here (for [number])\n // |/---- full match here for [string, \"booger\", number]\n // vv\n // ....booger....\n\n // Which ever results in a match first is then used. So this 3-4 step\n // process essentially allows us to say \"match at this position, excluding\n // a prior rule that was ignored\".\n //\n // 1. Match \"booger\" first, ignore. Also proves that [string] does non match.\n // 2. Resume matching for [number]\n // 3. Match at index + 1 for [string, \"booger\", number]\n // 4. If #2 and #3 result in matches, which came first?\n if (this.resumingScanAtSamePosition()) {\n if (result && result.index === this.lastIndex) ; else { // use the second matcher result\n const m2 = this.getMatcher(0);\n m2.lastIndex = this.lastIndex + 1;\n result = m2.exec(s);\n }\n }\n\n if (result) {\n this.regexIndex += result.position + 1;\n if (this.regexIndex === this.count) {\n // wrap-around to considering all matches again\n this.considerAll();\n }\n }\n\n return result;\n }\n }\n\n /**\n * Given a mode, builds a huge ResumableMultiRegex that can be used to walk\n * the content and find matches.\n *\n * @param {CompiledMode} mode\n * @returns {ResumableMultiRegex}\n */\n function buildModeRegex(mode) {\n const mm = new ResumableMultiRegex();\n\n mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: \"begin\" }));\n\n if (mode.terminatorEnd) {\n mm.addRule(mode.terminatorEnd, { type: \"end\" });\n }\n if (mode.illegal) {\n mm.addRule(mode.illegal, { type: \"illegal\" });\n }\n\n return mm;\n }\n\n /** skip vs abort vs ignore\n *\n * @skip - The mode is still entered and exited normally (and contains rules apply),\n * but all content is held and added to the parent buffer rather than being\n * output when the mode ends. Mostly used with `sublanguage` to build up\n * a single large buffer than can be parsed by sublanguage.\n *\n * - The mode begin ands ends normally.\n * - Content matched is added to the parent mode buffer.\n * - The parser cursor is moved forward normally.\n *\n * @abort - A hack placeholder until we have ignore. Aborts the mode (as if it\n * never matched) but DOES NOT continue to match subsequent `contains`\n * modes. Abort is bad/suboptimal because it can result in modes\n * farther down not getting applied because an earlier rule eats the\n * content but then aborts.\n *\n * - The mode does not begin.\n * - Content matched by `begin` is added to the mode buffer.\n * - The parser cursor is moved forward accordingly.\n *\n * @ignore - Ignores the mode (as if it never matched) and continues to match any\n * subsequent `contains` modes. Ignore isn't technically possible with\n * the current parser implementation.\n *\n * - The mode does not begin.\n * - Content matched by `begin` is ignored.\n * - The parser cursor is not moved forward.\n */\n\n /**\n * Compiles an individual mode\n *\n * This can raise an error if the mode contains certain detectable known logic\n * issues.\n * @param {Mode} mode\n * @param {CompiledMode | null} [parent]\n * @returns {CompiledMode | never}\n */\n function compileMode(mode, parent) {\n const cmode = /** @type CompiledMode */ (mode);\n if (mode.isCompiled) return cmode;\n\n [\n scopeClassName,\n // do this early so compiler extensions generally don't have to worry about\n // the distinction between match/begin\n compileMatch,\n MultiClass,\n beforeMatchExt\n ].forEach(ext => ext(mode, parent));\n\n language.compilerExtensions.forEach(ext => ext(mode, parent));\n\n // __beforeBegin is considered private API, internal use only\n mode.__beforeBegin = null;\n\n [\n beginKeywords,\n // do this later so compiler extensions that come earlier have access to the\n // raw array if they wanted to perhaps manipulate it, etc.\n compileIllegal,\n // default to 1 relevance if not specified\n compileRelevance\n ].forEach(ext => ext(mode, parent));\n\n mode.isCompiled = true;\n\n let keywordPattern = null;\n if (typeof mode.keywords === \"object\" && mode.keywords.$pattern) {\n // we need a copy because keywords might be compiled multiple times\n // so we can't go deleting $pattern from the original on the first\n // pass\n mode.keywords = Object.assign({}, mode.keywords);\n keywordPattern = mode.keywords.$pattern;\n delete mode.keywords.$pattern;\n }\n keywordPattern = keywordPattern || /\\w+/;\n\n if (mode.keywords) {\n mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);\n }\n\n cmode.keywordPatternRe = langRe(keywordPattern, true);\n\n if (parent) {\n if (!mode.begin) mode.begin = /\\B|\\b/;\n cmode.beginRe = langRe(cmode.begin);\n if (!mode.end && !mode.endsWithParent) mode.end = /\\B|\\b/;\n if (mode.end) cmode.endRe = langRe(cmode.end);\n cmode.terminatorEnd = source(cmode.end) || '';\n if (mode.endsWithParent && parent.terminatorEnd) {\n cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd;\n }\n }\n if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal));\n if (!mode.contains) mode.contains = [];\n\n mode.contains = [].concat(...mode.contains.map(function(c) {\n return expandOrCloneMode(c === 'self' ? mode : c);\n }));\n mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); });\n\n if (mode.starts) {\n compileMode(mode.starts, parent);\n }\n\n cmode.matcher = buildModeRegex(cmode);\n return cmode;\n }\n\n if (!language.compilerExtensions) language.compilerExtensions = [];\n\n // self is not valid at the top-level\n if (language.contains && language.contains.includes('self')) {\n throw new Error(\"ERR: contains `self` is not supported at the top-level of a language. See documentation.\");\n }\n\n // we need a null object, which inherit will guarantee\n language.classNameAliases = inherit$1(language.classNameAliases || {});\n\n return compileMode(/** @type Mode */ (language));\n}\n\n/**\n * Determines if a mode has a dependency on it's parent or not\n *\n * If a mode does have a parent dependency then often we need to clone it if\n * it's used in multiple places so that each copy points to the correct parent,\n * where-as modes without a parent can often safely be re-used at the bottom of\n * a mode chain.\n *\n * @param {Mode | null} mode\n * @returns {boolean} - is there a dependency on the parent?\n * */\nfunction dependencyOnParent(mode) {\n if (!mode) return false;\n\n return mode.endsWithParent || dependencyOnParent(mode.starts);\n}\n\n/**\n * Expands a mode or clones it if necessary\n *\n * This is necessary for modes with parental dependenceis (see notes on\n * `dependencyOnParent`) and for nodes that have `variants` - which must then be\n * exploded into their own individual modes at compile time.\n *\n * @param {Mode} mode\n * @returns {Mode | Mode[]}\n * */\nfunction expandOrCloneMode(mode) {\n if (mode.variants && !mode.cachedVariants) {\n mode.cachedVariants = mode.variants.map(function(variant) {\n return inherit$1(mode, { variants: null }, variant);\n });\n }\n\n // EXPAND\n // if we have variants then essentially \"replace\" the mode with the variants\n // this happens in compileMode, where this function is called from\n if (mode.cachedVariants) {\n return mode.cachedVariants;\n }\n\n // CLONE\n // if we have dependencies on parents then we need a unique\n // instance of ourselves, so we can be reused with many\n // different parents without issue\n if (dependencyOnParent(mode)) {\n return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });\n }\n\n if (Object.isFrozen(mode)) {\n return inherit$1(mode);\n }\n\n // no special dependency issues, just return ourselves\n return mode;\n}\n\nvar version = \"11.10.0\";\n\nclass HTMLInjectionError extends Error {\n constructor(reason, html) {\n super(reason);\n this.name = \"HTMLInjectionError\";\n this.html = html;\n }\n}\n\n/*\nSyntax highlighting with language autodetection.\nhttps://highlightjs.org/\n*/\n\n\n\n/**\n@typedef {import('highlight.js').Mode} Mode\n@typedef {import('highlight.js').CompiledMode} CompiledMode\n@typedef {import('highlight.js').CompiledScope} CompiledScope\n@typedef {import('highlight.js').Language} Language\n@typedef {import('highlight.js').HLJSApi} HLJSApi\n@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin\n@typedef {import('highlight.js').PluginEvent} PluginEvent\n@typedef {import('highlight.js').HLJSOptions} HLJSOptions\n@typedef {import('highlight.js').LanguageFn} LanguageFn\n@typedef {import('highlight.js').HighlightedHTMLElement} HighlightedHTMLElement\n@typedef {import('highlight.js').BeforeHighlightContext} BeforeHighlightContext\n@typedef {import('highlight.js/private').MatchType} MatchType\n@typedef {import('highlight.js/private').KeywordData} KeywordData\n@typedef {import('highlight.js/private').EnhancedMatch} EnhancedMatch\n@typedef {import('highlight.js/private').AnnotatedError} AnnotatedError\n@typedef {import('highlight.js').AutoHighlightResult} AutoHighlightResult\n@typedef {import('highlight.js').HighlightOptions} HighlightOptions\n@typedef {import('highlight.js').HighlightResult} HighlightResult\n*/\n\n\nconst escape = escapeHTML;\nconst inherit = inherit$1;\nconst NO_MATCH = Symbol(\"nomatch\");\nconst MAX_KEYWORD_HITS = 7;\n\n/**\n * @param {any} hljs - object that is extended (legacy)\n * @returns {HLJSApi}\n */\nconst HLJS = function(hljs) {\n // Global internal variables used within the highlight.js library.\n /** @type {Record} */\n const languages = Object.create(null);\n /** @type {Record} */\n const aliases = Object.create(null);\n /** @type {HLJSPlugin[]} */\n const plugins = [];\n\n // safe/production mode - swallows more errors, tries to keep running\n // even if a single syntax or parse hits a fatal error\n let SAFE_MODE = true;\n const LANGUAGE_NOT_FOUND = \"Could not find the language '{}', did you forget to load/include a language module?\";\n /** @type {Language} */\n const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] };\n\n // Global options used when within external APIs. This is modified when\n // calling the `hljs.configure` function.\n /** @type HLJSOptions */\n let options = {\n ignoreUnescapedHTML: false,\n throwUnescapedHTML: false,\n noHighlightRe: /^(no-?highlight)$/i,\n languageDetectRe: /\\blang(?:uage)?-([\\w-]+)\\b/i,\n classPrefix: 'hljs-',\n cssSelector: 'pre code',\n languages: null,\n // beta configuration options, subject to change, welcome to discuss\n // https://github.com/highlightjs/highlight.js/issues/1086\n __emitter: TokenTreeEmitter\n };\n\n /* Utility functions */\n\n /**\n * Tests a language name to see if highlighting should be skipped\n * @param {string} languageName\n */\n function shouldNotHighlight(languageName) {\n return options.noHighlightRe.test(languageName);\n }\n\n /**\n * @param {HighlightedHTMLElement} block - the HTML element to determine language for\n */\n function blockLanguage(block) {\n let classes = block.className + ' ';\n\n classes += block.parentNode ? block.parentNode.className : '';\n\n // language-* takes precedence over non-prefixed class names.\n const match = options.languageDetectRe.exec(classes);\n if (match) {\n const language = getLanguage(match[1]);\n if (!language) {\n warn(LANGUAGE_NOT_FOUND.replace(\"{}\", match[1]));\n warn(\"Falling back to no-highlight mode for this block.\", block);\n }\n return language ? match[1] : 'no-highlight';\n }\n\n return classes\n .split(/\\s+/)\n .find((_class) => shouldNotHighlight(_class) || getLanguage(_class));\n }\n\n /**\n * Core highlighting function.\n *\n * OLD API\n * highlight(lang, code, ignoreIllegals, continuation)\n *\n * NEW API\n * highlight(code, {lang, ignoreIllegals})\n *\n * @param {string} codeOrLanguageName - the language to use for highlighting\n * @param {string | HighlightOptions} optionsOrCode - the code to highlight\n * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail\n *\n * @returns {HighlightResult} Result - an object that represents the result\n * @property {string} language - the language name\n * @property {number} relevance - the relevance score\n * @property {string} value - the highlighted HTML code\n * @property {string} code - the original raw code\n * @property {CompiledMode} top - top of the current mode stack\n * @property {boolean} illegal - indicates whether any illegal matches were found\n */\n function highlight(codeOrLanguageName, optionsOrCode, ignoreIllegals) {\n let code = \"\";\n let languageName = \"\";\n if (typeof optionsOrCode === \"object\") {\n code = codeOrLanguageName;\n ignoreIllegals = optionsOrCode.ignoreIllegals;\n languageName = optionsOrCode.language;\n } else {\n // old API\n deprecated(\"10.7.0\", \"highlight(lang, code, ...args) has been deprecated.\");\n deprecated(\"10.7.0\", \"Please use highlight(code, options) instead.\\nhttps://github.com/highlightjs/highlight.js/issues/2277\");\n languageName = codeOrLanguageName;\n code = optionsOrCode;\n }\n\n // https://github.com/highlightjs/highlight.js/issues/3149\n // eslint-disable-next-line no-undefined\n if (ignoreIllegals === undefined) { ignoreIllegals = true; }\n\n /** @type {BeforeHighlightContext} */\n const context = {\n code,\n language: languageName\n };\n // the plugin can change the desired language or the code to be highlighted\n // just be changing the object it was passed\n fire(\"before:highlight\", context);\n\n // a before plugin can usurp the result completely by providing it's own\n // in which case we don't even need to call highlight\n const result = context.result\n ? context.result\n : _highlight(context.language, context.code, ignoreIllegals);\n\n result.code = context.code;\n // the plugin can change anything in result to suite it\n fire(\"after:highlight\", result);\n\n return result;\n }\n\n /**\n * private highlight that's used internally and does not fire callbacks\n *\n * @param {string} languageName - the language to use for highlighting\n * @param {string} codeToHighlight - the code to highlight\n * @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail\n * @param {CompiledMode?} [continuation] - current continuation mode, if any\n * @returns {HighlightResult} - result of the highlight operation\n */\n function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {\n const keywordHits = Object.create(null);\n\n /**\n * Return keyword data if a match is a keyword\n * @param {CompiledMode} mode - current mode\n * @param {string} matchText - the textual match\n * @returns {KeywordData | false}\n */\n function keywordData(mode, matchText) {\n return mode.keywords[matchText];\n }\n\n function processKeywords() {\n if (!top.keywords) {\n emitter.addText(modeBuffer);\n return;\n }\n\n let lastIndex = 0;\n top.keywordPatternRe.lastIndex = 0;\n let match = top.keywordPatternRe.exec(modeBuffer);\n let buf = \"\";\n\n while (match) {\n buf += modeBuffer.substring(lastIndex, match.index);\n const word = language.case_insensitive ? match[0].toLowerCase() : match[0];\n const data = keywordData(top, word);\n if (data) {\n const [kind, keywordRelevance] = data;\n emitter.addText(buf);\n buf = \"\";\n\n keywordHits[word] = (keywordHits[word] || 0) + 1;\n if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance;\n if (kind.startsWith(\"_\")) {\n // _ implied for relevance only, do not highlight\n // by applying a class name\n buf += match[0];\n } else {\n const cssClass = language.classNameAliases[kind] || kind;\n emitKeyword(match[0], cssClass);\n }\n } else {\n buf += match[0];\n }\n lastIndex = top.keywordPatternRe.lastIndex;\n match = top.keywordPatternRe.exec(modeBuffer);\n }\n buf += modeBuffer.substring(lastIndex);\n emitter.addText(buf);\n }\n\n function processSubLanguage() {\n if (modeBuffer === \"\") return;\n /** @type HighlightResult */\n let result = null;\n\n if (typeof top.subLanguage === 'string') {\n if (!languages[top.subLanguage]) {\n emitter.addText(modeBuffer);\n return;\n }\n result = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);\n continuations[top.subLanguage] = /** @type {CompiledMode} */ (result._top);\n } else {\n result = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);\n }\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n emitter.__addSublanguage(result._emitter, result.language);\n }\n\n function processBuffer() {\n if (top.subLanguage != null) {\n processSubLanguage();\n } else {\n processKeywords();\n }\n modeBuffer = '';\n }\n\n /**\n * @param {string} text\n * @param {string} scope\n */\n function emitKeyword(keyword, scope) {\n if (keyword === \"\") return;\n\n emitter.startScope(scope);\n emitter.addText(keyword);\n emitter.endScope();\n }\n\n /**\n * @param {CompiledScope} scope\n * @param {RegExpMatchArray} match\n */\n function emitMultiClass(scope, match) {\n let i = 1;\n const max = match.length - 1;\n while (i <= max) {\n if (!scope._emit[i]) { i++; continue; }\n const klass = language.classNameAliases[scope[i]] || scope[i];\n const text = match[i];\n if (klass) {\n emitKeyword(text, klass);\n } else {\n modeBuffer = text;\n processKeywords();\n modeBuffer = \"\";\n }\n i++;\n }\n }\n\n /**\n * @param {CompiledMode} mode - new mode to start\n * @param {RegExpMatchArray} match\n */\n function startNewMode(mode, match) {\n if (mode.scope && typeof mode.scope === \"string\") {\n emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);\n }\n if (mode.beginScope) {\n // beginScope just wraps the begin match itself in a scope\n if (mode.beginScope._wrap) {\n emitKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);\n modeBuffer = \"\";\n } else if (mode.beginScope._multi) {\n // at this point modeBuffer should just be the match\n emitMultiClass(mode.beginScope, match);\n modeBuffer = \"\";\n }\n }\n\n top = Object.create(mode, { parent: { value: top } });\n return top;\n }\n\n /**\n * @param {CompiledMode } mode - the mode to potentially end\n * @param {RegExpMatchArray} match - the latest match\n * @param {string} matchPlusRemainder - match plus remainder of content\n * @returns {CompiledMode | void} - the next mode, or if void continue on in current mode\n */\n function endOfMode(mode, match, matchPlusRemainder) {\n let matched = startsWith(mode.endRe, matchPlusRemainder);\n\n if (matched) {\n if (mode[\"on:end\"]) {\n const resp = new Response(mode);\n mode[\"on:end\"](match, resp);\n if (resp.isMatchIgnored) matched = false;\n }\n\n if (matched) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n }\n // even if on:end fires an `ignore` it's still possible\n // that we might trigger the end node because of a parent mode\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, match, matchPlusRemainder);\n }\n }\n\n /**\n * Handle matching but then ignoring a sequence of text\n *\n * @param {string} lexeme - string containing full match text\n */\n function doIgnore(lexeme) {\n if (top.matcher.regexIndex === 0) {\n // no more regexes to potentially match here, so we move the cursor forward one\n // space\n modeBuffer += lexeme[0];\n return 1;\n } else {\n // no need to move the cursor, we still have additional regexes to try and\n // match at this very spot\n resumeScanAtSamePosition = true;\n return 0;\n }\n }\n\n /**\n * Handle the start of a new potential mode match\n *\n * @param {EnhancedMatch} match - the current match\n * @returns {number} how far to advance the parse cursor\n */\n function doBeginMatch(match) {\n const lexeme = match[0];\n const newMode = match.rule;\n\n const resp = new Response(newMode);\n // first internal before callbacks, then the public ones\n const beforeCallbacks = [newMode.__beforeBegin, newMode[\"on:begin\"]];\n for (const cb of beforeCallbacks) {\n if (!cb) continue;\n cb(match, resp);\n if (resp.isMatchIgnored) return doIgnore(lexeme);\n }\n\n if (newMode.skip) {\n modeBuffer += lexeme;\n } else {\n if (newMode.excludeBegin) {\n modeBuffer += lexeme;\n }\n processBuffer();\n if (!newMode.returnBegin && !newMode.excludeBegin) {\n modeBuffer = lexeme;\n }\n }\n startNewMode(newMode, match);\n return newMode.returnBegin ? 0 : lexeme.length;\n }\n\n /**\n * Handle the potential end of mode\n *\n * @param {RegExpMatchArray} match - the current match\n */\n function doEndMatch(match) {\n const lexeme = match[0];\n const matchPlusRemainder = codeToHighlight.substring(match.index);\n\n const endMode = endOfMode(top, match, matchPlusRemainder);\n if (!endMode) { return NO_MATCH; }\n\n const origin = top;\n if (top.endScope && top.endScope._wrap) {\n processBuffer();\n emitKeyword(lexeme, top.endScope._wrap);\n } else if (top.endScope && top.endScope._multi) {\n processBuffer();\n emitMultiClass(top.endScope, match);\n } else if (origin.skip) {\n modeBuffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n modeBuffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n modeBuffer = lexeme;\n }\n }\n do {\n if (top.scope) {\n emitter.closeNode();\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== endMode.parent);\n if (endMode.starts) {\n startNewMode(endMode.starts, match);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n function processContinuations() {\n const list = [];\n for (let current = top; current !== language; current = current.parent) {\n if (current.scope) {\n list.unshift(current.scope);\n }\n }\n list.forEach(item => emitter.openNode(item));\n }\n\n /** @type {{type?: MatchType, index?: number, rule?: Mode}}} */\n let lastMatch = {};\n\n /**\n * Process an individual match\n *\n * @param {string} textBeforeMatch - text preceding the match (since the last match)\n * @param {EnhancedMatch} [match] - the match itself\n */\n function processLexeme(textBeforeMatch, match) {\n const lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n modeBuffer += textBeforeMatch;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type === \"begin\" && match.type === \"end\" && lastMatch.index === match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n modeBuffer += codeToHighlight.slice(match.index, match.index + 1);\n if (!SAFE_MODE) {\n /** @type {AnnotatedError} */\n const err = new Error(`0 width match regex (${languageName})`);\n err.languageName = languageName;\n err.badRule = lastMatch.rule;\n throw err;\n }\n return 1;\n }\n lastMatch = match;\n\n if (match.type === \"begin\") {\n return doBeginMatch(match);\n } else if (match.type === \"illegal\" && !ignoreIllegals) {\n // illegal match, we do not continue processing\n /** @type {AnnotatedError} */\n const err = new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.scope || '') + '\"');\n err.mode = top;\n throw err;\n } else if (match.type === \"end\") {\n const processed = doEndMatch(match);\n if (processed !== NO_MATCH) {\n return processed;\n }\n }\n\n // edge case for when illegal matches $ (end of line) which is technically\n // a 0 width match but not a begin/end match so it's not caught by the\n // first handler (when ignoreIllegals is true)\n if (match.type === \"illegal\" && lexeme === \"\") {\n // advance so we aren't stuck in an infinite loop\n return 1;\n }\n\n // infinite loops are BAD, this is a last ditch catch all. if we have a\n // decent number of iterations yet our index (cursor position in our\n // parsing) still 3x behind our index then something is very wrong\n // so we bail\n if (iterations > 100000 && iterations > match.index * 3) {\n const err = new Error('potential infinite loop, way more iterations than matches');\n throw err;\n }\n\n /*\n Why might be find ourselves here? An potential end match that was\n triggered but could not be completed. IE, `doEndMatch` returned NO_MATCH.\n (this could be because a callback requests the match be ignored, etc)\n\n This causes no real harm other than stopping a few times too many.\n */\n\n modeBuffer += lexeme;\n return lexeme.length;\n }\n\n const language = getLanguage(languageName);\n if (!language) {\n error(LANGUAGE_NOT_FOUND.replace(\"{}\", languageName));\n throw new Error('Unknown language: \"' + languageName + '\"');\n }\n\n const md = compileLanguage(language);\n let result = '';\n /** @type {CompiledMode} */\n let top = continuation || md;\n /** @type Record */\n const continuations = {}; // keep continuations for sub-languages\n const emitter = new options.__emitter(options);\n processContinuations();\n let modeBuffer = '';\n let relevance = 0;\n let index = 0;\n let iterations = 0;\n let resumeScanAtSamePosition = false;\n\n try {\n if (!language.__emitTokens) {\n top.matcher.considerAll();\n\n for (;;) {\n iterations++;\n if (resumeScanAtSamePosition) {\n // only regexes not matched previously will now be\n // considered for a potential match\n resumeScanAtSamePosition = false;\n } else {\n top.matcher.considerAll();\n }\n top.matcher.lastIndex = index;\n\n const match = top.matcher.exec(codeToHighlight);\n // console.log(\"match\", match[0], match.rule && match.rule.begin)\n\n if (!match) break;\n\n const beforeMatch = codeToHighlight.substring(index, match.index);\n const processedCount = processLexeme(beforeMatch, match);\n index = match.index + processedCount;\n }\n processLexeme(codeToHighlight.substring(index));\n } else {\n language.__emitTokens(codeToHighlight, emitter);\n }\n\n emitter.finalize();\n result = emitter.toHTML();\n\n return {\n language: languageName,\n value: result,\n relevance,\n illegal: false,\n _emitter: emitter,\n _top: top\n };\n } catch (err) {\n if (err.message && err.message.includes('Illegal')) {\n return {\n language: languageName,\n value: escape(codeToHighlight),\n illegal: true,\n relevance: 0,\n _illegalBy: {\n message: err.message,\n index,\n context: codeToHighlight.slice(index - 100, index + 100),\n mode: err.mode,\n resultSoFar: result\n },\n _emitter: emitter\n };\n } else if (SAFE_MODE) {\n return {\n language: languageName,\n value: escape(codeToHighlight),\n illegal: false,\n relevance: 0,\n errorRaised: err,\n _emitter: emitter,\n _top: top\n };\n } else {\n throw err;\n }\n }\n }\n\n /**\n * returns a valid highlight result, without actually doing any actual work,\n * auto highlight starts with this and it's possible for small snippets that\n * auto-detection may not find a better match\n * @param {string} code\n * @returns {HighlightResult}\n */\n function justTextHighlightResult(code) {\n const result = {\n value: escape(code),\n illegal: false,\n relevance: 0,\n _top: PLAINTEXT_LANGUAGE,\n _emitter: new options.__emitter(options)\n };\n result._emitter.addText(code);\n return result;\n }\n\n /**\n Highlighting with language detection. Accepts a string with the code to\n highlight. Returns an object with the following properties:\n\n - language (detected language)\n - relevance (int)\n - value (an HTML string with highlighting markup)\n - secondBest (object with the same structure for second-best heuristically\n detected language, may be absent)\n\n @param {string} code\n @param {Array} [languageSubset]\n @returns {AutoHighlightResult}\n */\n function highlightAuto(code, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n const plaintext = justTextHighlightResult(code);\n\n const results = languageSubset.filter(getLanguage).filter(autoDetection).map(name =>\n _highlight(name, code, false)\n );\n results.unshift(plaintext); // plaintext is always an option\n\n const sorted = results.sort((a, b) => {\n // sort base on relevance\n if (a.relevance !== b.relevance) return b.relevance - a.relevance;\n\n // always award the tie to the base language\n // ie if C++ and Arduino are tied, it's more likely to be C++\n if (a.language && b.language) {\n if (getLanguage(a.language).supersetOf === b.language) {\n return 1;\n } else if (getLanguage(b.language).supersetOf === a.language) {\n return -1;\n }\n }\n\n // otherwise say they are equal, which has the effect of sorting on\n // relevance while preserving the original ordering - which is how ties\n // have historically been settled, ie the language that comes first always\n // wins in the case of a tie\n return 0;\n });\n\n const [best, secondBest] = sorted;\n\n /** @type {AutoHighlightResult} */\n const result = best;\n result.secondBest = secondBest;\n\n return result;\n }\n\n /**\n * Builds new class name for block given the language name\n *\n * @param {HTMLElement} element\n * @param {string} [currentLang]\n * @param {string} [resultLang]\n */\n function updateClassName(element, currentLang, resultLang) {\n const language = (currentLang && aliases[currentLang]) || resultLang;\n\n element.classList.add(\"hljs\");\n element.classList.add(`language-${language}`);\n }\n\n /**\n * Applies highlighting to a DOM node containing code.\n *\n * @param {HighlightedHTMLElement} element - the HTML element to highlight\n */\n function highlightElement(element) {\n /** @type HTMLElement */\n let node = null;\n const language = blockLanguage(element);\n\n if (shouldNotHighlight(language)) return;\n\n fire(\"before:highlightElement\",\n { el: element, language });\n\n if (element.dataset.highlighted) {\n console.log(\"Element previously highlighted. To highlight again, first unset `dataset.highlighted`.\", element);\n return;\n }\n\n // we should be all text, no child nodes (unescaped HTML) - this is possibly\n // an HTML injection attack - it's likely too late if this is already in\n // production (the code has likely already done its damage by the time\n // we're seeing it)... but we yell loudly about this so that hopefully it's\n // more likely to be caught in development before making it to production\n if (element.children.length > 0) {\n if (!options.ignoreUnescapedHTML) {\n console.warn(\"One of your code blocks includes unescaped HTML. This is a potentially serious security risk.\");\n console.warn(\"https://github.com/highlightjs/highlight.js/wiki/security\");\n console.warn(\"The element with unescaped HTML:\");\n console.warn(element);\n }\n if (options.throwUnescapedHTML) {\n const err = new HTMLInjectionError(\n \"One of your code blocks includes unescaped HTML.\",\n element.innerHTML\n );\n throw err;\n }\n }\n\n node = element;\n const text = node.textContent;\n const result = language ? highlight(text, { language, ignoreIllegals: true }) : highlightAuto(text);\n\n element.innerHTML = result.value;\n element.dataset.highlighted = \"yes\";\n updateClassName(element, language, result.language);\n element.result = {\n language: result.language,\n // TODO: remove with version 11.0\n re: result.relevance,\n relevance: result.relevance\n };\n if (result.secondBest) {\n element.secondBest = {\n language: result.secondBest.language,\n relevance: result.secondBest.relevance\n };\n }\n\n fire(\"after:highlightElement\", { el: element, result, text });\n }\n\n /**\n * Updates highlight.js global options with the passed options\n *\n * @param {Partial} userOptions\n */\n function configure(userOptions) {\n options = inherit(options, userOptions);\n }\n\n // TODO: remove v12, deprecated\n const initHighlighting = () => {\n highlightAll();\n deprecated(\"10.6.0\", \"initHighlighting() deprecated. Use highlightAll() now.\");\n };\n\n // TODO: remove v12, deprecated\n function initHighlightingOnLoad() {\n highlightAll();\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() deprecated. Use highlightAll() now.\");\n }\n\n let wantsHighlight = false;\n\n /**\n * auto-highlights all pre>code elements on the page\n */\n function highlightAll() {\n // if we are called too early in the loading process\n if (document.readyState === \"loading\") {\n wantsHighlight = true;\n return;\n }\n\n const blocks = document.querySelectorAll(options.cssSelector);\n blocks.forEach(highlightElement);\n }\n\n function boot() {\n // if a highlight was requested before DOM was loaded, do now\n if (wantsHighlight) highlightAll();\n }\n\n // make sure we are in the browser environment\n if (typeof window !== 'undefined' && window.addEventListener) {\n window.addEventListener('DOMContentLoaded', boot, false);\n }\n\n /**\n * Register a language grammar module\n *\n * @param {string} languageName\n * @param {LanguageFn} languageDefinition\n */\n function registerLanguage(languageName, languageDefinition) {\n let lang = null;\n try {\n lang = languageDefinition(hljs);\n } catch (error$1) {\n error(\"Language definition for '{}' could not be registered.\".replace(\"{}\", languageName));\n // hard or soft error\n if (!SAFE_MODE) { throw error$1; } else { error(error$1); }\n // languages that have serious errors are replaced with essentially a\n // \"plaintext\" stand-in so that the code blocks will still get normal\n // css classes applied to them - and one bad language won't break the\n // entire highlighter\n lang = PLAINTEXT_LANGUAGE;\n }\n // give it a temporary name if it doesn't have one in the meta-data\n if (!lang.name) lang.name = languageName;\n languages[languageName] = lang;\n lang.rawDefinition = languageDefinition.bind(null, hljs);\n\n if (lang.aliases) {\n registerAliases(lang.aliases, { languageName });\n }\n }\n\n /**\n * Remove a language grammar module\n *\n * @param {string} languageName\n */\n function unregisterLanguage(languageName) {\n delete languages[languageName];\n for (const alias of Object.keys(aliases)) {\n if (aliases[alias] === languageName) {\n delete aliases[alias];\n }\n }\n }\n\n /**\n * @returns {string[]} List of language internal names\n */\n function listLanguages() {\n return Object.keys(languages);\n }\n\n /**\n * @param {string} name - name of the language to retrieve\n * @returns {Language | undefined}\n */\n function getLanguage(name) {\n name = (name || '').toLowerCase();\n return languages[name] || languages[aliases[name]];\n }\n\n /**\n *\n * @param {string|string[]} aliasList - single alias or list of aliases\n * @param {{languageName: string}} opts\n */\n function registerAliases(aliasList, { languageName }) {\n if (typeof aliasList === 'string') {\n aliasList = [aliasList];\n }\n aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; });\n }\n\n /**\n * Determines if a given language has auto-detection enabled\n * @param {string} name - name of the language\n */\n function autoDetection(name) {\n const lang = getLanguage(name);\n return lang && !lang.disableAutodetect;\n }\n\n /**\n * Upgrades the old highlightBlock plugins to the new\n * highlightElement API\n * @param {HLJSPlugin} plugin\n */\n function upgradePluginAPI(plugin) {\n // TODO: remove with v12\n if (plugin[\"before:highlightBlock\"] && !plugin[\"before:highlightElement\"]) {\n plugin[\"before:highlightElement\"] = (data) => {\n plugin[\"before:highlightBlock\"](\n Object.assign({ block: data.el }, data)\n );\n };\n }\n if (plugin[\"after:highlightBlock\"] && !plugin[\"after:highlightElement\"]) {\n plugin[\"after:highlightElement\"] = (data) => {\n plugin[\"after:highlightBlock\"](\n Object.assign({ block: data.el }, data)\n );\n };\n }\n }\n\n /**\n * @param {HLJSPlugin} plugin\n */\n function addPlugin(plugin) {\n upgradePluginAPI(plugin);\n plugins.push(plugin);\n }\n\n /**\n * @param {HLJSPlugin} plugin\n */\n function removePlugin(plugin) {\n const index = plugins.indexOf(plugin);\n if (index !== -1) {\n plugins.splice(index, 1);\n }\n }\n\n /**\n *\n * @param {PluginEvent} event\n * @param {any} args\n */\n function fire(event, args) {\n const cb = event;\n plugins.forEach(function(plugin) {\n if (plugin[cb]) {\n plugin[cb](args);\n }\n });\n }\n\n /**\n * DEPRECATED\n * @param {HighlightedHTMLElement} el\n */\n function deprecateHighlightBlock(el) {\n deprecated(\"10.7.0\", \"highlightBlock will be removed entirely in v12.0\");\n deprecated(\"10.7.0\", \"Please use highlightElement now.\");\n\n return highlightElement(el);\n }\n\n /* Interface definition */\n Object.assign(hljs, {\n highlight,\n highlightAuto,\n highlightAll,\n highlightElement,\n // TODO: Remove with v12 API\n highlightBlock: deprecateHighlightBlock,\n configure,\n initHighlighting,\n initHighlightingOnLoad,\n registerLanguage,\n unregisterLanguage,\n listLanguages,\n getLanguage,\n registerAliases,\n autoDetection,\n inherit,\n addPlugin,\n removePlugin\n });\n\n hljs.debugMode = function() { SAFE_MODE = false; };\n hljs.safeMode = function() { SAFE_MODE = true; };\n hljs.versionString = version;\n\n hljs.regex = {\n concat: concat,\n lookahead: lookahead,\n either: either,\n optional: optional,\n anyNumberOfTimes: anyNumberOfTimes\n };\n\n for (const key in MODES) {\n // @ts-ignore\n if (typeof MODES[key] === \"object\") {\n // @ts-ignore\n deepFreeze(MODES[key]);\n }\n }\n\n // merge all the modes/regexes into our main object\n Object.assign(hljs, MODES);\n\n return hljs;\n};\n\n// Other names for the variable may break build script\nconst highlight = HLJS({});\n\n// returns a new instance of the highlighter to be used for extensions\n// check https://github.com/wooorm/lowlight/issues/47\nhighlight.newInstance = () => HLJS({});\n\nmodule.exports = highlight;\nhighlight.HighlightJS = highlight;\nhighlight.default = highlight;\n","const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';\nconst KEYWORDS = [\n \"as\", // for exports\n \"in\",\n \"of\",\n \"if\",\n \"for\",\n \"while\",\n \"finally\",\n \"var\",\n \"new\",\n \"function\",\n \"do\",\n \"return\",\n \"void\",\n \"else\",\n \"break\",\n \"catch\",\n \"instanceof\",\n \"with\",\n \"throw\",\n \"case\",\n \"default\",\n \"try\",\n \"switch\",\n \"continue\",\n \"typeof\",\n \"delete\",\n \"let\",\n \"yield\",\n \"const\",\n \"class\",\n // JS handles these with a special rule\n // \"get\",\n // \"set\",\n \"debugger\",\n \"async\",\n \"await\",\n \"static\",\n \"import\",\n \"from\",\n \"export\",\n \"extends\"\n];\nconst LITERALS = [\n \"true\",\n \"false\",\n \"null\",\n \"undefined\",\n \"NaN\",\n \"Infinity\"\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects\nconst TYPES = [\n // Fundamental objects\n \"Object\",\n \"Function\",\n \"Boolean\",\n \"Symbol\",\n // numbers and dates\n \"Math\",\n \"Date\",\n \"Number\",\n \"BigInt\",\n // text\n \"String\",\n \"RegExp\",\n // Indexed collections\n \"Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int8Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n // Keyed collections\n \"Set\",\n \"Map\",\n \"WeakSet\",\n \"WeakMap\",\n // Structured data\n \"ArrayBuffer\",\n \"SharedArrayBuffer\",\n \"Atomics\",\n \"DataView\",\n \"JSON\",\n // Control abstraction objects\n \"Promise\",\n \"Generator\",\n \"GeneratorFunction\",\n \"AsyncFunction\",\n // Reflection\n \"Reflect\",\n \"Proxy\",\n // Internationalization\n \"Intl\",\n // WebAssembly\n \"WebAssembly\"\n];\n\nconst ERROR_TYPES = [\n \"Error\",\n \"EvalError\",\n \"InternalError\",\n \"RangeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n \"TypeError\",\n \"URIError\"\n];\n\nconst BUILT_IN_GLOBALS = [\n \"setInterval\",\n \"setTimeout\",\n \"clearInterval\",\n \"clearTimeout\",\n\n \"require\",\n \"exports\",\n\n \"eval\",\n \"isFinite\",\n \"isNaN\",\n \"parseFloat\",\n \"parseInt\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"unescape\"\n];\n\nconst BUILT_IN_VARIABLES = [\n \"arguments\",\n \"this\",\n \"super\",\n \"console\",\n \"window\",\n \"document\",\n \"localStorage\",\n \"sessionStorage\",\n \"module\",\n \"global\" // Node.js\n];\n\nconst BUILT_INS = [].concat(\n BUILT_IN_GLOBALS,\n TYPES,\n ERROR_TYPES\n);\n\n/*\nLanguage: JavaScript\nDescription: JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.\nCategory: common, scripting, web\nWebsite: https://developer.mozilla.org/en-US/docs/Web/JavaScript\n*/\n\n\n/** @type LanguageFn */\nfunction javascript(hljs) {\n const regex = hljs.regex;\n /**\n * Takes a string like \" {\n const tag = \"',\n end: ''\n };\n // to avoid some special cases inside isTrulyOpeningTag\n const XML_SELF_CLOSING = /<[A-Za-z0-9\\\\._:-]+\\s*\\/>/;\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n if (\n // HTML should not include another raw `<` inside a tag\n // nested type?\n // `>`, etc.\n nextChar === \"<\" ||\n // the , gives away that this is not HTML\n // ``\n nextChar === \",\"\n ) {\n response.ignoreMatch();\n return;\n }\n\n // ``\n // Quite possibly a tag, lets look for a matching closing tag...\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n\n // `` (self-closing)\n // handled by simpleSelfClosing rule\n\n let m;\n const afterMatch = match.input.substring(afterMatchIndex);\n\n // some more template typing stuff\n // (key?: string) => Modify<\n if ((m = afterMatch.match(/^\\s*=/))) {\n response.ignoreMatch();\n return;\n }\n\n // ``\n // technically this could be HTML, but it smells like a type\n // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276\n if ((m = afterMatch.match(/^\\s+extends\\s+/))) {\n if (m.index === 0) {\n response.ignoreMatch();\n // eslint-disable-next-line no-useless-return\n return;\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS,\n \"variable.language\": BUILT_IN_VARIABLES\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: '\\.?html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: '\\.?css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const GRAPHQL_TEMPLATE = {\n begin: '\\.?gql`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'graphql'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n begin: '(?=@[A-Za-z]+)',\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n },\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n excludeEnd: true,\n excludeBegin: true,\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n GRAPHQL_TEMPLATE,\n TEMPLATE_STRING,\n // Skip numbers when they are part of a variable name\n { match: /\\$\\d+/ },\n NUMBER,\n // This is intentional:\n // See https://github.com/highlightjs/highlight.js/issues/3288\n // hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /(\\s*)\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n // convert this to negative lookbehind in v12\n begin: /(\\s*)\\(/, // to match the parms with \n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n // ES6 classes\n const CLASS_OR_EXTENDS = {\n variants: [\n // class Car extends vehicle\n {\n match: [\n /class/,\n /\\s+/,\n IDENT_RE$1,\n /\\s+/,\n /extends/,\n /\\s+/,\n regex.concat(IDENT_RE$1, \"(\", regex.concat(/\\./, IDENT_RE$1), \")*\")\n ],\n scope: {\n 1: \"keyword\",\n 3: \"title.class\",\n 5: \"keyword\",\n 7: \"title.class.inherited\"\n }\n },\n // class Car\n {\n match: [\n /class/,\n /\\s+/,\n IDENT_RE$1\n ],\n scope: {\n 1: \"keyword\",\n 3: \"title.class\"\n }\n },\n\n ]\n };\n\n const CLASS_REFERENCE = {\n relevance: 0,\n match:\n regex.either(\n // Hard coded exceptions\n /\\bJSON/,\n // Float32Array, OutT\n /\\b[A-Z][a-z]+([A-Z][a-z]*|\\d)*/,\n // CSSFactory, CSSFactoryT\n /\\b[A-Z]{2,}([A-Z][a-z]+|\\d)+([A-Z][a-z]*)*/,\n // FPs, FPsT\n /\\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\\d)*([A-Z][a-z]*)*/,\n // P\n // single letters are not highlighted\n // BLAH\n // this will be flagged as a UPPER_CASE_CONSTANT instead\n ),\n className: \"title.class\",\n keywords: {\n _: [\n // se we still get relevance credit for JS library classes\n ...TYPES,\n ...ERROR_TYPES\n ]\n }\n };\n\n const USE_STRICT = {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n };\n\n const FUNCTION_DEFINITION = {\n variants: [\n {\n match: [\n /function/,\n /\\s+/,\n IDENT_RE$1,\n /(?=\\s*\\()/\n ]\n },\n // anonymous function\n {\n match: [\n /function/,\n /\\s*(?=\\()/\n ]\n }\n ],\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n label: \"func.def\",\n contains: [ PARAMS ],\n illegal: /%/\n };\n\n const UPPER_CASE_CONSTANT = {\n relevance: 0,\n match: /\\b[A-Z][A-Z_0-9]+\\b/,\n className: \"variable.constant\"\n };\n\n function noneOf(list) {\n return regex.concat(\"(?!\", list.join(\"|\"), \")\");\n }\n\n const FUNCTION_CALL = {\n match: regex.concat(\n /\\b/,\n noneOf([\n ...BUILT_IN_GLOBALS,\n \"super\",\n \"import\"\n ].map(x => `${x}\\\\s*\\\\(`)),\n IDENT_RE$1, regex.lookahead(/\\s*\\(/)),\n className: \"title.function\",\n relevance: 0\n };\n\n const PROPERTY_ACCESS = {\n begin: regex.concat(/\\./, regex.lookahead(\n regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)\n )),\n end: IDENT_RE$1,\n excludeBegin: true,\n keywords: \"prototype\",\n className: \"property\",\n relevance: 0\n };\n\n const GETTER_OR_SETTER = {\n match: [\n /get|set/,\n /\\s+/,\n IDENT_RE$1,\n /(?=\\()/\n ],\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n contains: [\n { // eat to avoid empty params\n begin: /\\(\\)/\n },\n PARAMS\n ]\n };\n\n const FUNC_LEAD_IN_RE = '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>';\n\n const FUNCTION_VARIABLE = {\n match: [\n /const|var|let/, /\\s+/,\n IDENT_RE$1, /\\s*/,\n /=\\s*/,\n /(async\\s*)?/, // async is optional\n regex.lookahead(FUNC_LEAD_IN_RE)\n ],\n keywords: \"async\",\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n contains: [\n PARAMS\n ]\n };\n\n return {\n name: 'JavaScript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS, CLASS_REFERENCE },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n USE_STRICT,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n GRAPHQL_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n // Skip numbers when they are part of a variable name\n { match: /\\$\\d+/ },\n NUMBER,\n CLASS_REFERENCE,\n {\n className: 'attr',\n begin: IDENT_RE$1 + regex.lookahead(':'),\n relevance: 0\n },\n FUNCTION_VARIABLE,\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n relevance: 0,\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: FUNC_LEAD_IN_RE,\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /(\\s*)\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/,\n relevance: 0\n },\n {\n match: /\\s+/,\n relevance: 0\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n { match: XML_SELF_CLOSING },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n },\n FUNCTION_DEFINITION,\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: '\\\\b(?!function)' + hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n label: \"func.def\",\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: \"title.function\" })\n ]\n },\n // catch ... so it won't trigger the property rule below\n {\n match: /\\.\\.\\./,\n relevance: 0\n },\n PROPERTY_ACCESS,\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n match: '\\\\$' + IDENT_RE$1,\n relevance: 0\n },\n {\n match: [ /\\bconstructor(?=\\s*\\()/ ],\n className: { 1: \"title.function\" },\n contains: [ PARAMS ]\n },\n FUNCTION_CALL,\n UPPER_CASE_CONSTANT,\n CLASS_OR_EXTENDS,\n GETTER_OR_SETTER,\n {\n match: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}\n\nexport { javascript as default };\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport componentCss from './code-block.scss?inline';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport hljs from 'highlight.js/lib/core';\nimport javascript from 'highlight.js/lib/languages/javascript';\n\nhljs.registerLanguage('javascript', javascript);\n\nexport class CodeBlock extends LitElement {\n static styles = [unsafeCSS(componentCss)];\n static properties = {\n language: { type: String },\n code: { tyoe: String, state: true }\n };\n\n constructor(props) {\n super(props);\n this.language = 'javascript';\n }\n\n #onCodeChanged() {\n const slottedElements = this.shadowRoot.querySelector('slot').assignedNodes();\n const codeStr = slottedElements[0].textContent;\n\n this.code = hljs.highlight(codeStr, { language: this.language }).value;\n }\n\n render() {\n return html`\n
${unsafeHTML(this.code)}
\n this.#onCodeChanged()}\">\n `;\n }\n}\n\ncustomElements.define('code-block', CodeBlock);\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport '../../../components/code-block/code-block';\nimport { animations, theme } from '../../../theme/theme';\nimport showcaseComponentCss from './showcase-component.scss?inline';\nimport { when } from 'lit/directives/when.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport class ShowcaseComponent extends LitElement {\n static styles = [theme, animations, unsafeCSS(showcaseComponentCss)];\n\n static properties = {\n collapsed: { type: Boolean },\n hasCodeExample: { type: Boolean, state: true },\n exampleLanguage: { type: String },\n href: { type: String }\n };\n\n connectedCallback() {\n super.connectedCallback();\n this.collapsed = true;\n this.shadowRoot.addEventListener('slotchange', () => {\n this.hasCodeExample = this.#hasSlot('code');\n });\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('collapsed') && !this.collapsed) {\n this.shadowRoot.querySelector('[part=\"implementation\"]').classList.add('active');\n }\n }\n\n #hasSlot(name) {\n return this.shadowRoot.querySelector(`slot[name=\"${name}\"]`).assignedNodes().length > 0;\n }\n\n #implementationSectionAnimationEnd(e) {\n e.target.classList.toggle('active', !e.target.classList.contains('fade-out-shrink'));\n e.target.classList.remove('fade-in-grow', 'fade-out-shrink');\n }\n\n #implementationSectionClassMap() {\n return {\n 'fade-in-grow': this.collapsed === false,\n 'fade-out-shrink': this.collapsed === true\n };\n }\n\n render() {\n return html`\n \n \n\n
\n

{\n this.collapsed = !this.collapsed;\n }}\">\n ${this.collapsed ? 'visibility' : 'visibility_off'}\n ${this.collapsed ? 'See the Implementation' : 'Hide the Implementation'} \n

\n
this.#implementationSectionAnimationEnd(e)}\">\n
\n \n
\n ${when(this.href, () => html`\n
\n \n view on github\n \n
\n `)}\n
\n
\n `;\n }\n}\n\ncustomElements.define('showcase-component', ShowcaseComponent);\n","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Start Time Showcase\\n \\n \\n\\n\\n\\n\\n
\\n

Start the player at a given position

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Multi Player Showcase\\n \\n \\n\\n\\n\\n\\n
\\n

Multiple players

\\n\\n
\\n \\n
\\n\\n \\n\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Detect blocked segment\\n \\n \\n\\n\\n\\n\\n
\\n

Detect blocked segment

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Display Current Chapter\\n \\n \\n\\n\\n\\n\\n
\\n

Display Current Chapter

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Skip Credits\\n \\n \\n\\n\\n\\n\\n
\\n

Skip Credits

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Playlist\\n \\n \\n\\n\\n\\n\\n
\\n

Playlist

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Quality Menu\\n \\n \\n\\n\\n\\n\\n
\\n

Quality Menu

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n \\n Pillarbox Demo - Display Countdown\\n \\n \\n \\n\\n \\n \\n
\\n

Display Countdown

\\n
\\n \\n
\\n\\n \\n
\\n\\n \\n\\n \\n\\n \\n\\n\\n\"","/**\n * Aligns the lines of a block of code by removing leading spaces.\n *\n * This function calculates the number of leading spaces on the first line of the code,\n * then creates a regular expression that matches this number of leading spaces.\n * It finally replaces these leading spaces in each line of the code.\n *\n * @param {string} code - The block of code to align.\n * @returns {string} The aligned block of code.\n */\nfunction alignLines(code) {\n // Remove leading and trailing new lines.\n const normalizeCode = code.replace(/^[\\r\\n]+|[\\r\\n]+$/g, '');\n // Calculate the number of leading spaces on the first line\n const firstLine = normalizeCode.split('\\n')[0];\n const leadingSpaces = firstLine.match(/^ */)[0].length;\n // Create a regular expression that matches 'leadingSpaces' number of leading spaces\n const regex = new RegExp(`^ {${leadingSpaces}}`, 'gm');\n\n // Replace leading spaces in each line\n return normalizeCode.replace(regex, '');\n}\n\nconst parser = new DOMParser();\n\n/**\n * Parses an HTML string and returns the text content of the first element that matches the provided selector.\n *\n * @param {string} html - The HTML string to parse.\n * @param {string} [selector='[data-implementation]'] - The CSS selector to match elements. Defaults to '[data-example]'.\n * @returns {string} The text content of the first matching element. If no elements match the selector, it returns an empty string.\n *\n * @example\n * const html = '
Hello, world!
';\n * const content = parseHTML(html);\n * console.log(content); // Logs: 'Hello, world!'\n */\nexport function getTextFromHTML(html, selector = '[data-implementation]') {\n return alignLines(\n parser.parseFromString(html, 'text/html').querySelector(selector).textContent\n );\n}\n","import router from '../../../router/router';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport './showcase-component.js';\nimport '../../../components/code-block/code-block';\nimport showcasePageCss from './showcase-page.scss?inline';\nimport rawStartTimeExample from '../../../../static/showcases/start-time.html?raw';\nimport rawMultiPlayerExample from '../../../../static/showcases/multi-player.html?raw';\nimport rawDetectBlockedSegmentsExample from '../../../../static/showcases/blocked-segment.html?raw';\nimport rawDisplayCurrentChapterExample from '../../../../static/showcases/chapters.html?raw';\nimport rawSkipCreditsExample from '../../../../static/showcases/skip-credits.html?raw';\nimport rawPlaylistExample from '../../../../static/showcases/playlist.html?raw';\nimport rawqualityMenuExample from '../../../../static/showcases/quality-menu.html?raw';\nimport rawCountdown from '../../../../static/showcases/countdown.html?raw';\nimport { getTextFromHTML } from './example-parser.js';\n\nconst startTimeExampleTxt = getTextFromHTML(rawStartTimeExample);\nconst multiPlayerExampleTxt = getTextFromHTML(rawMultiPlayerExample);\nconst detectBlockedSegmentsExampleTxt =\n getTextFromHTML(rawDetectBlockedSegmentsExample);\nconst displayCurrentChapterExampleTxt =\n getTextFromHTML(rawDisplayCurrentChapterExample);\nconst skipCreditsExampleTxt = getTextFromHTML(rawSkipCreditsExample);\nconst playlistExampleTxt = getTextFromHTML(rawPlaylistExample);\nconst qualityMenuExampleTxt = getTextFromHTML(rawqualityMenuExample);\nconst countdownExampleTxt = getTextFromHTML(rawCountdown);\n\nexport class ShowCasePage extends LitElement {\n static styles = [theme, animations, unsafeCSS(showcasePageCss)];\n\n render() {\n return html`\n ${this.#renderStartTime()}\n ${this.#renderMultiplePlayers()}\n ${this.#renderDetectBlockedSegments()}\n ${this.#renderDisplayCurrentChapter()}\n ${this.#renderSkipCredits()}\n ${this.#renderPlaylist()}\n ${this.#renderQualityMenu()}\n ${this.#renderCountdown()}\n `;\n }\n\n #renderStartTime() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Start the player at a given position

\n

\n In this showcase, we'll demonstrate how to load a video source and\n start playback at a specific position using Pillarbox. This can be\n useful when you want to provide users with the option to begin\n watching a video from a predefined timestamp. To achieve this\n functionality, follow the code snippet below:\n

\n ${startTimeExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderMultiplePlayers() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Multiple Players

\n

\n This example demonstrates how to incorporate multiple video players\n on a webpage.In this showcase, two players are initialized, each\n with its own configuration, a button allows to toggle the mute state\n for both players.\n

\n ${multiPlayerExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderDetectBlockedSegments() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Detect Blocked Segments

\n

\n This tutorial covers how to use pillarbox to create a plugin that\n detects and notifies when a blocked segment is skipped.\n

\n ${detectBlockedSegmentsExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderDisplayCurrentChapter() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Display Current Chapter

\n

\n This showcase explains how to use pillarbox to create a plugin that\n displays the currently playing chapter in a box above the progress\n bar.\n

\n ${displayCurrentChapterExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderSkipCredits() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Skip Credits

\n

\n This example shows how to use the\n Pillarbox Skip Button component\n to add a \"Skip\" button during detected credit intervals.\n

\n ${skipCreditsExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderPlaylist() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Playlist

\n

\n This example shows how to fetch media data for a set of video sources\n and load them into the Pillarbox Playlist plugin\n with metadata such as title and duration.\n

\n ${playlistExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderQualityMenu() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Quality Menu

\n

\n In this showcase, we'll demonstrate howto display a quality selector\n menu using the videojs-contrib-quality-menu\n plugin.\n

\n ${qualityMenuExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderCountdown() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Countdown Timer

\n

\n In this showcase, we'll demonstrate how to display a countdown timer.\n

\n ${countdownExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n}\n\ncustomElements.define('showcase-page', ShowCasePage);\nrouter.addRoute('showcase', 'showcase-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport '../../router/route-link-component';\nimport { theme } from '../../theme/theme';\nimport headerCSS from './demo-header-component.scss?inline';\nimport router from '../../router/router';\nimport './core-demo-header-component.js';\n\n/**\n * A web component that represents the header of the demo page. This header contains\n * the {@link CoreDemoHeaderComponent} as well as the navigation menu of the\n * different demo app sections.\n *\n * @element demo-header\n *\n * @prop {Boolean} debug - Indicates whether the debug mode is enabled.\n *\n * @example\n * \n */\nexport class DemoHeaderElement extends LitElement {\n static properties = {\n debug: { type: Boolean, state: true }\n };\n\n static styles = [theme, unsafeCSS(headerCSS)];\n\n #onRouteUpdated = ({ detail: { queryParams } }) => {\n this.debug = queryParams.debug === 'true';\n };\n\n connectedCallback() {\n super.connectedCallback();\n\n this.debug = router.queryParams.debug === 'true';\n router.addEventListener('routechanged', this.#onRouteUpdated);\n router.addEventListener('queryparams', this.#onRouteUpdated);\n }\n\n disconnectedCallback() {\n router.removeEventListener('routechanged', this.#onRouteUpdated);\n router.removeEventListener('queryparams', this.#onRouteUpdated);\n }\n\n render() {\n return html`\n ${this.#renderHeaderElement()}\n ${this.#renderNavElement()}\n `;\n }\n\n #renderHeaderElement() {\n return html`\n \n \n settings\n \n \n `;\n }\n\n #renderNavElement() {\n return html`\n `;\n }\n}\n\ncustomElements.define('demo-header', DemoHeaderElement);\n","import router from './router';\nimport { LitElement } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nexport class RouteOutletComponent extends LitElement {\n static properties = {\n route: { state: true }\n };\n\n constructor() {\n super();\n\n this.route = router.currentRoute;\n router.addEventListener('routechanged', ({ detail: { route } }) => {\n this.route?.destroy();\n this.route = route;\n });\n }\n\n render() {\n return unsafeHTML(`<${this.route.component}>`);\n }\n}\n\ncustomElements.define('route-outlet', RouteOutletComponent);\n","/**\n * Main module to import and initialize the demo as a single page application.\n *\n * @module\n */\nimport './components/dialog/demo-dialog-component';\nimport './components/player/player';\nimport './layout/content/examples/examples-page';\nimport './layout/content/lists/lists-page';\nimport './layout/content/search/search-page';\nimport './layout/content/settings/settings-page';\nimport './layout/content/showcase/showcase-page';\nimport './layout/header/demo-header-component.js';\nimport './router/route-outlet-component';\nimport router from './router/router';\nimport PreferencesProvider\n from './layout/content/settings/preferences-provider';\nimport ilProvider from './utils/il-provider.js';\n\n// Load preferences and initializes il host\nconst preferences = PreferencesProvider.loadPreferences();\n\nilProvider.host = preferences.dataProviderHost;\n\n// Initialize the router with the current path or 'examples' if none is found\nrouter.start({ defaultPath: 'examples' });\n\nif (router.queryParams.debug) {\n preferences.debug = router.queryParams.debug === 'true';\n PreferencesProvider.savePreferences(preferences);\n} else if (preferences.debug) {\n router.updateState({ debug: 'true' });\n}\n"],"names":["DemoDialog","LitElement","__privateAdd","_DemoDialog_instances","_dialog","_changedProperties","__privateGet","__privateSet","html","__privateMethod","onDialogClicked_fn","onDialogClosed_fn","__publicField","theme","animations","unsafeCSS","componentCSS","PreferencesProvider","preferences","IL_DEFAULT_HOST","DEFAULT_QUERY_PARAMS","DEFAULT_SEARCH_PARAMS","DEFAULT_SHOWLIST_PARAMS","toMedia","title","urn","mediaType","date","duration","ILProvider","host","_ILProvider_instances","_host","bu","query","signal","data","fetch_fn","toResults","nextProvider_fn","transmission","topicUrn","pageSize","showUrn","mediaList","id","channelId","path","params","queryParams","url","response","reason","nextUrl","resultMapper","nextData","ilProvider","DEMO_PLAYER_ID","DEFAULT_OPTIONS","preferencesToPlayerOptions","createPlayer","options","Pillarbox","destroyPlayer","playerDialog","toParams","keySystems","vendor","toKeySystem","certificateUri","licenseUri","asQueryParams","src","type","router","loadPlayerFromRouter","e","openPlayerModal","playerOptions","shouldUpdateRouter","player","s","i","t","r","_a","_b","LoadMediaFormComponent","_LoadMediaFormComponent_instances","initDrmSettings_fn","btnSettingsClassMap","handleLoadBarKeyUp_fn","classMap","drmSettingsTemplate_fn","submitMedia_fn","getSource_fn","keySystems_get","event","toKeySystem_fn","onFormAnimationEnd_fn","formAnimationClassMap_fn","ContentLinkComponent","_onClick","EXAMPLES","o","f","n","ExamplesPage","map","Examples","section","examples","example","when","css","SpinnerComponent","spinnerCss","DEFAULT_INT_OPTIONS","onIntersecting","target","callback","entries","entry","IntersectionObserverComponent","ScrollToTopComponent","toKebabCase","str","_ListsPageStateManager","root","_ListsPageStateManager_instances","nodes","sectionIndex","findSectionIndex_fn","nodeIndex","findNodeIndex_fn","processNodeString_fn","stackIndex","_ListsPageStateManager_static","params_fn","nodeStr","stack","rootSection","node","sectionStr","normalizedSectionStr","normalizedStr","ListsPageStateManager","Section","resolve","next","toNodesAndNext","listsSections","topic","show","channel","ListsPage","_ListsPage_instances","_abortController","_stateManager","_onQueryParamsChanged","updateState_fn","manager","renderScrollBtn","renderNavigation_fn","renderSpinner_fn","renderResults_fn","renderScrollToTopBtn_fn","toMediaButtonParams_fn","renderMediaButton_fn","toLevelParams_fn","sectionIdx","nodeIdx","renderLevelButton_fn","nextPage_fn","renderNodes_fn","firstSection","hasIntesectionObserver","idx","onSectionsClicked_fn","button","onNavigationClicked_fn","step","DEFAULT_BU","SearchBarComponent","_SearchBarComponent_instances","property","handleSelectChange_fn","handleSearchBarKeyUp_fn","clearSearchBar_fn","SearchPage","_SearchPage_instances","searchBar","search_fn","onSearchBarChanged_fn","fetchNextPage_fn","toQueryParams_fn","renderButton_fn","resultsClassMap","ToggleSwitchComponent","_onKeyDown","force","SettingsPage","_SettingsPage_instances","renderToggle_fn","renderInput_fn","label","componentCss","deepFreeze","obj","name","prop","Response","mode","escapeHTML","value","inherit$1","original","objects","result","key","SPAN_CLOSE","emitsWrappingTags","scopeToCSSClass","prefix","pieces","x","HTMLRenderer","parseTree","text","className","newNode","opts","TokenTree","scope","builder","child","el","TokenTreeEmitter","emitter","source","re","lookahead","concat","anyNumberOfTimes","optional","args","stripOptionsFromArgs","either","countMatchGroups","startsWith","lexeme","match","BACKREF_RE","_rewriteBackreferences","regexps","joinWith","numCaptures","regex","offset","out","MATCH_NOTHING_RE","IDENT_RE","UNDERSCORE_IDENT_RE","NUMBER_RE","C_NUMBER_RE","BINARY_NUMBER_RE","RE_STARTERS_RE","SHEBANG","beginShebang","m","resp","BACKSLASH_ESCAPE","APOS_STRING_MODE","QUOTE_STRING_MODE","PHRASAL_WORDS_MODE","COMMENT","begin","end","modeOptions","ENGLISH_WORD","C_LINE_COMMENT_MODE","C_BLOCK_COMMENT_MODE","HASH_COMMENT_MODE","NUMBER_MODE","C_NUMBER_MODE","BINARY_NUMBER_MODE","REGEXP_MODE","TITLE_MODE","UNDERSCORE_TITLE_MODE","METHOD_GUARD","END_SAME_AS_BEGIN","MODES","skipIfHasPrecedingDot","scopeClassName","_parent","beginKeywords","parent","compileIllegal","compileMatch","compileRelevance","beforeMatchExt","originalMode","COMMON_KEYWORDS","DEFAULT_KEYWORD_SCOPE","compileKeywords","rawKeywords","caseInsensitive","scopeName","compiledKeywords","compileList","keywordList","keyword","pair","scoreForKeyword","providedScore","commonKeyword","seenDeprecations","error","message","warn","deprecated","version","MultiClassError","remapScopeNames","regexes","scopeNames","emit","positions","beginMultiClass","endMultiClass","scopeSugar","MultiClass","compileLanguage","language","langRe","global","MultiRegex","terminators","matchData","ResumableMultiRegex","index","matcher","m2","buildModeRegex","mm","term","compileMode","cmode","ext","keywordPattern","c","expandOrCloneMode","dependencyOnParent","variant","HTMLInjectionError","escape","inherit","NO_MATCH","MAX_KEYWORD_HITS","HLJS","hljs","languages","aliases","plugins","SAFE_MODE","LANGUAGE_NOT_FOUND","PLAINTEXT_LANGUAGE","shouldNotHighlight","languageName","blockLanguage","block","classes","getLanguage","_class","highlight","codeOrLanguageName","optionsOrCode","ignoreIllegals","code","context","fire","_highlight","codeToHighlight","continuation","keywordHits","keywordData","matchText","processKeywords","top","modeBuffer","lastIndex","buf","word","kind","keywordRelevance","relevance","cssClass","emitKeyword","processSubLanguage","continuations","highlightAuto","processBuffer","emitMultiClass","max","klass","startNewMode","endOfMode","matchPlusRemainder","matched","doIgnore","resumeScanAtSamePosition","doBeginMatch","newMode","beforeCallbacks","cb","doEndMatch","endMode","origin","processContinuations","list","current","item","lastMatch","processLexeme","textBeforeMatch","err","processed","iterations","md","beforeMatch","processedCount","justTextHighlightResult","languageSubset","plaintext","results","autoDetection","sorted","a","b","best","secondBest","updateClassName","element","currentLang","resultLang","highlightElement","configure","userOptions","initHighlighting","highlightAll","initHighlightingOnLoad","wantsHighlight","boot","registerLanguage","languageDefinition","lang","error$1","registerAliases","unregisterLanguage","alias","listLanguages","aliasList","upgradePluginAPI","plugin","addPlugin","removePlugin","deprecateHighlightBlock","core","KEYWORDS","LITERALS","TYPES","ERROR_TYPES","BUILT_IN_GLOBALS","BUILT_IN_VARIABLES","BUILT_INS","javascript","hasClosingTag","after","tag","IDENT_RE$1","FRAGMENT","XML_SELF_CLOSING","XML_TAG","afterMatchIndex","nextChar","afterMatch","KEYWORDS$1","decimalDigits","frac","decimalInteger","NUMBER","SUBST","HTML_TEMPLATE","CSS_TEMPLATE","GRAPHQL_TEMPLATE","TEMPLATE_STRING","SUBST_INTERNALS","SUBST_AND_COMMENTS","PARAMS_CONTAINS","PARAMS","CLASS_OR_EXTENDS","CLASS_REFERENCE","USE_STRICT","FUNCTION_DEFINITION","UPPER_CASE_CONSTANT","noneOf","FUNCTION_CALL","PROPERTY_ACCESS","GETTER_OR_SETTER","FUNC_LEAD_IN_RE","FUNCTION_VARIABLE","CodeBlock","props","_CodeBlock_instances","unsafeHTML","onCodeChanged_fn","codeStr","ShowcaseComponent","_ShowcaseComponent_instances","hasSlot_fn","implementationSectionClassMap_fn","implementationSectionAnimationEnd_fn","showcaseComponentCss","rawStartTimeExample","rawMultiPlayerExample","rawDetectBlockedSegmentsExample","rawDisplayCurrentChapterExample","rawSkipCreditsExample","rawPlaylistExample","rawqualityMenuExample","rawCountdown","alignLines","normalizeCode","leadingSpaces","parser","getTextFromHTML","selector","startTimeExampleTxt","multiPlayerExampleTxt","detectBlockedSegmentsExampleTxt","displayCurrentChapterExampleTxt","skipCreditsExampleTxt","playlistExampleTxt","qualityMenuExampleTxt","countdownExampleTxt","ShowCasePage","_ShowCasePage_instances","renderStartTime_fn","renderMultiplePlayers_fn","renderDetectBlockedSegments_fn","renderDisplayCurrentChapter_fn","renderSkipCredits_fn","renderPlaylist_fn","renderQualityMenu_fn","renderCountdown_fn","showcasePageCss","DemoHeaderElement","_DemoHeaderElement_instances","_onRouteUpdated","renderHeaderElement_fn","renderNavElement_fn","headerCSS","RouteOutletComponent","route"],"mappings":"2kCASO,MAAMA,WAAmBC,CAAW,CAWzC,aAAc,CACZ,MAAO,EAZJC,EAAA,KAAAC,IASLD,EAAA,KAAAE,IAIE,KAAK,KAAO,EAChB,CAEE,QAAQC,EAAoB,CAC1B,MAAM,QAAQA,CAAkB,EAE5BA,EAAmB,IAAI,MAAM,IAC3B,KAAK,MACPC,EAAA,KAAKF,IAAQ,UAAW,EACxBE,EAAA,KAAKF,IAAQ,UAAU,OAAO,mBAAoB,EAAI,GAEtDE,EAAA,KAAKF,IAAQ,MAAO,EAG5B,CAEE,aAAaC,EAAoB,CAC/B,MAAM,aAAaA,CAAkB,EACrCE,EAAA,KAAKH,GAAU,KAAK,WAAW,cAAc,QAAQ,EACzD,CAWE,QAAS,CACP,OAAOI;AAAAA;AAAAA,wBAEaC,EAAA,KAAKN,GAAAO,IAAiB,KAAK,IAAI,CAA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,CACE,MAAO,yBACP,YAAa,4BACb,IAAK,iFACL,KAAM,uBACP,EACD,CACE,MAAO,kCACP,YAAa,2BACb,IAAK,4EACL,KAAM,uBACP,EACD,CACE,MAAO,iDACP,YAAa,YACb,IAAK,wFACL,KAAM,uBACP,EACD,CACE,MAAO,yBACP,YAAa,kBACb,IAAK,qEACL,KAAM,uBACP,EACD,CACE,MAAO,kBACP,YAAa,iCACb,IAAK,kGACL,KAAM,uBACP,EACD,CACE,MAAO,mBACP,YAAa,kCACb,IAAK,oGACL,KAAM,uBACP,EACD,CACE,MAAO,2BACP,YAAa,6DACb,IAAK,qGACL,KAAM,uBACP,EACD,CACE,MAAO,6BACP,YAAa,2DACb,IAAK,uGACL,KAAM,uBACP,EACD,CACE,MAAO,mCACP,YAAa,oDACb,IAAK,mGACL,KAAM,uBACP,EACD,CACE,MAAO,cACP,IAAK,sFACL,KAAM,uBACP,EACD,CACE,MAAO,0BACP,IAAK,0HACL,KAAM,uBACP,EACD,CACE,MAAO,mBACP,YAAa,sCACb,IAAK;AAAA,EACL,KAAM,uBACP,EACD,CACE,MAAO,sCACP,YAAa,kCACb,IAAK,mEACL,KAAM,uBACP,EACD,CACE,MAAO,WACP,IAAK,wFACL,KAAM,uBACP,EACD,CACE,MAAO,0BACP,IAAK,2GACL,KAAM,uBACP,EACD,CACE,MAAO,UACP,IAAK,6EACL,KAAM,uBACP,EACD,CACE,MAAO,uBACP,IAAK,uGACL,KAAM,uBACP,EACD,CACE,MAAO,iCACP,IAAK,kHACL,KAAM,uBACP,EACD,CACE,MAAO,mBACP,IAAK,6IACL,KAAM,uBACP,EACD,CACE,MAAO,kBACP,IAAK,wHACL,KAAM,uBACP,EACD,CACE,MAAO,yBACP,IAAK,0HACL,KAAM,uBACP,EACD,CACE,MAAO,0BACP,IAAK,oOACL,KAAM,uBACP,EACD,CACE,MAAO,YACP,IAAK,qEACL,KAAM,uBACP,EACD,CACE,MAAO,wBACP,IAAK,oFACL,KAAM,uBACP,EACD,CACE,MAAO,aACP,IAAK,gGACL,KAAM,uBACP,EACD,CACE,MAAO,qBACP,IAAK,uEACL,KAAM,uBACP,EACD,CACE,MAAO,cACP,IAAK,4GACL,KAAM,uBACP,EACD,CACE,MAAO,gBACP,IAAK,4GACL,KAAM,uBACP,EACD,CACE,MAAO,QACP,YAAa,mBACb,IAAK,2EACL,KAAM,uBACZ,CACG,EACD,KAAM,CACJ,CACE,MAAO,oBACP,IAAK,oEACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,mEACL,KAAM,uBACN,WAAY,CACV,qBAAsB,iFAC9B,CACK,EACD,CACE,MAAO,oBACP,IAAK,oEACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,mEACL,KAAM,uBACN,WAAY,CACV,qBAAsB,iFAC9B,CACK,EACD,CACE,MAAO,mBACP,IAAK,sGACL,KAAM,sBACP,EACD,CACE,MAAO,wBACP,IAAK,sGACL,KAAM,sBACP,EACD,CACE,MAAO,mBACP,IAAK,uHACL,KAAM,sBACP,EACD,CACE,MAAO,0CACP,IAAK,gIACL,KAAM,sBACP,EACD,CACE,MAAO,yCACP,IAAK,+GACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,yGACL,KAAM,sBACP,EACD,CACE,MAAO,2CACP,IAAK,8GACL,KAAM,sBACP,EACD,CACE,MAAO,oCACP,IAAK,2GACL,KAAM,sBACP,EACD,CACE,MAAO,oBACP,IAAK,4IACL,KAAM,sBACP,EACD,CACE,MAAO,+BACP,IAAK,kHACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,iHACL,KAAM,sBACP,EACD,CACE,MAAO,2CACP,IAAK,+GACL,KAAM,sBACP,EACD,CACE,MAAO,mBACP,IAAK,oEACL,KAAM,sBACP,EACD,CACE,MAAO,+BACP,IAAK,mFACL,KAAM,sBACP,EACD,CACE,MAAO,8BACP,IAAK,gFACL,KAAM,sBACZ,CACG,EACD,IAAK,CACH,CACE,MAAO,YACP,YAAa,UACb,IA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AAW,GACtCA,GAAY,OACrBwD,EAAO,YAAY,CAAE,MAAO,MAAM,CAAE","x_google_ignoreList":[4,8,9,22,23]} \ No newline at end of file +{"version":3,"file":"index-pkCQMwAg.js","sources":["../../src/components/dialog/demo-dialog-component.js","../../src/layout/content/settings/preferences-provider.js","../../src/utils/il-provider.js","../../src/components/player/player.js","../../node_modules/lit-html/directives/class-map.js","../../src/layout/content/examples/load-media-form-component.js","../../src/components/content-link/content-link-component.js","../../src/layout/content/examples/examples.js","../../node_modules/lit-html/directives/map.js","../../node_modules/lit-html/directives/when.js","../../src/layout/content/examples/examples-page.js","../../src/components/spinner/spinner-component.js","../../src/components/intersection-observer/intersection-observer-component.js","../../src/components/scroll-to-top/scroll-to-top-component.js","../../src/utils/string-utils.js","../../src/layout/content/lists/lists-page-state-manager.js","../../src/layout/content/lists/lists-sections.js","../../src/layout/content/lists/lists-page.js","../../src/layout/content/search/search-bar-component.js","../../src/layout/content/search/search-page.js","../../src/components/toggle-switch/toggle-switch-component.js","../../src/layout/content/settings/settings-page.js","../../node_modules/highlight.js/lib/core.js","../../node_modules/highlight.js/es/languages/javascript.js","../../src/components/code-block/code-block.js","../../src/layout/content/showcase/showcase-component.js","../../static/showcases/start-time.html?raw","../../static/showcases/multi-player.html?raw","../../static/showcases/blocked-segment.html?raw","../../static/showcases/chapters.html?raw","../../static/showcases/skip-credits.html?raw","../../static/showcases/playlist.html?raw","../../static/showcases/quality-menu.html?raw","../../static/showcases/countdown.html?raw","../../src/layout/content/showcase/example-parser.js","../../src/layout/content/showcase/showcase-page.js","../../src/layout/header/demo-header-component.js","../../src/router/route-outlet-component.js","../../src/index.js"],"sourcesContent":["/**\n * Defines the behaviour of the demo dialog.\n *\n * @module\n */\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../theme/theme';\nimport componentCSS from './demo-dialog-component.scss?inline';\n\nexport class DemoDialog extends LitElement {\n static properties = {\n open: { type: Boolean, reflect: true }\n };\n\n static styles = [\n theme, animations, unsafeCSS(componentCSS)\n ];\n\n #dialog;\n\n constructor() {\n super();\n this.open = false;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('open')) {\n if (this.open) {\n this.#dialog.showModal();\n this.#dialog.classList.toggle('slide-up-fade-in', true);\n } else {\n this.#dialog.close();\n }\n }\n }\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n this.#dialog = this.shadowRoot.querySelector('dialog');\n }\n\n #onDialogClosed() {\n this.dispatchEvent(new CustomEvent('close'));\n }\n\n #onDialogClicked(e) {\n if (this.#dialog !== e.target) return;\n this.open = false;\n }\n\n render() {\n return html`\n e.target.classList.remove('slide-up-fade-in')}\">\n \n \n \n `;\n }\n}\n\ncustomElements.define('demo-dialog', DemoDialog);\n","/**\n * Utility class for loading and saving preferences to local storage.\n *\n * @class PreferencesProvider\n */\nclass PreferencesProvider {\n /**\n * Load preferences from local storage.\n *\n * @static\n * @returns {Object} An object representing the loaded preferences.\n */\n static loadPreferences() {\n return JSON.parse(localStorage.getItem('preferences')) || {};\n }\n\n /**\n * Save preferences to local storage.\n *\n * @static\n * @param {Object} preferences - An object representing the preferences to be saved.\n * @returns {void}\n */\n static savePreferences(preferences) {\n localStorage.setItem('preferences', JSON.stringify(preferences));\n }\n}\n\nexport default PreferencesProvider;\n","export const IL_DEFAULT_HOST = 'il.srgssr.ch';\n\nconst DEFAULT_QUERY_PARAMS = {\n vector: 'srgplay'\n};\nconst DEFAULT_SEARCH_PARAMS = {\n includeAggregations: false,\n includeSuggestions: false,\n sortBy: 'default',\n sortDir: 'desc',\n pageSize: 50,\n ...DEFAULT_QUERY_PARAMS\n};\nconst DEFAULT_SHOWLIST_PARAMS = {\n onlyActiveShows: true,\n ...DEFAULT_QUERY_PARAMS\n};\n\nconst toMedia = ({ title, urn, mediaType, date, duration }) => ({\n title, urn, mediaType, date, duration\n});\n\n/**\n * Class representing a provider for the integration layer.\n *\n * @class\n */\nclass ILProvider {\n #host;\n\n /**\n * Creates an instance of ILProvider.\n *\n * @param {string} [host='il.srgssr.ch'] - The hostname for the integration layer (without the protocol).\n */\n constructor(host = IL_DEFAULT_HOST) {\n this.host = host;\n }\n\n /**\n * Get the current hostname for the integration layer.\n *\n * @returns {string} the hostname for the integration layer.\n */\n get host() {\n return this.#host;\n }\n\n /**\n * Set the hostname for the integration layer (without the protocol). Forces\n * `il.srgssr.ch` if null, undefined or empty string is passed.\n *\n * @param {string} host The hostname for the integration layer,\n */\n set host(host) {\n this.#host = host || IL_DEFAULT_HOST;\n }\n\n /**\n * Performs a search for media content based on the provided business unit and query.\n *\n * @param {string} bu - The business unit for which the search is performed (rsi, rtr, rts, srf or swi).\n * @param {string} query - The search query.\n * @param {AbortSignal} [signal=undefined] - (Optional) An abort signal,\n * allows to abort the query through an abort controller.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the search results.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async search(bu, query, signal = undefined) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/searchResultMediaList`,\n { ...DEFAULT_SEARCH_PARAMS, q: query },\n signal\n );\n const toResults = (data) => data.searchResultMediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves a list of topics for the specified business unit and transmission type.\n *\n * @param {string} bu - The business unit for which to retrieve topics (rsi, rtr, rts, srf, or swi).\n * @param {string} [transmission='tv'] - The transmission type ('tv' or 'radio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the topics.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async topics(bu, transmission = 'tv') {\n const data = await this.#fetch(`/${bu.toLowerCase()}/topicList/${transmission}`);\n\n return data.topicList.map(\n ({ title, urn }) => ({ title, urn })\n );\n }\n\n /**\n * Retrieves the latest media content for a specific topic.\n *\n * @param {string} topicUrn - The URN (Unique Resource Name) of the topic.\n * @param {number} [pageSize=30] - The maximum number of episodes to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async latestByTopic(topicUrn, pageSize = 30) {\n const data = await this.#fetch(`/mediaList/latest/byTopicUrn/${topicUrn}`, { pageSize });\n\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves a list of shows for the specified business unit, transmission type, and ordering.\n *\n * @param {string} bu - The business unit for which to retrieve shows (rsi, rtr, rts, srf, or swi).\n * @param {string} [pageSize='unlimited'] - The maximum number of shows to retrieve. Use 'unlimited' for all shows.\n * @param {string} [transmission='tv'] - The transmission type ('tv' or 'radio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the shows.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async shows(bu, pageSize = 'unlimited', transmission = 'tv') {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/showList/${transmission}/alphabetical`,\n { ...DEFAULT_SHOWLIST_PARAMS, pageSize }\n );\n\n return data.showList.map(\n ({ title, urn }) => ({ title, urn })\n );\n }\n\n /**\n * Retrieves the latest media content for a specific show.\n *\n * @param {string} showUrn - The URN (Unique Resource Name) of the show.\n * @param {number} [pageSize=30] - The maximum number of episodes to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async latestByShow(showUrn, pageSize = 30) {\n const data = await this.#fetch(\n `/episodeComposition/latestByShow/byUrn/${showUrn}`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n\n const toResults = (data) => data.episodeList\n .map(({ mediaList }) => mediaList[0])\n .map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves editorial media content for the specified business unit.\n *\n * @param {string} bu - The business unit for which to retrieve editorial media (rsi, rtr, rts, srf, or swi).\n * @param {number} [pageSize=30] - The maximum number of editorial media items to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async editorial(bu, pageSize = 30) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/mediaList/video/editorial`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves livestream media content for the specified business unit and media type.\n *\n * @param {string} bu - The business unit for which to retrieve livestreams (rsi, rtr, rts, srf, or swi).\n * @param {string} [mediaType='video'] - The media type ('video' or 'audio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the livestream media content.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async livestreams(bu, mediaType = 'video') {\n const data = await this.#fetch(`/${bu.toLowerCase()}/mediaList/${mediaType}/livestreams`);\n\n return data.mediaList.map(toMedia);\n }\n\n /**\n * Retrieves scheduled livestream media content for the specified business unit.\n *\n * @param {string} bu - The business unit for which to retrieve scheduled livestreams (rsi, rtr, rts, srf, or swi).\n * @param {number} [pageSize=10] - The maximum number of scheduled livestreams to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async scheduledLivestream(bu, pageSize = 10) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/mediaList/video/scheduledLivestreams`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves media content for the livecenter for the specified business unit.\n *\n * @param {string} bu - The business unit for which to retrieve livecenter media (rsi, rtr, rts, srf, or swi).\n * @param {number} [pageSize=10] - The maximum number of livecenter media items to retrieve.\n *\n * @returns {Promise<{ results: Array<{ title: string, urn: string }>, next: function }>} - A promise\n * that resolves to an object containing :\n * - `results`: An array of objects containing the title, URN, media type, date, and duration of the medias.\n * - `next`: A function that, when called, retrieves the next set of data and returns a new object with updated results and the next function.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async livecenter(bu, pageSize = 10) {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/mediaList/video/scheduledLivestreams/livecenter`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n const toResults = (data) => data.mediaList.map(toMedia);\n\n return {\n results: toResults(data),\n next: data.next ? this.#nextProvider(data.next, toResults) : undefined\n };\n }\n\n /**\n * Retrieves a list of channels for the specified business unit and transmission type.\n *\n * @param {string} bu - The business unit for which to retrieve channels (rsi, rtr, rts, srf, or swi).\n * @param {string} [transmission='radio'] - The transmission type ('tv' or 'radio').\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and ID of the channels.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async channels(bu, transmission = 'radio') {\n const data = await this.#fetch(`/${bu.toLowerCase()}/channelList/${transmission}`);\n\n return data.channelList.map(\n ({ title, id }) => ({ title, id })\n );\n }\n\n /**\n * Retrieves radio shows for the specified business unit and channel.\n *\n * @param {string} bu - The business unit for which to retrieve radio shows (rsi, rtr, rts, srf, or swi).\n * @param {string} channelId - The ID of the channel.\n * @param {string} [pageSize='unlimited'] - The maximum number of radio shows to retrieve. Use 'unlimited' for all shows.\n *\n * @returns {Promise>} - A promise that resolves to an array\n * of objects containing the title and URN of the radio shows.\n *\n * @throws {Promise} - A rejected promise with the response object if the fetch request fails.\n */\n async radioShowByChannel(bu, channelId, pageSize = 'unlimited') {\n const data = await this.#fetch(\n `/${bu.toLowerCase()}/showList/radio/alphabeticalByChannel/${channelId}`,\n { ...DEFAULT_QUERY_PARAMS, pageSize }\n );\n\n return data.showList.map(\n ({ title, urn }) => ({ title, urn })\n );\n }\n\n /**\n * Asynchronously fetches data from the IL for the specified path and parameters.\n *\n * @private\n * @param {string} path - The path to fetch data from.\n * @param {Object} [params=DEFAULT_QUERY_PARAMS] - (Optional) parameters for the request.\n * @param {AbortSignal} [signal=undefined] - (Optional) AbortSignal to abort the request.\n *\n * @returns {Promise<*>} A Promise that resolves to the JSON response data.\n *\n * @throws {Response} If the HTTP response is not ok (status code other than 2xx).\n * @throws {Error} If the fetch operation fails for any other reason.\n */\n async #fetch(path, params = DEFAULT_QUERY_PARAMS, signal = undefined) {\n const queryParams = new URLSearchParams(params).toString();\n const url = `https://${this.host}/integrationlayer/2.0/${path.replace(/^\\/+/, '')}?${queryParams}`;\n\n return fetch(url, { signal }).then(response => {\n if (!response.ok) {\n return Promise.reject(response);\n }\n\n return response.json();\n }).catch((reason) => {\n return Promise.reject(reason);\n });\n }\n\n /**\n * Generates a function that, when called, retrieves the next set of data and\n * returns a new object with updated results and the next function.\n *\n * @private\n * @template T - The type of data returned by the resultMapper function.\n *\n * @param {string} nextUrl - The URL for fetching the next set of data.\n * @param {(data: any) => T} resultMapper - A function to map the raw data to the desired format.\n *\n * @returns {(signal?: AbortSignal) => Promise<{ results: T, next: function }>} - A function that,\n * when called, retrieves the next set of data and returns a new object with updated results and the next function.\n */\n #nextProvider(nextUrl, resultMapper) {\n return async(signal = undefined) => {\n const nextData = await fetch(nextUrl, { signal }).then(response => {\n if (!response.ok) {\n return Promise.reject(response);\n }\n\n return response.json();\n }).catch((reason) => {\n return Promise.reject(reason);\n });\n\n const nextResults = resultMapper(nextData);\n\n return {\n results: nextResults,\n next: this.#nextProvider(nextData.next, resultMapper)\n };\n };\n }\n}\n\nexport default new ILProvider();\n","/**\n * Initialized the demo player.\n *\n * @module\n */\nimport '../dialog/demo-dialog-component';\nimport PreferencesProvider\n from '../../layout/content/settings/preferences-provider';\nimport router from '../../router/router';\nimport Pillarbox from '@srgssr/pillarbox-web';\nimport { IL_DEFAULT_HOST } from '../../utils/il-provider.js';\n\nconst DEMO_PLAYER_ID = 'demo-player';\nconst DEFAULT_OPTIONS = {\n restoreEl: true\n};\n\nconst preferencesToPlayerOptions = (preferences) => {\n return {\n muted: preferences.muted ?? true,\n autoplay: preferences.autoplay ?? false,\n debug: preferences.debug ?? false,\n srgOptions: {\n dataProviderHost: preferences.dataProviderHost ?? IL_DEFAULT_HOST\n }\n };\n};\n/**\n * Creates and configures a Pillarbox player.\n *\n * @param {Object} options - (Optional) options to customize the player behaviour.\n *\n * @returns {Object} The configured Pillarbox player instance.\n */\nconst createPlayer = (options = {}) => {\n window.player = new Pillarbox(DEMO_PLAYER_ID, {\n ...DEFAULT_OPTIONS,\n ...preferencesToPlayerOptions(PreferencesProvider.loadPreferences()),\n ...options\n });\n\n return window.player;\n};\n\n/**\n * Disposes of the Pillarbox video player instance.\n */\nconst destroyPlayer = () => {\n Pillarbox.getPlayer(DEMO_PLAYER_ID).dispose();\n window.player = null;\n};\n\n// Expose Pillarbox and player in the window object for debugging\nwindow.pillarbox = Pillarbox;\n// Configure the dialog\nconst playerDialog = document.querySelector('demo-dialog');\n\nconst toParams = (keySystems) => {\n const vendor = Object.keys(keySystems ?? {})[0];\n\n if (!vendor) {\n return {};\n }\n\n return {\n vendor,\n ...(vendor === 'com.apple.fps.1_0' ? keySystems[vendor] : { licenseUri: keySystems[vendor] })\n };\n};\n\nconst toKeySystem = (params) => {\n if (!params.vendor) {\n return undefined;\n }\n\n const { certificateUri, licenseUri } = params;\n\n if (params.vendor === 'com.apple.fps.1_0') {\n return { [params.vendor]: { certificateUri, licenseUri } };\n }\n\n return { [params.vendor]: licenseUri };\n};\n\nexport const asQueryParams = ({ src, type, keySystems }) => {\n return new URLSearchParams({ src, type, ...toParams(keySystems) }).toString();\n};\n\nplayerDialog.addEventListener('close', () => {\n destroyPlayer();\n router.updateState({}, ['src', 'type', 'vendor', 'certificateUri', 'licenseUri']);\n});\n\nconst loadPlayerFromRouter = (e) => {\n if (window.player) {\n return;\n }\n\n const params = e.detail.queryParams;\n\n if ('src' in params) {\n const { src, type } = params;\n const keySystems = toKeySystem(params);\n\n openPlayerModal({ src, type, keySystems });\n }\n};\n\nrouter.addEventListener('routechanged', loadPlayerFromRouter);\nrouter.addEventListener('queryparams', loadPlayerFromRouter);\n\n/**\n * Opens a modal containing a video player with specified source and type. Can only\n * load URN if the type 'srgssr/urn`is explicitly provided, otherwise the created\n * Pillarbox player tries to guess the type.\n *\n * @param {object} options - An object containing the source and type of the video to be played.\n * @param {string} options.src - The source URL of the video.\n * @param {string} [options.type] - (Optional) The type/format of the video (e.g., 'video/mp4').\n * @param {object} [options.keySystems] - (Optional) The DRM configuration for DRM protected sources.\n * @param {object} [options.playerOptions] - (Optional) Additional configuration for the player.\n * @param {Boolean} shouldUpdateRouter - Whether the router should be updated or not (Default: true).\n *\n * @returns {Object} The configured Pillarbox player instance.\n */\nexport const openPlayerModal = (\n { src, type, keySystems, playerOptions },\n shouldUpdateRouter = true\n) => {\n const player = createPlayer(playerOptions ?? {});\n\n playerDialog.open = true;\n player.src({ src, type, keySystems });\n\n if (shouldUpdateRouter) {\n router.updateState({\n src,\n ...(type ? { type } : {}),\n ...toParams(keySystems)\n });\n }\n\n return player;\n};\n","import{noChange as t}from\"../lit-html.js\";import{directive as s,Directive as i,PartType as r}from\"../directive.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const e=s(class extends i{constructor(t){if(super(t),t.type!==r.ATTRIBUTE||\"class\"!==t.name||t.strings?.length>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(t){return\" \"+Object.keys(t).filter((s=>t[s])).join(\" \")+\" \"}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(\" \").split(/\\s/).filter((t=>\"\"!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t}});export{e as classMap};\n//# sourceMappingURL=class-map.js.map\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport componentCSS from './load-media-form-component.scss?inline';\nimport { classMap } from 'lit/directives/class-map.js';\n\n/**\n * LoadMediaFormComponent is a LitElement that provides a user interface for loading media content.\n *\n * @element load-media-form\n *\n * @fires LoadMediaFormComponent#submit-media - Dispatched when the user submits media with the specified details.\n *\n * @prop {String} src - The URL or URN of the media content to be loaded.\n * @prop {{vendor: String, certificateUri: String, licenseUri: String}} drmSettings - DRM settings for the loaded media.\n */\nexport class LoadMediaFormComponent extends LitElement {\n static properties = {\n src: { type: String },\n drmSettings: { type: Object },\n drmSettingsShown: { state: true, type: Boolean }\n };\n\n static styles = [theme, animations, unsafeCSS(componentCSS)];\n\n constructor() {\n super();\n\n this.src = '';\n this.#initDrmSettings();\n }\n\n #initDrmSettings() {\n this.drmSettings = {\n vendor: '',\n certificateUri: '',\n licenseUri: ''\n };\n }\n\n #getSource() {\n try {\n return new URL(this.src).searchParams.get('urn') ?? this.src;\n } catch {\n return this.src;\n }\n }\n\n #submitMedia() {\n const src = this.#getSource()?.trim();\n const type = src.startsWith('urn:') ? 'srgssr/urn' : undefined;\n const keySystems = this.#keySystems;\n\n /**\n * Custom event dispatched by LoadMediaFormComponent when the user submits media.\n *\n * @event LoadMediaFormComponent#submit-media\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {string} detail.src - The URL or URN of the media content to be loaded.\n * @property {string | undefined} detail.type - The type of media. Undefined if the type cannot be determined.\n * @property {Object | undefined} detail.keySystems - DRM key systems for the loaded media.\n */\n this.dispatchEvent(new CustomEvent('submit-media', {\n detail: { src, type, keySystems }\n }));\n }\n\n #handleLoadBarKeyUp(event) {\n this.src = event.target.value;\n\n if (event.key === 'Enter' && this.src) {\n this.#submitMedia();\n }\n }\n\n get #keySystems() {\n if (!this.drmSettings?.vendor) {\n return undefined;\n }\n\n return this.#toKeySystem();\n }\n\n #toKeySystem() {\n const certificateUri = this.drmSettings.certificateUri?.trim();\n const licenseUri = this.drmSettings.licenseUri?.trim();\n\n if (this.drmSettings.vendor === 'com.apple.fps.1_0') {\n return { [this.drmSettings.vendor]: { certificateUri, licenseUri } };\n }\n\n return { [this.drmSettings.vendor]: licenseUri };\n }\n\n render() {\n const btnSettingsClassMap = {\n spin: this.drmSettingsShown === true,\n 'spin-back': this.drmSettingsShown === false\n };\n\n return html`\n
e.target.classList.remove('fade-in')}\">\n
\n insert_link\n \n \n
\n \n ${this.#drmSettingsTemplate()}\n\n \n
\n `;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('drmSettingsShown') && this.drmSettingsShown) {\n this.shadowRoot.querySelector('.drm-settings-container').classList.add('active');\n }\n }\n\n #onFormAnimationEnd(e) {\n e.target.classList.toggle('active', !e.target.classList.contains('fade-out-shrink'));\n e.target.classList.remove('fade-in-grow', 'fade-out-shrink');\n }\n\n #formAnimationClassMap() {\n return {\n 'fade-in-grow': this.drmSettingsShown === true,\n 'fade-out-shrink': this.drmSettingsShown === false\n };\n }\n\n #drmSettingsTemplate() {\n return html`\n
this.#onFormAnimationEnd(e)}\">\n

DRM Settings

\n \n { this.drmSettings.licenseUri = e.target.value; }}\">\n { this.drmSettings.certificateUri = e.target.value; }}\">\n \n
\n
\n `;\n }\n}\n\ncustomElements.define('load-media-form', LoadMediaFormComponent);\n","import router from '../../router/router';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport componentCSS from './content-link-component.scss?inline';\n\n/**\n * A component for rendering a content link.\n *\n * @prop {string} href - The URL to navigate to.\n * @prop {string} title - The title attribute for the link.\n *\n * @csspart a - The anchor element.\n * @csspart title - The title span within the anchor.\n * @csspart description - The slot for additional description content within the anchor.\n *\n * @example\n * \n * Additional Description Content\n * \n */\nexport class ContentLinkComponent extends LitElement {\n static properties = {\n href: {}\n };\n\n static styles = unsafeCSS(componentCSS);\n\n #onClick = (event) => {\n event.preventDefault();\n\n const url = new URL(`${window.location.origin}/${this.href}`);\n const queryParams = Object.fromEntries(url.searchParams.entries());\n\n router.navigateTo(url.pathname, queryParams);\n };\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n render() {\n return html`\n \n ${this.title}\n \n \n `;\n }\n}\n\ncustomElements.define('content-link', ContentLinkComponent);\n","const EXAMPLES = {\n SRGSSR: [\n {\n title: 'Horizontal video',\n src: 'urn:rts:video:14827306',\n type: 'srgssr/urn'\n },\n {\n title: 'Square video',\n src: 'urn:rts:video:8393241',\n type: 'srgssr/urn'\n },\n {\n title: 'Vertical video',\n src: 'urn:rts:video:13444390',\n type: 'srgssr/urn'\n },\n {\n title: 'Token-protected video',\n description: 'Ski alpin, Slalom Messieurs',\n src: 'urn:swisstxt:video:rts:c56ea781-99ad-40c3-8d9b-444cc5ac3aea',\n type: 'srgssr/urn'\n },\n {\n title: 'Superfluously token-protected video',\n description: 'Telegiornale flash',\n src: 'urn:rsi:video:15916771',\n type: 'srgssr/urn'\n },\n {\n title: 'DRM-protected video',\n description: 'Top Models 8870',\n src: 'urn:rts:video:13639837',\n type: 'srgssr/urn'\n },\n {\n title: 'Live video',\n description: 'SRF 1',\n src: 'urn:srf:video:c4927fcf-e1a0-0001-7edd-1ef01d441651',\n type: 'srgssr/urn'\n },\n {\n title: 'DVR video livestream',\n description: 'RTS 1',\n src: 'urn:rts:video:3608506',\n type: 'srgssr/urn'\n },\n {\n title: 'DVR audio livestream',\n description: 'Couleur 3 (DVR)',\n src: 'urn:rts:audio:3262363',\n type: 'srgssr/urn'\n },\n {\n title: 'On-demand audio stream',\n description: 'Il lavoro di TerraProject per una fotografia documentaria',\n src: 'urn:rsi:audio:8833144',\n type: 'srgssr/urn'\n },\n {\n title: 'Expired URN',\n description: 'Content that is not available anymore',\n src: 'urn:rts:video:13382911',\n type: 'srgssr/urn'\n },\n {\n title: 'Unknown URN',\n description: 'Content that does not exist',\n src: 'urn:srf:video:unknown',\n type: 'srgssr/urn'\n }\n ],\n HLS: [\n {\n title: 'VOD - HLS',\n description: 'Switzerland says sorry! The fondue invasion',\n src: 'https://swi-vod.akamaized.net/videoJson/47603186/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'VOD - HLS (short)',\n description: 'Des violents orages ont touché Ajaccio, chef-lieu de la Corse, jeudi',\n src: 'https://rts-vod-amd.akamaized.net/ww/13317145/f1d49f18-f302-37ce-866c-1c1c9b76a824/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Brain Farm Skate Phantom Flex',\n description: '4K video',\n src: 'https://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Video livestream - HLS',\n description: 'Couleur 3 en vidéo (live)',\n src: 'https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8?dw=0',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Video livestream with DVR - HLS',\n description: 'Couleur 3 en vidéo (DVR)',\n src: 'https://rtsc3video.akamaized.net/hls/live/2042837/c3video/3/playlist.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Video livestream with DVR and timestamps - HLS',\n description: 'Tageschau',\n src: 'https://tagesschau.akamaized.net/hls/live/2020115/tagesschau/tagesschau_1/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Audio livestream - HLS',\n description: 'Couleur 3 (DVR)',\n src: 'https://lsaplus.swisstxt.ch/audio/couleur3_96.stream/playlist.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Basic 4:3',\n description: '4x3 aspect ratio, H.264 @ 30Hz',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Basic 16:9',\n description: '16x9 aspect ratio, H.264 @ 30Hz',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Advanced 16:9 (TS)',\n description: '16x9 aspect ratio, H.264 @ 30Hz and 60Hz, Transport stream',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Advanced 16:9 (fMP4)',\n description: '16x9 aspect ratio, H.264 @ 30Hz and 60Hz, Fragmented MP4',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Advanced 16:9 (HEVC/H.264)',\n description: '16x9 aspect ratio, H.264 and HEVC @ 30Hz and 60Hz',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple Atmos',\n src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/adv_dv_atmos/main.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple WWDC Keynote 2023',\n src: 'https://events-delivery.apple.com/0105cftwpxxsfrpdwklppzjhjocakrsk/m3u8/vod_index-PQsoJoECcKHTYzphNkXohHsQWACugmET.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Apple tv trailer',\n description: 'Lot of audios and subtitles choices',\n src: 'https://play-edge.itunes.apple.com/WebObjects/MZPlayLocal.woa/hls/subscription/playlist.m3u8?cc=CH&svcId=tvs.vds.4021&a=1522121579&isExternal=true&brandId=tvs.sbd.4000&id=518077009&l=en-GB&aec=UHD\\n',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Multiple subtitles and audio tracks',\n description: 'On some devices codec may crash',\n src: 'https://bitmovin-a.akamaihd.net/content/sintel/hls/playlist.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: '4K, HEVC',\n src: 'https://cdn.bitmovin.com/content/encoding_test_dash_hls/4k/hls/4k_profile/master.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'VoD, single audio track',\n src: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'AES-128',\n src: 'https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/m3u8s/11331.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Fragmented MP4',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Alternate audio language',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Audio only',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.m3u8?filter=(type!=%22video%22)',\n type: 'application/x-mpegURL'\n },\n {\n title: 'HLS - Trickplay',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/no-handler-origin/tears-of-steel/tears-of-steel-trickplay.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Limiting bandwidth use',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8?max_bitrate=800000',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Dynamic Track Selection',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8?filter=%28type%3D%3D%22audio%22%26%26systemBitrate%3C100000%29%7C%7C%28type%3D%3D%22video%22%26%26systemBitrate%3C1024000%29',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Pure live',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Timeshift (5 minutes)',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8?time_shift=300',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Live audio',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8?filter=(type!=%22video%22)',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Pure live (scte35)',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/scte35.isml/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'fMP4, clear',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-fmp4.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'fMP4, HEVC 4K',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-hevc.ism/.m3u8',\n type: 'application/x-mpegURL'\n },\n {\n title: 'Test1',\n description: 'Forced subtitles',\n src: 'https://prd.vod-srgssr.ch/origin/1053457/fr/master.m3u8?complexSubs=true',\n type: 'application/x-mpegURL'\n }\n ],\n DASH: [\n {\n title: 'VoD - Dash (H264)',\n src: 'https://storage.googleapis.com/wvmedia/clear/h264/tears/tears.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'VoD - Dash Widewine cenc (H264)',\n src: 'https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd',\n type: 'application/dash+xml',\n keySystems: {\n 'com.widevine.alpha': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'\n }\n },\n {\n title: 'VoD - Dash (H265)',\n src: 'https://storage.googleapis.com/wvmedia/clear/hevc/tears/tears.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'VoD - Dash widewine cenc (H265)',\n src: 'https://storage.googleapis.com/wvmedia/cenc/hevc/tears/tears.mpd',\n type: 'application/dash+xml',\n keySystems: {\n 'com.widevine.alpha': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'\n }\n },\n {\n title: 'VoD - Dash - MP4',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.mp4/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Fragmented MP4',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - TrickPlay',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/no-handler-origin/tears-of-steel/tears-of-steel-trickplay.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Tiled thumbnails (live/timeline)',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-tiled-thumbnails-timeline.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Accessibility - hard of hearing',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-hoh-subs.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Single - fragmented TTML',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-en.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Multiple - RFC 5646 language tags',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-rfc5646.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Multiple - fragmented TTML',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-ttml.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Audio only',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.mpd?filter=(type!=%22video%22)',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Multiple audio codecs',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-codec.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Alternate audio language',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multi-lang.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Accessibility - audio description',\n src: 'https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-desc-aud.ism/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Pure live',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.mpd',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - Timeshift (5 minutes)',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live.isml/.mpd?time_shift=300',\n type: 'application/dash+xml'\n },\n {\n title: 'Dash - DVB DASH low latency',\n src: 'https://demo.unified-streaming.com/k8s/live/stable/live-low-latency.isml/.mpd',\n type: 'application/dash+xml'\n }\n ],\n MP4: [\n {\n title: 'VOD - MP4',\n description: 'The dig',\n src: 'https://media.swissinfo.ch/media/video/dddaff93-c2cd-4b6e-bdad-55f75a519480/rendition/154a844b-de1d-4854-93c1-5c61cd07e98c.mp4',\n type: 'video/mp4'\n },\n {\n title: 'AVC Progressive',\n src: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',\n type: 'video/mp4'\n }\n ],\n AOD: [\n {\n title: 'Audio HLS',\n description: 'Content with PTS rollover',\n src: 'https://cdn.rts.ch/audio-sample/playlist.m3u8',\n type: 'application/x-mpegURL'\n }\n ]\n};\n\nexport default EXAMPLES;\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++)}}export{o as map};\n//# sourceMappingURL=map.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n,r,t){return n?r(n):t?.(n)}export{n as when};\n//# sourceMappingURL=when.js.map\n","import router from '../../../router/router';\nimport { css, html, LitElement } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport './load-media-form-component';\nimport '../../../components/content-link/content-link-component';\nimport Examples from './examples';\nimport { map } from 'lit/directives/map.js';\nimport { when } from 'lit/directives/when.js';\nimport { asQueryParams, openPlayerModal } from '../../../components/player/player';\n\n/**\n * A web component that represents the examples page.\n *\n * @element examples-page\n */\nexport class ExamplesPage extends LitElement {\n static styles = [\n theme, animations, css`\n .example-section p {\n margin-bottom: 0;\n color: var(--color-5);\n font-size: var(--size-3);\n text-align: left;\n }`\n ];\n\n render() {\n return html`\n openPlayerModal(e.detail)}\">\n \n\n \n
e.target.classList.remove('fade-in')}\">\n ${map(Object.entries(Examples), ([section, examples]) => html`\n
\n

${section}

\n ${map(examples, example => html`\n \n ${when(example.description, () => html`\n ${example.title}\n `)}\n \n `)}\n
\n `)}\n
\n `;\n }\n}\n\ncustomElements.define('examples-page', ExamplesPage);\nrouter.addRoute('examples', 'examples-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport spinnerCss from './spinner-component.scss?inline';\nimport { animations } from '../../theme/theme';\n\n/**\n * A spinner component.\n *\n * @element loading-spinner\n */\nexport class SpinnerComponent extends LitElement {\n static properties = {\n loading: { type: Boolean, reflect: true }\n };\n\n static styles = [animations, unsafeCSS(spinnerCss)];\n\n constructor() {\n super();\n this.loading = false;\n }\n\n render() {\n return html`\n
\n
\n
\n `;\n }\n}\n\ncustomElements.define('loading-spinner', SpinnerComponent);\n","import { html, LitElement } from 'lit';\nimport { animations } from '../../theme/theme';\n\nconst DEFAULT_INT_OPTIONS = {\n root: null,\n rootMargin: '0px',\n threshold: 0.1\n};\n\n/**\n * Attach an Intersection Observer to a target element and execute a callback when it becomes visible.\n *\n * @param {Element} target - The target element to observe.\n * @param {Function} callback - The callback function to execute when the target is intersecting.\n * @param {Object} options - (Optional) Options to configure the Intersection Observer.\n * @param {Element} [options.root=null] - The element that is used as the viewport for checking visibility.\n * @param {string} [options.rootMargin='0px'] - Margin around the root. Can have values similar to CSS margin property.\n * @param {number} [options.threshold=0.1] - The threshold at which the callback will be triggered.\n */\nconst onIntersecting = (target, callback, options = DEFAULT_INT_OPTIONS) => {\n new IntersectionObserver((entries) => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n callback();\n }\n });\n }, options).observe(target);\n};\n\n/**\n * This web component acts as a sentinel for an Intersection Observer,\n * dispatching an 'intersecting' event when the observed element intersects\n * with the view.\n *\n * @element intersection-observer\n * @csspart sentinel - the sentinel element.\n *\n * @fires IntersectionObserverComponent#intersecting - Dispatched when the observed element intersects with the view.\n */\nexport class IntersectionObserverComponent extends LitElement {\n static styles = [\n animations\n ];\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n onIntersecting(\n this.renderRoot.querySelector('div'),\n () => {\n /**\n * Custom event dispatched by IntersectionObserverComponent when the observed element intersects\n * with the view.\n *\n * @event IntersectionObserverComponent#intersecting\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {string} detail.src - The URL or URN of the media content to be loaded.\n * @property {string | undefined} detail.type - The type of media. Undefined if the type cannot be determined.\n * @property {Object | undefined} detail.keySystems - DRM key systems for the loaded media.\n */\n this.dispatchEvent(new CustomEvent('intersecting'));\n }\n );\n }\n\n render() {\n return html`\n
\n `;\n }\n}\n\ncustomElements.define('intersection-observer', IntersectionObserverComponent);\n","import { css, html, LitElement } from 'lit';\nimport { animations, theme } from '../../theme/theme';\n\n/**\n * A custom web component that provides a button to scroll to the top of the page.\n *\n * @element scroll-to-top-button\n */\nexport class ScrollToTopComponent extends LitElement {\n static styles = [\n theme,\n animations,\n css`\n .scroll-to-top-button {\n position: fixed;\n right: 20px;\n bottom: 20px;\n z-index: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--size-7);\n height: var(--size-7);\n padding: 0;\n border: none;\n border-radius: var(--radius-round);\n }\n\n .scroll-to-top-button i {\n font-size: var(--size-8);\n }\n `];\n\n render() {\n return html`\n \n `;\n }\n}\n\ncustomElements.define('scroll-to-top-button', ScrollToTopComponent);\n","/**\n * Converts a given string to kebab case, spaces are replaced with hyphens\n * and all letters are converted to lowercase.\n *\n * @param {string} str - The input string to be converted to kebab case.\n * @returns {string} - The input string converted to kebab case.\n *\n * @example\n * const result = toKebabCase(\"Hello World\");\n * console.log(result); // Output: \"hello-world\"\n *\n * @example\n * const result = toKebabCase(\"CamelCase Example\");\n * console.log(result); // Output: \"camelcase-example\"\n */\nexport const toKebabCase = (str) => str.replace(/\\s+/g, '-').toLowerCase();\n","import { toKebabCase } from '../../../utils/string-utils';\n\n/**\n * Manages the state of a lists page, allowing navigation and retrieval of section data.\n *\n * @class\n */\nclass ListsPageStateManager {\n /**\n * Creates an instance of ListsPageStateManager.\n *\n * @constructor\n * @param {Array
} root - The root level of the lists page.\n */\n constructor(root) {\n /**\n * Stack to keep track of the traversal steps for navigation.\n *\n * @type {Array<{level: Array
, sectionIndex: number, nodeIndex: number}>}\n */\n this.stack = [];\n /**\n * The current level of the content tree.\n *\n * @type {Array
}\n */\n this.level = root;\n }\n\n /**\n * Initializes the state manager with the provided section, business unit, and nodes.\n *\n * @async\n * @param {string} section - The section to initialize.\n * @param {string} bu - The business unit associated with the section.\n * @param {string} nodes - A comma-separated string of nodes representing the initial state.\n * @returns {Promise} - A promise that resolves when initialization is complete.\n *\n * @example\n * // Example Usage:\n * await stateManager.initialize(\"radio-shows\", \"rts\", \"a9e7621504c6959e35c3ecbe7f6bed0446cdf8da,urn:rts:show:radio:9801398\");\n */\n async initialize(section, bu, nodes) {\n if (!section || !bu) {\n return;\n }\n\n const sectionIndex = this.#findSectionIndex(section);\n const nodeIndex = this.#findNodeIndex(this.level[sectionIndex].nodes, bu);\n\n await this.fetchNextState(sectionIndex, nodeIndex);\n await this.#processNodeString(nodes);\n }\n\n async #processNodeString(nodes) {\n for (const nodeStr of (nodes?.split(',') || [])) {\n const nodeIndex = this.#findNodeIndex(this.level[0].nodes, nodeStr);\n\n await this.fetchNextState(0, nodeIndex);\n }\n }\n\n /**\n * Fetches the next state based on the provided section index and node index.\n *\n * @param {number} sectionIndex - The index of the section.\n * @param {number} nodeIndex - The index of the node.\n * @returns {Promise} - A promise that resolves when the state is fetched.\n */\n async fetchNextState(sectionIndex, nodeIndex) {\n const section = this.level[sectionIndex];\n\n this.stack.push({ level: this.level, sectionIndex, nodeIndex });\n this.level = [await section.resolve(section.nodes[nodeIndex])];\n }\n\n /**\n * Fetches the previous state based on the provided stack index.\n *\n * @param {number} stackIndex - The index in the stack.\n */\n fetchPreviousState(stackIndex) {\n this.level = this.stack[stackIndex].level;\n this.stack.splice(stackIndex);\n }\n\n /**\n * Checks if the specified section at the given index is a leaf section.\n *\n * @param {number} sectionIndex - The index of the section.\n *\n * @returns {boolean} - True if the section is a leaf section, false otherwise.\n */\n isLeafSection(sectionIndex) {\n return this.level[sectionIndex]?.isLeaf();\n }\n\n /**\n * Retrieves the node at the specified section and node indices.\n *\n * @param {number} sectionIndex - The index of the section.\n * @param {number} nodeIndex - The index of the node.\n *\n * @returns {any} - The retrieved node.\n */\n retrieveNode(sectionIndex, nodeIndex) {\n return this.level[sectionIndex]?.nodes[nodeIndex];\n }\n\n /**\n * Gets the root level of the content tree.\n *\n * @returns {Array
} - The root level of the content tree.\n */\n get root() {\n return this.stack[0]?.level || this.level;\n }\n\n /**\n * Return the current state of this manager as query params that are parsable\n * by {@link #initialize}.\n *\n * @returns {{}|{bu: string, section: string, nodes?: string}} The current state as query params.\n */\n get params() {\n return ListsPageStateManager.#params(this.stack);\n }\n\n static #params(stack) {\n if (stack.length === 0) {\n return {};\n }\n\n const root = stack[0];\n const rootSection = root.level[root.sectionIndex];\n const nodes = stack.slice(1).map(n => {\n const node = n.level[n.sectionIndex].nodes[n.nodeIndex];\n\n return node.id || node.urn;\n });\n const params = {\n section: toKebabCase(rootSection.title),\n bu: rootSection.nodes[root.nodeIndex].toLowerCase()\n };\n\n if (nodes && nodes.length) {\n params.nodes = nodes.join(',');\n }\n\n return params;\n }\n\n paramsAt(sectionIndex, nodeIndex) {\n return ListsPageStateManager.#params(\n [...this.stack, { level: this.level, sectionIndex, nodeIndex }]\n );\n }\n\n /**\n * Finds the index of a section based on its title in kebab case.\n *\n * @private\n * @param {string} sectionStr - The section title to find.\n * @returns {number} - The index of the section.\n *\n * @example\n * const index = stateManager.#findSectionIndex(\"Products\");\n */\n #findSectionIndex(sectionStr) {\n const normalizedSectionStr = toKebabCase(sectionStr).toLowerCase();\n\n return this.level\n .map(s => toKebabCase(s.title).toLowerCase())\n .findIndex(title => title === normalizedSectionStr);\n }\n\n /**\n * Finds the index of a node based on its string representation.\n *\n * @private\n * @param {Array} nodes - The array of nodes to search.\n * @param {string} str - The string representation of the node to find.\n *\n * @returns {number} - The index of the node.\n */\n #findNodeIndex(nodes, str) {\n const normalizedStr = str.toLowerCase();\n\n return nodes\n .map(n => (n.urn || n.id || n.toString()).toLowerCase())\n .findIndex(n => n === normalizedStr);\n }\n}\n\nexport default ListsPageStateManager;\n","import ilProvider from '../../../utils/il-provider';\n\n/**\n * A section within the content hierarchy.\n *\n * @property {string} title - The title of the section node.\n * @property {string[]} values - An array of values associated with the section.\n * @property {function} resolve - A function that, when defined, resolves the next level\n * of the hierarchy asynchronously.\n */\nclass Section {\n /**\n * Creates an instance of Section.\n *\n * @param {Object} options - The options for creating the section.\n * @param {string} options.title - The title of the section.\n * @param {string[]} options.nodes - An array of nodes associated with the section.\n * @param {function} [options.resolve] - (Optional) A function that, when defined, resolves the next level\n * of the hierarchy asynchronously.\n * @param {function} [options.next] - (Optional) A function that, when defined, resolves the next level\n * of the hierarchy asynchronously.\n */\n constructor({\n title,\n nodes,\n resolve = undefined,\n next = undefined\n }) {\n this.title = title;\n this.nodes = nodes;\n this.resolve = resolve;\n this.next = next;\n }\n\n /**\n * Checks if the node is a leaf node (i.e., has no further levels to resolve).\n *\n * @returns {boolean} True if the node is a leaf node, false otherwise.\n */\n isLeaf() {\n return !this.resolve;\n }\n\n /**\n * Fetch more nodes from the next function if available.\n * @param signal\n * @returns {Promise<*>}\n */\n async fetchNext(signal = undefined) {\n if (!this.next) return;\n const data = await this.next(signal);\n\n this.next = data.next;\n this.nodes.push(...data.results);\n\n return data.results;\n }\n}\n\nconst toNodesAndNext = (data) => ({\n nodes: data.results,\n next: data.next\n});\n\n/**\n * An asynchronous tree-like structure that allows traversing the SRG SSR content\n * by category in a hierarchical fashion.\n *\n * @type {Section[]}\n */\nexport const listsSections = [\n new Section({\n title: 'TV Topics',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF', 'SWI'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Topics`,\n nodes: await ilProvider.topics(bu),\n resolve: async(topic) => new Section({\n title: topic.title,\n ...toNodesAndNext(await ilProvider.latestByTopic(topic.urn))\n })\n })\n }),\n new Section({\n title: 'TV Shows',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF', 'SWI'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Shows`,\n nodes: await ilProvider.shows(bu),\n resolve: async(show) => new Section({\n title: show.title,\n ...toNodesAndNext(await ilProvider.latestByShow(show.urn))\n })\n })\n }),\n new Section({\n title: 'TV Latest Videos',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Latest Videos`,\n ...toNodesAndNext(await ilProvider.editorial(bu))\n })\n }),\n new Section({\n title: 'TV Livestreams',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} TV Livestreams`,\n nodes: await ilProvider.livestreams(bu)\n })\n }),\n new Section({\n title: 'Live web',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Live web`,\n ...toNodesAndNext(await ilProvider.scheduledLivestream(bu))\n })\n }),\n new Section({\n title: 'Live center',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Live center`,\n nodes: await ilProvider.livecenter(bu)\n })\n }),\n new Section({\n title: 'Radio Shows',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Radio Channels`,\n nodes: await ilProvider.channels(bu),\n resolve: async(channel) => new Section({\n title: `${channel.title} Radio shows`,\n nodes: await ilProvider.radioShowByChannel(bu, channel.id),\n resolve: async(show) => new Section({\n title: show.title,\n ...toNodesAndNext(await ilProvider.latestByShow(show.urn))\n })\n })\n })\n }),\n new Section({\n title: 'Radio Livestreams',\n nodes: ['RSI', 'RTR', 'RTS', 'SRF'],\n resolve: async(bu) => new Section({\n title: `${bu} Radio Livestreams`,\n nodes: await ilProvider.livestreams(bu, 'audio')\n })\n })\n];\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport router from '../../../router/router';\nimport componentCSS from './lists-page.scss?inline';\nimport '../../../components/spinner/spinner-component';\nimport '../../../components/intersection-observer/intersection-observer-component';\nimport '../../../components/scroll-to-top/scroll-to-top-component';\nimport { map } from 'lit/directives/map.js';\nimport { when } from 'lit/directives/when.js';\nimport ListsPageStateManager from './lists-page-state-manager';\nimport { listsSections } from './lists-sections';\nimport Pillarbox from 'video.js';\n\nexport class ListsPage extends LitElement {\n static properties = {\n loading: { state: true, type: Boolean },\n stack: { state: true, type: Array },\n level: { state: true, type: Object },\n nextPage: { state: true, type: Function }\n };\n\n static styles = [\n theme, animations, unsafeCSS(componentCSS)\n ];\n\n /**\n * The abort controller for handling search cancellation.\n *\n * @private\n * @type {AbortController}\n */\n #abortController = new AbortController();\n /**\n * Keeps track of the state of the list page : the current level in display, as\n * well as the traversal stack.\n *\n * @private\n * @type {ListsPageStateManager}\n */\n #stateManager;\n /**\n * The reference to the query params changed event handler.\n *\n * @private\n * @type {Function}\n */\n #onQueryParamsChanged;\n\n constructor() {\n super();\n\n this.loading = false;\n this.#stateManager = new ListsPageStateManager(listsSections);\n this.#updateState();\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#onQueryParamsChanged = async(event) => {\n if (!event.detail.popstate) return;\n\n this.abortFetch();\n const manager = new ListsPageStateManager(this.#stateManager.root);\n const { section, bu, nodes } = event.detail.queryParams;\n\n this.loading = true;\n try {\n await manager.initialize(section, bu, nodes);\n this.#stateManager = manager;\n this.#updateState();\n } finally {\n this.loading = false;\n }\n };\n router.addEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.abortFetch();\n router.removeEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n this.#onQueryParamsChanged(\n { detail: { popstate: true, queryParams: router.queryParams } }\n );\n }\n\n #updateState() {\n this.stack = [...this.#stateManager.stack];\n this.level = [...this.#stateManager.level];\n }\n\n /**\n * Navigates to the specified section and node in the content tree.\n *\n * @param {number} sectionIndex - The index of the section.\n * @param {number} nodeIndex - The index of the node.\n */\n async navigateTo(sectionIndex, nodeIndex) {\n if (!this.#stateManager.isLeafSection(sectionIndex)) {\n this.abortFetch();\n this.loading = true;\n try {\n await this.#stateManager.fetchNextState(sectionIndex, nodeIndex);\n this.#updateState();\n } finally {\n this.loading = false;\n }\n }\n }\n\n /**\n * Aborts the previous fetch by cancelling the associated abort signal and\n * creates a new abort controller for the next fetch.\n *\n * @returns {AbortSignal} - The abort signal associated with the new fetch.\n */\n abortFetch() {\n this.#abortController?.abort('New search launched');\n this.#abortController = new AbortController();\n\n return this.#abortController.signal;\n }\n\n #toMediaButtonParams(node) {\n return new URLSearchParams({ ...router.queryParams, src: node.urn, type: 'srgssr/urn' }).toString();\n }\n\n #renderMediaButton(node) {\n const date = new Intl.DateTimeFormat('fr-CH').format(new Date(node.date));\n const duration = Pillarbox.formatTime(node.duration / 1000);\n\n return html`\n \n
\n ${node.mediaType === 'VIDEO' ? 'movie' : 'audiotrack'}\n  | ${date} | ${duration}\n
\n
\n `;\n }\n\n #toLevelParams(sectionIdx, nodeIdx) {\n const params = this.#stateManager.paramsAt(sectionIdx, nodeIdx);\n\n return new URLSearchParams(params).toString();\n }\n\n #renderLevelButton(node, sectionIdx, nodeIdx) {\n return html`\n \n \n `;\n }\n\n async #nextPage(section) {\n const signal = this.abortFetch();\n\n await section.fetchNext(signal);\n this.#updateState();\n }\n\n #renderNodes(nodes, sectionIdx) {\n const firstSection = this.level[0];\n const hasIntesectionObserver = this.level.length === 1 && firstSection.next;\n\n return html`\n ${map(nodes, (node, idx) => html`\n ${when(node.mediaType, () => this.#renderMediaButton(node, idx), () => this.#renderLevelButton(node, sectionIdx, idx))}\n `)}\n ${when(hasIntesectionObserver, () => html`\n this.#nextPage(firstSection)}\">\n \n `)}\n `;\n }\n\n async #onSectionsClicked(e) {\n const button = e.target.closest('content-link');\n\n if (this.loading || !('nodeIdx' in button.dataset)) return;\n\n const sectionIndex = button.dataset.sectionIdx;\n const nodeIndex = button.dataset.nodeIdx;\n\n await this.navigateTo(sectionIndex, nodeIndex);\n }\n\n #renderResults() {\n return html`\n
e.target.classList.remove('fade-in')}\"\n @click=\"${this.#onSectionsClicked.bind(this)}\">\n ${map(this.level, (section, idx) => html`\n
\n

${section.title}

\n ${this.#renderNodes(section.nodes, idx)}\n
\n `)}\n
\n `;\n }\n\n #renderSpinner() {\n return html`\n e.target.classList.remove('slide-up-fade-in')}\">\n \n `;\n }\n\n #renderScrollToTopBtn() {\n return html`\n `;\n }\n\n #onNavigationClicked(e) {\n if (e.target.tagName.toLowerCase() !== 'button') return;\n this.abortFetch();\n this.#stateManager.fetchPreviousState(e.target.dataset.navigationIdx);\n this.#updateState();\n router.updateState(this.#stateManager.params, ['section', 'bu', 'nodes']);\n }\n\n #renderNavigation() {\n return html`\n
\n ${when(this.stack.length > 0, () => html`\n \n `)}\n ${map(this.stack.slice(1), (step, idx) => html`\n chevron_right\n \n `)}\n
\n `;\n }\n\n render() {\n const renderScrollBtn = this.level.length === 1 && this.level[0].next;\n\n return html`\n ${this.#renderNavigation()}\n ${when(this.loading, this.#renderSpinner.bind(this), this.#renderResults.bind(this))}\n ${when(renderScrollBtn, this.#renderScrollToTopBtn.bind(this))}\n `;\n }\n}\n\ncustomElements.define('lists-page', ListsPage);\nrouter.addRoute('lists', 'lists-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport componentCSS from './search-bar-component.scss?inline';\nimport Pillarbox from 'video.js';\n\nconst DEFAULT_BU = 'rsi';\n\n/**\n * A search bar component for filtering content based on a query and business unit.\n *\n * @element search-bar\n *\n * @fires SearchBarComponent#change - Dispatched when the value of the search bar changes.\n */\nexport class SearchBarComponent extends LitElement {\n static properties = {\n bu: { type: String },\n query: { type: String }\n };\n\n static styles = [theme, animations, unsafeCSS(componentCSS)];\n\n constructor() {\n super();\n this.bu = DEFAULT_BU;\n this.query = '';\n }\n\n #handleSearchBarKeyUp() {\n this.query = this.renderRoot.querySelector('input').value;\n }\n\n #handleSelectChange(e) {\n this.bu = e.target.value;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (['bu', 'query'].some(property => _changedProperties.has(property))) {\n const query = this.query ?? '';\n const bu = this.bu ?? DEFAULT_BU;\n\n /**\n * Custom event dispatched by SearchBarComponent when the value of the bar changes.\n *\n * @event SearchBarComponent#change\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {string} detail.query - The query on the search bar.a\n * @property {string} detail.bu - The selected bu.\n */\n this.dispatchEvent(new CustomEvent('change', {\n detail: { query, bu }\n }));\n }\n }\n\n #clearSearchBar() {\n this.query = '';\n this.renderRoot.querySelector('input').value = '';\n }\n\n render() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n \n \n
\n `;\n }\n}\n\ncustomElements.define('search-bar', SearchBarComponent);\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport router from '../../../router/router';\nimport componentCSS from './search-page.scss?inline';\nimport './search-bar-component';\nimport ilProvider from '../../../utils/il-provider';\nimport '../../../components/spinner/spinner-component';\nimport '../../../components/intersection-observer/intersection-observer-component';\nimport '../../../components/scroll-to-top/scroll-to-top-component';\nimport '../../../components/content-link/content-link-component';\nimport { map } from 'lit/directives/map.js';\nimport Pillarbox from 'video.js';\nimport { when } from 'lit/directives/when.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport class SearchPage extends LitElement {\n static properties = {\n loading: {\n state: true,\n type: Boolean\n },\n results: {\n state: true,\n type: Array\n },\n nextPage: {\n state: true,\n type: Function\n }\n };\n\n static styles = [\n theme, animations, unsafeCSS(componentCSS)\n ];\n\n /**\n * The abort controller for handling search cancellation.\n *\n * @private\n * @type {AbortController}\n */\n #abortController = new AbortController();\n /**\n * The reference to the query params changed event handler.\n *\n * @private\n * @type {Function}\n */\n #onQueryParamsChanged;\n\n constructor() {\n super();\n\n this.loading = false;\n this.results = null;\n this.nextPage = null;\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.#onQueryParamsChanged = () => {\n const searchBar = this.renderRoot.querySelector('search-bar');\n\n searchBar.query = router.queryParams.query ?? '';\n searchBar.bu = router.queryParams.bu ?? 'rsi';\n };\n router.addEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.abortSearch();\n router.removeEventListener('queryparams', this.#onQueryParamsChanged);\n }\n\n async firstUpdated(_changedProperties) {\n super.firstUpdated(_changedProperties);\n const searchBar = this.renderRoot.querySelector('search-bar');\n\n this.#onQueryParamsChanged();\n await this.#search(searchBar.bu, searchBar.query);\n }\n\n async #onSearchBarChanged(bu, query) {\n router.updateState({ bu, ...(query ? { query } : {}) });\n await this.#search(bu, query);\n }\n\n /**\n * Performs a search based on the specified business unit and query. Performing\n * a new search will abort the previous search if it's ongoing and display a\n * loading spinner for the asynchronous operation.\n *\n * @param {string} bu - The selected business unit.\n * @param {string} query - The search query.\n *\n * @throws {Promise} - A rejected promise with the response object if\n * the fetch request for the search results fails.\n */\n async #search(bu, query) {\n const signal = this.abortSearch();\n\n if (!query) {\n [this.results, this.nextPage] = [null, null];\n\n return;\n }\n\n this.loading = true;\n try {\n const data = await ilProvider.search(bu, query, signal);\n\n [this.results, this.nextPage] = [data.results, data.next];\n } finally {\n this.loading = false;\n }\n }\n\n /**\n * Advances to the next page of search results and updates the UI accordingly.\n *\n * @throws {Promise} - A rejected promise with the response object if\n * the fetch request for the next page fails.\n */\n async #fetchNextPage() {\n const signal = this.abortSearch();\n const data = await this.nextPage(signal);\n\n this.nextPage = data.next;\n this.results = [...this.results, ...data.results];\n }\n\n /**\n * Aborts the previous search by cancelling the associated abort signal and\n * creates a new abort controller for the next search.\n *\n * @returns {AbortSignal} - The abort signal associated with the new search.\n */\n abortSearch() {\n this.#abortController?.abort('New search launched');\n this.#abortController = new AbortController();\n\n return this.#abortController.signal;\n }\n\n #toQueryParams(r) {\n return new URLSearchParams({\n ...router.queryParams,\n src: r.urn,\n type: 'srgssr/urn'\n }).toString();\n }\n\n #renderButton(r) {\n const date = new Intl.DateTimeFormat('fr-CH').format(new Date(r.date));\n const duration = Pillarbox.formatTime(r.duration / 1000);\n\n return html`\n \n
\n ${r.mediaType === 'VIDEO' ? 'movie' : 'audiotrack'}\n  | ${date} | ${duration}\n
\n
\n `;\n }\n\n #renderResults() {\n const resultsClassMap = {\n empty: this.results == null,\n 'no-results': this.results && this.results.length === 0,\n 'material-icons': !this.results || this.results.length === 0\n };\n\n return html`\n
e.target.classList.remove('fade-in')}\">\n ${map(this.results ?? [], this.#renderButton.bind(this))}\n ${when(this.nextPage, () => html`\n \n \n `)}\n
\n `;\n }\n\n #renderSpinner() {\n return html`\n e.target.classList.remove('slide-up-fade-in')}\">\n \n `;\n }\n\n #renderScrollToTopBtn() {\n return html`\n `;\n }\n\n render() {\n return html`\n this.#onSearchBarChanged(e.detail.bu, e.detail.query)}\">\n \n\n \n ${when(this.loading, this.#renderSpinner.bind(this), this.#renderResults.bind(this))}\n ${when(this.results?.length > 0, this.#renderScrollToTopBtn.bind(this))}\n `;\n }\n}\n\ncustomElements.define('search-page', SearchPage);\nrouter.addRoute('search', 'search-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport { theme } from '../../theme/theme';\nimport componentCSS from './toggle-switch-component.scss?inline';\n\n/**\n * Custom element representing a toggle switch.\n *\n * @element toggle-switch\n *\n * @csspart switch - The container for the toggle switch.\n * @csspart slider - The slider button of the toggle switch.\n *\n * @prop {Boolean} checked - Reflects the current state of the toggle switch.\n * @prop {Boolean} disabled - Indicates whether the toggle switch is disabled.\n *\n * @attribute {String} role - ARIA role for accessibility, set to 'switch'.\n * @attribute {String} tabindex - ARIA tabindex for accessibility, set to '0'.\n *\n * @fires ToggleSwitchComponent#change\n *\n * @example\n * \n *\n * @customElement\n */\nexport class ToggleSwitchComponent extends LitElement {\n static formAssociated = true;\n static properties = {\n checked: { type: Boolean, reflect: true },\n disabled: { type: Boolean }\n };\n\n constructor() {\n super();\n this.checked = false;\n this.disabled = false;\n }\n\n static styles = [\n theme, unsafeCSS(componentCSS)\n ];\n\n #onKeyDown = (e) => {\n if (e.key === ' ') {\n e.preventDefault();\n this.toggle();\n }\n };\n\n #onClick = () => {\n this.toggle();\n };\n\n connectedCallback() {\n super.connectedCallback();\n\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'switch');\n }\n\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', '0');\n }\n\n this.addEventListener('click', this.#onClick);\n this.addEventListener('keydown', this.#onKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('click', this.#onClick);\n this.removeEventListener('keydown', this.#onKeyDown);\n }\n\n toggle(force) {\n if (!this.disabled) {\n this.checked = force ?? !this.checked;\n }\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('checked')) {\n this.setAttribute('aria-checked', this.checked.toString());\n /**\n * Custom event dispatched when the state of the toggle switch changes.\n *\n * @event ToggleSwitchComponent#change\n * @type {CustomEvent}\n * @property {Object} detail - The event detail object.\n * @property {Boolean} detail.checked - The new state of the toggle switch.\n */\n this.dispatchEvent(new CustomEvent('change', { detail: { checked: this.checked } }));\n }\n }\n\n render() {\n return html`\n
\n
\n
\n `;\n }\n}\n\ncustomElements.define('toggle-switch', ToggleSwitchComponent);\n","import router from '../../../router/router';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport '../../../components/toggle-switch/toggle-switch-component.js';\nimport PreferencesProvider from './preferences-provider';\nimport componentCss from './settings-page.scss?inline';\nimport ilProvider from '../../../utils/il-provider.js';\n\n/**\n * A web component that represents the settings page.\n *\n * @element settings-page\n */\nexport class SettingsPage extends LitElement {\n static properties = {\n autoplay: { type: Boolean, state: true },\n muted: { type: Boolean, state: true },\n debug: { type: Boolean, state: true },\n dataProviderHost: { type: String, state: true }\n };\n\n static styles = [theme, animations, unsafeCSS(componentCss)];\n\n constructor() {\n super();\n const preferences = PreferencesProvider.loadPreferences();\n\n this.autoplay = preferences.autoplay ?? false;\n this.muted = preferences.muted ?? true;\n this.debug = preferences.debug ?? false;\n this.dataProviderHost = preferences.dataProviderHost;\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n const preferences = PreferencesProvider.loadPreferences();\n\n [..._changedProperties.keys()]\n .filter(property => ['autoplay', 'muted', 'debug', 'dataProviderHost'].includes(property))\n .forEach((property) => {\n preferences[property] = this[property];\n });\n\n PreferencesProvider.savePreferences(preferences);\n\n if (_changedProperties.has('debug')) {\n router.replaceState(this.debug ? { debug: 'true' } : {});\n }\n\n if (_changedProperties.has('dataProviderHost')) {\n ilProvider.host = this.dataProviderHost;\n }\n }\n\n #renderToggle(property, label) {\n return html`\n
\n \n {\n this[property] = e.detail.checked;\n }}\">\n \n
\n `;\n }\n\n #renderInput(property, label) {\n return html`\n
\n \n {\n this[property] = e.target.value === '' ? undefined : e.target.value;\n }}\">\n
\n `;\n }\n\n render() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n

Player Settings

\n ${this.#renderToggle('autoplay', 'Autoplay')}\n ${this.#renderToggle('muted', 'Player starts muted')}\n ${this.#renderToggle('debug', 'Enable debug mode')}\n ${this.#renderInput('dataProviderHost', 'Data provider host')}\n
\n `;\n }\n}\n\ncustomElements.define('settings-page', SettingsPage);\nrouter.addRoute('settings', 'settings-page');\n","/* eslint-disable no-multi-assign */\n\nfunction deepFreeze(obj) {\n if (obj instanceof Map) {\n obj.clear =\n obj.delete =\n obj.set =\n function () {\n throw new Error('map is read-only');\n };\n } else if (obj instanceof Set) {\n obj.add =\n obj.clear =\n obj.delete =\n function () {\n throw new Error('set is read-only');\n };\n }\n\n // Freeze self\n Object.freeze(obj);\n\n Object.getOwnPropertyNames(obj).forEach((name) => {\n const prop = obj[name];\n const type = typeof prop;\n\n // Freeze prop if it is an object or function and also not already frozen\n if ((type === 'object' || type === 'function') && !Object.isFrozen(prop)) {\n deepFreeze(prop);\n }\n });\n\n return obj;\n}\n\n/** @typedef {import('highlight.js').CallbackResponse} CallbackResponse */\n/** @typedef {import('highlight.js').CompiledMode} CompiledMode */\n/** @implements CallbackResponse */\n\nclass Response {\n /**\n * @param {CompiledMode} mode\n */\n constructor(mode) {\n // eslint-disable-next-line no-undefined\n if (mode.data === undefined) mode.data = {};\n\n this.data = mode.data;\n this.isMatchIgnored = false;\n }\n\n ignoreMatch() {\n this.isMatchIgnored = true;\n }\n}\n\n/**\n * @param {string} value\n * @returns {string}\n */\nfunction escapeHTML(value) {\n return value\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\n/**\n * performs a shallow merge of multiple objects into one\n *\n * @template T\n * @param {T} original\n * @param {Record[]} objects\n * @returns {T} a single new object\n */\nfunction inherit$1(original, ...objects) {\n /** @type Record */\n const result = Object.create(null);\n\n for (const key in original) {\n result[key] = original[key];\n }\n objects.forEach(function(obj) {\n for (const key in obj) {\n result[key] = obj[key];\n }\n });\n return /** @type {T} */ (result);\n}\n\n/**\n * @typedef {object} Renderer\n * @property {(text: string) => void} addText\n * @property {(node: Node) => void} openNode\n * @property {(node: Node) => void} closeNode\n * @property {() => string} value\n */\n\n/** @typedef {{scope?: string, language?: string, sublanguage?: boolean}} Node */\n/** @typedef {{walk: (r: Renderer) => void}} Tree */\n/** */\n\nconst SPAN_CLOSE = '';\n\n/**\n * Determines if a node needs to be wrapped in \n *\n * @param {Node} node */\nconst emitsWrappingTags = (node) => {\n // rarely we can have a sublanguage where language is undefined\n // TODO: track down why\n return !!node.scope;\n};\n\n/**\n *\n * @param {string} name\n * @param {{prefix:string}} options\n */\nconst scopeToCSSClass = (name, { prefix }) => {\n // sub-language\n if (name.startsWith(\"language:\")) {\n return name.replace(\"language:\", \"language-\");\n }\n // tiered scope: comment.line\n if (name.includes(\".\")) {\n const pieces = name.split(\".\");\n return [\n `${prefix}${pieces.shift()}`,\n ...(pieces.map((x, i) => `${x}${\"_\".repeat(i + 1)}`))\n ].join(\" \");\n }\n // simple scope\n return `${prefix}${name}`;\n};\n\n/** @type {Renderer} */\nclass HTMLRenderer {\n /**\n * Creates a new HTMLRenderer\n *\n * @param {Tree} parseTree - the parse tree (must support `walk` API)\n * @param {{classPrefix: string}} options\n */\n constructor(parseTree, options) {\n this.buffer = \"\";\n this.classPrefix = options.classPrefix;\n parseTree.walk(this);\n }\n\n /**\n * Adds texts to the output stream\n *\n * @param {string} text */\n addText(text) {\n this.buffer += escapeHTML(text);\n }\n\n /**\n * Adds a node open to the output stream (if needed)\n *\n * @param {Node} node */\n openNode(node) {\n if (!emitsWrappingTags(node)) return;\n\n const className = scopeToCSSClass(node.scope,\n { prefix: this.classPrefix });\n this.span(className);\n }\n\n /**\n * Adds a node close to the output stream (if needed)\n *\n * @param {Node} node */\n closeNode(node) {\n if (!emitsWrappingTags(node)) return;\n\n this.buffer += SPAN_CLOSE;\n }\n\n /**\n * returns the accumulated buffer\n */\n value() {\n return this.buffer;\n }\n\n // helpers\n\n /**\n * Builds a span element\n *\n * @param {string} className */\n span(className) {\n this.buffer += ``;\n }\n}\n\n/** @typedef {{scope?: string, language?: string, children: Node[]} | string} Node */\n/** @typedef {{scope?: string, language?: string, children: Node[]} } DataNode */\n/** @typedef {import('highlight.js').Emitter} Emitter */\n/** */\n\n/** @returns {DataNode} */\nconst newNode = (opts = {}) => {\n /** @type DataNode */\n const result = { children: [] };\n Object.assign(result, opts);\n return result;\n};\n\nclass TokenTree {\n constructor() {\n /** @type DataNode */\n this.rootNode = newNode();\n this.stack = [this.rootNode];\n }\n\n get top() {\n return this.stack[this.stack.length - 1];\n }\n\n get root() { return this.rootNode; }\n\n /** @param {Node} node */\n add(node) {\n this.top.children.push(node);\n }\n\n /** @param {string} scope */\n openNode(scope) {\n /** @type Node */\n const node = newNode({ scope });\n this.add(node);\n this.stack.push(node);\n }\n\n closeNode() {\n if (this.stack.length > 1) {\n return this.stack.pop();\n }\n // eslint-disable-next-line no-undefined\n return undefined;\n }\n\n closeAllNodes() {\n while (this.closeNode());\n }\n\n toJSON() {\n return JSON.stringify(this.rootNode, null, 4);\n }\n\n /**\n * @typedef { import(\"./html_renderer\").Renderer } Renderer\n * @param {Renderer} builder\n */\n walk(builder) {\n // this does not\n return this.constructor._walk(builder, this.rootNode);\n // this works\n // return TokenTree._walk(builder, this.rootNode);\n }\n\n /**\n * @param {Renderer} builder\n * @param {Node} node\n */\n static _walk(builder, node) {\n if (typeof node === \"string\") {\n builder.addText(node);\n } else if (node.children) {\n builder.openNode(node);\n node.children.forEach((child) => this._walk(builder, child));\n builder.closeNode(node);\n }\n return builder;\n }\n\n /**\n * @param {Node} node\n */\n static _collapse(node) {\n if (typeof node === \"string\") return;\n if (!node.children) return;\n\n if (node.children.every(el => typeof el === \"string\")) {\n // node.text = node.children.join(\"\");\n // delete node.children;\n node.children = [node.children.join(\"\")];\n } else {\n node.children.forEach((child) => {\n TokenTree._collapse(child);\n });\n }\n }\n}\n\n/**\n Currently this is all private API, but this is the minimal API necessary\n that an Emitter must implement to fully support the parser.\n\n Minimal interface:\n\n - addText(text)\n - __addSublanguage(emitter, subLanguageName)\n - startScope(scope)\n - endScope()\n - finalize()\n - toHTML()\n\n*/\n\n/**\n * @implements {Emitter}\n */\nclass TokenTreeEmitter extends TokenTree {\n /**\n * @param {*} options\n */\n constructor(options) {\n super();\n this.options = options;\n }\n\n /**\n * @param {string} text\n */\n addText(text) {\n if (text === \"\") { return; }\n\n this.add(text);\n }\n\n /** @param {string} scope */\n startScope(scope) {\n this.openNode(scope);\n }\n\n endScope() {\n this.closeNode();\n }\n\n /**\n * @param {Emitter & {root: DataNode}} emitter\n * @param {string} name\n */\n __addSublanguage(emitter, name) {\n /** @type DataNode */\n const node = emitter.root;\n if (name) node.scope = `language:${name}`;\n\n this.add(node);\n }\n\n toHTML() {\n const renderer = new HTMLRenderer(this, this.options);\n return renderer.value();\n }\n\n finalize() {\n this.closeAllNodes();\n return true;\n }\n}\n\n/**\n * @param {string} value\n * @returns {RegExp}\n * */\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction source(re) {\n if (!re) return null;\n if (typeof re === \"string\") return re;\n\n return re.source;\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction lookahead(re) {\n return concat('(?=', re, ')');\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction anyNumberOfTimes(re) {\n return concat('(?:', re, ')*');\n}\n\n/**\n * @param {RegExp | string } re\n * @returns {string}\n */\nfunction optional(re) {\n return concat('(?:', re, ')?');\n}\n\n/**\n * @param {...(RegExp | string) } args\n * @returns {string}\n */\nfunction concat(...args) {\n const joined = args.map((x) => source(x)).join(\"\");\n return joined;\n}\n\n/**\n * @param { Array } args\n * @returns {object}\n */\nfunction stripOptionsFromArgs(args) {\n const opts = args[args.length - 1];\n\n if (typeof opts === 'object' && opts.constructor === Object) {\n args.splice(args.length - 1, 1);\n return opts;\n } else {\n return {};\n }\n}\n\n/** @typedef { {capture?: boolean} } RegexEitherOptions */\n\n/**\n * Any of the passed expresssions may match\n *\n * Creates a huge this | this | that | that match\n * @param {(RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]} args\n * @returns {string}\n */\nfunction either(...args) {\n /** @type { object & {capture?: boolean} } */\n const opts = stripOptionsFromArgs(args);\n const joined = '('\n + (opts.capture ? \"\" : \"?:\")\n + args.map((x) => source(x)).join(\"|\") + \")\";\n return joined;\n}\n\n/**\n * @param {RegExp | string} re\n * @returns {number}\n */\nfunction countMatchGroups(re) {\n return (new RegExp(re.toString() + '|')).exec('').length - 1;\n}\n\n/**\n * Does lexeme start with a regular expression match at the beginning\n * @param {RegExp} re\n * @param {string} lexeme\n */\nfunction startsWith(re, lexeme) {\n const match = re && re.exec(lexeme);\n return match && match.index === 0;\n}\n\n// BACKREF_RE matches an open parenthesis or backreference. To avoid\n// an incorrect parse, it additionally matches the following:\n// - [...] elements, where the meaning of parentheses and escapes change\n// - other escape sequences, so we do not misparse escape sequences as\n// interesting elements\n// - non-matching or lookahead parentheses, which do not capture. These\n// follow the '(' with a '?'.\nconst BACKREF_RE = /\\[(?:[^\\\\\\]]|\\\\.)*\\]|\\(\\??|\\\\([1-9][0-9]*)|\\\\./;\n\n// **INTERNAL** Not intended for outside usage\n// join logically computes regexps.join(separator), but fixes the\n// backreferences so they continue to match.\n// it also places each individual regular expression into it's own\n// match group, keeping track of the sequencing of those match groups\n// is currently an exercise for the caller. :-)\n/**\n * @param {(string | RegExp)[]} regexps\n * @param {{joinWith: string}} opts\n * @returns {string}\n */\nfunction _rewriteBackreferences(regexps, { joinWith }) {\n let numCaptures = 0;\n\n return regexps.map((regex) => {\n numCaptures += 1;\n const offset = numCaptures;\n let re = source(regex);\n let out = '';\n\n while (re.length > 0) {\n const match = BACKREF_RE.exec(re);\n if (!match) {\n out += re;\n break;\n }\n out += re.substring(0, match.index);\n re = re.substring(match.index + match[0].length);\n if (match[0][0] === '\\\\' && match[1]) {\n // Adjust the backreference.\n out += '\\\\' + String(Number(match[1]) + offset);\n } else {\n out += match[0];\n if (match[0] === '(') {\n numCaptures++;\n }\n }\n }\n return out;\n }).map(re => `(${re})`).join(joinWith);\n}\n\n/** @typedef {import('highlight.js').Mode} Mode */\n/** @typedef {import('highlight.js').ModeCallback} ModeCallback */\n\n// Common regexps\nconst MATCH_NOTHING_RE = /\\b\\B/;\nconst IDENT_RE = '[a-zA-Z]\\\\w*';\nconst UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\\\w*';\nconst NUMBER_RE = '\\\\b\\\\d+(\\\\.\\\\d+)?';\nconst C_NUMBER_RE = '(-?)(\\\\b0[xX][a-fA-F0-9]+|(\\\\b\\\\d+(\\\\.\\\\d*)?|\\\\.\\\\d+)([eE][-+]?\\\\d+)?)'; // 0x..., 0..., decimal, float\nconst BINARY_NUMBER_RE = '\\\\b(0b[01]+)'; // 0b...\nconst RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\\\*|\\\\*=|\\\\+|\\\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\\\?|\\\\[|\\\\{|\\\\(|\\\\^|\\\\^=|\\\\||\\\\|=|\\\\|\\\\||~';\n\n/**\n* @param { Partial & {binary?: string | RegExp} } opts\n*/\nconst SHEBANG = (opts = {}) => {\n const beginShebang = /^#![ ]*\\//;\n if (opts.binary) {\n opts.begin = concat(\n beginShebang,\n /.*\\b/,\n opts.binary,\n /\\b.*/);\n }\n return inherit$1({\n scope: 'meta',\n begin: beginShebang,\n end: /$/,\n relevance: 0,\n /** @type {ModeCallback} */\n \"on:begin\": (m, resp) => {\n if (m.index !== 0) resp.ignoreMatch();\n }\n }, opts);\n};\n\n// Common modes\nconst BACKSLASH_ESCAPE = {\n begin: '\\\\\\\\[\\\\s\\\\S]', relevance: 0\n};\nconst APOS_STRING_MODE = {\n scope: 'string',\n begin: '\\'',\n end: '\\'',\n illegal: '\\\\n',\n contains: [BACKSLASH_ESCAPE]\n};\nconst QUOTE_STRING_MODE = {\n scope: 'string',\n begin: '\"',\n end: '\"',\n illegal: '\\\\n',\n contains: [BACKSLASH_ESCAPE]\n};\nconst PHRASAL_WORDS_MODE = {\n begin: /\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b/\n};\n/**\n * Creates a comment mode\n *\n * @param {string | RegExp} begin\n * @param {string | RegExp} end\n * @param {Mode | {}} [modeOptions]\n * @returns {Partial}\n */\nconst COMMENT = function(begin, end, modeOptions = {}) {\n const mode = inherit$1(\n {\n scope: 'comment',\n begin,\n end,\n contains: []\n },\n modeOptions\n );\n mode.contains.push({\n scope: 'doctag',\n // hack to avoid the space from being included. the space is necessary to\n // match here to prevent the plain text rule below from gobbling up doctags\n begin: '[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)',\n end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,\n excludeBegin: true,\n relevance: 0\n });\n const ENGLISH_WORD = either(\n // list of common 1 and 2 letter words in English\n \"I\",\n \"a\",\n \"is\",\n \"so\",\n \"us\",\n \"to\",\n \"at\",\n \"if\",\n \"in\",\n \"it\",\n \"on\",\n // note: this is not an exhaustive list of contractions, just popular ones\n /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, // contractions - can't we'd they're let's, etc\n /[A-Za-z]+[-][a-z]+/, // `no-way`, etc.\n /[A-Za-z][a-z]{2,}/ // allow capitalized words at beginning of sentences\n );\n // looking like plain text, more likely to be a comment\n mode.contains.push(\n {\n // TODO: how to include \", (, ) without breaking grammars that use these for\n // comment delimiters?\n // begin: /[ ]+([()\"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()\":]?([.][ ]|[ ]|\\))){3}/\n // ---\n\n // this tries to find sequences of 3 english words in a row (without any\n // \"programming\" type syntax) this gives us a strong signal that we've\n // TRULY found a comment - vs perhaps scanning with the wrong language.\n // It's possible to find something that LOOKS like the start of the\n // comment - but then if there is no readable text - good chance it is a\n // false match and not a comment.\n //\n // for a visual example please see:\n // https://github.com/highlightjs/highlight.js/issues/2827\n\n begin: concat(\n /[ ]+/, // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */\n '(',\n ENGLISH_WORD,\n /[.]?[:]?([.][ ]|[ ])/,\n '){3}') // look for 3 words in a row\n }\n );\n return mode;\n};\nconst C_LINE_COMMENT_MODE = COMMENT('//', '$');\nconst C_BLOCK_COMMENT_MODE = COMMENT('/\\\\*', '\\\\*/');\nconst HASH_COMMENT_MODE = COMMENT('#', '$');\nconst NUMBER_MODE = {\n scope: 'number',\n begin: NUMBER_RE,\n relevance: 0\n};\nconst C_NUMBER_MODE = {\n scope: 'number',\n begin: C_NUMBER_RE,\n relevance: 0\n};\nconst BINARY_NUMBER_MODE = {\n scope: 'number',\n begin: BINARY_NUMBER_RE,\n relevance: 0\n};\nconst REGEXP_MODE = {\n scope: \"regexp\",\n begin: /\\/(?=[^/\\n]*\\/)/,\n end: /\\/[gimuy]*/,\n contains: [\n BACKSLASH_ESCAPE,\n {\n begin: /\\[/,\n end: /\\]/,\n relevance: 0,\n contains: [BACKSLASH_ESCAPE]\n }\n ]\n};\nconst TITLE_MODE = {\n scope: 'title',\n begin: IDENT_RE,\n relevance: 0\n};\nconst UNDERSCORE_TITLE_MODE = {\n scope: 'title',\n begin: UNDERSCORE_IDENT_RE,\n relevance: 0\n};\nconst METHOD_GUARD = {\n // excludes method names from keyword processing\n begin: '\\\\.\\\\s*' + UNDERSCORE_IDENT_RE,\n relevance: 0\n};\n\n/**\n * Adds end same as begin mechanics to a mode\n *\n * Your mode must include at least a single () match group as that first match\n * group is what is used for comparison\n * @param {Partial} mode\n */\nconst END_SAME_AS_BEGIN = function(mode) {\n return Object.assign(mode,\n {\n /** @type {ModeCallback} */\n 'on:begin': (m, resp) => { resp.data._beginMatch = m[1]; },\n /** @type {ModeCallback} */\n 'on:end': (m, resp) => { if (resp.data._beginMatch !== m[1]) resp.ignoreMatch(); }\n });\n};\n\nvar MODES = /*#__PURE__*/Object.freeze({\n __proto__: null,\n APOS_STRING_MODE: APOS_STRING_MODE,\n BACKSLASH_ESCAPE: BACKSLASH_ESCAPE,\n BINARY_NUMBER_MODE: BINARY_NUMBER_MODE,\n BINARY_NUMBER_RE: BINARY_NUMBER_RE,\n COMMENT: COMMENT,\n C_BLOCK_COMMENT_MODE: C_BLOCK_COMMENT_MODE,\n C_LINE_COMMENT_MODE: C_LINE_COMMENT_MODE,\n C_NUMBER_MODE: C_NUMBER_MODE,\n C_NUMBER_RE: C_NUMBER_RE,\n END_SAME_AS_BEGIN: END_SAME_AS_BEGIN,\n HASH_COMMENT_MODE: HASH_COMMENT_MODE,\n IDENT_RE: IDENT_RE,\n MATCH_NOTHING_RE: MATCH_NOTHING_RE,\n METHOD_GUARD: METHOD_GUARD,\n NUMBER_MODE: NUMBER_MODE,\n NUMBER_RE: NUMBER_RE,\n PHRASAL_WORDS_MODE: PHRASAL_WORDS_MODE,\n QUOTE_STRING_MODE: QUOTE_STRING_MODE,\n REGEXP_MODE: REGEXP_MODE,\n RE_STARTERS_RE: RE_STARTERS_RE,\n SHEBANG: SHEBANG,\n TITLE_MODE: TITLE_MODE,\n UNDERSCORE_IDENT_RE: UNDERSCORE_IDENT_RE,\n UNDERSCORE_TITLE_MODE: UNDERSCORE_TITLE_MODE\n});\n\n/**\n@typedef {import('highlight.js').CallbackResponse} CallbackResponse\n@typedef {import('highlight.js').CompilerExt} CompilerExt\n*/\n\n// Grammar extensions / plugins\n// See: https://github.com/highlightjs/highlight.js/issues/2833\n\n// Grammar extensions allow \"syntactic sugar\" to be added to the grammar modes\n// without requiring any underlying changes to the compiler internals.\n\n// `compileMatch` being the perfect small example of now allowing a grammar\n// author to write `match` when they desire to match a single expression rather\n// than being forced to use `begin`. The extension then just moves `match` into\n// `begin` when it runs. Ie, no features have been added, but we've just made\n// the experience of writing (and reading grammars) a little bit nicer.\n\n// ------\n\n// TODO: We need negative look-behind support to do this properly\n/**\n * Skip a match if it has a preceding dot\n *\n * This is used for `beginKeywords` to prevent matching expressions such as\n * `bob.keyword.do()`. The mode compiler automatically wires this up as a\n * special _internal_ 'on:begin' callback for modes with `beginKeywords`\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\nfunction skipIfHasPrecedingDot(match, response) {\n const before = match.input[match.index - 1];\n if (before === \".\") {\n response.ignoreMatch();\n }\n}\n\n/**\n *\n * @type {CompilerExt}\n */\nfunction scopeClassName(mode, _parent) {\n // eslint-disable-next-line no-undefined\n if (mode.className !== undefined) {\n mode.scope = mode.className;\n delete mode.className;\n }\n}\n\n/**\n * `beginKeywords` syntactic sugar\n * @type {CompilerExt}\n */\nfunction beginKeywords(mode, parent) {\n if (!parent) return;\n if (!mode.beginKeywords) return;\n\n // for languages with keywords that include non-word characters checking for\n // a word boundary is not sufficient, so instead we check for a word boundary\n // or whitespace - this does no harm in any case since our keyword engine\n // doesn't allow spaces in keywords anyways and we still check for the boundary\n // first\n mode.begin = '\\\\b(' + mode.beginKeywords.split(' ').join('|') + ')(?!\\\\.)(?=\\\\b|\\\\s)';\n mode.__beforeBegin = skipIfHasPrecedingDot;\n mode.keywords = mode.keywords || mode.beginKeywords;\n delete mode.beginKeywords;\n\n // prevents double relevance, the keywords themselves provide\n // relevance, the mode doesn't need to double it\n // eslint-disable-next-line no-undefined\n if (mode.relevance === undefined) mode.relevance = 0;\n}\n\n/**\n * Allow `illegal` to contain an array of illegal values\n * @type {CompilerExt}\n */\nfunction compileIllegal(mode, _parent) {\n if (!Array.isArray(mode.illegal)) return;\n\n mode.illegal = either(...mode.illegal);\n}\n\n/**\n * `match` to match a single expression for readability\n * @type {CompilerExt}\n */\nfunction compileMatch(mode, _parent) {\n if (!mode.match) return;\n if (mode.begin || mode.end) throw new Error(\"begin & end are not supported with match\");\n\n mode.begin = mode.match;\n delete mode.match;\n}\n\n/**\n * provides the default 1 relevance to all modes\n * @type {CompilerExt}\n */\nfunction compileRelevance(mode, _parent) {\n // eslint-disable-next-line no-undefined\n if (mode.relevance === undefined) mode.relevance = 1;\n}\n\n// allow beforeMatch to act as a \"qualifier\" for the match\n// the full match begin must be [beforeMatch][begin]\nconst beforeMatchExt = (mode, parent) => {\n if (!mode.beforeMatch) return;\n // starts conflicts with endsParent which we need to make sure the child\n // rule is not matched multiple times\n if (mode.starts) throw new Error(\"beforeMatch cannot be used with starts\");\n\n const originalMode = Object.assign({}, mode);\n Object.keys(mode).forEach((key) => { delete mode[key]; });\n\n mode.keywords = originalMode.keywords;\n mode.begin = concat(originalMode.beforeMatch, lookahead(originalMode.begin));\n mode.starts = {\n relevance: 0,\n contains: [\n Object.assign(originalMode, { endsParent: true })\n ]\n };\n mode.relevance = 0;\n\n delete originalMode.beforeMatch;\n};\n\n// keywords that should have no default relevance value\nconst COMMON_KEYWORDS = [\n 'of',\n 'and',\n 'for',\n 'in',\n 'not',\n 'or',\n 'if',\n 'then',\n 'parent', // common variable name\n 'list', // common variable name\n 'value' // common variable name\n];\n\nconst DEFAULT_KEYWORD_SCOPE = \"keyword\";\n\n/**\n * Given raw keywords from a language definition, compile them.\n *\n * @param {string | Record | Array} rawKeywords\n * @param {boolean} caseInsensitive\n */\nfunction compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) {\n /** @type {import(\"highlight.js/private\").KeywordDict} */\n const compiledKeywords = Object.create(null);\n\n // input can be a string of keywords, an array of keywords, or a object with\n // named keys representing scopeName (which can then point to a string or array)\n if (typeof rawKeywords === 'string') {\n compileList(scopeName, rawKeywords.split(\" \"));\n } else if (Array.isArray(rawKeywords)) {\n compileList(scopeName, rawKeywords);\n } else {\n Object.keys(rawKeywords).forEach(function(scopeName) {\n // collapse all our objects back into the parent object\n Object.assign(\n compiledKeywords,\n compileKeywords(rawKeywords[scopeName], caseInsensitive, scopeName)\n );\n });\n }\n return compiledKeywords;\n\n // ---\n\n /**\n * Compiles an individual list of keywords\n *\n * Ex: \"for if when while|5\"\n *\n * @param {string} scopeName\n * @param {Array} keywordList\n */\n function compileList(scopeName, keywordList) {\n if (caseInsensitive) {\n keywordList = keywordList.map(x => x.toLowerCase());\n }\n keywordList.forEach(function(keyword) {\n const pair = keyword.split('|');\n compiledKeywords[pair[0]] = [scopeName, scoreForKeyword(pair[0], pair[1])];\n });\n }\n}\n\n/**\n * Returns the proper score for a given keyword\n *\n * Also takes into account comment keywords, which will be scored 0 UNLESS\n * another score has been manually assigned.\n * @param {string} keyword\n * @param {string} [providedScore]\n */\nfunction scoreForKeyword(keyword, providedScore) {\n // manual scores always win over common keywords\n // so you can force a score of 1 if you really insist\n if (providedScore) {\n return Number(providedScore);\n }\n\n return commonKeyword(keyword) ? 0 : 1;\n}\n\n/**\n * Determines if a given keyword is common or not\n *\n * @param {string} keyword */\nfunction commonKeyword(keyword) {\n return COMMON_KEYWORDS.includes(keyword.toLowerCase());\n}\n\n/*\n\nFor the reasoning behind this please see:\nhttps://github.com/highlightjs/highlight.js/issues/2880#issuecomment-747275419\n\n*/\n\n/**\n * @type {Record}\n */\nconst seenDeprecations = {};\n\n/**\n * @param {string} message\n */\nconst error = (message) => {\n console.error(message);\n};\n\n/**\n * @param {string} message\n * @param {any} args\n */\nconst warn = (message, ...args) => {\n console.log(`WARN: ${message}`, ...args);\n};\n\n/**\n * @param {string} version\n * @param {string} message\n */\nconst deprecated = (version, message) => {\n if (seenDeprecations[`${version}/${message}`]) return;\n\n console.log(`Deprecated as of ${version}. ${message}`);\n seenDeprecations[`${version}/${message}`] = true;\n};\n\n/* eslint-disable no-throw-literal */\n\n/**\n@typedef {import('highlight.js').CompiledMode} CompiledMode\n*/\n\nconst MultiClassError = new Error();\n\n/**\n * Renumbers labeled scope names to account for additional inner match\n * groups that otherwise would break everything.\n *\n * Lets say we 3 match scopes:\n *\n * { 1 => ..., 2 => ..., 3 => ... }\n *\n * So what we need is a clean match like this:\n *\n * (a)(b)(c) => [ \"a\", \"b\", \"c\" ]\n *\n * But this falls apart with inner match groups:\n *\n * (a)(((b)))(c) => [\"a\", \"b\", \"b\", \"b\", \"c\" ]\n *\n * Our scopes are now \"out of alignment\" and we're repeating `b` 3 times.\n * What needs to happen is the numbers are remapped:\n *\n * { 1 => ..., 2 => ..., 5 => ... }\n *\n * We also need to know that the ONLY groups that should be output\n * are 1, 2, and 5. This function handles this behavior.\n *\n * @param {CompiledMode} mode\n * @param {Array} regexes\n * @param {{key: \"beginScope\"|\"endScope\"}} opts\n */\nfunction remapScopeNames(mode, regexes, { key }) {\n let offset = 0;\n const scopeNames = mode[key];\n /** @type Record */\n const emit = {};\n /** @type Record */\n const positions = {};\n\n for (let i = 1; i <= regexes.length; i++) {\n positions[i + offset] = scopeNames[i];\n emit[i + offset] = true;\n offset += countMatchGroups(regexes[i - 1]);\n }\n // we use _emit to keep track of which match groups are \"top-level\" to avoid double\n // output from inside match groups\n mode[key] = positions;\n mode[key]._emit = emit;\n mode[key]._multi = true;\n}\n\n/**\n * @param {CompiledMode} mode\n */\nfunction beginMultiClass(mode) {\n if (!Array.isArray(mode.begin)) return;\n\n if (mode.skip || mode.excludeBegin || mode.returnBegin) {\n error(\"skip, excludeBegin, returnBegin not compatible with beginScope: {}\");\n throw MultiClassError;\n }\n\n if (typeof mode.beginScope !== \"object\" || mode.beginScope === null) {\n error(\"beginScope must be object\");\n throw MultiClassError;\n }\n\n remapScopeNames(mode, mode.begin, { key: \"beginScope\" });\n mode.begin = _rewriteBackreferences(mode.begin, { joinWith: \"\" });\n}\n\n/**\n * @param {CompiledMode} mode\n */\nfunction endMultiClass(mode) {\n if (!Array.isArray(mode.end)) return;\n\n if (mode.skip || mode.excludeEnd || mode.returnEnd) {\n error(\"skip, excludeEnd, returnEnd not compatible with endScope: {}\");\n throw MultiClassError;\n }\n\n if (typeof mode.endScope !== \"object\" || mode.endScope === null) {\n error(\"endScope must be object\");\n throw MultiClassError;\n }\n\n remapScopeNames(mode, mode.end, { key: \"endScope\" });\n mode.end = _rewriteBackreferences(mode.end, { joinWith: \"\" });\n}\n\n/**\n * this exists only to allow `scope: {}` to be used beside `match:`\n * Otherwise `beginScope` would necessary and that would look weird\n\n {\n match: [ /def/, /\\w+/ ]\n scope: { 1: \"keyword\" , 2: \"title\" }\n }\n\n * @param {CompiledMode} mode\n */\nfunction scopeSugar(mode) {\n if (mode.scope && typeof mode.scope === \"object\" && mode.scope !== null) {\n mode.beginScope = mode.scope;\n delete mode.scope;\n }\n}\n\n/**\n * @param {CompiledMode} mode\n */\nfunction MultiClass(mode) {\n scopeSugar(mode);\n\n if (typeof mode.beginScope === \"string\") {\n mode.beginScope = { _wrap: mode.beginScope };\n }\n if (typeof mode.endScope === \"string\") {\n mode.endScope = { _wrap: mode.endScope };\n }\n\n beginMultiClass(mode);\n endMultiClass(mode);\n}\n\n/**\n@typedef {import('highlight.js').Mode} Mode\n@typedef {import('highlight.js').CompiledMode} CompiledMode\n@typedef {import('highlight.js').Language} Language\n@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin\n@typedef {import('highlight.js').CompiledLanguage} CompiledLanguage\n*/\n\n// compilation\n\n/**\n * Compiles a language definition result\n *\n * Given the raw result of a language definition (Language), compiles this so\n * that it is ready for highlighting code.\n * @param {Language} language\n * @returns {CompiledLanguage}\n */\nfunction compileLanguage(language) {\n /**\n * Builds a regex with the case sensitivity of the current language\n *\n * @param {RegExp | string} value\n * @param {boolean} [global]\n */\n function langRe(value, global) {\n return new RegExp(\n source(value),\n 'm'\n + (language.case_insensitive ? 'i' : '')\n + (language.unicodeRegex ? 'u' : '')\n + (global ? 'g' : '')\n );\n }\n\n /**\n Stores multiple regular expressions and allows you to quickly search for\n them all in a string simultaneously - returning the first match. It does\n this by creating a huge (a|b|c) regex - each individual item wrapped with ()\n and joined by `|` - using match groups to track position. When a match is\n found checking which position in the array has content allows us to figure\n out which of the original regexes / match groups triggered the match.\n\n The match object itself (the result of `Regex.exec`) is returned but also\n enhanced by merging in any meta-data that was registered with the regex.\n This is how we keep track of which mode matched, and what type of rule\n (`illegal`, `begin`, end, etc).\n */\n class MultiRegex {\n constructor() {\n this.matchIndexes = {};\n // @ts-ignore\n this.regexes = [];\n this.matchAt = 1;\n this.position = 0;\n }\n\n // @ts-ignore\n addRule(re, opts) {\n opts.position = this.position++;\n // @ts-ignore\n this.matchIndexes[this.matchAt] = opts;\n this.regexes.push([opts, re]);\n this.matchAt += countMatchGroups(re) + 1;\n }\n\n compile() {\n if (this.regexes.length === 0) {\n // avoids the need to check length every time exec is called\n // @ts-ignore\n this.exec = () => null;\n }\n const terminators = this.regexes.map(el => el[1]);\n this.matcherRe = langRe(_rewriteBackreferences(terminators, { joinWith: '|' }), true);\n this.lastIndex = 0;\n }\n\n /** @param {string} s */\n exec(s) {\n this.matcherRe.lastIndex = this.lastIndex;\n const match = this.matcherRe.exec(s);\n if (!match) { return null; }\n\n // eslint-disable-next-line no-undefined\n const i = match.findIndex((el, i) => i > 0 && el !== undefined);\n // @ts-ignore\n const matchData = this.matchIndexes[i];\n // trim off any earlier non-relevant match groups (ie, the other regex\n // match groups that make up the multi-matcher)\n match.splice(0, i);\n\n return Object.assign(match, matchData);\n }\n }\n\n /*\n Created to solve the key deficiently with MultiRegex - there is no way to\n test for multiple matches at a single location. Why would we need to do\n that? In the future a more dynamic engine will allow certain matches to be\n ignored. An example: if we matched say the 3rd regex in a large group but\n decided to ignore it - we'd need to started testing again at the 4th\n regex... but MultiRegex itself gives us no real way to do that.\n\n So what this class creates MultiRegexs on the fly for whatever search\n position they are needed.\n\n NOTE: These additional MultiRegex objects are created dynamically. For most\n grammars most of the time we will never actually need anything more than the\n first MultiRegex - so this shouldn't have too much overhead.\n\n Say this is our search group, and we match regex3, but wish to ignore it.\n\n regex1 | regex2 | regex3 | regex4 | regex5 ' ie, startAt = 0\n\n What we need is a new MultiRegex that only includes the remaining\n possibilities:\n\n regex4 | regex5 ' ie, startAt = 3\n\n This class wraps all that complexity up in a simple API... `startAt` decides\n where in the array of expressions to start doing the matching. It\n auto-increments, so if a match is found at position 2, then startAt will be\n set to 3. If the end is reached startAt will return to 0.\n\n MOST of the time the parser will be setting startAt manually to 0.\n */\n class ResumableMultiRegex {\n constructor() {\n // @ts-ignore\n this.rules = [];\n // @ts-ignore\n this.multiRegexes = [];\n this.count = 0;\n\n this.lastIndex = 0;\n this.regexIndex = 0;\n }\n\n // @ts-ignore\n getMatcher(index) {\n if (this.multiRegexes[index]) return this.multiRegexes[index];\n\n const matcher = new MultiRegex();\n this.rules.slice(index).forEach(([re, opts]) => matcher.addRule(re, opts));\n matcher.compile();\n this.multiRegexes[index] = matcher;\n return matcher;\n }\n\n resumingScanAtSamePosition() {\n return this.regexIndex !== 0;\n }\n\n considerAll() {\n this.regexIndex = 0;\n }\n\n // @ts-ignore\n addRule(re, opts) {\n this.rules.push([re, opts]);\n if (opts.type === \"begin\") this.count++;\n }\n\n /** @param {string} s */\n exec(s) {\n const m = this.getMatcher(this.regexIndex);\n m.lastIndex = this.lastIndex;\n let result = m.exec(s);\n\n // The following is because we have no easy way to say \"resume scanning at the\n // existing position but also skip the current rule ONLY\". What happens is\n // all prior rules are also skipped which can result in matching the wrong\n // thing. Example of matching \"booger\":\n\n // our matcher is [string, \"booger\", number]\n //\n // ....booger....\n\n // if \"booger\" is ignored then we'd really need a regex to scan from the\n // SAME position for only: [string, number] but ignoring \"booger\" (if it\n // was the first match), a simple resume would scan ahead who knows how\n // far looking only for \"number\", ignoring potential string matches (or\n // future \"booger\" matches that might be valid.)\n\n // So what we do: We execute two matchers, one resuming at the same\n // position, but the second full matcher starting at the position after:\n\n // /--- resume first regex match here (for [number])\n // |/---- full match here for [string, \"booger\", number]\n // vv\n // ....booger....\n\n // Which ever results in a match first is then used. So this 3-4 step\n // process essentially allows us to say \"match at this position, excluding\n // a prior rule that was ignored\".\n //\n // 1. Match \"booger\" first, ignore. Also proves that [string] does non match.\n // 2. Resume matching for [number]\n // 3. Match at index + 1 for [string, \"booger\", number]\n // 4. If #2 and #3 result in matches, which came first?\n if (this.resumingScanAtSamePosition()) {\n if (result && result.index === this.lastIndex) ; else { // use the second matcher result\n const m2 = this.getMatcher(0);\n m2.lastIndex = this.lastIndex + 1;\n result = m2.exec(s);\n }\n }\n\n if (result) {\n this.regexIndex += result.position + 1;\n if (this.regexIndex === this.count) {\n // wrap-around to considering all matches again\n this.considerAll();\n }\n }\n\n return result;\n }\n }\n\n /**\n * Given a mode, builds a huge ResumableMultiRegex that can be used to walk\n * the content and find matches.\n *\n * @param {CompiledMode} mode\n * @returns {ResumableMultiRegex}\n */\n function buildModeRegex(mode) {\n const mm = new ResumableMultiRegex();\n\n mode.contains.forEach(term => mm.addRule(term.begin, { rule: term, type: \"begin\" }));\n\n if (mode.terminatorEnd) {\n mm.addRule(mode.terminatorEnd, { type: \"end\" });\n }\n if (mode.illegal) {\n mm.addRule(mode.illegal, { type: \"illegal\" });\n }\n\n return mm;\n }\n\n /** skip vs abort vs ignore\n *\n * @skip - The mode is still entered and exited normally (and contains rules apply),\n * but all content is held and added to the parent buffer rather than being\n * output when the mode ends. Mostly used with `sublanguage` to build up\n * a single large buffer than can be parsed by sublanguage.\n *\n * - The mode begin ands ends normally.\n * - Content matched is added to the parent mode buffer.\n * - The parser cursor is moved forward normally.\n *\n * @abort - A hack placeholder until we have ignore. Aborts the mode (as if it\n * never matched) but DOES NOT continue to match subsequent `contains`\n * modes. Abort is bad/suboptimal because it can result in modes\n * farther down not getting applied because an earlier rule eats the\n * content but then aborts.\n *\n * - The mode does not begin.\n * - Content matched by `begin` is added to the mode buffer.\n * - The parser cursor is moved forward accordingly.\n *\n * @ignore - Ignores the mode (as if it never matched) and continues to match any\n * subsequent `contains` modes. Ignore isn't technically possible with\n * the current parser implementation.\n *\n * - The mode does not begin.\n * - Content matched by `begin` is ignored.\n * - The parser cursor is not moved forward.\n */\n\n /**\n * Compiles an individual mode\n *\n * This can raise an error if the mode contains certain detectable known logic\n * issues.\n * @param {Mode} mode\n * @param {CompiledMode | null} [parent]\n * @returns {CompiledMode | never}\n */\n function compileMode(mode, parent) {\n const cmode = /** @type CompiledMode */ (mode);\n if (mode.isCompiled) return cmode;\n\n [\n scopeClassName,\n // do this early so compiler extensions generally don't have to worry about\n // the distinction between match/begin\n compileMatch,\n MultiClass,\n beforeMatchExt\n ].forEach(ext => ext(mode, parent));\n\n language.compilerExtensions.forEach(ext => ext(mode, parent));\n\n // __beforeBegin is considered private API, internal use only\n mode.__beforeBegin = null;\n\n [\n beginKeywords,\n // do this later so compiler extensions that come earlier have access to the\n // raw array if they wanted to perhaps manipulate it, etc.\n compileIllegal,\n // default to 1 relevance if not specified\n compileRelevance\n ].forEach(ext => ext(mode, parent));\n\n mode.isCompiled = true;\n\n let keywordPattern = null;\n if (typeof mode.keywords === \"object\" && mode.keywords.$pattern) {\n // we need a copy because keywords might be compiled multiple times\n // so we can't go deleting $pattern from the original on the first\n // pass\n mode.keywords = Object.assign({}, mode.keywords);\n keywordPattern = mode.keywords.$pattern;\n delete mode.keywords.$pattern;\n }\n keywordPattern = keywordPattern || /\\w+/;\n\n if (mode.keywords) {\n mode.keywords = compileKeywords(mode.keywords, language.case_insensitive);\n }\n\n cmode.keywordPatternRe = langRe(keywordPattern, true);\n\n if (parent) {\n if (!mode.begin) mode.begin = /\\B|\\b/;\n cmode.beginRe = langRe(cmode.begin);\n if (!mode.end && !mode.endsWithParent) mode.end = /\\B|\\b/;\n if (mode.end) cmode.endRe = langRe(cmode.end);\n cmode.terminatorEnd = source(cmode.end) || '';\n if (mode.endsWithParent && parent.terminatorEnd) {\n cmode.terminatorEnd += (mode.end ? '|' : '') + parent.terminatorEnd;\n }\n }\n if (mode.illegal) cmode.illegalRe = langRe(/** @type {RegExp | string} */ (mode.illegal));\n if (!mode.contains) mode.contains = [];\n\n mode.contains = [].concat(...mode.contains.map(function(c) {\n return expandOrCloneMode(c === 'self' ? mode : c);\n }));\n mode.contains.forEach(function(c) { compileMode(/** @type Mode */ (c), cmode); });\n\n if (mode.starts) {\n compileMode(mode.starts, parent);\n }\n\n cmode.matcher = buildModeRegex(cmode);\n return cmode;\n }\n\n if (!language.compilerExtensions) language.compilerExtensions = [];\n\n // self is not valid at the top-level\n if (language.contains && language.contains.includes('self')) {\n throw new Error(\"ERR: contains `self` is not supported at the top-level of a language. See documentation.\");\n }\n\n // we need a null object, which inherit will guarantee\n language.classNameAliases = inherit$1(language.classNameAliases || {});\n\n return compileMode(/** @type Mode */ (language));\n}\n\n/**\n * Determines if a mode has a dependency on it's parent or not\n *\n * If a mode does have a parent dependency then often we need to clone it if\n * it's used in multiple places so that each copy points to the correct parent,\n * where-as modes without a parent can often safely be re-used at the bottom of\n * a mode chain.\n *\n * @param {Mode | null} mode\n * @returns {boolean} - is there a dependency on the parent?\n * */\nfunction dependencyOnParent(mode) {\n if (!mode) return false;\n\n return mode.endsWithParent || dependencyOnParent(mode.starts);\n}\n\n/**\n * Expands a mode or clones it if necessary\n *\n * This is necessary for modes with parental dependenceis (see notes on\n * `dependencyOnParent`) and for nodes that have `variants` - which must then be\n * exploded into their own individual modes at compile time.\n *\n * @param {Mode} mode\n * @returns {Mode | Mode[]}\n * */\nfunction expandOrCloneMode(mode) {\n if (mode.variants && !mode.cachedVariants) {\n mode.cachedVariants = mode.variants.map(function(variant) {\n return inherit$1(mode, { variants: null }, variant);\n });\n }\n\n // EXPAND\n // if we have variants then essentially \"replace\" the mode with the variants\n // this happens in compileMode, where this function is called from\n if (mode.cachedVariants) {\n return mode.cachedVariants;\n }\n\n // CLONE\n // if we have dependencies on parents then we need a unique\n // instance of ourselves, so we can be reused with many\n // different parents without issue\n if (dependencyOnParent(mode)) {\n return inherit$1(mode, { starts: mode.starts ? inherit$1(mode.starts) : null });\n }\n\n if (Object.isFrozen(mode)) {\n return inherit$1(mode);\n }\n\n // no special dependency issues, just return ourselves\n return mode;\n}\n\nvar version = \"11.10.0\";\n\nclass HTMLInjectionError extends Error {\n constructor(reason, html) {\n super(reason);\n this.name = \"HTMLInjectionError\";\n this.html = html;\n }\n}\n\n/*\nSyntax highlighting with language autodetection.\nhttps://highlightjs.org/\n*/\n\n\n\n/**\n@typedef {import('highlight.js').Mode} Mode\n@typedef {import('highlight.js').CompiledMode} CompiledMode\n@typedef {import('highlight.js').CompiledScope} CompiledScope\n@typedef {import('highlight.js').Language} Language\n@typedef {import('highlight.js').HLJSApi} HLJSApi\n@typedef {import('highlight.js').HLJSPlugin} HLJSPlugin\n@typedef {import('highlight.js').PluginEvent} PluginEvent\n@typedef {import('highlight.js').HLJSOptions} HLJSOptions\n@typedef {import('highlight.js').LanguageFn} LanguageFn\n@typedef {import('highlight.js').HighlightedHTMLElement} HighlightedHTMLElement\n@typedef {import('highlight.js').BeforeHighlightContext} BeforeHighlightContext\n@typedef {import('highlight.js/private').MatchType} MatchType\n@typedef {import('highlight.js/private').KeywordData} KeywordData\n@typedef {import('highlight.js/private').EnhancedMatch} EnhancedMatch\n@typedef {import('highlight.js/private').AnnotatedError} AnnotatedError\n@typedef {import('highlight.js').AutoHighlightResult} AutoHighlightResult\n@typedef {import('highlight.js').HighlightOptions} HighlightOptions\n@typedef {import('highlight.js').HighlightResult} HighlightResult\n*/\n\n\nconst escape = escapeHTML;\nconst inherit = inherit$1;\nconst NO_MATCH = Symbol(\"nomatch\");\nconst MAX_KEYWORD_HITS = 7;\n\n/**\n * @param {any} hljs - object that is extended (legacy)\n * @returns {HLJSApi}\n */\nconst HLJS = function(hljs) {\n // Global internal variables used within the highlight.js library.\n /** @type {Record} */\n const languages = Object.create(null);\n /** @type {Record} */\n const aliases = Object.create(null);\n /** @type {HLJSPlugin[]} */\n const plugins = [];\n\n // safe/production mode - swallows more errors, tries to keep running\n // even if a single syntax or parse hits a fatal error\n let SAFE_MODE = true;\n const LANGUAGE_NOT_FOUND = \"Could not find the language '{}', did you forget to load/include a language module?\";\n /** @type {Language} */\n const PLAINTEXT_LANGUAGE = { disableAutodetect: true, name: 'Plain text', contains: [] };\n\n // Global options used when within external APIs. This is modified when\n // calling the `hljs.configure` function.\n /** @type HLJSOptions */\n let options = {\n ignoreUnescapedHTML: false,\n throwUnescapedHTML: false,\n noHighlightRe: /^(no-?highlight)$/i,\n languageDetectRe: /\\blang(?:uage)?-([\\w-]+)\\b/i,\n classPrefix: 'hljs-',\n cssSelector: 'pre code',\n languages: null,\n // beta configuration options, subject to change, welcome to discuss\n // https://github.com/highlightjs/highlight.js/issues/1086\n __emitter: TokenTreeEmitter\n };\n\n /* Utility functions */\n\n /**\n * Tests a language name to see if highlighting should be skipped\n * @param {string} languageName\n */\n function shouldNotHighlight(languageName) {\n return options.noHighlightRe.test(languageName);\n }\n\n /**\n * @param {HighlightedHTMLElement} block - the HTML element to determine language for\n */\n function blockLanguage(block) {\n let classes = block.className + ' ';\n\n classes += block.parentNode ? block.parentNode.className : '';\n\n // language-* takes precedence over non-prefixed class names.\n const match = options.languageDetectRe.exec(classes);\n if (match) {\n const language = getLanguage(match[1]);\n if (!language) {\n warn(LANGUAGE_NOT_FOUND.replace(\"{}\", match[1]));\n warn(\"Falling back to no-highlight mode for this block.\", block);\n }\n return language ? match[1] : 'no-highlight';\n }\n\n return classes\n .split(/\\s+/)\n .find((_class) => shouldNotHighlight(_class) || getLanguage(_class));\n }\n\n /**\n * Core highlighting function.\n *\n * OLD API\n * highlight(lang, code, ignoreIllegals, continuation)\n *\n * NEW API\n * highlight(code, {lang, ignoreIllegals})\n *\n * @param {string} codeOrLanguageName - the language to use for highlighting\n * @param {string | HighlightOptions} optionsOrCode - the code to highlight\n * @param {boolean} [ignoreIllegals] - whether to ignore illegal matches, default is to bail\n *\n * @returns {HighlightResult} Result - an object that represents the result\n * @property {string} language - the language name\n * @property {number} relevance - the relevance score\n * @property {string} value - the highlighted HTML code\n * @property {string} code - the original raw code\n * @property {CompiledMode} top - top of the current mode stack\n * @property {boolean} illegal - indicates whether any illegal matches were found\n */\n function highlight(codeOrLanguageName, optionsOrCode, ignoreIllegals) {\n let code = \"\";\n let languageName = \"\";\n if (typeof optionsOrCode === \"object\") {\n code = codeOrLanguageName;\n ignoreIllegals = optionsOrCode.ignoreIllegals;\n languageName = optionsOrCode.language;\n } else {\n // old API\n deprecated(\"10.7.0\", \"highlight(lang, code, ...args) has been deprecated.\");\n deprecated(\"10.7.0\", \"Please use highlight(code, options) instead.\\nhttps://github.com/highlightjs/highlight.js/issues/2277\");\n languageName = codeOrLanguageName;\n code = optionsOrCode;\n }\n\n // https://github.com/highlightjs/highlight.js/issues/3149\n // eslint-disable-next-line no-undefined\n if (ignoreIllegals === undefined) { ignoreIllegals = true; }\n\n /** @type {BeforeHighlightContext} */\n const context = {\n code,\n language: languageName\n };\n // the plugin can change the desired language or the code to be highlighted\n // just be changing the object it was passed\n fire(\"before:highlight\", context);\n\n // a before plugin can usurp the result completely by providing it's own\n // in which case we don't even need to call highlight\n const result = context.result\n ? context.result\n : _highlight(context.language, context.code, ignoreIllegals);\n\n result.code = context.code;\n // the plugin can change anything in result to suite it\n fire(\"after:highlight\", result);\n\n return result;\n }\n\n /**\n * private highlight that's used internally and does not fire callbacks\n *\n * @param {string} languageName - the language to use for highlighting\n * @param {string} codeToHighlight - the code to highlight\n * @param {boolean?} [ignoreIllegals] - whether to ignore illegal matches, default is to bail\n * @param {CompiledMode?} [continuation] - current continuation mode, if any\n * @returns {HighlightResult} - result of the highlight operation\n */\n function _highlight(languageName, codeToHighlight, ignoreIllegals, continuation) {\n const keywordHits = Object.create(null);\n\n /**\n * Return keyword data if a match is a keyword\n * @param {CompiledMode} mode - current mode\n * @param {string} matchText - the textual match\n * @returns {KeywordData | false}\n */\n function keywordData(mode, matchText) {\n return mode.keywords[matchText];\n }\n\n function processKeywords() {\n if (!top.keywords) {\n emitter.addText(modeBuffer);\n return;\n }\n\n let lastIndex = 0;\n top.keywordPatternRe.lastIndex = 0;\n let match = top.keywordPatternRe.exec(modeBuffer);\n let buf = \"\";\n\n while (match) {\n buf += modeBuffer.substring(lastIndex, match.index);\n const word = language.case_insensitive ? match[0].toLowerCase() : match[0];\n const data = keywordData(top, word);\n if (data) {\n const [kind, keywordRelevance] = data;\n emitter.addText(buf);\n buf = \"\";\n\n keywordHits[word] = (keywordHits[word] || 0) + 1;\n if (keywordHits[word] <= MAX_KEYWORD_HITS) relevance += keywordRelevance;\n if (kind.startsWith(\"_\")) {\n // _ implied for relevance only, do not highlight\n // by applying a class name\n buf += match[0];\n } else {\n const cssClass = language.classNameAliases[kind] || kind;\n emitKeyword(match[0], cssClass);\n }\n } else {\n buf += match[0];\n }\n lastIndex = top.keywordPatternRe.lastIndex;\n match = top.keywordPatternRe.exec(modeBuffer);\n }\n buf += modeBuffer.substring(lastIndex);\n emitter.addText(buf);\n }\n\n function processSubLanguage() {\n if (modeBuffer === \"\") return;\n /** @type HighlightResult */\n let result = null;\n\n if (typeof top.subLanguage === 'string') {\n if (!languages[top.subLanguage]) {\n emitter.addText(modeBuffer);\n return;\n }\n result = _highlight(top.subLanguage, modeBuffer, true, continuations[top.subLanguage]);\n continuations[top.subLanguage] = /** @type {CompiledMode} */ (result._top);\n } else {\n result = highlightAuto(modeBuffer, top.subLanguage.length ? top.subLanguage : null);\n }\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n emitter.__addSublanguage(result._emitter, result.language);\n }\n\n function processBuffer() {\n if (top.subLanguage != null) {\n processSubLanguage();\n } else {\n processKeywords();\n }\n modeBuffer = '';\n }\n\n /**\n * @param {string} text\n * @param {string} scope\n */\n function emitKeyword(keyword, scope) {\n if (keyword === \"\") return;\n\n emitter.startScope(scope);\n emitter.addText(keyword);\n emitter.endScope();\n }\n\n /**\n * @param {CompiledScope} scope\n * @param {RegExpMatchArray} match\n */\n function emitMultiClass(scope, match) {\n let i = 1;\n const max = match.length - 1;\n while (i <= max) {\n if (!scope._emit[i]) { i++; continue; }\n const klass = language.classNameAliases[scope[i]] || scope[i];\n const text = match[i];\n if (klass) {\n emitKeyword(text, klass);\n } else {\n modeBuffer = text;\n processKeywords();\n modeBuffer = \"\";\n }\n i++;\n }\n }\n\n /**\n * @param {CompiledMode} mode - new mode to start\n * @param {RegExpMatchArray} match\n */\n function startNewMode(mode, match) {\n if (mode.scope && typeof mode.scope === \"string\") {\n emitter.openNode(language.classNameAliases[mode.scope] || mode.scope);\n }\n if (mode.beginScope) {\n // beginScope just wraps the begin match itself in a scope\n if (mode.beginScope._wrap) {\n emitKeyword(modeBuffer, language.classNameAliases[mode.beginScope._wrap] || mode.beginScope._wrap);\n modeBuffer = \"\";\n } else if (mode.beginScope._multi) {\n // at this point modeBuffer should just be the match\n emitMultiClass(mode.beginScope, match);\n modeBuffer = \"\";\n }\n }\n\n top = Object.create(mode, { parent: { value: top } });\n return top;\n }\n\n /**\n * @param {CompiledMode } mode - the mode to potentially end\n * @param {RegExpMatchArray} match - the latest match\n * @param {string} matchPlusRemainder - match plus remainder of content\n * @returns {CompiledMode | void} - the next mode, or if void continue on in current mode\n */\n function endOfMode(mode, match, matchPlusRemainder) {\n let matched = startsWith(mode.endRe, matchPlusRemainder);\n\n if (matched) {\n if (mode[\"on:end\"]) {\n const resp = new Response(mode);\n mode[\"on:end\"](match, resp);\n if (resp.isMatchIgnored) matched = false;\n }\n\n if (matched) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n }\n // even if on:end fires an `ignore` it's still possible\n // that we might trigger the end node because of a parent mode\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, match, matchPlusRemainder);\n }\n }\n\n /**\n * Handle matching but then ignoring a sequence of text\n *\n * @param {string} lexeme - string containing full match text\n */\n function doIgnore(lexeme) {\n if (top.matcher.regexIndex === 0) {\n // no more regexes to potentially match here, so we move the cursor forward one\n // space\n modeBuffer += lexeme[0];\n return 1;\n } else {\n // no need to move the cursor, we still have additional regexes to try and\n // match at this very spot\n resumeScanAtSamePosition = true;\n return 0;\n }\n }\n\n /**\n * Handle the start of a new potential mode match\n *\n * @param {EnhancedMatch} match - the current match\n * @returns {number} how far to advance the parse cursor\n */\n function doBeginMatch(match) {\n const lexeme = match[0];\n const newMode = match.rule;\n\n const resp = new Response(newMode);\n // first internal before callbacks, then the public ones\n const beforeCallbacks = [newMode.__beforeBegin, newMode[\"on:begin\"]];\n for (const cb of beforeCallbacks) {\n if (!cb) continue;\n cb(match, resp);\n if (resp.isMatchIgnored) return doIgnore(lexeme);\n }\n\n if (newMode.skip) {\n modeBuffer += lexeme;\n } else {\n if (newMode.excludeBegin) {\n modeBuffer += lexeme;\n }\n processBuffer();\n if (!newMode.returnBegin && !newMode.excludeBegin) {\n modeBuffer = lexeme;\n }\n }\n startNewMode(newMode, match);\n return newMode.returnBegin ? 0 : lexeme.length;\n }\n\n /**\n * Handle the potential end of mode\n *\n * @param {RegExpMatchArray} match - the current match\n */\n function doEndMatch(match) {\n const lexeme = match[0];\n const matchPlusRemainder = codeToHighlight.substring(match.index);\n\n const endMode = endOfMode(top, match, matchPlusRemainder);\n if (!endMode) { return NO_MATCH; }\n\n const origin = top;\n if (top.endScope && top.endScope._wrap) {\n processBuffer();\n emitKeyword(lexeme, top.endScope._wrap);\n } else if (top.endScope && top.endScope._multi) {\n processBuffer();\n emitMultiClass(top.endScope, match);\n } else if (origin.skip) {\n modeBuffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n modeBuffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n modeBuffer = lexeme;\n }\n }\n do {\n if (top.scope) {\n emitter.closeNode();\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== endMode.parent);\n if (endMode.starts) {\n startNewMode(endMode.starts, match);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n function processContinuations() {\n const list = [];\n for (let current = top; current !== language; current = current.parent) {\n if (current.scope) {\n list.unshift(current.scope);\n }\n }\n list.forEach(item => emitter.openNode(item));\n }\n\n /** @type {{type?: MatchType, index?: number, rule?: Mode}}} */\n let lastMatch = {};\n\n /**\n * Process an individual match\n *\n * @param {string} textBeforeMatch - text preceding the match (since the last match)\n * @param {EnhancedMatch} [match] - the match itself\n */\n function processLexeme(textBeforeMatch, match) {\n const lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n modeBuffer += textBeforeMatch;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type === \"begin\" && match.type === \"end\" && lastMatch.index === match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n modeBuffer += codeToHighlight.slice(match.index, match.index + 1);\n if (!SAFE_MODE) {\n /** @type {AnnotatedError} */\n const err = new Error(`0 width match regex (${languageName})`);\n err.languageName = languageName;\n err.badRule = lastMatch.rule;\n throw err;\n }\n return 1;\n }\n lastMatch = match;\n\n if (match.type === \"begin\") {\n return doBeginMatch(match);\n } else if (match.type === \"illegal\" && !ignoreIllegals) {\n // illegal match, we do not continue processing\n /** @type {AnnotatedError} */\n const err = new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.scope || '') + '\"');\n err.mode = top;\n throw err;\n } else if (match.type === \"end\") {\n const processed = doEndMatch(match);\n if (processed !== NO_MATCH) {\n return processed;\n }\n }\n\n // edge case for when illegal matches $ (end of line) which is technically\n // a 0 width match but not a begin/end match so it's not caught by the\n // first handler (when ignoreIllegals is true)\n if (match.type === \"illegal\" && lexeme === \"\") {\n // advance so we aren't stuck in an infinite loop\n return 1;\n }\n\n // infinite loops are BAD, this is a last ditch catch all. if we have a\n // decent number of iterations yet our index (cursor position in our\n // parsing) still 3x behind our index then something is very wrong\n // so we bail\n if (iterations > 100000 && iterations > match.index * 3) {\n const err = new Error('potential infinite loop, way more iterations than matches');\n throw err;\n }\n\n /*\n Why might be find ourselves here? An potential end match that was\n triggered but could not be completed. IE, `doEndMatch` returned NO_MATCH.\n (this could be because a callback requests the match be ignored, etc)\n\n This causes no real harm other than stopping a few times too many.\n */\n\n modeBuffer += lexeme;\n return lexeme.length;\n }\n\n const language = getLanguage(languageName);\n if (!language) {\n error(LANGUAGE_NOT_FOUND.replace(\"{}\", languageName));\n throw new Error('Unknown language: \"' + languageName + '\"');\n }\n\n const md = compileLanguage(language);\n let result = '';\n /** @type {CompiledMode} */\n let top = continuation || md;\n /** @type Record */\n const continuations = {}; // keep continuations for sub-languages\n const emitter = new options.__emitter(options);\n processContinuations();\n let modeBuffer = '';\n let relevance = 0;\n let index = 0;\n let iterations = 0;\n let resumeScanAtSamePosition = false;\n\n try {\n if (!language.__emitTokens) {\n top.matcher.considerAll();\n\n for (;;) {\n iterations++;\n if (resumeScanAtSamePosition) {\n // only regexes not matched previously will now be\n // considered for a potential match\n resumeScanAtSamePosition = false;\n } else {\n top.matcher.considerAll();\n }\n top.matcher.lastIndex = index;\n\n const match = top.matcher.exec(codeToHighlight);\n // console.log(\"match\", match[0], match.rule && match.rule.begin)\n\n if (!match) break;\n\n const beforeMatch = codeToHighlight.substring(index, match.index);\n const processedCount = processLexeme(beforeMatch, match);\n index = match.index + processedCount;\n }\n processLexeme(codeToHighlight.substring(index));\n } else {\n language.__emitTokens(codeToHighlight, emitter);\n }\n\n emitter.finalize();\n result = emitter.toHTML();\n\n return {\n language: languageName,\n value: result,\n relevance,\n illegal: false,\n _emitter: emitter,\n _top: top\n };\n } catch (err) {\n if (err.message && err.message.includes('Illegal')) {\n return {\n language: languageName,\n value: escape(codeToHighlight),\n illegal: true,\n relevance: 0,\n _illegalBy: {\n message: err.message,\n index,\n context: codeToHighlight.slice(index - 100, index + 100),\n mode: err.mode,\n resultSoFar: result\n },\n _emitter: emitter\n };\n } else if (SAFE_MODE) {\n return {\n language: languageName,\n value: escape(codeToHighlight),\n illegal: false,\n relevance: 0,\n errorRaised: err,\n _emitter: emitter,\n _top: top\n };\n } else {\n throw err;\n }\n }\n }\n\n /**\n * returns a valid highlight result, without actually doing any actual work,\n * auto highlight starts with this and it's possible for small snippets that\n * auto-detection may not find a better match\n * @param {string} code\n * @returns {HighlightResult}\n */\n function justTextHighlightResult(code) {\n const result = {\n value: escape(code),\n illegal: false,\n relevance: 0,\n _top: PLAINTEXT_LANGUAGE,\n _emitter: new options.__emitter(options)\n };\n result._emitter.addText(code);\n return result;\n }\n\n /**\n Highlighting with language detection. Accepts a string with the code to\n highlight. Returns an object with the following properties:\n\n - language (detected language)\n - relevance (int)\n - value (an HTML string with highlighting markup)\n - secondBest (object with the same structure for second-best heuristically\n detected language, may be absent)\n\n @param {string} code\n @param {Array} [languageSubset]\n @returns {AutoHighlightResult}\n */\n function highlightAuto(code, languageSubset) {\n languageSubset = languageSubset || options.languages || Object.keys(languages);\n const plaintext = justTextHighlightResult(code);\n\n const results = languageSubset.filter(getLanguage).filter(autoDetection).map(name =>\n _highlight(name, code, false)\n );\n results.unshift(plaintext); // plaintext is always an option\n\n const sorted = results.sort((a, b) => {\n // sort base on relevance\n if (a.relevance !== b.relevance) return b.relevance - a.relevance;\n\n // always award the tie to the base language\n // ie if C++ and Arduino are tied, it's more likely to be C++\n if (a.language && b.language) {\n if (getLanguage(a.language).supersetOf === b.language) {\n return 1;\n } else if (getLanguage(b.language).supersetOf === a.language) {\n return -1;\n }\n }\n\n // otherwise say they are equal, which has the effect of sorting on\n // relevance while preserving the original ordering - which is how ties\n // have historically been settled, ie the language that comes first always\n // wins in the case of a tie\n return 0;\n });\n\n const [best, secondBest] = sorted;\n\n /** @type {AutoHighlightResult} */\n const result = best;\n result.secondBest = secondBest;\n\n return result;\n }\n\n /**\n * Builds new class name for block given the language name\n *\n * @param {HTMLElement} element\n * @param {string} [currentLang]\n * @param {string} [resultLang]\n */\n function updateClassName(element, currentLang, resultLang) {\n const language = (currentLang && aliases[currentLang]) || resultLang;\n\n element.classList.add(\"hljs\");\n element.classList.add(`language-${language}`);\n }\n\n /**\n * Applies highlighting to a DOM node containing code.\n *\n * @param {HighlightedHTMLElement} element - the HTML element to highlight\n */\n function highlightElement(element) {\n /** @type HTMLElement */\n let node = null;\n const language = blockLanguage(element);\n\n if (shouldNotHighlight(language)) return;\n\n fire(\"before:highlightElement\",\n { el: element, language });\n\n if (element.dataset.highlighted) {\n console.log(\"Element previously highlighted. To highlight again, first unset `dataset.highlighted`.\", element);\n return;\n }\n\n // we should be all text, no child nodes (unescaped HTML) - this is possibly\n // an HTML injection attack - it's likely too late if this is already in\n // production (the code has likely already done its damage by the time\n // we're seeing it)... but we yell loudly about this so that hopefully it's\n // more likely to be caught in development before making it to production\n if (element.children.length > 0) {\n if (!options.ignoreUnescapedHTML) {\n console.warn(\"One of your code blocks includes unescaped HTML. This is a potentially serious security risk.\");\n console.warn(\"https://github.com/highlightjs/highlight.js/wiki/security\");\n console.warn(\"The element with unescaped HTML:\");\n console.warn(element);\n }\n if (options.throwUnescapedHTML) {\n const err = new HTMLInjectionError(\n \"One of your code blocks includes unescaped HTML.\",\n element.innerHTML\n );\n throw err;\n }\n }\n\n node = element;\n const text = node.textContent;\n const result = language ? highlight(text, { language, ignoreIllegals: true }) : highlightAuto(text);\n\n element.innerHTML = result.value;\n element.dataset.highlighted = \"yes\";\n updateClassName(element, language, result.language);\n element.result = {\n language: result.language,\n // TODO: remove with version 11.0\n re: result.relevance,\n relevance: result.relevance\n };\n if (result.secondBest) {\n element.secondBest = {\n language: result.secondBest.language,\n relevance: result.secondBest.relevance\n };\n }\n\n fire(\"after:highlightElement\", { el: element, result, text });\n }\n\n /**\n * Updates highlight.js global options with the passed options\n *\n * @param {Partial} userOptions\n */\n function configure(userOptions) {\n options = inherit(options, userOptions);\n }\n\n // TODO: remove v12, deprecated\n const initHighlighting = () => {\n highlightAll();\n deprecated(\"10.6.0\", \"initHighlighting() deprecated. Use highlightAll() now.\");\n };\n\n // TODO: remove v12, deprecated\n function initHighlightingOnLoad() {\n highlightAll();\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() deprecated. Use highlightAll() now.\");\n }\n\n let wantsHighlight = false;\n\n /**\n * auto-highlights all pre>code elements on the page\n */\n function highlightAll() {\n // if we are called too early in the loading process\n if (document.readyState === \"loading\") {\n wantsHighlight = true;\n return;\n }\n\n const blocks = document.querySelectorAll(options.cssSelector);\n blocks.forEach(highlightElement);\n }\n\n function boot() {\n // if a highlight was requested before DOM was loaded, do now\n if (wantsHighlight) highlightAll();\n }\n\n // make sure we are in the browser environment\n if (typeof window !== 'undefined' && window.addEventListener) {\n window.addEventListener('DOMContentLoaded', boot, false);\n }\n\n /**\n * Register a language grammar module\n *\n * @param {string} languageName\n * @param {LanguageFn} languageDefinition\n */\n function registerLanguage(languageName, languageDefinition) {\n let lang = null;\n try {\n lang = languageDefinition(hljs);\n } catch (error$1) {\n error(\"Language definition for '{}' could not be registered.\".replace(\"{}\", languageName));\n // hard or soft error\n if (!SAFE_MODE) { throw error$1; } else { error(error$1); }\n // languages that have serious errors are replaced with essentially a\n // \"plaintext\" stand-in so that the code blocks will still get normal\n // css classes applied to them - and one bad language won't break the\n // entire highlighter\n lang = PLAINTEXT_LANGUAGE;\n }\n // give it a temporary name if it doesn't have one in the meta-data\n if (!lang.name) lang.name = languageName;\n languages[languageName] = lang;\n lang.rawDefinition = languageDefinition.bind(null, hljs);\n\n if (lang.aliases) {\n registerAliases(lang.aliases, { languageName });\n }\n }\n\n /**\n * Remove a language grammar module\n *\n * @param {string} languageName\n */\n function unregisterLanguage(languageName) {\n delete languages[languageName];\n for (const alias of Object.keys(aliases)) {\n if (aliases[alias] === languageName) {\n delete aliases[alias];\n }\n }\n }\n\n /**\n * @returns {string[]} List of language internal names\n */\n function listLanguages() {\n return Object.keys(languages);\n }\n\n /**\n * @param {string} name - name of the language to retrieve\n * @returns {Language | undefined}\n */\n function getLanguage(name) {\n name = (name || '').toLowerCase();\n return languages[name] || languages[aliases[name]];\n }\n\n /**\n *\n * @param {string|string[]} aliasList - single alias or list of aliases\n * @param {{languageName: string}} opts\n */\n function registerAliases(aliasList, { languageName }) {\n if (typeof aliasList === 'string') {\n aliasList = [aliasList];\n }\n aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; });\n }\n\n /**\n * Determines if a given language has auto-detection enabled\n * @param {string} name - name of the language\n */\n function autoDetection(name) {\n const lang = getLanguage(name);\n return lang && !lang.disableAutodetect;\n }\n\n /**\n * Upgrades the old highlightBlock plugins to the new\n * highlightElement API\n * @param {HLJSPlugin} plugin\n */\n function upgradePluginAPI(plugin) {\n // TODO: remove with v12\n if (plugin[\"before:highlightBlock\"] && !plugin[\"before:highlightElement\"]) {\n plugin[\"before:highlightElement\"] = (data) => {\n plugin[\"before:highlightBlock\"](\n Object.assign({ block: data.el }, data)\n );\n };\n }\n if (plugin[\"after:highlightBlock\"] && !plugin[\"after:highlightElement\"]) {\n plugin[\"after:highlightElement\"] = (data) => {\n plugin[\"after:highlightBlock\"](\n Object.assign({ block: data.el }, data)\n );\n };\n }\n }\n\n /**\n * @param {HLJSPlugin} plugin\n */\n function addPlugin(plugin) {\n upgradePluginAPI(plugin);\n plugins.push(plugin);\n }\n\n /**\n * @param {HLJSPlugin} plugin\n */\n function removePlugin(plugin) {\n const index = plugins.indexOf(plugin);\n if (index !== -1) {\n plugins.splice(index, 1);\n }\n }\n\n /**\n *\n * @param {PluginEvent} event\n * @param {any} args\n */\n function fire(event, args) {\n const cb = event;\n plugins.forEach(function(plugin) {\n if (plugin[cb]) {\n plugin[cb](args);\n }\n });\n }\n\n /**\n * DEPRECATED\n * @param {HighlightedHTMLElement} el\n */\n function deprecateHighlightBlock(el) {\n deprecated(\"10.7.0\", \"highlightBlock will be removed entirely in v12.0\");\n deprecated(\"10.7.0\", \"Please use highlightElement now.\");\n\n return highlightElement(el);\n }\n\n /* Interface definition */\n Object.assign(hljs, {\n highlight,\n highlightAuto,\n highlightAll,\n highlightElement,\n // TODO: Remove with v12 API\n highlightBlock: deprecateHighlightBlock,\n configure,\n initHighlighting,\n initHighlightingOnLoad,\n registerLanguage,\n unregisterLanguage,\n listLanguages,\n getLanguage,\n registerAliases,\n autoDetection,\n inherit,\n addPlugin,\n removePlugin\n });\n\n hljs.debugMode = function() { SAFE_MODE = false; };\n hljs.safeMode = function() { SAFE_MODE = true; };\n hljs.versionString = version;\n\n hljs.regex = {\n concat: concat,\n lookahead: lookahead,\n either: either,\n optional: optional,\n anyNumberOfTimes: anyNumberOfTimes\n };\n\n for (const key in MODES) {\n // @ts-ignore\n if (typeof MODES[key] === \"object\") {\n // @ts-ignore\n deepFreeze(MODES[key]);\n }\n }\n\n // merge all the modes/regexes into our main object\n Object.assign(hljs, MODES);\n\n return hljs;\n};\n\n// Other names for the variable may break build script\nconst highlight = HLJS({});\n\n// returns a new instance of the highlighter to be used for extensions\n// check https://github.com/wooorm/lowlight/issues/47\nhighlight.newInstance = () => HLJS({});\n\nmodule.exports = highlight;\nhighlight.HighlightJS = highlight;\nhighlight.default = highlight;\n","const IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';\nconst KEYWORDS = [\n \"as\", // for exports\n \"in\",\n \"of\",\n \"if\",\n \"for\",\n \"while\",\n \"finally\",\n \"var\",\n \"new\",\n \"function\",\n \"do\",\n \"return\",\n \"void\",\n \"else\",\n \"break\",\n \"catch\",\n \"instanceof\",\n \"with\",\n \"throw\",\n \"case\",\n \"default\",\n \"try\",\n \"switch\",\n \"continue\",\n \"typeof\",\n \"delete\",\n \"let\",\n \"yield\",\n \"const\",\n \"class\",\n // JS handles these with a special rule\n // \"get\",\n // \"set\",\n \"debugger\",\n \"async\",\n \"await\",\n \"static\",\n \"import\",\n \"from\",\n \"export\",\n \"extends\"\n];\nconst LITERALS = [\n \"true\",\n \"false\",\n \"null\",\n \"undefined\",\n \"NaN\",\n \"Infinity\"\n];\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects\nconst TYPES = [\n // Fundamental objects\n \"Object\",\n \"Function\",\n \"Boolean\",\n \"Symbol\",\n // numbers and dates\n \"Math\",\n \"Date\",\n \"Number\",\n \"BigInt\",\n // text\n \"String\",\n \"RegExp\",\n // Indexed collections\n \"Array\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int8Array\",\n \"Uint8Array\",\n \"Uint8ClampedArray\",\n \"Int16Array\",\n \"Int32Array\",\n \"Uint16Array\",\n \"Uint32Array\",\n \"BigInt64Array\",\n \"BigUint64Array\",\n // Keyed collections\n \"Set\",\n \"Map\",\n \"WeakSet\",\n \"WeakMap\",\n // Structured data\n \"ArrayBuffer\",\n \"SharedArrayBuffer\",\n \"Atomics\",\n \"DataView\",\n \"JSON\",\n // Control abstraction objects\n \"Promise\",\n \"Generator\",\n \"GeneratorFunction\",\n \"AsyncFunction\",\n // Reflection\n \"Reflect\",\n \"Proxy\",\n // Internationalization\n \"Intl\",\n // WebAssembly\n \"WebAssembly\"\n];\n\nconst ERROR_TYPES = [\n \"Error\",\n \"EvalError\",\n \"InternalError\",\n \"RangeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n \"TypeError\",\n \"URIError\"\n];\n\nconst BUILT_IN_GLOBALS = [\n \"setInterval\",\n \"setTimeout\",\n \"clearInterval\",\n \"clearTimeout\",\n\n \"require\",\n \"exports\",\n\n \"eval\",\n \"isFinite\",\n \"isNaN\",\n \"parseFloat\",\n \"parseInt\",\n \"decodeURI\",\n \"decodeURIComponent\",\n \"encodeURI\",\n \"encodeURIComponent\",\n \"escape\",\n \"unescape\"\n];\n\nconst BUILT_IN_VARIABLES = [\n \"arguments\",\n \"this\",\n \"super\",\n \"console\",\n \"window\",\n \"document\",\n \"localStorage\",\n \"sessionStorage\",\n \"module\",\n \"global\" // Node.js\n];\n\nconst BUILT_INS = [].concat(\n BUILT_IN_GLOBALS,\n TYPES,\n ERROR_TYPES\n);\n\n/*\nLanguage: JavaScript\nDescription: JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.\nCategory: common, scripting, web\nWebsite: https://developer.mozilla.org/en-US/docs/Web/JavaScript\n*/\n\n\n/** @type LanguageFn */\nfunction javascript(hljs) {\n const regex = hljs.regex;\n /**\n * Takes a string like \" {\n const tag = \"',\n end: ''\n };\n // to avoid some special cases inside isTrulyOpeningTag\n const XML_SELF_CLOSING = /<[A-Za-z0-9\\\\._:-]+\\s*\\/>/;\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n if (\n // HTML should not include another raw `<` inside a tag\n // nested type?\n // `>`, etc.\n nextChar === \"<\" ||\n // the , gives away that this is not HTML\n // ``\n nextChar === \",\"\n ) {\n response.ignoreMatch();\n return;\n }\n\n // ``\n // Quite possibly a tag, lets look for a matching closing tag...\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n\n // `` (self-closing)\n // handled by simpleSelfClosing rule\n\n let m;\n const afterMatch = match.input.substring(afterMatchIndex);\n\n // some more template typing stuff\n // (key?: string) => Modify<\n if ((m = afterMatch.match(/^\\s*=/))) {\n response.ignoreMatch();\n return;\n }\n\n // ``\n // technically this could be HTML, but it smells like a type\n // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276\n if ((m = afterMatch.match(/^\\s+extends\\s+/))) {\n if (m.index === 0) {\n response.ignoreMatch();\n // eslint-disable-next-line no-useless-return\n return;\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS,\n \"variable.language\": BUILT_IN_VARIABLES\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: '\\.?html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: '\\.?css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const GRAPHQL_TEMPLATE = {\n begin: '\\.?gql`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'graphql'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n begin: '(?=@[A-Za-z]+)',\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n },\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n excludeEnd: true,\n excludeBegin: true,\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n GRAPHQL_TEMPLATE,\n TEMPLATE_STRING,\n // Skip numbers when they are part of a variable name\n { match: /\\$\\d+/ },\n NUMBER,\n // This is intentional:\n // See https://github.com/highlightjs/highlight.js/issues/3288\n // hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /(\\s*)\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n // convert this to negative lookbehind in v12\n begin: /(\\s*)\\(/, // to match the parms with \n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n // ES6 classes\n const CLASS_OR_EXTENDS = {\n variants: [\n // class Car extends vehicle\n {\n match: [\n /class/,\n /\\s+/,\n IDENT_RE$1,\n /\\s+/,\n /extends/,\n /\\s+/,\n regex.concat(IDENT_RE$1, \"(\", regex.concat(/\\./, IDENT_RE$1), \")*\")\n ],\n scope: {\n 1: \"keyword\",\n 3: \"title.class\",\n 5: \"keyword\",\n 7: \"title.class.inherited\"\n }\n },\n // class Car\n {\n match: [\n /class/,\n /\\s+/,\n IDENT_RE$1\n ],\n scope: {\n 1: \"keyword\",\n 3: \"title.class\"\n }\n },\n\n ]\n };\n\n const CLASS_REFERENCE = {\n relevance: 0,\n match:\n regex.either(\n // Hard coded exceptions\n /\\bJSON/,\n // Float32Array, OutT\n /\\b[A-Z][a-z]+([A-Z][a-z]*|\\d)*/,\n // CSSFactory, CSSFactoryT\n /\\b[A-Z]{2,}([A-Z][a-z]+|\\d)+([A-Z][a-z]*)*/,\n // FPs, FPsT\n /\\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\\d)*([A-Z][a-z]*)*/,\n // P\n // single letters are not highlighted\n // BLAH\n // this will be flagged as a UPPER_CASE_CONSTANT instead\n ),\n className: \"title.class\",\n keywords: {\n _: [\n // se we still get relevance credit for JS library classes\n ...TYPES,\n ...ERROR_TYPES\n ]\n }\n };\n\n const USE_STRICT = {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n };\n\n const FUNCTION_DEFINITION = {\n variants: [\n {\n match: [\n /function/,\n /\\s+/,\n IDENT_RE$1,\n /(?=\\s*\\()/\n ]\n },\n // anonymous function\n {\n match: [\n /function/,\n /\\s*(?=\\()/\n ]\n }\n ],\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n label: \"func.def\",\n contains: [ PARAMS ],\n illegal: /%/\n };\n\n const UPPER_CASE_CONSTANT = {\n relevance: 0,\n match: /\\b[A-Z][A-Z_0-9]+\\b/,\n className: \"variable.constant\"\n };\n\n function noneOf(list) {\n return regex.concat(\"(?!\", list.join(\"|\"), \")\");\n }\n\n const FUNCTION_CALL = {\n match: regex.concat(\n /\\b/,\n noneOf([\n ...BUILT_IN_GLOBALS,\n \"super\",\n \"import\"\n ].map(x => `${x}\\\\s*\\\\(`)),\n IDENT_RE$1, regex.lookahead(/\\s*\\(/)),\n className: \"title.function\",\n relevance: 0\n };\n\n const PROPERTY_ACCESS = {\n begin: regex.concat(/\\./, regex.lookahead(\n regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)\n )),\n end: IDENT_RE$1,\n excludeBegin: true,\n keywords: \"prototype\",\n className: \"property\",\n relevance: 0\n };\n\n const GETTER_OR_SETTER = {\n match: [\n /get|set/,\n /\\s+/,\n IDENT_RE$1,\n /(?=\\()/\n ],\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n contains: [\n { // eat to avoid empty params\n begin: /\\(\\)/\n },\n PARAMS\n ]\n };\n\n const FUNC_LEAD_IN_RE = '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>';\n\n const FUNCTION_VARIABLE = {\n match: [\n /const|var|let/, /\\s+/,\n IDENT_RE$1, /\\s*/,\n /=\\s*/,\n /(async\\s*)?/, // async is optional\n regex.lookahead(FUNC_LEAD_IN_RE)\n ],\n keywords: \"async\",\n className: {\n 1: \"keyword\",\n 3: \"title.function\"\n },\n contains: [\n PARAMS\n ]\n };\n\n return {\n name: 'JavaScript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS, CLASS_REFERENCE },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n USE_STRICT,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n GRAPHQL_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n // Skip numbers when they are part of a variable name\n { match: /\\$\\d+/ },\n NUMBER,\n CLASS_REFERENCE,\n {\n className: 'attr',\n begin: IDENT_RE$1 + regex.lookahead(':'),\n relevance: 0\n },\n FUNCTION_VARIABLE,\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n relevance: 0,\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: FUNC_LEAD_IN_RE,\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /(\\s*)\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/,\n relevance: 0\n },\n {\n match: /\\s+/,\n relevance: 0\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n { match: XML_SELF_CLOSING },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n },\n FUNCTION_DEFINITION,\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: '\\\\b(?!function)' + hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n label: \"func.def\",\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: \"title.function\" })\n ]\n },\n // catch ... so it won't trigger the property rule below\n {\n match: /\\.\\.\\./,\n relevance: 0\n },\n PROPERTY_ACCESS,\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n match: '\\\\$' + IDENT_RE$1,\n relevance: 0\n },\n {\n match: [ /\\bconstructor(?=\\s*\\()/ ],\n className: { 1: \"title.function\" },\n contains: [ PARAMS ]\n },\n FUNCTION_CALL,\n UPPER_CASE_CONSTANT,\n CLASS_OR_EXTENDS,\n GETTER_OR_SETTER,\n {\n match: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}\n\nexport { javascript as default };\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport componentCss from './code-block.scss?inline';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport hljs from 'highlight.js/lib/core';\nimport javascript from 'highlight.js/lib/languages/javascript';\n\nhljs.registerLanguage('javascript', javascript);\n\nexport class CodeBlock extends LitElement {\n static styles = [unsafeCSS(componentCss)];\n static properties = {\n language: { type: String },\n code: { tyoe: String, state: true }\n };\n\n constructor(props) {\n super(props);\n this.language = 'javascript';\n }\n\n #onCodeChanged() {\n const slottedElements = this.shadowRoot.querySelector('slot').assignedNodes();\n const codeStr = slottedElements[0].textContent;\n\n this.code = hljs.highlight(codeStr, { language: this.language }).value;\n }\n\n render() {\n return html`\n
${unsafeHTML(this.code)}
\n this.#onCodeChanged()}\">\n `;\n }\n}\n\ncustomElements.define('code-block', CodeBlock);\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport '../../../components/code-block/code-block';\nimport { animations, theme } from '../../../theme/theme';\nimport showcaseComponentCss from './showcase-component.scss?inline';\nimport { when } from 'lit/directives/when.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport class ShowcaseComponent extends LitElement {\n static styles = [theme, animations, unsafeCSS(showcaseComponentCss)];\n\n static properties = {\n collapsed: { type: Boolean },\n hasCodeExample: { type: Boolean, state: true },\n exampleLanguage: { type: String },\n href: { type: String }\n };\n\n connectedCallback() {\n super.connectedCallback();\n this.collapsed = true;\n this.shadowRoot.addEventListener('slotchange', () => {\n this.hasCodeExample = this.#hasSlot('code');\n });\n }\n\n updated(_changedProperties) {\n super.updated(_changedProperties);\n\n if (_changedProperties.has('collapsed') && !this.collapsed) {\n this.shadowRoot.querySelector('[part=\"implementation\"]').classList.add('active');\n }\n }\n\n #hasSlot(name) {\n return this.shadowRoot.querySelector(`slot[name=\"${name}\"]`).assignedNodes().length > 0;\n }\n\n #implementationSectionAnimationEnd(e) {\n e.target.classList.toggle('active', !e.target.classList.contains('fade-out-shrink'));\n e.target.classList.remove('fade-in-grow', 'fade-out-shrink');\n }\n\n #implementationSectionClassMap() {\n return {\n 'fade-in-grow': this.collapsed === false,\n 'fade-out-shrink': this.collapsed === true\n };\n }\n\n render() {\n return html`\n \n \n\n
\n

{\n this.collapsed = !this.collapsed;\n }}\">\n ${this.collapsed ? 'visibility' : 'visibility_off'}\n ${this.collapsed ? 'See the Implementation' : 'Hide the Implementation'} \n

\n
this.#implementationSectionAnimationEnd(e)}\">\n
\n \n
\n ${when(this.href, () => html`\n
\n \n view on github\n \n
\n `)}\n
\n
\n `;\n }\n}\n\ncustomElements.define('showcase-component', ShowcaseComponent);\n","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Start Time Showcase\\n \\n \\n\\n\\n\\n\\n
\\n

Start the player at a given position

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Multi Player Showcase\\n \\n \\n\\n\\n\\n\\n
\\n

Multiple players

\\n\\n
\\n \\n
\\n\\n \\n\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Detect blocked segment\\n \\n \\n\\n\\n\\n\\n
\\n

Detect blocked segment

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Display Current Chapter\\n \\n \\n\\n\\n\\n\\n
\\n

Display Current Chapter

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Skip Credits\\n \\n \\n\\n\\n\\n\\n
\\n

Skip Credits

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Playlist\\n \\n \\n\\n\\n\\n\\n
\\n

Playlist

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n Pillarbox Demo - Quality Menu\\n \\n \\n\\n\\n\\n\\n
\\n

Quality Menu

\\n
\\n \\n
\\n\\n \\n
\\n\\n\\n\\n\\n\\n\\n\\n\"","export default \"\\n\\n\\n \\n \\n \\n \\n Pillarbox Demo - Display Countdown\\n \\n \\n \\n\\n \\n \\n
\\n

Display Countdown

\\n
\\n \\n
\\n\\n \\n
\\n\\n \\n\\n \\n\\n \\n\\n\\n\"","/**\n * Aligns the lines of a block of code by removing leading spaces.\n *\n * This function calculates the number of leading spaces on the first line of the code,\n * then creates a regular expression that matches this number of leading spaces.\n * It finally replaces these leading spaces in each line of the code.\n *\n * @param {string} code - The block of code to align.\n * @returns {string} The aligned block of code.\n */\nfunction alignLines(code) {\n // Remove leading and trailing new lines.\n const normalizeCode = code.replace(/^[\\r\\n]+|[\\r\\n]+$/g, '');\n // Calculate the number of leading spaces on the first line\n const firstLine = normalizeCode.split('\\n')[0];\n const leadingSpaces = firstLine.match(/^ */)[0].length;\n // Create a regular expression that matches 'leadingSpaces' number of leading spaces\n const regex = new RegExp(`^ {${leadingSpaces}}`, 'gm');\n\n // Replace leading spaces in each line\n return normalizeCode.replace(regex, '');\n}\n\nconst parser = new DOMParser();\n\n/**\n * Parses an HTML string and returns the text content of the first element that matches the provided selector.\n *\n * @param {string} html - The HTML string to parse.\n * @param {string} [selector='[data-implementation]'] - The CSS selector to match elements. Defaults to '[data-example]'.\n * @returns {string} The text content of the first matching element. If no elements match the selector, it returns an empty string.\n *\n * @example\n * const html = '
Hello, world!
';\n * const content = parseHTML(html);\n * console.log(content); // Logs: 'Hello, world!'\n */\nexport function getTextFromHTML(html, selector = '[data-implementation]') {\n return alignLines(\n parser.parseFromString(html, 'text/html').querySelector(selector).textContent\n );\n}\n","import router from '../../../router/router';\nimport { html, LitElement, unsafeCSS } from 'lit';\nimport { animations, theme } from '../../../theme/theme';\nimport './showcase-component.js';\nimport '../../../components/code-block/code-block';\nimport showcasePageCss from './showcase-page.scss?inline';\nimport rawStartTimeExample from '../../../../static/showcases/start-time.html?raw';\nimport rawMultiPlayerExample from '../../../../static/showcases/multi-player.html?raw';\nimport rawDetectBlockedSegmentsExample from '../../../../static/showcases/blocked-segment.html?raw';\nimport rawDisplayCurrentChapterExample from '../../../../static/showcases/chapters.html?raw';\nimport rawSkipCreditsExample from '../../../../static/showcases/skip-credits.html?raw';\nimport rawPlaylistExample from '../../../../static/showcases/playlist.html?raw';\nimport rawqualityMenuExample from '../../../../static/showcases/quality-menu.html?raw';\nimport rawCountdown from '../../../../static/showcases/countdown.html?raw';\nimport { getTextFromHTML } from './example-parser.js';\n\nconst startTimeExampleTxt = getTextFromHTML(rawStartTimeExample);\nconst multiPlayerExampleTxt = getTextFromHTML(rawMultiPlayerExample);\nconst detectBlockedSegmentsExampleTxt =\n getTextFromHTML(rawDetectBlockedSegmentsExample);\nconst displayCurrentChapterExampleTxt =\n getTextFromHTML(rawDisplayCurrentChapterExample);\nconst skipCreditsExampleTxt = getTextFromHTML(rawSkipCreditsExample);\nconst playlistExampleTxt = getTextFromHTML(rawPlaylistExample);\nconst qualityMenuExampleTxt = getTextFromHTML(rawqualityMenuExample);\nconst countdownExampleTxt = getTextFromHTML(rawCountdown);\n\nexport class ShowCasePage extends LitElement {\n static styles = [theme, animations, unsafeCSS(showcasePageCss)];\n\n render() {\n return html`\n ${this.#renderStartTime()}\n ${this.#renderMultiplePlayers()}\n ${this.#renderDetectBlockedSegments()}\n ${this.#renderDisplayCurrentChapter()}\n ${this.#renderSkipCredits()}\n ${this.#renderPlaylist()}\n ${this.#renderQualityMenu()}\n ${this.#renderCountdown()}\n `;\n }\n\n #renderStartTime() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Start the player at a given position

\n

\n In this showcase, we'll demonstrate how to load a video source and\n start playback at a specific position using Pillarbox. This can be\n useful when you want to provide users with the option to begin\n watching a video from a predefined timestamp. To achieve this\n functionality, follow the code snippet below:\n

\n ${startTimeExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderMultiplePlayers() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Multiple Players

\n

\n This example demonstrates how to incorporate multiple video players\n on a webpage.In this showcase, two players are initialized, each\n with its own configuration, a button allows to toggle the mute state\n for both players.\n

\n ${multiPlayerExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderDetectBlockedSegments() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Detect Blocked Segments

\n

\n This tutorial covers how to use pillarbox to create a plugin that\n detects and notifies when a blocked segment is skipped.\n

\n ${detectBlockedSegmentsExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderDisplayCurrentChapter() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Display Current Chapter

\n

\n This showcase explains how to use pillarbox to create a plugin that\n displays the currently playing chapter in a box above the progress\n bar.\n

\n ${displayCurrentChapterExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderSkipCredits() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Skip Credits

\n

\n This example shows how to use the\n Pillarbox Skip Button component\n to add a \"Skip\" button during detected credit intervals.\n

\n ${skipCreditsExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderPlaylist() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Playlist

\n

\n This example shows how to fetch media data for a set of video sources\n and load them into the Pillarbox Playlist plugin\n with metadata such as title and duration.\n

\n ${playlistExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderQualityMenu() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Quality Menu

\n

\n In this showcase, we'll demonstrate howto display a quality selector\n menu using the videojs-contrib-quality-menu\n plugin.\n

\n ${qualityMenuExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n\n #renderCountdown() {\n return html`\n
e.target.classList.remove('fade-in')}\">\n \n

Countdown Timer

\n

\n In this showcase, we'll demonstrate how to display a countdown timer.\n

\n ${countdownExampleTxt}\n
\n \n Open this showcase\n \n
\n `;\n }\n}\n\ncustomElements.define('showcase-page', ShowCasePage);\nrouter.addRoute('showcase', 'showcase-page');\n","import { html, LitElement, unsafeCSS } from 'lit';\nimport '../../router/route-link-component';\nimport { theme } from '../../theme/theme';\nimport headerCSS from './demo-header-component.scss?inline';\nimport router from '../../router/router';\nimport './core-demo-header-component.js';\n\n/**\n * A web component that represents the header of the demo page. This header contains\n * the {@link CoreDemoHeaderComponent} as well as the navigation menu of the\n * different demo app sections.\n *\n * @element demo-header\n *\n * @prop {Boolean} debug - Indicates whether the debug mode is enabled.\n *\n * @example\n * \n */\nexport class DemoHeaderElement extends LitElement {\n static properties = {\n debug: { type: Boolean, state: true }\n };\n\n static styles = [theme, unsafeCSS(headerCSS)];\n\n #onRouteUpdated = ({ detail: { queryParams } }) => {\n this.debug = queryParams.debug === 'true';\n };\n\n connectedCallback() {\n super.connectedCallback();\n\n this.debug = router.queryParams.debug === 'true';\n router.addEventListener('routechanged', this.#onRouteUpdated);\n router.addEventListener('queryparams', this.#onRouteUpdated);\n }\n\n disconnectedCallback() {\n router.removeEventListener('routechanged', this.#onRouteUpdated);\n router.removeEventListener('queryparams', this.#onRouteUpdated);\n }\n\n render() {\n return html`\n ${this.#renderHeaderElement()}\n ${this.#renderNavElement()}\n `;\n }\n\n #renderHeaderElement() {\n return html`\n \n \n settings\n \n \n `;\n }\n\n #renderNavElement() {\n return html`\n `;\n }\n}\n\ncustomElements.define('demo-header', DemoHeaderElement);\n","import router from './router';\nimport { LitElement } from 'lit';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\n\nexport class RouteOutletComponent extends LitElement {\n static properties = {\n route: { state: true }\n };\n\n constructor() {\n super();\n\n this.route = router.currentRoute;\n router.addEventListener('routechanged', ({ detail: { route } }) => {\n this.route?.destroy();\n this.route = route;\n });\n }\n\n render() {\n return unsafeHTML(`<${this.route.component}>`);\n }\n}\n\ncustomElements.define('route-outlet', RouteOutletComponent);\n","/**\n * Main module to import and initialize the demo as a single page application.\n *\n * @module\n */\nimport './components/dialog/demo-dialog-component';\nimport './components/player/player';\nimport './layout/content/examples/examples-page';\nimport './layout/content/lists/lists-page';\nimport './layout/content/search/search-page';\nimport './layout/content/settings/settings-page';\nimport './layout/content/showcase/showcase-page';\nimport './layout/header/demo-header-component.js';\nimport './router/route-outlet-component';\nimport router from './router/router';\nimport PreferencesProvider\n from './layout/content/settings/preferences-provider';\nimport ilProvider from './utils/il-provider.js';\n\n// Load preferences and initializes il host\nconst preferences = PreferencesProvider.loadPreferences();\n\nilProvider.host = preferences.dataProviderHost;\n\n// Initialize the router with the current path or 'examples' if none is found\nrouter.start({ defaultPath: 'examples' });\n\nif (router.queryParams.debug) {\n preferences.debug = router.queryParams.debug === 'true';\n PreferencesProvider.savePreferences(preferences);\n} else if (preferences.debug) {\n router.updateState({ debug: 'true' });\n}\n"],"names":["DemoDialog","LitElement","__privateAdd","_DemoDialog_instances","_dialog","_changedProperties","__privateGet","__privateSet","html","__privateMethod","onDialogClicked_fn","onDialogClosed_fn","__publicField","theme","animations","unsafeCSS","componentCSS","PreferencesProvider","preferences","IL_DEFAULT_HOST","DEFAULT_QUERY_PARAMS","DEFAULT_SEARCH_PARAMS","DEFAULT_SHOWLIST_PARAMS","toMedia","title","urn","mediaType","date","duration","ILProvider","host","_ILProvider_instances","_host","bu","query","signal","data","fetch_fn","toResults","nextProvider_fn","transmission","topicUrn","pageSize","showUrn","mediaList","id","channelId","path","params","queryParams","url","response","reason","nextUrl","resultMapper","nextData","ilProvider","DEMO_PLAYER_ID","DEFAULT_OPTIONS","preferencesToPlayerOptions","createPlayer","options","Pillarbox","destroyPlayer","playerDialog","toParams","keySystems","vendor","toKeySystem","certificateUri","licenseUri","asQueryParams","src","type","router","loadPlayerFromRouter","e","openPlayerModal","playerOptions","shouldUpdateRouter","player","s","i","t","r","_a","_b","LoadMediaFormComponent","_LoadMediaFormComponent_instances","initDrmSettings_fn","btnSettingsClassMap","handleLoadBarKeyUp_fn","classMap","drmSettingsTemplate_fn","submitMedia_fn","getSource_fn","keySystems_get","event","toKeySystem_fn","onFormAnimationEnd_fn","formAnimationClassMap_fn","ContentLinkComponent","_onClick","EXAMPLES","o","f","n","ExamplesPage","map","Examples","section","examples","example","when","css","SpinnerComponent","spinnerCss","DEFAULT_INT_OPTIONS","onIntersecting","target","callback","entries","entry","IntersectionObserverComponent","ScrollToTopComponent","toKebabCase","str","_ListsPageStateManager","root","_ListsPageStateManager_instances","nodes","sectionIndex","findSectionIndex_fn","nodeIndex","findNodeIndex_fn","processNodeString_fn","stackIndex","_ListsPageStateManager_static","params_fn","nodeStr","stack","rootSection","node","sectionStr","normalizedSectionStr","normalizedStr","ListsPageStateManager","Section","resolve","next","toNodesAndNext","listsSections","topic","show","channel","ListsPage","_ListsPage_instances","_abortController","_stateManager","_onQueryParamsChanged","updateState_fn","manager","renderScrollBtn","renderNavigation_fn","renderSpinner_fn","renderResults_fn","renderScrollToTopBtn_fn","toMediaButtonParams_fn","renderMediaButton_fn","toLevelParams_fn","sectionIdx","nodeIdx","renderLevelButton_fn","nextPage_fn","renderNodes_fn","firstSection","hasIntesectionObserver","idx","onSectionsClicked_fn","button","onNavigationClicked_fn","step","DEFAULT_BU","SearchBarComponent","_SearchBarComponent_instances","property","handleSelectChange_fn","handleSearchBarKeyUp_fn","clearSearchBar_fn","SearchPage","_SearchPage_instances","searchBar","search_fn","onSearchBarChanged_fn","fetchNextPage_fn","toQueryParams_fn","renderButton_fn","resultsClassMap","ToggleSwitchComponent","_onKeyDown","force","SettingsPage","_SettingsPage_instances","renderToggle_fn","renderInput_fn","label","componentCss","deepFreeze","obj","name","prop","Response","mode","escapeHTML","value","inherit$1","original","objects","result","key","SPAN_CLOSE","emitsWrappingTags","scopeToCSSClass","prefix","pieces","x","HTMLRenderer","parseTree","text","className","newNode","opts","TokenTree","scope","builder","child","el","TokenTreeEmitter","emitter","source","re","lookahead","concat","anyNumberOfTimes","optional","args","stripOptionsFromArgs","either","countMatchGroups","startsWith","lexeme","match","BACKREF_RE","_rewriteBackreferences","regexps","joinWith","numCaptures","regex","offset","out","MATCH_NOTHING_RE","IDENT_RE","UNDERSCORE_IDENT_RE","NUMBER_RE","C_NUMBER_RE","BINARY_NUMBER_RE","RE_STARTERS_RE","SHEBANG","beginShebang","m","resp","BACKSLASH_ESCAPE","APOS_STRING_MODE","QUOTE_STRING_MODE","PHRASAL_WORDS_MODE","COMMENT","begin","end","modeOptions","ENGLISH_WORD","C_LINE_COMMENT_MODE","C_BLOCK_COMMENT_MODE","HASH_COMMENT_MODE","NUMBER_MODE","C_NUMBER_MODE","BINARY_NUMBER_MODE","REGEXP_MODE","TITLE_MODE","UNDERSCORE_TITLE_MODE","METHOD_GUARD","END_SAME_AS_BEGIN","MODES","skipIfHasPrecedingDot","scopeClassName","_parent","beginKeywords","parent","compileIllegal","compileMatch","compileRelevance","beforeMatchExt","originalMode","COMMON_KEYWORDS","DEFAULT_KEYWORD_SCOPE","compileKeywords","rawKeywords","caseInsensitive","scopeName","compiledKeywords","compileList","keywordList","keyword","pair","scoreForKeyword","providedScore","commonKeyword","seenDeprecations","error","message","warn","deprecated","version","MultiClassError","remapScopeNames","regexes","scopeNames","emit","positions","beginMultiClass","endMultiClass","scopeSugar","MultiClass","compileLanguage","language","langRe","global","MultiRegex","terminators","matchData","ResumableMultiRegex","index","matcher","m2","buildModeRegex","mm","term","compileMode","cmode","ext","keywordPattern","c","expandOrCloneMode","dependencyOnParent","variant","HTMLInjectionError","escape","inherit","NO_MATCH","MAX_KEYWORD_HITS","HLJS","hljs","languages","aliases","plugins","SAFE_MODE","LANGUAGE_NOT_FOUND","PLAINTEXT_LANGUAGE","shouldNotHighlight","languageName","blockLanguage","block","classes","getLanguage","_class","highlight","codeOrLanguageName","optionsOrCode","ignoreIllegals","code","context","fire","_highlight","codeToHighlight","continuation","keywordHits","keywordData","matchText","processKeywords","top","modeBuffer","lastIndex","buf","word","kind","keywordRelevance","relevance","cssClass","emitKeyword","processSubLanguage","continuations","highlightAuto","processBuffer","emitMultiClass","max","klass","startNewMode","endOfMode","matchPlusRemainder","matched","doIgnore","resumeScanAtSamePosition","doBeginMatch","newMode","beforeCallbacks","cb","doEndMatch","endMode","origin","processContinuations","list","current","item","lastMatch","processLexeme","textBeforeMatch","err","processed","iterations","md","beforeMatch","processedCount","justTextHighlightResult","languageSubset","plaintext","results","autoDetection","sorted","a","b","best","secondBest","updateClassName","element","currentLang","resultLang","highlightElement","configure","userOptions","initHighlighting","highlightAll","initHighlightingOnLoad","wantsHighlight","boot","registerLanguage","languageDefinition","lang","error$1","registerAliases","unregisterLanguage","alias","listLanguages","aliasList","upgradePluginAPI","plugin","addPlugin","removePlugin","deprecateHighlightBlock","core","KEYWORDS","LITERALS","TYPES","ERROR_TYPES","BUILT_IN_GLOBALS","BUILT_IN_VARIABLES","BUILT_INS","javascript","hasClosingTag","after","tag","IDENT_RE$1","FRAGMENT","XML_SELF_CLOSING","XML_TAG","afterMatchIndex","nextChar","afterMatch","KEYWORDS$1","decimalDigits","frac","decimalInteger","NUMBER","SUBST","HTML_TEMPLATE","CSS_TEMPLATE","GRAPHQL_TEMPLATE","TEMPLATE_STRING","SUBST_INTERNALS","SUBST_AND_COMMENTS","PARAMS_CONTAINS","PARAMS","CLASS_OR_EXTENDS","CLASS_REFERENCE","USE_STRICT","FUNCTION_DEFINITION","UPPER_CASE_CONSTANT","noneOf","FUNCTION_CALL","PROPERTY_ACCESS","GETTER_OR_SETTER","FUNC_LEAD_IN_RE","FUNCTION_VARIABLE","CodeBlock","props","_CodeBlock_instances","unsafeHTML","onCodeChanged_fn","codeStr","ShowcaseComponent","_ShowcaseComponent_instances","hasSlot_fn","implementationSectionClassMap_fn","implementationSectionAnimationEnd_fn","showcaseComponentCss","rawStartTimeExample","rawMultiPlayerExample","rawDetectBlockedSegmentsExample","rawDisplayCurrentChapterExample","rawSkipCreditsExample","rawPlaylistExample","rawqualityMenuExample","rawCountdown","alignLines","normalizeCode","leadingSpaces","parser","getTextFromHTML","selector","startTimeExampleTxt","multiPlayerExampleTxt","detectBlockedSegmentsExampleTxt","displayCurrentChapterExampleTxt","skipCreditsExampleTxt","playlistExampleTxt","qualityMenuExampleTxt","countdownExampleTxt","ShowCasePage","_ShowCasePage_instances","renderStartTime_fn","renderMultiplePlayers_fn","renderDetectBlockedSegments_fn","renderDisplayCurrentChapter_fn","renderSkipCredits_fn","renderPlaylist_fn","renderQualityMenu_fn","renderCountdown_fn","showcasePageCss","DemoHeaderElement","_DemoHeaderElement_instances","_onRouteUpdated","renderHeaderElement_fn","renderNavElement_fn","headerCSS","RouteOutletComponent","route"],"mappings":"2kCASO,MAAMA,WAAmBC,CAAW,CAWzC,aAAc,CACZ,MAAO,EAZJC,EAAA,KAAAC,IASLD,EAAA,KAAAE,IAIE,KAAK,KAAO,EAChB,CAEE,QAAQC,EAAoB,CAC1B,MAAM,QAAQA,CAAkB,EAE5BA,EAAmB,IAAI,MAAM,IAC3B,KAAK,MACPC,EAAA,KAAKF,IAAQ,UAAW,EACxBE,EAAA,KAAKF,IAAQ,UAAU,OAAO,mBAAoB,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D,CACE,MAAO,cACP,YAAa,8BACb,IAAK,wBACL,KAAM,YACZ,CACG,EACD,IAAK,CACH,CACE,MAAO,YACP,YAAa,8CACb,IAAK,+DACL,KAAM,uBACP,EACD,CACE,MAAO,oBACP,YAAa,uEACb,IAAK,iGACL,KAAM,uBACP,EACD,CACE,MAAO,gCACP,YAAa,WACb,IAAK,8EACL,KAAM,uBACP,EACD,CACE,MAAO,yBACP,YAAa,4BACb,IAAK,iFACL,KAAM,uBACP,EACD,CACE,MAAO,kCACP,YAAa,2BACb,IAAK,4EACL,KAAM,uBACP,EACD,CACE,MAAO,iDACP,YAAa,YACb,IAAK,wFACL,KAAM,uBACP,EACD,CACE,MAAO,yBACP,YAAa,kBACb,IAAK,qEACL,KAAM,uBACP,EACD,CACE,MAAO,kBACP,YAAa,iCACb,IAAK,kGACL,KAAM,uBACP,EACD,CACE,MAAO,mBACP,YAAa,kCACb,IAAK,oGACL,KAAM,uBACP,EACD,CACE,MAAO,2BACP,YAAa,6DACb,IAAK,qGACL,KAAM,uBACP,EACD,CACE,MAAO,6BACP,YAAa,2DACb,IAAK,uGACL,KAAM,uBACP,EACD,CACE,MAAO,mCACP,YAAa,oDACb,IAAK,mGACL,KAAM,uBACP,EACD,CACE,MAAO,cACP,IAAK,sFACL,KAAM,uBACP,EACD,CACE,MAAO,0BACP,IAAK,0HACL,KAAM,uBACP,EACD,CACE,MAAO,mBACP,YAAa,sCACb,IAAK;AAAA,EACL,KAAM,uBACP,EACD,CACE,MAAO,sCACP,YAAa,kCACb,IAAK,mEACL,KAAM,uBACP,EACD,CACE,MAAO,WACP,IAAK,wFACL,KAAM,uBACP,EACD,CACE,MAAO,0BACP,IAAK,2GACL,KAAM,uBACP,EACD,CACE,MAAO,UACP,IAAK,6EACL,KAAM,uBACP,EACD,CACE,MAAO,uBACP,IAAK,uGACL,KAAM,uBACP,EACD,CACE,MAAO,iCACP,IAAK,kHACL,KAAM,uBACP,EACD,CACE,MAAO,mBACP,IAAK,6IACL,KAAM,uBACP,EACD,CACE,MAAO,kBACP,IAAK,wHACL,KAAM,uBACP,EACD,CACE,MAAO,yBACP,IAAK,0HACL,KAAM,uBACP,EACD,CACE,MAAO,0BACP,IAAK,oOACL,KAAM,uBACP,EACD,CACE,MAAO,YACP,IAAK,qEACL,KAAM,uBACP,EACD,CACE,MAAO,wBACP,IAAK,oFACL,KAAM,uBACP,EACD,CACE,MAAO,aACP,IAAK,gGACL,KAAM,uBACP,EACD,CACE,MAAO,qBACP,IAAK,uEACL,KAAM,uBACP,EACD,CACE,MAAO,cACP,IAAK,4GACL,KAAM,uBACP,EACD,CACE,MAAO,gBACP,IAAK,4GACL,KAAM,uBACP,EACD,CACE,MAAO,QACP,YAAa,mBACb,IAAK,2EACL,KAAM,uBACZ,CACG,EACD,KAAM,CACJ,CACE,MAAO,oBACP,IAAK,oEACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,mEACL,KAAM,uBACN,WAAY,CACV,qBAAsB,iFAC9B,CACK,EACD,CACE,MAAO,oBACP,IAAK,oEACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,mEACL,KAAM,uBACN,WAAY,CACV,qBAAsB,iFAC9B,CACK,EACD,CACE,MAAO,mBACP,IAAK,sGACL,KAAM,sBACP,EACD,CACE,MAAO,wBACP,IAAK,sGACL,KAAM,sBACP,EACD,CACE,MAAO,mBACP,IAAK,uHACL,KAAM,sBACP,EACD,CACE,MAAO,0CACP,IAAK,gIACL,KAAM,sBACP,EACD,CACE,MAAO,yCACP,IAAK,+GACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,yGACL,KAAM,sBACP,EACD,CACE,MAAO,2CACP,IAAK,8GACL,KAAM,sBACP,EACD,CACE,MAAO,oCACP,IAAK,2GACL,KAAM,sBACP,EACD,CACE,MAAO,oBACP,IAAK,4IACL,KAAM,sBACP,EACD,CACE,MAAO,+BACP,IAAK,kHACL,KAAM,sBACP,EACD,CACE,MAAO,kCACP,IAAK,iHACL,K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AcA,GACxBA,GAAU,QAAUA,mBCpiFdjH,GAAW,2BACX+M,GAAW,CACf,KACA,KACA,KACA,KACA,MACA,QACA,UACA,MACA,MACA,WACA,KACA,SACA,OACA,OACA,QACA,QACA,aACA,OACA,QACA,OACA,UACA,MACA,SACA,WACA,SACA,SACA,MACA,QACA,QACA,QAIA,WACA,QACA,QACA,SACA,SACA,OACA,SACA,SACF,EACMC,GAAW,CACf,OACA,QACA,OACA,YACA,MACA,UACF,EAGMC,GAAQ,CAEZ,SACA,WACA,UACA,SAEA,OACA,OACA,SACA,SAEA,SACA,SAEA,QACA,eACA,eACA,YACA,aACA,oBACA,aACA,aACA,cACA,cACA,gBACA,iBAEA,MACA,MACA,UACA,UAEA,cACA,oBACA,UACA,WACA,OAEA,UACA,YACA,oBACA,gBAEA,UACA,QAEA,OAEA,aACF,EAEMC,GAAc,CAClB,QACA,YACA,gBACA,aACA,iBACA,cACA,YACA,UACF,EAEMC,GAAmB,CACvB,cACA,aACA,gBACA,eAEA,UACA,UAEA,OACA,WACA,QACA,aACA,WACA,YACA,qBACA,YACA,qBACA,SACA,UACF,EAEMC,GAAqB,CACzB,YACA,OACA,QACA,UACA,SACA,WACA,eACA,iBACA,SACA,QACF,EAEMC,GAAY,CAAE,EAAC,OACnBF,GACAF,GACAC,EACF,EAWA,SAASI,GAAWnH,EAAM,CACxB,MAAMvG,EAAQuG,EAAK,MAQboH,EAAgB,CAACjO,EAAO,CAAE,MAAAkO,CAAK,IAAO,CAC1C,MAAMC,EAAM,KAAOnO,EAAM,CAAC,EAAE,MAAM,CAAC,EAEnC,OADYA,EAAM,MAAM,QAAQmO,EAAKD,CAAK,IAC3B,EAChB,EAEKE,EAAa1N,GACb2N,EAAW,CACf,MAAO,KACP,IAAK,KACN,EAEKC,EAAmB,4BACnBC,EAAU,CACd,MAAO,sBACP,IAAK,4BAKL,kBAAmB,CAACvO,EAAOxM,IAAa,CACtC,MAAMgb,EAAkBxO,EAAM,CAAC,EAAE,OAASA,EAA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iBACLmI,CACD,EACD,YAAa,KACnB,CACG,EACKG,GAAmB,CACvB,MAAO,SACP,IAAK,GACL,OAAQ,CACN,IAAK,IACL,UAAW,GACX,SAAU,CACRtI,EAAK,iBACLmI,CACD,EACD,YAAa,SACnB,CACG,EACKI,GAAkB,CACtB,UAAW,SACX,MAAO,IACP,IAAK,IACL,SAAU,CACRvI,EAAK,iBACLmI,CACN,CACG,EAwCKxN,GAAU,CACd,UAAW,UACX,SAAU,CAzCUqF,EAAK,QACzB,eACA,OACA,CACE,UAAW,EACX,SAAU,CACR,CACE,MAAO,iBACP,UAAW,EACX,SAAU,CACR,CACE,UAAW,SACX,MAAO,YACR,EACD,CACE,UAAW,OACX,MAAO,MACP,IAAK,MACL,WAAY,GACZ,aAAc,GACd,UAAW,CACZ,EACD,CACE,UAAW,WACX,MAAOuH,EAAa,gBACpB,WAAY,GACZ,UAAW,CACZ,EAGD,CACE,MAAO,cACP,UAAW,CACzB,CACA,CACA,CACA,CACA,CACG,EAKGvH,EAAK,qBACLA,EAAK,mBACX,CACG,EACKwI,GAAkB,CACtBxI,EAAK,iBACLA,EAAK,kBACLoI,GACAC,GACAC,GACAC,GAEA,CAAE,MAAO,OAAS,EAClBL,EAID,EACDC,EAAM,SAAWK,GACd,OAAO,CAGN,MAAO,KACP,IAAK,KACL,SAAUV,EACV,SAAU,CACR,MACD,EAAC,OAAOU,EAAe,CAC9B,CAAK,EACH,MAAMC,GAAqB,CAAA,EAAG,OAAO9N,GAASwN,EAAM,QAAQ,EACtDO,GAAkBD,GAAmB,OAAO,CAEhD,CACE,MAAO,UACP,IAAK,KACL,SAAUX,EACV,SAAU,CAAC,MAAM,EAAE,OAAOW,EAAkB,CAClD,CACA,CAAG,EACKE,GAAS,CACb,UAAW,SAEX,MAAO,UACP,IAAK,KACL,aAAc,GACd,WAAY,GACZ,SAAUb,EACV,SAAUY,EACX,EAGKE,GAAmB,CACvB,SAAU,CAER,CACE,MAAO,CACL,QACA,MACArB,EACA,MACA,UAC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AI,CACrB,GAiBH,eAAe,OAAO,eAAgBA,EAAoB,ECJ1D,MAAMhiB,GAAcD,GAAoB,gBAAiB,EAEzDuC,EAAW,KAAOtC,GAAY,iBAG9BwD,EAAO,MAAM,CAAE,YAAa,WAAY,EAEpCA,EAAO,YAAY,OACrBxD,GAAY,MAAQwD,EAAO,YAAY,QAAU,OACjDzD,GAAoB,gBAAgBC,EAAW,GACtCA,GAAY,OACrBwD,EAAO,YAAY,CAAE,MAAO,MAAM,CAAE","x_google_ignoreList":[4,8,9,22,23]} \ No newline at end of file diff --git a/pr-preview/pr-48/index.html b/pr-preview/pr-48/index.html index eef1690..59c0c3a 100644 --- a/pr-preview/pr-48/index.html +++ b/pr-preview/pr-48/index.html @@ -31,7 +31,7 @@ }(window.location)); - +