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gK,KAAKmB,cAKVpK,SAASsD,cAAc,4BACzBtD,SAASsD,cAAc,2BAA2BxB,aAAa,eAAe,EAElF,I,gFAAC,CAhnB2B,GAmnB9B,G,89CC1nBM3C,EAAY,WA2BhB,O,EApBA,SAAAA,EAAYkL,EAAcC,I,4FAAUtL,CAAA,KAAAG,GAKlCF,KAAKsL,OAASF,EAMdpL,KAAKuL,KAAOnG,OAAOoG,QAAQH,GAAUI,QACnC,SAACC,EAAGC,GAAA,IAAAC,E,w5BAAAC,CAAAF,EAAE,GAAChJ,EAAKiJ,EAAA,GAAEE,EAAUF,EAAA,UAAAG,EAAAA,EAAA,GACnBL,GAAG,GAAAvL,EAAA,GACLwC,EAAQ,IAAIqJ,IAAIF,IAAW,GAE9B,CAAC,EAEL,E,EAEA,EAAApL,IAAA,QAAAY,IAGA,WACE,OAAOtB,KAAKsL,MACd,GAEA,CAAA5K,IAAA,eAAAC,MAWA,WAAwB,QAAAsL,EAAAjJ,UAAAC,OAARiJ,EAAM,IAAA7F,MAAA4F,GAAAE,EAAA,EAAAA,EAAAF,EAAAE,IAAND,EAAMC,GAAAnJ,UAAAmJ,GACpB,OAAO,IAAIH,IAAIE,GAAQE,IAAIpM,KAAKsL,OAClC,GAEA,CAAA5K,IAAA,WAAAC,MAMA,SAAS0L,GACP,IAAMC,EAActM,KAAKuL,KAAKvL,KAAKsL,QACnC,IAAKgB,EACH,MAAM,IAAI/J,MAAM,sCAAD2D,OAAuClG,KAAKsL,SAGzDgB,EAAYF,IAAIC,KAClBrM,KAAKsL,OAASe,EASlB,I,gFAAC,CAvEe,GA0ElB,K","sources":["webpack://@upstatement/harvard-law-school-wp-theme/./static/js/components/gallery-block-modal-gallery/constants.js","webpack://@upstatement/harvard-law-school-wp-theme/./static/js/components/gallery-block-modal-gallery/Slide.js","webpack://@upstatement/harvard-law-school-wp-theme/./static/js/components/gallery-block-modal-gallery/index.js","webpack://@upstatement/harvard-law-school-wp-theme/./static/js/utils/StateMachine.js"],"sourcesContent":["export const STATE = {\n unmounted: 'unmounted',\n beforeUnmount: 'beforeUnmount',\n beforeMount: 'beforeMount',\n mounted: 'mounted',\n open: 'open',\n beforeOpen: 'beforeOpen',\n beforeClose: 'beforeClose',\n};\n\nexport const TARGET_CLASSES = {\n root: 'js-gallery-block-modal-gallery__root',\n trigger: 'js-gallery-block-modal-gallery__trigger',\n hidden: 'js-gallery-block-modal-gallery__hidden',\n videoOverlay: 'js-gallery-block-modal-gallery__video-overlay',\n videoButton: 'js-gallery-block-modal-gallery__video-button',\n open: 'js-gallery-block-modal-gallery__open',\n caption: 'js-gallery-block-modal-gallery__caption',\n image: 'js-gallery-block-modal-gallery__image',\n title: 'js-gallery-block-modal-gallery__title',\n subtitle: 'js-gallery-block-modal-gallery__subtitle',\n description: 'js-gallery-block-modal-gallery__description',\n linktext: 'js-gallery-block-modal-gallery__linktext',\n linkurl: 'js-gallery-block-modal-gallery__linkurl',\n linkout: 'js-gallery-block-modal-gallery__linkout',\n close: 'js-gallery-block-modal-gallery__close',\n countCurrent: 'js-gallery-block-modal-gallery__count--current',\n countTotal: 'js-gallery-block-modal-gallery__count--total',\n credit: 'js-gallery-block-modal-gallery__credit',\n next: 'js-gallery-block-modal-gallery__next',\n previous: 'js-gallery-block-modal-gallery__previous',\n slideAsset: 'js-gallery-block-modal-gallery__asset',\n slideActive: 'js-gallery-block-modal-gallery__slide--active',\n slideNext: 'js-gallery-block-modal-gallery__slide--next',\n slidePrevious: 'js-gallery-block-modal-gallery__slide--previous',\n extraSlides: 'js-gallery-block-modal-gallery__extra-slides',\n};\n\nexport const COMPONENTS = {\n caption: null,\n image: null,\n title: null,\n subtitle: null,\n description: null,\n linktext: null,\n linkurl: null,\n linkout: null,\n close: [],\n countCurrent: null,\n countTotal: null,\n credit: null,\n next: [],\n open: [],\n previous: [],\n slideActive: null,\n slideNext: null,\n slidePrevious: null,\n};\n","import { StateMachine, on } from '@src/utils';\nimport { KEY_CODES } from '@src/utils/constants';\nimport { TARGET_CLASSES } from './constants';\n\nconst STATE = {\n unmounted: 'unmounted',\n beforeMount: 'beforeMount',\n mounted: 'mounted',\n beforeUnmount: 'beforeUnmount',\n};\n\nconst VIDEO_LABELS = {\n play: 'Play',\n pause: 'Pause',\n ariaPlay: 'Play Video',\n ariaPause: 'Pause Video',\n};\n\nclass Slide {\n /**\n * Creates a new slide for the modal gallery.\n *\n * @param {HTMLImageElement|HTMLVideoElement} ref the original reference to the image or video element\n * on the page\n */\n constructor(ref) {\n this.stateManager = new StateMachine(STATE.unmounted, {\n [STATE.unmounted]: [STATE.beforeMount],\n [STATE.beforeMount]: [STATE.mounted],\n [STATE.mounted]: [STATE.beforeUnmount],\n [STATE.beforeUnmount]: [STATE.unmounted],\n });\n\n this.ref = ref;\n this.wrapper = null;\n this.button = null;\n this.el = null; // the media element (img/video)\n this.videoPoster = null;\n\n this.initialize();\n this.mount();\n }\n\n initialize() {\n // Clone the ref to display it in the slide and give it our custom class\n this.el = this.ref.cloneNode(true);\n this.el.className = TARGET_CLASSES.slideAsset;\n\n if (this.isVideo) {\n this.videoPoster = document.createElement('img');\n this.videoPoster.src = this.ref.poster;\n } else {\n // For image sizes\n this.el.src = this.ref.dataset.src || this.ref.src;\n this.el.srcset = this.ref.dataset.srcset || this.ref.srcset;\n this.el.sizes = this.ref.dataset.sizes || this.ref.sizes;\n }\n }\n\n /**\n * @type {boolean} whether the slide is currently mounted\n */\n get isMounted() {\n return this.stateManager.isStateOneOf([STATE.beforeMount, STATE.mounted, STATE.beforeUnmount]);\n }\n\n /**\n * @type {HTMLImageElement} the preview to show for inactive slides\n */\n get preview() {\n if (this.isVideo) {\n return this.videoPoster;\n }\n return this.el;\n }\n\n /**\n * @type {boolean} whether the slide is a video\n */\n get isVideo() {\n return this.ref instanceof HTMLVideoElement;\n }\n\n /**\n * @type {string} the slide's media caption\n */\n get caption() {\n return this.ref.dataset.caption || '';\n }\n\n /**\n * @type {string} the slide's media credit\n */\n get credit() {\n return this.ref.dataset.credit || '';\n }\n\n /**\n * @type {string} the slide's media title\n */\n get title() {\n return this.ref.dataset.title || '';\n }\n\n /**\n * @type {string} the slide's media title\n */\n get subtitle() {\n return this.ref.dataset.subtitle || '';\n }\n\n /**\n * @type {string} the slide's media description\n */\n get description() {\n return this.ref.dataset.description || '';\n }\n\n /**\n * @type {string} the slide's media link text\n */\n get linktext() {\n return this.ref.dataset.linktext || '';\n }\n\n /**\n * @type {string} the slide's media link URL\n */\n get linkurl() {\n return this.ref.dataset.linkurl || '';\n }\n\n /**\n * Callback before the slide is mounted. Wraps the media reference in a `span` for\n * adding the open button.\n */\n _beforeMount() {\n const wrapper = document.createElement('span');\n wrapper.classList.add(TARGET_CLASSES.trigger);\n\n // If the media item isn't absolutely positioned, add a relative class\n // to position the wrapper element correctly\n if (window.getComputedStyle(this.ref).position !== 'absolute') {\n wrapper.classList.add('relative');\n }\n\n let videoOverlay = null;\n const isFromVideoBlock = this.ref.parentNode.classList.contains('wp-block-video');\n\n if (this.isVideo && isFromVideoBlock) {\n wrapper.classList.add('video');\n videoOverlay = this.createVideoOverlayElem();\n }\n\n // Add the wrapper around the media element\n this.ref.parentNode.insertBefore(wrapper, this.ref);\n\n // Append the media element to the wrapper\n wrapper.append(this.ref);\n\n // Append the video overlay and play the video\n if (videoOverlay) {\n wrapper.append(videoOverlay);\n this.ref.play();\n }\n\n this.wrapper = wrapper;\n }\n\n /**\n * Mounts the slide to the DOM. If the slide is already mounted, an error\n * is thrown.\n */\n mount() {\n if (this.isMounted) {\n throw new Error('Slide is already mounted!');\n }\n\n this.stateManager.setState(STATE.beforeMount);\n this._beforeMount();\n this.stateManager.setState(STATE.mounted);\n }\n\n /**\n * Unwraps the media reference, removes the wrapper, and resets both the wrapper and button.\n */\n _beforeUnmount() {\n if (this.wrapper) {\n this.wrapper.parentNode.insertBefore(this.wrapper, this.ref);\n this.wrapper.parentNode.removeChild(this.wrapper);\n }\n\n this.button = null;\n this.wrapper = null;\n }\n\n /**\n * Unmounts the slide from the DOM, if the slide was mounted.\n */\n unmount() {\n if (this.stateManager.state === STATE.mounted) {\n this.stateManager.setState(STATE.beforeUnmount);\n this._beforeUnmount();\n this.stateManager.setState(STATE.unmounted);\n }\n }\n\n /**\n * Retrieves the slide's open button or, if it doesn't exist, creates one.\n *\n * @return {HTMLButtonElement} the open button, or `null` if the slide isn't mounted\n */\n getOrCreateOpenButton() {\n if (this.stateManager.state !== STATE.mounted) {\n return null;\n } else if (!this.button) {\n const button = document.createElement('button');\n\n button.setAttribute('aria-label', 'Open modal gallery');\n button.classList.add(TARGET_CLASSES.open);\n\n this.wrapper.append(button);\n this.button = button;\n }\n return this.button;\n }\n\n /**\n * Renders the slide to the given element.\n *\n * @param {HTMLElement} element the element to render to\n * @param {boolean} [active=false] whether the slide is currently active\n * @return {HTMLImageElement|HTMLVideoElement} the rendered slide\n */\n renderTo(element, active = false) {\n if (this.stateManager.state !== STATE.mounted || !element) {\n return null;\n }\n\n if (active) {\n element.appendChild(this.el);\n\n // Append the video overlay and play the video from the beginning\n if (this.isVideo) {\n const videoOverlay = this.createVideoOverlayElem();\n element.append(videoOverlay);\n\n this.el.currentTime = 0;\n this.el.play();\n }\n\n return;\n }\n\n return element.appendChild(this.preview);\n }\n\n /**\n * Returns overlay div allow video play/pause functionality\n *\n * @return {HTMLElement} video overlay div with button\n */\n createVideoOverlayElem() {\n const button = document.createElement('button');\n button.classList.add('article-asset-mod__video-btn');\n button.classList.add(TARGET_CLASSES.videoButton);\n button.innerHTML =\n 'PauseVideo playing';\n\n on(button, 'click', this.toggleVideoPlay);\n on(button, 'keydown', e => {\n const spaceKey = e.key === KEY_CODES.SPACE || e.key === KEY_CODES.SPACE_IE11;\n const enterKey = e.key === KEY_CODES.ENTER;\n if (spaceKey || enterKey) {\n e.preventDefault(); // prevent page from scrolling down\n this.toggleVideoPlay(e);\n }\n });\n\n return button;\n }\n\n /**\n * Toggles video play/pause state\n *\n * @param {MouseEvent|KeyboardEvent} e The event from the click or keydown event listeners\n * @return void\n */\n toggleVideoPlay(e) {\n const videoButton = e.currentTarget;\n // Get the ` : '',\n );\n\n // special case for links; start by removing any pre-existing links.\n this._removeChildren(this.components.linkout);\n\n // special case for links; build the link for the current item.\n if (currentSlide.linkurl && currentSlide.linktext) {\n const linkEl = document.createElement('a');\n linkEl.href = currentSlide.linkurl;\n linkEl.classList = ['gallery-block-modal-linkout'];\n\n const linkSpan = document.createElement('span');\n linkSpan.classList = ['gallery-block-modal-inner'];\n linkSpan.innerText = `${currentSlide.linktext} `;\n\n const innerLinkSpan = document.createElement('span');\n innerLinkSpan.classList = ['gallery-block-modal-link-keep'];\n\n const linkSVG = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n linkSVG.setAttribute('display', 'none');\n linkSVG.setAttribute('width', '0');\n linkSVG.setAttribute('height', '0');\n linkSVG.setAttribute('version', '1.1');\n linkSVG.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n linkSVG.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n linkSVG.setAttribute('aria-hidden', true);\n linkSVG.setAttribute('viewBox', '0 0 14 12');\n\n const linkSVGPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n linkSVGPath.setAttribute(\n 'd',\n 'M11.0866 6.8013L5.86592 12L7.97765 12L14 6L7.97765 5.84566e-07L5.86592 6.76873e-07L11.0866 5.1987L-2.97294e-07 5.1987L-2.27242e-07 6.8013L11.0866 6.8013Z',\n );\n linkSVGPath.setAttribute('fill', 'currentColor');\n linkSVG.appendChild(linkSVGPath);\n\n innerLinkSpan.appendChild(linkSVG);\n linkSpan.appendChild(innerLinkSpan);\n linkEl.appendChild(linkSpan);\n\n this.components.linkout.appendChild(linkEl);\n }\n\n this._setInnerHTML(this.components.countCurrent, this.index + 1);\n }\n }\n\n /**\n * Callback for when the modal gallery is about to open. Updates the index to the given\n * one, initializes event listeners, locks body scroll, and makes the gallery visible.\n *\n * @param {number} [index] the index to open the gallery to\n * @param {MouseEvent} [event] the event that triggered opening the gallery modal\n */\n _beforeOpen(index, event) {\n if (index !== undefined) {\n this.index = index;\n }\n\n this.galleryListeners.push(\n on(window, 'keydown', this._onKeyDown.bind(this)),\n on(this.components.close, 'click', this.close.bind(this)),\n on(this.components.next, 'click', this.next.bind(this)),\n on(this.components.previous, 'click', this.previous.bind(this)),\n );\n\n if (this.numSlides > 1) {\n this._setInnerHTML(this.components.countTotal, this.numSlides);\n this.root.classList.remove('disable-controls');\n } else {\n this.root.classList.add('disable-controls');\n }\n\n this._update();\n this.root.setAttribute('aria-hidden', false);\n this.outsideModalEls.forEach(el => el.setAttribute('aria-hidden', true));\n\n // Focus trap.\n if (!this.trap) {\n this.trap = focusTrap.createFocusTrap(this.root);\n }\n\n this.modalOpener = event.currentTarget ?? document.activeElement;\n this.root.focus();\n disableBodyScroll(this.root, {\n allowTouchMove: el => {\n while (el && el !== document.body) {\n if (el.getAttribute('body-scroll-lock-ignore') !== null) {\n return true;\n }\n el = el.parentElement;\n }\n },\n });\n\n // change styles of the modal display to allow for multiple Gallery Blocks on the same page with potentially different image sizes.\n const modalImageSize = this.modalOpener.closest('figure.js-gallery-block-modal-gallery')\n .attributes['data-modal-gallery-image-size'].value;\n const extraSlidesEl = document.querySelector('.js-gallery-block-modal-gallery__extra-slides');\n const contentPaneEl = document.querySelector('#gallery-block-modal-gallery-content-pane');\n const panelAssetEl = document.querySelector('img.js-gallery-block-modal-gallery__asset');\n\n switch (modalImageSize) {\n case 'large':\n // allow for large image size in modal, and image appears left of text\n extraSlidesEl.classList.remove('gallery-modal-text-panel-small');\n extraSlidesEl.classList.add('gallery-modal-text-panel-large');\n contentPaneEl.classList.remove('gallery-modal-image-panel-small');\n contentPaneEl.classList.add('gallery-modal-image-panel-large');\n panelAssetEl.classList.remove('max-height-100');\n break;\n case 'small':\n // allow for small image size in modal, and image appears right of text\n extraSlidesEl.classList.remove('gallery-modal-text-panel-large');\n extraSlidesEl.classList.add('gallery-modal-text-panel-small');\n contentPaneEl.classList.remove('gallery-modal-image-panel-large');\n contentPaneEl.classList.add('gallery-modal-image-panel-small');\n panelAssetEl.classList.add('max-height-100');\n break;\n default:\n // allow for large image size in modal, and image appears left of text\n extraSlidesEl.classList.remove('gallery-modal-text-panel-small');\n extraSlidesEl.classList.add('gallery-modal-text-panel-large');\n contentPaneEl.classList.remove('gallery-modal-image-panel-small');\n contentPaneEl.classList.add('gallery-modal-image-panel-large');\n panelAssetEl.classList.remove('max-height-100');\n break;\n }\n }\n\n /**\n * Opens the modal gallery.\n *\n * @param {number} [index] the index to open the gallery to\n * @param {MouseEvent} [event] the event that triggered opening the gallery modal\n */\n open(index, event) {\n if (this.stateManager.state === STATE.mounted) {\n this.stateManager.setState(STATE.beforeOpen);\n this._beforeOpen(index, event);\n this.stateManager.setState(STATE.open);\n if (this.trap) {\n this.trap.activate();\n }\n\n this.stateLabel.innerText = 'Modal gallery open';\n }\n }\n\n /**\n * Goes to the slide at the given index.\n *\n * @param {number} index the index to go to\n */\n goToSlide(index) {\n if (this.stateManager.state === STATE.open) {\n this.index = index;\n this._update();\n }\n }\n\n /**\n * Advances to the next slide.\n */\n next() {\n if (this.stateManager.state === STATE.open) {\n this.index += 1;\n this._update();\n }\n }\n\n /**\n * Advances to the previous slide.\n */\n previous() {\n if (this.stateManager.state === STATE.open) {\n this.index -= 1;\n this._update();\n }\n }\n\n /**\n * Callback for when the gallery is about to close. Removes all event listeners, unlocks\n * body scroll, and hides the gallery.\n */\n _beforeClose() {\n this.galleryListeners.forEach(off => {\n off();\n });\n this.galleryListeners = [];\n\n enableBodyScroll(this.root);\n this.root.setAttribute('aria-hidden', true);\n this.outsideModalEls.forEach(el => el.setAttribute('aria-hidden', false));\n if (this.modalOpener !== document.body) {\n this.modalOpener?.focus();\n this.modalOpener = null;\n }\n }\n\n /**\n * Closes the modal gallery.\n */\n close() {\n if (this.stateManager.state === STATE.open) {\n this.stateManager.setState(STATE.beforeClose);\n this._beforeClose();\n this.stateManager.setState(STATE.mounted);\n if (this.trap) {\n this.trap.deactivate();\n }\n }\n\n // ALSO close the regular modal gallery view, if present.\n if (document.querySelector('.js-modal-gallery__root')) {\n document.querySelector('.js-modal-gallery__root').setAttribute('aria-hidden', true);\n }\n }\n}\n\nexport default GalleryBlockModalGallery;\n","class StateMachine {\n /**\n * Creates a new state machine.\n *\n * @param {string} initialState the initial state of the machine\n * @param {Record} stateMap a map of states to their valid next states\n */\n constructor(initialState, stateMap) {\n /**\n * @private\n * @type {string} the current internal state\n */\n this._state = initialState;\n\n /**\n * @private\n * @type {Record>} a map of states to their valid next states\n */\n this._map = Object.entries(stateMap).reduce(\n (acc, [state, nextStates]) => ({\n ...acc,\n [state]: new Set(nextStates),\n }),\n {},\n );\n }\n\n /**\n * @type {string} the current state of the machine\n */\n get state() {\n return this._state;\n }\n\n /**\n * Checks whether the current state is any of the given ones.\n *\n * @example\n * ```js\n * const isMounted = stateMachine.isStateOneOf(['beforeMount', 'mounted', 'beforeUnmount']);\n * ```\n *\n * @param {...string} states the different states to check\n * @return {boolean} whether the current state is one of the given ones\n */\n isStateOneOf(...states) {\n return new Set(states).has(this._state);\n }\n\n /**\n * Sets the current state, granted that the given state is valid to move to from\n * the current state in the machine.\n *\n * @param {string} newState the new state to move to\n */\n setState(newState) {\n const validStates = this._map[this._state];\n if (!validStates) {\n throw new Error(`Modal gallery is in unknown state: ${this._state}`);\n }\n\n if (validStates.has(newState)) {\n this._state = newState;\n } else if (process.env.NODE_ENV === 'development') {\n const validStatesList = Array.from(validStates)\n .map(state => `\"${state}\"`)\n .join(',');\n console.warn(\n `Modal gallery is in state \"${this._state}\".\\nFrom here, it can only be in one of the following states: ${validStatesList}`,\n );\n }\n }\n}\n\nexport default StateMachine;\n"],"names":["STATE","TARGET_CLASSES","COMPONENTS","caption","image","title","subtitle","description","linktext","linkurl","linkout","close","countCurrent","countTotal","credit","next","open","previous","slideActive","slideNext","slidePrevious","Slide","ref","_classCallCheck","this","stateManager","StateMachine","_defineProperty","wrapper","button","el","videoPoster","initialize","mount","key","value","cloneNode","className","isVideo","document","createElement","src","poster","dataset","srcset","sizes","get","isStateOneOf","HTMLVideoElement","classList","add","window","getComputedStyle","position","videoOverlay","isFromVideoBlock","parentNode","contains","createVideoOverlayElem","insertBefore","append","play","isMounted","Error","setState","_beforeMount","removeChild","state","_beforeUnmount","setAttribute","element","active","arguments","length","undefined","appendChild","preview","currentTime","_this","innerHTML","on","toggleVideoPlay","e","spaceKey","KEY_CODES","SPACE","SPACE_IE11","enterKey","ENTER","preventDefault","videoButton","currentTarget","video","querySelector","label","stateLabel","svg","paused","textContent","innerText","pause","GalleryBlockModalGallery","_index","container","root","outsideModalEls","modalOpener","components","Object","assign","slides","listeners","galleryListeners","set","newIndex","_getBoundedIndex","forEach","off","index","mediaQuery","map","tag","concat","join","media","Array","from","querySelectorAll","slide","openBtn","getOrCreateOpenButton","push","event","extraSlides","_getComponent","rootEl","multiple","parseInt","target","numSlides","_setInnerHTML","remove","_this2","_toConsumableArray","parentElement","children","filter","n","x","unmount","_removeChildren","Math","min","max","targetClass","options","selector","evt","ARROW_LEFT","ARROW_LEFT_IE11","ARROW_RIGHT","ARROW_RIGHT_IE11","ESCAPE","ESCAPE_IE11","firstChild","lastChild","html","currentSlide","renderTo","regex","subtitleDescription","replaceAll","paragraphDescription","linkEl","href","linkSpan","innerLinkSpan","linkSVG","createElementNS","linkSVGPath","_event$currentTarget","_onKeyDown","bind","_update","trap","focusTrap","activeElement","focus","disableBodyScroll","allowTouchMove","body","getAttribute","modalImageSize","closest","attributes","extraSlidesEl","contentPaneEl","panelAssetEl","_beforeOpen","activate","_this$modalOpener","enableBodyScroll","_beforeClose","deactivate","initialState","stateMap","_state","_map","entries","reduce","acc","_ref","_ref2","_slicedToArray","nextStates","_objectSpread","Set","_len","states","_key","has","newState","validStates"],"sourceRoot":""}