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mV,EAAWvU,GACzB,MAAM4C,EAAM5O,SAAS6G,cAAc,UACnC+H,EAAI2G,IAAMvJ,EACV4C,EAAI1B,OAAQ,EACZlN,SAASC,KAAKugB,OAAO5R,EACvB,C","sources":["webpack://endrun/./app/javascript/app/scrolling/jump.js","webpack://endrun/./app/components/components.js","webpack://endrun/./app/javascript/app/analytics/pagevisibility.js","webpack://endrun/./app/javascript/app/scrolling/global-scroll-service.js","webpack://endrun/./app/javascript/app/initialize.js","webpack://endrun/./app/javascript/app/analytics/honeybadger.js","webpack://endrun/./app/javascript/app/analytics/record.js","webpack://endrun/./app/javascript/app/analytics/scrolldepth.js","webpack://endrun/./app/javascript/app/animations/animations.js","webpack://endrun/./app/javascript/app/dynamic-sizing/dynamic-sizing.js","webpack://endrun/./app/javascript/app/house-ads/house-ads.js","webpack://endrun/./app/javascript/app/legacy/emailsignup-deprecated.js","webpack://endrun/./app/javascript/app/menu/menu.js","webpack://endrun/./app/javascript/app/posts/headers/vertical-header.js","webpack://endrun/./app/javascript/app/scrolling/hotzone.js","webpack://endrun/./app/javascript/app/toasts/toastnotifications.js","webpack://endrun/./app/javascript/app/index.js","webpack://endrun/./app/javascript/app/util/cookiehelpers.js","webpack://endrun/./app/javascript/app/external-services/doccloud.js","webpack://endrun/./app/javascript/app/dynamic-sizing/responsive-iframes.js","webpack://endrun/./app/javascript/app/analytics/mailchimpgoaltracking.js","webpack://endrun/./app/javascript/app/util/dom.js","webpack://endrun/./app/javascript/shared/utils.js"],"sourcesContent":["document.body.addEventListener('click', (event) => {\n const jump = event.target.closest('a[data-anchor-jump]');\n\n if (jump) {\n event.preventDefault();\n const jumpId = jump.getAttribute('data-anchor-jump');\n const land = document.querySelector(`[data-anchor-land=\"${jumpId}\"]`);\n const headerHeight = document\n .querySelector('header')\n .getBoundingClientRect().height;\n const top =\n land.getBoundingClientRect().top - headerHeight + window.scrollY;\n\n window.scrollTo({\n behavior: 'smooth',\n top,\n });\n }\n});\n","import {\n dynamicRenderClassToElement,\n whenElementExists,\n} from '$shared/utils.js';\n\n// Custom elements\nwhenElementExists('tmp-animation', () => import('./animation_component.js'));\nwhenElementExists('tmp-confirm-submit', () =>\n import('./confirm_submit_component.js')\n);\nwhenElementExists('tmp-audio-player', () =>\n import('./audio_player_component.js')\n);\nwhenElementExists('tmp-disclosure', () => import('./disclosure_component.js'));\nwhenElementExists('tmp-datawrapper-embed', () =>\n import('./datawrapper_embed_component.js')\n);\nwhenElementExists('tmp-footnote', () => import('./footnote_component.js'));\nwhenElementExists('tmp-series-page', () =>\n import('./series_page_component.js')\n);\nwhenElementExists('tmp-stream', () => import('./stream_component.js'));\nwhenElementExists('tmp-captcha-protected-form', () =>\n import('./captcha_protected_form.js')\n);\nwhenElementExists('tmp-sensitive-content-component', () =>\n import('./shortcode/sensitive_content_component.js')\n);\n\n// JavaScript\nwhenElementExists('[data-impact-item-id]', () =>\n import('./impact/featured_items_component.js')\n);\nwhenElementExists('[data-sidebar-v1],[data-sidebar-germany]', () =>\n import('./series_sidebar_component.js')\n);\ndynamicRenderClassToElement(\n '.tmp-photo-slideshow-endrun',\n () => import('./photo_slideshow_component.js'),\n { skipRender: true }\n);\nwhenElementExists('.dropdown', () => import('./dropdown_menu_component.js'));\n","window._hidden = false;\n\nfunction isDocumentHidden() {\n // modern API: https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState\n if (document.visibilityState) {\n return document.visibilityState === 'hidden';\n }\n\n // old API: https://developer.mozilla.org/en-US/docs/Web/API/Document/hidden\n return document.hidden;\n}\n\ndocument.addEventListener(\n 'visibilitychange',\n () => {\n if (isDocumentHidden()) {\n window._hidden = true;\n } else {\n window._hidden = false;\n }\n },\n false\n);\n","import { ScrollController, ScrollScene } from '@themarshallproject/scrolling';\n\nexport { ScrollScene };\nexport const globalScrollService = new ScrollController();\n\n// FIXME: get rid of the globals\n// This is just to support graphics rig projects that used the global variable,\n// until we can identify and update all of them.\nwindow.TMPScrolling = {\n ScrollScene,\n scrollService: globalScrollService,\n};\n","// packages\nimport throttle from 'underscore/modules/throttle.js';\n\n// local\nimport { getCsrfToken } from '$shared/http.js';\nimport { createEvent } from './util/events.js';\n\nconst htmlElement = document.documentElement;\nhtmlElement.classList.remove('no-js');\nhtmlElement.classList.add('has-js');\n\nwindow.last_mousemove = new Date().getTime();\nwindow.last_scroll = new Date().getTime();\nwindow.last_resize = new Date().getTime();\n\n// keeping this until we know we're done using $.ajax and friends\nif (typeof $ !== 'undefined' && typeof $.ajaxSetup === 'function') {\n $.ajaxSetup({\n beforeSend: function (xhr) {\n xhr.setRequestHeader('X-CSRF-Token', getCsrfToken());\n },\n });\n}\nwindow.dispatchEvent(createEvent('tmp_ready'));\n\nwindow.addEventListener(\n 'mousemove',\n throttle(() => {\n window.last_mousemove = new Date().getTime();\n }, 500)\n);\n\nwindow.addEventListener(\n 'scroll',\n throttle(() => {\n window.last_scroll = new Date().getTime();\n window.dispatchEvent(createEvent('tmp_scroll'));\n }, 50)\n);\n\nwindow.addEventListener(\n 'resize',\n throttle(() => {\n window.last_resize = new Date().getTime();\n set_device_class();\n window.dispatchEvent(createEvent('tmp_resize'));\n }, 100)\n);\n\nfunction set_device_class() {\n const w = window.innerWidth;\n const body = document.body;\n\n if (w < 740) {\n body.classList.remove('desktop');\n body.classList.remove('tablet');\n body.classList.add('mobile');\n } else if (w >= 740 && w < 1200) {\n body.classList.remove('desktop');\n body.classList.add('tablet');\n body.classList.remove('mobile');\n } else {\n body.classList.add('desktop');\n body.classList.remove('tablet');\n body.classList.remove('mobile');\n }\n}\n\nset_device_class();\n","import Honeybadger from '@honeybadger-io/js';\nimport { getBootstrapData } from '$shared/utils.js';\n\nif (!window.TMPDisableErrorTracking) {\n Honeybadger.configure({\n api_key: getBootstrapData('honeybadgerKey'),\n environment: getBootstrapData('env'),\n });\n}\n","// local\nimport { getCookie, setCookie } from '../util/cookiehelpers.js';\n\nif (document.referrer.includes('facebook.com')) {\n setCookie('_fb_ref', 'true');\n}\nif (document.referrer.includes('twitter.com')) {\n setCookie('_tw_ref', 'true');\n}\n\nlet max_scroll = 0;\n\nwindow.addEventListener('tmp_scroll', () => {\n const scroll = window.scrollY;\n\n if (scroll > max_scroll) {\n max_scroll = scroll;\n }\n});\n\nwindow.max_scroll = () => max_scroll;\n\n// Increment cookie, UserTotalPageView\nconst utpCookieName = '_utpv'; // user total pageviews\nlet total_pageviews;\nconst total_pageviews_raw = getCookie(utpCookieName);\n\nif (total_pageviews_raw === null) {\n total_pageviews = 1;\n} else {\n total_pageviews = parseInt(total_pageviews_raw, 10);\n total_pageviews += 1;\n}\nsetCookie(utpCookieName, total_pageviews);\nwindow._utpv = total_pageviews;\n\n// Set a cookie, UserFirstSeen, if it is not already present. Calculate the time between that cookie and now.\nconst ufsCookieName = '_ufs';\n\nif (getCookie(ufsCookieName) === null) {\n setCookie(ufsCookieName, '' + new Date().getTime());\n}\n\nconst delta_ms = new Date().getTime() - parseInt(getCookie(ufsCookieName), 10);\nconst delta = Math.floor(delta_ms / 1000); // ms -> seconds\nwindow._ufs_delta = delta;\n\nlet totalSelections = 0;\nconst selections = [];\n\nfunction getSelectionText() {\n let text = '';\n\n if (window.getSelection) {\n text = window.getSelection().toString();\n } else if (document.selection && document.selection.type != 'Control') {\n text = document.selection.createRange().text;\n }\n\n return text;\n}\n\ndocument.addEventListener('mouseup', () => {\n const text = getSelectionText();\n\n if (text.length >= 4) {\n // TODO: is what is this threshold, why bother?\n totalSelections += 1;\n\n selections.push({ time: new Date().getTime(), text });\n }\n});\n\nfunction getSelectionCount() {\n return totalSelections;\n}\n\nwindow.getSelectionCount = getSelectionCount;\n\nfunction getSelectionHistory() {\n return selections;\n}\nwindow.getSelectionHistory = getSelectionHistory;\n\nconst pageLoadTime = new Date().getTime();\nconst samples = [];\nconst lastSample = 0; // timestamp\nconst sampleDelta = 100; // milliseconds\n\nwindow.addEventListener('scroll', () => {\n const now = new Date().getTime();\n\n if (now - lastSample > sampleDelta) {\n samples.push({\n time: now - pageLoadTime,\n scrollPosition: window.scrollY,\n });\n }\n});\n\nfunction getScrollSamples() {\n return samples;\n}\nwindow.getScrollSamples = getScrollSamples;\n","// local\nimport { trackEvent } from './helpers.js';\n\nconst top_of_post = document.querySelector('span[data-mark=\"top-of-post\"]');\nconst bottom_of_post = document.querySelector(\n 'span[data-mark=\"bottom-of-post\"]'\n);\n/** @type {Set} */\nconst events_sent = new Set();\nconst fractions = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0];\n\nif (top_of_post && bottom_of_post) {\n const post_height = bottom_of_post.offsetTop - top_of_post.offsetTop;\n\n const scroll_markers = fractions.map((fraction) => {\n return { fraction, pixels: fraction * post_height + top_of_post.offsetTop };\n });\n\n function check_scroll_depth() {\n const window_bottom = window.scrollY + window.innerHeight;\n\n scroll_markers\n .filter((marker) => {\n return marker.pixels <= window_bottom;\n })\n .forEach((active_marker) => {\n if (events_sent.has(active_marker.fraction)) {\n // already sent this event, no-op\n } else {\n events_sent.add(active_marker.fraction);\n const percent_scroll_event_label = `${100 * active_marker.fraction}%`;\n trackEvent('story_scrollmark', {\n percent: percent_scroll_event_label,\n fraction: active_marker.fraction,\n });\n }\n });\n }\n\n check_scroll_depth();\n\n window.addEventListener('tmp_scroll', () => check_scroll_depth());\n}\n","export function AnimationContext() {\n this.stylesheet = createStylesheet();\n}\n\nfunction createStylesheet() {\n var stylesheet = document.createElement('style');\n document.head.appendChild(stylesheet);\n return stylesheet.sheet;\n}\n\nAnimationContext.prototype.clear = function () {\n for (var i = this.stylesheet.cssRules.length; i > 0; i--) {\n this.stylesheet.deleteRule(0);\n }\n};\n\nAnimationContext.prototype.createKeyframeRules = function (name, frames) {\n var prefixes = ['-o-', '-moz-', '-webkit-', ''];\n return prefixes.map(function (prefix) {\n return '@' + prefix + 'keyframes ' + name + ' {\\n' + frames + '\\n}';\n });\n};\n\nAnimationContext.prototype.insertKeyframe = function (name, frames) {\n var self = this;\n this.createKeyframeRules(name, frames).forEach(function (rule) {\n // This will raise an exception if the wrong prefix is used.\n try {\n self.stylesheet.insertRule(rule, self.stylesheet.cssRules.length);\n } catch (e) {}\n });\n};\n\nAnimationContext.prototype.insertRule = function (rule, beginning) {\n var index = beginning ? 0 : this.stylesheet.cssRules.length;\n this.stylesheet.insertRule(rule, index);\n};\n","// packages\nimport throttle from 'underscore/modules/throttle.js';\n\nconst NAVBAR_HEIGHT = 64;\nconst MOBILE_NAVBAR_HEIGHT = 42;\n\nlet lastHeights = [];\n\nfunction setDynamicResizeScrollbarWidthCSSVar() {\n // This is a CSS variable used on fullbleed elements\n // .fullbleed-container and .photo-max-shim. See `article.scss.erb`\n document.documentElement.style.setProperty(\n '--dynamic-resize-scrollbar-width',\n `${window.innerWidth - document.body.clientWidth}px`\n );\n}\n\n// initial call\nsetDynamicResizeScrollbarWidthCSSVar();\n\n// throttled call on resize event\nwindow.addEventListener(\n 'resize',\n throttle(setDynamicResizeScrollbarWidthCSSVar, 100)\n);\n\nfunction resizeDynamicElements() {\n const photoMaxShims = document.querySelectorAll('.photo-max-shim');\n\n photoMaxShims.forEach((shim) => {\n const photo = shim.querySelector('.photo-max');\n\n window.requestAnimationFrame(() => {\n // let it paint, then calc new height and update shim\n shim.style.height = `${photo.getBoundingClientRect().height}px`;\n });\n });\n\n // full-height is an attempt to deal with the fact that most mobile\n // browsers trigger vertical resizes quite frequently when browser chrome\n // minimizes or expands. This causes ugly jank that repositions the whole\n // page when one or more non-positioned elements are set to 100vh height.\n // So instead we set elements to 100vh initially, then fix their heights\n // in pixels and only resize them when the height has changed > 120 pixels.\n const windowWidth = window.document.documentElement.clientWidth;\n const windowHeight = window.document.documentElement.clientHeight;\n\n if (windowWidth <= 768) {\n const maxLastHeights = lastHeights.map((height) =>\n Math.abs(height - windowHeight)\n );\n const maxDiff = Math.max(...maxLastHeights);\n\n if (lastHeights.length === 0 || maxDiff > 120) {\n const fullHeightElements = document.querySelectorAll('.full-height');\n\n fullHeightElements.forEach((element) => {\n element.style.height = `${windowHeight}px`;\n });\n\n const targetHeight =\n windowHeight -\n (windowWidth < 740 ? MOBILE_NAVBAR_HEIGHT : NAVBAR_HEIGHT);\n\n const fullHeightMinusHeaderElements = document.querySelectorAll(\n '.full-height-minus-header'\n );\n\n fullHeightMinusHeaderElements.forEach((element) => {\n element.style.height = `${targetHeight}px`;\n });\n\n // Reset the baseline\n lastHeights = [];\n\n lastHeights.push(windowHeight);\n }\n } else {\n const fullHeightElements = document.querySelectorAll(\n '.full-height, .full-height-minus-header'\n );\n\n fullHeightElements.forEach((element) => {\n element.style.height = null;\n });\n }\n}\n\nresizeDynamicElements();\nwindow.requestAnimationFrame(() => {\n resizeDynamicElements();\n});\n\nsetTimeout(() => {\n resizeDynamicElements();\n}, 10);\nsetTimeout(() => {\n resizeDynamicElements();\n}, 1000);\nsetTimeout(() => {\n resizeDynamicElements();\n}, 2000);\nsetTimeout(() => {\n resizeDynamicElements();\n}, 5000);\n\nwindow.addEventListener('tmp_recalc_max_photos', () => {\n resizeDynamicElements();\n});\n// rate-limited window.resize\nwindow.addEventListener('tmp_resize', () => {\n resizeDynamicElements();\n});\n","// packages\nimport debounce from 'underscore/modules/debounce.js';\n\n// local\nimport { trackEvent } from '../analytics/helpers.js';\nimport { AnimationContext } from '../animations/animations.js';\n\nconst houseAdElements = document.querySelectorAll('.house-ad');\n\nif (houseAdElements.length > 0) {\n const animations = new AnimationContext();\n\n houseAdElements.forEach((element) => {\n registerListeners(element);\n });\n\n function resize() {\n animations.clear();\n\n houseAdElements.forEach((element) => {\n generateAnimations(element);\n });\n }\n\n resize();\n\n window.addEventListener('resize', debounce(resize, 300));\n\n function registerListeners(/** @type {Element} */ element) {\n function onInteraction() {\n element.classList.add('animate');\n element.addEventListener(\n 'animationend',\n () => {\n element.classList.remove('animate');\n },\n { once: true }\n );\n }\n\n element.addEventListener('mouseenter', onInteraction);\n element.addEventListener('touchstart', onInteraction, { passive: true });\n\n function onTMPHotZoneWillAppear() {\n onInteraction();\n\n trackEvent('house_ad_impression', {\n title: element.querySelector('.house-ad-title').textContent,\n });\n }\n\n element.addEventListener('tmp_hotzone_will_appear', onTMPHotZoneWillAppear);\n\n function onClick() {\n trackEvent('house_ad_click', {\n title: element.querySelector('.house-ad-title').textContent,\n });\n }\n\n element.addEventListener('click', onClick);\n }\n\n function generateAnimations(/** @type {Element} */ element) {\n /** @type {SVGSVGElement} */\n const frame = element.querySelector('.house-ad-icon-frame');\n\n if (!frame) {\n return;\n }\n\n const length = frame.getTotalLength();\n const id = element.getAttribute('data-id');\n const name = `ad-${id}-anim`;\n const keyframes = `100% { stroke-dashoffset: ${2 * length}px; }`;\n\n animations.insertKeyframe(name, keyframes);\n\n const animRule = `.house-ad-${id}.animate .house-ad-icon-frame { animation-name: ${name}; }`;\n animations.insertRule(animRule);\n frame.style.strokeDasharray = length.toString();\n }\n}\n","// packages\nimport defaults from 'underscore/modules/defaults.js';\n\n// local\nimport http from '$shared/http.js';\nimport { getCookie } from '../util/cookiehelpers.js';\nimport { trackEvent } from '../analytics/helpers.js';\nimport { createEvent } from '../util/events.js';\n\nfunction findTargets() {\n return document.querySelectorAll('.email-onboard');\n}\n\nfunction getContext(/** @type {Element} */ el) {\n return JSON.parse(el.getAttribute('data-context'));\n}\n\nfunction setContext(/** @type {Element} */ el, context) {\n el.setAttribute('data-context', JSON.stringify(context));\n}\n\nfunction recalcEl(/** @type {Element} */ el) {\n const { width, height } = el.getBoundingClientRect();\n\n const context = getContext(el);\n\n context.checkboxes = el.getAttribute('data-checkboxes') === 'true';\n // if (context.checkboxes && !context.occasionalEnabled) {\n // // this introduces a bug where if check boxes are enabled, but the screen shinks,\n // // then the screen expands again, they won't be re-enabled. wontfix for now.\n // context.checkboxes = (width >= 1010); // this is a JavaScript breakpoint, basically.\n // }\n context.oneLine = height <= 70; // this is a JavaScript breakpoint, basically.\n context.emailValid = true;\n context.formFloatRight = width >= 880;\n\n setContext(el, context);\n render(el);\n}\n\nfunction dynamicSizing(/** @type {Element} */ el) {\n window.addEventListener('tmp_resize', () => {\n recalcEl(el);\n });\n\n recalcEl(el);\n}\n\nfunction successCallback() {\n document.querySelector('.email-signup').style.display = 'none';\n}\n\nfunction failureCallback(\n /** @type {Element} */ el,\n /** @type {string} */ message\n) {\n const response = el.querySelector('.response');\n response.innerHTML = message;\n}\n\nfunction submitEmail(\n /** @type {Element} */ el,\n /** @type {string} */ email,\n options\n) {\n if (email === '') {\n console.error('no email address provided');\n return;\n }\n\n const submit = el.querySelector('.submit');\n const input = el.querySelector('.email-address');\n\n el.querySelector('.response').textContent = '';\n\n const previousSubmitLabel = submit.textContent;\n submit.textContent = 'Saving...';\n submit.classList.add('in-progress');\n submit.setAttribute('disabled', '');\n input.setAttribute('disabled', '');\n\n const placement = el.getAttribute('data-placement') || 'unknown';\n\n options = options || {};\n const endpoint = '/api/v3/email/subscribe';\n\n const payload = {\n signup: {\n email,\n options,\n placement,\n url: window.location.href,\n referer: document.referrer,\n t: getCookie('t'),\n _utpv: getCookie('_utpv'),\n user_agent: window.navigator.userAgent,\n },\n };\n\n http\n .post(endpoint, { json: payload })\n .json()\n .then((data) => {\n submit.textContent = 'Thanks!';\n submit.classList.add('complete');\n successCallback(data);\n\n trackEvent('web-email-signup', 'subscribe', placement);\n window.dispatchEvent(createEvent('tmp_email_signup_success'));\n\n // this is confusing, but the JSON data returned does _not_ use HTTP headers\n // to communicate this, it actually sets \"status\" to \"redirect\"\n if (data.status === 'redirect' && data.redirect_url) {\n window.location.assign(data.redirect_url);\n }\n })\n .catch(async (error) => {\n const data = await error.response.json();\n\n submit.setAttribute('value', previousSubmitLabel);\n submit.classList.remove('in-progress');\n submit.removeAttribute('disabled');\n input.removeAttribute('disabled');\n submit.textContent = previousSubmitLabel;\n\n failureCallback(el, data.error.message);\n });\n}\n\nfunction getOptions(/** @type {Element} */ el) {\n const context = getContext(el);\n\n let options;\n\n if (context.checkboxes) {\n const daily =\n el.querySelector('.checkbox-daily').getAttribute('data-checked') ===\n 'true';\n const weekly =\n el.querySelector('.checkbox-weekly').getAttribute('data-checked') ===\n 'true';\n const occasional =\n el.querySelector('.checkbox-occasional').getAttribute('data-checked') ===\n 'true';\n\n options = {\n daily,\n weekly,\n occasional,\n };\n } else {\n // if we don't have checkboxes visible, enroll in the default segments\n options = defaults(\n {\n daily: context.dailyEnabled,\n weekly: context.weeklyEnabled,\n occasional: context.occasionalEnabled,\n },\n {\n daily: true,\n weekly: true,\n occasional: false,\n }\n );\n }\n\n return options;\n}\n\nfunction registerHandlers(/** @type {Element} */ el) {\n el.addEventListener('click', (event) => {\n if (event.target.matches('.submit')) {\n const email = el.querySelector('.email-address').value;\n const options = getOptions(el);\n\n submitEmail(el, email, options);\n }\n\n if (event.target.matches('.checkbox-outer')) {\n const fakebox = event.target.querySelector('.fakebox');\n const previousState = fakebox.getAttribute('data-checked') === 'true';\n\n if (previousState) {\n fakebox.setAttribute('data-checked', 'false');\n } else {\n fakebox.setAttribute('data-checked', 'true');\n }\n\n updateCheckboxes(el);\n }\n });\n\n if (window.innerWidth > 700) {\n el.addEventListener('keydown', (event) => {\n if (event.target.matches('input.email-address')) {\n if (event.key === 'Enter') {\n const email = el.querySelector('.email-address').value;\n const options = getOptions(el);\n\n submitEmail(el, email, options);\n }\n }\n });\n } else {\n // skip \"enter\" key for email submit\n }\n}\n\nfunction updateCheckboxes(/** @type {Element} */ el) {\n const fakeboxes = el.querySelectorAll('.fakebox');\n\n fakeboxes.forEach((el) => {\n const checked = el.getAttribute('data-checked') === 'true';\n\n if (checked) {\n el.innerHTML = '✔︎';\n } else {\n el.innerHTML = ' ';\n }\n });\n}\n\nfunction render(/** @type {Element} */ el) {\n const wrapper = el.closest('.email-onboard-container-wrapper');\n\n if (wrapper && wrapper.classList.contains('rendered')) {\n // already rendered\n return;\n }\n\n const context = JSON.parse(el.getAttribute('data-context'));\n el.innerHTML = '';\n\n let components = [];\n\n if (context.onlyForm) {\n components.push(templates.form(context.form));\n } else {\n components = [\n templates.copy(context),\n templates.archive_link(context),\n templates.form(context),\n templates.checkboxes(context),\n ];\n }\n\n components.forEach((child) => {\n if (child) {\n el.appendChild(child);\n }\n });\n\n updateCheckboxes(el);\n}\n\nfunction buildEl(\n /** @type {string} */ tag,\n /** @type {string} */ contents,\n /** @type {string} */ className\n) {\n const el = document.createElement(tag);\n el.className = className;\n el.innerHTML = contents;\n\n return el;\n}\n\nfunction div(/** @type {string} */ contents, /** @type {string} */ className) {\n return buildEl('div', contents, className);\n}\n\nfunction span(/** @type {string} */ contents, /** @type {string} */ className) {\n return buildEl('span', contents, className);\n}\n\nfunction link(\n /** @type {string} */ href,\n /** @type {string} */ contents,\n /** @type {string} */ className\n) {\n var el = buildEl('a', contents, className);\n el.href = href;\n return el;\n}\n\nconst templates = {\n copy(context) {\n if (!context.copy) {\n return null;\n }\n\n const el = div('', 'copy');\n el.appendChild(span(context.title, 'title'));\n el.appendChild(span(context.body, 'body'));\n\n return el;\n },\n\n archive_link(context) {\n if (context.archiveLink) {\n return link(context.archiveLink, 'Most Recent Email', 'archive-link');\n } else {\n return null;\n }\n },\n\n checkboxes(context) {\n if (context.checkboxes === false) {\n return null;\n }\n\n const boxes = [\n '
Opening Statement – Daily
',\n '
Closing Argument – Weekly
',\n ];\n\n if (context.occasionalEnabled === true) {\n boxes.push(\n '
President\\'s Brief – Bi-Weekly
'\n );\n }\n\n return div(boxes.join(''), 'checkboxes');\n },\n\n form(context) {\n const buttonLabel = 'Subscribe';\n const placeholder = 'email@example.com';\n\n let className = 'form';\n\n if (context.formFloatRight) {\n className += ' float-right ';\n }\n\n return div(\n [\n '',\n '',\n '',\n ].join(''),\n className\n );\n },\n};\n\nfunction generateContext(/** @type {Element} */ el) {\n const checkboxes = el.getAttribute('data-checkboxes');\n const occasionalEnabled = el.getAttribute('data-include-occasional');\n const dailyEnabled = el.getAttribute('data-include-daily');\n const weeklyEnabled = el.getAttribute('data-include-weekly');\n const archiveLink = el.getAttribute('data-archive-link');\n const copy = el.getAttribute('data-copy') !== 'false';\n\n return {\n title: 'Opening Statement',\n body: 'The best criminal justice news, delivered to your inbox daily.',\n archiveLink,\n copy,\n checkboxes,\n occasionalEnabled,\n dailyEnabled,\n weeklyEnabled,\n };\n}\n\nfunction boot() {\n const targets = findTargets();\n\n targets.forEach((el) => {\n if (el.getAttribute('data-rendered') === 'true') {\n return;\n }\n\n el.setAttribute('data-rendered', 'true');\n\n const context = generateContext(el);\n\n setContext(el, context);\n render(el);\n registerHandlers(el);\n dynamicSizing(el);\n\n // used to enable CSS\n const wrapper = el.closest('.email-onboard-container-wrapper');\n\n if (wrapper) {\n wrapper.classList.add('rendered');\n }\n });\n}\n\nwindow.addEventListener('tmp_detect_email_signup', () => {\n boot();\n});\n\nboot();\n","import { trackEvent } from '../analytics/helpers.js';\n\nconst menuButton = document.querySelector('.header-menu-button');\nconst menuWrapper = document.querySelector('.menu-wrapper');\n/** @type {HTMLInputElement} */\nconst searchInput = document.querySelector('.menu-search-input');\nconst searchSection = document.querySelector('.menu-search-js');\nconst lightsOut = document.querySelector('.lights-out');\n\nfunction onInteraction() {\n if (menuWrapper.classList.contains('menu-hidden')) {\n openMenu();\n } else {\n closeMenu('icon');\n }\n}\n\nfunction removeMenuItemFocus(e) {\n if (this === e.target && menuWrapper.classList.contains('menu-hidden')) {\n menuWrapper.classList.add('menu-unfocusable');\n }\n}\n\nmenuButton.addEventListener('click', onInteraction);\n\nmenuWrapper.addEventListener('transitionend', removeMenuItemFocus);\n\nsearchInput.addEventListener('focus', () => {\n if (menuWrapper.classList.contains('menu-hidden')) {\n openMenu();\n }\n});\n\ndocument.body.addEventListener('click', (event) => {\n if (event.target.matches('.lights-out')) {\n closeMenu('offmenu');\n }\n});\n\ndocument.body.addEventListener('keyup', (event) => {\n if (event.key === 'Escape') {\n if (!menuWrapper.classList.contains('menu-hidden')) {\n closeMenu('escape');\n }\n }\n});\n\nlightsOut.style.display = 'inline';\nlightsOut.style.zIndex = '-999';\n\nfunction openMenu() {\n menuButton.classList.add('active');\n menuButton.setAttribute('aria-expanded', 'true');\n menuWrapper.classList.remove('menu-hidden', 'menu-unfocusable');\n document.body.classList.add('lock-scrolling');\n\n dim_page();\n trackEvent('hamburger_menu_opened');\n}\n\nfunction closeMenu(/** @type {string} */ type) {\n document.body.classList.remove('lock-scrolling');\n menuButton.classList.remove('active');\n menuButton.setAttribute('aria-expanded', 'false');\n menuWrapper.classList.add('menu-hidden');\n searchInput.value = '';\n searchInput.blur();\n searchSection.classList.remove('active');\n\n restore_page();\n trackEvent('hamburger_menu_closed', { type });\n}\n\nfunction dim_page() {\n setTimeout(() => {\n lightsOut.style.opacity = '0.6';\n lightsOut.style.zIndex = '999';\n }, 1);\n}\n\nfunction restore_page() {\n setTimeout(() => {\n lightsOut.style.opacity = '0';\n lightsOut.style.zIndex = '-999';\n }, 1);\n}\n\nconst menuItemLinkElements = document.querySelectorAll('.menu-item-link');\n\nmenuItemLinkElements.forEach((element) => {\n element.addEventListener('click', (event) => {\n trackEvent('hamburger_menu_link_click', { link: event.target.href });\n });\n});\n\nsearchSection.addEventListener('click', () => {\n searchSection.classList.add('active');\n searchInput.focus();\n});\n\nsearchInput.addEventListener('focus', () => {\n searchSection.classList.add('active');\n});\n\nconst menuSearchButton = document.querySelector('.menu-search-button');\n\nmenuSearchButton.addEventListener('click', () => {\n if (searchSection.classList.contains('active')) {\n executeSearch();\n }\n});\n\nsearchInput.addEventListener('keyup', (event) => {\n if (event.key === 'Enter') {\n executeSearch();\n }\n});\n\nfunction executeSearch() {\n const value = searchInput.value;\n window.location.href = `/search?q=${value}`;\n}\n","// packages\nimport debounce from 'underscore/modules/debounce.js';\nimport delay from 'underscore/modules/delay.js';\n\nconst sizer = document.querySelector('.vertical-hed-caption-sizer-js');\n\nif (sizer) {\n if (sizer.complete && sizer.naturalWidth > 1) {\n resizeCaption(sizer);\n // This silliness fixes firefox somehow someway\n delay(resizeCaption.bind(undefined, sizer), 50);\n } else {\n sizer.addEventListener('load', function () {\n resizeCaption(sizer);\n delay(resizeCaption.bind(undefined, sizer), 50);\n });\n }\n\n window.addEventListener(\n 'resize',\n debounce(resizeCaption.bind(this, sizer), 100)\n );\n}\n\n// adapted from: https://www.npmjs.com/package/intrinsic-scale\nfunction getObjectFitSize(\n contains /* true = contain, false = cover */,\n containerWidth,\n containerHeight,\n width,\n height\n) {\n const imgAspectRatio = width / height;\n const containerAspectRatio = containerWidth / containerHeight;\n let targetWidth = 0;\n let targetHeight = 0;\n const test = contains\n ? imgAspectRatio > containerAspectRatio\n : imgAspectRatio < containerAspectRatio;\n\n if (test) {\n targetWidth = containerWidth;\n targetHeight = targetWidth / imgAspectRatio;\n } else {\n targetHeight = containerHeight;\n targetWidth = targetHeight * imgAspectRatio;\n }\n\n return {\n width: targetWidth,\n height: targetHeight,\n x: (containerWidth - targetWidth) / 2,\n y: (containerHeight - targetHeight) / 2,\n };\n}\n\nfunction resizeCaption(/** @type {HTMLImageElement} */ img) {\n const { width, x } = getObjectFitSize(\n true /* contain */,\n img.width,\n img.height,\n img.naturalWidth,\n img.naturalHeight\n );\n\n const caption = document.querySelector('.vertical-hed-caption-js');\n\n if (caption) {\n caption.style.width = `${width}px`;\n caption.style.paddingLeft = `${x}px`;\n }\n}\n","// packages\nimport { nanoid } from 'nanoid';\n\n// utils\nimport { createEvent } from '../util/events.js';\n\nfunction enabledElements() {\n return document.querySelectorAll('[data-hotzone]');\n}\n\nfunction elementTop(/** @type {Element} */ el) {\n return el.getBoundingClientRect().top;\n}\n\nfunction isActive(/** @type {Element} */ el) {\n let hotzoneTopRatio = 1 / 12.0;\n let hotzoneBottomRatio = 1 / 3.0;\n\n const str_hotzoneTopRatio = el.getAttribute('data-hotzone-top-ratio');\n if (str_hotzoneTopRatio) {\n hotzoneTopRatio = parseFloat(str_hotzoneTopRatio);\n }\n\n const str_hotzoneBottomRatio = el.getAttribute('data-hotzone-bottom-ratio');\n if (str_hotzoneBottomRatio) {\n hotzoneBottomRatio = parseFloat(str_hotzoneBottomRatio);\n }\n\n const windowHeight = window.innerHeight;\n const hotzoneTop = hotzoneTopRatio * windowHeight;\n const hotzoneBottom = hotzoneBottomRatio * windowHeight;\n\n if (elementTop(el) >= hotzoneTop && elementTop(el) <= hotzoneBottom) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction dispatchIfEdge(\n /** @type {Element} */ el,\n /** @type {string} */ incomingEventName\n) {\n if (el.getAttribute('data-hotzone-last-event') !== incomingEventName) {\n el.setAttribute('data-hotzone-last-event', incomingEventName);\n el.dispatchEvent(createEvent(incomingEventName));\n document.dispatchEvent(createEvent('tmp-hotzone-change'));\n }\n}\n\nfunction checkVisibility(/** @type {Element} */ el) {\n const lastState = el.getAttribute('data-visibility') === 'true';\n\n const scrollTop = window.scrollY;\n const windowHeight = window.innerHeight;\n const bounds = el.getBoundingClientRect();\n const elHeight = bounds.height;\n const elTop = bounds.top + scrollTop;\n\n const aboveBottom = elTop < scrollTop + windowHeight;\n const belowTop = elHeight + elTop > scrollTop;\n const currentState = aboveBottom && belowTop;\n\n if (currentState !== lastState) {\n el.setAttribute('data-visibility', currentState);\n if (currentState === true) {\n el.dispatchEvent(createEvent('tmp_hotzone_will_appear'));\n } else {\n el.dispatchEvent(createEvent('tmp_hotzone_will_disappear'));\n }\n }\n}\n\nfunction updateElements() {\n enabledElements().forEach((el) => {\n if (isActive(el)) {\n el.setAttribute('data-hotzone-state', 'on');\n dispatchIfEdge(el, 'tmp_hotzone_start');\n } else {\n el.setAttribute('data-hotzone-state', 'off');\n dispatchIfEdge(el, 'tmp_hotzone_end');\n }\n\n checkVisibility(el);\n });\n}\n\nwindow.addEventListener('tmp_scroll', () => {\n updateElements();\n});\n\nupdateElements();\n\n// youtube hotzone\n//
is the form to generate this.\n// See https://developers.google.com/youtube/player_parameters for the parameters you can pass (not 100% implemented)\n\nfunction loadYoutubeAPI() {\n if (window._youtube_api_loaded === true) {\n return true;\n }\n const script_tag = document.createElement('script');\n script_tag.src = 'https://www.youtube.com/iframe_api';\n const firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(script_tag, firstScriptTag);\n window._youtube_api_loaded = true;\n}\n\nfunction findYouTubePlayers() {\n // find YouTube players, inject YouTube API if we find one\n document.querySelectorAll('[data-youtube-id]').forEach((element) => {\n // Mobile browsers seem to have trouble with the JS API,\n // see https://developers.google.com/youtube/iframe_api_reference#Mobile_considerations\n // So we fall back to a normal iframe, passing the same query parameters.\n // This is a super crude mobile browser indicator. Could certainly be made better.\n if (window.innerWidth < 768) {\n buildMobileIframe(element);\n } else {\n loadYoutubeAPI();\n }\n });\n}\n\nfindYouTubePlayers();\n\nfunction setupYoutubePlayers() {\n document\n .querySelectorAll('[data-youtube-hotzone]')\n .forEach(function (element) {\n buildYouTubePlayer(element);\n });\n}\n\nwindow.onYouTubeIframeAPIReady = () => {\n // this needs to be on window so the YouTube API can find it. keep the rest scoped inside here.\n setupYoutubePlayers();\n};\n\nfunction getPlayerVars(source_el) {\n function attr(name, defaultValue) {\n return source_el.getAttribute(name) !== null\n ? source_el.getAttribute(name)\n : defaultValue;\n }\n const videoId = source_el.getAttribute('data-youtube-id');\n\n const playerVars = {\n controls: attr('data-controls', 1),\n loop: attr('data-loop', 1),\n autoplay: attr('data-autoplay', 0),\n fs: attr('data-fs', 1),\n list: attr('data-list'),\n modestbranding: attr('data-modestbranding', 1),\n playsinline: attr('data-playsinline', 0),\n rel: attr('data-rel', 0),\n showinfo: attr('data-showinfo', 1),\n start: attr('data-start'),\n end: attr('data-end'),\n };\n\n if (playerVars.loop) {\n playerVars.playlist = videoId;\n }\n\n return playerVars;\n}\n\nfunction buildYouTubePlayer(/** @type {Element} */ source_el) {\n const videoPlayerId = 'youtube_' + nanoid();\n source_el.id = videoPlayerId;\n\n const playerVars = getPlayerVars(source_el);\n\n const videoId = source_el.getAttribute('data-youtube-id');\n\n const player = new YT.Player(videoPlayerId, {\n height: '400',\n width: '100%',\n videoId,\n playerVars,\n events: {\n onReady: onPlayerReady,\n onStateChange: onPlayerStateChange,\n },\n });\n\n const el = document.getElementById(videoPlayerId);\n\n el.setAttribute('data-hotzone', 'true');\n\n el.addEventListener('tmp_hotzone_start', () => {\n if (player !== undefined) {\n player.playVideo();\n } else {\n console.log('player undefined during hotzone start');\n }\n });\n\n el.addEventListener('tmp_hotzone_end', () => {\n if (player !== undefined) {\n player.pauseVideo();\n } else {\n console.log('player undefined during hotzone end');\n }\n });\n}\n\nfunction onPlayerStateChange() {\n // noop\n}\nfunction onPlayerReady() {\n // noop\n}\n\nfunction buildMobileIframe(/** @type {Element} */ source_el) {\n const playerVars = getPlayerVars(source_el);\n const queryString = Object.keys(playerVars)\n .map((key) => {\n if (playerVars[key] === undefined) {\n return '';\n }\n\n return key + '=' + playerVars[key];\n })\n .join('&');\n\n const videoId = source_el.getAttribute('data-youtube-id');\n const iframe = document.createElement('iframe');\n iframe.width = '100%';\n iframe.height = '315';\n iframe.src = `https://www.youtube.com/embed/${videoId}?${queryString}`;\n iframe.frameBorder = '0';\n iframe.allowFullscreen = true;\n\n source_el.parentNode.replaceChild(iframe, source_el);\n}\n\nfunction getIframeSrc(videoId, playerId) {\n return [\n 'https://player.vimeo.com/video/',\n videoId,\n '?api=1&player_id=',\n playerId,\n ].join('');\n}\n\nfunction insertAfter(newNode, referenceNode) {\n // http://stackoverflow.com/a/4793630\n referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\n}\n\nfunction buildVimeoPlayer(/** @type {Element} */ source_el) {\n const playerId = 'vimeo_' + nanoid();\n const videoId = source_el.getAttribute('data-vimeo-id');\n\n const el = document.createElement('iframe');\n\n el.id = playerId;\n el.setAttribute('data-hotzone', 'true');\n el.src = getIframeSrc(videoId, playerId);\n el.width = '100%';\n el.height = '400';\n el.setAttribute('frameborder', 0);\n\n insertAfter(el, source_el);\n source_el.remove();\n\n el.addEventListener('tmp_hotzone_start', () => {\n postToIframe(el, 'play');\n });\n\n el.addEventListener('tmp_hotzone_end', () => {\n postToIframe(el, 'pause');\n });\n}\n\nfunction postToIframe(el, action, value) {\n var data = { method: action };\n if (value) {\n data.value = value;\n }\n var message = JSON.stringify(data);\n el.contentWindow.postMessage(message, '*');\n}\n\ndocument.querySelectorAll('[data-vimeo-id]').forEach((el) => {\n buildVimeoPlayer(el);\n});\n","// packages\nimport _delay from 'underscore/modules/delay.js';\n\n// local\nimport { trackEvent } from '../analytics/helpers.js';\nimport { AnimationContext } from '../animations/animations.js';\nimport EmailSignupService from '../subscribe/emailsignupservice.js';\nimport http from '$shared/http.js';\nimport { renderClassToElement } from '$shared/utils.js';\nimport { appendStringIntoElement } from '../util/dom.js';\nimport { createEvent } from '../util/events.js';\n\n/**\n * Simple logic for a small 'toast' notification that pops up in the bottom-right of the page.\n */\nconst toastContainer = document.querySelector('.toast-notifications-container');\n\nif (toastContainer) {\n loadToast();\n}\n\nconst COUNT_KEY = 'toast-pageview-count';\nconst RESPONDED_KEY = 'toast-has-responded';\n\nfunction shouldShowToast() {\n if (window.sessionStorage.getItem(RESPONDED_KEY)) {\n return false;\n }\n\n const currentValue = window.sessionStorage.getItem(COUNT_KEY) || 0;\n try {\n window.sessionStorage.setItem(COUNT_KEY, (currentValue + 1) % 3);\n } catch {}\n\n // We only load a toast on every other opportunity\n if (currentValue % 2 === 0) {\n return true;\n }\n\n return true;\n}\n\nasync function loadToast() {\n const data = await http.get('/notifications/v2/toast').json();\n\n if (data) {\n setupToast(data);\n }\n}\n\nfunction setupToast(data) {\n appendStringIntoElement(toastContainer, data.html);\n const toast = document.querySelector('.toast-notification');\n\n if (!toast) {\n return;\n }\n\n // TODO this should be DRYed out. Probably a super class situation.\n if (data.type === 'house-ad-ticker' && shouldShowToast()) {\n setupTicker(toast);\n } else if (data.type === 'email-signup' && shouldShowToast()) {\n setupEmailSignup(toast);\n } else if (data.type === 'email-signup-v2') {\n setupEmailSignupV2(toast);\n }\n}\n\nfunction setupEmailSignup(/** @type {Element} */ toast) {\n let closeTimer;\n let focused = false;\n const DISAPPEARANCE_DELAY = 15000; // 15s\n const APPEARANCE_DELAY = 8000; // 8s\n\n window.dispatchEvent(createEvent('tmp_detect_email_signup'));\n\n setTimeout(() => {\n toast.classList.add('toast-active');\n\n trackEvent('email_signup_toast_impression', { version: 1 });\n\n closeTimer = setTimeout(closeToast, DISAPPEARANCE_DELAY);\n }, APPEARANCE_DELAY);\n\n function closeToast() {\n toast.classList.remove('toast-active');\n\n toast.addEventListener('transitionend', () => {\n toast.remove();\n });\n }\n\n toast.querySelector('.close-button').addEventListener('click', (event) => {\n closeToast();\n event.preventDefault();\n event.stopPropagation();\n });\n\n toast.addEventListener('mouseover', () => {\n window.clearTimeout(closeTimer);\n });\n\n toast.addEventListener('mouseout', () => {\n if (!focused) {\n closeTimer = window.setTimeout(closeToast, DISAPPEARANCE_DELAY);\n }\n });\n\n function onFocus() {\n focused = true;\n window.clearTimeout(closeTimer);\n }\n\n toast.addEventListener('focus', onFocus);\n toast.addEventListener('input', onFocus);\n\n window.addEventListener('tmp_email_signup_success', () => {\n window.setTimeout(closeToast, 3000);\n });\n}\n\nfunction setupEmailSignupV2(/** @type {Element} */ toast) {\n let closeTimer;\n let focused = false;\n const DISAPPEARANCE_DELAY = 15000; // 15s\n const APPEARANCE_DELAY = 2000; // 2s\n\n renderClassToElement(EmailSignupService, '.email-signup-v2-js');\n\n function openToast() {\n toast.classList.add('toast-active');\n trackEvent('email_signup_toast_impression', { version: 2 });\n closeTimer = setTimeout(closeToast, DISAPPEARANCE_DELAY);\n openTimeout = null;\n }\n\n let openTimeout = window.setTimeout(openToast, APPEARANCE_DELAY);\n\n window.addEventListener(\n 'tmp_scroll',\n () => {\n if (openTimeout) {\n window.clearTimeout(openTimeout);\n }\n\n openToast();\n },\n { once: true }\n );\n\n function closeToast(_, force = false) {\n if (force || !focused) {\n toast.classList.remove('toast-active');\n toast.addEventListener('transitionend', () => {\n toast.remove();\n });\n }\n }\n\n toast.querySelector('.close-button').addEventListener('click', (event) => {\n closeToast(null, true);\n event.preventDefault();\n event.stopPropagation();\n });\n\n toast.addEventListener('mouseover', () => {\n window.clearTimeout(closeTimer);\n });\n\n toast.addEventListener('mouseout', () => {\n if (!focused) {\n closeTimer = window.setTimeout(closeToast, DISAPPEARANCE_DELAY);\n }\n });\n\n toast.addEventListener('click', () => {\n focused = true;\n window.clearTimeout(closeTimer);\n });\n}\n\nfunction setupTicker(toast) {\n const TICKER_SPEED = 100; // pixels/second\n const animations = new AnimationContext();\n\n const delay = parseInt(toast.dataset.delay, 10) * 1000; // Time before toast appears\n const numLoops = 2;\n /** @type {HTMLDivElement} */\n const toastBody = toast.querySelector('.toast-body');\n\n function resize() {\n animations.clear();\n const windowWidth = window.innerWidth;\n const bodyLength = toastBody.getBoundingClientRect().width;\n\n const arrowRightEdge = toast\n .querySelector('.toast-icon')\n .getBoundingClientRect().right;\n\n const visibleTickerWidth = windowWidth - arrowRightEdge;\n\n animations.insertKeyframe(\n 'toast-ticker',\n [\n 'from {\\n transform: translate3d(' +\n visibleTickerWidth +\n 'px, 0, 0); \\n}',\n 'to {\\n transform: translate3d(-' + bodyLength + 'px, 0, 0);\\n}',\n ].join('\\n')\n );\n\n const tickerDistance = visibleTickerWidth + bodyLength;\n const duration = tickerDistance / TICKER_SPEED;\n\n toastBody.style.animationName = 'toast-ticker';\n toastBody.style.animationDuration = `${duration}s`;\n toastBody.style['-webkit-animation-name'] = 'toast-ticker';\n toastBody.style['-webkit-animation-duration'] = `${duration}s`;\n toastBody.style['-moz-animation-name'] = 'toast-ticker';\n toastBody.style['-moz-animation-duration'] = `${duration}s`;\n }\n\n resize();\n window.addEventListener('resize', resize);\n\n setTimeout(() => {\n toast.classList.add('toast-active');\n\n resize();\n // Unset and reset the animation name to get around a bug in mobile\n // Webkit (Chrome and Safari) that was causing the animation to not play\n // if the name and 'runnin' were set at different times.\n toastBody.style.animationName = '';\n\n _delay(() => {\n toastBody.style.animationPlayState = 'running';\n toastBody.style.animationName = 'toast-ticker';\n }, 1);\n trackEvent('toast_banner_impression', {\n title: toast.querySelector('.toast-title').textContent,\n });\n }, delay);\n\n function closeToast() {\n toast.classList.remove('toast-active');\n toast.addEventListener('transitionend', () => {\n toast.remove();\n });\n }\n\n let completionCount = 0;\n\n toastBody.addEventListener('animationiteration', () => {\n completionCount += 1;\n\n if (completionCount === numLoops) {\n closeToast();\n }\n });\n\n toast.addEventListener('click', () => {\n completionCount = 0;\n trackEvent('toast_banner_click', {\n title: toast.querySelector('.toast-title').textContent,\n });\n\n window.sessionStorage.setItem(RESPONDED_KEY, 'true');\n window.location.assign(toast.getAttribute('data-href'));\n });\n\n toast.querySelector('.close-button').addEventListener('click', (event) => {\n closeToast();\n event.preventDefault();\n event.stopPropagation();\n });\n}\n","// This is the eventual home of all the main\n// application code for tmp.org. During the\n// transition, both this index and the sprockets\n// app/app.js will be loaded on every page.\n\nimport './analytics/ga.js';\nimport './analytics/honeybadger.js';\nimport './analytics/mailchimpgoaltracking.js';\nimport './analytics/pagevisibility.js';\nimport './analytics/record.js';\nimport './analytics/scrolldepth.js';\nimport './animations/animations.js';\nimport './dynamic-sizing/dynamic-sizing.js';\nimport './dynamic-sizing/responsive-iframes.js';\nimport './external-services/doccloud.js';\nimport './house-ads/house-ads.js';\nimport './legacy/emailsignup-deprecated.js';\nimport './menu/menu.js';\nimport './posts/headers/vertical-header.js';\nimport './scrolling/hotzone.js';\nimport './scrolling/jump.js';\nimport './scrolling/global-scroll-service.js';\nimport './toasts/toastnotifications.js';\nimport './util/cookiehelpers.js';\nimport '$components/components.js';\n\nimport {\n dynamicRenderClassToElement,\n whenElementExists,\n loadScript,\n} from '$shared/utils.js';\n\n// Self-contained renderers\nwhenElementExists('.post-annotation-2-selector', () =>\n import('./shortcodes/annotation_2.js')\n);\nwhenElementExists('[data-audioplayer=\"v1\"]', () =>\n import('./shortcodes/audioplayer_1.js')\n);\nwhenElementExists('[data-shortcode-form]', () =>\n import('./shortcodes/form.js')\n);\nwhenElementExists('#test-partner-url-button', () =>\n import('./legacy/partnersetup.js')\n);\nwhenElementExists('.topshelf, .topshelf-collection', () =>\n import('./stream/topshelf.js')\n);\nwhenElementExists('.compact-text-js', () => import('./util/textcompacter.js'));\nwhenElementExists('#manage-donations-email', () =>\n import('./support/manage.js')\n);\nwhenElementExists('clipboard-copy', () =>\n import('../shared/clipboard-copy.js')\n);\nwhenElementExists('include-fragment', () =>\n import('@github/include-fragment-element')\n);\nwhenElementExists('turbo-frame', () => import('$shared/turbo.js'));\n\nwhenElementExists('img.lazyload,video.lazyload,iframe.lazyload', () =>\n import('./media/lazyload.js').then(({ init }) => init())\n);\nwhenElementExists('[data-background-image]', () =>\n import('./media/lazy-background-images.js').then(({ init }) => init())\n);\n\nwhenElementExists('.share-button', () => import('./analytics/sharetools.js'));\n\n// Class based renderers\ndynamicRenderClassToElement('.email-signup-v2-js', () =>\n import('./subscribe/emailsignupservice.js')\n);\ndynamicRenderClassToElement(\n '.tmp-video-player-js',\n () => import('./video/video-player.js'),\n { skipRender: true }\n);\ndynamicRenderClassToElement('.static-menu', () =>\n import('./static-pages/menu.js')\n);\ndynamicRenderClassToElement('[data-toc]', () =>\n import('./table-of-contents/table-of-contents.js')\n);\ndynamicRenderClassToElement('.photo-overlay-header-post', () =>\n import('./posts/headers/photooverlay.js')\n);\ndynamicRenderClassToElement('.external-preview-warning', () =>\n import('./posts/external_preview_warning.js')\n);\n\n// External scripts to conditionally load\nwhenElementExists('.twitter-tweet', () => {\n loadScript('https://platform.twitter.com/widgets.js');\n});\nwhenElementExists('.fb-post', () => {\n loadScript('https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2');\n});\nwhenElementExists('.instagram-media', () => {\n loadScript('https://www.instagram.com/embed.js');\n});\n","// Adapted from https://stackoverflow.com/questions/5639346/what-is-the-shortest-function-for-reading-a-cookie-by-name-in-javascript\nexport function getCookie(name) {\n const result = new RegExp(`(?:^|; )${name}=([^;]*)`).exec(document.cookie);\n return result ? result[1] : null;\n}\n\nwindow.readCookie = window.read_cookie = getCookie;\n\nexport function setCookie(key, value, maxAgeInDays = 1500) {\n const maxAge = maxAgeInDays * 24 * 60 * 60;\n document.cookie = `${key}=${value};max-age=${maxAge};path=/`;\n}\n\nwindow.setCookie = window.set_cookie = setCookie;\n","function setup_document_cloud() {\n // If the note embed is already loaded, don't repeat the process.\n if (window.dc && window.dc.noteEmbedLoaded) return;\n\n window.dc = window.dc || {};\n window.dc.recordHit = 'https://www.documentcloud.org/pixel.gif';\n\n function loadCSS(url, media) {\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.media = media || 'screen';\n link.href = url;\n var head = document.getElementsByTagName('head')[0];\n head.appendChild(link);\n }\n\n /*@cc_on\n /*@if (@_jscript_version < 5.8)\n loadCSS('https://s3.amazonaws.com/s3.documentcloud.org/note_embed/note_embed.css');\n @else @*/\n loadCSS(\n 'https://s3.amazonaws.com/s3.documentcloud.org/note_embed/note_embed-datauri.css'\n );\n /*@end\n @*/\n\n // Record the fact that the note embed is loaded.\n dc.noteEmbedLoaded = true;\n\n // Request the embed JavaScript.\n // (done manually in the footer)\n}\n\nfunction setup_doc_cloud_size_hacks() {\n const noteElements = document.querySelectorAll('.dc-note-excerpt');\n\n noteElements.forEach((element) => {\n const noteWrap = element.closest('.dc-note-excerpt-wrap');\n const width = noteWrap.getBoundingClientRect().width - 1;\n\n if (!document.body.classList.contains('desktop')) {\n element.style.width = `${width}px`;\n element.querySelector('.DC-right-cover').remove();\n }\n });\n}\n\nwindow.addEventListener(\n 'load',\n () => {\n setTimeout(() => {\n setup_doc_cloud_size_hacks();\n }, 2000);\n\n setup_doc_cloud_size_hacks();\n },\n { once: true }\n);\n","const ratio = 9 / 16;\n\nconst iframe_config_ratios = [\n {\n domain: 'youtube.com',\n ratio,\n },\n {\n domain: 'mediamtvnservq-a.akamaihd.net',\n ratio,\n },\n {\n domain: 'vimeo.com',\n ratio,\n },\n {\n domain: 'facebook.com',\n ratio,\n },\n {\n domain: 'player.ooyala.com',\n ratio,\n },\n];\n\nfunction resize_iframes() {\n const iframes = document.querySelectorAll('iframe');\n\n iframes.forEach((iframe) => {\n const host = iframe.getAttribute('src');\n\n if (!host) {\n return;\n }\n\n const config = iframe_config_ratios.find((candidate) => {\n return host.includes(candidate.domain);\n });\n\n if (!config) {\n return;\n }\n\n const width = iframe.getBoundingClientRect().width;\n const height = Math.ceil(width * config.ratio);\n\n window.requestAnimationFrame(() => {\n iframe.setAttribute('height', height);\n });\n });\n}\n\nresize_iframes();\n\nwindow.addEventListener('tmp_resize', () => {\n resize_iframes();\n});\n\nsetTimeout(() => {\n resize_iframes();\n}, 500);\n","// https://s3.amazonaws.com/downloads.mailchimp.com/js/goal.min.js\nvar goalParam = null;\nvar goal = {\n getUuid: function () {\n return $mcGoal.settings.uuid;\n },\n getDC: function () {\n return $mcGoal.settings.dc;\n },\n process: function () {\n goalParam = goal.getParameter('goal');\n if (goalParam && goal.isValidGoal(goalParam)) {\n goal.createCookie('goal', goalParam, 365);\n } else {\n goalParam = goal.readCookie('goal');\n }\n goal.processPage();\n },\n isValidGoal: function () {\n if (!goalParam) return false;\n var regex = new RegExp('0_[a-z0-9]+-[a-z0-9]+-[0-9]+');\n return goalParam.search(regex) === 0 ? true : false;\n },\n isValidEvent: function (click_event) {\n if (!click_event || click_event === '') return false;\n return true;\n },\n isValidSettings: function () {\n if (!goal.getUuid() || goal.getUuid() === '') return false;\n if (!goal.getDC() || goal.getDC() === '') return false;\n return true;\n },\n isDoNotTrack: function () {\n if (navigator.doNotTrack === '1') return true;\n if (navigator.msDoNotTrack === '1') return true;\n return false;\n },\n getParameter: function (name) {\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n var results = regex.exec(location.search);\n return results === null\n ? null\n : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n },\n createCookie: function (c_name, value, exdays, domain) {\n var exdate = new Date();\n exdate.setDate(exdate.getDate() + exdays);\n var c_value =\n escape(value) +\n (exdays === null ? '' : '; expires=' + exdate.toUTCString());\n c_value += ';path=/';\n document.cookie = c_name + '=' + c_value;\n },\n readCookie: function (c_name) {\n var nameEQ = c_name + '=';\n var ca = document.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n },\n processPage: function () {\n if (!goal.isValidGoal()) return;\n var params = {\n goal: goalParam,\n };\n goal.sendData(params);\n },\n processEvent: function (click_event) {\n if (!goal.isValidGoal()) return;\n if (!goal.isValidEvent(click_event)) return;\n var params = {\n goal: goalParam,\n event: click_event,\n };\n goal.sendData(params);\n },\n sendData: function (params) {\n if (!goal.isValidSettings()) return;\n if (goal.isDoNotTrack()) return;\n params.title = document.title;\n params.uuid = goal.getUuid();\n params = goal.serializeParamters(params);\n var sp = document.createElement('script');\n sp.type = 'text/javascript';\n sp.async = true;\n sp.defer = true;\n sp.src =\n ('https:' == document.location.protocol ? 'https' : 'http') +\n '://goal.' +\n goal.getDC() +\n '.list-manage.com/goal/event?' +\n params;\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(sp, s);\n },\n serializeParamters: function (obj, prefix) {\n var str = [];\n for (var p in obj) {\n var k = prefix ? prefix + '[' + p + ']' : p,\n v = obj[p];\n str.push(\n typeof v == 'object'\n ? serialize(v, k)\n : encodeURIComponent(k) + '=' + encodeURIComponent(v)\n );\n }\n return str.join('&');\n },\n};\n\nif (window.$mcGoal) {\n $mcGoal.process = goal.process;\n $mcGoal.processEvent = goal.processEvent;\n $mcGoal.process();\n}\n","/**\n * Accepts an element and a string of HTML and injects the string into the element.\n *\n * @param {Element} element\n * @param {string} string\n */\nexport function appendStringIntoElement(element, string) {\n // TODO: Use a template element instead of a document fragment once we are done with IE11\n const fragment = document.createRange().createContextualFragment(string);\n element.appendChild(fragment);\n}\n\n/**\n * Sets the CSS style of the specified element.\n *\n * @param {HTMLElement} element\n * @param {string} property\n * @param {any} value\n */\nexport function setStyle(element, property, value) {\n element.style.setProperty(property, value);\n}\n","export function ensure(name, object, requiredKeys) {\n const errors = [];\n\n requiredKeys.forEach((key) => {\n if (isUndefined(object[key])) {\n errors.push(`Required key ${key} missing from options`);\n }\n });\n\n if (errors.length > 0) {\n throw new Error(`Error calling ${name}:\\n${errors.join('\\n')}`);\n }\n}\n\nexport function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}\n\nexport function isUndefined(value) {\n return value === undefined;\n}\n\nexport function getBootstrapData(key, optional = false) {\n const value = window.TMPBootstrapData[key];\n\n if (!optional && isUndefined(value)) {\n throw new Error(`Required bootstrap value ${key} is absent \\\n did you forget to call set_bootstrap_data in the controller?`);\n }\n\n return value;\n}\n\nexport function abstractMethod(name) {\n throw new Error(\n `${name} is an abstract method and must be implemented in the child class`\n );\n}\n\nexport function getDomain(url) {\n const a = document.createElement('a');\n a.href = url;\n return a.hostname.replace('//www.', '//');\n}\n\nexport function isMobileViewport() {\n return window.innerWidth <= 768;\n}\n\n// Lifted from https://davidwalsh.name/query-string-javascript\nexport function getUrlParameter(name) {\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n const regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n const results = regex.exec(location.search);\n return results === null\n ? ''\n : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n}\n\n// Lifted from https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\nexport function uuidv4() {\n return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>\n (\n c ^\n (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))\n ).toString(16)\n );\n}\n\nexport function renderClassToElement(klass, selector, options = {}) {\n const $els = $(selector);\n\n if ($els.length > 0) {\n $els.each((index, el) => {\n const instance = new klass({ el });\n if (!options.skipRender) {\n instance.render();\n }\n });\n }\n}\n\nexport function whenElementExists(selectors, fn) {\n if (document.querySelector(selectors)) {\n fn();\n }\n}\n\nexport function dynamicRenderClassToElement(\n selectors,\n loadFn,\n { skipRender } = {}\n) {\n const els = document.querySelectorAll(selectors);\n const count = els.length;\n\n // we have one, keep going\n if (count > 0) {\n loadFn().then(({ default: Class }) => {\n for (let idx = 0; idx < count; idx++) {\n const el = els[idx];\n const instance = new Class({ el });\n\n if (!skipRender) {\n instance.render();\n }\n }\n });\n }\n}\n\nexport function loadScript(url) {\n const tag = document.createElement('script');\n tag.src = url;\n tag.async = true;\n document.body.append(tag);\n}\n"],"names":["document","body","addEventListener","event","jump","target","closest","preventDefault","jumpId","getAttribute","land","querySelector","headerHeight","getBoundingClientRect","height","top","window","scrollY","scrollTo","behavior","skipRender","_hidden","visibilityState","hidden","globalScrollService","TMPScrolling","ScrollScene","scrollService","htmlElement","documentElement","set_device_class","w","innerWidth","classList","remove","add","last_mousemove","Date","getTime","last_scroll","last_resize","$","ajaxSetup","beforeSend","xhr","setRequestHeader","dispatchEvent","throttle","TMPDisableErrorTracking","api_key","environment","referrer","includes","max_scroll","scroll","utpCookieName","total_pageviews","total_pageviews_raw","parseInt","_utpv","ufsCookieName","delta_ms","delta","Math","floor","_ufs_delta","totalSelections","selections","text","getSelection","toString","selection","type","createRange","getSelectionText","length","push","time","getSelectionCount","getSelectionHistory","pageLoadTime","samples","now","scrollPosition","getScrollSamples","top_of_post","bottom_of_post","events_sent","Set","fractions","check_scroll_depth","window_bottom","innerHeight","scroll_markers","filter","marker","pixels","forEach","active_marker","has","fraction","percent_scroll_event_label","percent","post_height","offsetTop","map","AnimationContext","stylesheet","this","createElement","head","appendChild","sheet","prototype","clear","i","cssRules","deleteRule","createKeyframeRules","name","frames","prefix","insertKeyframe","self","rule","insertRule","e","beginning","index","lastHeights","setDynamicResizeScrollbarWidthCSSVar","style","setProperty","clientWidth","resizeDynamicElements","querySelectorAll","shim","photo","requestAnimationFrame","windowWidth","windowHeight","clientHeight","maxLastHeights","abs","maxDiff","max","element","targetHeight","setTimeout","houseAdElements","resize","animations","generateAnimations","registerListeners","onInteraction","once","passive","title","textContent","frame","getTotalLength","id","keyframes","animRule","strokeDasharray","debounce","getContext","el","JSON","parse","setContext","context","setAttribute","stringify","recalcEl","width","checkboxes","oneLine","emailValid","formFloatRight","render","submitEmail","email","options","console","error","submit","input","previousSubmitLabel","placement","payload","signup","url","location","href","referer","t","user_agent","navigator","userAgent","http","post","json","then","data","display","status","redirect_url","assign","catch","async","response","removeAttribute","message","innerHTML","failureCallback","getOptions","daily","weekly","occasional","defaults","dailyEnabled","weeklyEnabled","occasionalEnabled","updateCheckboxes","checked","wrapper","contains","components","onlyForm","templates","form","copy","archive_link","child","buildEl","tag","contents","className","div","span","archiveLink","boxes","join","boot","generateContext","matches","value","fakebox","key","registerHandlers","dynamicSizing","menuButton","menuWrapper","searchInput","searchSection","lightsOut","openMenu","opacity","zIndex","closeMenu","blur","link","focus","executeSearch","sizer","resizeCaption","img","x","containerWidth","containerHeight","imgAspectRatio","containerAspectRatio","targetWidth","y","getObjectFitSize","naturalWidth","naturalHeight","caption","paddingLeft","complete","bind","elementTop","dispatchIfEdge","incomingEventName","updateElements","hotzoneTopRatio","hotzoneBottomRatio","str_hotzoneTopRatio","parseFloat","str_hotzoneBottomRatio","hotzoneTop","hotzoneBottom","isActive","lastState","scrollTop","bounds","elHeight","elTop","currentState","checkVisibility","setupYoutubePlayers","source_el","videoPlayerId","playerVars","getPlayerVars","videoId","player","YT","Player","events","onReady","onPlayerReady","onStateChange","onPlayerStateChange","getElementById","playVideo","log","pauseVideo","buildYouTubePlayer","attr","defaultValue","controls","loop","autoplay","fs","list","modestbranding","playsinline","rel","showinfo","start","end","playlist","postToIframe","action","method","contentWindow","postMessage","queryString","Object","keys","iframe","src","frameBorder","allowFullscreen","parentNode","replaceChild","buildMobileIframe","_youtube_api_loaded","script_tag","firstScriptTag","getElementsByTagName","insertBefore","loadYoutubeAPI","onYouTubeIframeAPIReady","playerId","newNode","referenceNode","getIframeSrc","nextSibling","buildVimeoPlayer","toastContainer","get","html","toast","shouldShowToast","TICKER_SPEED","delay","dataset","numLoops","toastBody","bodyLength","visibleTickerWidth","right","duration","animationName","animationDuration","closeToast","animationPlayState","completionCount","sessionStorage","setItem","RESPONDED_KEY","stopPropagation","setupTicker","closeTimer","focused","DISAPPEARANCE_DELAY","APPEARANCE_DELAY","onFocus","clearTimeout","version","setupEmailSignup","openToast","openTimeout","_","force","setupEmailSignupV2","setupToast","loadToast","COUNT_KEY","getItem","currentValue","init","getCookie","result","RegExp","exec","cookie","setCookie","maxAgeInDays","maxAge","readCookie","read_cookie","set_cookie","setup_doc_cloud_size_hacks","ratio","iframe_config_ratios","domain","resize_iframes","host","config","find","candidate","ceil","goalParam","goal","getUuid","$mcGoal","settings","uuid","getDC","dc","process","getParameter","isValidGoal","createCookie","processPage","regex","search","isValidEvent","click_event","isValidSettings","isDoNotTrack","doNotTrack","msDoNotTrack","replace","results","decodeURIComponent","c_name","exdays","exdate","setDate","getDate","c_value","escape","toUTCString","nameEQ","ca","split","c","charAt","substring","indexOf","params","sendData","processEvent","serializeParamters","sp","defer","protocol","s","obj","str","p","k","v","serialize","encodeURIComponent","appendStringIntoElement","string","fragment","createContextualFragment","setStyle","property","ensure","object","requiredKeys","errors","isUndefined","Error","isNullOrUndefined","getBootstrapData","optional","TMPBootstrapData","abstractMethod","isMobileViewport","getUrlParameter","uuidv4","crypto","getRandomValues","Uint8Array","renderClassToElement","klass","selector","$els","each","instance","whenElementExists","selectors","fn","dynamicRenderClassToElement","loadFn","els","count","default","Class","idx","loadScript","append"],"sourceRoot":""}