Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alexis.durgnat/homepage
  • orestis.malaspin/homepage
2 results
Show changes
Showing
with 0 additions and 4941 deletions
import { SLIDES_SELECTOR } from '../utils/constants.js'
import { queryAll, createStyleSheet } from '../utils/util.js'
/**
* Setups up our presentation for printing/exporting to PDF.
*/
export default class Print {
constructor( Reveal ) {
this.Reveal = Reveal;
}
/**
* Configures the presentation for printing to a static
* PDF.
*/
setupPDF() {
let config = this.Reveal.getConfig();
let slideSize = this.Reveal.getComputedSlideSize( window.innerWidth, window.innerHeight );
// Dimensions of the PDF pages
let pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ),
pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) );
// Dimensions of slides within the pages
let slideWidth = slideSize.width,
slideHeight = slideSize.height;
// Let the browser know what page size we want to print
createStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0px;}' );
// Limit the size of certain elements to the dimensions of the slide
createStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' );
document.documentElement.classList.add( 'print-pdf' );
document.body.style.width = pageWidth + 'px';
document.body.style.height = pageHeight + 'px';
// Make sure stretch elements fit on slide
this.Reveal.layoutSlideContents( slideWidth, slideHeight );
// Compute slide numbers now, before we start duplicating slides
let doingSlideNumbers = config.slideNumber && /all|print/i.test( config.showSlideNumber );
queryAll( this.Reveal.getRevealElement(), SLIDES_SELECTOR ).forEach( function( slide ) {
slide.setAttribute( 'data-slide-number', this.Reveal.slideNumber.getSlideNumber( slide ) );
}, this );
// Slide and slide background layout
queryAll( this.Reveal.getRevealElement(), SLIDES_SELECTOR ).forEach( function( slide ) {
// Vertical stacks are not centred since their section
// children will be
if( slide.classList.contains( 'stack' ) === false ) {
// Center the slide inside of the page, giving the slide some margin
let left = ( pageWidth - slideWidth ) / 2,
top = ( pageHeight - slideHeight ) / 2;
let contentHeight = slide.scrollHeight;
let numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 );
// Adhere to configured pages per slide limit
numberOfPages = Math.min( numberOfPages, config.pdfMaxPagesPerSlide );
// Center slides vertically
if( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) {
top = Math.max( ( pageHeight - contentHeight ) / 2, 0 );
}
// Wrap the slide in a page element and hide its overflow
// so that no page ever flows onto another
let page = document.createElement( 'div' );
page.className = 'pdf-page';
page.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px';
slide.parentNode.insertBefore( page, slide );
page.appendChild( slide );
// Position the slide inside of the page
slide.style.left = left + 'px';
slide.style.top = top + 'px';
slide.style.width = slideWidth + 'px';
if( slide.slideBackgroundElement ) {
page.insertBefore( slide.slideBackgroundElement, slide );
}
// Inject notes if `showNotes` is enabled
if( config.showNotes ) {
// Are there notes for this slide?
let notes = this.Reveal.getSlideNotes( slide );
if( notes ) {
let notesSpacing = 8;
let notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline';
let notesElement = document.createElement( 'div' );
notesElement.classList.add( 'speaker-notes' );
notesElement.classList.add( 'speaker-notes-pdf' );
notesElement.setAttribute( 'data-layout', notesLayout );
notesElement.innerHTML = notes;
if( notesLayout === 'separate-page' ) {
page.parentNode.insertBefore( notesElement, page.nextSibling );
}
else {
notesElement.style.left = notesSpacing + 'px';
notesElement.style.bottom = notesSpacing + 'px';
notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px';
page.appendChild( notesElement );
}
}
}
// Inject slide numbers if `slideNumbers` are enabled
if( doingSlideNumbers ) {
let numberElement = document.createElement( 'div' );
numberElement.classList.add( 'slide-number' );
numberElement.classList.add( 'slide-number-pdf' );
numberElement.innerHTML = slide.getAttribute( 'data-slide-number' );
page.appendChild( numberElement );
}
// Copy page and show fragments one after another
if( config.pdfSeparateFragments ) {
// Each fragment 'group' is an array containing one or more
// fragments. Multiple fragments that appear at the same time
// are part of the same group.
let fragmentGroups = this.Reveal.fragments.sort( page.querySelectorAll( '.fragment' ), true );
let previousFragmentStep;
let previousPage;
fragmentGroups.forEach( function( fragments ) {
// Remove 'current-fragment' from the previous group
if( previousFragmentStep ) {
previousFragmentStep.forEach( function( fragment ) {
fragment.classList.remove( 'current-fragment' );
} );
}
// Show the fragments for the current index
fragments.forEach( function( fragment ) {
fragment.classList.add( 'visible', 'current-fragment' );
}, this );
// Create a separate page for the current fragment state
let clonedPage = page.cloneNode( true );
page.parentNode.insertBefore( clonedPage, ( previousPage || page ).nextSibling );
previousFragmentStep = fragments;
previousPage = clonedPage;
}, this );
// Reset the first/original page so that all fragments are hidden
fragmentGroups.forEach( function( fragments ) {
fragments.forEach( function( fragment ) {
fragment.classList.remove( 'visible', 'current-fragment' );
} );
} );
}
// Show all fragments
else {
queryAll( page, '.fragment:not(.fade-out)' ).forEach( function( fragment ) {
fragment.classList.add( 'visible' );
} );
}
}
}, this );
// Notify subscribers that the PDF layout is good to go
this.Reveal.dispatchEvent({ type: 'pdf-ready' });
}
/**
* Checks if this instance is being used to print a PDF.
*/
isPrintingPDF() {
return ( /print-pdf/gi ).test( window.location.search );
}
}
\ No newline at end of file
/**
* Creates a visual progress bar for the presentation.
*/
export default class Progress {
constructor( Reveal ) {
this.Reveal = Reveal;
this.onProgressClicked = this.onProgressClicked.bind( this );
}
render() {
this.element = document.createElement( 'div' );
this.element.className = 'progress';
this.Reveal.getRevealElement().appendChild( this.element );
this.bar = document.createElement( 'span' );
this.element.appendChild( this.bar );
}
/**
* Called when the reveal.js config is updated.
*/
configure( config, oldConfig ) {
this.element.style.display = config.progress ? 'block' : 'none';
}
bind() {
if( this.Reveal.getConfig().progress && this.element ) {
this.element.addEventListener( 'click', this.onProgressClicked, false );
}
}
unbind() {
if ( this.Reveal.getConfig().progress && this.element ) {
this.element.removeEventListener( 'click', this.onProgressClicked, false );
}
}
/**
* Updates the progress bar to reflect the current slide.
*/
update() {
// Update progress if enabled
if( this.Reveal.getConfig().progress && this.bar ) {
let scale = this.Reveal.getProgress();
// Don't fill the progress bar if there's only one slide
if( this.Reveal.getTotalSlides() < 2 ) {
scale = 0;
}
this.bar.style.transform = 'scaleX('+ scale +')';
}
}
getMaxWidth() {
return this.Reveal.getRevealElement().offsetWidth;
}
/**
* Clicking on the progress bar results in a navigation to the
* closest approximate horizontal slide using this equation:
*
* ( clickX / presentationWidth ) * numberOfSlides
*
* @param {object} event
*/
onProgressClicked( event ) {
this.Reveal.onUserInput( event );
event.preventDefault();
let slidesTotal = this.Reveal.getHorizontalSlides().length;
let slideIndex = Math.floor( ( event.clientX / this.getMaxWidth() ) * slidesTotal );
if( this.Reveal.getConfig().rtl ) {
slideIndex = slidesTotal - slideIndex;
}
this.Reveal.slide( slideIndex );
}
}
\ No newline at end of file
import { HORIZONTAL_SLIDES_SELECTOR, VERTICAL_SLIDES_SELECTOR } from '../utils/constants.js'
import { extend, queryAll, closest } from '../utils/util.js'
import { isMobile } from '../utils/device.js'
import fitty from 'fitty';
/**
* Handles loading, unloading and playback of slide
* content such as images, videos and iframes.
*/
export default class SlideContent {
constructor( Reveal ) {
this.Reveal = Reveal;
this.startEmbeddedIframe = this.startEmbeddedIframe.bind( this );
}
/**
* Should the given element be preloaded?
* Decides based on local element attributes and global config.
*
* @param {HTMLElement} element
*/
shouldPreload( element ) {
// Prefer an explicit global preload setting
let preload = this.Reveal.getConfig().preloadIframes;
// If no global setting is available, fall back on the element's
// own preload setting
if( typeof preload !== 'boolean' ) {
preload = element.hasAttribute( 'data-preload' );
}
return preload;
}
/**
* Called when the given slide is within the configured view
* distance. Shows the slide element and loads any content
* that is set to load lazily (data-src).
*
* @param {HTMLElement} slide Slide to show
*/
load( slide, options = {} ) {
// Show the slide element
slide.style.display = this.Reveal.getConfig().display;
// Media elements with data-src attributes
queryAll( slide, 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ).forEach( element => {
if( element.tagName !== 'IFRAME' || this.shouldPreload( element ) ) {
element.setAttribute( 'src', element.getAttribute( 'data-src' ) );
element.setAttribute( 'data-lazy-loaded', '' );
element.removeAttribute( 'data-src' );
}
} );
// Media elements with <source> children
queryAll( slide, 'video, audio' ).forEach( media => {
let sources = 0;
queryAll( media, 'source[data-src]' ).forEach( source => {
source.setAttribute( 'src', source.getAttribute( 'data-src' ) );
source.removeAttribute( 'data-src' );
source.setAttribute( 'data-lazy-loaded', '' );
sources += 1;
} );
// Enable inline video playback in mobile Safari
if( isMobile && media.tagName === 'VIDEO' ) {
media.setAttribute( 'playsinline', '' );
}
// If we rewrote sources for this video/audio element, we need
// to manually tell it to load from its new origin
if( sources > 0 ) {
media.load();
}
} );
// Show the corresponding background element
let background = slide.slideBackgroundElement;
if( background ) {
background.style.display = 'block';
let backgroundContent = slide.slideBackgroundContentElement;
let backgroundIframe = slide.getAttribute( 'data-background-iframe' );
// If the background contains media, load it
if( background.hasAttribute( 'data-loaded' ) === false ) {
background.setAttribute( 'data-loaded', 'true' );
let backgroundImage = slide.getAttribute( 'data-background-image' ),
backgroundVideo = slide.getAttribute( 'data-background-video' ),
backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ),
backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' );
// Images
if( backgroundImage ) {
backgroundContent.style.backgroundImage = 'url('+ encodeURI( backgroundImage ) +')';
}
// Videos
else if ( backgroundVideo && !this.Reveal.isSpeakerNotes() ) {
let video = document.createElement( 'video' );
if( backgroundVideoLoop ) {
video.setAttribute( 'loop', '' );
}
if( backgroundVideoMuted ) {
video.muted = true;
}
// Enable inline playback in mobile Safari
//
// Mute is required for video to play when using
// swipe gestures to navigate since they don't
// count as direct user actions :'(
if( isMobile ) {
video.muted = true;
video.setAttribute( 'playsinline', '' );
}
// Support comma separated lists of video sources
backgroundVideo.split( ',' ).forEach( source => {
video.innerHTML += '<source src="'+ source +'">';
} );
backgroundContent.appendChild( video );
}
// Iframes
else if( backgroundIframe && options.excludeIframes !== true ) {
let iframe = document.createElement( 'iframe' );
iframe.setAttribute( 'allowfullscreen', '' );
iframe.setAttribute( 'mozallowfullscreen', '' );
iframe.setAttribute( 'webkitallowfullscreen', '' );
iframe.setAttribute( 'allow', 'autoplay' );
iframe.setAttribute( 'data-src', backgroundIframe );
iframe.style.width = '100%';
iframe.style.height = '100%';
iframe.style.maxHeight = '100%';
iframe.style.maxWidth = '100%';
backgroundContent.appendChild( iframe );
}
}
// Start loading preloadable iframes
let backgroundIframeElement = backgroundContent.querySelector( 'iframe[data-src]' );
if( backgroundIframeElement ) {
// Check if this iframe is eligible to be preloaded
if( this.shouldPreload( background ) && !/autoplay=(1|true|yes)/gi.test( backgroundIframe ) ) {
if( backgroundIframeElement.getAttribute( 'src' ) !== backgroundIframe ) {
backgroundIframeElement.setAttribute( 'src', backgroundIframe );
}
}
}
}
// Autosize text with the r-fit-text class based on the
// size of its container. This needs to happen after the
// slide is visible in order to measure the text.
Array.from( slide.querySelectorAll( '.r-fit-text:not([data-fitted])' ) ).forEach( element => {
element.dataset.fitted = '';
fitty( element, {
minSize: 24,
maxSize: this.Reveal.getConfig().height * 0.8,
observeMutations: false,
observeWindow: false
} );
} );
}
/**
* Unloads and hides the given slide. This is called when the
* slide is moved outside of the configured view distance.
*
* @param {HTMLElement} slide
*/
unload( slide ) {
// Hide the slide element
slide.style.display = 'none';
// Hide the corresponding background element
let background = this.Reveal.getSlideBackground( slide );
if( background ) {
background.style.display = 'none';
// Unload any background iframes
queryAll( background, 'iframe[src]' ).forEach( element => {
element.removeAttribute( 'src' );
} );
}
// Reset lazy-loaded media elements with src attributes
queryAll( slide, 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]' ).forEach( element => {
element.setAttribute( 'data-src', element.getAttribute( 'src' ) );
element.removeAttribute( 'src' );
} );
// Reset lazy-loaded media elements with <source> children
queryAll( slide, 'video[data-lazy-loaded] source[src], audio source[src]' ).forEach( source => {
source.setAttribute( 'data-src', source.getAttribute( 'src' ) );
source.removeAttribute( 'src' );
} );
}
/**
* Enforces origin-specific format rules for embedded media.
*/
formatEmbeddedContent() {
let _appendParamToIframeSource = ( sourceAttribute, sourceURL, param ) => {
queryAll( this.Reveal.getSlidesElement(), 'iframe['+ sourceAttribute +'*="'+ sourceURL +'"]' ).forEach( el => {
let src = el.getAttribute( sourceAttribute );
if( src && src.indexOf( param ) === -1 ) {
el.setAttribute( sourceAttribute, src + ( !/\?/.test( src ) ? '?' : '&' ) + param );
}
});
};
// YouTube frames must include "?enablejsapi=1"
_appendParamToIframeSource( 'src', 'youtube.com/embed/', 'enablejsapi=1' );
_appendParamToIframeSource( 'data-src', 'youtube.com/embed/', 'enablejsapi=1' );
// Vimeo frames must include "?api=1"
_appendParamToIframeSource( 'src', 'player.vimeo.com/', 'api=1' );
_appendParamToIframeSource( 'data-src', 'player.vimeo.com/', 'api=1' );
}
/**
* Start playback of any embedded content inside of
* the given element.
*
* @param {HTMLElement} element
*/
startEmbeddedContent( element ) {
if( element && !this.Reveal.isSpeakerNotes() ) {
// Restart GIFs
queryAll( element, 'img[src$=".gif"]' ).forEach( el => {
// Setting the same unchanged source like this was confirmed
// to work in Chrome, FF & Safari
el.setAttribute( 'src', el.getAttribute( 'src' ) );
} );
// HTML5 media elements
queryAll( element, 'video, audio' ).forEach( el => {
if( closest( el, '.fragment' ) && !closest( el, '.fragment.visible' ) ) {
return;
}
// Prefer an explicit global autoplay setting
let autoplay = this.Reveal.getConfig().autoPlayMedia;
// If no global setting is available, fall back on the element's
// own autoplay setting
if( typeof autoplay !== 'boolean' ) {
autoplay = el.hasAttribute( 'data-autoplay' ) || !!closest( el, '.slide-background' );
}
if( autoplay && typeof el.play === 'function' ) {
// If the media is ready, start playback
if( el.readyState > 1 ) {
this.startEmbeddedMedia( { target: el } );
}
// Mobile devices never fire a loaded event so instead
// of waiting, we initiate playback
else if( isMobile ) {
let promise = el.play();
// If autoplay does not work, ensure that the controls are visible so
// that the viewer can start the media on their own
if( promise && typeof promise.catch === 'function' && el.controls === false ) {
promise.catch( () => {
el.controls = true;
// Once the video does start playing, hide the controls again
el.addEventListener( 'play', () => {
el.controls = false;
} );
} );
}
}
// If the media isn't loaded, wait before playing
else {
el.removeEventListener( 'loadeddata', this.startEmbeddedMedia ); // remove first to avoid dupes
el.addEventListener( 'loadeddata', this.startEmbeddedMedia );
}
}
} );
// Normal iframes
queryAll( element, 'iframe[src]' ).forEach( el => {
if( closest( el, '.fragment' ) && !closest( el, '.fragment.visible' ) ) {
return;
}
this.startEmbeddedIframe( { target: el } );
} );
// Lazy loading iframes
queryAll( element, 'iframe[data-src]' ).forEach( el => {
if( closest( el, '.fragment' ) && !closest( el, '.fragment.visible' ) ) {
return;
}
if( el.getAttribute( 'src' ) !== el.getAttribute( 'data-src' ) ) {
el.removeEventListener( 'load', this.startEmbeddedIframe ); // remove first to avoid dupes
el.addEventListener( 'load', this.startEmbeddedIframe );
el.setAttribute( 'src', el.getAttribute( 'data-src' ) );
}
} );
}
}
/**
* Starts playing an embedded video/audio element after
* it has finished loading.
*
* @param {object} event
*/
startEmbeddedMedia( event ) {
let isAttachedToDOM = !!closest( event.target, 'html' ),
isVisible = !!closest( event.target, '.present' );
if( isAttachedToDOM && isVisible ) {
event.target.currentTime = 0;
event.target.play();
}
event.target.removeEventListener( 'loadeddata', this.startEmbeddedMedia );
}
/**
* "Starts" the content of an embedded iframe using the
* postMessage API.
*
* @param {object} event
*/
startEmbeddedIframe( event ) {
let iframe = event.target;
if( iframe && iframe.contentWindow ) {
let isAttachedToDOM = !!closest( event.target, 'html' ),
isVisible = !!closest( event.target, '.present' );
if( isAttachedToDOM && isVisible ) {
// Prefer an explicit global autoplay setting
let autoplay = this.Reveal.getConfig().autoPlayMedia;
// If no global setting is available, fall back on the element's
// own autoplay setting
if( typeof autoplay !== 'boolean' ) {
autoplay = iframe.hasAttribute( 'data-autoplay' ) || !!closest( iframe, '.slide-background' );
}
// YouTube postMessage API
if( /youtube\.com\/embed\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) {
iframe.contentWindow.postMessage( '{"event":"command","func":"playVideo","args":""}', '*' );
}
// Vimeo postMessage API
else if( /player\.vimeo\.com\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) {
iframe.contentWindow.postMessage( '{"method":"play"}', '*' );
}
// Generic postMessage API
else {
iframe.contentWindow.postMessage( 'slide:start', '*' );
}
}
}
}
/**
* Stop playback of any embedded content inside of
* the targeted slide.
*
* @param {HTMLElement} element
*/
stopEmbeddedContent( element, options = {} ) {
options = extend( {
// Defaults
unloadIframes: true
}, options );
if( element && element.parentNode ) {
// HTML5 media elements
queryAll( element, 'video, audio' ).forEach( el => {
if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) {
el.setAttribute('data-paused-by-reveal', '');
el.pause();
}
} );
// Generic postMessage API for non-lazy loaded iframes
queryAll( element, 'iframe' ).forEach( el => {
if( el.contentWindow ) el.contentWindow.postMessage( 'slide:stop', '*' );
el.removeEventListener( 'load', this.startEmbeddedIframe );
});
// YouTube postMessage API
queryAll( element, 'iframe[src*="youtube.com/embed/"]' ).forEach( el => {
if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) {
el.contentWindow.postMessage( '{"event":"command","func":"pauseVideo","args":""}', '*' );
}
});
// Vimeo postMessage API
queryAll( element, 'iframe[src*="player.vimeo.com/"]' ).forEach( el => {
if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) {
el.contentWindow.postMessage( '{"method":"pause"}', '*' );
}
});
if( options.unloadIframes === true ) {
// Unload lazy-loaded iframes
queryAll( element, 'iframe[data-src]' ).forEach( el => {
// Only removing the src doesn't actually unload the frame
// in all browsers (Firefox) so we set it to blank first
el.setAttribute( 'src', 'about:blank' );
el.removeAttribute( 'src' );
} );
}
}
}
}
\ No newline at end of file
/**
* Handles the display of reveal.js' optional slide number.
*/
export default class SlideNumber {
constructor( Reveal ) {
this.Reveal = Reveal;
}
render() {
this.element = document.createElement( 'div' );
this.element.className = 'slide-number';
this.Reveal.getRevealElement().appendChild( this.element );
}
/**
* Called when the reveal.js config is updated.
*/
configure( config, oldConfig ) {
let slideNumberDisplay = 'none';
if( config.slideNumber && !this.Reveal.isPrintingPDF() ) {
if( config.showSlideNumber === 'all' ) {
slideNumberDisplay = 'block';
}
else if( config.showSlideNumber === 'speaker' && this.Reveal.isSpeakerNotes() ) {
slideNumberDisplay = 'block';
}
}
this.element.style.display = slideNumberDisplay;
}
/**
* Updates the slide number to match the current slide.
*/
update() {
// Update slide number if enabled
if( this.Reveal.getConfig().slideNumber && this.element ) {
this.element.innerHTML = this.getSlideNumber();
}
}
/**
* Returns the HTML string corresponding to the current slide
* number, including formatting.
*/
getSlideNumber( slide = this.Reveal.getCurrentSlide() ) {
let config = this.Reveal.getConfig();
let value;
let format = 'h.v';
if ( typeof config.slideNumber === 'function' ) {
value = config.slideNumber( slide );
} else {
// Check if a custom number format is available
if( typeof config.slideNumber === 'string' ) {
format = config.slideNumber;
}
// If there are ONLY vertical slides in this deck, always use
// a flattened slide number
if( !/c/.test( format ) && this.Reveal.getHorizontalSlides().length === 1 ) {
format = 'c';
}
// Offset the current slide number by 1 to make it 1-indexed
let horizontalOffset = slide && slide.dataset.visibility === 'uncounted' ? 0 : 1;
value = [];
switch( format ) {
case 'c':
value.push( this.Reveal.getSlidePastCount( slide ) + horizontalOffset );
break;
case 'c/t':
value.push( this.Reveal.getSlidePastCount( slide ) + horizontalOffset, '/', this.Reveal.getTotalSlides() );
break;
default:
let indices = this.Reveal.getIndices( slide );
value.push( indices.h + horizontalOffset );
let sep = format === 'h/v' ? '/' : '.';
if( this.Reveal.isVerticalSlide( slide ) ) value.push( sep, indices.v + 1 );
}
}
let url = '#' + this.Reveal.location.getHash( slide );
return this.formatNumber( value[0], value[1], value[2], url );
}
/**
* Applies HTML formatting to a slide number before it's
* written to the DOM.
*
* @param {number} a Current slide
* @param {string} delimiter Character to separate slide numbers
* @param {(number|*)} b Total slides
* @param {HTMLElement} [url='#'+locationHash()] The url to link to
* @return {string} HTML string fragment
*/
formatNumber( a, delimiter, b, url = '#' + this.Reveal.location.getHash() ) {
if( typeof b === 'number' && !isNaN( b ) ) {
return `<a href="${url}">
<span class="slide-number-a">${a}</span>
<span class="slide-number-delimiter">${delimiter}</span>
<span class="slide-number-b">${b}</span>
</a>`;
}
else {
return `<a href="${url}">
<span class="slide-number-a">${a}</span>
</a>`;
}
}
}
\ No newline at end of file
import { isAndroid } from '../utils/device.js'
const SWIPE_THRESHOLD = 40;
/**
* Controls all touch interactions and navigations for
* a presentation.
*/
export default class Touch {
constructor( Reveal ) {
this.Reveal = Reveal;
// Holds information about the currently ongoing touch interaction
this.touchStartX = 0;
this.touchStartY = 0;
this.touchStartCount = 0;
this.touchCaptured = false;
this.onPointerDown = this.onPointerDown.bind( this );
this.onPointerMove = this.onPointerMove.bind( this );
this.onPointerUp = this.onPointerUp.bind( this );
this.onTouchStart = this.onTouchStart.bind( this );
this.onTouchMove = this.onTouchMove.bind( this );
this.onTouchEnd = this.onTouchEnd.bind( this );
}
/**
*
*/
bind() {
let revealElement = this.Reveal.getRevealElement();
if( 'onpointerdown' in window ) {
// Use W3C pointer events
revealElement.addEventListener( 'pointerdown', this.onPointerDown, false );
revealElement.addEventListener( 'pointermove', this.onPointerMove, false );
revealElement.addEventListener( 'pointerup', this.onPointerUp, false );
}
else if( window.navigator.msPointerEnabled ) {
// IE 10 uses prefixed version of pointer events
revealElement.addEventListener( 'MSPointerDown', this.onPointerDown, false );
revealElement.addEventListener( 'MSPointerMove', this.onPointerMove, false );
revealElement.addEventListener( 'MSPointerUp', this.onPointerUp, false );
}
else {
// Fall back to touch events
revealElement.addEventListener( 'touchstart', this.onTouchStart, false );
revealElement.addEventListener( 'touchmove', this.onTouchMove, false );
revealElement.addEventListener( 'touchend', this.onTouchEnd, false );
}
}
/**
*
*/
unbind() {
let revealElement = this.Reveal.getRevealElement();
revealElement.removeEventListener( 'pointerdown', this.onPointerDown, false );
revealElement.removeEventListener( 'pointermove', this.onPointerMove, false );
revealElement.removeEventListener( 'pointerup', this.onPointerUp, false );
revealElement.removeEventListener( 'MSPointerDown', this.onPointerDown, false );
revealElement.removeEventListener( 'MSPointerMove', this.onPointerMove, false );
revealElement.removeEventListener( 'MSPointerUp', this.onPointerUp, false );
revealElement.removeEventListener( 'touchstart', this.onTouchStart, false );
revealElement.removeEventListener( 'touchmove', this.onTouchMove, false );
revealElement.removeEventListener( 'touchend', this.onTouchEnd, false );
}
/**
* Checks if the target element prevents the triggering of
* swipe navigation.
*/
isSwipePrevented( target ) {
while( target && typeof target.hasAttribute === 'function' ) {
if( target.hasAttribute( 'data-prevent-swipe' ) ) return true;
target = target.parentNode;
}
return false;
}
/**
* Handler for the 'touchstart' event, enables support for
* swipe and pinch gestures.
*
* @param {object} event
*/
onTouchStart( event ) {
if( this.isSwipePrevented( event.target ) ) return true;
this.touchStartX = event.touches[0].clientX;
this.touchStartY = event.touches[0].clientY;
this.touchStartCount = event.touches.length;
}
/**
* Handler for the 'touchmove' event.
*
* @param {object} event
*/
onTouchMove( event ) {
if( this.isSwipePrevented( event.target ) ) return true;
let config = this.Reveal.getConfig();
// Each touch should only trigger one action
if( !this.touchCaptured ) {
this.Reveal.onUserInput( event );
let currentX = event.touches[0].clientX;
let currentY = event.touches[0].clientY;
// There was only one touch point, look for a swipe
if( event.touches.length === 1 && this.touchStartCount !== 2 ) {
let availableRoutes = this.Reveal.availableRoutes({ includeFragments: true });
let deltaX = currentX - this.touchStartX,
deltaY = currentY - this.touchStartY;
if( deltaX > SWIPE_THRESHOLD && Math.abs( deltaX ) > Math.abs( deltaY ) ) {
this.touchCaptured = true;
if( config.navigationMode === 'linear' ) {
if( config.rtl ) {
this.Reveal.next();
}
else {
this.Reveal.prev();
}
}
else {
this.Reveal.left();
}
}
else if( deltaX < -SWIPE_THRESHOLD && Math.abs( deltaX ) > Math.abs( deltaY ) ) {
this.touchCaptured = true;
if( config.navigationMode === 'linear' ) {
if( config.rtl ) {
this.Reveal.prev();
}
else {
this.Reveal.next();
}
}
else {
this.Reveal.right();
}
}
else if( deltaY > SWIPE_THRESHOLD && availableRoutes.up ) {
this.touchCaptured = true;
if( config.navigationMode === 'linear' ) {
this.Reveal.prev();
}
else {
this.Reveal.up();
}
}
else if( deltaY < -SWIPE_THRESHOLD && availableRoutes.down ) {
this.touchCaptured = true;
if( config.navigationMode === 'linear' ) {
this.Reveal.next();
}
else {
this.Reveal.down();
}
}
// If we're embedded, only block touch events if they have
// triggered an action
if( config.embedded ) {
if( this.touchCaptured || this.Reveal.isVerticalSlide() ) {
event.preventDefault();
}
}
// Not embedded? Block them all to avoid needless tossing
// around of the viewport in iOS
else {
event.preventDefault();
}
}
}
// There's a bug with swiping on some Android devices unless
// the default action is always prevented
else if( isAndroid ) {
event.preventDefault();
}
}
/**
* Handler for the 'touchend' event.
*
* @param {object} event
*/
onTouchEnd( event ) {
this.touchCaptured = false;
}
/**
* Convert pointer down to touch start.
*
* @param {object} event
*/
onPointerDown( event ) {
if( event.pointerType === event.MSPOINTER_TYPE_TOUCH || event.pointerType === "touch" ) {
event.touches = [{ clientX: event.clientX, clientY: event.clientY }];
this.onTouchStart( event );
}
}
/**
* Convert pointer move to touch move.
*
* @param {object} event
*/
onPointerMove( event ) {
if( event.pointerType === event.MSPOINTER_TYPE_TOUCH || event.pointerType === "touch" ) {
event.touches = [{ clientX: event.clientX, clientY: event.clientY }];
this.onTouchMove( event );
}
}
/**
* Convert pointer up to touch end.
*
* @param {object} event
*/
onPointerUp( event ) {
if( event.pointerType === event.MSPOINTER_TYPE_TOUCH || event.pointerType === "touch" ) {
event.touches = [{ clientX: event.clientX, clientY: event.clientY }];
this.onTouchEnd( event );
}
}
}
\ No newline at end of file
import Deck, { VERSION } from './reveal.js'
/**
* Expose the Reveal class to the window. To create a
* new instance:
* let deck = new Reveal( document.querySelector( '.reveal' ), {
* controls: false
* } );
* deck.initialize().then(() => {
* // reveal.js is ready
* });
*/
let Reveal = Deck;
/**
* The below is a thin shell that mimics the pre 4.0
* reveal.js API and ensures backwards compatibility.
* This API only allows for one Reveal instance per
* page, whereas the new API above lets you run many
* presentations on the same page.
*
* Reveal.initialize( { controls: false } ).then(() => {
* // reveal.js is ready
* });
*/
let enqueuedAPICalls = [];
Reveal.initialize = options => {
// Create our singleton reveal.js instance
Object.assign( Reveal, new Deck( document.querySelector( '.reveal' ), options ) );
// Invoke any enqueued API calls
enqueuedAPICalls.map( method => method( Reveal ) );
return Reveal.initialize();
}
/**
* The pre 4.0 API let you add event listener before
* initializing. We maintain the same behavior by
* queuing up premature API calls and invoking all
* of them when Reveal.initialize is called.
*/
[ 'configure', 'on', 'off', 'addEventListener', 'removeEventListener', 'registerPlugin' ].forEach( method => {
Reveal[method] = ( ...args ) => {
enqueuedAPICalls.push( deck => deck[method].call( null, ...args ) );
}
} );
Reveal.isReady = () => false;
Reveal.VERSION = VERSION;
export default Reveal;
\ No newline at end of file
import SlideContent from './controllers/slidecontent.js'
import SlideNumber from './controllers/slidenumber.js'
import Backgrounds from './controllers/backgrounds.js'
import AutoAnimate from './controllers/autoanimate.js'
import Fragments from './controllers/fragments.js'
import Overview from './controllers/overview.js'
import Keyboard from './controllers/keyboard.js'
import Location from './controllers/location.js'
import Controls from './controllers/controls.js'
import Progress from './controllers/progress.js'
import Pointer from './controllers/pointer.js'
import Plugins from './controllers/plugins.js'
import Print from './controllers/print.js'
import Touch from './controllers/touch.js'
import Focus from './controllers/focus.js'
import Notes from './controllers/notes.js'
import Playback from './components/playback.js'
import defaultConfig from './config.js'
import * as Util from './utils/util.js'
import * as Device from './utils/device.js'
import {
SLIDES_SELECTOR,
HORIZONTAL_SLIDES_SELECTOR,
VERTICAL_SLIDES_SELECTOR,
POST_MESSAGE_METHOD_BLACKLIST
} from './utils/constants.js'
// The reveal.js version
export const VERSION = '4.1.0';
/**
* reveal.js
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/
export default function( revealElement, options ) {
// Support initialization with no args, one arg
// [options] or two args [revealElement, options]
if( arguments.length < 2 ) {
options = arguments[0];
revealElement = document.querySelector( '.reveal' );
}
const Reveal = {};
// Configuration defaults, can be overridden at initialization time
let config = {},
// Flags if reveal.js is loaded (has dispatched the 'ready' event)
ready = false,
// The horizontal and vertical index of the currently active slide
indexh,
indexv,
// The previous and current slide HTML elements
previousSlide,
currentSlide,
// Remember which directions that the user has navigated towards
navigationHistory = {
hasNavigatedHorizontally: false,
hasNavigatedVertically: false
},
// Slides may have a data-state attribute which we pick up and apply
// as a class to the body. This list contains the combined state of
// all current slides.
state = [],
// The current scale of the presentation (see width/height config)
scale = 1,
// CSS transform that is currently applied to the slides container,
// split into two groups
slidesTransform = { layout: '', overview: '' },
// Cached references to DOM elements
dom = {},
// Flags if the interaction event listeners are bound
eventsAreBound = false,
// The current slide transition state; idle or running
transition = 'idle',
// The current auto-slide duration
autoSlide = 0,
// Auto slide properties
autoSlidePlayer,
autoSlideTimeout = 0,
autoSlideStartTime = -1,
autoSlidePaused = false,
// Controllers for different aspects of our presentation. They're
// all given direct references to this Reveal instance since there
// may be multiple presentations running in parallel.
slideContent = new SlideContent( Reveal ),
slideNumber = new SlideNumber( Reveal ),
autoAnimate = new AutoAnimate( Reveal ),
backgrounds = new Backgrounds( Reveal ),
fragments = new Fragments( Reveal ),
overview = new Overview( Reveal ),
keyboard = new Keyboard( Reveal ),
location = new Location( Reveal ),
controls = new Controls( Reveal ),
progress = new Progress( Reveal ),
pointer = new Pointer( Reveal ),
plugins = new Plugins( Reveal ),
print = new Print( Reveal ),
focus = new Focus( Reveal ),
touch = new Touch( Reveal ),
notes = new Notes( Reveal );
/**
* Starts up the presentation.
*/
function initialize( initOptions ) {
// Cache references to key DOM elements
dom.wrapper = revealElement;
dom.slides = revealElement.querySelector( '.slides' );
// Compose our config object in order of increasing precedence:
// 1. Default reveal.js options
// 2. Options provided via Reveal.configure() prior to
// initialization
// 3. Options passed to the Reveal constructor
// 4. Options passed to Reveal.initialize
// 5. Query params
config = { ...defaultConfig, ...config, ...options, ...initOptions, ...Util.getQueryHash() };
setViewport();
// Force a layout when the whole page, incl fonts, has loaded
window.addEventListener( 'load', layout, false );
// Register plugins and load dependencies, then move on to #start()
plugins.load( config.plugins, config.dependencies ).then( start );
return new Promise( resolve => Reveal.on( 'ready', resolve ) );
}
/**
* Encase the presentation in a reveal.js viewport. The
* extent of the viewport differs based on configuration.
*/
function setViewport() {
// Embedded decks use the reveal element as their viewport
if( config.embedded === true ) {
dom.viewport = Util.closest( revealElement, '.reveal-viewport' ) || revealElement;
}
// Full-page decks use the body as their viewport
else {
dom.viewport = document.body;
document.documentElement.classList.add( 'reveal-full-page' );
}
dom.viewport.classList.add( 'reveal-viewport' );
}
/**
* Starts up reveal.js by binding input events and navigating
* to the current URL deeplink if there is one.
*/
function start() {
ready = true;
// Remove slides hidden with data-visibility
removeHiddenSlides();
// Make sure we've got all the DOM elements we need
setupDOM();
// Listen to messages posted to this window
setupPostMessage();
// Prevent the slides from being scrolled out of view
setupScrollPrevention();
// Resets all vertical slides so that only the first is visible
resetVerticalSlides();
// Updates the presentation to match the current configuration values
configure();
// Read the initial hash
location.readURL();
// Create slide backgrounds
backgrounds.update( true );
// Notify listeners that the presentation is ready but use a 1ms
// timeout to ensure it's not fired synchronously after #initialize()
setTimeout( () => {
// Enable transitions now that we're loaded
dom.slides.classList.remove( 'no-transition' );
dom.wrapper.classList.add( 'ready' );
dispatchEvent({
type: 'ready',
data: {
indexh,
indexv,
currentSlide
}
});
}, 1 );
// Special setup and config is required when printing to PDF
if( print.isPrintingPDF() ) {
removeEventListeners();
// The document needs to have loaded for the PDF layout
// measurements to be accurate
if( document.readyState === 'complete' ) {
print.setupPDF();
}
else {
window.addEventListener( 'load', () => {
print.setupPDF();
} );
}
}
}
/**
* Removes all slides with data-visibility="hidden". This
* is done right before the rest of the presentation is
* initialized.
*
* If you want to show all hidden slides, initialize
* reveal.js with showHiddenSlides set to true.
*/
function removeHiddenSlides() {
if( !config.showHiddenSlides ) {
Util.queryAll( dom.wrapper, 'section[data-visibility="hidden"]' ).forEach( slide => {
slide.parentNode.removeChild( slide );
} );
}
}
/**
* Finds and stores references to DOM elements which are
* required by the presentation. If a required element is
* not found, it is created.
*/
function setupDOM() {
// Prevent transitions while we're loading
dom.slides.classList.add( 'no-transition' );
if( Device.isMobile ) {
dom.wrapper.classList.add( 'no-hover' );
}
else {
dom.wrapper.classList.remove( 'no-hover' );
}
backgrounds.render();
slideNumber.render();
controls.render();
progress.render();
notes.render();
// Overlay graphic which is displayed during the paused mode
dom.pauseOverlay = Util.createSingletonNode( dom.wrapper, 'div', 'pause-overlay', config.controls ? '<button class="resume-button">Resume presentation</button>' : null );
dom.statusElement = createStatusElement();
dom.wrapper.setAttribute( 'role', 'application' );
}
/**
* Creates a hidden div with role aria-live to announce the
* current slide content. Hide the div off-screen to make it
* available only to Assistive Technologies.
*
* @return {HTMLElement}
*/
function createStatusElement() {
let statusElement = dom.wrapper.querySelector( '.aria-status' );
if( !statusElement ) {
statusElement = document.createElement( 'div' );
statusElement.style.position = 'absolute';
statusElement.style.height = '1px';
statusElement.style.width = '1px';
statusElement.style.overflow = 'hidden';
statusElement.style.clip = 'rect( 1px, 1px, 1px, 1px )';
statusElement.classList.add( 'aria-status' );
statusElement.setAttribute( 'aria-live', 'polite' );
statusElement.setAttribute( 'aria-atomic','true' );
dom.wrapper.appendChild( statusElement );
}
return statusElement;
}
/**
* Announces the given text to screen readers.
*/
function announceStatus( value ) {
dom.statusElement.textContent = value;
}
/**
* Converts the given HTML element into a string of text
* that can be announced to a screen reader. Hidden
* elements are excluded.
*/
function getStatusText( node ) {
let text = '';
// Text node
if( node.nodeType === 3 ) {
text += node.textContent;
}
// Element node
else if( node.nodeType === 1 ) {
let isAriaHidden = node.getAttribute( 'aria-hidden' );
let isDisplayHidden = window.getComputedStyle( node )['display'] === 'none';
if( isAriaHidden !== 'true' && !isDisplayHidden ) {
Array.from( node.childNodes ).forEach( child => {
text += getStatusText( child );
} );
}
}
text = text.trim();
return text === '' ? '' : text + ' ';
}
/**
* This is an unfortunate necessity. Some actions – such as
* an input field being focused in an iframe or using the
* keyboard to expand text selection beyond the bounds of
* a slide – can trigger our content to be pushed out of view.
* This scrolling can not be prevented by hiding overflow in
* CSS (we already do) so we have to resort to repeatedly
* checking if the slides have been offset :(
*/
function setupScrollPrevention() {
setInterval( () => {
if( dom.wrapper.scrollTop !== 0 || dom.wrapper.scrollLeft !== 0 ) {
dom.wrapper.scrollTop = 0;
dom.wrapper.scrollLeft = 0;
}
}, 1000 );
}
/**
* Registers a listener to postMessage events, this makes it
* possible to call all reveal.js API methods from another
* window. For example:
*
* revealWindow.postMessage( JSON.stringify({
* method: 'slide',
* args: [ 2 ]
* }), '*' );
*/
function setupPostMessage() {
if( config.postMessage ) {
window.addEventListener( 'message', event => {
let data = event.data;
// Make sure we're dealing with JSON
if( typeof data === 'string' && data.charAt( 0 ) === '{' && data.charAt( data.length - 1 ) === '}' ) {
data = JSON.parse( data );
// Check if the requested method can be found
if( data.method && typeof Reveal[data.method] === 'function' ) {
if( POST_MESSAGE_METHOD_BLACKLIST.test( data.method ) === false ) {
const result = Reveal[data.method].apply( Reveal, data.args );
// Dispatch a postMessage event with the returned value from
// our method invocation for getter functions
dispatchPostMessage( 'callback', { method: data.method, result: result } );
}
else {
console.warn( 'reveal.js: "'+ data.method +'" is is blacklisted from the postMessage API' );
}
}
}
}, false );
}
}
/**
* Applies the configuration settings from the config
* object. May be called multiple times.
*
* @param {object} options
*/
function configure( options ) {
const oldConfig = { ...config }
// New config options may be passed when this method
// is invoked through the API after initialization
if( typeof options === 'object' ) Util.extend( config, options );
// Abort if reveal.js hasn't finished loading, config
// changes will be applied automatically once ready
if( Reveal.isReady() === false ) return;
const numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length;
// The transition is added as a class on the .reveal element
dom.wrapper.classList.remove( oldConfig.transition );
dom.wrapper.classList.add( config.transition );
dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed );
dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );
// Expose our configured slide dimensions as custom props
dom.viewport.style.setProperty( '--slide-width', config.width + 'px' );
dom.viewport.style.setProperty( '--slide-height', config.height + 'px' );
if( config.shuffle ) {
shuffle();
}
Util.toggleClass( dom.wrapper, 'embedded', config.embedded );
Util.toggleClass( dom.wrapper, 'rtl', config.rtl );
Util.toggleClass( dom.wrapper, 'center', config.center );
// Exit the paused mode if it was configured off
if( config.pause === false ) {
resume();
}
// Iframe link previews
if( config.previewLinks ) {
enablePreviewLinks();
disablePreviewLinks( '[data-preview-link=false]' );
}
else {
disablePreviewLinks();
enablePreviewLinks( '[data-preview-link]:not([data-preview-link=false])' );
}
// Reset all changes made by auto-animations
autoAnimate.reset();
// Remove existing auto-slide controls
if( autoSlidePlayer ) {
autoSlidePlayer.destroy();
autoSlidePlayer = null;
}
// Generate auto-slide controls if needed
if( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable ) {
autoSlidePlayer = new Playback( dom.wrapper, () => {
return Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );
} );
autoSlidePlayer.on( 'click', onAutoSlidePlayerClick );
autoSlidePaused = false;
}
// Add the navigation mode to the DOM so we can adjust styling
if( config.navigationMode !== 'default' ) {
dom.wrapper.setAttribute( 'data-navigation-mode', config.navigationMode );
}
else {
dom.wrapper.removeAttribute( 'data-navigation-mode' );
}
notes.configure( config, oldConfig );
focus.configure( config, oldConfig );
pointer.configure( config, oldConfig );
controls.configure( config, oldConfig );
progress.configure( config, oldConfig );
keyboard.configure( config, oldConfig );
fragments.configure( config, oldConfig );
slideNumber.configure( config, oldConfig );
sync();
}
/**
* Binds all event listeners.
*/
function addEventListeners() {
eventsAreBound = true;
window.addEventListener( 'resize', onWindowResize, false );
if( config.touch ) touch.bind();
if( config.keyboard ) keyboard.bind();
if( config.progress ) progress.bind();
if( config.respondToHashChanges ) location.bind();
controls.bind();
focus.bind();
dom.slides.addEventListener( 'transitionend', onTransitionEnd, false );
dom.pauseOverlay.addEventListener( 'click', resume, false );
if( config.focusBodyOnPageVisibilityChange ) {
document.addEventListener( 'visibilitychange', onPageVisibilityChange, false );
}
}
/**
* Unbinds all event listeners.
*/
function removeEventListeners() {
eventsAreBound = false;
touch.unbind();
focus.unbind();
keyboard.unbind();
controls.unbind();
progress.unbind();
location.unbind();
window.removeEventListener( 'resize', onWindowResize, false );
dom.slides.removeEventListener( 'transitionend', onTransitionEnd, false );
dom.pauseOverlay.removeEventListener( 'click', resume, false );
}
/**
* Adds a listener to one of our custom reveal.js events,
* like slidechanged.
*/
function on( type, listener, useCapture ) {
revealElement.addEventListener( type, listener, useCapture );
}
/**
* Unsubscribes from a reveal.js event.
*/
function off( type, listener, useCapture ) {
revealElement.removeEventListener( type, listener, useCapture );
}
/**
* Applies CSS transforms to the slides container. The container
* is transformed from two separate sources: layout and the overview
* mode.
*
* @param {object} transforms
*/
function transformSlides( transforms ) {
// Pick up new transforms from arguments
if( typeof transforms.layout === 'string' ) slidesTransform.layout = transforms.layout;
if( typeof transforms.overview === 'string' ) slidesTransform.overview = transforms.overview;
// Apply the transforms to the slides container
if( slidesTransform.layout ) {
Util.transformElement( dom.slides, slidesTransform.layout + ' ' + slidesTransform.overview );
}
else {
Util.transformElement( dom.slides, slidesTransform.overview );
}
}
/**
* Dispatches an event of the specified type from the
* reveal DOM element.
*/
function dispatchEvent({ target=dom.wrapper, type, data, bubbles=true }) {
let event = document.createEvent( 'HTMLEvents', 1, 2 );
event.initEvent( type, bubbles, true );
Util.extend( event, data );
target.dispatchEvent( event );
if( target === dom.wrapper ) {
// If we're in an iframe, post each reveal.js event to the
// parent window. Used by the notes plugin
dispatchPostMessage( type );
}
}
/**
* Dispatched a postMessage of the given type from our window.
*/
function dispatchPostMessage( type, data ) {
if( config.postMessageEvents && window.parent !== window.self ) {
let message = {
namespace: 'reveal',
eventName: type,
state: getState()
};
Util.extend( message, data );
window.parent.postMessage( JSON.stringify( message ), '*' );
}
}
/**
* Bind preview frame links.
*
* @param {string} [selector=a] - selector for anchors
*/
function enablePreviewLinks( selector = 'a' ) {
Array.from( dom.wrapper.querySelectorAll( selector ) ).forEach( element => {
if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {
element.addEventListener( 'click', onPreviewLinkClicked, false );
}
} );
}
/**
* Unbind preview frame links.
*/
function disablePreviewLinks( selector = 'a' ) {
Array.from( dom.wrapper.querySelectorAll( selector ) ).forEach( element => {
if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) {
element.removeEventListener( 'click', onPreviewLinkClicked, false );
}
} );
}
/**
* Opens a preview window for the target URL.
*
* @param {string} url - url for preview iframe src
*/
function showPreview( url ) {
closeOverlay();
dom.overlay = document.createElement( 'div' );
dom.overlay.classList.add( 'overlay' );
dom.overlay.classList.add( 'overlay-preview' );
dom.wrapper.appendChild( dom.overlay );
dom.overlay.innerHTML =
`<header>
<a class="close" href="#"><span class="icon"></span></a>
<a class="external" href="${url}" target="_blank"><span class="icon"></span></a>
</header>
<div class="spinner"></div>
<div class="viewport">
<iframe src="${url}"></iframe>
<small class="viewport-inner">
<span class="x-frame-error">Unable to load iframe. This is likely due to the site's policy (x-frame-options).</span>
</small>
</div>`;
dom.overlay.querySelector( 'iframe' ).addEventListener( 'load', event => {
dom.overlay.classList.add( 'loaded' );
}, false );
dom.overlay.querySelector( '.close' ).addEventListener( 'click', event => {
closeOverlay();
event.preventDefault();
}, false );
dom.overlay.querySelector( '.external' ).addEventListener( 'click', event => {
closeOverlay();
}, false );
}
/**
* Open or close help overlay window.
*
* @param {Boolean} [override] Flag which overrides the
* toggle logic and forcibly sets the desired state. True means
* help is open, false means it's closed.
*/
function toggleHelp( override ){
if( typeof override === 'boolean' ) {
override ? showHelp() : closeOverlay();
}
else {
if( dom.overlay ) {
closeOverlay();
}
else {
showHelp();
}
}
}
/**
* Opens an overlay window with help material.
*/
function showHelp() {
if( config.help ) {
closeOverlay();
dom.overlay = document.createElement( 'div' );
dom.overlay.classList.add( 'overlay' );
dom.overlay.classList.add( 'overlay-help' );
dom.wrapper.appendChild( dom.overlay );
let html = '<p class="title">Keyboard Shortcuts</p><br/>';
let shortcuts = keyboard.getShortcuts(),
bindings = keyboard.getBindings();
html += '<table><th>KEY</th><th>ACTION</th>';
for( let key in shortcuts ) {
html += `<tr><td>${key}</td><td>${shortcuts[ key ]}</td></tr>`;
}
// Add custom key bindings that have associated descriptions
for( let binding in bindings ) {
if( bindings[binding].key && bindings[binding].description ) {
html += `<tr><td>${bindings[binding].key}</td><td>${bindings[binding].description}</td></tr>`;
}
}
html += '</table>';
dom.overlay.innerHTML = `
<header>
<a class="close" href="#"><span class="icon"></span></a>
</header>
<div class="viewport">
<div class="viewport-inner">${html}</div>
</div>
`;
dom.overlay.querySelector( '.close' ).addEventListener( 'click', event => {
closeOverlay();
event.preventDefault();
}, false );
}
}
/**
* Closes any currently open overlay.
*/
function closeOverlay() {
if( dom.overlay ) {
dom.overlay.parentNode.removeChild( dom.overlay );
dom.overlay = null;
return true;
}
return false;
}
/**
* Applies JavaScript-controlled layout rules to the
* presentation.
*/
function layout() {
if( dom.wrapper && !print.isPrintingPDF() ) {
if( !config.disableLayout ) {
// On some mobile devices '100vh' is taller than the visible
// viewport which leads to part of the presentation being
// cut off. To work around this we define our own '--vh' custom
// property where 100x adds up to the correct height.
//
// https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
if( Device.isMobile && !config.embedded ) {
document.documentElement.style.setProperty( '--vh', ( window.innerHeight * 0.01 ) + 'px' );
}
const size = getComputedSlideSize();
const oldScale = scale;
// Layout the contents of the slides
layoutSlideContents( config.width, config.height );
dom.slides.style.width = size.width + 'px';
dom.slides.style.height = size.height + 'px';
// Determine scale of content to fit within available space
scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height );
// Respect max/min scale settings
scale = Math.max( scale, config.minScale );
scale = Math.min( scale, config.maxScale );
// Don't apply any scaling styles if scale is 1
if( scale === 1 ) {
dom.slides.style.zoom = '';
dom.slides.style.left = '';
dom.slides.style.top = '';
dom.slides.style.bottom = '';
dom.slides.style.right = '';
transformSlides( { layout: '' } );
}
else {
// Zoom Scaling
// Content remains crisp no matter how much we scale. Side
// effects are minor differences in text layout and iframe
// viewports changing size. A 200x200 iframe viewport in a
// 2x zoomed presentation ends up having a 400x400 viewport.
if( scale > 1 && Device.supportsZoom && window.devicePixelRatio < 2 ) {
dom.slides.style.zoom = scale;
dom.slides.style.left = '';
dom.slides.style.top = '';
dom.slides.style.bottom = '';
dom.slides.style.right = '';
transformSlides( { layout: '' } );
}
// Transform Scaling
// Content layout remains the exact same when scaled up.
// Side effect is content becoming blurred, especially with
// high scale values on ldpi screens.
else {
dom.slides.style.zoom = '';
dom.slides.style.left = '50%';
dom.slides.style.top = '50%';
dom.slides.style.bottom = 'auto';
dom.slides.style.right = 'auto';
transformSlides( { layout: 'translate(-50%, -50%) scale('+ scale +')' } );
}
}
// Select all slides, vertical and horizontal
const slides = Array.from( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) );
for( let i = 0, len = slides.length; i < len; i++ ) {
const slide = slides[ i ];
// Don't bother updating invisible slides
if( slide.style.display === 'none' ) {
continue;
}
if( config.center || slide.classList.contains( 'center' ) ) {
// Vertical stacks are not centred since their section
// children will be
if( slide.classList.contains( 'stack' ) ) {
slide.style.top = 0;
}
else {
slide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px';
}
}
else {
slide.style.top = '';
}
}
if( oldScale !== scale ) {
dispatchEvent({
type: 'resize',
data: {
oldScale,
scale,
size
}
});
}
}
progress.update();
backgrounds.updateParallax();
if( overview.isActive() ) {
overview.update();
}
}
}
/**
* Applies layout logic to the contents of all slides in
* the presentation.
*
* @param {string|number} width
* @param {string|number} height
*/
function layoutSlideContents( width, height ) {
// Handle sizing of elements with the 'r-stretch' class
Util.queryAll( dom.slides, 'section > .stretch, section > .r-stretch' ).forEach( element => {
// Determine how much vertical space we can use
let remainingHeight = Util.getRemainingHeight( element, height );
// Consider the aspect ratio of media elements
if( /(img|video)/gi.test( element.nodeName ) ) {
const nw = element.naturalWidth || element.videoWidth,
nh = element.naturalHeight || element.videoHeight;
const es = Math.min( width / nw, remainingHeight / nh );
element.style.width = ( nw * es ) + 'px';
element.style.height = ( nh * es ) + 'px';
}
else {
element.style.width = width + 'px';
element.style.height = remainingHeight + 'px';
}
} );
}
/**
* Calculates the computed pixel size of our slides. These
* values are based on the width and height configuration
* options.
*
* @param {number} [presentationWidth=dom.wrapper.offsetWidth]
* @param {number} [presentationHeight=dom.wrapper.offsetHeight]
*/
function getComputedSlideSize( presentationWidth, presentationHeight ) {
const size = {
// Slide size
width: config.width,
height: config.height,
// Presentation size
presentationWidth: presentationWidth || dom.wrapper.offsetWidth,
presentationHeight: presentationHeight || dom.wrapper.offsetHeight
};
// Reduce available space by margin
size.presentationWidth -= ( size.presentationWidth * config.margin );
size.presentationHeight -= ( size.presentationHeight * config.margin );
// Slide width may be a percentage of available width
if( typeof size.width === 'string' && /%$/.test( size.width ) ) {
size.width = parseInt( size.width, 10 ) / 100 * size.presentationWidth;
}
// Slide height may be a percentage of available height
if( typeof size.height === 'string' && /%$/.test( size.height ) ) {
size.height = parseInt( size.height, 10 ) / 100 * size.presentationHeight;
}
return size;
}
/**
* Stores the vertical index of a stack so that the same
* vertical slide can be selected when navigating to and
* from the stack.
*
* @param {HTMLElement} stack The vertical stack element
* @param {string|number} [v=0] Index to memorize
*/
function setPreviousVerticalIndex( stack, v ) {
if( typeof stack === 'object' && typeof stack.setAttribute === 'function' ) {
stack.setAttribute( 'data-previous-indexv', v || 0 );
}
}
/**
* Retrieves the vertical index which was stored using
* #setPreviousVerticalIndex() or 0 if no previous index
* exists.
*
* @param {HTMLElement} stack The vertical stack element
*/
function getPreviousVerticalIndex( stack ) {
if( typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains( 'stack' ) ) {
// Prefer manually defined start-indexv
const attributeName = stack.hasAttribute( 'data-start-indexv' ) ? 'data-start-indexv' : 'data-previous-indexv';
return parseInt( stack.getAttribute( attributeName ) || 0, 10 );
}
return 0;
}
/**
* Checks if the current or specified slide is vertical
* (nested within another slide).
*
* @param {HTMLElement} [slide=currentSlide] The slide to check
* orientation of
* @return {Boolean}
*/
function isVerticalSlide( slide = currentSlide ) {
return slide && slide.parentNode && !!slide.parentNode.nodeName.match( /section/i );
}
/**
* Returns true if we're on the last slide in the current
* vertical stack.
*/
function isLastVerticalSlide() {
if( currentSlide && isVerticalSlide( currentSlide ) ) {
// Does this slide have a next sibling?
if( currentSlide.nextElementSibling ) return false;
return true;
}
return false;
}
/**
* Returns true if we're currently on the first slide in
* the presentation.
*/
function isFirstSlide() {
return indexh === 0 && indexv === 0;
}
/**
* Returns true if we're currently on the last slide in
* the presenation. If the last slide is a stack, we only
* consider this the last slide if it's at the end of the
* stack.
*/
function isLastSlide() {
if( currentSlide ) {
// Does this slide have a next sibling?
if( currentSlide.nextElementSibling ) return false;
// If it's vertical, does its parent have a next sibling?
if( isVerticalSlide( currentSlide ) && currentSlide.parentNode.nextElementSibling ) return false;
return true;
}
return false;
}
/**
* Enters the paused mode which fades everything on screen to
* black.
*/
function pause() {
if( config.pause ) {
const wasPaused = dom.wrapper.classList.contains( 'paused' );
cancelAutoSlide();
dom.wrapper.classList.add( 'paused' );
if( wasPaused === false ) {
dispatchEvent({ type: 'paused' });
}
}
}
/**
* Exits from the paused mode.
*/
function resume() {
const wasPaused = dom.wrapper.classList.contains( 'paused' );
dom.wrapper.classList.remove( 'paused' );
cueAutoSlide();
if( wasPaused ) {
dispatchEvent({ type: 'resumed' });
}
}
/**
* Toggles the paused mode on and off.
*/
function togglePause( override ) {
if( typeof override === 'boolean' ) {
override ? pause() : resume();
}
else {
isPaused() ? resume() : pause();
}
}
/**
* Checks if we are currently in the paused mode.
*
* @return {Boolean}
*/
function isPaused() {
return dom.wrapper.classList.contains( 'paused' );
}
/**
* Toggles the auto slide mode on and off.
*
* @param {Boolean} [override] Flag which sets the desired state.
* True means autoplay starts, false means it stops.
*/
function toggleAutoSlide( override ) {
if( typeof override === 'boolean' ) {
override ? resumeAutoSlide() : pauseAutoSlide();
}
else {
autoSlidePaused ? resumeAutoSlide() : pauseAutoSlide();
}
}
/**
* Checks if the auto slide mode is currently on.
*
* @return {Boolean}
*/
function isAutoSliding() {
return !!( autoSlide && !autoSlidePaused );
}
/**
* Steps from the current point in the presentation to the
* slide which matches the specified horizontal and vertical
* indices.
*
* @param {number} [h=indexh] Horizontal index of the target slide
* @param {number} [v=indexv] Vertical index of the target slide
* @param {number} [f] Index of a fragment within the
* target slide to activate
* @param {number} [o] Origin for use in multimaster environments
*/
function slide( h, v, f, o ) {
// Remember where we were at before
previousSlide = currentSlide;
// Query all horizontal slides in the deck
const horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR );
// Abort if there are no slides
if( horizontalSlides.length === 0 ) return;
// If no vertical index is specified and the upcoming slide is a
// stack, resume at its previous vertical index
if( v === undefined && !overview.isActive() ) {
v = getPreviousVerticalIndex( horizontalSlides[ h ] );
}
// If we were on a vertical stack, remember what vertical index
// it was on so we can resume at the same position when returning
if( previousSlide && previousSlide.parentNode && previousSlide.parentNode.classList.contains( 'stack' ) ) {
setPreviousVerticalIndex( previousSlide.parentNode, indexv );
}
// Remember the state before this slide
const stateBefore = state.concat();
// Reset the state array
state.length = 0;
let indexhBefore = indexh || 0,
indexvBefore = indexv || 0;
// Activate and transition to the new slide
indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h );
indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v );
// Dispatch an event if the slide changed
let slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore );
// Ensure that the previous slide is never the same as the current
if( !slideChanged ) previousSlide = null;
// Find the current horizontal slide and any possible vertical slides
// within it
let currentHorizontalSlide = horizontalSlides[ indexh ],
currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' );
// Store references to the previous and current slides
currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide;
let autoAnimateTransition = false;
// Detect if we're moving between two auto-animated slides
if( slideChanged && previousSlide && currentSlide && !overview.isActive() ) {
// If this is an auto-animated transition, we disable the
// regular slide transition
//
// Note 20-03-2020:
// This needs to happen before we update slide visibility,
// otherwise transitions will still run in Safari.
if( previousSlide.hasAttribute( 'data-auto-animate' ) && currentSlide.hasAttribute( 'data-auto-animate' ) ) {
autoAnimateTransition = true;
dom.slides.classList.add( 'disable-slide-transitions' );
}
transition = 'running';
}
// Update the visibility of slides now that the indices have changed
updateSlidesVisibility();
layout();
// Update the overview if it's currently active
if( overview.isActive() ) {
overview.update();
}
// Show fragment, if specified
if( typeof f !== 'undefined' ) {
fragments.goto( f );
}
// Solves an edge case where the previous slide maintains the
// 'present' class when navigating between adjacent vertical
// stacks
if( previousSlide && previousSlide !== currentSlide ) {
previousSlide.classList.remove( 'present' );
previousSlide.setAttribute( 'aria-hidden', 'true' );
// Reset all slides upon navigate to home
if( isFirstSlide() ) {
// Launch async task
setTimeout( () => {
getVerticalStacks().forEach( slide => {
setPreviousVerticalIndex( slide, 0 );
} );
}, 0 );
}
}
// Apply the new state
stateLoop: for( let i = 0, len = state.length; i < len; i++ ) {
// Check if this state existed on the previous slide. If it
// did, we will avoid adding it repeatedly
for( let j = 0; j < stateBefore.length; j++ ) {
if( stateBefore[j] === state[i] ) {
stateBefore.splice( j, 1 );
continue stateLoop;
}
}
dom.viewport.classList.add( state[i] );
// Dispatch custom event matching the state's name
dispatchEvent({ type: state[i] });
}
// Clean up the remains of the previous state
while( stateBefore.length ) {
dom.viewport.classList.remove( stateBefore.pop() );
}
if( slideChanged ) {
dispatchEvent({
type: 'slidechanged',
data: {
indexh,
indexv,
previousSlide,
currentSlide,
origin: o
}
});
}
// Handle embedded content
if( slideChanged || !previousSlide ) {
slideContent.stopEmbeddedContent( previousSlide );
slideContent.startEmbeddedContent( currentSlide );
}
// Announce the current slide contents to screen readers
announceStatus( getStatusText( currentSlide ) );
progress.update();
controls.update();
notes.update();
backgrounds.update();
backgrounds.updateParallax();
slideNumber.update();
fragments.update();
// Update the URL hash
location.writeURL();
cueAutoSlide();
// Auto-animation
if( autoAnimateTransition ) {
setTimeout( () => {
dom.slides.classList.remove( 'disable-slide-transitions' );
}, 0 );
if( config.autoAnimate ) {
// Run the auto-animation between our slides
autoAnimate.run( previousSlide, currentSlide );
}
}
}
/**
* Syncs the presentation with the current DOM. Useful
* when new slides or control elements are added or when
* the configuration has changed.
*/
function sync() {
// Subscribe to input
removeEventListeners();
addEventListeners();
// Force a layout to make sure the current config is accounted for
layout();
// Reflect the current autoSlide value
autoSlide = config.autoSlide;
// Start auto-sliding if it's enabled
cueAutoSlide();
// Re-create all slide backgrounds
backgrounds.create();
// Write the current hash to the URL
location.writeURL();
fragments.sortAll();
controls.update();
progress.update();
updateSlidesVisibility();
notes.update();
notes.updateVisibility();
backgrounds.update( true );
slideNumber.update();
slideContent.formatEmbeddedContent();
// Start or stop embedded content depending on global config
if( config.autoPlayMedia === false ) {
slideContent.stopEmbeddedContent( currentSlide, { unloadIframes: false } );
}
else {
slideContent.startEmbeddedContent( currentSlide );
}
if( overview.isActive() ) {
overview.layout();
}
}
/**
* Updates reveal.js to keep in sync with new slide attributes. For
* example, if you add a new `data-background-image` you can call
* this to have reveal.js render the new background image.
*
* Similar to #sync() but more efficient when you only need to
* refresh a specific slide.
*
* @param {HTMLElement} slide
*/
function syncSlide( slide = currentSlide ) {
backgrounds.sync( slide );
fragments.sync( slide );
slideContent.load( slide );
backgrounds.update();
notes.update();
}
/**
* Resets all vertical slides so that only the first
* is visible.
*/
function resetVerticalSlides() {
getHorizontalSlides().forEach( horizontalSlide => {
Util.queryAll( horizontalSlide, 'section' ).forEach( ( verticalSlide, y ) => {
if( y > 0 ) {
verticalSlide.classList.remove( 'present' );
verticalSlide.classList.remove( 'past' );
verticalSlide.classList.add( 'future' );
verticalSlide.setAttribute( 'aria-hidden', 'true' );
}
} );
} );
}
/**
* Randomly shuffles all slides in the deck.
*/
function shuffle( slides = getHorizontalSlides() ) {
slides.forEach( ( slide, i ) => {
// Insert the slide next to a randomly picked sibling slide
// slide. This may cause the slide to insert before itself,
// but that's not an issue.
let beforeSlide = slides[ Math.floor( Math.random() * slides.length ) ];
if( beforeSlide.parentNode === slide.parentNode ) {
slide.parentNode.insertBefore( slide, beforeSlide );
}
// Randomize the order of vertical slides (if there are any)
let verticalSlides = slide.querySelectorAll( 'section' );
if( verticalSlides.length ) {
shuffle( verticalSlides );
}
} );
}
/**
* Updates one dimension of slides by showing the slide
* with the specified index.
*
* @param {string} selector A CSS selector that will fetch
* the group of slides we are working with
* @param {number} index The index of the slide that should be
* shown
*
* @return {number} The index of the slide that is now shown,
* might differ from the passed in index if it was out of
* bounds.
*/
function updateSlides( selector, index ) {
// Select all slides and convert the NodeList result to
// an array
let slides = Util.queryAll( dom.wrapper, selector ),
slidesLength = slides.length;
let printMode = print.isPrintingPDF();
if( slidesLength ) {
// Should the index loop?
if( config.loop ) {
index %= slidesLength;
if( index < 0 ) {
index = slidesLength + index;
}
}
// Enforce max and minimum index bounds
index = Math.max( Math.min( index, slidesLength - 1 ), 0 );
for( let i = 0; i < slidesLength; i++ ) {
let element = slides[i];
let reverse = config.rtl && !isVerticalSlide( element );
// Avoid .remove() with multiple args for IE11 support
element.classList.remove( 'past' );
element.classList.remove( 'present' );
element.classList.remove( 'future' );
// http://www.w3.org/html/wg/drafts/html/master/editing.html#the-hidden-attribute
element.setAttribute( 'hidden', '' );
element.setAttribute( 'aria-hidden', 'true' );
// If this element contains vertical slides
if( element.querySelector( 'section' ) ) {
element.classList.add( 'stack' );
}
// If we're printing static slides, all slides are "present"
if( printMode ) {
element.classList.add( 'present' );
continue;
}
if( i < index ) {
// Any element previous to index is given the 'past' class
element.classList.add( reverse ? 'future' : 'past' );
if( config.fragments ) {
// Show all fragments in prior slides
Util.queryAll( element, '.fragment' ).forEach( fragment => {
fragment.classList.add( 'visible' );
fragment.classList.remove( 'current-fragment' );
} );
}
}
else if( i > index ) {
// Any element subsequent to index is given the 'future' class
element.classList.add( reverse ? 'past' : 'future' );
if( config.fragments ) {
// Hide all fragments in future slides
Util.queryAll( element, '.fragment.visible' ).forEach( fragment => {
fragment.classList.remove( 'visible', 'current-fragment' );
} );
}
}
}
let slide = slides[index];
let wasPresent = slide.classList.contains( 'present' );
// Mark the current slide as present
slide.classList.add( 'present' );
slide.removeAttribute( 'hidden' );
slide.removeAttribute( 'aria-hidden' );
if( !wasPresent ) {
// Dispatch an event indicating the slide is now visible
dispatchEvent({
target: slide,
type: 'visible',
bubbles: false
});
}
// If this slide has a state associated with it, add it
// onto the current state of the deck
let slideState = slide.getAttribute( 'data-state' );
if( slideState ) {
state = state.concat( slideState.split( ' ' ) );
}
}
else {
// Since there are no slides we can't be anywhere beyond the
// zeroth index
index = 0;
}
return index;
}
/**
* Optimization method; hide all slides that are far away
* from the present slide.
*/
function updateSlidesVisibility() {
// Select all slides and convert the NodeList result to
// an array
let horizontalSlides = getHorizontalSlides(),
horizontalSlidesLength = horizontalSlides.length,
distanceX,
distanceY;
if( horizontalSlidesLength && typeof indexh !== 'undefined' ) {
// The number of steps away from the present slide that will
// be visible
let viewDistance = overview.isActive() ? 10 : config.viewDistance;
// Shorten the view distance on devices that typically have
// less resources
if( Device.isMobile ) {
viewDistance = overview.isActive() ? 6 : config.mobileViewDistance;
}
// All slides need to be visible when exporting to PDF
if( print.isPrintingPDF() ) {
viewDistance = Number.MAX_VALUE;
}
for( let x = 0; x < horizontalSlidesLength; x++ ) {
let horizontalSlide = horizontalSlides[x];
let verticalSlides = Util.queryAll( horizontalSlide, 'section' ),
verticalSlidesLength = verticalSlides.length;
// Determine how far away this slide is from the present
distanceX = Math.abs( ( indexh || 0 ) - x ) || 0;
// If the presentation is looped, distance should measure
// 1 between the first and last slides
if( config.loop ) {
distanceX = Math.abs( ( ( indexh || 0 ) - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0;
}
// Show the horizontal slide if it's within the view distance
if( distanceX < viewDistance ) {
slideContent.load( horizontalSlide );
}
else {
slideContent.unload( horizontalSlide );
}
if( verticalSlidesLength ) {
let oy = getPreviousVerticalIndex( horizontalSlide );
for( let y = 0; y < verticalSlidesLength; y++ ) {
let verticalSlide = verticalSlides[y];
distanceY = x === ( indexh || 0 ) ? Math.abs( ( indexv || 0 ) - y ) : Math.abs( y - oy );
if( distanceX + distanceY < viewDistance ) {
slideContent.load( verticalSlide );
}
else {
slideContent.unload( verticalSlide );
}
}
}
}
// Flag if there are ANY vertical slides, anywhere in the deck
if( hasVerticalSlides() ) {
dom.wrapper.classList.add( 'has-vertical-slides' );
}
else {
dom.wrapper.classList.remove( 'has-vertical-slides' );
}
// Flag if there are ANY horizontal slides, anywhere in the deck
if( hasHorizontalSlides() ) {
dom.wrapper.classList.add( 'has-horizontal-slides' );
}
else {
dom.wrapper.classList.remove( 'has-horizontal-slides' );
}
}
}
/**
* Determine what available routes there are for navigation.
*
* @return {{left: boolean, right: boolean, up: boolean, down: boolean}}
*/
function availableRoutes({ includeFragments = false } = {}) {
let horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ),
verticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR );
let routes = {
left: indexh > 0,
right: indexh < horizontalSlides.length - 1,
up: indexv > 0,
down: indexv < verticalSlides.length - 1
};
// Looped presentations can always be navigated as long as
// there are slides available
if( config.loop ) {
if( horizontalSlides.length > 1 ) {
routes.left = true;
routes.right = true;
}
if( verticalSlides.length > 1 ) {
routes.up = true;
routes.down = true;
}
}
if ( horizontalSlides.length > 1 && config.navigationMode === 'linear' ) {
routes.right = routes.right || routes.down;
routes.left = routes.left || routes.up;
}
// If includeFragments is set, a route will be considered
// availalbe if either a slid OR fragment is available in
// the given direction
if( includeFragments === true ) {
let fragmentRoutes = fragments.availableRoutes();
routes.left = routes.left || fragmentRoutes.prev;
routes.up = routes.up || fragmentRoutes.prev;
routes.down = routes.down || fragmentRoutes.next;
routes.right = routes.right || fragmentRoutes.next;
}
// Reverse horizontal controls for rtl
if( config.rtl ) {
let left = routes.left;
routes.left = routes.right;
routes.right = left;
}
return routes;
}
/**
* Returns the number of past slides. This can be used as a global
* flattened index for slides.
*
* @param {HTMLElement} [slide=currentSlide] The slide we're counting before
*
* @return {number} Past slide count
*/
function getSlidePastCount( slide = currentSlide ) {
let horizontalSlides = getHorizontalSlides();
// The number of past slides
let pastCount = 0;
// Step through all slides and count the past ones
mainLoop: for( let i = 0; i < horizontalSlides.length; i++ ) {
let horizontalSlide = horizontalSlides[i];
let verticalSlides = horizontalSlide.querySelectorAll( 'section' );
for( let j = 0; j < verticalSlides.length; j++ ) {
// Stop as soon as we arrive at the present
if( verticalSlides[j] === slide ) {
break mainLoop;
}
// Don't count slides with the "uncounted" class
if( verticalSlides[j].dataset.visibility !== 'uncounted' ) {
pastCount++;
}
}
// Stop as soon as we arrive at the present
if( horizontalSlide === slide ) {
break;
}
// Don't count the wrapping section for vertical slides and
// slides marked as uncounted
if( horizontalSlide.classList.contains( 'stack' ) === false && horizontalSlide.dataset.visibility !== 'uncounted' ) {
pastCount++;
}
}
return pastCount;
}
/**
* Returns a value ranging from 0-1 that represents
* how far into the presentation we have navigated.
*
* @return {number}
*/
function getProgress() {
// The number of past and total slides
let totalCount = getTotalSlides();
let pastCount = getSlidePastCount();
if( currentSlide ) {
let allFragments = currentSlide.querySelectorAll( '.fragment' );
// If there are fragments in the current slide those should be
// accounted for in the progress.
if( allFragments.length > 0 ) {
let visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' );
// This value represents how big a portion of the slide progress
// that is made up by its fragments (0-1)
let fragmentWeight = 0.9;
// Add fragment progress to the past slide count
pastCount += ( visibleFragments.length / allFragments.length ) * fragmentWeight;
}
}
return Math.min( pastCount / ( totalCount - 1 ), 1 );
}
/**
* Retrieves the h/v location and fragment of the current,
* or specified, slide.
*
* @param {HTMLElement} [slide] If specified, the returned
* index will be for this slide rather than the currently
* active one
*
* @return {{h: number, v: number, f: number}}
*/
function getIndices( slide ) {
// By default, return the current indices
let h = indexh,
v = indexv,
f;
// If a slide is specified, return the indices of that slide
if( slide ) {
let isVertical = isVerticalSlide( slide );
let slideh = isVertical ? slide.parentNode : slide;
// Select all horizontal slides
let horizontalSlides = getHorizontalSlides();
// Now that we know which the horizontal slide is, get its index
h = Math.max( horizontalSlides.indexOf( slideh ), 0 );
// Assume we're not vertical
v = undefined;
// If this is a vertical slide, grab the vertical index
if( isVertical ) {
v = Math.max( Util.queryAll( slide.parentNode, 'section' ).indexOf( slide ), 0 );
}
}
if( !slide && currentSlide ) {
let hasFragments = currentSlide.querySelectorAll( '.fragment' ).length > 0;
if( hasFragments ) {
let currentFragment = currentSlide.querySelector( '.current-fragment' );
if( currentFragment && currentFragment.hasAttribute( 'data-fragment-index' ) ) {
f = parseInt( currentFragment.getAttribute( 'data-fragment-index' ), 10 );
}
else {
f = currentSlide.querySelectorAll( '.fragment.visible' ).length - 1;
}
}
}
return { h, v, f };
}
/**
* Retrieves all slides in this presentation.
*/
function getSlides() {
return Util.queryAll( dom.wrapper, SLIDES_SELECTOR + ':not(.stack):not([data-visibility="uncounted"])' );
}
/**
* Returns a list of all horizontal slides in the deck. Each
* vertical stack is included as one horizontal slide in the
* resulting array.
*/
function getHorizontalSlides() {
return Util.queryAll( dom.wrapper, HORIZONTAL_SLIDES_SELECTOR );
}
/**
* Returns all vertical slides that exist within this deck.
*/
function getVerticalSlides() {
return Util.queryAll( dom.wrapper, '.slides>section>section' );
}
/**
* Returns all vertical stacks (each stack can contain multiple slides).
*/
function getVerticalStacks() {
return Util.queryAll( dom.wrapper, HORIZONTAL_SLIDES_SELECTOR + '.stack');
}
/**
* Returns true if there are at least two horizontal slides.
*/
function hasHorizontalSlides() {
return getHorizontalSlides().length > 1;
}
/**
* Returns true if there are at least two vertical slides.
*/
function hasVerticalSlides() {
return getVerticalSlides().length > 1;
}
/**
* Returns an array of objects where each object represents the
* attributes on its respective slide.
*/
function getSlidesAttributes() {
return getSlides().map( slide => {
let attributes = {};
for( let i = 0; i < slide.attributes.length; i++ ) {
let attribute = slide.attributes[ i ];
attributes[ attribute.name ] = attribute.value;
}
return attributes;
} );
}
/**
* Retrieves the total number of slides in this presentation.
*
* @return {number}
*/
function getTotalSlides() {
return getSlides().length;
}
/**
* Returns the slide element matching the specified index.
*
* @return {HTMLElement}
*/
function getSlide( x, y ) {
let horizontalSlide = getHorizontalSlides()[ x ];
let verticalSlides = horizontalSlide && horizontalSlide.querySelectorAll( 'section' );
if( verticalSlides && verticalSlides.length && typeof y === 'number' ) {
return verticalSlides ? verticalSlides[ y ] : undefined;
}
return horizontalSlide;
}
/**
* Returns the background element for the given slide.
* All slides, even the ones with no background properties
* defined, have a background element so as long as the
* index is valid an element will be returned.
*
* @param {mixed} x Horizontal background index OR a slide
* HTML element
* @param {number} y Vertical background index
* @return {(HTMLElement[]|*)}
*/
function getSlideBackground( x, y ) {
let slide = typeof x === 'number' ? getSlide( x, y ) : x;
if( slide ) {
return slide.slideBackgroundElement;
}
return undefined;
}
/**
* Retrieves the current state of the presentation as
* an object. This state can then be restored at any
* time.
*
* @return {{indexh: number, indexv: number, indexf: number, paused: boolean, overview: boolean}}
*/
function getState() {
let indices = getIndices();
return {
indexh: indices.h,
indexv: indices.v,
indexf: indices.f,
paused: isPaused(),
overview: overview.isActive()
};
}
/**
* Restores the presentation to the given state.
*
* @param {object} state As generated by getState()
* @see {@link getState} generates the parameter `state`
*/
function setState( state ) {
if( typeof state === 'object' ) {
slide( Util.deserialize( state.indexh ), Util.deserialize( state.indexv ), Util.deserialize( state.indexf ) );
let pausedFlag = Util.deserialize( state.paused ),
overviewFlag = Util.deserialize( state.overview );
if( typeof pausedFlag === 'boolean' && pausedFlag !== isPaused() ) {
togglePause( pausedFlag );
}
if( typeof overviewFlag === 'boolean' && overviewFlag !== overview.isActive() ) {
overview.toggle( overviewFlag );
}
}
}
/**
* Cues a new automated slide if enabled in the config.
*/
function cueAutoSlide() {
cancelAutoSlide();
if( currentSlide && config.autoSlide !== false ) {
let fragment = currentSlide.querySelector( '.current-fragment' );
// When the slide first appears there is no "current" fragment so
// we look for a data-autoslide timing on the first fragment
if( !fragment ) fragment = currentSlide.querySelector( '.fragment' );
let fragmentAutoSlide = fragment ? fragment.getAttribute( 'data-autoslide' ) : null;
let parentAutoSlide = currentSlide.parentNode ? currentSlide.parentNode.getAttribute( 'data-autoslide' ) : null;
let slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' );
// Pick value in the following priority order:
// 1. Current fragment's data-autoslide
// 2. Current slide's data-autoslide
// 3. Parent slide's data-autoslide
// 4. Global autoSlide setting
if( fragmentAutoSlide ) {
autoSlide = parseInt( fragmentAutoSlide, 10 );
}
else if( slideAutoSlide ) {
autoSlide = parseInt( slideAutoSlide, 10 );
}
else if( parentAutoSlide ) {
autoSlide = parseInt( parentAutoSlide, 10 );
}
else {
autoSlide = config.autoSlide;
// If there are media elements with data-autoplay,
// automatically set the autoSlide duration to the
// length of that media. Not applicable if the slide
// is divided up into fragments.
// playbackRate is accounted for in the duration.
if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) {
Util.queryAll( currentSlide, 'video, audio' ).forEach( el => {
if( el.hasAttribute( 'data-autoplay' ) ) {
if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) {
autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000;
}
}
} );
}
}
// Cue the next auto-slide if:
// - There is an autoSlide value
// - Auto-sliding isn't paused by the user
// - The presentation isn't paused
// - The overview isn't active
// - The presentation isn't over
if( autoSlide && !autoSlidePaused && !isPaused() && !overview.isActive() && ( !isLastSlide() || fragments.availableRoutes().next || config.loop === true ) ) {
autoSlideTimeout = setTimeout( () => {
if( typeof config.autoSlideMethod === 'function' ) {
config.autoSlideMethod()
}
else {
navigateNext();
}
cueAutoSlide();
}, autoSlide );
autoSlideStartTime = Date.now();
}
if( autoSlidePlayer ) {
autoSlidePlayer.setPlaying( autoSlideTimeout !== -1 );
}
}
}
/**
* Cancels any ongoing request to auto-slide.
*/
function cancelAutoSlide() {
clearTimeout( autoSlideTimeout );
autoSlideTimeout = -1;
}
function pauseAutoSlide() {
if( autoSlide && !autoSlidePaused ) {
autoSlidePaused = true;
dispatchEvent({ type: 'autoslidepaused' });
clearTimeout( autoSlideTimeout );
if( autoSlidePlayer ) {
autoSlidePlayer.setPlaying( false );
}
}
}
function resumeAutoSlide() {
if( autoSlide && autoSlidePaused ) {
autoSlidePaused = false;
dispatchEvent({ type: 'autoslideresumed' });
cueAutoSlide();
}
}
function navigateLeft() {
navigationHistory.hasNavigatedHorizontally = true;
// Reverse for RTL
if( config.rtl ) {
if( ( overview.isActive() || fragments.next() === false ) && availableRoutes().left ) {
slide( indexh + 1, config.navigationMode === 'grid' ? indexv : undefined );
}
}
// Normal navigation
else if( ( overview.isActive() || fragments.prev() === false ) && availableRoutes().left ) {
slide( indexh - 1, config.navigationMode === 'grid' ? indexv : undefined );
}
}
function navigateRight() {
navigationHistory.hasNavigatedHorizontally = true;
// Reverse for RTL
if( config.rtl ) {
if( ( overview.isActive() || fragments.prev() === false ) && availableRoutes().right ) {
slide( indexh - 1, config.navigationMode === 'grid' ? indexv : undefined );
}
}
// Normal navigation
else if( ( overview.isActive() || fragments.next() === false ) && availableRoutes().right ) {
slide( indexh + 1, config.navigationMode === 'grid' ? indexv : undefined );
}
}
function navigateUp() {
// Prioritize hiding fragments
if( ( overview.isActive() || fragments.prev() === false ) && availableRoutes().up ) {
slide( indexh, indexv - 1 );
}
}
function navigateDown() {
navigationHistory.hasNavigatedVertically = true;
// Prioritize revealing fragments
if( ( overview.isActive() || fragments.next() === false ) && availableRoutes().down ) {
slide( indexh, indexv + 1 );
}
}
/**
* Navigates backwards, prioritized in the following order:
* 1) Previous fragment
* 2) Previous vertical slide
* 3) Previous horizontal slide
*/
function navigatePrev() {
// Prioritize revealing fragments
if( fragments.prev() === false ) {
if( availableRoutes().up ) {
navigateUp();
}
else {
// Fetch the previous horizontal slide, if there is one
let previousSlide;
if( config.rtl ) {
previousSlide = Util.queryAll( dom.wrapper, HORIZONTAL_SLIDES_SELECTOR + '.future' ).pop();
}
else {
previousSlide = Util.queryAll( dom.wrapper, HORIZONTAL_SLIDES_SELECTOR + '.past' ).pop();
}
if( previousSlide ) {
let v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;
let h = indexh - 1;
slide( h, v );
}
}
}
}
/**
* The reverse of #navigatePrev().
*/
function navigateNext() {
navigationHistory.hasNavigatedHorizontally = true;
navigationHistory.hasNavigatedVertically = true;
// Prioritize revealing fragments
if( fragments.next() === false ) {
let routes = availableRoutes();
// When looping is enabled `routes.down` is always available
// so we need a separate check for when we've reached the
// end of a stack and should move horizontally
if( routes.down && routes.right && config.loop && isLastVerticalSlide( currentSlide ) ) {
routes.down = false;
}
if( routes.down ) {
navigateDown();
}
else if( config.rtl ) {
navigateLeft();
}
else {
navigateRight();
}
}
}
// --------------------------------------------------------------------//
// ----------------------------- EVENTS -------------------------------//
// --------------------------------------------------------------------//
/**
* Called by all event handlers that are based on user
* input.
*
* @param {object} [event]
*/
function onUserInput( event ) {
if( config.autoSlideStoppable ) {
pauseAutoSlide();
}
}
/**
* Event listener for transition end on the current slide.
*
* @param {object} [event]
*/
function onTransitionEnd( event ) {
if( transition === 'running' && /section/gi.test( event.target.nodeName ) ) {
transition = 'idle';
dispatchEvent({
type: 'slidetransitionend',
data: { indexh, indexv, previousSlide, currentSlide }
});
}
}
/**
* Handler for the window level 'resize' event.
*
* @param {object} [event]
*/
function onWindowResize( event ) {
layout();
}
/**
* Handle for the window level 'visibilitychange' event.
*
* @param {object} [event]
*/
function onPageVisibilityChange( event ) {
// If, after clicking a link or similar and we're coming back,
// focus the document.body to ensure we can use keyboard shortcuts
if( document.hidden === false && document.activeElement !== document.body ) {
// Not all elements support .blur() - SVGs among them.
if( typeof document.activeElement.blur === 'function' ) {
document.activeElement.blur();
}
document.body.focus();
}
}
/**
* Handles clicks on links that are set to preview in the
* iframe overlay.
*
* @param {object} event
*/
function onPreviewLinkClicked( event ) {
if( event.currentTarget && event.currentTarget.hasAttribute( 'href' ) ) {
let url = event.currentTarget.getAttribute( 'href' );
if( url ) {
showPreview( url );
event.preventDefault();
}
}
}
/**
* Handles click on the auto-sliding controls element.
*
* @param {object} [event]
*/
function onAutoSlidePlayerClick( event ) {
// Replay
if( isLastSlide() && config.loop === false ) {
slide( 0, 0 );
resumeAutoSlide();
}
// Resume
else if( autoSlidePaused ) {
resumeAutoSlide();
}
// Pause
else {
pauseAutoSlide();
}
}
// --------------------------------------------------------------------//
// ------------------------------- API --------------------------------//
// --------------------------------------------------------------------//
// The public reveal.js API
const API = {
VERSION,
initialize,
configure,
sync,
syncSlide,
syncFragments: fragments.sync.bind( fragments ),
// Navigation methods
slide,
left: navigateLeft,
right: navigateRight,
up: navigateUp,
down: navigateDown,
prev: navigatePrev,
next: navigateNext,
// Navigation aliases
navigateLeft, navigateRight, navigateUp, navigateDown, navigatePrev, navigateNext,
// Fragment methods
navigateFragment: fragments.goto.bind( fragments ),
prevFragment: fragments.prev.bind( fragments ),
nextFragment: fragments.next.bind( fragments ),
// Event binding
on,
off,
// Legacy event binding methods left in for backwards compatibility
addEventListener: on,
removeEventListener: off,
// Forces an update in slide layout
layout,
// Randomizes the order of slides
shuffle,
// Returns an object with the available routes as booleans (left/right/top/bottom)
availableRoutes,
// Returns an object with the available fragments as booleans (prev/next)
availableFragments: fragments.availableRoutes.bind( fragments ),
// Toggles a help overlay with keyboard shortcuts
toggleHelp,
// Toggles the overview mode on/off
toggleOverview: overview.toggle.bind( overview ),
// Toggles the "black screen" mode on/off
togglePause,
// Toggles the auto slide mode on/off
toggleAutoSlide,
// Slide navigation checks
isFirstSlide,
isLastSlide,
isLastVerticalSlide,
isVerticalSlide,
// State checks
isPaused,
isAutoSliding,
isSpeakerNotes: notes.isSpeakerNotesWindow.bind( notes ),
isOverview: overview.isActive.bind( overview ),
isFocused: focus.isFocused.bind( focus ),
isPrintingPDF: print.isPrintingPDF.bind( print ),
// Checks if reveal.js has been loaded and is ready for use
isReady: () => ready,
// Slide preloading
loadSlide: slideContent.load.bind( slideContent ),
unloadSlide: slideContent.unload.bind( slideContent ),
// Adds or removes all internal event listeners
addEventListeners,
removeEventListeners,
dispatchEvent,
// Facility for persisting and restoring the presentation state
getState,
setState,
// Presentation progress on range of 0-1
getProgress,
// Returns the indices of the current, or specified, slide
getIndices,
// Returns an Array of key:value maps of the attributes of each
// slide in the deck
getSlidesAttributes,
// Returns the number of slides that we have passed
getSlidePastCount,
// Returns the total number of slides
getTotalSlides,
// Returns the slide element at the specified index
getSlide,
// Returns the previous slide element, may be null
getPreviousSlide: () => previousSlide,
// Returns the current slide element
getCurrentSlide: () => currentSlide,
// Returns the slide background element at the specified index
getSlideBackground,
// Returns the speaker notes string for a slide, or null
getSlideNotes: notes.getSlideNotes.bind( notes ),
// Returns an Array of all slides
getSlides,
// Returns an array with all horizontal/vertical slides in the deck
getHorizontalSlides,
getVerticalSlides,
// Checks if the presentation contains two or more horizontal
// and vertical slides
hasHorizontalSlides,
hasVerticalSlides,
// Checks if the deck has navigated on either axis at least once
hasNavigatedHorizontally: () => navigationHistory.hasNavigatedHorizontally,
hasNavigatedVertically: () => navigationHistory.hasNavigatedVertically,
// Adds/removes a custom key binding
addKeyBinding: keyboard.addKeyBinding.bind( keyboard ),
removeKeyBinding: keyboard.removeKeyBinding.bind( keyboard ),
// Programmatically triggers a keyboard event
triggerKey: keyboard.triggerKey.bind( keyboard ),
// Registers a new shortcut to include in the help overlay
registerKeyboardShortcut: keyboard.registerKeyboardShortcut.bind( keyboard ),
getComputedSlideSize,
// Returns the current scale of the presentation content
getScale: () => scale,
// Returns the current configuration object
getConfig: () => config,
// Helper method, retrieves query string as a key:value map
getQueryHash: Util.getQueryHash,
// Returns reveal.js DOM elements
getRevealElement: () => revealElement,
getSlidesElement: () => dom.slides,
getViewportElement: () => dom.viewport,
getBackgroundsElement: () => backgrounds.element,
// API for registering and retrieving plugins
registerPlugin: plugins.registerPlugin.bind( plugins ),
hasPlugin: plugins.hasPlugin.bind( plugins ),
getPlugin: plugins.getPlugin.bind( plugins ),
getPlugins: plugins.getRegisteredPlugins.bind( plugins )
};
// Our internal API which controllers have access to
Util.extend( Reveal, {
...API,
// Methods for announcing content to screen readers
announceStatus,
getStatusText,
// Controllers
print,
focus,
progress,
controls,
location,
overview,
fragments,
slideContent,
slideNumber,
onUserInput,
closeOverlay,
updateSlidesVisibility,
layoutSlideContents,
transformSlides,
cueAutoSlide,
cancelAutoSlide
} );
return API;
};
/**
* Converts various color input formats to an {r:0,g:0,b:0} object.
*
* @param {string} color The string representation of a color
* @example
* colorToRgb('#000');
* @example
* colorToRgb('#000000');
* @example
* colorToRgb('rgb(0,0,0)');
* @example
* colorToRgb('rgba(0,0,0)');
*
* @return {{r: number, g: number, b: number, [a]: number}|null}
*/
export const colorToRgb = ( color ) => {
let hex3 = color.match( /^#([0-9a-f]{3})$/i );
if( hex3 && hex3[1] ) {
hex3 = hex3[1];
return {
r: parseInt( hex3.charAt( 0 ), 16 ) * 0x11,
g: parseInt( hex3.charAt( 1 ), 16 ) * 0x11,
b: parseInt( hex3.charAt( 2 ), 16 ) * 0x11
};
}
let hex6 = color.match( /^#([0-9a-f]{6})$/i );
if( hex6 && hex6[1] ) {
hex6 = hex6[1];
return {
r: parseInt( hex6.substr( 0, 2 ), 16 ),
g: parseInt( hex6.substr( 2, 2 ), 16 ),
b: parseInt( hex6.substr( 4, 2 ), 16 )
};
}
let rgb = color.match( /^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i );
if( rgb ) {
return {
r: parseInt( rgb[1], 10 ),
g: parseInt( rgb[2], 10 ),
b: parseInt( rgb[3], 10 )
};
}
let rgba = color.match( /^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i );
if( rgba ) {
return {
r: parseInt( rgba[1], 10 ),
g: parseInt( rgba[2], 10 ),
b: parseInt( rgba[3], 10 ),
a: parseFloat( rgba[4] )
};
}
return null;
}
/**
* Calculates brightness on a scale of 0-255.
*
* @param {string} color See colorToRgb for supported formats.
* @see {@link colorToRgb}
*/
export const colorBrightness = ( color ) => {
if( typeof color === 'string' ) color = colorToRgb( color );
if( color ) {
return ( color.r * 299 + color.g * 587 + color.b * 114 ) / 1000;
}
return null;
}
\ No newline at end of file
export const SLIDES_SELECTOR = '.slides section';
export const HORIZONTAL_SLIDES_SELECTOR = '.slides>section';
export const VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section';
// Methods that may not be invoked via the postMessage API
export const POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/;
// Regex for retrieving the fragment style from a class attribute
export const FRAGMENT_STYLE_REGEX = /fade-(down|up|right|left|out|in-then-out|in-then-semi-out)|semi-fade-out|current-visible|shrink|grow/;
\ No newline at end of file
const UA = navigator.userAgent;
const testElement = document.createElement( 'div' );
export const isMobile = /(iphone|ipod|ipad|android)/gi.test( UA ) ||
( navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ); // iPadOS
export const isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );
export const isAndroid = /android/gi.test( UA );
// Flags if we should use zoom instead of transform to scale
// up slides. Zoom produces crisper results but has a lot of
// xbrowser quirks so we only use it in whitelisted browsers.
export const supportsZoom = 'zoom' in testElement.style && !isMobile &&
( isChrome || /Version\/[\d\.]+.*Safari/.test( UA ) );
\ No newline at end of file
/**
* Loads a JavaScript file from the given URL and executes it.
*
* @param {string} url Address of the .js file to load
* @param {function} callback Method to invoke when the script
* has loaded and executed
*/
export const loadScript = ( url, callback ) => {
const script = document.createElement( 'script' );
script.type = 'text/javascript';
script.async = false;
script.defer = false;
script.src = url;
if( typeof callback === 'function' ) {
// Success callback
script.onload = script.onreadystatechange = event => {
if( event.type === 'load' || /loaded|complete/.test( script.readyState ) ) {
// Kill event listeners
script.onload = script.onreadystatechange = script.onerror = null;
callback();
}
};
// Error callback
script.onerror = err => {
// Kill event listeners
script.onload = script.onreadystatechange = script.onerror = null;
callback( new Error( 'Failed loading script: ' + script.src + '\n' + err ) );
};
}
// Append the script at the end of <head>
const head = document.querySelector( 'head' );
head.insertBefore( script, head.lastChild );
}
\ No newline at end of file
/**
* Extend object a with the properties of object b.
* If there's a conflict, object b takes precedence.
*
* @param {object} a
* @param {object} b
*/
export const extend = ( a, b ) => {
for( let i in b ) {
a[ i ] = b[ i ];
}
return a;
}
/**
* querySelectorAll but returns an Array.
*/
export const queryAll = ( el, selector ) => {
return Array.from( el.querySelectorAll( selector ) );
}
/**
* classList.toggle() with cross browser support
*/
export const toggleClass = ( el, className, value ) => {
if( value ) {
el.classList.add( className );
}
else {
el.classList.remove( className );
}
}
/**
* Utility for deserializing a value.
*
* @param {*} value
* @return {*}
*/
export const deserialize = ( value ) => {
if( typeof value === 'string' ) {
if( value === 'null' ) return null;
else if( value === 'true' ) return true;
else if( value === 'false' ) return false;
else if( value.match( /^-?[\d\.]+$/ ) ) return parseFloat( value );
}
return value;
}
/**
* Measures the distance in pixels between point a
* and point b.
*
* @param {object} a point with x/y properties
* @param {object} b point with x/y properties
*
* @return {number}
*/
export const distanceBetween = ( a, b ) => {
let dx = a.x - b.x,
dy = a.y - b.y;
return Math.sqrt( dx*dx + dy*dy );
}
/**
* Applies a CSS transform to the target element.
*
* @param {HTMLElement} element
* @param {string} transform
*/
export const transformElement = ( element, transform ) => {
element.style.transform = transform;
}
/**
* Element.matches with IE support.
*
* @param {HTMLElement} target The element to match
* @param {String} selector The CSS selector to match
* the element against
*
* @return {Boolean}
*/
export const matches = ( target, selector ) => {
let matchesMethod = target.matches || target.matchesSelector || target.msMatchesSelector;
return !!( matchesMethod && matchesMethod.call( target, selector ) );
}
/**
* Find the closest parent that matches the given
* selector.
*
* @param {HTMLElement} target The child element
* @param {String} selector The CSS selector to match
* the parents against
*
* @return {HTMLElement} The matched parent or null
* if no matching parent was found
*/
export const closest = ( target, selector ) => {
// Native Element.closest
if( typeof target.closest === 'function' ) {
return target.closest( selector );
}
// Polyfill
while( target ) {
if( matches( target, selector ) ) {
return target;
}
// Keep searching
target = target.parentNode;
}
return null;
}
/**
* Handling the fullscreen functionality via the fullscreen API
*
* @see http://fullscreen.spec.whatwg.org/
* @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
*/
export const enterFullscreen = element => {
element = element || document.documentElement;
// Check which implementation is available
let requestMethod = element.requestFullscreen ||
element.webkitRequestFullscreen ||
element.webkitRequestFullScreen ||
element.mozRequestFullScreen ||
element.msRequestFullscreen;
if( requestMethod ) {
requestMethod.apply( element );
}
}
/**
* Creates an HTML element and returns a reference to it.
* If the element already exists the existing instance will
* be returned.
*
* @param {HTMLElement} container
* @param {string} tagname
* @param {string} classname
* @param {string} innerHTML
*
* @return {HTMLElement}
*/
export const createSingletonNode = ( container, tagname, classname, innerHTML='' ) => {
// Find all nodes matching the description
let nodes = container.querySelectorAll( '.' + classname );
// Check all matches to find one which is a direct child of
// the specified container
for( let i = 0; i < nodes.length; i++ ) {
let testNode = nodes[i];
if( testNode.parentNode === container ) {
return testNode;
}
}
// If no node was found, create it now
let node = document.createElement( tagname );
node.className = classname;
node.innerHTML = innerHTML;
container.appendChild( node );
return node;
}
/**
* Injects the given CSS styles into the DOM.
*
* @param {string} value
*/
export const createStyleSheet = ( value ) => {
let tag = document.createElement( 'style' );
tag.type = 'text/css';
if( value && value.length > 0 ) {
if( tag.styleSheet ) {
tag.styleSheet.cssText = value;
}
else {
tag.appendChild( document.createTextNode( value ) );
}
}
document.head.appendChild( tag );
return tag;
}
/**
* Returns a key:value hash of all query params.
*/
export const getQueryHash = () => {
let query = {};
location.search.replace( /[A-Z0-9]+?=([\w\.%-]*)/gi, a => {
query[ a.split( '=' ).shift() ] = a.split( '=' ).pop();
} );
// Basic deserialization
for( let i in query ) {
let value = query[ i ];
query[ i ] = deserialize( unescape( value ) );
}
// Do not accept new dependencies via query config to avoid
// the potential of malicious script injection
if( typeof query['dependencies'] !== 'undefined' ) delete query['dependencies'];
return query;
}
/**
* Returns the remaining height within the parent of the
* target element.
*
* remaining height = [ configured parent height ] - [ current parent height ]
*
* @param {HTMLElement} element
* @param {number} [height]
*/
export const getRemainingHeight = ( element, height = 0 ) => {
if( element ) {
let newHeight, oldHeight = element.style.height;
// Change the .stretch element height to 0 in order find the height of all
// the other elements
element.style.height = '0px';
// In Overview mode, the parent (.slide) height is set of 700px.
// Restore it temporarily to its natural height.
element.parentNode.style.height = 'auto';
newHeight = height - element.parentNode.offsetHeight;
// Restore the old height, just in case
element.style.height = oldHeight + 'px';
// Clear the parent (.slide) height. .removeProperty works in IE9+
element.parentNode.style.removeProperty('height');
return newHeight;
}
return height;
}
\ No newline at end of file
{
"name": "reveal.js",
"version": "4.1.0",
"description": "The HTML Presentation Framework",
"homepage": "https://revealjs.com",
"subdomain": "revealjs",
"main": "dist/reveal.js",
"module": "dist/reveal.esm.js",
"license": "MIT",
"scripts": {
"test": "gulp test",
"start": "gulp serve",
"build": "gulp"
},
"author": {
"name": "Hakim El Hattab",
"email": "hakim.elhattab@gmail.com",
"web": "https://hakim.se"
},
"repository": {
"type": "git",
"url": "git://github.com/hakimel/reveal.js.git"
},
"engines": {
"node": ">=10.0.0"
},
"keywords": [
"reveal",
"slides",
"presentation"
],
"devDependencies": {
"@babel/core": "^7.9.6",
"@babel/preset-env": "^7.9.6",
"@rollup/plugin-babel": "^5.2.0",
"@rollup/plugin-commonjs": "^15.0.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"babel-eslint": "^10.1.0",
"babel-plugin-transform-html-import-to-string": "0.0.1",
"colors": "^1.4.0",
"core-js": "^3.6.5",
"fitty": "^2.3.0",
"glob": "^7.1.6",
"gulp": "^4.0.2",
"gulp-autoprefixer": "^7.0.1",
"gulp-clean-css": "^4.2.0",
"gulp-connect": "^5.7.0",
"gulp-eslint": "^6.0.0",
"gulp-header": "^2.0.9",
"gulp-sass": "^4.0.2",
"gulp-tap": "^2.0.0",
"gulp-zip": "^5.0.1",
"highlight.js": "^10.0.3",
"marked": "^1.1.0",
"node-qunit-puppeteer": "^2.0.1",
"qunit": "^2.10.0",
"rollup": "^2.26.4",
"rollup-plugin-terser": "^7.0.0",
"yargs": "^15.1.0"
},
"browserslist": "> 0.5%, IE 11, not dead",
"eslintConfig": {
"env": {
"browser": true,
"es6": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": true
},
"globals": {
"module": false,
"console": false,
"unescape": false,
"define": false,
"exports": false
},
"rules": {
"curly": 0,
"eqeqeq": 2,
"wrap-iife": [
2,
"any"
],
"no-use-before-define": [
2,
{
"functions": false
}
],
"new-cap": 2,
"no-caller": 2,
"dot-notation": 0,
"no-eq-null": 2,
"no-unused-expressions": 0
}
}
}
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
/*
Monokai style - ported by Luigi Maselli - http://grigio.org
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #272822;
color: #ddd;
}
.hljs-tag,
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-strong,
.hljs-name {
color: #f92672;
}
.hljs-code {
color: #66d9ef;
}
.hljs-class .hljs-title {
color: white;
}
.hljs-attribute,
.hljs-symbol,
.hljs-regexp,
.hljs-link {
color: #bf79db;
}
.hljs-string,
.hljs-bullet,
.hljs-subst,
.hljs-title,
.hljs-section,
.hljs-emphasis,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
color: #a6e22e;
}
.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
color: #75715e;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-doctag,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-selector-id {
font-weight: bold;
}
import hljs from 'highlight.js'
/* highlightjs-line-numbers.js 2.6.0 | (C) 2018 Yauheni Pakala | MIT License | github.com/wcoder/highlightjs-line-numbers.js */
/* Edited by Hakim for reveal.js; removed async timeout */
!function(n,e){"use strict";function t(){var n=e.createElement("style");n.type="text/css",n.innerHTML=g(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[v,L,b]),e.getElementsByTagName("head")[0].appendChild(n)}function r(t){"interactive"===e.readyState||"complete"===e.readyState?i(t):n.addEventListener("DOMContentLoaded",function(){i(t)})}function i(t){try{var r=e.querySelectorAll("code.hljs,code.nohighlight");for(var i in r)r.hasOwnProperty(i)&&l(r[i],t)}catch(o){n.console.error("LineNumbers error: ",o)}}function l(n,e){"object"==typeof n&&f(function(){n.innerHTML=s(n,e)})}function o(n,e){if("string"==typeof n){var t=document.createElement("code");return t.innerHTML=n,s(t,e)}}function s(n,e){e=e||{singleLine:!1};var t=e.singleLine?0:1;return c(n),a(n.innerHTML,t)}function a(n,e){var t=u(n);if(""===t[t.length-1].trim()&&t.pop(),t.length>e){for(var r="",i=0,l=t.length;i<l;i++)r+=g('<tr><td class="{0}"><div class="{1} {2}" {3}="{5}"></div></td><td class="{4}"><div class="{1}">{6}</div></td></tr>',[j,m,L,b,p,i+1,t[i].length>0?t[i]:" "]);return g('<table class="{0}">{1}</table>',[v,r])}return n}function c(n){var e=n.childNodes;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];h(r.textContent)>0&&(r.childNodes.length>0?c(r):d(r.parentNode))}}function d(n){var e=n.className;if(/hljs-/.test(e)){for(var t=u(n.innerHTML),r=0,i="";r<t.length;r++){var l=t[r].length>0?t[r]:" ";i+=g('<span class="{0}">{1}</span>\n',[e,l])}n.innerHTML=i.trim()}}function u(n){return 0===n.length?[]:n.split(y)}function h(n){return(n.trim().match(y)||[]).length}function f(e){e()}function g(n,e){return n.replace(/\{(\d+)\}/g,function(n,t){return e[t]?e[t]:n})}var v="hljs-ln",m="hljs-ln-line",p="hljs-ln-code",j="hljs-ln-numbers",L="hljs-ln-n",b="data-line-number",y=/\r\n|\r|\n/g;hljs?(hljs.initLineNumbersOnLoad=r,hljs.lineNumbersBlock=l,hljs.lineNumbersValue=o,t()):n.console.error("highlight.js not detected!")}(window,document);
/*!
* reveal.js plugin that adds syntax highlight support.
*/
const Plugin = {
id: 'highlight',
HIGHLIGHT_STEP_DELIMITER: '|',
HIGHLIGHT_LINE_DELIMITER: ',',
HIGHLIGHT_LINE_RANGE_DELIMITER: '-',
hljs: hljs,
/**
* Highlights code blocks withing the given deck.
*
* Note that this can be called multiple times if
* there are multiple presentations on one page.
*
* @param {Reveal} reveal the reveal.js instance
*/
init: function( reveal ) {
// Read the plugin config options and provide fallbacks
var config = reveal.getConfig().highlight || {};
config.highlightOnLoad = typeof config.highlightOnLoad === 'boolean' ? config.highlightOnLoad : true;
config.escapeHTML = typeof config.escapeHTML === 'boolean' ? config.escapeHTML : true;
[].slice.call( reveal.getRevealElement().querySelectorAll( 'pre code' ) ).forEach( function( block ) {
// Code can optionally be wrapped in script template to avoid
// HTML being parsed by the browser (i.e. when you need to
// include <, > or & in your code).
let substitute = block.querySelector( 'script[type="text/template"]' );
if( substitute ) {
// textContent handles the HTML entity escapes for us
block.textContent = substitute.innerHTML;
}
// Trim whitespace if the "data-trim" attribute is present
if( block.hasAttribute( 'data-trim' ) && typeof block.innerHTML.trim === 'function' ) {
block.innerHTML = betterTrim( block );
}
// Escape HTML tags unless the "data-noescape" attrbute is present
if( config.escapeHTML && !block.hasAttribute( 'data-noescape' )) {
block.innerHTML = block.innerHTML.replace( /</g,"&lt;").replace(/>/g, '&gt;' );
}
// Re-highlight when focus is lost (for contenteditable code)
block.addEventListener( 'focusout', function( event ) {
hljs.highlightBlock( event.currentTarget );
}, false );
if( config.highlightOnLoad ) {
Plugin.highlightBlock( block );
}
} );
// If we're printing to PDF, scroll the code highlights of
// all blocks in the deck into view at once
reveal.on( 'pdf-ready', function() {
[].slice.call( reveal.getRevealElement().querySelectorAll( 'pre code[data-line-numbers].current-fragment' ) ).forEach( function( block ) {
Plugin.scrollHighlightedLineIntoView( block, {}, true );
} );
} );
},
/**
* Highlights a code block. If the <code> node has the
* 'data-line-numbers' attribute we also generate slide
* numbers.
*
* If the block contains multiple line highlight steps,
* we clone the block and create a fragment for each step.
*/
highlightBlock: function( block ) {
hljs.highlightBlock( block );
// Don't generate line numbers for empty code blocks
if( block.innerHTML.trim().length === 0 ) return;
if( block.hasAttribute( 'data-line-numbers' ) ) {
hljs.lineNumbersBlock( block, { singleLine: true } );
var scrollState = { currentBlock: block };
// If there is at least one highlight step, generate
// fragments
var highlightSteps = Plugin.deserializeHighlightSteps( block.getAttribute( 'data-line-numbers' ) );
if( highlightSteps.length > 1 ) {
// If the original code block has a fragment-index,
// each clone should follow in an incremental sequence
var fragmentIndex = parseInt( block.getAttribute( 'data-fragment-index' ), 10 );
if( typeof fragmentIndex !== 'number' || isNaN( fragmentIndex ) ) {
fragmentIndex = null;
}
// Generate fragments for all steps except the original block
highlightSteps.slice(1).forEach( function( highlight ) {
var fragmentBlock = block.cloneNode( true );
fragmentBlock.setAttribute( 'data-line-numbers', Plugin.serializeHighlightSteps( [ highlight ] ) );
fragmentBlock.classList.add( 'fragment' );
block.parentNode.appendChild( fragmentBlock );
Plugin.highlightLines( fragmentBlock );
if( typeof fragmentIndex === 'number' ) {
fragmentBlock.setAttribute( 'data-fragment-index', fragmentIndex );
fragmentIndex += 1;
}
else {
fragmentBlock.removeAttribute( 'data-fragment-index' );
}
// Scroll highlights into view as we step through them
fragmentBlock.addEventListener( 'visible', Plugin.scrollHighlightedLineIntoView.bind( Plugin, fragmentBlock, scrollState ) );
fragmentBlock.addEventListener( 'hidden', Plugin.scrollHighlightedLineIntoView.bind( Plugin, fragmentBlock.previousSibling, scrollState ) );
} );
block.removeAttribute( 'data-fragment-index' )
block.setAttribute( 'data-line-numbers', Plugin.serializeHighlightSteps( [ highlightSteps[0] ] ) );
}
// Scroll the first highlight into view when the slide
// becomes visible. Note supported in IE11 since it lacks
// support for Element.closest.
var slide = typeof block.closest === 'function' ? block.closest( 'section:not(.stack)' ) : null;
if( slide ) {
var scrollFirstHighlightIntoView = function() {
Plugin.scrollHighlightedLineIntoView( block, scrollState, true );
slide.removeEventListener( 'visible', scrollFirstHighlightIntoView );
}
slide.addEventListener( 'visible', scrollFirstHighlightIntoView );
}
Plugin.highlightLines( block );
}
},
/**
* Animates scrolling to the first highlighted line
* in the given code block.
*/
scrollHighlightedLineIntoView: function( block, scrollState, skipAnimation ) {
cancelAnimationFrame( scrollState.animationFrameID );
// Match the scroll position of the currently visible
// code block
if( scrollState.currentBlock ) {
block.scrollTop = scrollState.currentBlock.scrollTop;
}
// Remember the current code block so that we can match
// its scroll position when showing/hiding fragments
scrollState.currentBlock = block;
var highlightBounds = this.getHighlightedLineBounds( block )
var viewportHeight = block.offsetHeight;
// Subtract padding from the viewport height
var blockStyles = getComputedStyle( block );
viewportHeight -= parseInt( blockStyles.paddingTop ) + parseInt( blockStyles.paddingBottom );
// Scroll position which centers all highlights
var startTop = block.scrollTop;
var targetTop = highlightBounds.top + ( Math.min( highlightBounds.bottom - highlightBounds.top, viewportHeight ) - viewportHeight ) / 2;
// Account for offsets in position applied to the
// <table> that holds our lines of code
var lineTable = block.querySelector( '.hljs-ln' );
if( lineTable ) targetTop += lineTable.offsetTop - parseInt( blockStyles.paddingTop );
// Make sure the scroll target is within bounds
targetTop = Math.max( Math.min( targetTop, block.scrollHeight - viewportHeight ), 0 );
if( skipAnimation === true || startTop === targetTop ) {
block.scrollTop = targetTop;
}
else {
// Don't attempt to scroll if there is no overflow
if( block.scrollHeight <= viewportHeight ) return;
var time = 0;
var animate = function() {
time = Math.min( time + 0.02, 1 );
// Update our eased scroll position
block.scrollTop = startTop + ( targetTop - startTop ) * Plugin.easeInOutQuart( time );
// Keep animating unless we've reached the end
if( time < 1 ) {
scrollState.animationFrameID = requestAnimationFrame( animate );
}
};
animate();
}
},
/**
* The easing function used when scrolling.
*/
easeInOutQuart: function( t ) {
// easeInOutQuart
return t<.5 ? 8*t*t*t*t : 1-8*(--t)*t*t*t;
},
getHighlightedLineBounds: function( block ) {
var highlightedLines = block.querySelectorAll( '.highlight-line' );
if( highlightedLines.length === 0 ) {
return { top: 0, bottom: 0 };
}
else {
var firstHighlight = highlightedLines[0];
var lastHighlight = highlightedLines[ highlightedLines.length -1 ];
return {
top: firstHighlight.offsetTop,
bottom: lastHighlight.offsetTop + lastHighlight.offsetHeight
}
}
},
/**
* Visually emphasize specific lines within a code block.
* This only works on blocks with line numbering turned on.
*
* @param {HTMLElement} block a <code> block
* @param {String} [linesToHighlight] The lines that should be
* highlighted in this format:
* "1" = highlights line 1
* "2,5" = highlights lines 2 & 5
* "2,5-7" = highlights lines 2, 5, 6 & 7
*/
highlightLines: function( block, linesToHighlight ) {
var highlightSteps = Plugin.deserializeHighlightSteps( linesToHighlight || block.getAttribute( 'data-line-numbers' ) );
if( highlightSteps.length ) {
highlightSteps[0].forEach( function( highlight ) {
var elementsToHighlight = [];
// Highlight a range
if( typeof highlight.end === 'number' ) {
elementsToHighlight = [].slice.call( block.querySelectorAll( 'table tr:nth-child(n+'+highlight.start+'):nth-child(-n+'+highlight.end+')' ) );
}
// Highlight a single line
else if( typeof highlight.start === 'number' ) {
elementsToHighlight = [].slice.call( block.querySelectorAll( 'table tr:nth-child('+highlight.start+')' ) );
}
if( elementsToHighlight.length ) {
elementsToHighlight.forEach( function( lineElement ) {
lineElement.classList.add( 'highlight-line' );
} );
block.classList.add( 'has-highlights' );
}
} );
}
},
/**
* Parses and formats a user-defined string of line
* numbers to highlight.
*
* @example
* Plugin.deserializeHighlightSteps( '1,2|3,5-10' )
* // [
* // [ { start: 1 }, { start: 2 } ],
* // [ { start: 3 }, { start: 5, end: 10 } ]
* // ]
*/
deserializeHighlightSteps: function( highlightSteps ) {
// Remove whitespace
highlightSteps = highlightSteps.replace( /\s/g, '' );
// Divide up our line number groups
highlightSteps = highlightSteps.split( Plugin.HIGHLIGHT_STEP_DELIMITER );
return highlightSteps.map( function( highlights ) {
return highlights.split( Plugin.HIGHLIGHT_LINE_DELIMITER ).map( function( highlight ) {
// Parse valid line numbers
if( /^[\d-]+$/.test( highlight ) ) {
highlight = highlight.split( Plugin.HIGHLIGHT_LINE_RANGE_DELIMITER );
var lineStart = parseInt( highlight[0], 10 ),
lineEnd = parseInt( highlight[1], 10 );
if( isNaN( lineEnd ) ) {
return {
start: lineStart
};
}
else {
return {
start: lineStart,
end: lineEnd
};
}
}
// If no line numbers are provided, no code will be highlighted
else {
return {};
}
} );
} );
},
/**
* Serializes parsed line number data into a string so
* that we can store it in the DOM.
*/
serializeHighlightSteps: function( highlightSteps ) {
return highlightSteps.map( function( highlights ) {
return highlights.map( function( highlight ) {
// Line range
if( typeof highlight.end === 'number' ) {
return highlight.start + Plugin.HIGHLIGHT_LINE_RANGE_DELIMITER + highlight.end;
}
// Single line
else if( typeof highlight.start === 'number' ) {
return highlight.start;
}
// All lines
else {
return '';
}
} ).join( Plugin.HIGHLIGHT_LINE_DELIMITER );
} ).join( Plugin.HIGHLIGHT_STEP_DELIMITER );
}
}
// Function to perform a better "data-trim" on code snippets
// Will slice an indentation amount on each line of the snippet (amount based on the line having the lowest indentation length)
function betterTrim(snippetEl) {
// Helper functions
function trimLeft(val) {
// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
return val.replace(/^[\s\uFEFF\xA0]+/g, '');
}
function trimLineBreaks(input) {
var lines = input.split('\n');
// Trim line-breaks from the beginning
for (var i = 0; i < lines.length; i++) {
if (lines[i].trim() === '') {
lines.splice(i--, 1);
} else break;
}
// Trim line-breaks from the end
for (var i = lines.length-1; i >= 0; i--) {
if (lines[i].trim() === '') {
lines.splice(i, 1);
} else break;
}
return lines.join('\n');
}
// Main function for betterTrim()
return (function(snippetEl) {
var content = trimLineBreaks(snippetEl.innerHTML);
var lines = content.split('\n');
// Calculate the minimum amount to remove on each line start of the snippet (can be 0)
var pad = lines.reduce(function(acc, line) {
if (line.length > 0 && trimLeft(line).length > 0 && acc > line.length - trimLeft(line).length) {
return line.length - trimLeft(line).length;
}
return acc;
}, Number.POSITIVE_INFINITY);
// Slice each line with this amount
return lines.map(function(line, index) {
return line.slice(pad);
})
.join('\n');
})(snippetEl);
}
export default () => Plugin;
/*
Zenburn style from voldmar.ru (c) Vladimir Epifanov <voldmar@voldmar.ru>
based on dark.css by Ivan Sagalaev
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #3f3f3f;
color: #dcdcdc;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-tag {
color: #e3ceab;
}
.hljs-template-tag {
color: #dcdcdc;
}
.hljs-number {
color: #8cd0d3;
}
.hljs-variable,
.hljs-template-variable,
.hljs-attribute {
color: #efdcbc;
}
.hljs-literal {
color: #efefaf;
}
.hljs-subst {
color: #8f8f8f;
}
.hljs-title,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-section,
.hljs-type {
color: #efef8f;
}
.hljs-symbol,
.hljs-bullet,
.hljs-link {
color: #dca3a3;
}
.hljs-deletion,
.hljs-string,
.hljs-built_in,
.hljs-builtin-name {
color: #cc9393;
}
.hljs-addition,
.hljs-comment,
.hljs-quote,
.hljs-meta {
color: #7f9f7f;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var n=function(e){return e&&e.Math==Math&&e},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},o=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,s={f:l&&!a.call({1:2},1)?function(e){var t=l(this,e);return!!t&&t.enumerable}:a},c=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},u={}.toString,f=function(e){return u.call(e).slice(8,-1)},p="".split,h=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==f(e)?p.call(e,""):Object(e)}:Object,g=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},d=function(e){return h(g(e))},v=function(e){return"object"==typeof e?null!==e:"function"==typeof e},y=function(e,t){if(!v(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!v(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},k={}.hasOwnProperty,m=function(e,t){return k.call(e,t)},b=r.document,x=v(b)&&v(b.createElement),w=function(e){return x?b.createElement(e):{}},S=!o&&!i((function(){return 7!=Object.defineProperty(w("div"),"a",{get:function(){return 7}}).a})),_=Object.getOwnPropertyDescriptor,A={f:o?_:function(e,t){if(e=d(e),t=y(t,!0),S)try{return _(e,t)}catch(e){}if(m(e,t))return c(!s.f.call(e,t),e[t])}},E=function(e){if(!v(e))throw TypeError(String(e)+" is not an object");return e},O=Object.defineProperty,T={f:o?O:function(e,t,n){if(E(e),t=y(t,!0),E(n),S)try{return O(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},R=o?function(e,t,n){return T.f(e,t,c(1,n))}:function(e,t,n){return e[t]=n,e},I=function(e,t){try{R(r,e,t)}catch(n){r[e]=t}return t},j=r["__core-js_shared__"]||I("__core-js_shared__",{}),z=Function.toString;"function"!=typeof j.inspectSource&&(j.inspectSource=function(e){return z.call(e)});var $,P,C,L=j.inspectSource,M=r.WeakMap,N="function"==typeof M&&/native code/.test(L(M)),D=t((function(e){(e.exports=function(e,t){return j[e]||(j[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),U=0,q=Math.random(),Z=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++U+q).toString(36)},F=D("keys"),G=function(e){return F[e]||(F[e]=Z(e))},H={},W=r.WeakMap;if(N){var B=j.state||(j.state=new W),V=B.get,K=B.has,X=B.set;$=function(e,t){return t.facade=e,X.call(B,e,t),t},P=function(e){return V.call(B,e)||{}},C=function(e){return K.call(B,e)}}else{var Y=G("state");H[Y]=!0,$=function(e,t){return t.facade=e,R(e,Y,t),t},P=function(e){return m(e,Y)?e[Y]:{}},C=function(e){return m(e,Y)}}var J,Q,ee={set:$,get:P,has:C,enforce:function(e){return C(e)?P(e):$(e,{})},getterFor:function(e){return function(t){var n;if(!v(t)||(n=P(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},te=t((function(e){var t=ee.get,n=ee.enforce,i=String(String).split("String");(e.exports=function(e,t,o,a){var l,s=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,u=!!a&&!!a.noTargetGet;"function"==typeof o&&("string"!=typeof t||m(o,"name")||R(o,"name",t),(l=n(o)).source||(l.source=i.join("string"==typeof t?t:""))),e!==r?(s?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=o:R(e,t,o)):c?e[t]=o:I(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||L(this)}))})),ne=r,re=function(e){return"function"==typeof e?e:void 0},ie=function(e,t){return arguments.length<2?re(ne[e])||re(r[e]):ne[e]&&ne[e][t]||r[e]&&r[e][t]},oe=Math.ceil,ae=Math.floor,le=function(e){return isNaN(e=+e)?0:(e>0?ae:oe)(e)},se=Math.min,ce=function(e){return e>0?se(le(e),9007199254740991):0},ue=Math.max,fe=Math.min,pe=function(e,t){var n=le(e);return n<0?ue(n+t,0):fe(n,t)},he=function(e){return function(t,n,r){var i,o=d(t),a=ce(o.length),l=pe(r,a);if(e&&n!=n){for(;a>l;)if((i=o[l++])!=i)return!0}else for(;a>l;l++)if((e||l in o)&&o[l]===n)return e||l||0;return!e&&-1}},ge={includes:he(!0),indexOf:he(!1)},de=ge.indexOf,ve=function(e,t){var n,r=d(e),i=0,o=[];for(n in r)!m(H,n)&&m(r,n)&&o.push(n);for(;t.length>i;)m(r,n=t[i++])&&(~de(o,n)||o.push(n));return o},ye=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ke=ye.concat("length","prototype"),me={f:Object.getOwnPropertyNames||function(e){return ve(e,ke)}},be={f:Object.getOwnPropertySymbols},xe=ie("Reflect","ownKeys")||function(e){var t=me.f(E(e)),n=be.f;return n?t.concat(n(e)):t},we=function(e,t){for(var n=xe(t),r=T.f,i=A.f,o=0;o<n.length;o++){var a=n[o];m(e,a)||r(e,a,i(t,a))}},Se=/#|\.prototype\./,_e=function(e,t){var n=Ee[Ae(e)];return n==Te||n!=Oe&&("function"==typeof t?i(t):!!t)},Ae=_e.normalize=function(e){return String(e).replace(Se,".").toLowerCase()},Ee=_e.data={},Oe=_e.NATIVE="N",Te=_e.POLYFILL="P",Re=_e,Ie=A.f,je=function(e,t){var n,i,o,a,l,s=e.target,c=e.global,u=e.stat;if(n=c?r:u?r[s]||I(s,{}):(r[s]||{}).prototype)for(i in t){if(a=t[i],o=e.noTargetGet?(l=Ie(n,i))&&l.value:n[i],!Re(c?i:s+(u?".":"#")+i,e.forced)&&void 0!==o){if(typeof a==typeof o)continue;we(a,o)}(e.sham||o&&o.sham)&&R(a,"sham",!0),te(n,i,a,e)}},ze=Array.isArray||function(e){return"Array"==f(e)},$e=function(e){return Object(g(e))},Pe=function(e,t,n){var r=y(t);r in e?T.f(e,r,c(0,n)):e[r]=n},Ce=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Le=Ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Me=D("wks"),Ne=r.Symbol,De=Le?Ne:Ne&&Ne.withoutSetter||Z,Ue=function(e){return m(Me,e)||(Ce&&m(Ne,e)?Me[e]=Ne[e]:Me[e]=De("Symbol."+e)),Me[e]},qe=Ue("species"),Ze=function(e,t){var n;return ze(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!ze(n.prototype)?v(n)&&null===(n=n[qe])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Fe=ie("navigator","userAgent")||"",Ge=r.process,He=Ge&&Ge.versions,We=He&&He.v8;We?Q=(J=We.split("."))[0]+J[1]:Fe&&(!(J=Fe.match(/Edge\/(\d+)/))||J[1]>=74)&&(J=Fe.match(/Chrome\/(\d+)/))&&(Q=J[1]);var Be=Q&&+Q,Ve=Ue("species"),Ke=function(e){return Be>=51||!i((function(){var t=[];return(t.constructor={})[Ve]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Xe=Ue("isConcatSpreadable"),Ye=Be>=51||!i((function(){var e=[];return e[Xe]=!1,e.concat()[0]!==e})),Je=Ke("concat"),Qe=function(e){if(!v(e))return!1;var t=e[Xe];return void 0!==t?!!t:ze(e)};je({target:"Array",proto:!0,forced:!Ye||!Je},{concat:function(e){var t,n,r,i,o,a=$e(this),l=Ze(a,0),s=0;for(t=-1,r=arguments.length;t<r;t++)if(Qe(o=-1===t?a:arguments[t])){if(s+(i=ce(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<i;n++,s++)n in o&&Pe(l,s,o[n])}else{if(s>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Pe(l,s++,o)}return l.length=s,l}});var et=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},tt=function(e,t,n){if(et(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},nt=[].push,rt=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=5==e||o;return function(l,s,c,u){for(var f,p,g=$e(l),d=h(g),v=tt(s,c,3),y=ce(d.length),k=0,m=u||Ze,b=t?m(l,y):n?m(l,0):void 0;y>k;k++)if((a||k in d)&&(p=v(f=d[k],k,g),e))if(t)b[k]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return k;case 2:nt.call(b,f)}else if(i)return!1;return o?-1:r||i?i:b}},it={forEach:rt(0),map:rt(1),filter:rt(2),some:rt(3),every:rt(4),find:rt(5),findIndex:rt(6)},ot=function(e,t){var n=[][e];return!!n&&i((function(){n.call(null,t||function(){throw 1},1)}))},at=Object.defineProperty,lt={},st=function(e){throw e},ct=function(e,t){if(m(lt,e))return lt[e];t||(t={});var n=[][e],r=!!m(t,"ACCESSORS")&&t.ACCESSORS,a=m(t,0)?t[0]:st,l=m(t,1)?t[1]:void 0;return lt[e]=!!n&&!i((function(){if(r&&!o)return!0;var e={length:-1};r?at(e,1,{enumerable:!0,get:st}):e[1]=1,n.call(e,a,l)}))},ut=it.forEach,ft=ot("forEach"),pt=ct("forEach"),ht=ft&&pt?[].forEach:function(e){return ut(this,e,arguments.length>1?arguments[1]:void 0)};je({target:"Array",proto:!0,forced:[].forEach!=ht},{forEach:ht});var gt,dt=Object.keys||function(e){return ve(e,ye)},vt=o?Object.defineProperties:function(e,t){E(e);for(var n,r=dt(t),i=r.length,o=0;i>o;)T.f(e,n=r[o++],t[n]);return e},yt=ie("document","documentElement"),kt=G("IE_PROTO"),mt=function(){},bt=function(e){return"<script>"+e+"<\/script>"},xt=function(){try{gt=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;xt=gt?function(e){e.write(bt("")),e.close();var t=e.parentWindow.Object;return e=null,t}(gt):((t=w("iframe")).style.display="none",yt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(bt("document.F=Object")),e.close(),e.F);for(var n=ye.length;n--;)delete xt.prototype[ye[n]];return xt()};H[kt]=!0;var wt=Object.create||function(e,t){var n;return null!==e?(mt.prototype=E(e),n=new mt,mt.prototype=null,n[kt]=e):n=xt(),void 0===t?n:vt(n,t)},St=Ue("unscopables"),_t=Array.prototype;null==_t[St]&&T.f(_t,St,{configurable:!0,value:wt(null)});var At,Et,Ot,Tt=function(e){_t[St][e]=!0},Rt={},It=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),jt=G("IE_PROTO"),zt=Object.prototype,$t=It?Object.getPrototypeOf:function(e){return e=$e(e),m(e,jt)?e[jt]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?zt:null},Pt=Ue("iterator"),Ct=!1;[].keys&&("next"in(Ot=[].keys())?(Et=$t($t(Ot)))!==Object.prototype&&(At=Et):Ct=!0),null==At&&(At={}),m(At,Pt)||R(At,Pt,(function(){return this}));var Lt={IteratorPrototype:At,BUGGY_SAFARI_ITERATORS:Ct},Mt=T.f,Nt=Ue("toStringTag"),Dt=function(e,t,n){e&&!m(e=n?e:e.prototype,Nt)&&Mt(e,Nt,{configurable:!0,value:t})},Ut=Lt.IteratorPrototype,qt=function(){return this},Zt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return E(n),function(e){if(!v(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Ft=Lt.IteratorPrototype,Gt=Lt.BUGGY_SAFARI_ITERATORS,Ht=Ue("iterator"),Wt=function(){return this},Bt=function(e,t,n,r,i,o,a){!function(e,t,n){var r=t+" Iterator";e.prototype=wt(Ut,{next:c(1,n)}),Dt(e,r,!1),Rt[r]=qt}(n,t,r);var l,s,u,f=function(e){if(e===i&&v)return v;if(!Gt&&e in g)return g[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},p=t+" Iterator",h=!1,g=e.prototype,d=g[Ht]||g["@@iterator"]||i&&g[i],v=!Gt&&d||f(i),y="Array"==t&&g.entries||d;if(y&&(l=$t(y.call(new e)),Ft!==Object.prototype&&l.next&&($t(l)!==Ft&&(Zt?Zt(l,Ft):"function"!=typeof l[Ht]&&R(l,Ht,Wt)),Dt(l,p,!0))),"values"==i&&d&&"values"!==d.name&&(h=!0,v=function(){return d.call(this)}),g[Ht]!==v&&R(g,Ht,v),Rt[t]=v,i)if(s={values:f("values"),keys:o?v:f("keys"),entries:f("entries")},a)for(u in s)(Gt||h||!(u in g))&&te(g,u,s[u]);else je({target:t,proto:!0,forced:Gt||h},s);return s},Vt=ee.set,Kt=ee.getterFor("Array Iterator"),Xt=Bt(Array,"Array",(function(e,t){Vt(this,{type:"Array Iterator",target:d(e),index:0,kind:t})}),(function(){var e=Kt(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Rt.Arguments=Rt.Array,Tt("keys"),Tt("values"),Tt("entries");var Yt=[].join,Jt=h!=Object,Qt=ot("join",",");je({target:"Array",proto:!0,forced:Jt||!Qt},{join:function(e){return Yt.call(d(this),void 0===e?",":e)}});var en=Ke("slice"),tn=ct("slice",{ACCESSORS:!0,0:0,1:2}),nn=Ue("species"),rn=[].slice,on=Math.max;je({target:"Array",proto:!0,forced:!en||!tn},{slice:function(e,t){var n,r,i,o=d(this),a=ce(o.length),l=pe(e,a),s=pe(void 0===t?a:t,a);if(ze(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!ze(n.prototype)?v(n)&&null===(n=n[nn])&&(n=void 0):n=void 0,n===Array||void 0===n))return rn.call(o,l,s);for(r=new(void 0===n?Array:n)(on(s-l,0)),i=0;l<s;l++,i++)l in o&&Pe(r,i,o[l]);return r.length=i,r}});var an=T.f,ln=Function.prototype,sn=ln.toString,cn=/^\s*function ([^ (]*)/;o&&!("name"in ln)&&an(ln,"name",{configurable:!0,get:function(){try{return sn.call(this).match(cn)[1]}catch(e){return""}}});var un={};un[Ue("toStringTag")]="z";var fn="[object z]"===String(un),pn=Ue("toStringTag"),hn="Arguments"==f(function(){return arguments}()),gn=fn?f:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),pn))?n:hn?f(t):"Object"==(r=f(t))&&"function"==typeof t.callee?"Arguments":r},dn=fn?{}.toString:function(){return"[object "+gn(this)+"]"};fn||te(Object.prototype,"toString",dn,{unsafe:!0});var vn=r.Promise,yn=Ue("species"),kn=function(e){var t=ie(e),n=T.f;o&&t&&!t[yn]&&n(t,yn,{configurable:!0,get:function(){return this}})},mn=Ue("iterator"),bn=Array.prototype,xn=Ue("iterator"),wn=function(e){var t=e.return;if(void 0!==t)return E(t.call(e)).value},Sn=function(e,t){this.stopped=e,this.result=t},_n=function(e,t,n){var r,i,o,a,l,s,c,u,f=n&&n.that,p=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),g=!(!n||!n.INTERRUPTED),d=tt(t,f,1+p+g),v=function(e){return r&&wn(r),new Sn(!0,e)},y=function(e){return p?(E(e),g?d(e[0],e[1],v):d(e[0],e[1])):g?d(e,v):d(e)};if(h)r=e;else{if("function"!=typeof(i=function(e){if(null!=e)return e[xn]||e["@@iterator"]||Rt[gn(e)]}(e)))throw TypeError("Target is not iterable");if(void 0!==(u=i)&&(Rt.Array===u||bn[mn]===u)){for(o=0,a=ce(e.length);a>o;o++)if((l=y(e[o]))&&l instanceof Sn)return l;return new Sn(!1)}r=i.call(e)}for(s=r.next;!(c=s.call(r)).done;){try{l=y(c.value)}catch(e){throw wn(r),e}if("object"==typeof l&&l&&l instanceof Sn)return l}return new Sn(!1)},An=Ue("iterator"),En=!1;try{var On=0,Tn={next:function(){return{done:!!On++}},return:function(){En=!0}};Tn[An]=function(){return this},Array.from(Tn,(function(){throw 2}))}catch(e){}var Rn,In,jn,zn=Ue("species"),$n=function(e,t){var n,r=E(e).constructor;return void 0===r||null==(n=E(r)[zn])?t:et(n)},Pn=/(iphone|ipod|ipad).*applewebkit/i.test(Fe),Cn="process"==f(r.process),Ln=r.location,Mn=r.setImmediate,Nn=r.clearImmediate,Dn=r.process,Un=r.MessageChannel,qn=r.Dispatch,Zn=0,Fn={},Gn=function(e){if(Fn.hasOwnProperty(e)){var t=Fn[e];delete Fn[e],t()}},Hn=function(e){return function(){Gn(e)}},Wn=function(e){Gn(e.data)},Bn=function(e){r.postMessage(e+"",Ln.protocol+"//"+Ln.host)};Mn&&Nn||(Mn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Fn[++Zn]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Rn(Zn),Zn},Nn=function(e){delete Fn[e]},Cn?Rn=function(e){Dn.nextTick(Hn(e))}:qn&&qn.now?Rn=function(e){qn.now(Hn(e))}:Un&&!Pn?(jn=(In=new Un).port2,In.port1.onmessage=Wn,Rn=tt(jn.postMessage,jn,1)):r.addEventListener&&"function"==typeof postMessage&&!r.importScripts&&Ln&&"file:"!==Ln.protocol&&!i(Bn)?(Rn=Bn,r.addEventListener("message",Wn,!1)):Rn="onreadystatechange"in w("script")?function(e){yt.appendChild(w("script")).onreadystatechange=function(){yt.removeChild(this),Gn(e)}}:function(e){setTimeout(Hn(e),0)});var Vn,Kn,Xn,Yn,Jn,Qn,er,tr,nr={set:Mn,clear:Nn},rr=A.f,ir=nr.set,or=r.MutationObserver||r.WebKitMutationObserver,ar=r.document,lr=r.process,sr=r.Promise,cr=rr(r,"queueMicrotask"),ur=cr&&cr.value;ur||(Vn=function(){var e,t;for(Cn&&(e=lr.domain)&&e.exit();Kn;){t=Kn.fn,Kn=Kn.next;try{t()}catch(e){throw Kn?Yn():Xn=void 0,e}}Xn=void 0,e&&e.enter()},!Pn&&!Cn&&or&&ar?(Jn=!0,Qn=ar.createTextNode(""),new or(Vn).observe(Qn,{characterData:!0}),Yn=function(){Qn.data=Jn=!Jn}):sr&&sr.resolve?(er=sr.resolve(void 0),tr=er.then,Yn=function(){tr.call(er,Vn)}):Yn=Cn?function(){lr.nextTick(Vn)}:function(){ir.call(r,Vn)});var fr,pr,hr,gr,dr=ur||function(e){var t={fn:e,next:void 0};Xn&&(Xn.next=t),Kn||(Kn=t,Yn()),Xn=t},vr=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=et(t),this.reject=et(n)},yr={f:function(e){return new vr(e)}},kr=function(e,t){if(E(e),v(t)&&t.constructor===e)return t;var n=yr.f(e);return(0,n.resolve)(t),n.promise},mr=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},br=nr.set,xr=Ue("species"),wr="Promise",Sr=ee.get,_r=ee.set,Ar=ee.getterFor(wr),Er=vn,Or=r.TypeError,Tr=r.document,Rr=r.process,Ir=ie("fetch"),jr=yr.f,zr=jr,$r=!!(Tr&&Tr.createEvent&&r.dispatchEvent),Pr="function"==typeof PromiseRejectionEvent,Cr=Re(wr,(function(){if(!(L(Er)!==String(Er))){if(66===Be)return!0;if(!Cn&&!Pr)return!0}if(Be>=51&&/native code/.test(Er))return!1;var e=Er.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[xr]=t,!(e.then((function(){}))instanceof t)})),Lr=Cr||!function(e,t){if(!t&&!En)return!1;var n=!1;try{var r={};r[An]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Er.all(e).catch((function(){}))})),Mr=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},Nr=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;dr((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,l,s,c=n[o++],u=i?c.ok:c.fail,f=c.resolve,p=c.reject,h=c.domain;try{u?(i||(2===e.rejection&&Zr(e),e.rejection=1),!0===u?a=r:(h&&h.enter(),a=u(r),h&&(h.exit(),s=!0)),a===c.promise?p(Or("Promise-chain cycle")):(l=Mr(a))?l.call(a,f,p):f(a)):p(r)}catch(e){h&&!s&&h.exit(),p(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ur(e)}))}},Dr=function(e,t,n){var i,o;$r?((i=Tr.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),r.dispatchEvent(i)):i={promise:t,reason:n},!Pr&&(o=r["on"+e])?o(i):"unhandledrejection"===e&&function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Ur=function(e){br.call(r,(function(){var t,n=e.facade,r=e.value;if(qr(e)&&(t=mr((function(){Cn?Rr.emit("unhandledRejection",r,n):Dr("unhandledrejection",n,r)})),e.rejection=Cn||qr(e)?2:1,t.error))throw t.value}))},qr=function(e){return 1!==e.rejection&&!e.parent},Zr=function(e){br.call(r,(function(){var t=e.facade;Cn?Rr.emit("rejectionHandled",t):Dr("rejectionhandled",t,e.value)}))},Fr=function(e,t,n){return function(r){e(t,r,n)}},Gr=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Nr(e,!0))},Hr=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Or("Promise can't be resolved itself");var r=Mr(t);r?dr((function(){var n={done:!1};try{r.call(t,Fr(Hr,n,e),Fr(Gr,n,e))}catch(t){Gr(n,t,e)}})):(e.value=t,e.state=1,Nr(e,!1))}catch(t){Gr({done:!1},t,e)}}};Cr&&(Er=function(e){!function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,Er,wr),et(e),fr.call(this);var t=Sr(this);try{e(Fr(Hr,t),Fr(Gr,t))}catch(e){Gr(t,e)}},(fr=function(e){_r(this,{type:wr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(e,t,n){for(var r in t)te(e,r,t[r],n);return e}(Er.prototype,{then:function(e,t){var n=Ar(this),r=jr($n(this,Er));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Cn?Rr.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Nr(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),pr=function(){var e=new fr,t=Sr(e);this.promise=e,this.resolve=Fr(Hr,t),this.reject=Fr(Gr,t)},yr.f=jr=function(e){return e===Er||e===hr?new pr(e):zr(e)},"function"==typeof vn&&(gr=vn.prototype.then,te(vn.prototype,"then",(function(e,t){var n=this;return new Er((function(e,t){gr.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Ir&&je({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return kr(Er,Ir.apply(r,arguments))}}))),je({global:!0,wrap:!0,forced:Cr},{Promise:Er}),Dt(Er,wr,!1),kn(wr),hr=ie(wr),je({target:wr,stat:!0,forced:Cr},{reject:function(e){var t=jr(this);return t.reject.call(void 0,e),t.promise}}),je({target:wr,stat:!0,forced:Cr},{resolve:function(e){return kr(this,e)}}),je({target:wr,stat:!0,forced:Lr},{all:function(e){var t=this,n=jr(t),r=n.resolve,i=n.reject,o=mr((function(){var n=et(t.resolve),o=[],a=0,l=1;_n(e,(function(e){var s=a++,c=!1;o.push(void 0),l++,n.call(t,e).then((function(e){c||(c=!0,o[s]=e,--l||r(o))}),i)})),--l||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=jr(t),r=n.reject,i=mr((function(){var i=et(t.resolve);_n(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Wr=Ue("match"),Br=function(e){var t;return v(e)&&(void 0!==(t=e[Wr])?!!t:"RegExp"==f(e))},Vr=function(){var e=E(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function Kr(e,t){return RegExp(e,t)}var Xr={UNSUPPORTED_Y:i((function(){var e=Kr("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:i((function(){var e=Kr("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},Yr=T.f,Jr=me.f,Qr=ee.set,ei=Ue("match"),ti=r.RegExp,ni=ti.prototype,ri=/a/g,ii=/a/g,oi=new ti(ri)!==ri,ai=Xr.UNSUPPORTED_Y;if(o&&Re("RegExp",!oi||ai||i((function(){return ii[ei]=!1,ti(ri)!=ri||ti(ii)==ii||"/a/i"!=ti(ri,"i")})))){for(var li=function(e,t){var n,r=this instanceof li,i=Br(e),o=void 0===t;if(!r&&i&&e.constructor===li&&o)return e;oi?i&&!o&&(e=e.source):e instanceof li&&(o&&(t=Vr.call(e)),e=e.source),ai&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var a,l,s,c,u,f=(a=oi?new ti(e,t):ti(e,t),l=r?this:ni,s=li,Zt&&"function"==typeof(c=l.constructor)&&c!==s&&v(u=c.prototype)&&u!==s.prototype&&Zt(a,u),a);return ai&&n&&Qr(f,{sticky:n}),f},si=function(e){e in li||Yr(li,e,{configurable:!0,get:function(){return ti[e]},set:function(t){ti[e]=t}})},ci=Jr(ti),ui=0;ci.length>ui;)si(ci[ui++]);ni.constructor=li,li.prototype=ni,te(r,"RegExp",li)}kn("RegExp");var fi=RegExp.prototype.exec,pi=String.prototype.replace,hi=fi,gi=function(){var e=/a/,t=/b*/g;return fi.call(e,"a"),fi.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),di=Xr.UNSUPPORTED_Y||Xr.BROKEN_CARET,vi=void 0!==/()??/.exec("")[1];(gi||vi||di)&&(hi=function(e){var t,n,r,i,o=this,a=di&&o.sticky,l=Vr.call(o),s=o.source,c=0,u=e;return a&&(-1===(l=l.replace("y","")).indexOf("g")&&(l+="g"),u=String(e).slice(o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==e[o.lastIndex-1])&&(s="(?: "+s+")",u=" "+u,c++),n=new RegExp("^(?:"+s+")",l)),vi&&(n=new RegExp("^"+s+"$(?!\\s)",l)),gi&&(t=o.lastIndex),r=fi.call(a?n:o,u),a?r?(r.input=r.input.slice(c),r[0]=r[0].slice(c),r.index=o.lastIndex,o.lastIndex+=r[0].length):o.lastIndex=0:gi&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),vi&&r&&r.length>1&&pi.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var yi=hi;je({target:"RegExp",proto:!0,forced:/./.exec!==yi},{exec:yi});var ki=RegExp.prototype,mi=ki.toString,bi=i((function(){return"/a/b"!=mi.call({source:"a",flags:"b"})})),xi="toString"!=mi.name;(bi||xi)&&te(RegExp.prototype,"toString",(function(){var e=E(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in ki)?Vr.call(e):n)}),{unsafe:!0});var wi=function(e){return function(t,n){var r,i,o=String(g(t)),a=le(n),l=o.length;return a<0||a>=l?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===l||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}},Si={codeAt:wi(!1),charAt:wi(!0)},_i=Si.charAt,Ai=ee.set,Ei=ee.getterFor("String Iterator");Bt(String,"String",(function(e){Ai(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Ei(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=_i(n,r),t.index+=e.length,{value:e,done:!1})}));var Oi=Ue("species"),Ti=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Ri="$0"==="a".replace(/./,"$0"),Ii=Ue("replace"),ji=!!/./[Ii]&&""===/./[Ii]("a","$0"),zi=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),$i=function(e,t,n,r){var o=Ue(e),a=!i((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),l=a&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Oi]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!a||!l||"replace"===e&&(!Ti||!Ri||ji)||"split"===e&&!zi){var s=/./[o],c=n(o,""[e],(function(e,t,n,r,i){return t.exec===yi?a&&!i?{done:!0,value:s.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Ri,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:ji}),u=c[0],f=c[1];te(String.prototype,e,u),te(RegExp.prototype,o,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)})}r&&R(RegExp.prototype[o],"sham",!0)},Pi=Si.charAt,Ci=function(e,t,n){return t+(n?Pi(e,t).length:1)},Li=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==f(e))throw TypeError("RegExp#exec called on incompatible receiver");return yi.call(e,t)};$i("match",1,(function(e,t,n){return[function(t){var n=g(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var i=E(e),o=String(this);if(!i.global)return Li(i,o);var a=i.unicode;i.lastIndex=0;for(var l,s=[],c=0;null!==(l=Li(i,o));){var u=String(l[0]);s[c]=u,""===u&&(i.lastIndex=Ci(o,ce(i.lastIndex),a)),c++}return 0===c?null:s}]}));var Mi=Math.max,Ni=Math.min,Di=Math.floor,Ui=/\$([$&'`]|\d\d?|<[^>]*>)/g,qi=/\$([$&'`]|\d\d?)/g;$i("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,o=r.REPLACE_KEEPS_$0,a=i?"$":"$0";return[function(n,r){var i=g(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&o||"string"==typeof r&&-1===r.indexOf(a)){var s=n(t,e,this,r);if(s.done)return s.value}var c=E(e),u=String(this),f="function"==typeof r;f||(r=String(r));var p=c.global;if(p){var h=c.unicode;c.lastIndex=0}for(var g=[];;){var d=Li(c,u);if(null===d)break;if(g.push(d),!p)break;""===String(d[0])&&(c.lastIndex=Ci(u,ce(c.lastIndex),h))}for(var v,y="",k=0,m=0;m<g.length;m++){d=g[m];for(var b=String(d[0]),x=Mi(Ni(le(d.index),u.length),0),w=[],S=1;S<d.length;S++)w.push(void 0===(v=d[S])?v:String(v));var _=d.groups;if(f){var A=[b].concat(w,x,u);void 0!==_&&A.push(_);var O=String(r.apply(void 0,A))}else O=l(b,u,x,w,_,r);x>=k&&(y+=u.slice(k,x)+O,k=x+b.length)}return y+u.slice(k)}];function l(e,n,r,i,o,a){var l=r+e.length,s=i.length,c=qi;return void 0!==o&&(o=$e(o),c=Ui),t.call(a,c,(function(t,a){var c;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(l);case"<":c=o[a.slice(1,-1)];break;default:var u=+a;if(0===u)return t;if(u>s){var f=Di(u/10);return 0===f?t:f<=s?void 0===i[f-1]?a.charAt(1):i[f-1]+a.charAt(1):t}c=i[u-1]}return void 0===c?"":c}))}}));var Zi=[].push,Fi=Math.min,Gi=!i((function(){return!RegExp(4294967295,"y")}));$i("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(g(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Br(e))return t.call(r,e,i);for(var o,a,l,s=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,f=new RegExp(e.source,c+"g");(o=yi.call(f,r))&&!((a=f.lastIndex)>u&&(s.push(r.slice(u,o.index)),o.length>1&&o.index<r.length&&Zi.apply(s,o.slice(1)),l=o[0].length,u=a,s.length>=i));)f.lastIndex===o.index&&f.lastIndex++;return u===r.length?!l&&f.test("")||s.push(""):s.push(r.slice(u)),s.length>i?s.slice(0,i):s}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=g(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var o=n(r,e,this,i,r!==t);if(o.done)return o.value;var a=E(e),l=String(this),s=$n(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(Gi?"y":"g"),f=new s(Gi?a:"^(?:"+a.source+")",u),p=void 0===i?4294967295:i>>>0;if(0===p)return[];if(0===l.length)return null===Li(f,l)?[l]:[];for(var h=0,g=0,d=[];g<l.length;){f.lastIndex=Gi?g:0;var v,y=Li(f,Gi?l:l.slice(g));if(null===y||(v=Fi(ce(f.lastIndex+(Gi?0:g)),l.length))===h)g=Ci(l,g,c);else{if(d.push(l.slice(h,g)),d.length===p)return d;for(var k=1;k<=y.length-1;k++)if(d.push(y[k]),d.length===p)return d;g=h=v}}return d.push(l.slice(h)),d}]}),!Gi);var Hi="\t\n\v\f\r \u2028\u2029\ufeff",Wi="["+Hi+"]",Bi=RegExp("^"+Wi+Wi+"*"),Vi=RegExp(Wi+Wi+"*$"),Ki=function(e){return function(t){var n=String(g(t));return 1&e&&(n=n.replace(Bi,"")),2&e&&(n=n.replace(Vi,"")),n}},Xi={start:Ki(1),end:Ki(2),trim:Ki(3)},Yi=function(e){return i((function(){return!!Hi[e]()||"​…᠎"!="​…᠎"[e]()||Hi[e].name!==e}))},Ji=Xi.trim;je({target:"String",proto:!0,forced:Yi("trim")},{trim:function(){return Ji(this)}});var Qi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var eo in Qi){var to=r[eo],no=to&&to.prototype;if(no&&no.forEach!==ht)try{R(no,"forEach",ht)}catch(e){no.forEach=ht}}var ro=Ue("iterator"),io=Ue("toStringTag"),oo=Xt.values;for(var ao in Qi){var lo=r[ao],so=lo&&lo.prototype;if(so){if(so[ro]!==oo)try{R(so,ro,oo)}catch(e){so[ro]=oo}if(so[io]||R(so,io,ao),Qi[ao])for(var co in Xt)if(so[co]!==Xt[co])try{R(so,co,Xt[co])}catch(e){so[co]=Xt[co]}}}function uo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function po(e,t,n){return t&&fo(e.prototype,t),n&&fo(e,n),e}function ho(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||yo(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(e,t){if(e){if("string"==typeof e)return ko(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ko(e,t):void 0}}function ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mo(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=yo(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}var bo=ge.includes,xo=ct("indexOf",{ACCESSORS:!0,1:0});je({target:"Array",proto:!0,forced:!xo},{includes:function(e){return bo(this,e,arguments.length>1?arguments[1]:void 0)}}),Tt("includes");var wo=Math.min,So=[].lastIndexOf,_o=!!So&&1/[1].lastIndexOf(1,-0)<0,Ao=ot("lastIndexOf"),Eo=ct("indexOf",{ACCESSORS:!0,1:0}),Oo=_o||!Ao||!Eo?function(e){if(_o)return So.apply(this,arguments)||0;var t=d(this),n=ce(t.length),r=n-1;for(arguments.length>1&&(r=wo(r,le(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:So;je({target:"Array",proto:!0,forced:Oo!==[].lastIndexOf},{lastIndexOf:Oo});var To=i((function(){dt(1)}));je({target:"Object",stat:!0,forced:To},{keys:function(e){return dt($e(e))}});var Ro=function(e){if(Br(e))throw TypeError("The method doesn't accept regular expressions");return e},Io=Ue("match"),jo=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Io]=!1,"/./"[e](t)}catch(e){}}return!1};je({target:"String",proto:!0,forced:!jo("includes")},{includes:function(e){return!!~String(g(this)).indexOf(Ro(e),arguments.length>1?arguments[1]:void 0)}});var zo=/"/g;je({target:"String",proto:!0,forced:function(e){return i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}("link")},{link:function(e){return t="a",n="href",r=e,i=String(g(this)),o="<"+t,""!==n&&(o+=" "+n+'="'+String(r).replace(zo,"&quot;")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}});var $o=ge.indexOf,Po=[].indexOf,Co=!!Po&&1/[1].indexOf(1,-0)<0,Lo=ot("indexOf"),Mo=ct("indexOf",{ACCESSORS:!0,1:0});je({target:"Array",proto:!0,forced:Co||!Lo||!Mo},{indexOf:function(e){return Co?Po.apply(this,arguments)||0:$o(this,e,arguments.length>1?arguments[1]:void 0)}});var No=it.map,Do=Ke("map"),Uo=ct("map");je({target:"Array",proto:!0,forced:!Do||!Uo},{map:function(e){return No(this,e,arguments.length>1?arguments[1]:void 0)}});var qo=Ke("splice"),Zo=ct("splice",{ACCESSORS:!0,0:0,1:2}),Fo=Math.max,Go=Math.min;je({target:"Array",proto:!0,forced:!qo||!Zo},{splice:function(e,t){var n,r,i,o,a,l,s=$e(this),c=ce(s.length),u=pe(e,c),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=c-u):(n=f-2,r=Go(Fo(le(t),0),c-u)),c+n-r>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(i=Ze(s,r),o=0;o<r;o++)(a=u+o)in s&&Pe(i,o,s[a]);if(i.length=r,n<r){for(o=u;o<c-r;o++)l=o+n,(a=o+r)in s?s[l]=s[a]:delete s[l];for(o=c;o>c-r+n;o--)delete s[o-1]}else if(n>r)for(o=c-r;o>u;o--)l=o+n-1,(a=o+r-1)in s?s[l]=s[a]:delete s[l];for(o=0;o<n;o++)s[o+u]=arguments[o+2];return s.length=c-r+n,i}});var Ho,Wo=A.f,Bo="".endsWith,Vo=Math.min,Ko=jo("endsWith"),Xo=!(Ko||(Ho=Wo(String.prototype,"endsWith"),!Ho||Ho.writable));je({target:"String",proto:!0,forced:!Xo&&!Ko},{endsWith:function(e){var t=String(g(this));Ro(e);var n=arguments.length>1?arguments[1]:void 0,r=ce(t.length),i=void 0===n?r:Vo(ce(n),r),o=String(e);return Bo?Bo.call(t,o,i):t.slice(i-o.length,i)===o}});var Yo=A.f,Jo="".startsWith,Qo=Math.min,ea=jo("startsWith"),ta=!ea&&!!function(){var e=Yo(String.prototype,"startsWith");return e&&!e.writable}();je({target:"String",proto:!0,forced:!ta&&!ea},{startsWith:function(e){var t=String(g(this));Ro(e);var n=ce(Qo(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Jo?Jo.call(t,r,n):t.slice(n,n+r.length)===r}});var na=Xi.end,ra=Yi("trimEnd"),ia=ra?function(){return na(this)}:"".trimEnd;je({target:"String",proto:!0,forced:ra},{trimEnd:ia,trimRight:ia});var oa=t((function(e){function t(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),aa=/[&<>"']/,la=/[&<>"']/g,sa=/[<>"']|&(?!#?\w+;)/,ca=/[<>"']|&(?!#?\w+;)/g,ua={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fa=function(e){return ua[e]};var pa=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function ha(e){return e.replace(pa,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var ga=/(^|[^\[])\^/g;var da=/[^\w:]/g,va=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var ya={},ka=/^[^:]+:\/*[^/]*$/,ma=/^([^:]+:)[\s\S]*$/,ba=/^([^:]+:\/*[^/]*)[\s\S]*$/;function xa(e,t){ya[" "+e]||(ka.test(e)?ya[" "+e]=e+"/":ya[" "+e]=wa(e,"/",!0));var n=-1===(e=ya[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(ma,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(ba,"$1")+t:e+t}function wa(e,t,n){var r=e.length;if(0===r)return"";for(var i=0;i<r;){var o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.substr(0,r-i)}var Sa=function(e,t){if(t){if(aa.test(e))return e.replace(la,fa)}else if(sa.test(e))return e.replace(ca,fa);return e},_a=ha,Aa=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,r){return r=(r=r.source||r).replace(ga,"$1"),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n},Ea=function(e,t,n){if(e){var r;try{r=decodeURIComponent(ha(n)).replace(da,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!va.test(n)&&(n=xa(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},Oa={exec:function(){}},Ta=function(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ra=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var r=!1,i=t;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},Ia=wa,ja=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,r=0,i=0;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&--r<0)return i;return-1},za=function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},$a=function(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e},Pa=oa.defaults,Ca=Ia,La=Ra,Ma=Sa,Na=ja;function Da(e,t,n){var r=t.href,i=t.title?Ma(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:i,text:o}:{type:"image",raw:n,href:r,title:i,text:Ma(o)}}var Ua=function(){function e(t){uo(this,e),this.options=t||Pa}return po(e,[{key:"space",value:function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}},{key:"code",value:function(e,t){var n=this.rules.block.code.exec(e);if(n){var r=t[t.length-1];if(r&&"paragraph"===r.type)return{raw:n[0],text:n[0].trimRight()};var i=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Ca(i,"\n")}}}},{key:"fences",value:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:vo(t,1)[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}}},{key:"heading",value:function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}}},{key:"nptable",value:function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:La(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=La(n.cells[r],n.header.length);return n}}}},{key:"hr",value:function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}},{key:"blockquote",value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}}},{key:"list",value:function(e){var t=this.rules.block.list.exec(e);if(t){var n,r,i,o,a,l,s,c,u=t[0],f=t[2],p=f.length>1,h={type:"list",raw:u,ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]},g=t[0].match(this.rules.block.item),d=!1,v=g.length;i=this.rules.block.listItemStart.exec(g[0]);for(var y=0;y<v;y++){if(u=n=g[y],y!==v-1){if((o=this.rules.block.listItemStart.exec(g[y+1]))[1].length>i[0].length||o[1].length>3){g.splice(y,2,g[y]+"\n"+g[y+1]),y--,v--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==f[f.length-1]:p===(1===o[2].length))&&(a=g.slice(y+1).join("\n"),h.raw=h.raw.substring(0,h.raw.length-a.length),y=v-1),i=o}r=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(r-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+r+"}","gm"),"")),l=d||/\n\n(?!\s*$)/.test(n),y!==v-1&&(d="\n"===n.charAt(n.length-1),l||(l=d)),l&&(h.loose=!0),c=void 0,(s=/^\[[ xX]\] /.test(n))&&(c=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),h.items.push({type:"list_item",raw:u,task:s,checked:c,loose:l,text:n})}return h}}},{key:"html",value:function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Ma(t[0]):t[0]}}},{key:"def",value:function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}},{key:"table",value:function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:La(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=La(n.cells[r].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}}},{key:"lheading",value:function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}}},{key:"paragraph",value:function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}}},{key:"text",value:function(e,t){var n=this.rules.block.text.exec(e);if(n){var r=t[t.length-1];return r&&"text"===r.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}}},{key:"escape",value:function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ma(t[1])}}},{key:"tag",value:function(e,t,n){var r=this.rules.inline.tag.exec(e);if(r)return!t&&/^<a /i.test(r[0])?t=!0:t&&/^<\/a>/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Ma(r[0]):r[0]}}},{key:"link",value:function(e){var t=this.rules.inline.link.exec(e);if(t){var n=Na(t[2],"()");if(n>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,r).trim(),t[3]=""}var i=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a?(i=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return Da(t,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}}},{key:"reflink",value:function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Da(n,r,n[0])}}},{key:"strong",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,i[0].length),text:e.slice(2,i[0].length-2)}}}},{key:"em",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,i[0].length),text:e.slice(1,i[0].length-1)}}}},{key:"codespan",value:function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=n.startsWith(" ")&&n.endsWith(" ");return r&&i&&(n=n.substring(1,n.length-1)),n=Ma(n,!0),{type:"codespan",raw:t[0],text:n}}}},{key:"br",value:function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}},{key:"del",value:function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}}},{key:"autolink",value:function(e,t){var n,r,i=this.rules.inline.autolink.exec(e);if(i)return r="@"===i[2]?"mailto:"+(n=Ma(this.options.mangle?t(i[1]):i[1])):n=Ma(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}},{key:"url",value:function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if("@"===n[2])i="mailto:"+(r=Ma(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);r=Ma(n[0]),i="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}},{key:"inlineText",value:function(e,t,n){var r,i=this.rules.inline.text.exec(e);if(i)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Ma(i[0]):i[0]:Ma(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}]),e}(),qa=Oa,Za=Aa,Fa=Ta,Ga={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:qa,table:qa,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Ga.def=Za(Ga.def).replace("label",Ga._label).replace("title",Ga._title).getRegex(),Ga.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ga.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Ga.item=Za(Ga.item,"gm").replace(/bull/g,Ga.bullet).getRegex(),Ga.listItemStart=Za(/^( *)(bull)/).replace("bull",Ga.bullet).getRegex(),Ga.list=Za(Ga.list).replace(/bull/g,Ga.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ga.def.source+")").getRegex(),Ga._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ga._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Ga.html=Za(Ga.html,"i").replace("comment",Ga._comment).replace("tag",Ga._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ga.paragraph=Za(Ga._paragraph).replace("hr",Ga.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ga._tag).getRegex(),Ga.blockquote=Za(Ga.blockquote).replace("paragraph",Ga.paragraph).getRegex(),Ga.normal=Fa({},Ga),Ga.gfm=Fa({},Ga.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ga.gfm.nptable=Za(Ga.gfm.nptable).replace("hr",Ga.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ga._tag).getRegex(),Ga.gfm.table=Za(Ga.gfm.table).replace("hr",Ga.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ga._tag).getRegex(),Ga.pedantic=Fa({},Ga.normal,{html:Za("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ga._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:qa,paragraph:Za(Ga.normal._paragraph).replace("hr",Ga.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ga.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Ha={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qa,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qa,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};Ha.punctuation=Za(Ha.punctuation).replace(/punctuation/g,Ha._punctuation).getRegex(),Ha._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Ha._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Ha._comment=Za(Ga._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ha.em.start=Za(Ha.em.start).replace(/punctuation/g,Ha._punctuation).getRegex(),Ha.em.middle=Za(Ha.em.middle).replace(/punctuation/g,Ha._punctuation).replace(/overlapSkip/g,Ha._overlapSkip).getRegex(),Ha.em.endAst=Za(Ha.em.endAst,"g").replace(/punctuation/g,Ha._punctuation).getRegex(),Ha.em.endUnd=Za(Ha.em.endUnd,"g").replace(/punctuation/g,Ha._punctuation).getRegex(),Ha.strong.start=Za(Ha.strong.start).replace(/punctuation/g,Ha._punctuation).getRegex(),Ha.strong.middle=Za(Ha.strong.middle).replace(/punctuation/g,Ha._punctuation).replace(/overlapSkip/g,Ha._overlapSkip).getRegex(),Ha.strong.endAst=Za(Ha.strong.endAst,"g").replace(/punctuation/g,Ha._punctuation).getRegex(),Ha.strong.endUnd=Za(Ha.strong.endUnd,"g").replace(/punctuation/g,Ha._punctuation).getRegex(),Ha.blockSkip=Za(Ha._blockSkip,"g").getRegex(),Ha.overlapSkip=Za(Ha._overlapSkip,"g").getRegex(),Ha._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ha._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ha._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ha.autolink=Za(Ha.autolink).replace("scheme",Ha._scheme).replace("email",Ha._email).getRegex(),Ha._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ha.tag=Za(Ha.tag).replace("comment",Ha._comment).replace("attribute",Ha._attribute).getRegex(),Ha._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ha._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Ha._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ha.link=Za(Ha.link).replace("label",Ha._label).replace("href",Ha._href).replace("title",Ha._title).getRegex(),Ha.reflink=Za(Ha.reflink).replace("label",Ha._label).getRegex(),Ha.reflinkSearch=Za(Ha.reflinkSearch,"g").replace("reflink",Ha.reflink).replace("nolink",Ha.nolink).getRegex(),Ha.normal=Fa({},Ha),Ha.pedantic=Fa({},Ha.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Za(/^!?\[(label)\]\((.*?)\)/).replace("label",Ha._label).getRegex(),reflink:Za(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ha._label).getRegex()}),Ha.gfm=Fa({},Ha.normal,{escape:Za(Ha.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),Ha.gfm.url=Za(Ha.gfm.url,"i").replace("email",Ha.gfm._extended_email).getRegex(),Ha.breaks=Fa({},Ha.gfm,{br:Za(Ha.br).replace("{2,}","*").getRegex(),text:Za(Ha.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Wa={block:Ga,inline:Ha},Ba=oa.defaults,Va=Wa.block,Ka=Wa.inline,Xa=$a;function Ya(e){return e.replace(/---/g,"").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"").replace(/\.{3}/g,"")}function Ja(e){var t,n,r="",i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var Qa=function(){function e(t){uo(this,e),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ba,this.options.tokenizer=this.options.tokenizer||new Ua,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var n={block:Va.normal,inline:Ka.normal};this.options.pedantic?(n.block=Va.pedantic,n.inline=Ka.pedantic):this.options.gfm&&(n.block=Va.gfm,this.options.breaks?n.inline=Ka.breaks:n.inline=Ka.gfm),this.tokenizer.rules=n}return po(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}},{key:"blockTokens",value:function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];for(e=e.replace(/^ +$/gm,"");e;)if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),t.type&&o.push(t);else if(t=this.tokenizer.code(e,o))e=e.substring(t.raw.length),t.type?o.push(t):((i=o[o.length-1]).raw+="\n"+t.raw,i.text+="\n"+t.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.nptable(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),t.tokens=this.blockTokens(t.text,[],a),o.push(t);else if(t=this.tokenizer.list(e)){for(e=e.substring(t.raw.length),r=t.items.length,n=0;n<r;n++)t.items[n].tokens=this.blockTokens(t.items[n].text,[],!1);o.push(t)}else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),o.push(t);else if(a&&(t=this.tokenizer.def(e)))e=e.substring(t.raw.length),this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),o.push(t);else if(a&&(t=this.tokenizer.paragraph(e)))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.text(e,o))e=e.substring(t.raw.length),t.type?o.push(t):((i=o[o.length-1]).raw+="\n"+t.raw,i.text+="\n"+t.text);else if(e){var l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}return o}},{key:"inline",value:function(e){var t,n,r,i,o,a,l=e.length;for(t=0;t<l;t++)switch((a=e[t]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},i=a.header.length,n=0;n<i;n++)a.tokens.header[n]=[],this.inlineTokens(a.header[n],a.tokens.header[n]);for(i=a.cells.length,n=0;n<i;n++)for(o=a.cells[n],a.tokens.cells[n]=[],r=0;r<o.length;r++)a.tokens.cells[n][r]=[],this.inlineTokens(o[r],a.tokens.cells[n][r]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(i=a.items.length,n=0;n<i;n++)this.inline(a.items[n].tokens)}return e}},{key:"inlineTokens",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",l=e;if(this.tokens.links){var s=Object.keys(this.tokens.links);if(s.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(l));)s.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,n.index)+"["+Xa("a",n[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,n.index)+"["+Xa("a",n[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),r.push(t);else if(t=this.tokenizer.tag(e,i,o))e=e.substring(t.raw.length),i=t.inLink,o=t.inRawBlock,r.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),"link"===t.type&&(t.tokens=this.inlineTokens(t.text,[],!0,o)),r.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),"link"===t.type&&(t.tokens=this.inlineTokens(t.text,[],!0,o)),r.push(t);else if(t=this.tokenizer.strong(e,l,a))e=e.substring(t.raw.length),t.tokens=this.inlineTokens(t.text,[],i,o),r.push(t);else if(t=this.tokenizer.em(e,l,a))e=e.substring(t.raw.length),t.tokens=this.inlineTokens(t.text,[],i,o),r.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),r.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),r.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),t.tokens=this.inlineTokens(t.text,[],i,o),r.push(t);else if(t=this.tokenizer.autolink(e,Ja))e=e.substring(t.raw.length),r.push(t);else if(i||!(t=this.tokenizer.url(e,Ja))){if(t=this.tokenizer.inlineText(e,o,Ya))e=e.substring(t.raw.length),a=t.raw.slice(-1),r.push(t);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(t.raw.length),r.push(t);return r}}],[{key:"lex",value:function(t,n){return new e(n).lex(t)}},{key:"lexInline",value:function(t,n){return new e(n).inlineTokens(t)}},{key:"rules",get:function(){return{block:Va,inline:Ka}}}]),e}(),el=oa.defaults,tl=Ea,nl=Sa,rl=function(){function e(t){uo(this,e),this.options=t||el}return po(e,[{key:"code",value:function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'<pre><code class="'+this.options.langPrefix+nl(r,!0)+'">'+(n?e:nl(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:nl(e,!0))+"</code></pre>\n"}},{key:"blockquote",value:function(e){return"<blockquote>\n"+e+"</blockquote>\n"}},{key:"html",value:function(e){return e}},{key:"heading",value:function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}},{key:"hr",value:function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}},{key:"list",value:function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}},{key:"listitem",value:function(e){return"<li>"+e+"</li>\n"}},{key:"checkbox",value:function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}},{key:"paragraph",value:function(e){return"<p>"+e+"</p>\n"}},{key:"table",value:function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}},{key:"tablerow",value:function(e){return"<tr>\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}},{key:"strong",value:function(e){return"<strong>"+e+"</strong>"}},{key:"em",value:function(e){return"<em>"+e+"</em>"}},{key:"codespan",value:function(e){return"<code>"+e+"</code>"}},{key:"br",value:function(){return this.options.xhtml?"<br/>":"<br>"}},{key:"del",value:function(e){return"<del>"+e+"</del>"}},{key:"link",value:function(e,t,n){if(null===(e=tl(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+nl(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}},{key:"image",value:function(e,t,n){if(null===(e=tl(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"}},{key:"text",value:function(e){return e}}]),e}(),il=function(){function e(){uo(this,e)}return po(e,[{key:"strong",value:function(e){return e}},{key:"em",value:function(e){return e}},{key:"codespan",value:function(e){return e}},{key:"del",value:function(e){return e}},{key:"html",value:function(e){return e}},{key:"text",value:function(e){return e}},{key:"link",value:function(e,t,n){return""+n}},{key:"image",value:function(e,t,n){return""+n}},{key:"br",value:function(){return""}}]),e}(),ol=function(){function e(){uo(this,e),this.seen={}}return po(e,[{key:"serialize",value:function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}},{key:"getNextSafeSlug",value:function(e,t){var n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{n=e+"-"+ ++r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}},{key:"slug",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}]),e}(),al=oa.defaults,ll=_a,sl=function(){function e(t){uo(this,e),this.options=t||al,this.options.renderer=this.options.renderer||new rl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new il,this.slugger=new ol}return po(e,[{key:"parse",value:function(e){var t,n,r,i,o,a,l,s,c,u,f,p,h,g,d,v,y,k,m=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],b="",x=e.length;for(t=0;t<x;t++)switch((u=e[t]).type){case"space":continue;case"hr":b+=this.renderer.hr();continue;case"heading":b+=this.renderer.heading(this.parseInline(u.tokens),u.depth,ll(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":b+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(s="",l="",i=u.header.length,n=0;n<i;n++)l+=this.renderer.tablecell(this.parseInline(u.tokens.header[n]),{header:!0,align:u.align[n]});for(s+=this.renderer.tablerow(l),c="",i=u.cells.length,n=0;n<i;n++){for(l="",o=(a=u.tokens.cells[n]).length,r=0;r<o;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:u.align[r]});c+=this.renderer.tablerow(l)}b+=this.renderer.table(s,c);continue;case"blockquote":c=this.parse(u.tokens),b+=this.renderer.blockquote(c);continue;case"list":for(f=u.ordered,p=u.start,h=u.loose,i=u.items.length,c="",n=0;n<i;n++)v=(d=u.items[n]).checked,y=d.task,g="",d.task&&(k=this.renderer.checkbox(v),h?d.tokens.length>0&&"text"===d.tokens[0].type?(d.tokens[0].text=k+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&"text"===d.tokens[0].tokens[0].type&&(d.tokens[0].tokens[0].text=k+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:k}):g+=k),g+=this.parse(d.tokens,h),c+=this.renderer.listitem(g,y,v);b+=this.renderer.list(c,f,p);continue;case"html":b+=this.renderer.html(u.text);continue;case"paragraph":b+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(c=u.tokens?this.parseInline(u.tokens):u.text;t+1<x&&"text"===e[t+1].type;)c+="\n"+((u=e[++t]).tokens?this.parseInline(u.tokens):u.text);b+=m?this.renderer.paragraph(c):c;continue;default:var w='Token with "'+u.type+'" type was not found.';if(this.options.silent)return void console.error(w);throw new Error(w)}return b}},{key:"parseInline",value:function(e,t){t=t||this.renderer;var n,r,i="",o=e.length;for(n=0;n<o;n++)switch((r=e[n]).type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:var a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return i}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}},{key:"parseInline",value:function(t,n){return new e(n).parseInline(t)}}]),e}(),cl=Ta,ul=za,fl=Sa,pl=oa.getDefaults,hl=oa.changeDefaults,gl=oa.defaults;function dl(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=cl({},dl.defaults,t||{}),ul(t),n){var r,i=t.highlight;try{r=Qa.lex(e,t)}catch(e){return n(e)}var o=function(e){var o;if(!e)try{o=sl.parse(r,t)}catch(t){e=t}return t.highlight=i,e?n(e):n(null,o)};if(!i||i.length<3)return o();if(delete t.highlight,!r.length)return o();var a=0;return dl.walkTokens(r,(function(e){"code"===e.type&&(a++,setTimeout((function(){i(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0===--a&&o()}))}),0))})),void(0===a&&o())}try{var l=Qa.lex(e,t);return t.walkTokens&&dl.walkTokens(l,t.walkTokens),sl.parse(l,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+fl(e.message+"",!0)+"</pre>";throw e}}dl.options=dl.setOptions=function(e){return cl(dl.defaults,e),hl(dl.defaults),dl},dl.getDefaults=pl,dl.defaults=gl,dl.use=function(e){var t=cl({},e);if(e.renderer&&function(){var n=dl.defaults.renderer||new rl,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var l=e.renderer[t].apply(n,o);return!1===l&&(l=r.apply(n,o)),l}};for(var i in e.renderer)r(i);t.renderer=n}(),e.tokenizer&&function(){var n=dl.defaults.tokenizer||new Ua,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var l=e.tokenizer[t].apply(n,o);return!1===l&&(l=r.apply(n,o)),l}};for(var i in e.tokenizer)r(i);t.tokenizer=n}(),e.walkTokens){var n=dl.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),n&&n(t)}}dl.setOptions(t)},dl.walkTokens=function(e,t){var n,r=mo(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;switch(t(i),i.type){case"table":var o,a=mo(i.tokens.header);try{for(a.s();!(o=a.n()).done;){var l=o.value;dl.walkTokens(l,t)}}catch(e){a.e(e)}finally{a.f()}var s,c=mo(i.tokens.cells);try{for(c.s();!(s=c.n()).done;){var u,f=mo(s.value);try{for(f.s();!(u=f.n()).done;){var p=u.value;dl.walkTokens(p,t)}}catch(e){f.e(e)}finally{f.f()}}}catch(e){c.e(e)}finally{c.f()}break;case"list":dl.walkTokens(i.items,t);break;default:i.tokens&&dl.walkTokens(i.tokens,t)}}}catch(e){r.e(e)}finally{r.f()}},dl.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=cl({},dl.defaults,t||{}),ul(t);try{var n=Qa.lexInline(e,t);return t.walkTokens&&dl.walkTokens(n,t.walkTokens),sl.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+fl(e.message+"",!0)+"</pre>";throw e}},dl.Parser=sl,dl.parser=sl.parse,dl.Renderer=rl,dl.TextRenderer=il,dl.Lexer=Qa,dl.lexer=Qa.lex,dl.Tokenizer=Ua,dl.Slugger=ol,dl.parse=dl;var vl=dl,yl=/\[([\s\d,|-]*)\]/,kl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};export default function(){var e;function t(e){var t=(e.querySelector("[data-template]")||e.querySelector("script")||e).textContent,n=(t=t.replace(new RegExp("__SCRIPT_END__","g"),"<\/script>")).match(/^\n?(\s*)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length;return r>0?t=t.replace(new RegExp("\\n?\\t{"+r+"}","g"),"\n"):n>1&&(t=t.replace(new RegExp("\\n? {"+n+"}","g"),"\n")),t}function n(e){for(var t=e.attributes,n=[],r=0,i=t.length;r<i;r++){var o=t[r].name,a=t[r].value;/data\-(markdown|separator|vertical|notes)/gi.test(o)||(a?n.push(o+'="'+a+'"'):n.push(o))}return n.join(" ")}function r(e){return(e=e||{}).separator=e.separator||"^\r?\n---\r?\n$",e.notesSeparator=e.notesSeparator||"notes?:",e.attributes=e.attributes||"",e}function i(e,t){t=r(t);var n=e.split(new RegExp(t.notesSeparator,"mgi"));return 2===n.length&&(e=n[0]+'<aside class="notes">'+vl(n[1].trim())+"</aside>"),'<script type="text/template">'+(e=e.replace(/<\/script>/g,"__SCRIPT_END__"))+"<\/script>"}function o(e,t){t=r(t);for(var n,o,a,l=new RegExp(t.separator+(t.verticalSeparator?"|"+t.verticalSeparator:""),"mg"),s=new RegExp(t.separator),c=0,u=!0,f=[];n=l.exec(e);)!(o=s.test(n[0]))&&u&&f.push([]),a=e.substring(c,n.index),o&&u?f.push(a):f[f.length-1].push(a),c=l.lastIndex,u=o;(u?f:f[f.length-1]).push(e.substring(c));for(var p="",h=0,g=f.length;h<g;h++)f[h]instanceof Array?(p+="<section "+t.attributes+">",f[h].forEach((function(e){p+="<section data-markdown>"+i(e,t)+"</section>"})),p+="</section>"):p+="<section "+t.attributes+" data-markdown>"+i(f[h],t)+"</section>";return p}function a(e){return new Promise((function(r){var a=[];[].slice.call(e.querySelectorAll("[data-markdown]:not([data-markdown-parsed])")).forEach((function(e,r){e.getAttribute("data-markdown").length?a.push(function(e){return new Promise((function(t,n){var r=new XMLHttpRequest,i=e.getAttribute("data-markdown"),o=e.getAttribute("data-charset");null!=o&&""!=o&&r.overrideMimeType("text/html; charset="+o),r.onreadystatechange=function(e,r){4===r.readyState&&(r.status>=200&&r.status<300||0===r.status?t(r,i):n(r,i))}.bind(this,e,r),r.open("GET",i,!0);try{r.send()}catch(e){console.warn("Failed to get the Markdown file "+i+". Make sure that the presentation and the file are served by a HTTP server and the file can be found there. "+e),t(r,i)}}))}(e).then((function(t,r){e.outerHTML=o(t.responseText,{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:n(e)})}),(function(t,n){e.outerHTML='<section data-state="alert">ERROR: The attempt to fetch '+n+" failed with HTTP status "+t.status+".Check your browser's JavaScript console for more details.<p>Remember that you need to serve the presentation HTML from a HTTP server.</p></section>"}))):e.getAttribute("data-separator")||e.getAttribute("data-separator-vertical")||e.getAttribute("data-separator-notes")?e.outerHTML=o(t(e),{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:n(e)}):e.innerHTML=i(t(e))})),Promise.all(a).then(r)}))}function l(e,t,n){var r,i,o=new RegExp(n,"mg"),a=new RegExp('([^"= ]+?)="([^"]+?)"|(data-[^"= ]+?)(?=[" ])',"mg"),l=e.nodeValue;if(r=o.exec(l)){var s=r[1];for(l=l.substring(0,r.index)+l.substring(o.lastIndex),e.nodeValue=l;i=a.exec(s);)i[2]?t.setAttribute(i[1],i[2]):t.setAttribute(i[3],"");return!0}return!1}function s(e,t,n,r,i){if(null!=t&&null!=t.childNodes&&t.childNodes.length>0)for(var o=t,a=0;a<t.childNodes.length;a++){var c=t.childNodes[a];if(a>0)for(var u=a-1;u>=0;){var f=t.childNodes[u];if("function"==typeof f.setAttribute&&"BR"!=f.tagName){o=f;break}u-=1}var p=e;"section"==c.nodeName&&(p=c,o=c),"function"!=typeof c.setAttribute&&c.nodeType!=Node.COMMENT_NODE||s(p,c,o,r,i)}t.nodeType==Node.COMMENT_NODE&&0==l(t,n,r)&&l(t,e,i)}function c(){var n=e.getRevealElement().querySelectorAll("[data-markdown]:not([data-markdown-parsed])");return[].slice.call(n).forEach((function(e){e.setAttribute("data-markdown-parsed",!0);var n=e.querySelector("aside.notes"),r=t(e);e.innerHTML=vl(r),s(e,e,null,e.getAttribute("data-element-attributes")||e.parentNode.getAttribute("data-element-attributes")||"\\.element\\s*?(.+?)$",e.getAttribute("data-attributes")||e.parentNode.getAttribute("data-attributes")||"\\.slide:\\s*?(\\S.+?)$"),n&&e.appendChild(n)})),Promise.resolve()}return{id:"markdown",init:function(t){e=t;var n=new vl.Renderer;return n.code=function(e,t){var n="";return yl.test(t)&&(n=t.match(yl)[1].trim(),n='data-line-numbers="'.concat(n,'"'),t=t.replace(yl,"").trim()),e=e.replace(/([&<>'"])/g,(function(e){return kl[e]})),"<pre><code ".concat(n,' class="').concat(t,'">').concat(e,"</code></pre>")},vl.setOptions(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?go(Object(n),!0).forEach((function(t){ho(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):go(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({renderer:n},e.getConfig().markdown)),a(e.getRevealElement()).then(c)},processSlides:a,convertSlides:c,slidify:o,marked:vl}}
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).RevealMarkdown=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var n=function(e){return e&&e.Math==Math&&e},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},o=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,s={f:l&&!a.call({1:2},1)?function(e){var t=l(this,e);return!!t&&t.enumerable}:a},c=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},u={}.toString,f=function(e){return u.call(e).slice(8,-1)},p="".split,h=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==f(e)?p.call(e,""):Object(e)}:Object,g=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},d=function(e){return h(g(e))},v=function(e){return"object"==typeof e?null!==e:"function"==typeof e},y=function(e,t){if(!v(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!v(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},k={}.hasOwnProperty,m=function(e,t){return k.call(e,t)},b=r.document,x=v(b)&&v(b.createElement),w=function(e){return x?b.createElement(e):{}},S=!o&&!i((function(){return 7!=Object.defineProperty(w("div"),"a",{get:function(){return 7}}).a})),_=Object.getOwnPropertyDescriptor,A={f:o?_:function(e,t){if(e=d(e),t=y(t,!0),S)try{return _(e,t)}catch(e){}if(m(e,t))return c(!s.f.call(e,t),e[t])}},E=function(e){if(!v(e))throw TypeError(String(e)+" is not an object");return e},O=Object.defineProperty,T={f:o?O:function(e,t,n){if(E(e),t=y(t,!0),E(n),S)try{return O(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},R=o?function(e,t,n){return T.f(e,t,c(1,n))}:function(e,t,n){return e[t]=n,e},I=function(e,t){try{R(r,e,t)}catch(n){r[e]=t}return t},j="__core-js_shared__",z=r[j]||I(j,{}),$=Function.toString;"function"!=typeof z.inspectSource&&(z.inspectSource=function(e){return $.call(e)});var P,C,L,M=z.inspectSource,N=r.WeakMap,U="function"==typeof N&&/native code/.test(M(N)),q=t((function(e){(e.exports=function(e,t){return z[e]||(z[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.7.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),D=0,Z=Math.random(),F=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++D+Z).toString(36)},G=q("keys"),H=function(e){return G[e]||(G[e]=F(e))},W={},B=r.WeakMap;if(U){var V=z.state||(z.state=new B),K=V.get,X=V.has,Y=V.set;P=function(e,t){return t.facade=e,Y.call(V,e,t),t},C=function(e){return K.call(V,e)||{}},L=function(e){return X.call(V,e)}}else{var J=H("state");W[J]=!0,P=function(e,t){return t.facade=e,R(e,J,t),t},C=function(e){return m(e,J)?e[J]:{}},L=function(e){return m(e,J)}}var Q,ee,te={set:P,get:C,has:L,enforce:function(e){return L(e)?C(e):P(e,{})},getterFor:function(e){return function(t){var n;if(!v(t)||(n=C(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ne=t((function(e){var t=te.get,n=te.enforce,i=String(String).split("String");(e.exports=function(e,t,o,a){var l,s=!!a&&!!a.unsafe,c=!!a&&!!a.enumerable,u=!!a&&!!a.noTargetGet;"function"==typeof o&&("string"!=typeof t||m(o,"name")||R(o,"name",t),(l=n(o)).source||(l.source=i.join("string"==typeof t?t:""))),e!==r?(s?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=o:R(e,t,o)):c?e[t]=o:I(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||M(this)}))})),re=r,ie=function(e){return"function"==typeof e?e:void 0},oe=function(e,t){return arguments.length<2?ie(re[e])||ie(r[e]):re[e]&&re[e][t]||r[e]&&r[e][t]},ae=Math.ceil,le=Math.floor,se=function(e){return isNaN(e=+e)?0:(e>0?le:ae)(e)},ce=Math.min,ue=function(e){return e>0?ce(se(e),9007199254740991):0},fe=Math.max,pe=Math.min,he=function(e,t){var n=se(e);return n<0?fe(n+t,0):pe(n,t)},ge=function(e){return function(t,n,r){var i,o=d(t),a=ue(o.length),l=he(r,a);if(e&&n!=n){for(;a>l;)if((i=o[l++])!=i)return!0}else for(;a>l;l++)if((e||l in o)&&o[l]===n)return e||l||0;return!e&&-1}},de={includes:ge(!0),indexOf:ge(!1)},ve=de.indexOf,ye=function(e,t){var n,r=d(e),i=0,o=[];for(n in r)!m(W,n)&&m(r,n)&&o.push(n);for(;t.length>i;)m(r,n=t[i++])&&(~ve(o,n)||o.push(n));return o},ke=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],me=ke.concat("length","prototype"),be={f:Object.getOwnPropertyNames||function(e){return ye(e,me)}},xe={f:Object.getOwnPropertySymbols},we=oe("Reflect","ownKeys")||function(e){var t=be.f(E(e)),n=xe.f;return n?t.concat(n(e)):t},Se=function(e,t){for(var n=we(t),r=T.f,i=A.f,o=0;o<n.length;o++){var a=n[o];m(e,a)||r(e,a,i(t,a))}},_e=/#|\.prototype\./,Ae=function(e,t){var n=Oe[Ee(e)];return n==Re||n!=Te&&("function"==typeof t?i(t):!!t)},Ee=Ae.normalize=function(e){return String(e).replace(_e,".").toLowerCase()},Oe=Ae.data={},Te=Ae.NATIVE="N",Re=Ae.POLYFILL="P",Ie=Ae,je=A.f,ze=function(e,t){var n,i,o,a,l,s=e.target,c=e.global,u=e.stat;if(n=c?r:u?r[s]||I(s,{}):(r[s]||{}).prototype)for(i in t){if(a=t[i],o=e.noTargetGet?(l=je(n,i))&&l.value:n[i],!Ie(c?i:s+(u?".":"#")+i,e.forced)&&void 0!==o){if(typeof a==typeof o)continue;Se(a,o)}(e.sham||o&&o.sham)&&R(a,"sham",!0),ne(n,i,a,e)}},$e=Array.isArray||function(e){return"Array"==f(e)},Pe=function(e){return Object(g(e))},Ce=function(e,t,n){var r=y(t);r in e?T.f(e,r,c(0,n)):e[r]=n},Le=!!Object.getOwnPropertySymbols&&!i((function(){return!String(Symbol())})),Me=Le&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ne=q("wks"),Ue=r.Symbol,qe=Me?Ue:Ue&&Ue.withoutSetter||F,De=function(e){return m(Ne,e)||(Le&&m(Ue,e)?Ne[e]=Ue[e]:Ne[e]=qe("Symbol."+e)),Ne[e]},Ze=De("species"),Fe=function(e,t){var n;return $e(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!$e(n.prototype)?v(n)&&null===(n=n[Ze])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Ge=oe("navigator","userAgent")||"",He=r.process,We=He&&He.versions,Be=We&&We.v8;Be?ee=(Q=Be.split("."))[0]+Q[1]:Ge&&(!(Q=Ge.match(/Edge\/(\d+)/))||Q[1]>=74)&&(Q=Ge.match(/Chrome\/(\d+)/))&&(ee=Q[1]);var Ve=ee&&+ee,Ke=De("species"),Xe=function(e){return Ve>=51||!i((function(){var t=[];return(t.constructor={})[Ke]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Ye=De("isConcatSpreadable"),Je=9007199254740991,Qe="Maximum allowed index exceeded",et=Ve>=51||!i((function(){var e=[];return e[Ye]=!1,e.concat()[0]!==e})),tt=Xe("concat"),nt=function(e){if(!v(e))return!1;var t=e[Ye];return void 0!==t?!!t:$e(e)};ze({target:"Array",proto:!0,forced:!et||!tt},{concat:function(e){var t,n,r,i,o,a=Pe(this),l=Fe(a,0),s=0;for(t=-1,r=arguments.length;t<r;t++)if(nt(o=-1===t?a:arguments[t])){if(s+(i=ue(o.length))>Je)throw TypeError(Qe);for(n=0;n<i;n++,s++)n in o&&Ce(l,s,o[n])}else{if(s>=Je)throw TypeError(Qe);Ce(l,s++,o)}return l.length=s,l}});var rt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},it=function(e,t,n){if(rt(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},ot=[].push,at=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=5==e||o;return function(l,s,c,u){for(var f,p,g=Pe(l),d=h(g),v=it(s,c,3),y=ue(d.length),k=0,m=u||Fe,b=t?m(l,y):n?m(l,0):void 0;y>k;k++)if((a||k in d)&&(p=v(f=d[k],k,g),e))if(t)b[k]=p;else if(p)switch(e){case 3:return!0;case 5:return f;case 6:return k;case 2:ot.call(b,f)}else if(i)return!1;return o?-1:r||i?i:b}},lt={forEach:at(0),map:at(1),filter:at(2),some:at(3),every:at(4),find:at(5),findIndex:at(6)},st=function(e,t){var n=[][e];return!!n&&i((function(){n.call(null,t||function(){throw 1},1)}))},ct=Object.defineProperty,ut={},ft=function(e){throw e},pt=function(e,t){if(m(ut,e))return ut[e];t||(t={});var n=[][e],r=!!m(t,"ACCESSORS")&&t.ACCESSORS,a=m(t,0)?t[0]:ft,l=m(t,1)?t[1]:void 0;return ut[e]=!!n&&!i((function(){if(r&&!o)return!0;var e={length:-1};r?ct(e,1,{enumerable:!0,get:ft}):e[1]=1,n.call(e,a,l)}))},ht=lt.forEach,gt=st("forEach"),dt=pt("forEach"),vt=gt&&dt?[].forEach:function(e){return ht(this,e,arguments.length>1?arguments[1]:void 0)};ze({target:"Array",proto:!0,forced:[].forEach!=vt},{forEach:vt});var yt,kt=Object.keys||function(e){return ye(e,ke)},mt=o?Object.defineProperties:function(e,t){E(e);for(var n,r=kt(t),i=r.length,o=0;i>o;)T.f(e,n=r[o++],t[n]);return e},bt=oe("document","documentElement"),xt=H("IE_PROTO"),wt=function(){},St=function(e){return"<script>"+e+"</"+"script>"},_t=function(){try{yt=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;_t=yt?function(e){e.write(St("")),e.close();var t=e.parentWindow.Object;return e=null,t}(yt):((t=w("iframe")).style.display="none",bt.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(St("document.F=Object")),e.close(),e.F);for(var n=ke.length;n--;)delete _t.prototype[ke[n]];return _t()};W[xt]=!0;var At=Object.create||function(e,t){var n;return null!==e?(wt.prototype=E(e),n=new wt,wt.prototype=null,n[xt]=e):n=_t(),void 0===t?n:mt(n,t)},Et=De("unscopables"),Ot=Array.prototype;null==Ot[Et]&&T.f(Ot,Et,{configurable:!0,value:At(null)});var Tt,Rt,It,jt=function(e){Ot[Et][e]=!0},zt={},$t=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Pt=H("IE_PROTO"),Ct=Object.prototype,Lt=$t?Object.getPrototypeOf:function(e){return e=Pe(e),m(e,Pt)?e[Pt]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Ct:null},Mt=De("iterator"),Nt=!1;[].keys&&("next"in(It=[].keys())?(Rt=Lt(Lt(It)))!==Object.prototype&&(Tt=Rt):Nt=!0),null==Tt&&(Tt={}),m(Tt,Mt)||R(Tt,Mt,(function(){return this}));var Ut={IteratorPrototype:Tt,BUGGY_SAFARI_ITERATORS:Nt},qt=T.f,Dt=De("toStringTag"),Zt=function(e,t,n){e&&!m(e=n?e:e.prototype,Dt)&&qt(e,Dt,{configurable:!0,value:t})},Ft=Ut.IteratorPrototype,Gt=function(){return this},Ht=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return E(n),function(e){if(!v(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Wt=Ut.IteratorPrototype,Bt=Ut.BUGGY_SAFARI_ITERATORS,Vt=De("iterator"),Kt="keys",Xt="values",Yt="entries",Jt=function(){return this},Qt=function(e,t,n,r,i,o,a){!function(e,t,n){var r=t+" Iterator";e.prototype=At(Ft,{next:c(1,n)}),Zt(e,r,!1),zt[r]=Gt}(n,t,r);var l,s,u,f=function(e){if(e===i&&v)return v;if(!Bt&&e in g)return g[e];switch(e){case Kt:case Xt:case Yt:return function(){return new n(this,e)}}return function(){return new n(this)}},p=t+" Iterator",h=!1,g=e.prototype,d=g[Vt]||g["@@iterator"]||i&&g[i],v=!Bt&&d||f(i),y="Array"==t&&g.entries||d;if(y&&(l=Lt(y.call(new e)),Wt!==Object.prototype&&l.next&&(Lt(l)!==Wt&&(Ht?Ht(l,Wt):"function"!=typeof l[Vt]&&R(l,Vt,Jt)),Zt(l,p,!0))),i==Xt&&d&&d.name!==Xt&&(h=!0,v=function(){return d.call(this)}),g[Vt]!==v&&R(g,Vt,v),zt[t]=v,i)if(s={values:f(Xt),keys:o?v:f(Kt),entries:f(Yt)},a)for(u in s)(Bt||h||!(u in g))&&ne(g,u,s[u]);else ze({target:t,proto:!0,forced:Bt||h},s);return s},en="Array Iterator",tn=te.set,nn=te.getterFor(en),rn=Qt(Array,"Array",(function(e,t){tn(this,{type:en,target:d(e),index:0,kind:t})}),(function(){var e=nn(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");zt.Arguments=zt.Array,jt("keys"),jt("values"),jt("entries");var on=[].join,an=h!=Object,ln=st("join",",");ze({target:"Array",proto:!0,forced:an||!ln},{join:function(e){return on.call(d(this),void 0===e?",":e)}});var sn=Xe("slice"),cn=pt("slice",{ACCESSORS:!0,0:0,1:2}),un=De("species"),fn=[].slice,pn=Math.max;ze({target:"Array",proto:!0,forced:!sn||!cn},{slice:function(e,t){var n,r,i,o=d(this),a=ue(o.length),l=he(e,a),s=he(void 0===t?a:t,a);if($e(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!$e(n.prototype)?v(n)&&null===(n=n[un])&&(n=void 0):n=void 0,n===Array||void 0===n))return fn.call(o,l,s);for(r=new(void 0===n?Array:n)(pn(s-l,0)),i=0;l<s;l++,i++)l in o&&Ce(r,i,o[l]);return r.length=i,r}});var hn=T.f,gn=Function.prototype,dn=gn.toString,vn=/^\s*function ([^ (]*)/,yn="name";o&&!(yn in gn)&&hn(gn,yn,{configurable:!0,get:function(){try{return dn.call(this).match(vn)[1]}catch(e){return""}}});var kn={};kn[De("toStringTag")]="z";var mn="[object z]"===String(kn),bn=De("toStringTag"),xn="Arguments"==f(function(){return arguments}()),wn=mn?f:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),bn))?n:xn?f(t):"Object"==(r=f(t))&&"function"==typeof t.callee?"Arguments":r},Sn=mn?{}.toString:function(){return"[object "+wn(this)+"]"};mn||ne(Object.prototype,"toString",Sn,{unsafe:!0});var _n=r.Promise,An=De("species"),En=function(e){var t=oe(e),n=T.f;o&&t&&!t[An]&&n(t,An,{configurable:!0,get:function(){return this}})},On=De("iterator"),Tn=Array.prototype,Rn=De("iterator"),In=function(e){var t=e.return;if(void 0!==t)return E(t.call(e)).value},jn=function(e,t){this.stopped=e,this.result=t},zn=function(e,t,n){var r,i,o,a,l,s,c,u,f=n&&n.that,p=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),g=!(!n||!n.INTERRUPTED),d=it(t,f,1+p+g),v=function(e){return r&&In(r),new jn(!0,e)},y=function(e){return p?(E(e),g?d(e[0],e[1],v):d(e[0],e[1])):g?d(e,v):d(e)};if(h)r=e;else{if("function"!=typeof(i=function(e){if(null!=e)return e[Rn]||e["@@iterator"]||zt[wn(e)]}(e)))throw TypeError("Target is not iterable");if(void 0!==(u=i)&&(zt.Array===u||Tn[On]===u)){for(o=0,a=ue(e.length);a>o;o++)if((l=y(e[o]))&&l instanceof jn)return l;return new jn(!1)}r=i.call(e)}for(s=r.next;!(c=s.call(r)).done;){try{l=y(c.value)}catch(e){throw In(r),e}if("object"==typeof l&&l&&l instanceof jn)return l}return new jn(!1)},$n=De("iterator"),Pn=!1;try{var Cn=0,Ln={next:function(){return{done:!!Cn++}},return:function(){Pn=!0}};Ln[$n]=function(){return this},Array.from(Ln,(function(){throw 2}))}catch(e){}var Mn,Nn,Un,qn=De("species"),Dn=function(e,t){var n,r=E(e).constructor;return void 0===r||null==(n=E(r)[qn])?t:rt(n)},Zn=/(iphone|ipod|ipad).*applewebkit/i.test(Ge),Fn="process"==f(r.process),Gn=r.location,Hn=r.setImmediate,Wn=r.clearImmediate,Bn=r.process,Vn=r.MessageChannel,Kn=r.Dispatch,Xn=0,Yn={},Jn="onreadystatechange",Qn=function(e){if(Yn.hasOwnProperty(e)){var t=Yn[e];delete Yn[e],t()}},er=function(e){return function(){Qn(e)}},tr=function(e){Qn(e.data)},nr=function(e){r.postMessage(e+"",Gn.protocol+"//"+Gn.host)};Hn&&Wn||(Hn=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Yn[++Xn]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Mn(Xn),Xn},Wn=function(e){delete Yn[e]},Fn?Mn=function(e){Bn.nextTick(er(e))}:Kn&&Kn.now?Mn=function(e){Kn.now(er(e))}:Vn&&!Zn?(Un=(Nn=new Vn).port2,Nn.port1.onmessage=tr,Mn=it(Un.postMessage,Un,1)):r.addEventListener&&"function"==typeof postMessage&&!r.importScripts&&Gn&&"file:"!==Gn.protocol&&!i(nr)?(Mn=nr,r.addEventListener("message",tr,!1)):Mn=Jn in w("script")?function(e){bt.appendChild(w("script")).onreadystatechange=function(){bt.removeChild(this),Qn(e)}}:function(e){setTimeout(er(e),0)});var rr,ir,or,ar,lr,sr,cr,ur,fr={set:Hn,clear:Wn},pr=A.f,hr=fr.set,gr=r.MutationObserver||r.WebKitMutationObserver,dr=r.document,vr=r.process,yr=r.Promise,kr=pr(r,"queueMicrotask"),mr=kr&&kr.value;mr||(rr=function(){var e,t;for(Fn&&(e=vr.domain)&&e.exit();ir;){t=ir.fn,ir=ir.next;try{t()}catch(e){throw ir?ar():or=void 0,e}}or=void 0,e&&e.enter()},!Zn&&!Fn&&gr&&dr?(lr=!0,sr=dr.createTextNode(""),new gr(rr).observe(sr,{characterData:!0}),ar=function(){sr.data=lr=!lr}):yr&&yr.resolve?(cr=yr.resolve(void 0),ur=cr.then,ar=function(){ur.call(cr,rr)}):ar=Fn?function(){vr.nextTick(rr)}:function(){hr.call(r,rr)});var br,xr,wr,Sr,_r=mr||function(e){var t={fn:e,next:void 0};or&&(or.next=t),ir||(ir=t,ar()),or=t},Ar=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=rt(t),this.reject=rt(n)},Er={f:function(e){return new Ar(e)}},Or=function(e,t){if(E(e),v(t)&&t.constructor===e)return t;var n=Er.f(e);return(0,n.resolve)(t),n.promise},Tr=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Rr=fr.set,Ir=De("species"),jr="Promise",zr=te.get,$r=te.set,Pr=te.getterFor(jr),Cr=_n,Lr=r.TypeError,Mr=r.document,Nr=r.process,Ur=oe("fetch"),qr=Er.f,Dr=qr,Zr=!!(Mr&&Mr.createEvent&&r.dispatchEvent),Fr="function"==typeof PromiseRejectionEvent,Gr="unhandledrejection",Hr=Ie(jr,(function(){if(!(M(Cr)!==String(Cr))){if(66===Ve)return!0;if(!Fn&&!Fr)return!0}if(Ve>=51&&/native code/.test(Cr))return!1;var e=Cr.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Ir]=t,!(e.then((function(){}))instanceof t)})),Wr=Hr||!function(e,t){if(!t&&!Pn)return!1;var n=!1;try{var r={};r[$n]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Cr.all(e).catch((function(){}))})),Br=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},Vr=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;_r((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,l,s,c=n[o++],u=i?c.ok:c.fail,f=c.resolve,p=c.reject,h=c.domain;try{u?(i||(2===e.rejection&&Jr(e),e.rejection=1),!0===u?a=r:(h&&h.enter(),a=u(r),h&&(h.exit(),s=!0)),a===c.promise?p(Lr("Promise-chain cycle")):(l=Br(a))?l.call(a,f,p):f(a)):p(r)}catch(e){h&&!s&&h.exit(),p(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Xr(e)}))}},Kr=function(e,t,n){var i,o;Zr?((i=Mr.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),r.dispatchEvent(i)):i={promise:t,reason:n},!Fr&&(o=r["on"+e])?o(i):e===Gr&&function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Xr=function(e){Rr.call(r,(function(){var t,n=e.facade,r=e.value;if(Yr(e)&&(t=Tr((function(){Fn?Nr.emit("unhandledRejection",r,n):Kr(Gr,n,r)})),e.rejection=Fn||Yr(e)?2:1,t.error))throw t.value}))},Yr=function(e){return 1!==e.rejection&&!e.parent},Jr=function(e){Rr.call(r,(function(){var t=e.facade;Fn?Nr.emit("rejectionHandled",t):Kr("rejectionhandled",t,e.value)}))},Qr=function(e,t,n){return function(r){e(t,r,n)}},ei=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Vr(e,!0))},ti=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Lr("Promise can't be resolved itself");var r=Br(t);r?_r((function(){var n={done:!1};try{r.call(t,Qr(ti,n,e),Qr(ei,n,e))}catch(t){ei(n,t,e)}})):(e.value=t,e.state=1,Vr(e,!1))}catch(t){ei({done:!1},t,e)}}};Hr&&(Cr=function(e){!function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}(this,Cr,jr),rt(e),br.call(this);var t=zr(this);try{e(Qr(ti,t),Qr(ei,t))}catch(e){ei(t,e)}},(br=function(e){$r(this,{type:jr,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=function(e,t,n){for(var r in t)ne(e,r,t[r],n);return e}(Cr.prototype,{then:function(e,t){var n=Pr(this),r=qr(Dn(this,Cr));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Fn?Nr.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Vr(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),xr=function(){var e=new br,t=zr(e);this.promise=e,this.resolve=Qr(ti,t),this.reject=Qr(ei,t)},Er.f=qr=function(e){return e===Cr||e===wr?new xr(e):Dr(e)},"function"==typeof _n&&(Sr=_n.prototype.then,ne(_n.prototype,"then",(function(e,t){var n=this;return new Cr((function(e,t){Sr.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Ur&&ze({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Or(Cr,Ur.apply(r,arguments))}}))),ze({global:!0,wrap:!0,forced:Hr},{Promise:Cr}),Zt(Cr,jr,!1),En(jr),wr=oe(jr),ze({target:jr,stat:!0,forced:Hr},{reject:function(e){var t=qr(this);return t.reject.call(void 0,e),t.promise}}),ze({target:jr,stat:!0,forced:Hr},{resolve:function(e){return Or(this,e)}}),ze({target:jr,stat:!0,forced:Wr},{all:function(e){var t=this,n=qr(t),r=n.resolve,i=n.reject,o=Tr((function(){var n=rt(t.resolve),o=[],a=0,l=1;zn(e,(function(e){var s=a++,c=!1;o.push(void 0),l++,n.call(t,e).then((function(e){c||(c=!0,o[s]=e,--l||r(o))}),i)})),--l||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=qr(t),r=n.reject,i=Tr((function(){var i=rt(t.resolve);zn(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var ni=De("match"),ri=function(e){var t;return v(e)&&(void 0!==(t=e[ni])?!!t:"RegExp"==f(e))},ii=function(){var e=E(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function oi(e,t){return RegExp(e,t)}var ai={UNSUPPORTED_Y:i((function(){var e=oi("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:i((function(){var e=oi("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},li=T.f,si=be.f,ci=te.set,ui=De("match"),fi=r.RegExp,pi=fi.prototype,hi=/a/g,gi=/a/g,di=new fi(hi)!==hi,vi=ai.UNSUPPORTED_Y;if(o&&Ie("RegExp",!di||vi||i((function(){return gi[ui]=!1,fi(hi)!=hi||fi(gi)==gi||"/a/i"!=fi(hi,"i")})))){for(var yi=function(e,t){var n,r=this instanceof yi,i=ri(e),o=void 0===t;if(!r&&i&&e.constructor===yi&&o)return e;di?i&&!o&&(e=e.source):e instanceof yi&&(o&&(t=ii.call(e)),e=e.source),vi&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var a,l,s,c,u,f=(a=di?new fi(e,t):fi(e,t),l=r?this:pi,s=yi,Ht&&"function"==typeof(c=l.constructor)&&c!==s&&v(u=c.prototype)&&u!==s.prototype&&Ht(a,u),a);return vi&&n&&ci(f,{sticky:n}),f},ki=function(e){e in yi||li(yi,e,{configurable:!0,get:function(){return fi[e]},set:function(t){fi[e]=t}})},mi=si(fi),bi=0;mi.length>bi;)ki(mi[bi++]);pi.constructor=yi,yi.prototype=pi,ne(r,"RegExp",yi)}En("RegExp");var xi=RegExp.prototype.exec,wi=String.prototype.replace,Si=xi,_i=function(){var e=/a/,t=/b*/g;return xi.call(e,"a"),xi.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Ai=ai.UNSUPPORTED_Y||ai.BROKEN_CARET,Ei=void 0!==/()??/.exec("")[1];(_i||Ei||Ai)&&(Si=function(e){var t,n,r,i,o=this,a=Ai&&o.sticky,l=ii.call(o),s=o.source,c=0,u=e;return a&&(-1===(l=l.replace("y","")).indexOf("g")&&(l+="g"),u=String(e).slice(o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==e[o.lastIndex-1])&&(s="(?: "+s+")",u=" "+u,c++),n=new RegExp("^(?:"+s+")",l)),Ei&&(n=new RegExp("^"+s+"$(?!\\s)",l)),_i&&(t=o.lastIndex),r=xi.call(a?n:o,u),a?r?(r.input=r.input.slice(c),r[0]=r[0].slice(c),r.index=o.lastIndex,o.lastIndex+=r[0].length):o.lastIndex=0:_i&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),Ei&&r&&r.length>1&&wi.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var Oi=Si;ze({target:"RegExp",proto:!0,forced:/./.exec!==Oi},{exec:Oi});var Ti="toString",Ri=RegExp.prototype,Ii=Ri.toString,ji=i((function(){return"/a/b"!=Ii.call({source:"a",flags:"b"})})),zi=Ii.name!=Ti;(ji||zi)&&ne(RegExp.prototype,Ti,(function(){var e=E(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Ri)?ii.call(e):n)}),{unsafe:!0});var $i=function(e){return function(t,n){var r,i,o=String(g(t)),a=se(n),l=o.length;return a<0||a>=l?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===l||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}},Pi={codeAt:$i(!1),charAt:$i(!0)},Ci=Pi.charAt,Li="String Iterator",Mi=te.set,Ni=te.getterFor(Li);Qt(String,"String",(function(e){Mi(this,{type:Li,string:String(e),index:0})}),(function(){var e,t=Ni(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Ci(n,r),t.index+=e.length,{value:e,done:!1})}));var Ui=De("species"),qi=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Di="$0"==="a".replace(/./,"$0"),Zi=De("replace"),Fi=!!/./[Zi]&&""===/./[Zi]("a","$0"),Gi=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Hi=function(e,t,n,r){var o=De(e),a=!i((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),l=a&&!i((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Ui]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!a||!l||"replace"===e&&(!qi||!Di||Fi)||"split"===e&&!Gi){var s=/./[o],c=n(o,""[e],(function(e,t,n,r,i){return t.exec===Oi?a&&!i?{done:!0,value:s.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Di,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Fi}),u=c[0],f=c[1];ne(String.prototype,e,u),ne(RegExp.prototype,o,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)})}r&&R(RegExp.prototype[o],"sham",!0)},Wi=Pi.charAt,Bi=function(e,t,n){return t+(n?Wi(e,t).length:1)},Vi=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==f(e))throw TypeError("RegExp#exec called on incompatible receiver");return Oi.call(e,t)};Hi("match",1,(function(e,t,n){return[function(t){var n=g(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var i=E(e),o=String(this);if(!i.global)return Vi(i,o);var a=i.unicode;i.lastIndex=0;for(var l,s=[],c=0;null!==(l=Vi(i,o));){var u=String(l[0]);s[c]=u,""===u&&(i.lastIndex=Bi(o,ue(i.lastIndex),a)),c++}return 0===c?null:s}]}));var Ki=Math.max,Xi=Math.min,Yi=Math.floor,Ji=/\$([$&'`]|\d\d?|<[^>]*>)/g,Qi=/\$([$&'`]|\d\d?)/g;Hi("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,o=r.REPLACE_KEEPS_$0,a=i?"$":"$0";return[function(n,r){var i=g(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&o||"string"==typeof r&&-1===r.indexOf(a)){var s=n(t,e,this,r);if(s.done)return s.value}var c=E(e),u=String(this),f="function"==typeof r;f||(r=String(r));var p=c.global;if(p){var h=c.unicode;c.lastIndex=0}for(var g=[];;){var d=Vi(c,u);if(null===d)break;if(g.push(d),!p)break;""===String(d[0])&&(c.lastIndex=Bi(u,ue(c.lastIndex),h))}for(var v,y="",k=0,m=0;m<g.length;m++){d=g[m];for(var b=String(d[0]),x=Ki(Xi(se(d.index),u.length),0),w=[],S=1;S<d.length;S++)w.push(void 0===(v=d[S])?v:String(v));var _=d.groups;if(f){var A=[b].concat(w,x,u);void 0!==_&&A.push(_);var O=String(r.apply(void 0,A))}else O=l(b,u,x,w,_,r);x>=k&&(y+=u.slice(k,x)+O,k=x+b.length)}return y+u.slice(k)}];function l(e,n,r,i,o,a){var l=r+e.length,s=i.length,c=Qi;return void 0!==o&&(o=Pe(o),c=Ji),t.call(a,c,(function(t,a){var c;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(l);case"<":c=o[a.slice(1,-1)];break;default:var u=+a;if(0===u)return t;if(u>s){var f=Yi(u/10);return 0===f?t:f<=s?void 0===i[f-1]?a.charAt(1):i[f-1]+a.charAt(1):t}c=i[u-1]}return void 0===c?"":c}))}}));var eo=[].push,to=Math.min,no=4294967295,ro=!i((function(){return!RegExp(no,"y")}));Hi("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(g(this)),i=void 0===n?no:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!ri(e))return t.call(r,e,i);for(var o,a,l,s=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),u=0,f=new RegExp(e.source,c+"g");(o=Oi.call(f,r))&&!((a=f.lastIndex)>u&&(s.push(r.slice(u,o.index)),o.length>1&&o.index<r.length&&eo.apply(s,o.slice(1)),l=o[0].length,u=a,s.length>=i));)f.lastIndex===o.index&&f.lastIndex++;return u===r.length?!l&&f.test("")||s.push(""):s.push(r.slice(u)),s.length>i?s.slice(0,i):s}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=g(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var o=n(r,e,this,i,r!==t);if(o.done)return o.value;var a=E(e),l=String(this),s=Dn(a,RegExp),c=a.unicode,u=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ro?"y":"g"),f=new s(ro?a:"^(?:"+a.source+")",u),p=void 0===i?no:i>>>0;if(0===p)return[];if(0===l.length)return null===Vi(f,l)?[l]:[];for(var h=0,g=0,d=[];g<l.length;){f.lastIndex=ro?g:0;var v,y=Vi(f,ro?l:l.slice(g));if(null===y||(v=to(ue(f.lastIndex+(ro?0:g)),l.length))===h)g=Bi(l,g,c);else{if(d.push(l.slice(h,g)),d.length===p)return d;for(var k=1;k<=y.length-1;k++)if(d.push(y[k]),d.length===p)return d;g=h=v}}return d.push(l.slice(h)),d}]}),!ro);var io="\t\n\v\f\r \u2028\u2029\ufeff",oo="["+io+"]",ao=RegExp("^"+oo+oo+"*"),lo=RegExp(oo+oo+"*$"),so=function(e){return function(t){var n=String(g(t));return 1&e&&(n=n.replace(ao,"")),2&e&&(n=n.replace(lo,"")),n}},co={start:so(1),end:so(2),trim:so(3)},uo=function(e){return i((function(){return!!io[e]()||"​…᠎"!="​…᠎"[e]()||io[e].name!==e}))},fo=co.trim;ze({target:"String",proto:!0,forced:uo("trim")},{trim:function(){return fo(this)}});var po={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var ho in po){var go=r[ho],vo=go&&go.prototype;if(vo&&vo.forEach!==vt)try{R(vo,"forEach",vt)}catch(e){vo.forEach=vt}}var yo=De("iterator"),ko=De("toStringTag"),mo=rn.values;for(var bo in po){var xo=r[bo],wo=xo&&xo.prototype;if(wo){if(wo[yo]!==mo)try{R(wo,yo,mo)}catch(e){wo[yo]=mo}if(wo[ko]||R(wo,ko,bo),po[bo])for(var So in rn)if(wo[So]!==rn[So])try{R(wo,So,rn[So])}catch(e){wo[So]=rn[So]}}}function _o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ao(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eo(e,t,n){return t&&Ao(e.prototype,t),n&&Ao(e,n),e}function Oo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function To(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ro(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n}(e,t)||Io(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Io(e,t){if(e){if("string"==typeof e)return jo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jo(e,t):void 0}}function jo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zo(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Io(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}var $o=de.includes,Po=pt("indexOf",{ACCESSORS:!0,1:0});ze({target:"Array",proto:!0,forced:!Po},{includes:function(e){return $o(this,e,arguments.length>1?arguments[1]:void 0)}}),jt("includes");var Co=Math.min,Lo=[].lastIndexOf,Mo=!!Lo&&1/[1].lastIndexOf(1,-0)<0,No=st("lastIndexOf"),Uo=pt("indexOf",{ACCESSORS:!0,1:0}),qo=Mo||!No||!Uo?function(e){if(Mo)return Lo.apply(this,arguments)||0;var t=d(this),n=ue(t.length),r=n-1;for(arguments.length>1&&(r=Co(r,se(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:Lo;ze({target:"Array",proto:!0,forced:qo!==[].lastIndexOf},{lastIndexOf:qo});var Do=i((function(){kt(1)}));ze({target:"Object",stat:!0,forced:Do},{keys:function(e){return kt(Pe(e))}});var Zo=function(e){if(ri(e))throw TypeError("The method doesn't accept regular expressions");return e},Fo=De("match"),Go=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Fo]=!1,"/./"[e](t)}catch(e){}}return!1};ze({target:"String",proto:!0,forced:!Go("includes")},{includes:function(e){return!!~String(g(this)).indexOf(Zo(e),arguments.length>1?arguments[1]:void 0)}});var Ho=/"/g;ze({target:"String",proto:!0,forced:function(e){return i((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}("link")},{link:function(e){return t="a",n="href",r=e,i=String(g(this)),o="<"+t,""!==n&&(o+=" "+n+'="'+String(r).replace(Ho,"&quot;")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}});var Wo=de.indexOf,Bo=[].indexOf,Vo=!!Bo&&1/[1].indexOf(1,-0)<0,Ko=st("indexOf"),Xo=pt("indexOf",{ACCESSORS:!0,1:0});ze({target:"Array",proto:!0,forced:Vo||!Ko||!Xo},{indexOf:function(e){return Vo?Bo.apply(this,arguments)||0:Wo(this,e,arguments.length>1?arguments[1]:void 0)}});var Yo=lt.map,Jo=Xe("map"),Qo=pt("map");ze({target:"Array",proto:!0,forced:!Jo||!Qo},{map:function(e){return Yo(this,e,arguments.length>1?arguments[1]:void 0)}});var ea=Xe("splice"),ta=pt("splice",{ACCESSORS:!0,0:0,1:2}),na=Math.max,ra=Math.min,ia=9007199254740991,oa="Maximum allowed length exceeded";ze({target:"Array",proto:!0,forced:!ea||!ta},{splice:function(e,t){var n,r,i,o,a,l,s=Pe(this),c=ue(s.length),u=he(e,c),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=c-u):(n=f-2,r=ra(na(se(t),0),c-u)),c+n-r>ia)throw TypeError(oa);for(i=Fe(s,r),o=0;o<r;o++)(a=u+o)in s&&Ce(i,o,s[a]);if(i.length=r,n<r){for(o=u;o<c-r;o++)l=o+n,(a=o+r)in s?s[l]=s[a]:delete s[l];for(o=c;o>c-r+n;o--)delete s[o-1]}else if(n>r)for(o=c-r;o>u;o--)l=o+n-1,(a=o+r-1)in s?s[l]=s[a]:delete s[l];for(o=0;o<n;o++)s[o+u]=arguments[o+2];return s.length=c-r+n,i}});var aa,la=A.f,sa="".endsWith,ca=Math.min,ua=Go("endsWith"),fa=!(ua||(aa=la(String.prototype,"endsWith"),!aa||aa.writable));ze({target:"String",proto:!0,forced:!fa&&!ua},{endsWith:function(e){var t=String(g(this));Zo(e);var n=arguments.length>1?arguments[1]:void 0,r=ue(t.length),i=void 0===n?r:ca(ue(n),r),o=String(e);return sa?sa.call(t,o,i):t.slice(i-o.length,i)===o}});var pa=A.f,ha="".startsWith,ga=Math.min,da=Go("startsWith"),va=!da&&!!function(){var e=pa(String.prototype,"startsWith");return e&&!e.writable}();ze({target:"String",proto:!0,forced:!va&&!da},{startsWith:function(e){var t=String(g(this));Zo(e);var n=ue(ga(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return ha?ha.call(t,r,n):t.slice(n,n+r.length)===r}});var ya=co.end,ka=uo("trimEnd"),ma=ka?function(){return ya(this)}:"".trimEnd;ze({target:"String",proto:!0,forced:ka},{trimEnd:ma,trimRight:ma});var ba=t((function(e){function t(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),xa=/[&<>"']/,wa=/[&<>"']/g,Sa=/[<>"']|&(?!#?\w+;)/,_a=/[<>"']|&(?!#?\w+;)/g,Aa={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ea=function(e){return Aa[e]};var Oa=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Ta(e){return e.replace(Oa,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var Ra=/(^|[^\[])\^/g;var Ia=/[^\w:]/g,ja=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var za={},$a=/^[^:]+:\/*[^/]*$/,Pa=/^([^:]+:)[\s\S]*$/,Ca=/^([^:]+:\/*[^/]*)[\s\S]*$/;function La(e,t){za[" "+e]||($a.test(e)?za[" "+e]=e+"/":za[" "+e]=Ma(e,"/",!0));var n=-1===(e=za[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Pa,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Ca,"$1")+t:e+t}function Ma(e,t,n){var r=e.length;if(0===r)return"";for(var i=0;i<r;){var o=e.charAt(r-i-1);if(o!==t||n){if(o===t||!n)break;i++}else i++}return e.substr(0,r-i)}var Na=function(e,t){if(t){if(xa.test(e))return e.replace(wa,Ea)}else if(Sa.test(e))return e.replace(_a,Ea);return e},Ua=Ta,qa=function(e,t){e=e.source||e,t=t||"";var n={replace:function(t,r){return r=(r=r.source||r).replace(Ra,"$1"),e=e.replace(t,r),n},getRegex:function(){return new RegExp(e,t)}};return n},Da=function(e,t,n){if(e){var r;try{r=decodeURIComponent(Ta(n)).replace(Ia,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!ja.test(n)&&(n=La(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},Za={exec:function(){}},Fa=function(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ga=function(e,t){var n=e.replace(/\|/g,(function(e,t,n){for(var r=!1,i=t;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n},Ha=Ma,Wa=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=e.length,r=0,i=0;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&--r<0)return i;return-1},Ba=function(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},Va=function(e,t){if(t<1)return"";for(var n="";t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e},Ka=ba.defaults,Xa=Ha,Ya=Ga,Ja=Na,Qa=Wa;function el(e,t,n){var r=t.href,i=t.title?Ja(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:i,text:o}:{type:"image",raw:n,href:r,title:i,text:Ja(o)}}var tl=function(){function e(t){_o(this,e),this.options=t||Ka}return Eo(e,[{key:"space",value:function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}},{key:"code",value:function(e,t){var n=this.rules.block.code.exec(e);if(n){var r=t[t.length-1];if(r&&"paragraph"===r.type)return{raw:n[0],text:n[0].trimRight()};var i=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Xa(i,"\n")}}}},{key:"fences",value:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Ro(t,1)[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}}},{key:"heading",value:function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}}},{key:"nptable",value:function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:Ya(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=Ya(n.cells[r],n.header.length);return n}}}},{key:"hr",value:function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}},{key:"blockquote",value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){var n=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}}},{key:"list",value:function(e){var t=this.rules.block.list.exec(e);if(t){var n,r,i,o,a,l,s,c,u=t[0],f=t[2],p=f.length>1,h={type:"list",raw:u,ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]},g=t[0].match(this.rules.block.item),d=!1,v=g.length;i=this.rules.block.listItemStart.exec(g[0]);for(var y=0;y<v;y++){if(u=n=g[y],y!==v-1){if((o=this.rules.block.listItemStart.exec(g[y+1]))[1].length>i[0].length||o[1].length>3){g.splice(y,2,g[y]+"\n"+g[y+1]),y--,v--;continue}(!this.options.pedantic||this.options.smartLists?o[2][o[2].length-1]!==f[f.length-1]:p===(1===o[2].length))&&(a=g.slice(y+1).join("\n"),h.raw=h.raw.substring(0,h.raw.length-a.length),y=v-1),i=o}r=n.length,~(n=n.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(r-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+r+"}","gm"),"")),l=d||/\n\n(?!\s*$)/.test(n),y!==v-1&&(d="\n"===n.charAt(n.length-1),l||(l=d)),l&&(h.loose=!0),c=void 0,(s=/^\[[ xX]\] /.test(n))&&(c=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),h.items.push({type:"list_item",raw:u,task:s,checked:c,loose:l,text:n})}return h}}},{key:"html",value:function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Ja(t[0]):t[0]}}},{key:"def",value:function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}},{key:"table",value:function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:Ya(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var r,i=n.align.length;for(r=0;r<i;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(i=n.cells.length,r=0;r<i;r++)n.cells[r]=Ya(n.cells[r].replace(/^ *\| *| *\| *$/g,""),n.header.length);return n}}}},{key:"lheading",value:function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}}},{key:"paragraph",value:function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}}},{key:"text",value:function(e,t){var n=this.rules.block.text.exec(e);if(n){var r=t[t.length-1];return r&&"text"===r.type?{raw:n[0],text:n[0]}:{type:"text",raw:n[0],text:n[0]}}}},{key:"escape",value:function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ja(t[1])}}},{key:"tag",value:function(e,t,n){var r=this.rules.inline.tag.exec(e);if(r)return!t&&/^<a /i.test(r[0])?t=!0:t&&/^<\/a>/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Ja(r[0]):r[0]}}},{key:"link",value:function(e){var t=this.rules.inline.link.exec(e);if(t){var n=Qa(t[2],"()");if(n>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,r).trim(),t[3]=""}var i=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a?(i=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return el(t,{href:(i=i.trim().replace(/^<([\s\S]*)>$/,"$1"))?i.replace(this.rules.inline._escapes,"$1"):i,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}}},{key:"reflink",value:function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return el(n,r,n[0])}}},{key:"strong",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,i[0].length),text:e.slice(2,i[0].length-2)}}}},{key:"em",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var i,o="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(r=o.exec(t));)if(i=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,i[0].length),text:e.slice(1,i[0].length-1)}}}},{key:"codespan",value:function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),i=n.startsWith(" ")&&n.endsWith(" ");return r&&i&&(n=n.substring(1,n.length-1)),n=Ja(n,!0),{type:"codespan",raw:t[0],text:n}}}},{key:"br",value:function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}},{key:"del",value:function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}}},{key:"autolink",value:function(e,t){var n,r,i=this.rules.inline.autolink.exec(e);if(i)return r="@"===i[2]?"mailto:"+(n=Ja(this.options.mangle?t(i[1]):i[1])):n=Ja(i[1]),{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}},{key:"url",value:function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,i;if("@"===n[2])i="mailto:"+(r=Ja(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);r=Ja(n[0]),i="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}},{key:"inlineText",value:function(e,t,n){var r,i=this.rules.inline.text.exec(e);if(i)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Ja(i[0]):i[0]:Ja(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}]),e}(),nl=Za,rl=qa,il=Fa,ol={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:nl,table:nl,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ol.def=rl(ol.def).replace("label",ol._label).replace("title",ol._title).getRegex(),ol.bullet=/(?:[*+-]|\d{1,9}[.)])/,ol.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,ol.item=rl(ol.item,"gm").replace(/bull/g,ol.bullet).getRegex(),ol.listItemStart=rl(/^( *)(bull)/).replace("bull",ol.bullet).getRegex(),ol.list=rl(ol.list).replace(/bull/g,ol.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ol.def.source+")").getRegex(),ol._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ol._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ol.html=rl(ol.html,"i").replace("comment",ol._comment).replace("tag",ol._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ol.paragraph=rl(ol._paragraph).replace("hr",ol.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ol._tag).getRegex(),ol.blockquote=rl(ol.blockquote).replace("paragraph",ol.paragraph).getRegex(),ol.normal=il({},ol),ol.gfm=il({},ol.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ol.gfm.nptable=rl(ol.gfm.nptable).replace("hr",ol.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ol._tag).getRegex(),ol.gfm.table=rl(ol.gfm.table).replace("hr",ol.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ol._tag).getRegex(),ol.pedantic=il({},ol.normal,{html:rl("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ol._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:nl,paragraph:rl(ol.normal._paragraph).replace("hr",ol.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ol.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var al={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:nl,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:nl,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};al.punctuation=rl(al.punctuation).replace(/punctuation/g,al._punctuation).getRegex(),al._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",al._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",al._comment=rl(ol._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),al.em.start=rl(al.em.start).replace(/punctuation/g,al._punctuation).getRegex(),al.em.middle=rl(al.em.middle).replace(/punctuation/g,al._punctuation).replace(/overlapSkip/g,al._overlapSkip).getRegex(),al.em.endAst=rl(al.em.endAst,"g").replace(/punctuation/g,al._punctuation).getRegex(),al.em.endUnd=rl(al.em.endUnd,"g").replace(/punctuation/g,al._punctuation).getRegex(),al.strong.start=rl(al.strong.start).replace(/punctuation/g,al._punctuation).getRegex(),al.strong.middle=rl(al.strong.middle).replace(/punctuation/g,al._punctuation).replace(/overlapSkip/g,al._overlapSkip).getRegex(),al.strong.endAst=rl(al.strong.endAst,"g").replace(/punctuation/g,al._punctuation).getRegex(),al.strong.endUnd=rl(al.strong.endUnd,"g").replace(/punctuation/g,al._punctuation).getRegex(),al.blockSkip=rl(al._blockSkip,"g").getRegex(),al.overlapSkip=rl(al._overlapSkip,"g").getRegex(),al._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,al._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,al._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,al.autolink=rl(al.autolink).replace("scheme",al._scheme).replace("email",al._email).getRegex(),al._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,al.tag=rl(al.tag).replace("comment",al._comment).replace("attribute",al._attribute).getRegex(),al._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,al._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,al._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,al.link=rl(al.link).replace("label",al._label).replace("href",al._href).replace("title",al._title).getRegex(),al.reflink=rl(al.reflink).replace("label",al._label).getRegex(),al.reflinkSearch=rl(al.reflinkSearch,"g").replace("reflink",al.reflink).replace("nolink",al.nolink).getRegex(),al.normal=il({},al),al.pedantic=il({},al.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rl(/^!?\[(label)\]\((.*?)\)/).replace("label",al._label).getRegex(),reflink:rl(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",al._label).getRegex()}),al.gfm=il({},al.normal,{escape:rl(al.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),al.gfm.url=rl(al.gfm.url,"i").replace("email",al.gfm._extended_email).getRegex(),al.breaks=il({},al.gfm,{br:rl(al.br).replace("{2,}","*").getRegex(),text:rl(al.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ll={block:ol,inline:al},sl=ba.defaults,cl=ll.block,ul=ll.inline,fl=Va;function pl(e){return e.replace(/---/g,"").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"").replace(/\.{3}/g,"")}function hl(e){var t,n,r="",i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var gl=function(){function e(t){_o(this,e),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||sl,this.options.tokenizer=this.options.tokenizer||new tl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var n={block:cl.normal,inline:ul.normal};this.options.pedantic?(n.block=cl.pedantic,n.inline=ul.pedantic):this.options.gfm&&(n.block=cl.gfm,this.options.breaks?n.inline=ul.breaks:n.inline=ul.gfm),this.tokenizer.rules=n}return Eo(e,[{key:"lex",value:function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}},{key:"blockTokens",value:function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];for(e=e.replace(/^ +$/gm,"");e;)if(t=this.tokenizer.space(e))e=e.substring(t.raw.length),t.type&&o.push(t);else if(t=this.tokenizer.code(e,o))e=e.substring(t.raw.length),t.type?o.push(t):((i=o[o.length-1]).raw+="\n"+t.raw,i.text+="\n"+t.text);else if(t=this.tokenizer.fences(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.heading(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.nptable(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.hr(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.blockquote(e))e=e.substring(t.raw.length),t.tokens=this.blockTokens(t.text,[],a),o.push(t);else if(t=this.tokenizer.list(e)){for(e=e.substring(t.raw.length),r=t.items.length,n=0;n<r;n++)t.items[n].tokens=this.blockTokens(t.items[n].text,[],!1);o.push(t)}else if(t=this.tokenizer.html(e))e=e.substring(t.raw.length),o.push(t);else if(a&&(t=this.tokenizer.def(e)))e=e.substring(t.raw.length),this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});else if(t=this.tokenizer.table(e))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.lheading(e))e=e.substring(t.raw.length),o.push(t);else if(a&&(t=this.tokenizer.paragraph(e)))e=e.substring(t.raw.length),o.push(t);else if(t=this.tokenizer.text(e,o))e=e.substring(t.raw.length),t.type?o.push(t):((i=o[o.length-1]).raw+="\n"+t.raw,i.text+="\n"+t.text);else if(e){var l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}return o}},{key:"inline",value:function(e){var t,n,r,i,o,a,l=e.length;for(t=0;t<l;t++)switch((a=e[t]).type){case"paragraph":case"text":case"heading":a.tokens=[],this.inlineTokens(a.text,a.tokens);break;case"table":for(a.tokens={header:[],cells:[]},i=a.header.length,n=0;n<i;n++)a.tokens.header[n]=[],this.inlineTokens(a.header[n],a.tokens.header[n]);for(i=a.cells.length,n=0;n<i;n++)for(o=a.cells[n],a.tokens.cells[n]=[],r=0;r<o.length;r++)a.tokens.cells[n][r]=[],this.inlineTokens(o[r],a.tokens.cells[n][r]);break;case"blockquote":this.inline(a.tokens);break;case"list":for(i=a.items.length,n=0;n<i;n++)this.inline(a.items[n].tokens)}return e}},{key:"inlineTokens",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",l=e;if(this.tokens.links){var s=Object.keys(this.tokens.links);if(s.length>0)for(;null!=(n=this.tokenizer.rules.inline.reflinkSearch.exec(l));)s.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,n.index)+"["+fl("a",n[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(n=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,n.index)+"["+fl("a",n[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(t=this.tokenizer.escape(e))e=e.substring(t.raw.length),r.push(t);else if(t=this.tokenizer.tag(e,i,o))e=e.substring(t.raw.length),i=t.inLink,o=t.inRawBlock,r.push(t);else if(t=this.tokenizer.link(e))e=e.substring(t.raw.length),"link"===t.type&&(t.tokens=this.inlineTokens(t.text,[],!0,o)),r.push(t);else if(t=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(t.raw.length),"link"===t.type&&(t.tokens=this.inlineTokens(t.text,[],!0,o)),r.push(t);else if(t=this.tokenizer.strong(e,l,a))e=e.substring(t.raw.length),t.tokens=this.inlineTokens(t.text,[],i,o),r.push(t);else if(t=this.tokenizer.em(e,l,a))e=e.substring(t.raw.length),t.tokens=this.inlineTokens(t.text,[],i,o),r.push(t);else if(t=this.tokenizer.codespan(e))e=e.substring(t.raw.length),r.push(t);else if(t=this.tokenizer.br(e))e=e.substring(t.raw.length),r.push(t);else if(t=this.tokenizer.del(e))e=e.substring(t.raw.length),t.tokens=this.inlineTokens(t.text,[],i,o),r.push(t);else if(t=this.tokenizer.autolink(e,hl))e=e.substring(t.raw.length),r.push(t);else if(i||!(t=this.tokenizer.url(e,hl))){if(t=this.tokenizer.inlineText(e,o,pl))e=e.substring(t.raw.length),a=t.raw.slice(-1),r.push(t);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(t.raw.length),r.push(t);return r}}],[{key:"lex",value:function(t,n){return new e(n).lex(t)}},{key:"lexInline",value:function(t,n){return new e(n).inlineTokens(t)}},{key:"rules",get:function(){return{block:cl,inline:ul}}}]),e}(),dl=ba.defaults,vl=Da,yl=Na,kl=function(){function e(t){_o(this,e),this.options=t||dl}return Eo(e,[{key:"code",value:function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'<pre><code class="'+this.options.langPrefix+yl(r,!0)+'">'+(n?e:yl(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:yl(e,!0))+"</code></pre>\n"}},{key:"blockquote",value:function(e){return"<blockquote>\n"+e+"</blockquote>\n"}},{key:"html",value:function(e){return e}},{key:"heading",value:function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}},{key:"hr",value:function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}},{key:"list",value:function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"}},{key:"listitem",value:function(e){return"<li>"+e+"</li>\n"}},{key:"checkbox",value:function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}},{key:"paragraph",value:function(e){return"<p>"+e+"</p>\n"}},{key:"table",value:function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}},{key:"tablerow",value:function(e){return"<tr>\n"+e+"</tr>\n"}},{key:"tablecell",value:function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}},{key:"strong",value:function(e){return"<strong>"+e+"</strong>"}},{key:"em",value:function(e){return"<em>"+e+"</em>"}},{key:"codespan",value:function(e){return"<code>"+e+"</code>"}},{key:"br",value:function(){return this.options.xhtml?"<br/>":"<br>"}},{key:"del",value:function(e){return"<del>"+e+"</del>"}},{key:"link",value:function(e,t,n){if(null===(e=vl(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+yl(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}},{key:"image",value:function(e,t,n){if(null===(e=vl(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"}},{key:"text",value:function(e){return e}}]),e}(),ml=function(){function e(){_o(this,e)}return Eo(e,[{key:"strong",value:function(e){return e}},{key:"em",value:function(e){return e}},{key:"codespan",value:function(e){return e}},{key:"del",value:function(e){return e}},{key:"html",value:function(e){return e}},{key:"text",value:function(e){return e}},{key:"link",value:function(e,t,n){return""+n}},{key:"image",value:function(e,t,n){return""+n}},{key:"br",value:function(){return""}}]),e}(),bl=function(){function e(){_o(this,e),this.seen={}}return Eo(e,[{key:"serialize",value:function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}},{key:"getNextSafeSlug",value:function(e,t){var n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{n=e+"-"+ ++r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n}},{key:"slug",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}]),e}(),xl=ba.defaults,wl=Ua,Sl=function(){function e(t){_o(this,e),this.options=t||xl,this.options.renderer=this.options.renderer||new kl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ml,this.slugger=new bl}return Eo(e,[{key:"parse",value:function(e){var t,n,r,i,o,a,l,s,c,u,f,p,h,g,d,v,y,k,m=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],b="",x=e.length;for(t=0;t<x;t++)switch((u=e[t]).type){case"space":continue;case"hr":b+=this.renderer.hr();continue;case"heading":b+=this.renderer.heading(this.parseInline(u.tokens),u.depth,wl(this.parseInline(u.tokens,this.textRenderer)),this.slugger);continue;case"code":b+=this.renderer.code(u.text,u.lang,u.escaped);continue;case"table":for(s="",l="",i=u.header.length,n=0;n<i;n++)l+=this.renderer.tablecell(this.parseInline(u.tokens.header[n]),{header:!0,align:u.align[n]});for(s+=this.renderer.tablerow(l),c="",i=u.cells.length,n=0;n<i;n++){for(l="",o=(a=u.tokens.cells[n]).length,r=0;r<o;r++)l+=this.renderer.tablecell(this.parseInline(a[r]),{header:!1,align:u.align[r]});c+=this.renderer.tablerow(l)}b+=this.renderer.table(s,c);continue;case"blockquote":c=this.parse(u.tokens),b+=this.renderer.blockquote(c);continue;case"list":for(f=u.ordered,p=u.start,h=u.loose,i=u.items.length,c="",n=0;n<i;n++)v=(d=u.items[n]).checked,y=d.task,g="",d.task&&(k=this.renderer.checkbox(v),h?d.tokens.length>0&&"text"===d.tokens[0].type?(d.tokens[0].text=k+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&"text"===d.tokens[0].tokens[0].type&&(d.tokens[0].tokens[0].text=k+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:k}):g+=k),g+=this.parse(d.tokens,h),c+=this.renderer.listitem(g,y,v);b+=this.renderer.list(c,f,p);continue;case"html":b+=this.renderer.html(u.text);continue;case"paragraph":b+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(c=u.tokens?this.parseInline(u.tokens):u.text;t+1<x&&"text"===e[t+1].type;)c+="\n"+((u=e[++t]).tokens?this.parseInline(u.tokens):u.text);b+=m?this.renderer.paragraph(c):c;continue;default:var w='Token with "'+u.type+'" type was not found.';if(this.options.silent)return void console.error(w);throw new Error(w)}return b}},{key:"parseInline",value:function(e,t){t=t||this.renderer;var n,r,i="",o=e.length;for(n=0;n<o;n++)switch((r=e[n]).type){case"escape":i+=t.text(r.text);break;case"html":i+=t.html(r.text);break;case"link":i+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":i+=t.image(r.href,r.title,r.text);break;case"strong":i+=t.strong(this.parseInline(r.tokens,t));break;case"em":i+=t.em(this.parseInline(r.tokens,t));break;case"codespan":i+=t.codespan(r.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(r.tokens,t));break;case"text":i+=t.text(r.text);break;default:var a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(a);throw new Error(a)}return i}}],[{key:"parse",value:function(t,n){return new e(n).parse(t)}},{key:"parseInline",value:function(t,n){return new e(n).parseInline(t)}}]),e}(),_l=Fa,Al=Ba,El=Na,Ol=ba.getDefaults,Tl=ba.changeDefaults,Rl=ba.defaults;function Il(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),t=_l({},Il.defaults,t||{}),Al(t),n){var r,i=t.highlight;try{r=gl.lex(e,t)}catch(e){return n(e)}var o=function(e){var o;if(!e)try{o=Sl.parse(r,t)}catch(t){e=t}return t.highlight=i,e?n(e):n(null,o)};if(!i||i.length<3)return o();if(delete t.highlight,!r.length)return o();var a=0;return Il.walkTokens(r,(function(e){"code"===e.type&&(a++,setTimeout((function(){i(e.text,e.lang,(function(t,n){if(t)return o(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),0===--a&&o()}))}),0))})),void(0===a&&o())}try{var l=gl.lex(e,t);return t.walkTokens&&Il.walkTokens(l,t.walkTokens),Sl.parse(l,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+El(e.message+"",!0)+"</pre>";throw e}}Il.options=Il.setOptions=function(e){return _l(Il.defaults,e),Tl(Il.defaults),Il},Il.getDefaults=Ol,Il.defaults=Rl,Il.use=function(e){var t=_l({},e);if(e.renderer&&function(){var n=Il.defaults.renderer||new kl,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var l=e.renderer[t].apply(n,o);return!1===l&&(l=r.apply(n,o)),l}};for(var i in e.renderer)r(i);t.renderer=n}(),e.tokenizer&&function(){var n=Il.defaults.tokenizer||new tl,r=function(t){var r=n[t];n[t]=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var l=e.tokenizer[t].apply(n,o);return!1===l&&(l=r.apply(n,o)),l}};for(var i in e.tokenizer)r(i);t.tokenizer=n}(),e.walkTokens){var n=Il.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),n&&n(t)}}Il.setOptions(t)},Il.walkTokens=function(e,t){var n,r=zo(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;switch(t(i),i.type){case"table":var o,a=zo(i.tokens.header);try{for(a.s();!(o=a.n()).done;){var l=o.value;Il.walkTokens(l,t)}}catch(e){a.e(e)}finally{a.f()}var s,c=zo(i.tokens.cells);try{for(c.s();!(s=c.n()).done;){var u,f=zo(s.value);try{for(f.s();!(u=f.n()).done;){var p=u.value;Il.walkTokens(p,t)}}catch(e){f.e(e)}finally{f.f()}}}catch(e){c.e(e)}finally{c.f()}break;case"list":Il.walkTokens(i.items,t);break;default:i.tokens&&Il.walkTokens(i.tokens,t)}}}catch(e){r.e(e)}finally{r.f()}},Il.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");t=_l({},Il.defaults,t||{}),Al(t);try{var n=gl.lexInline(e,t);return t.walkTokens&&Il.walkTokens(n,t.walkTokens),Sl.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+El(e.message+"",!0)+"</pre>";throw e}},Il.Parser=Sl,Il.parser=Sl.parse,Il.Renderer=kl,Il.TextRenderer=ml,Il.Lexer=gl,Il.lexer=gl.lex,Il.Tokenizer=tl,Il.Slugger=bl,Il.parse=Il;var jl=Il,zl="__SCRIPT_END__",$l=/\[([\s\d,|-]*)\]/,Pl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return function(){var e;function t(e){var t=(e.querySelector("[data-template]")||e.querySelector("script")||e).textContent,n=(t=t.replace(new RegExp(zl,"g"),"<\/script>")).match(/^\n?(\s*)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length;return r>0?t=t.replace(new RegExp("\\n?\\t{"+r+"}","g"),"\n"):n>1&&(t=t.replace(new RegExp("\\n? {"+n+"}","g"),"\n")),t}function n(e){for(var t=e.attributes,n=[],r=0,i=t.length;r<i;r++){var o=t[r].name,a=t[r].value;/data\-(markdown|separator|vertical|notes)/gi.test(o)||(a?n.push(o+'="'+a+'"'):n.push(o))}return n.join(" ")}function r(e){return(e=e||{}).separator=e.separator||"^\r?\n---\r?\n$",e.notesSeparator=e.notesSeparator||"notes?:",e.attributes=e.attributes||"",e}function i(e,t){t=r(t);var n=e.split(new RegExp(t.notesSeparator,"mgi"));return 2===n.length&&(e=n[0]+'<aside class="notes">'+jl(n[1].trim())+"</aside>"),'<script type="text/template">'+(e=e.replace(/<\/script>/g,zl))+"<\/script>"}function o(e,t){t=r(t);for(var n,o,a,l=new RegExp(t.separator+(t.verticalSeparator?"|"+t.verticalSeparator:""),"mg"),s=new RegExp(t.separator),c=0,u=!0,f=[];n=l.exec(e);)!(o=s.test(n[0]))&&u&&f.push([]),a=e.substring(c,n.index),o&&u?f.push(a):f[f.length-1].push(a),c=l.lastIndex,u=o;(u?f:f[f.length-1]).push(e.substring(c));for(var p="",h=0,g=f.length;h<g;h++)f[h]instanceof Array?(p+="<section "+t.attributes+">",f[h].forEach((function(e){p+="<section data-markdown>"+i(e,t)+"</section>"})),p+="</section>"):p+="<section "+t.attributes+" data-markdown>"+i(f[h],t)+"</section>";return p}function a(e){return new Promise((function(r){var a=[];[].slice.call(e.querySelectorAll("[data-markdown]:not([data-markdown-parsed])")).forEach((function(e,r){e.getAttribute("data-markdown").length?a.push(function(e){return new Promise((function(t,n){var r=new XMLHttpRequest,i=e.getAttribute("data-markdown"),o=e.getAttribute("data-charset");null!=o&&""!=o&&r.overrideMimeType("text/html; charset="+o),r.onreadystatechange=function(e,r){4===r.readyState&&(r.status>=200&&r.status<300||0===r.status?t(r,i):n(r,i))}.bind(this,e,r),r.open("GET",i,!0);try{r.send()}catch(e){console.warn("Failed to get the Markdown file "+i+". Make sure that the presentation and the file are served by a HTTP server and the file can be found there. "+e),t(r,i)}}))}(e).then((function(t,r){e.outerHTML=o(t.responseText,{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:n(e)})}),(function(t,n){e.outerHTML='<section data-state="alert">ERROR: The attempt to fetch '+n+" failed with HTTP status "+t.status+".Check your browser's JavaScript console for more details.<p>Remember that you need to serve the presentation HTML from a HTTP server.</p></section>"}))):e.getAttribute("data-separator")||e.getAttribute("data-separator-vertical")||e.getAttribute("data-separator-notes")?e.outerHTML=o(t(e),{separator:e.getAttribute("data-separator"),verticalSeparator:e.getAttribute("data-separator-vertical"),notesSeparator:e.getAttribute("data-separator-notes"),attributes:n(e)}):e.innerHTML=i(t(e))})),Promise.all(a).then(r)}))}function l(e,t,n){var r,i,o=new RegExp(n,"mg"),a=new RegExp('([^"= ]+?)="([^"]+?)"|(data-[^"= ]+?)(?=[" ])',"mg"),l=e.nodeValue;if(r=o.exec(l)){var s=r[1];for(l=l.substring(0,r.index)+l.substring(o.lastIndex),e.nodeValue=l;i=a.exec(s);)i[2]?t.setAttribute(i[1],i[2]):t.setAttribute(i[3],"");return!0}return!1}function s(e,t,n,r,i){if(null!=t&&null!=t.childNodes&&t.childNodes.length>0)for(var o=t,a=0;a<t.childNodes.length;a++){var c=t.childNodes[a];if(a>0)for(var u=a-1;u>=0;){var f=t.childNodes[u];if("function"==typeof f.setAttribute&&"BR"!=f.tagName){o=f;break}u-=1}var p=e;"section"==c.nodeName&&(p=c,o=c),"function"!=typeof c.setAttribute&&c.nodeType!=Node.COMMENT_NODE||s(p,c,o,r,i)}t.nodeType==Node.COMMENT_NODE&&0==l(t,n,r)&&l(t,e,i)}function c(){var n=e.getRevealElement().querySelectorAll("[data-markdown]:not([data-markdown-parsed])");return[].slice.call(n).forEach((function(e){e.setAttribute("data-markdown-parsed",!0);var n=e.querySelector("aside.notes"),r=t(e);e.innerHTML=jl(r),s(e,e,null,e.getAttribute("data-element-attributes")||e.parentNode.getAttribute("data-element-attributes")||"\\.element\\s*?(.+?)$",e.getAttribute("data-attributes")||e.parentNode.getAttribute("data-attributes")||"\\.slide:\\s*?(\\S.+?)$"),n&&e.appendChild(n)})),Promise.resolve()}return{id:"markdown",init:function(t){e=t;var n=new jl.Renderer;return n.code=function(e,t){var n="";return $l.test(t)&&(n=t.match($l)[1].trim(),n='data-line-numbers="'.concat(n,'"'),t=t.replace($l,"").trim()),e=e.replace(/([&<>'"])/g,(function(e){return Pl[e]})),"<pre><code ".concat(n,' class="').concat(t,'">').concat(e,"</code></pre>")},jl.setOptions(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?To(Object(n),!0).forEach((function(t){Oo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):To(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({renderer:n},e.getConfig().markdown)),a(e.getRevealElement()).then(c)},processSlides:a,convertSlides:c,slidify:o,marked:jl}}}));