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KAAM,gBACNqO,MAAO,CACL,CAEEuI,MACE,4FACFonC,OAAQ,oCAEV,CACEpnC,MACE,4FACFmnC,SAAU,iBAIhB,CACE/9C,KAAM,aACNqO,MAAO,CACL,CAEEuI,MAAO,oCACPonC,OAAQ,8CAMVE,EAA0B,CAC9B,CACEl+C,KAAM,eACNqO,MAAO,CACL,CACEuI,MACE,oFACF5W,KAAM,0BAIZ,CACEA,KAAM,qBACNqO,MAAO,CACL,CACEuI,MACE,oFACF5W,KAAM,wBAER,CACE4W,MACE,0FACF5W,KAAM,wBAER,CACE4W,MACE,sFACF5W,KAAM,2BAiVd,EApRmB4J,CAAC7K,EAAOw4B,KAOzB,GACqB,6BAAnBx4B,GAAOuvC,SAPkB,CACzB,cACA,kBACA,mDAKmB1wC,SAASmB,GAAOqmB,OAAO3mB,OAAO6vC,SAEjD,OAAO,KAGT,MAAM7vC,EAAQ84B,EAAK4mB,kBAEnB,GAAI1/C,GAAO6vC,QAAS,CAClB,MAAM8P,EAAgB,CACpB,uBACA,6BACA,+BACA,yBACA,sCACA,+CACA,mDACA,sDACA,sBACA,yBACA,yBAGIC,EAAkB,CACtB,gBACA,oBACA,gCACA,yCACA,WACA,qCACA,oBACA,QACA,UACA,aACA,2BACA,6CACA,kGACA,4BACA,0CACA,uDACA,mBACA,uBACA,mBACA,gBACA,0BACA,cACA,+BACA,eACA,YACA,yBACA,SACA,WACA,4BACA,sBACA,QACA,WACA,+BACA,qBACA,qBACA,0BACA,gBACA,oCACA,sCACA,qCACA,kDACA,uBACA,iBACA,uBACA,6BACA,cACA,iBACA,6BACA,oBACA,6BACA,iBACA,uBACA,oBACA,mBACA,uBACA,gCACA,YACA,cACA,4BACA,mBACA,sBACA,yCACA,WACA,UACA,QACA,cACA,SACA,wBACA,2BACA,4BACA,8BACA,qDACA,wEACA,2BACA,wBAGIC,EAAW,CACf,mCAGI,QAAEhQ,GAAY7vC,EAEpB,GACE2/C,EAAcxgD,SAAS0wC,IACvB+P,EAAgBE,MAA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,EAAKzkC,GAsEfhC,KAAK0mC,WAAa,CACd,MAAS,CACL,YAAe,kBACf,YAAe,oEACf,gBAAmB,uBACnB,qBAAwB,0BACxB,oBAAuB,kCACvB,gBAAmB,mBACnB,qBAAwB,sBACxB,oBAAuB,8BACvB,uBAA0B,mEAC1B,sBAAyB,kEACzB,uBAA0B,8EAC1B,iBAAoB,QACpB,iBAAoB,qBACpB,aAAgB,g4BAEpB,eAAkB,MAClB,YAAe,CACX,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,YAEJ,wBAA2B,CACvB,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,OAEJ,mBAAsB,CAClB,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAEJ,UAAa,CACT,SACA,SACA,UACA,YACA,WACA,SACA,YAEJ,sBAAyB,CACrB,MACA,MACA,MACA,MACA,MACA,MACA,OAEJ,gBAAmB,CACf,KACA,KACA,KACA,KACA,KACA,KACA,MAEJ,iBAAoB,CAChB,IACA,IACA,IACA,IACA,IACA,IACA,KAEJ,YAAe,CACX,GAAM,KACN,KAAQ,OACR,GAAM,MAEV,wBAA2B,CACvB,GAAM,KACN,KAAQ,OACR,GAAM,MAEV,mBAAsB,CAClB,GAAM,IACN,KAAQ,IACR,GAAM,KAEV,cAAiB,CACb,cACA,cACA,cACA,eAEJ,0BAA6B,CACzB,KACA,KACA,KACA,MAEJ,qBAAwB,CACpB,IACA,IACA,IACA,KAEJ,UAAa,CACT,gBACA,eAEJ,sBAAyB,CACrB,KACA,MAEJ,iBAAoB,CAChB,IACA,KAEJ,YAAe,kBACf,YAAe,YACf,cAAiB,WACjB,aAAgB,SAChB,iBAAoB,GAGxB,IAAIC,EAAmB,CACtB,wJACA,uCACA,QAEGC,EAAqB,CACxB,4FACA,wCACA,uMACA,oMACA,uMACA,kMACA,mOACA,WACA,sLACA,kCACA,oDACA,yJACA,yJACA,2JACA,+JACA,6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BA,EAAOyU,MAAQ,GACVzU,EAAOvtC,WAAUutC,EAAOvtC,SAAW,IACjCutC,GCHR4S,EAAoBW,EAAI,I,MCKxB,IAAImB,EAAkB,CACrB,IAAK,GAaN9B,EAAoBve,EAAEkf,EAAKoB,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BtzD,KACvD,IAGIsxD,EAAU8B,GAHTzB,EAAU4B,EAAaC,GAAWxzD,EAGhB8G,EAAI,EAC3B,GAAG6qD,EAAS3S,MAAM5+C,GAAgC,IAAxB+yD,EAAgB/yD,KAAa,CACtD,IAAIkxD,KAAYiC,EACZlC,EAAoBnd,EAAEqf,EAAajC,KACrCD,EAAoB5sD,EAAE6sD,GAAYiC,EAAYjC,IAGhD,GAAGkC,EAAS,IAAIxrD,EAASwrD,EAAQnC,EAClC,CAEA,IADGiC,GAA4BA,EAA2BtzD,GACrD8G,EAAI6qD,EAAS5qD,OAAQD,IACzBssD,EAAUzB,EAAS7qD,GAChBuqD,EAAoBnd,EAAEif,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAO/B,EAAoBve,EAAE9qC,EAAO,EAGjCyrD,EAAqBb,WAA+B,mBAAIA,WAA+B,oBAAK,GAChGa,EAAmBzyD,QAAQqyD,EAAqB/lC,KAAK,KAAM,IAC3DmmC,EAAmB3zD,KAAOuzD,EAAqB/lC,KAAK,KAAMmmC,EAAmB3zD,KAAKwtB,KAAKmmC,G,KC7CvF,IAAIC,EAAsBrC,EAAoBve,OAAEjuC,EAAW,CAAC,IAAI,MAAM,IAAOwsD,EAAoB,SACjGqC,EAAsBrC,EAAoBve,EAAE4gB,E","sources":["webpack://dotcom/webpack/runtime/chunk loaded","webpack://dotcom/webpack/runtime/create fake namespace object","webpack://dotcom/./ts/app/channels.ts","webpack://dotcom/./ts/app/dismiss-fullscreen-error.ts","webpack://dotcom/./ts/app/global-navigation.ts","webpack://dotcom/./ts/helpers/debounce.ts","webpack://dotcom/./ts/helpers/fetch-json.ts","webpack://dotcom/./ts/helpers/keyboard-events.ts","webpack://dotcom/./ts/helpers/media-breakpoints.ts","webpack://dotcom/./ts/helpers/query.ts","webpack://dotcom/./ts/helpers/text.ts","webpack://dotcom/./ts/sentry.ts","webpack://dotcom/./ts/ui/accordion.ts","webpack://dotcom/./ts/ui/autocomplete/helpers.ts","webpack://dotcom/./ts/ui/autocomplete/index.ts","webpack://dotcom/./ts/ui/autocomplete/plugins.ts","webpack://dotcom/./ts/ui/autocomplete/plugins/algolia.ts","webpack://dotcom/./ts/ui/autocomplete/plugins/geolocation.ts","webpack://dotcom/./ts/ui/autocomplete/plugins/locations.ts","webpack://dotcom/./ts/ui/autocomplete/plugins/popular.ts","webpack://dotcom/./ts/ui/autocomplete/templates/algolia.tsx","webpack://dotcom/./ts/ui/autocomplete/templates/geolocation.tsx","webpack://dotcom/./ts/ui/autocomplete/templates/location.tsx","webpack://dotcom/./ts/ui/autocomplete/templates/popular.tsx","webpack://dotcom/./js/algolia-result.js","webpack://dotcom/./js/google-analytics.js","webpack://dotcom/./js/turbolinks-mods.js","webpack://dotcom/./js/support-form.js","webpack://dotcom/./js/geolocation.js","webpack://dotcom/./js/address-search.js","webpack://dotcom/./js/google-translate.js","webpack://dotcom/./js/scroll-to.js","webpack://dotcom/./js/timetable-style.js","webpack://dotcom/./js/timetable-stick.js","webpack://dotcom/./js/datepicker-input.js","webpack://dotcom/./js/time-controls/time-controls.js","webpack://dotcom/./js/maps-helpers.js","webpack://dotcom/./js/algolia-search.js","webpack://dotcom/./js/algolia-autocomplete.js","webpack://dotcom/./js/algolia-autocomplete-with-geo.js","webpack://dotcom/./js/trip-planner-location-controls.js","webpack://dotcom/./js/photo-gallery.js","webpack://dotcom/./js/algolia-embedded-search-options.js","webpack://dotcom/./js/algolia-embedded-search.js","webpack://dotcom/./js/algolia-homepage-search.js","webpack://dotcom/./js/algolia-search-with-geo.js","webpack://dotcom/./js/facet-item.js","webpack://dotcom/./js/facet-group.js","webpack://dotcom/./js/facet-bar.js","webpack://dotcom/./js/facet-location-group.js","webpack://dotcom/./js/algolia-facets.js","webpack://dotcom/./js/algolia-results.js","webpack://dotcom/./js/algolia-global-search.js","webpack://dotcom/./js/cr-timetable-tooltips.js","webpack://dotcom/./js/cr-timetable-train-icons.js","webpack://dotcom/./js/cr-timetable-trains.js","webpack://dotcom/./js/alert-item.js","webpack://dotcom/./js/event-page-setup.js","webpack://dotcom/./js/psl-page-setup.js","webpack://dotcom/./js/app.js","webpack://dotcom/./js/fullstory.js","webpack://dotcom/./js/submit-on-events.js","webpack://dotcom/./js/collapse.js","webpack://dotcom/./js/modal.js","webpack://dotcom/./js/fixedsticky.js","webpack://dotcom/./js/input-focus.js","webpack://dotcom/./js/tabbed-nav.js","webpack://dotcom/./js/timetable-scroll.js","webpack://dotcom/./js/date-picker.js","webpack://dotcom/./js/toggle-on-click.js","webpack://dotcom/./js/stop-bubbles.js","webpack://dotcom/./js/search.js","webpack://dotcom/./js/sticky-tooltip.js","webpack://dotcom/./js/cookies.js","webpack://dotcom/./js/trip-planner-widget.js","webpack://dotcom/./js/view-previous-events.js","webpack://dotcom/./js/geolocation-promise.js","webpack://dotcom/./js/icons.js","webpack://dotcom/./js/sentry-filter.js","webpack://dotcom/./vendor/accessible-date-picker.js","webpack://dotcom/./vendor/fixedsticky.js","webpack://dotcom/webpack/bootstrap","webpack://dotcom/webpack/runtime/amd define","webpack://dotcom/webpack/runtime/compat get default export","webpack://dotcom/webpack/runtime/define property getters","webpack://dotcom/webpack/runtime/ensure chunk","webpack://dotcom/webpack/runtime/global","webpack://dotcom/webpack/runtime/harmony module decorator","webpack://dotcom/webpack/runtime/hasOwnProperty shorthand","webpack://dotcom/webpack/runtime/make namespace object","webpack://dotcom/webpack/runtime/node module decorator","webpack://dotcom/webpack/runtime/runtimeId","webpack://dotcom/webpack/runtime/jsonp chunk loading","webpack://dotcom/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","import { Socket, Channel } from \"phoenix\";\n\ndeclare global {\n  interface Window {\n    channels: { [id: string]: Channel };\n    socket: Socket;\n  }\n}\n\ntype UpdateEventName = \"reset\" | \"add\" | \"update\";\n\ninterface UpdateEvent<DataType> {\n  event: UpdateEventName;\n  data: DataType;\n}\n\ninterface RemoveEvent {\n  event: \"remove\";\n  data: string[];\n}\n\nexport type SocketEvent<DataType> = UpdateEvent<DataType> | RemoveEvent;\n\nexport const isVehicleChannel = (channelId: string): boolean =>\n  (channelId.includes(\"vehicles:\") || channelId.includes(\"vehicles-v2:\")) &&\n  !channelId.includes(\":remove\");\n\nconst joinChannel = <T>(\n  channelId: string,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  handleJoin?: (event: any) => void\n): void => {\n  if (!window.socket) return;\n\n  if (!window.channels[channelId]) {\n    window.channels[channelId] = window.socket.channel(channelId, {});\n  }\n\n  const channel = window.channels[channelId];\n\n  if (![\"joined\", \"joining\"].includes(channel.state)) {\n    channel\n      .join()\n      .receive(\"error\", ({ reason }) => {\n        /* eslint-disable no-console */\n        console.error(`failed to join ${channelId}`, reason);\n        const errorEvent = new CustomEvent<{ error: string }>(channelId, {\n          detail: { error: reason }\n        });\n        document.dispatchEvent(errorEvent);\n      })\n      .receive(\"ok\", event => {\n        console.log(`success joining ${channelId}`);\n        if (handleJoin && event) {\n          handleJoin(event);\n        }\n        if (isVehicleChannel(channelId)) {\n          const [, route_id, direction_id] = channelId.split(\":\");\n          channel.push(\"init\", { route_id, direction_id });\n        }\n      });\n  }\n\n  channel.on(\"data\", (data: T) => {\n    const event = new CustomEvent<T>(channelId, { detail: data });\n    document.dispatchEvent(event);\n  });\n\n  channel.onError((reason: string) => {\n    console.error(`error on channel ${channelId} : ${reason}`);\n    /* eslint-enable no-console */\n    const errorEvent = new CustomEvent<{ error: string }>(channelId, {\n      detail: { error: reason }\n    });\n    document.dispatchEvent(errorEvent);\n  });\n\n  if (isVehicleChannel(channelId)) {\n    const [baseChannel] = channelId.split(\":\");\n    joinChannel(`${baseChannel}:remove`);\n  }\n};\n\nconst leaveChannel = (id: string): void => {\n  if (window.channels && window.channels[id]) {\n    window.channels[id].off(\"data\");\n    window.channels[id].leave();\n    delete window.channels[id];\n  }\n\n  if (isVehicleChannel(id)) {\n    const [baseChannel] = id.split(\":\");\n    leaveChannel(`${baseChannel}:remove`);\n  }\n};\n\nconst setupChannels = (): void => {\n  window.socket = new Socket(\"/socket\", {});\n  window.socket.onClose(event => {\n    if (event.type === \"close\" && !event.wasClean) {\n      // eslint-disable-next-line no-console\n      console.log(\n        \"Socket was forced closed by the browser -- reloading to establish WebSocket connection.\"\n      );\n      window.location.reload();\n    }\n  });\n  window.socket.connect();\n  window.channels = {};\n\n  const joinAllChannels = (): void => {\n    document.querySelectorAll(\"[data-channel]\").forEach(el => {\n      const channelId = el.getAttribute(\"data-channel\");\n      if (channelId) joinChannel(channelId);\n    });\n  };\n\n  document.addEventListener(\"turbolinks:load\", joinAllChannels);\n\n  // leave subscribed channels when navigating away from a page.\n  const leaveAllChannels = (): void => {\n    Object.keys(window.channels).forEach(id => leaveChannel(id));\n  };\n  document.addEventListener(\"turbolinks:before-render\", leaveAllChannels);\n};\n\nexport { joinChannel, leaveChannel };\nexport default setupChannels;\n","import { handleNativeEnterKeyPress } from \"../helpers/keyboard-events\";\n\nconst hideAlert = (containerEl: HTMLElement): void => {\n  containerEl.setAttribute(\"style\", \"display: none\");\n};\n\nexport default (): void => {\n  const dismissEl: HTMLElement | null = document.querySelector(\n    \".js-fullscreen-error__dismiss\"\n  );\n  const containerEl: HTMLElement | null = document.querySelector(\n    \".js-fullscreen-error\"\n  );\n  if (!dismissEl || !containerEl) {\n    return;\n  }\n  dismissEl.addEventListener(\"click\", () => hideAlert(containerEl));\n  dismissEl.addEventListener(\"keydown\", (e: KeyboardEvent) =>\n    handleNativeEnterKeyPress(e, () => {\n      hideAlert(containerEl);\n    })\n  );\n};\n","// Responses handled here:\n// - \"menu-open\" or \"search-open\" added as class to header\n// - \"menu-open\" added as class to body\n// - update aria-expanded to indicate menu state\n// - update text of menu toggle button\n// - reset scroll on menu content when menu is opened\n// - menu can be closed by pressing esc key or veil-click\n\nimport { clearAllBodyScrollLocks, disableBodyScroll } from \"body-scroll-lock\";\nimport { handleNativeEscapeKeyPress } from \"../helpers/keyboard-events\";\n\nfunction undoOutline(this: HTMLElement): void {\n  this.style.outline = \"none\";\n}\n\nfunction toggleAriaExpanded(el: Element): void {\n  el.setAttribute(\n    \"aria-expanded\",\n    el.getAttribute(\"aria-expanded\") === \"true\" ? \"false\" : \"true\"\n  );\n}\n\nfunction toggleMenu(el: Element): void {\n  toggleAriaExpanded(el);\n}\n\nconst TOGGLE_NAMES = {\n  mobile: \"toggle-mobile-nav\",\n  search: \"toggle-nav-search\",\n  desktop: \"toggle-desktop-nav\"\n};\n\nconst TOGGLE_SELECTORS = Object.fromEntries(\n  Object.entries(TOGGLE_NAMES).map(([key, name]) => [key, `[data-nav=${name}]`])\n);\n\nconst allTogglesSelector: string = Object.values(TOGGLE_SELECTORS).join(\", \");\n\nexport function setHeaderElementPositions(\n  header: HTMLElement,\n  rootElement: HTMLElement\n): void {\n  if (!header || !rootElement) return;\n\n  const { bottom, height } = header.getBoundingClientRect();\n  const bottomPx = `${bottom}px`;\n  const heightPx = `${height}px`;\n\n  header.querySelectorAll(\"[data-nav='desktop-section']\").forEach(el => {\n    // eslint-disable-next-line no-param-reassign\n    (el as HTMLElement).style.top = heightPx;\n  });\n\n  const content = header.querySelector(\n    \"[data-nav='mobile-content']\"\n  ) as HTMLElement | null;\n  if (content) {\n    content.style.top = bottomPx;\n  }\n\n  const cover = rootElement.querySelector(\n    \"[data-nav='veil']\"\n  ) as HTMLElement | null;\n  if (cover) {\n    cover.style.top = bottomPx;\n  }\n}\n\nexport function setup(rootElement: HTMLElement): void {\n  // This clears any existing  body locks on page loading\n  clearAllBodyScrollLocks();\n  if (!rootElement) return;\n\n  const header: HTMLElement = rootElement.querySelector(\"header\")!;\n  if (!header) return;\n\n  window.addEventListener(\"DOMContentLoaded\", () => {\n    setHeaderElementPositions(header, rootElement);\n  });\n  window.addEventListener(\"resize\", () => {\n    setHeaderElementPositions(header, rootElement);\n  });\n\n  // On mobile, clicking Menu or the Search icon opens a menu\n  header\n    .querySelectorAll(\n      `button${TOGGLE_SELECTORS.mobile}, button${TOGGLE_SELECTORS.search}`\n    )\n    .forEach(toggle => {\n      toggle.addEventListener(\"click\", event => {\n        event.preventDefault(); // don't navigate the <a>\n        setHeaderElementPositions(header, rootElement);\n        toggleMenu(event.currentTarget as Element);\n      });\n    });\n\n  // On desktop, clicking a menu item opens the submenu\n  header.querySelectorAll(`a${TOGGLE_SELECTORS.desktop}`).forEach(toggle => {\n    toggle.addEventListener(\"click\", event => {\n      event.preventDefault(); // don't navigate the <a>\n      toggleMenu(event.currentTarget as Element);\n    });\n  });\n\n  // removes focus outline in Safari from open accordions\n  rootElement\n    .querySelectorAll(\"[data-nav='mobile-content'] .js-focus-on-expand\")\n    .forEach(openAccordion => {\n      openAccordion.addEventListener(\"focus\", undoOutline);\n    });\n\n  // On mobile, when a menu is opened/closed,\n  const toggledMobileMenuObserver = new MutationObserver(() => {\n    const mobileMenuToggle = header.querySelector(\n      `button${TOGGLE_SELECTORS.mobile}`\n    )!;\n\n    // Update Menu button text\n    if (\"navOpen\" in header.dataset) {\n      // eslint-disable-next-line no-param-reassign\n      rootElement.querySelector(\"[data-nav='mobile-content']\")!.scrollTop = 0;\n      mobileMenuToggle.innerHTML = \"Close\";\n    } else {\n      mobileMenuToggle.innerHTML = \"Menu\";\n    }\n\n    if (\"searchOpen\" in header.dataset) {\n      // pass focus to search bar\n      (rootElement.querySelector(\n        \"[data-nav='search'] #input\"\n      ) as HTMLElement)!.focus();\n    }\n  });\n\n  // When any navigation menu is expanded,\n  const expandedMenuObserver = new MutationObserver(mutations => {\n    const observedDataAttributes = mutations.map(\n      m => (m.target as HTMLElement).dataset.nav || \"\"\n    );\n\n    const aMenuIsBeingExpanded: boolean =\n      mutations.find(\n        ({ oldValue, target }) =>\n          (target as Element).getAttribute(\"aria-expanded\") === \"true\" &&\n          oldValue !== \"true\"\n      ) !== undefined;\n\n    // adjust theme color\n    rootElement\n      .querySelector('meta[name=\"theme-color\"]')\n      ?.setAttribute(\"content\", aMenuIsBeingExpanded ? \"#0b2f4c\" : \"#165c96\");\n\n    // add/remove data attributes based on which menu is expanded\n    // nav-open on the document body\n    // nav-open or search-open on the header\n    if (aMenuIsBeingExpanded) {\n      // eslint-disable-next-line no-param-reassign\n      rootElement.dataset.navOpen = \"true\";\n      if (observedDataAttributes.includes(TOGGLE_NAMES.mobile)) {\n        // eslint-disable-next-line no-param-reassign\n        header.dataset.navOpen = \"true\";\n        disableBodyScroll(\n          rootElement.querySelector(\"[data-nav='mobile-content']\")!\n        );\n      } else if (observedDataAttributes.includes(TOGGLE_NAMES.search)) {\n        // eslint-disable-next-line no-param-reassign\n        header.dataset.searchOpen = \"true\";\n        disableBodyScroll(header);\n      }\n    } else {\n      // only do this if no other menu is expanded\n      const anyOpen = Array.from(\n        rootElement.querySelectorAll(allTogglesSelector)\n      ).find(el => el.getAttribute(\"aria-expanded\") === \"true\");\n\n      if (!anyOpen) {\n        clearAllBodyScrollLocks();\n        // eslint-disable-next-line no-param-reassign\n        delete rootElement.dataset.navOpen;\n        if (observedDataAttributes.includes(TOGGLE_NAMES.mobile)) {\n          // eslint-disable-next-line no-param-reassign\n          delete header.dataset.navOpen;\n        } else if (observedDataAttributes.includes(TOGGLE_NAMES.search)) {\n          // eslint-disable-next-line no-param-reassign\n          delete header.dataset.searchOpen;\n        }\n      }\n    }\n\n    // Close the other desktop tabs programmatically\n    if (\n      aMenuIsBeingExpanded &&\n      observedDataAttributes.includes(TOGGLE_NAMES.desktop)\n    ) {\n      // Disable scrolling the page, but accomodate any visible scrollbars in\n      // order to avoid horizontal shift in the layout when scrolling becomes\n      // disabled. This additionally requires adjusting the width of the veil,\n      // to maintain a pleasing appearance.\n      disableBodyScroll(header, { reserveScrollBarGap: true });\n      const cover = rootElement.querySelector<HTMLElement>(\"[data-nav='veil']\");\n      if (\n        cover &&\n        !cover.style.paddingRight &&\n        rootElement.dataset.navOpen === \"true\"\n      ) {\n        const body = rootElement.querySelector(\"body\");\n        // this was added by { reserveScrollBarGap: true }\n        const paddingRight = body?.style.paddingRight;\n        if (paddingRight && paddingRight !== \"\") {\n          // add same 'padding' for veil by substracting from width\n          cover.style.width = `calc(100% - ${paddingRight})`;\n        }\n      }\n\n      const thisMenu = mutations.map(({ target }) =>\n        (target as Element).getAttribute(\"aria-controls\")\n      )[0];\n      // close OTHER menus\n      Array.from(rootElement.querySelectorAll(`${TOGGLE_SELECTORS.desktop}`))\n        .filter(\n          (el: Element) =>\n            el.getAttribute(\"aria-controls\") !== thisMenu &&\n            el.getAttribute(\"aria-expanded\") === \"true\"\n        )\n        .forEach(toggleAriaExpanded);\n    }\n  });\n\n  // monitor the header for attribute changes\n  toggledMobileMenuObserver.observe(header, {\n    attributes: true,\n    attributeFilter: [\"data-nav-open\", \"data-search-open\"]\n  });\n\n  // monitor all the menu toggles for aria-expanded changes\n  rootElement.querySelectorAll(allTogglesSelector).forEach(el => {\n    expandedMenuObserver.observe(el, {\n      attributes: true,\n      attributeOldValue: true,\n      attributeFilter: [\"aria-expanded\"]\n    });\n  });\n\n  // Scroll accordion into view on click\n  // Note: we can't use `scrollIntoView`, Safari doesn't support it as of\n  // 2022-02-28, and even if it did, the opening/closing animations of the\n  // accordions makes the behavior janky on other browsers\n  const menuContent = rootElement.querySelector(\n    \"[data-nav='mobile-content']\"\n  )! as HTMLElement;\n  if (window.matchMedia(\"(prefers-reduced-motion: no-preference)\").matches) {\n    menuContent\n      .querySelectorAll(\"[data-accordion] h3 > button\")\n      .forEach(target =>\n        target.addEventListener(\n          \"click\",\n          event => {\n            const el = event.target as HTMLElement;\n            if (target.getAttribute(\"aria-expanded\") === \"false\") {\n              return;\n            }\n\n            const expandedDrawerId = el.getAttribute(\"aria-controls\");\n            const expandedDrawer = menuContent.querySelector(\n              `#${expandedDrawerId}`\n            );\n\n            const targetBB = el.getBoundingClientRect();\n\n            const yOffset = (() => {\n              if (expandedDrawer) {\n                const bb = expandedDrawer.getBoundingClientRect();\n                if (bb.y < targetBB.y) {\n                  return bb.height;\n                }\n\n                return 0;\n              }\n\n              return 0;\n            })();\n\n            const targetY = el.offsetTop - targetBB.height / 2 - yOffset;\n\n            menuContent.scrollTo({\n              behavior: \"smooth\",\n              left: 0,\n              top: targetY\n            });\n          },\n          false\n        )\n      );\n  }\n\n  function closeAllMenus(): void {\n    rootElement.querySelectorAll(allTogglesSelector).forEach(el => {\n      if (el.getAttribute(\"aria-expanded\") === \"true\") {\n        toggleAriaExpanded(el);\n      }\n    });\n  }\n\n  function closeVeil(): void {\n    if (document.documentElement.dataset.navOpen === \"true\") {\n      delete document.documentElement.dataset.navOpen;\n    }\n  }\n\n  function resetPage(): void {\n    closeAllMenus();\n    closeVeil();\n  }\n\n  // menu click closes\n  const menu_links = rootElement.querySelectorAll(\"[data-nav='link']\");\n  for (let i = 0; i < menu_links.length; i += 1) {\n    menu_links[i].addEventListener(\"click\", resetPage);\n  }\n\n  // T logo click closes\n  header\n    .querySelector(\"[data-nav='logo']\")\n    ?.addEventListener(\"click\", resetPage);\n\n  // Veil click or Esc key closes everything\n  rootElement.addEventListener(\"keydown\", e => {\n    handleNativeEscapeKeyPress(e, resetPage);\n  });\n\n  rootElement\n    .querySelector(\"[data-nav='veil']\")\n    ?.addEventListener(\"click\", resetPage);\n\n  // Closes veil before navigating to search result\n  document.addEventListener(\"autocomplete:selected\", closeAllMenus);\n}\n\nexport default function setupGlobalNavigation(): void {\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      setup(document.documentElement);\n    },\n    { passive: true }\n  );\n}\n","// Debounce is meant to be used with event listeners. Use it to delay a call\n// until after a burst of events, such as keyboard input.\n//\n//   usage:\n//\n//     const callback = (ev: Event) => {}\n//     document.addEventListener(\"keyup\", debounce(callback, 250))\n//\n\nconst debounce = (callback: Function, delay: number): EventListener => {\n  let timer: number | undefined;\n\n  return (...args) => {\n    window.clearTimeout(timer);\n    timer = window.setTimeout(() => callback(...args), delay);\n  };\n};\n\nexport const debouncePromise = (\n  callback: Function,\n  delay: number\n): Function => {\n  let timerId: number | undefined;\n\n  return function debounced(...args: unknown[]) {\n    if (timerId) {\n      window.clearTimeout(timerId);\n    }\n\n    return new Promise(resolve => {\n      timerId = window.setTimeout(() => resolve(callback(...args)), delay);\n    });\n  };\n};\n\nexport default debounce;\n","export const isFetchFailed = <T>(r: FetchResult<T>): r is FetchFailed =>\n  r && typeof r === \"object\" && \"statusText\" in r;\n\nexport const throwIfFetchFailed = <T>(result: FetchResult<T>): T => {\n  if (isFetchFailed(result)) {\n    throw new Error(`Fetch failed: ${result}`);\n  }\n\n  return result;\n};\n\nexport type FetchFailed = Response;\nexport type FetchResult<T> = T | FetchFailed;\nexport const fetchJson = async <T>(\n  ...args: Parameters<typeof fetch>\n): Promise<FetchResult<T>> => {\n  const resp = await fetch(...args);\n  if (!resp.ok) {\n    return resp;\n  }\n\n  return resp.json();\n};\n\nexport const fetchJsonOrThrow = async <T>(\n  ...args: Parameters<typeof fetch>\n): Promise<T> => fetchJson<T>(...args).then(throwIfFetchFailed);\n","export const isEnter = (key: number | string): boolean =>\n  key === \"Enter\" || key === 13;\n\nexport const isEscape = (key: number | string): boolean =>\n  key === \"Escape\" || key === 27;\n\n// for vanilla JS\nexport const handleNativeEnterKeyPress = (\n  e: KeyboardEvent,\n  cb: Function\n): void => (isEnter(e.key || e.keyCode) ? cb(e) : () => {});\n\nexport const handleNativeEscapeKeyPress = (\n  e: KeyboardEvent,\n  cb: Function\n): void => (isEscape(e.key || e.keyCode) ? cb(e) : () => {});\n","// Specify in pixels, but in numbers here for calculations\nconst mediaBreakpoints = {\n  xs: 0,\n  sm: 544,\n  md: 800,\n  lg: 1088,\n  xxl: 1344\n};\n\nexport const isLGDown = (): boolean =>\n  window.matchMedia(`(max-width: ${mediaBreakpoints.lg}px)`).matches;\n\nexport const isSMDown = (): boolean =>\n  window?.matchMedia(`(max-width: ${mediaBreakpoints.sm}px)`)?.matches;\n","export interface QueryParams {\n  [key: string]: string;\n}\n\n// The encoder/decoder functions must be injected\n// because this helper is used by some vanilla JS files,\n// and MochaJS insists that the window object does not\n// include encodeURIComponent or decodeURIComponent,\n// which causes a compiler error. If/when there are\n// no more JS modules using these helpers, the\n// injections should be removed.\ntype EncoderDecoder = (str: string) => string;\n\nexport const paramsToString = (\n  params: QueryParams,\n  encoder: EncoderDecoder\n): string => {\n  if (!params || Object.keys(params).length === 0) {\n    return \"\";\n  }\n\n  return `?${Object.keys(params)\n    .map(key => `${key}=${encoder(params[key])}`)\n    .join(\"&\")}`;\n};\n\ntype QueryReducer = (params: QueryParams, kvString: string) => QueryParams;\n\nconst queryReducer = (decoder: EncoderDecoder): QueryReducer => (\n  params: QueryParams,\n  kvString: string\n) => {\n  const [key, val] = kvString.split(\"=\");\n  return { ...params, [decoder(key)]: decoder(val.replace(/\\+/g, \" \")) };\n};\n\nexport const parseQuery = (\n  query: string,\n  decoder: EncoderDecoder\n): QueryParams =>\n  query\n    ? query\n        .substring(1)\n        .split(\"&\")\n        .reduce(queryReducer(decoder), {})\n    : {};\n","/**\n * Replaces slashes in a given string with a slash + ZERO_WIDTH_SPACE.\n * It's visually the same, but allows browsers to break the text into multiple lines.\n */\n// eslint-disable-next-line import/prefer-default-export\nexport const breakTextAtSlash = (str: string): string =>\n  str.replace(/\\//g, \"/​\");\n\nexport interface HighlightedSpan {\n  offset: number;\n  length: number;\n}\nexport function highlightText(\n  text: string,\n  spans: HighlightedSpan[] = []\n): string {\n  const parts = [];\n  let cursor = 0;\n  spans.forEach(span => {\n    const { offset, length } = span;\n\n    parts.push(text.slice(cursor, offset));\n    parts.push(`<em>${text.slice(offset, offset + length)}</em>`);\n    cursor = length + offset;\n  });\n  parts.push(text.slice(cursor));\n\n  return parts.join(\"\");\n}\n","import * as Sentry from \"@sentry/react\";\nimport beforeSend from \"../js/sentry-filter\";\n\ndeclare global {\n  interface Window {\n    sentry: {\n      dsn: string;\n      environment: string;\n    };\n  }\n}\n\nexport default function initializeSentry(): void {\n  if (window.sentry) {\n    Sentry.init({\n      dsn: window.sentry.dsn,\n      environment: window.sentry.environment,\n      beforeSend,\n      autoSessionTracking: false,\n      sampleRate: 0.6, // error sampling - might increase later\n      initialScope: {\n        tags: { \"dotcom.application\": \"frontend\" }\n      },\n      beforeBreadcrumb: breadcrumb => {\n        // omit breadcrumbs that are just these scripts\n        // making their incessant pinging\n        if (\n          breadcrumb.data?.url?.contains(\"clarity.ms\") ||\n          breadcrumb.data?.url?.contains(\"doubleclick.net\") ||\n          breadcrumb.data?.url?.contains(\"google-analytics.com\")\n        ) {\n          return null;\n        }\n        return breadcrumb;\n      },\n      // ignoreErrors is a list of messages to be filtered out before\n      // being sent to Sentry as either regular expressions or strings.\n      // When using strings, they’ll partially match the messages\n      ignoreErrors: [\n        \"translate_\",\n        \"ResizeObserver loop limit exceeded\",\n        \"Non-Error promise rejection captured\",\n        \"Extension context invalidated\",\n        /^xd\\/\\(\\/_\\/translate_http/i\n      ],\n      // we don't care about errors from external tools and libraries\n      denyUrls: [\n        // Chrome extensions\n        /extensions\\//i,\n        /^chrome:\\/\\//i,\n        /^chrome-extension:\\/\\//i,\n        // Firefox extensions\n        /^resource:\\/\\//i,\n        /^moz-extension:\\/\\//i,\n        // Safari extensions\n        /^safari-extension:/i,\n        /safari-extension:\\/\\//i,\n        // Others\n        /google/i,\n        /gtag/i,\n        /gstatic/i,\n        /clarity/i,\n        // reCAPTCHA flakiness\n        /gstatic\\.com\\/recaptcha\\/releases/i,\n\n        // Bing UET tracking flakiness\n        /bat\\.bing\\.com\\/bat\\.js/i,\n\n        // Local user files\n        /file:\\/\\//i,\n\n        // Trustpilot scripts\n        /widget\\.trustpilot\\.com/i,\n\n        // Hubspot scripts\n        /js\\.hs-banner\\.com/i,\n        /js\\.hs-analytics\\.net/i,\n        /js\\.hs-scripts\\.com/i,\n        /js\\.hsadspixel\\.net/i,\n\n        // Sentry scripts\n        /browser\\.sentry-cdn\\.com/i,\n\n        // Facebook scripts\n        /graph\\.facebook\\.com/i,\n        /connect\\.facebook\\.net\\/en_US\\/all\\.js/i,\n\n        // Microsoft Clarity\n        /clarity\\.ms/i,\n\n        // Twitter ads\n        /ads-twitter\\.com/i,\n\n        // Google scripts\n        /googletagmanager\\.com/i,\n        /google-analytics\\.com/i,\n\n        // LinkedIn scripts\n        /snap\\.licdn\\.com/i,\n\n        // Quora scripts\n        /a\\.quora\\.com/i\n      ]\n    });\n  }\n\n  document.body.addEventListener(\n    \"error\",\n    event => {\n      const target = event.target as Element;\n      if (!event.target) return;\n\n      if (target.tagName === \"IMG\") {\n        Sentry.captureMessage(\n          `Failed to load image: ${(<HTMLImageElement>event.target).src}`,\n          \"warning\"\n        );\n      } else if (target.tagName === \"LINK\") {\n        Sentry.captureMessage(\n          `Failed to load css: ${(<HTMLLinkElement>event.target).href}`,\n          \"warning\"\n        );\n      } else if (target.tagName === \"SCRIPT\") {\n        Sentry.captureMessage(\n          `Failed to load script: ${(<HTMLScriptElement>event.target).src}`,\n          \"warning\"\n        );\n      } else if (target.tagName === \"VIDEO\") {\n        Sentry.captureMessage(\n          `Failed to load video: ${(<HTMLVideoElement>event.target).src}`,\n          \"warning\"\n        );\n      }\n    },\n    true // useCapture - necessary for resource loading errors\n  );\n}\n","/**\n * Accordion element, with accessible keyboard interaction as\n * recommended by w3.org/WAI/ARIA/apg/patterns/accordion\n */\n\n// toggles data-accordion-expanded attribute on the accordion header <h3> wrapper to\n// align with button.c-accordion-ui__trigger[aria-expanded] value\nconst addAccordionToggleObserver = (btn: Element): void =>\n  new MutationObserver(mutations => {\n    mutations.forEach(({ oldValue, target }): void => {\n      const newValue = (target as HTMLElement).getAttribute(\"aria-expanded\");\n      if (newValue === oldValue) return;\n      const wrapperEl = target.parentElement!;\n      if (\n        wrapperEl.getAttribute(\"data-accordion-expanded\") === \"true\" &&\n        newValue === \"false\"\n      ) {\n        wrapperEl.setAttribute(\"data-accordion-expanded\", \"false\");\n      } else if (newValue === \"true\") {\n        wrapperEl.setAttribute(\"data-accordion-expanded\", \"true\");\n      }\n    });\n  }).observe(btn, {\n    attributes: true,\n    attributeOldValue: true,\n    attributeFilter: [\"aria-expanded\"]\n  });\n\nexport default function setupAccordion(rootElement: HTMLElement): void {\n  rootElement.querySelectorAll(\"[data-accordion]\").forEach(accordion => {\n    const accordionHeaders = accordion.querySelectorAll<HTMLButtonElement>(\n      \"h3 > button\"\n    );\n\n    function toggleItem(this: HTMLButtonElement): void {\n      const isOpen = this.getAttribute(\"aria-expanded\") === \"true\";\n      accordionHeaders.forEach(btn => {\n        btn.setAttribute(\n          \"aria-expanded\",\n          btn === this ? (!isOpen).toString() : \"false\"\n        );\n      });\n    }\n\n    accordionHeaders.forEach((btn, btnIndex, btnList) => {\n      function toggleItemWithKeyboard(\n        this: HTMLButtonElement,\n        event: KeyboardEvent\n      ): void {\n        switch (event.code) {\n          case \"Space\":\n            toggleItem.call(this); // same as click or Enter\n            break;\n          case \"ArrowDown\":\n            if (btnIndex < btnList.length - 1) {\n              btnList[btnIndex + 1].focus(); // move to next accordion header\n            }\n            break;\n          case \"ArrowUp\":\n            if (btnIndex > 0) {\n              btnList[btnIndex - 1].focus(); // move to prior accordion header\n            }\n            break;\n          default:\n            return;\n        }\n        // Cancel the default action to avoid it being handled twice\n        event.preventDefault();\n      }\n\n      btn.addEventListener(\"click\", toggleItem, false);\n      btn.addEventListener(\"keyup\", toggleItemWithKeyboard, false);\n      addAccordionToggleObserver(btn); // respond to aria-expanded change\n    });\n  });\n}\n\nexport function accordionInit(): void {\n  document.addEventListener(\"turbolinks:load\", () => {\n    setupAccordion(document.documentElement);\n  });\n}\n","import { omit } from \"lodash\";\nimport { OnSubmitParams } from \"@algolia/autocomplete-core\";\nimport { OnStateChangeProps } from \"@algolia/autocomplete-js\";\nimport {\n  ContentItem,\n  Item,\n  LocationItem,\n  PopularItem,\n  RouteItem,\n  StopItem\n} from \"./__autocomplete\";\nimport { isLGDown } from \"../../helpers/media-breakpoints\";\n\nexport function isStopItem(x: Item): x is StopItem {\n  return Object.keys(x).includes(\"stop\");\n}\n\nexport function isRouteItem(x: Item): x is RouteItem {\n  return Object.keys(x).includes(\"route\");\n}\n\nexport function isContentItem(x: Item): x is ContentItem {\n  return Object.keys(x).includes(\"_content_type\");\n}\n\nexport const getTitleAttribute = (item: Item): string[] => {\n  if (isStopItem(item)) {\n    return [\"stop\", \"name\"];\n  }\n  if (isRouteItem(item)) {\n    return [\"route\", \"name\"];\n  }\n\n  // @ts-ignore\n  // eslint-disable-next-line no-underscore-dangle\n  return Object.keys(item._highlightResult);\n};\n\nconst navStateChange: (props: OnStateChangeProps<Item>) => void = ({\n  state\n}) => {\n  // grey out the page and disable scrolling when search is open\n  if (isLGDown()) {\n    if (state.isOpen) {\n      document.documentElement.dataset.navOpen = \"true\";\n    } else {\n      delete document.documentElement.dataset.navOpen;\n    }\n  }\n};\n\nexport const STATE_CHANGE_HANDLERS: Record<\n  string,\n  (props: OnStateChangeProps<Item>) => void\n> = {\n  nav: navStateChange\n};\n\nexport const SUBMIT_HANDLERS: Record<\n  string,\n  (props: OnSubmitParams<Item>) => void\n> = {\n  to_search_page({ state }) {\n    window.Turbolinks.visit(`/search?query=${state.query}`);\n  }\n};\n\nexport type WithUrls<T> = T & { urls: Record<string, string> };\n\n// The backend returns all possible URLs, use urlType to get the desired one\nexport const itemWithUrl = (\n  initialItem: WithUrls<LocationItem | PopularItem>,\n  urlType: string\n): Omit<typeof initialItem, \"urls\"> => {\n  const item = omit(initialItem, \"urls\");\n  item.url = initialItem.urls[urlType];\n  return item;\n};\n","import {\n  AutocompleteApi,\n  AutocompleteOptions,\n  autocomplete\n} from \"@algolia/autocomplete-js\";\nimport { createElement, Fragment } from \"react\";\nimport { render } from \"react-dom\";\nimport { Item } from \"./__autocomplete\";\nimport { STATE_CHANGE_HANDLERS, SUBMIT_HANDLERS } from \"./helpers\";\nimport getPlugins from \"./plugins\";\nimport { parseQuery } from \"../../helpers/query\";\n\n// replace the default Preact-based renderer used by AutocompleteJS\nconst reactRenderer = {\n  createElement,\n  Fragment,\n  render\n} as AutocompleteOptions<Item>[\"renderer\"];\n\n// Listens to the veil click to close the autocomplete suggestions\nfunction setupVeilCloseListener(autocompleteApi: AutocompleteApi<Item>): void {\n  document\n    .querySelector(\"[data-nav='veil']\")\n    ?.addEventListener(\"click\", () => autocompleteApi.setIsOpen(false));\n}\n\nfunction getLikelyQueryParams(): string | undefined {\n  const searchParams = parseQuery(\n    window.location.search,\n    window.decodeURIComponent\n  );\n  return searchParams.query || searchParams.name || searchParams.address;\n}\n\n/**\n * Creates the Algolia Autocomplete instances for various search experiences on\n * MBTA.com.\n */\nfunction setupAlgoliaAutocomplete(wrapper: HTMLElement): void {\n  const container = wrapper.querySelector<HTMLElement>(\n    \".c-search-bar__autocomplete\"\n  );\n  const panelContainer = wrapper.querySelector<HTMLElement>(\n    \".c-search-bar__autocomplete-results\"\n  );\n  if (!container || !panelContainer) throw new Error(\"container needed\");\n  const options: AutocompleteOptions<Item> = {\n    id: container.id,\n    container,\n    panelContainer,\n    detachedMediaQuery: \"none\",\n    classNames: {\n      input: \"c-form__input-container\"\n    },\n    initialState: {\n      query:\n        container.dataset.initialState === \"\"\n          ? getLikelyQueryParams()\n          : undefined\n    },\n    openOnFocus: true,\n    onStateChange:\n      STATE_CHANGE_HANDLERS[`${container.dataset.stateChangeListener}`],\n    onSubmit: SUBMIT_HANDLERS[`${container.dataset.submitHandler}`],\n    placeholder: container.dataset.placeholder,\n    plugins: getPlugins(container.dataset),\n    renderer: reactRenderer\n  };\n  setupVeilCloseListener(autocomplete(options));\n}\n\nexport default setupAlgoliaAutocomplete;\n","import { AutocompletePlugin } from \"@algolia/autocomplete-js\";\nimport { Item } from \"./__autocomplete\";\nimport { debouncePromise } from \"../../helpers/debounce\";\nimport createLocationsPlugin from \"./plugins/locations\";\nimport createAlgoliaBackendPlugin from \"./plugins/algolia\";\nimport createGeolocationPlugin from \"./plugins/geolocation\";\nimport createPopularLocationsPlugin from \"./plugins/popular\";\n\nexport type AutocompleteJSPlugin = Partial<AutocompletePlugin<Item, {}>>;\n\n// prevent search from firing too frequently\nexport const debounced = debouncePromise(\n  (items: Item[]) => Promise.resolve<Item[]>(items),\n  300\n);\n\nexport default function getPlugins(\n  dataset: DOMStringMap\n): AutocompleteJSPlugin[] {\n  const plugins = [];\n  const {\n    geolocation,\n    popularLocations,\n    locationsCount,\n    locationsUrlType,\n    algolia\n  } = dataset;\n  if (geolocation !== undefined) {\n    plugins.push(createGeolocationPlugin(locationsUrlType));\n  }\n  if (locationsCount !== undefined) {\n    const numberOfLocations = parseInt(locationsCount, 10) || 3;\n    plugins.push(createLocationsPlugin(numberOfLocations, locationsUrlType));\n  }\n  if (popularLocations !== undefined) {\n    plugins.push(createPopularLocationsPlugin(locationsUrlType));\n  }\n  const algoliaIndexes = algolia ? algolia.split(\",\") : [];\n  if (algoliaIndexes.length) {\n    plugins.unshift(createAlgoliaBackendPlugin(algoliaIndexes));\n  }\n  return plugins;\n}\n","import { SearchResponse } from \"@algolia/client-search\";\nimport { AutocompleteJSPlugin, debounced } from \"../plugins\";\nimport AlgoliaItemTemplate from \"../templates/algolia\";\nimport { AutocompleteItem } from \"../__autocomplete\";\n\n/**\n * Generates a plugin for Algolia Autocomplete which enables searching for our\n * Algolia-backed items given a user-input string. This currently includes GTFS\n * stops, GTFS routes, and content from the CMS. Results from all indexes are\n * fetched together, and rendered with rich iconography associated with the\n * retrieved data types, with matching text depicted in bold. Links navigate to\n * the source URL for the selected data type.\n */\nexport default function createAlgoliaBackendPlugin(\n  algoliaIndexes: string[]\n): AutocompleteJSPlugin {\n  return {\n    getSources({ query }) {\n      if (query) {\n        return [\n          {\n            sourceId: \"algolia\",\n            templates: {\n              item: AlgoliaItemTemplate\n            },\n            getItems() {\n              return debounced(\n                fetch(\"/search/query\", {\n                  method: \"POST\",\n                  headers: {\n                    \"Content-Type\": \"application/json\"\n                  },\n                  body: JSON.stringify({ algoliaQuery: query, algoliaIndexes })\n                })\n                  .then(res => res.json())\n                  .then(resp =>\n                    (resp.results as SearchResponse[]).flatMap(\n                      ({ hits, index }) =>\n                        hits.map(hit => ({ ...hit, index } as AutocompleteItem))\n                    )\n                  ),\n                300\n              );\n            }\n          }\n        ];\n      }\n      return [];\n    }\n  };\n}\n","import { LocationItem } from \"../__autocomplete\";\nimport { AutocompleteJSPlugin } from \"../plugins\";\nimport getGeolocationTemplate from \"../templates/geolocation\";\n\n/**\n * Generates a plugin for Algolia Autocomplete which enables geolocation. This\n * displays a prompt on search input focus to enable geolocation, executes the\n * geolocation, and on selection navigates to a URL.\n */\nexport default function createGeolocationPlugin(\n  urlType: string = \"transit-near-me\"\n): AutocompleteJSPlugin {\n  return {\n    getSources({ query, setIsOpen }) {\n      if (!query) {\n        return [\n          {\n            sourceId: \"geolocation\",\n            templates: {\n              item: getGeolocationTemplate(setIsOpen, urlType)\n            },\n            getItems() {\n              // a hack to make the template appear, no backend is queried in this case\n              return [{} as LocationItem];\n            }\n          }\n        ];\n      }\n      return [];\n    }\n  };\n}\n","import { fetchJsonOrThrow } from \"../../../helpers/fetch-json\";\nimport { LocationItem } from \"../__autocomplete\";\nimport { WithUrls, itemWithUrl } from \"../helpers\";\nimport { AutocompleteJSPlugin, debounced } from \"../plugins\";\nimport LocationItemTemplate from \"../templates/location\";\n\n/**\n * Generates a plugin for Algolia Autocomplete which enables searching for a\n * specified number geographic locations given a user-input string. Results are\n * rendered with a location 'pin' icon, with matching text depicted in bold. On\n * selection, navigates to a URL.\n */\nexport default function createLocationsPlugin(\n  numResults: number,\n  urlType: string = \"transit_near_me\"\n): AutocompleteJSPlugin {\n  return {\n    getSources({ query }) {\n      if (query) {\n        return debounced([\n          {\n            sourceId: \"locations\",\n            templates: {\n              item: LocationItemTemplate\n            },\n            async getItems() {\n              const { result: locations } = await fetchJsonOrThrow<{\n                result: WithUrls<LocationItem>[];\n              }>(`/places/search/${encodeURIComponent(query)}/${numResults}`);\n              return locations.map(location => itemWithUrl(location, urlType));\n            }\n          }\n        ]);\n      }\n      return [];\n    }\n  };\n}\n","import { fetchJsonOrThrow } from \"../../../helpers/fetch-json\";\nimport { PopularItem } from \"../__autocomplete\";\nimport { WithUrls, itemWithUrl } from \"../helpers\";\nimport { AutocompleteJSPlugin, debounced } from \"../plugins\";\nimport PopularItemTemplate from \"../templates/popular\";\n\n/**\n * Generates a plugin for Algolia Autocomplete which displays a list of popular\n * locations on search input focus, and on selection navigates to a URL.\n */\nexport default function createPopularLocationsPlugin(\n  urlType: string = \"transit-near-me\"\n): AutocompleteJSPlugin {\n  return {\n    getSources({ query }) {\n      if (!query) {\n        return debounced([\n          {\n            sourceId: \"popular\",\n            templates: {\n              item: PopularItemTemplate\n            },\n            async getItems() {\n              const { result: locations } = await fetchJsonOrThrow<{\n                result: WithUrls<PopularItem>[];\n              }>(\"/places/popular\");\n              return locations.map(location => itemWithUrl(location, urlType));\n            }\n          }\n        ]);\n      }\n      return [];\n    }\n  };\n}\n","/* eslint-disable no-underscore-dangle */\nimport React from \"react\";\nimport { get, uniqueId } from \"lodash\";\nimport { SourceTemplates } from \"@algolia/autocomplete-js\";\nimport { AutocompleteItem, Item } from \"../__autocomplete\";\nimport {\n  getTitleAttribute,\n  isContentItem,\n  isRouteItem,\n  isStopItem\n} from \"../helpers\";\nimport {\n  contentIcon,\n  getFeatureIcons,\n  getIcon\n} from \"../../../../js/algolia-result\";\n\ninterface LinkForItemProps {\n  item: AutocompleteItem;\n  query: string;\n  children: React.ReactElement;\n}\nexport function LinkForItem(props: LinkForItemProps): React.ReactElement {\n  const { item, query, children } = props;\n  const url = isContentItem(item) ? item._content_url : item.url;\n\n  // Special case: When the matching text isn't part of the page title, help the\n  // user locate the matching text by linking directly to / scrolling to the\n  // matching text on the page.\n  const highlightedResult = get(item._highlightResult, getTitleAttribute(item));\n  if (\n    isContentItem(item) &&\n    highlightedResult &&\n    highlightedResult.matchedWords.length === 0\n  ) {\n    // link directly to queried text via URL fragment text directive, supported\n    // in most browsers, ignored by the others. works with Turbolinks disabled.\n    const urlToQuery = `${url}#:~:text=${encodeURIComponent(query)}`;\n    return (\n      <a href={urlToQuery} className=\"aa-ItemLink\" data-turbolinks=\"false\">\n        {children}\n      </a>\n    );\n  }\n\n  return (\n    <a href={url} className=\"aa-ItemLink\">\n      {children}\n    </a>\n  );\n}\n\nconst AlgoliaItemTemplate: SourceTemplates<Item>[\"item\"] = ({\n  item,\n  state,\n  components\n}) => {\n  const { index } = item as AutocompleteItem;\n  const attribute = getTitleAttribute(item);\n  const featureIcons = getFeatureIcons(item, index);\n  const iconHtml = isContentItem(item)\n    ? contentIcon(item)\n    : getIcon(item, index);\n  return (\n    <LinkForItem item={item as AutocompleteItem} query={state.query}>\n      <div className=\"aa-ItemContent\">\n        <span\n          // eslint-disable-next-line react/no-danger\n          dangerouslySetInnerHTML={{\n            __html: iconHtml\n          }}\n        />\n        {!isContentItem(item) &&\n          featureIcons.map((feature: string) => (\n            <span\n              key={uniqueId()}\n              className=\"c-search-result__feature-icons\"\n              // eslint-disable-next-line react/no-danger\n              dangerouslySetInnerHTML={{ __html: feature }}\n            />\n          ))}\n        <span className=\"aa-ItemContentBody\">\n          <span className=\"aa-ItemContentTitle\">\n            <span className={isStopItem(item) ? \"notranslate\" : undefined}>\n              {components.Highlight({\n                hit: item,\n                attribute\n              })}\n            </span>\n            &nbsp;\n            {isRouteItem(item) && item.route.type === 3 && (\n              <span className=\"c-search-result__long-name notranslate\">\n                {components.Highlight({\n                  hit: item,\n                  attribute: [\"route\", \"long_name\"]\n                })}\n              </span>\n            )}\n          </span>\n        </span>\n      </div>\n    </LinkForItem>\n  );\n};\n\nexport default AlgoliaItemTemplate;\n","import React, { useState } from \"react\";\nimport { StateUpdater } from \"@algolia/autocomplete-core\";\nimport { SourceTemplates } from \"@algolia/autocomplete-js\";\nimport { pick } from \"lodash\";\nimport geolocationPromise from \"../../../../js/geolocation-promise\";\nimport { Item } from \"../__autocomplete\";\nimport { fetchJsonOrThrow } from \"../../../helpers/fetch-json\";\nimport { WithUrls } from \"../helpers\";\n\nconst goToPositionURL = async (\n  position: GeolocationPosition,\n  urlType: string = \"transit-near-me\"\n): Promise<void> => {\n  const latlon = pick(position.coords, [\"latitude\", \"longitude\"]);\n  // @ts-ignore\n  const params = new URLSearchParams(latlon);\n  const { result } = await fetchJsonOrThrow<{\n    result: WithUrls<typeof latlon>;\n  }>(`/places/urls?${params.toString()}`);\n  const url = result.urls[urlType];\n  if (url) window.Turbolinks.visit(url);\n};\n\nfunction GeolocationComponent(props: {\n  urlType: string;\n  setIsOpen: StateUpdater<boolean>;\n}): React.ReactElement {\n  const { setIsOpen, urlType } = props;\n  const [loading, setLoading] = useState<string>();\n  const [hasError, setHasError] = useState(false);\n\n  if (loading) {\n    return (\n      <div style={{ textAlign: \"center\" }}>\n        {loading} <i aria-hidden=\"true\" className=\"fa fa-cog fa-spin\" />\n      </div>\n    );\n  }\n\n  if (hasError) {\n    return (\n      <div className=\"u-error\">\n        {`${window.location.host} needs permission to use your location. Please update your browser's settings or refresh the page and try again.`}\n      </div>\n    );\n  }\n\n  return (\n    <button\n      id=\"search-bar__my-location\"\n      className=\"c-search-bar__my-location\"\n      type=\"button\"\n      onClick={event => {\n        event.stopPropagation();\n        setIsOpen(true);\n        setLoading(\"Getting your location...\");\n        geolocationPromise()\n          .then(position => {\n            setLoading(\"Redirecting...\");\n            goToPositionURL(position, urlType);\n            setTimeout(() => {\n              setLoading(undefined);\n              setHasError(false);\n              setIsOpen(false);\n            }, 3000);\n          })\n          .catch(() => {\n            setHasError(true);\n            setLoading(undefined);\n          });\n      }}\n    >\n      <span>\n        <span\n          className=\"c-search-result__content-icon fa fa-location-arrow\"\n          aria-hidden=\"true\"\n        />\n      </span>\n      <span className=\"aa-ItemContentTitle\">\n        Use my location{\" \"}\n        {urlType === \"transit-near-me\" && \"to find transit near me\"}\n      </span>\n    </button>\n  );\n}\n\nconst getGeolocationTemplate = (\n  setIsOpen: StateUpdater<boolean>,\n  urlType: string\n): SourceTemplates<Item>[\"item\"] =>\n  function GeolocationTemplate() {\n    return <GeolocationComponent setIsOpen={setIsOpen} urlType={urlType} />;\n  };\n\nexport default getGeolocationTemplate;\n","import React from \"react\";\nimport { SourceTemplates } from \"@algolia/autocomplete-js\";\nimport { LocationItem } from \"../__autocomplete\";\nimport { highlightText } from \"../../../helpers/text\";\n\nexport const LocationItemTemplate: SourceTemplates<LocationItem>[\"item\"] = ({\n  item\n}) => {\n  const { address, highlighted_spans } = item;\n  return (\n    <a href={item.url} data-turbolinks=\"false\">\n      <span\n        aria-hidden=\"true\"\n        className=\"c-search-result__content-icon fa fa-map-marker\"\n      />\n      <span\n        className=\"aa-ItemContentTitle\"\n        // eslint-disable-next-line react/no-danger\n        dangerouslySetInnerHTML={{\n          __html: highlightText(address, highlighted_spans)\n        }}\n      />\n    </a>\n  );\n};\n\nexport default LocationItemTemplate;\n","import { uniqueId } from \"lodash\";\nimport React from \"react\";\nimport { SourceTemplates } from \"@algolia/autocomplete-js\";\nimport { PopularItem } from \"../__autocomplete\";\nimport { getFeatureIcons, getPopularIcon } from \"../../../../js/algolia-result\";\n\nconst PopularItemTemplate: SourceTemplates<PopularItem>[\"item\"] = ({\n  item\n}) => {\n  const iconHtml = getPopularIcon(item.icon);\n  const featureIcons = getFeatureIcons(item, \"popular\");\n  return (\n    <a href={item.url} className=\"aa-ItemLink\" data-turbolinks=\"false\">\n      <div className=\"aa-ItemContent\">\n        <span\n          // eslint-disable-next-line react/no-danger\n          dangerouslySetInnerHTML={{\n            __html: iconHtml\n          }}\n        />\n        {featureIcons.map((feature: string) => (\n          <span\n            key={uniqueId()}\n            className=\"c-search-result__feature-icons\"\n            // eslint-disable-next-line react/no-danger\n            dangerouslySetInnerHTML={{ __html: feature }}\n          />\n        ))}\n        <span className=\"aa-ItemContentBody\">\n          <span className=\"aa-ItemContentTitle notranslate\">{item.name}</span>\n        </span>\n      </div>\n    </a>\n  );\n};\n\nexport default PopularItemTemplate;\n","import hogan from \"hogan.js\";\nimport _ from \"lodash\";\nimport * as Icons from \"./icons\";\nimport { highlightText } from \"../ts/helpers/text.ts\";\n\n/* eslint-disable no-underscore-dangle */\n\nexport const SELECTORS = {\n  result: \"js-search-result\"\n};\n\nexport const TEMPLATES = {\n  fontAwesomeIcon: hogan.compile(\n    `<span aria-hidden=\"true\" class=\"c-search-result__content-icon fa {{icon}}\"></span>`\n  ),\n  formattedDate: hogan.compile(\n    `<span class=\"c-search-result__event-date\">{{date}}</span>`\n  ),\n  locations: hogan.compile(`\n    <a id=\"hit-{{id}}\" class=\"c-search-result__link u-no-underline\" url={{hitUrl}}>\n      <span>{{{hitIcon}}}</span>\n      <span class=\"c-search-result__hit-name notranslate\">{{{hitTitle}}}</span>\n    </a>\n  `),\n  usemylocation: hogan.compile(`\n    <a id=\"search-bar__my-location\" class=\"c-search-bar__my-location\">\n      <i aria-hidden=\"true\" class=\"fa fa-location-arrow \"></i>\n      Use my location\n      <i aria-hidden=\"true\" id=\"search-result__loading-indicator\" class=\"fa fa-cog fa-spin c-search-result__loading-indicator\"></i>\n    </a>\n  `),\n  threePlusIcons: hogan.compile(`\n    {{#hasDate}}\n    <div class=\"c-search-result__hit--vertical\">\n    {{/hasDate}}\n    {{#id}}\n    <a id=\"hit-{{id}}\" class=\"${SELECTORS.result} c-search-result__link\" href=\"{{hitUrl}}\">\n    {{/id}}\n    {{^id}}\n    <a class=\"${SELECTORS.result} c-search-result__link u-no-underline\" href=\"{{hitUrl}}\" data-queryid=\"{{analyticsData.queryID}}\" data-hit-position=\"{{analyticsData.position}}\" data-objectid=\"{{analyticsData.objectID}}\">\n    {{/id}}\n      <span>{{{hitIcon}}}</span>\n      <span class=\"c-search-result__feature-icons\">\n      {{#hitFeatureIcons}}\n        {{{.}}}\n      {{/hitFeatureIcons}}\n      <br/>\n    </span>\n      <span class=\"c-search-result__hit-name notranslate\">{{{hitTitle}}}</span>\n    </a>\n    {{#hasDate}}\n    </div>\n    {{/hasDate}}\n  `),\n  default: hogan.compile(`\n    {{#hasDate}}\n    <div class=\"c-search-result__hit--vertical\">\n    {{/hasDate}}\n    {{#id}}\n    <a id=\"hit-{{id}}\" class=\"${SELECTORS.result} c-search-result__link\" href=\"{{hitUrl}}\">\n    {{/id}}\n    {{^id}}\n    <a class=\"${SELECTORS.result} c-search-result__link u-no-underline\" href=\"{{hitUrl}}\" data-queryid=\"{{analyticsData.queryID}}\" data-hit-position=\"{{analyticsData.position}}\" data-objectid=\"{{analyticsData.objectID}}\">\n    {{/id}}\n      <span>{{{hitIcon}}}</span>\n      <span class=\"c-search-result__feature-icons\">\n      {{#hitFeatureIcons}}\n        {{{.}}}\n      {{/hitFeatureIcons}}\n    </span>\n      <span class=\"c-search-result__hit-name notranslate\">{{{hitTitle}}}</span>\n    </a>\n    {{#hasDate}}\n    </div>\n    {{/hasDate}}\n  `)\n};\n\nexport const TEMPLATES_ALT_USE_MY_LOCATION = {\n  ...TEMPLATES,\n  usemylocation: hogan.compile(`\n    <a id=\"search-bar__my-location\" class=\"c-search-bar__my-location\">\n      <i aria-hidden=\"true\" class=\"fa fa-location-arrow \"></i>\n      Use my location to find transit near me\n      <i aria-hidden=\"true\" id=\"search-result__loading-indicator\" class=\"fa fa-cog fa-spin c-search-result__loading-indicator\"></i>\n    </a>\n  `)\n};\n\nfunction iconsFromGTFSAncestries(ancestries) {\n  return ancestries\n    .map(anc => anc.toLowerCase())\n    .filter(anc => anc !== \"subway\")\n    .map(anc => Icons.getFeatureIcon(anc));\n}\n\nfunction iconsFromGTFSAncestry(ancestry) {\n  if (Array.isArray(ancestry)) {\n    return iconsFromGTFSAncestries(ancestry);\n  }\n  return iconsFromGTFSAncestries([ancestry]);\n}\n\nfunction _subwayRouteIcon(routeId) {\n  if (routeId.includes(\"Green-\")) {\n    return routeId.toLowerCase().replace(\"-\", \"_line_\");\n  }\n\n  const mapper = {\n    Green: \"green_line\",\n    Red: \"red_line\",\n    Orange: \"orange_line\",\n    Blue: \"blue_line\",\n    Mattapan: \"mattapan_line\"\n  };\n\n  return mapper[routeId];\n}\n\nfunction iconFromGTFSId(id) {\n  const toSubway = _subwayRouteIcon(id);\n  if (toSubway) {\n    return Icons.getFeatureIcon(toSubway);\n  }\n  if (id in [\"commuter_rail\", \"bus\", \"ferry\", \"silver_line\"]) {\n    return Icons.getFeatureIcon(id);\n  }\n  if (id.includes(\"CR-\")) {\n    return Icons.getFeatureIcon(\"commuter_rail\");\n  }\n  return Icons.getFeatureIcon(id);\n}\n\nfunction iconsFromGTFSIds(id) {\n  if (Array.isArray(id)) {\n    return id.map(icon => iconFromGTFSId(icon));\n  }\n  return [iconFromGTFSId(id)];\n}\n\nexport function iconFromGTFS(id, ancestry) {\n  if (!id) {\n    return TEMPLATES.fontAwesomeIcon.render({ icon: \"fa-info\" });\n  }\n  let icons = iconsFromGTFSIds(id);\n  if (ancestry) {\n    icons = icons.concat(iconsFromGTFSAncestry(ancestry));\n  }\n  return icons;\n}\n\nfunction _fileIcon(hit) {\n  switch (hit._file_type) {\n    case \"application/pdf\":\n      return \"fa-file-pdf-o\";\n\n    case \"application/vnd.openxmlformats-officedocument.presentationml.presentation\":\n    case \"application/vnd.ms-powerpoint\":\n      return \"fa-file-powerpoint-o\";\n\n    case \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\":\n    case \"application/vnd.ms-excel\":\n      return \"fa-file-excel-o\";\n\n    case \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\":\n    case \"application/msword\":\n      return \"fa-file-word-o\";\n\n    default:\n      return \"fa-file-o\";\n  }\n}\n\nexport function contentIcon(hit) {\n  let icon;\n\n  if (hit.search_api_datasource === \"entity:file\") {\n    icon = _fileIcon(hit);\n  } else {\n    const iconMapper = {\n      search_result: \"fa-info\",\n      news_entry: \"fa-newspaper-o\",\n      event: \"fa-calendar\",\n      project: \"fa-wrench\",\n      project_update: \"fa-wrench\",\n      page: \"fa-info\",\n      landing_page: \"fa-info\",\n      person: \"fa-user\",\n      locations: \"fa-map-marker\"\n    };\n    icon = iconMapper[hit._content_type] || \"fa-info\";\n  }\n\n  return TEMPLATES.fontAwesomeIcon.render({ icon });\n}\n\nfunction _getStopOrStationIcon(hit) {\n  if (hit.stop[\"station?\"]) {\n    return Icons.getFeatureIcon(\"station\");\n  }\n  return Icons.getFeatureIcon(\"stop\");\n}\n\nfunction _iconFromRoute(route) {\n  switch (route.type) {\n    case 2:\n      return \"commuter_rail\";\n\n    case 3:\n      if (route.name.startsWith(\"SL\")) {\n        return \"silver_line\";\n      }\n      return \"bus\";\n\n    case 4:\n      return \"ferry\";\n\n    default:\n      return _subwayRouteIcon(route.id);\n  }\n}\n\nexport function getPopularIcon(icon) {\n  switch (icon) {\n    case \"airplane\":\n      return TEMPLATES.fontAwesomeIcon.render({ icon: \"fa-plane\" });\n    default:\n      return Icons.getFeatureIcon(icon);\n  }\n}\n\nexport function getIcon(hit, type) {\n  switch (type) {\n    case \"locations\":\n      return contentIcon({ ...hit, _content_type: \"locations\" });\n    case \"stops\":\n      return _getStopOrStationIcon(hit);\n\n    case \"routes\":\n      return Icons.getFeatureIcon(_iconFromRoute(hit.route));\n\n    case \"popular\":\n      return getPopularIcon(hit.icon);\n\n    case \"projects\":\n      // eslint-disable-next-line no-use-before-define\n      return getTransitIcons(hit);\n\n    case \"drupal\":\n    case \"pages\":\n    case \"documents\":\n    case \"events\":\n    case \"news\":\n      return contentIcon(hit);\n\n    case \"usemylocation\":\n      return \"\";\n\n    default:\n      return \"\";\n  }\n}\n\nfunction getTransitIcons(hit) {\n  if (\n    hit.related_transit_gtfs_id === null &&\n    hit.related_transit_gtfs_ancestry == null\n  ) {\n    return \"\";\n  }\n  const icons = iconFromGTFS(\n    hit.related_transit_gtfs_id,\n    hit.related_transit_gtfs_ancestry\n  );\n  if (Array.isArray(icons)) {\n    const uniqueIcons = _.uniq(icons);\n    return uniqueIcons.join(\" \");\n  }\n  return icons;\n}\n\nfunction _contentUrl(hit) {\n  if (hit.search_api_datasource === \"entity:file\") {\n    return `/sites/default/files/${hit._file_uri.replace(/public:\\/\\//, \"\")}`;\n  }\n  if (hit._content_type === \"search_result\") {\n    return hit._search_result_url.replace(/internal:/, \"\");\n  }\n  return hit._content_url;\n}\n\nexport function getUrl(hit, index) {\n  switch (index) {\n    case \"stops\":\n      return `/stops/${hit.stop.id}`;\n\n    case \"routes\":\n      return `/schedules/${hit.route.id}`;\n\n    case \"popular\":\n      return hit.url;\n\n    case \"drupal\":\n    case \"projects\":\n    case \"pages\":\n    case \"documents\":\n    case \"events\":\n    case \"news\":\n      return _contentUrl(hit);\n\n    case \"locations\":\n      return \"\";\n    case \"usemylocation\":\n      return \"#\";\n\n    default:\n      return \"#\";\n  }\n}\n\nfunction getRouteTitle(hit) {\n  const name = hit._highlightResult.route.name.value;\n  switch (hit.route.type) {\n    case 3:\n      return `${name} <span class=\"c-search-result__long-name\">${hit._highlightResult.route.long_name.value}</span>`;\n    default:\n      return name;\n  }\n}\n\nfunction _contentTitle(hit) {\n  if (hit._content_type === \"search_result\") {\n    return hit._highlightResult.search_result_title.value;\n  }\n  if (hit.search_api_datasource === \"entity:file\") {\n    return hit._highlightResult.file_name_raw.value;\n  }\n  return hit._highlightResult.content_title.value;\n}\n\nexport function getTitle(hit, type) {\n  switch (type) {\n    case \"locations\":\n      // eslint-disable-next-line no-case-declarations\n      const { address: text, highlighted_spans: spans } = hit;\n\n      return highlightText(text, spans);\n    case \"stops\":\n      return hit._highlightResult.stop.name.value;\n\n    case \"routes\":\n      return getRouteTitle(hit);\n\n    case \"popular\":\n      return hit.name;\n\n    case \"drupal\":\n    case \"projects\":\n    case \"pages\":\n    case \"documents\":\n    case \"events\":\n    case \"news\":\n      return _contentTitle(hit);\n\n    case \"usemylocation\":\n      return \"\";\n\n    default:\n      return \"\";\n  }\n}\n\nfunction _stopsWithAlerts() {\n  const stopsWithAlertsDiv = document.getElementById(\"stops-with-alerts\");\n  if (!stopsWithAlertsDiv) return \"\";\n  const {\n    dataset: { stopsWithAlerts }\n  } = stopsWithAlertsDiv;\n  return stopsWithAlerts;\n}\n\nfunction _routesWithAlerts() {\n  const routesWithAlertsDiv = document.getElementById(\"routes-with-alerts\");\n  if (!routesWithAlertsDiv) return \"\";\n  const {\n    dataset: { routesWithAlerts }\n  } = routesWithAlertsDiv;\n  return routesWithAlerts;\n}\n\nfunction _getAlertIcon(hit, type) {\n  let hasAlert = false;\n  switch (type) {\n    case \"stops\":\n      hasAlert = _stopsWithAlerts().includes(hit.stop.id);\n      break;\n\n    case \"routes\":\n      hasAlert = _routesWithAlerts().includes(hit.route.id);\n      break;\n\n    default:\n      hasAlert = false;\n  }\n\n  return hasAlert ? [\"alert\"] : [];\n}\n\nfunction _standardizeFeatureName(feature) {\n  switch (feature) {\n    case \"Red\":\n    case \"Blue\":\n    case \"Orange\":\n    case \"Green\":\n    case \"Green-B\":\n    case \"Green-C\":\n    case \"Green-D\":\n    case \"Green-E\":\n    case \"Mattapan\":\n      return _subwayRouteIcon(feature);\n\n    default:\n      return feature;\n  }\n}\n\nfunction _featuresToIcons(features) {\n  return features.map(feature =>\n    Icons.getFeatureIcon(_standardizeFeatureName(feature))\n  );\n}\n\nfunction _sortFeatures(features) {\n  const featuresWithoutBranches = features.filter(\n    feature => !feature.includes(\"Green-\")\n  );\n  const branches = features.filter(feature => feature.includes(\"Green-\"));\n  if (branches.length > 0) {\n    const greenLinePosition = featuresWithoutBranches.findIndex(\n      feature => feature === \"green_line\"\n    );\n\n    featuresWithoutBranches.splice(greenLinePosition + 1, 0, ...branches);\n    return featuresWithoutBranches;\n  }\n  return features;\n}\n\nfunction _getCommuterRailZone(hit) {\n  if (hit.zone) {\n    return [`<span class=\"c-icon__cr-zone\">Zone ${hit.zone}</span>`];\n  }\n  return [];\n}\n\nfunction _stopIcons(hit, type) {\n  const filteredFeatures = hit.features.filter(\n    feature => feature !== \"access\" && feature !== \"parking_lot\"\n  );\n\n  const alertFeature = _getAlertIcon(hit, type);\n  const allFeatures = alertFeature.concat(filteredFeatures);\n  const allFeaturesSorted = _sortFeatures(allFeatures);\n  const allIcons = _featuresToIcons(allFeaturesSorted);\n\n  const zoneIcon = _getCommuterRailZone(hit);\n\n  return allIcons.concat(zoneIcon);\n}\n\nfunction _formatDate(date) {\n  const formattedDate = date.toLocaleDateString(\"en-US\", {\n    year: \"numeric\",\n    month: \"short\",\n    day: \"numeric\"\n  });\n  return TEMPLATES.formattedDate.render({ date: formattedDate });\n}\n\nfunction pagesdocumentsDate(hit) {\n  if (hit._file_created !== undefined) {\n    const date = new Date(hit._file_created * 1000);\n    return [_formatDate(date)];\n  }\n  return [];\n}\n\nfunction projectsDate(hit) {\n  if (hit._content_posted_on) {\n    const date = new Date(hit._content_posted_on * 1000);\n    return [_formatDate(date)];\n  }\n  return [];\n}\n\nfunction _contentDate(hit) {\n  const dateString = hit._content_url.split(\"/\")[2];\n  try {\n    const dateStringWithTime = `${dateString}T01:00:00`;\n    const date = new Date(dateStringWithTime);\n    return [_formatDate(date)];\n  } catch (err) {\n    return [];\n  }\n}\n\nexport function getFeatureIcons(hit, type) {\n  const alertFeature = _getAlertIcon(hit, type);\n  switch (type) {\n    case \"popular\":\n    case \"stops\":\n      return _stopIcons(hit, type);\n\n    case \"routes\":\n      return _featuresToIcons(alertFeature);\n\n    case \"projects\":\n      return projectsDate(hit);\n\n    case \"pages\":\n    case \"documents\":\n      return pagesdocumentsDate(hit);\n    case \"events\":\n    case \"news\":\n      return _contentDate(hit);\n\n    default:\n      return [];\n  }\n}\n\nexport function parseResult(hit, index) {\n  return Object.assign(hit, {\n    hitIcon: getIcon(hit, index),\n    hitUrl: getUrl(hit, index),\n    hitTitle: getTitle(hit, index),\n    hasDate:\n      index === \"events\" ||\n      index === \"news\" ||\n      index === \"pages\" ||\n      index === \"documents\" ||\n      index === \"projects\" ||\n      null,\n    hitFeatureIcons: getFeatureIcons(hit, index),\n    id: hit.id || null\n  });\n}\n\nexport function renderResult(hit, index, templates = TEMPLATES) {\n  const parsedResult = parseResult(hit, index);\n  if (parsedResult.hitFeatureIcons.length > 2) {\n    return TEMPLATES.threePlusIcons.render(parsedResult);\n  }\n  if (templates[index]) {\n    return templates[index].render(parsedResult);\n  }\n  return templates.default.render(parsedResult);\n}\n","const track = () => {\n  if (window.dataLayer) {\n    window.dataLayer.push({\n      event: \"pageView\"\n    });\n  }\n};\n\nexport default () => {\n  document.addEventListener(\"turbolinks:load\", track);\n};\n","const turbolinks = ($, w = window, doc = document) => {\n  var lastScrollPosition = null;\n  var scrollBehavior = null;\n  var redirectTimeout = null;\n  var navigationEventType = \"push\";\n  var currentUrl = getCurrentUrl();\n\n  w.addEventListener(\n    \"popstate\",\n    ev => {\n      navigationEventType = \"pop\";\n      var url = w.location.href;\n      if (redirectTimeout && !url.match(/redirect/)) {\n        w.clearTimeout(redirectTimeout);\n        redirectTimeout = null;\n      }\n      currentUrl = url;\n    },\n    { passive: true }\n  );\n\n  doc.addEventListener(\n    \"turbolinks:before-visit\",\n    ev => {\n      // cancel a previously set redirect timeout\n      if (redirectTimeout) {\n        w.clearTimeout(redirectTimeout);\n        redirectTimeout = null;\n      }\n\n      // for every visit, there is an active element. That active element probably doesn't say much about whether the\n      // page should scroll or not after it is loaded, so the default behaviour is to consider if the link is to the\n      // same page, and if it is, retain the same position. But if the active element indicated what scroll action to take\n      // then that preference should override the default behavior\n      lastScrollPosition = [w.scrollX, w.scrollY];\n      switch (\n        ev.srcElement.activeElement &&\n        ev.srcElement.activeElement.dataset &&\n        ev.srcElement.activeElement.dataset.scroll\n      ) {\n        // allow the page to scroll on focus, or not at all if there is no focus\n        case \"true\":\n          scrollBehavior = \"none\";\n          break;\n\n        // prevent any scrolling for any reason\n        case \"false\":\n          scrollBehavior = \"remember\";\n          break;\n\n        // decide remember the position if the current page and next page have the same path\n        // allow scroll if the new url is an anchor link on the same page\n        default:\n          if (samePathWithQueryString(ev.data.url, currentUrl)) {\n            scrollBehavior = \"remember\";\n          } else if (withAnchor(ev.data.url)) {\n            scrollBehavior = \"scroll\";\n          } else {\n            scrollBehavior = \"top\";\n          }\n      }\n    },\n    { passive: true }\n  );\n\n  doc.addEventListener(\n    \"turbolinks:render\",\n    () => {\n      // if it's cached render, not a real one, set the scroll/focus positions,\n      // but don't clear them until we have the true rendering.\n      const cachedRender =\n        doc.documentElement.getAttribute(\"data-turbolinks-preview\") === \"\";\n      if (!cachedRender && w.location.hash) {\n        const el = doc.getElementById(w.location.hash.slice(1));\n        if (el) {\n          focusAndExpand(el, $);\n        }\n      }\n\n      // scroll page depeneding on previously determined conditions\n      // only do this on pushes, if the user is going back in their history, let turbolinks restore the scroll position\n      if (navigationEventType == \"push\") {\n        switch (scrollBehavior) {\n          case \"remember\":\n            w.scrollTo.apply(window, lastScrollPosition);\n            break;\n\n          case \"top\":\n            w.scrollTo.apply(window, [0, 0]);\n        }\n      }\n\n      // reset history state to default\n      navigationEventType = \"push\";\n    },\n    { passive: true }\n  );\n\n  doc.addEventListener(\n    \"turbolinks:request-end\",\n    ev => {\n      // update the current url\n      currentUrl = getCurrentUrl();\n\n      // if a refresh header was receieved, enforce via javascript\n      var refreshHeader = ev.data.xhr.getResponseHeader(\"Refresh\");\n      if (!refreshHeader) {\n        return;\n      }\n\n      // parse data from the header\n      var refreshUrl = refreshHeader.substring(refreshHeader.indexOf(\"=\") + 1);\n      var refreshDelay = refreshHeader.split(\";\")[0] * 1000;\n\n      // redirect after 5 seconds\n      redirectTimeout = w.setTimeout(() => {\n        doc.location = refreshUrl;\n      }, refreshDelay);\n    },\n    { passive: true }\n  );\n};\n\nexport function samePathWithQueryString(first, second) {\n  return (\n    samePath(first, second, \"?\") &&\n    // Don't consider it the same path if we are switching tabs\n    !includesTabParam(first)\n  );\n}\n\nexport function samePathWithAnchor(first, second) {\n  return samePath(first, second, \"#\");\n}\n\nfunction samePath(first, second, suffix_char) {\n  return (\n    first.slice(0, second.length) === second &&\n    (first.length == second.length || first[second.length] === suffix_char)\n  );\n}\n\nfunction withAnchor(urlString) {\n  return urlString.includes(\"#\");\n}\n\nfunction includesTabParam(path) {\n  return path.split(\"?\").length >= 2 && path.split(\"?\")[1].includes(\"tab=\");\n}\n\nfunction getCurrentUrl() {\n  return `${window.location.protocol}//${window.location.host}${window.location.pathname}`;\n}\n\nfunction focusAndExpand(el, $) {\n  const nodeName = el.nodeName;\n  // if tabindex has been explicitly set, or if we're focusing a\n  // link, select, or input, then focus it directly. otherwise, find\n  // the first child link and focus that.\n  if (\n    el.getAttribute(\"tabindex\") === \"0\" ||\n    nodeName === \"A\" ||\n    nodeName === \"SELECT\" ||\n    nodeName === \"INPUT\"\n  ) {\n    el.focus();\n  } else {\n    const a = el.querySelector(\"a\");\n    if (a != null) {\n      a.focus();\n      // if the link we focused is the target for a collapse, then show\n      // the collapsed element\n      if (a.getAttribute(\"data-target\") == window.location.hash) {\n        $(el).collapse(\"show\");\n      }\n    }\n  }\n}\n\nexport default turbolinks;\n","/* eslint-disable */\nimport Filter from \"bad-words\";\nimport * as Sentry from \"@sentry/browser\";\n\n// Some FormData methods like .set or .get are not supported in IE:\n// (https://developer.mozilla.org/en-US/docs/Web/API/FormData#Browser_compatibility)\n// so we need to make use of a polyfill:\nimport FormData from \"formdata-polyfill\";\n\nexport default function($ = window.jQuery) {\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      // TODO: create a way to run page-specific JS so that this hack isn't needed.\n      if (!document.getElementById(\"support\")) {\n        return;\n      }\n\n      window.nextTick(() => {\n        clearFallbacks($);\n\n        const toUpload = [];\n        setupPhotoPreviews($, toUpload);\n        setupTextArea();\n        setupRequestResponse($);\n        setupSubject($);\n        setupValidation($);\n\n        handleSubmitClick($, toUpload);\n        handleModeChangeSelection($);\n        handleSubjectChange($);\n      });\n    },\n    { passive: true }\n  );\n}\n\nexport function handleModeChangeSelection($) {\n  const modeOptionsEl = document.getElementById(\"js-routes-by-mode\");\n  const modeOptions = JSON.parse(modeOptionsEl.innerHTML);\n\n  const vehicleLabels = {\n    bus: \"Bus\",\n    commuter_rail: \"Train\",\n    subway: \"Vehicle\",\n    ferry: \"Boat\"\n  };\n\n  // initially hide the choices for route and vehicle\n  $(\"#route-and-vehicle\").hide();\n\n  const modeSelect = document.getElementById(\"support_mode\");\n  modeSelect.addEventListener(\n    \"change\",\n    ev => {\n      // empty contents of the select first:\n      $(\"#support_route\").empty();\n\n      const routeSelect = document.getElementById(\"support_route\");\n\n      // Get the text property of the <option> selected\n      // and build key in order to access the 'modeOptions' object\n\n      // .selectedOptions is not supported by IE so a workaround is needed:\n      const selectedText = ev.target.selectedOptions\n        ? ev.target.selectedOptions[0].text\n        : ev.target.options[ev.target.selectedIndex].innerText;\n\n      const key = selectedText\n        .split(\" \")\n        .map(el => el.toLowerCase())\n        .join(\"_\");\n\n      const opts = modeOptions[`${key}_options`];\n\n      if (!!opts) {\n        $(\"#route-and-vehicle\").show();\n        // update label:\n        $(\"#vehicleLabel\").text(`${vehicleLabels[key]} number`);\n\n        // Create options for the select (prepending an extra one for 'Select'):\n        const option = document.createElement(\"option\");\n        option.text = \"Select\";\n        option.value = \" \";\n        routeSelect.appendChild(option);\n\n        opts.forEach(element => {\n          const opt = document.createElement(\"option\");\n          opt.text = element;\n          opt.value = element;\n          routeSelect.appendChild(opt);\n        });\n      } else {\n        $(\"#route-and-vehicle\").hide();\n      }\n    },\n    { passive: true }\n  );\n}\n\n// Set a few things since we know we don't need the no-JS fallbacks\nexport function clearFallbacks($) {\n  const $photoLink = $(\"#upload-photo-link\"),\n    $photoInput = $(\"#photo\");\n  // Remove tabindex manipulation for screenreaders\n  $photoLink.removeAttr(\"tabindex\");\n  // Forward clicks from the button to the input\n  $photoLink.click(function(event) {\n    event.preventDefault();\n    $photoInput.click();\n  });\n}\n\n// Adds the uploaded photo previews\nfunction setupPhotoPreviews($, toUpload) {\n  const $container = $(\".photo-preview-container\");\n  $(\"#photo\").change(function() {\n    for (const file of this.files) {\n      resizeAndHandleUploadedFile($, file, $container, toUpload);\n    }\n  });\n}\n\nconst resizeAndHandleUploadedFile = ($, file, $container, toUpload) => {\n  if (/image\\//.test(file.type)) {\n    resizeImage(file)\n      .then(newFile => {\n        newFile.name = file.name;\n        handleUploadedPhoto($, newFile, $container, toUpload);\n        $(\"#support-upload-error-container\").addClass(\"hidden-xs-up\");\n      })\n      .catch(err => {\n        displayError($, \"#upload\");\n        $(\"#upload-photo-error\").html(\n          \"Sorry. We had trouble uploading your image. Please try again.\"\n        );\n      });\n  } else {\n    displayError($, \"#upload\");\n    $(\"#upload-photo-error\").html(\n      \"We couldn't upload your file. Please make sure it's an image and try again.\"\n    );\n  }\n  $container.focus();\n};\n\n// Split out for testing, since the content of a file input can't be\n// changed programmatically for security reasons\nexport function handleUploadedPhoto($, file, $container, toUpload) {\n  toUpload.push(file);\n  hideOrShowPreviews($container, toUpload);\n\n  let preview = new PhotoPreview($, file)\n    .addClickHandler($container, toUpload)\n    .div();\n  $container.append(preview);\n}\n\nconst resizeImage = file =>\n  new Promise((resolve, reject) => {\n    const fr = new FileReader();\n    fr.onerror = () => {\n      fr.abort();\n      reject(new DOMException(\"Error parsing file.\"));\n    };\n    fr.onload = () => {\n      const img = new Image();\n      img.onload = () => {\n        const dim = rescale({ width: img.width, height: img.height });\n        const canvas = document.createElement(\"canvas\");\n        canvas.width = dim.width;\n        canvas.height = dim.height;\n        const ctx = canvas.getContext(\"2d\");\n        ctx.drawImage(img, 0, 0, dim.width, dim.height);\n        if (canvas.msToBlob) {\n          // Special for IE\n          resolve(canvas.msToBlob());\n        } else {\n          // Works for all other browsers\n          canvas.toBlob(blob => {\n            resolve(blob);\n          }, \"image/jpeg\");\n        }\n      };\n      img.src = fr.result;\n    };\n    fr.readAsDataURL(file);\n  });\n\nexport function rescale(dim) {\n  const maxDim = 1000;\n  if (dim.width <= maxDim && dim.height <= maxDim) {\n    return dim;\n  }\n  if (dim.width > dim.height) {\n    const ratio = dim.height / dim.width;\n    dim.width = maxDim;\n    dim.height = maxDim * ratio;\n  } else {\n    const ratio = dim.width / dim.height;\n    dim.height = maxDim;\n    dim.width = maxDim * ratio;\n  }\n  return dim;\n}\n\nfunction hideOrShowPreviews($container, toUpload) {\n  if (toUpload.length > 0) {\n    $container.removeClass(\"hidden-xs-up\");\n  } else {\n    $container.addClass(\"hidden-xs-up\");\n  }\n}\n\nfunction PhotoPreview($, file) {\n  const filesize = require(\"filesize\");\n\n  let $div = $(`\n    <div class=\"photo-preview\">\n      <div class=\"clear-upload-container\">\n        <img height=\"64\" class=\"m-r-1\" alt=\"Uploaded image ${file.name} preview\"></img>\n        <div class=\"clear-photo\">\n          <i class=\"fa fa-circle fa-stack-1x\" style=\"color: white\" aria-hidden=\"true\"></i>\n          <i class=\"fa fa-times-circle fa-stack-1x\" aria-hidden=\"true\"></i>\n          <span class=\"sr-only\">Clear Photo Upload</span>\n        </div>\n      </div>\n    </div>\n  `);\n\n  let reader = new FileReader();\n  reader.onloadend = () => {\n    $div.find(\"img\")[0].src = reader.result;\n  };\n  reader.readAsDataURL(file);\n\n  this.addClickHandler = function($container, toUpload) {\n    $div.find(\".clear-photo\").click(event => {\n      event.preventDefault();\n\n      let index = toUpload.indexOf(file);\n      toUpload.splice(index, 1);\n      $div.remove();\n\n      hideOrShowPreviews($container, toUpload);\n    });\n    return this;\n  };\n\n  this.div = function() {\n    return $div;\n  };\n}\n\nexport function setupTextArea() {\n  // Track the number of characters in the main <textarea>\n  const commentsNode = document.getElementById(\"comments\"),\n    formTextNode = findSiblingWithClass(commentsNode, \"form-text\");\n  commentsNode.addEventListener(\n    \"keyup\",\n    ev => {\n      // .textLength is not supported in IE\n      // (https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#Browser_compatibility)\n      const commentLength = commentsNode.value.length;\n      formTextNode.innerHTML = commentLength + \"/3000 characters\";\n      if (commentLength > 0) {\n        formTextNode.className += \" support-comment-success\";\n        formTextNode.parentNode.className += \" has-success\";\n      } else {\n        removeClass(formTextNode, \"support-comment-success\");\n        removeClass(formTextNode.parentNode, \"has-success\");\n      }\n    },\n    { passive: true }\n  );\n}\n\nexport function setupSubject($) {\n  const support_service_opts = JSON.parse(\n    document.getElementById(\"js-subjects-by-service\").innerHTML\n  );\n\n  // show the field once a category is selected\n  $(\"[name='support[service]']\").change(function() {\n    const selectedCategory = $(\"[name='support[service]']:checked\").val();\n    const selectedOptions = support_service_opts[selectedCategory];\n    if (selectedOptions) {\n      // remove all <options> except the first\n      $(\"#support_subject option\")\n        .nextAll()\n        .remove();\n      $(\"#support_subject\").append(\n        selectedOptions.map(\n          opt => `<option value=${encodeURIComponent(opt)}>${opt}</option>`\n        )\n      );\n      $(\"#subject\").show();\n    } else {\n      $(\"#subject\").hide();\n    }\n  });\n}\n\nfunction findSiblingWithClass(node, className) {\n  node = node.nextElementSibling;\n  while (node && node.className.indexOf(className) === -1) {\n    node = node.nextElementSibling;\n  }\n  return node;\n}\nfunction removeClass(node, className) {\n  node.className = node.className.replace(className, \"\");\n}\n\nexport function setupRequestResponse($) {\n  $(\"#no_request_response\").change(function() {\n    $(\"#contactInfoForm\").toggle(!$(this).is(\":checked\"));\n  });\n}\n\nconst validators = {\n  comments: function($) {\n    return $(\"#comments\").val().length !== 0;\n  },\n  support_subject: function($) {\n    const subject = $(\"#support_subject\").val();\n    return subject && subject.length !== 0;\n  },\n  service: function($) {\n    return !!$(\"[name='support[service]']:checked\").val();\n  },\n  first_name: function($) {\n    if (responseRequested($)) {\n      return $(\"#first_name\").val().length !== 0;\n    }\n    return true;\n  },\n  last_name: function($) {\n    if (responseRequested($)) {\n      return $(\"#last_name\").val().length !== 0;\n    }\n    return true;\n  },\n  email: function($) {\n    if (responseRequested($)) {\n      return (\n        $(\"#email\")\n          .val()\n          .trim()\n          .match(/.+\\@.+\\..+/) !== null\n      );\n    }\n    return true;\n  },\n  privacy: function($) {\n    if (responseRequested($)) {\n      return $(\"#privacy\").prop(\"checked\");\n    }\n    return true;\n  },\n  recaptcha: function($) {\n    return !!$(\"#g-recaptcha-response\").val();\n  },\n  vehicle: function($) {\n    const value = $(\"#vehicle\").val();\n    return /^[0-9]{0,8}$/.test(value);\n  }\n};\n\nfunction responseRequested($) {\n  return !$(\"#no_request_response\")[0].checked;\n}\n\nfunction setupValidation($) {\n  [\n    \"#privacy\",\n    \"#support_subject\",\n    \"#comments\",\n    \"#email\",\n    \"#first_name\",\n    \"#last_name\",\n    \"#vehicle\"\n  ].forEach(selector => {\n    const $selector = $(selector);\n    $selector.on(\"keyup blur input change\", () => {\n      if (validators[selector.slice(1)]($)) {\n        displaySuccess($, selector);\n      }\n    });\n  });\n}\n\nfunction displayError($, selector) {\n  const rootSelector = selector.slice(1);\n  $(`.support-${rootSelector}-error-container`).removeClass(\"hidden-xs-up\");\n  $(selector)\n    .parent()\n    .addClass(\"has-danger\")\n    .removeClass(\"has-success\");\n}\n\nfunction displaySuccess($, selector) {\n  $(`.support-${selector.slice(1)}-error-container`).addClass(\"hidden-xs-up\");\n  $(selector)\n    .parent()\n    .removeClass(\"has-danger\")\n    .addClass(\"has-success\");\n}\n\nfunction validateForm($) {\n  const privacy = \"#privacy\",\n    subject = \"#support_subject\",\n    comments = \"#comments\",\n    service = \"#service\",\n    vehicle = \"#vehicle\",\n    email = \"#email\",\n    first_name = \"#first_name\",\n    last_name = \"#last_name\",\n    recaptcha = \"#g-recaptcha-response\",\n    errors = [];\n  // Service\n  if (!validators.service($)) {\n    displayError($, service);\n    errors.push(service);\n  } else {\n    displaySuccess($, service);\n  }\n  // Subject\n  if (!validators.support_subject($)) {\n    displayError($, subject);\n    errors.push(subject);\n  } else {\n    displaySuccess($, subject);\n  }\n  // Main textarea\n  if (!validators.comments($)) {\n    displayError($, comments);\n    errors.push(comments);\n  } else {\n    displaySuccess($, comments);\n  }\n  // Name\n  if (!validators.first_name($)) {\n    displayError($, first_name);\n    errors.push(first_name);\n  } else {\n    displaySuccess($, first_name);\n  }\n  if (!validators.last_name($)) {\n    displayError($, last_name);\n    errors.push(last_name);\n  } else {\n    displaySuccess($, last_name);\n  }\n  // Vehicle number\n  if (!validators.vehicle($)) {\n    displayError($, vehicle);\n    errors.push(vehicle);\n  } else {\n    displaySuccess($, vehicle);\n  }\n  // Phone and email\n  if (!validators.email($)) {\n    displayError($, email);\n    errors.push(email);\n  } else {\n    displaySuccess($, email);\n  }\n  // Privacy checkbox\n  if (!validators.privacy($)) {\n    displayError($, privacy);\n    errors.push(privacy);\n  } else {\n    displaySuccess($, privacy);\n  }\n  // reCAPTCHA\n  if (!validators.recaptcha($)) {\n    displayError($, recaptcha);\n    errors.push(recaptcha);\n  } else {\n    displaySuccess($, recaptcha);\n  }\n  focusError($, errors);\n  return errors.length === 0;\n}\n\nfunction focusError($, errors) {\n  if (errors.length > 0) {\n    $(`.support-${errors[0].slice(1)}-error-container`).focus();\n  }\n}\n\nfunction deactivateSubmitButton($) {\n  $(\"#support-submit\").prop(\"disabled\", true);\n  $(\".waiting\").removeAttr(\"hidden\");\n  $(\"#support-submit\").trigger(\"waiting:start\");\n}\n\nfunction reactivateSubmitButton($) {\n  $(\"#support-submit\").prop(\"disabled\", false);\n  $(\".waiting\").attr(\"hidden\", \"hidden\");\n  $(\"#support-submit\").trigger(\"waiting:end\");\n}\n\nexport function handleSubmitClick($, toUpload) {\n  $(\"#support-submit\").click(function(event) {\n    // Use an npm-installed library for testing\n    const FormData = window.FormData ? window.FormData : require(\"form-data\"),\n      valid = validateForm($);\n    event.preventDefault();\n    const errorDisplay = document.getElementById(\"support-form-errors\");\n    const errorList = document.getElementById(\"support-form-error-list\");\n    errorList.innerHTML = \"\";\n    if (!valid) {\n      // A bit of a hack. Get names of all fields marked with error styling.\n      const errors = Array.from(\n        document.querySelectorAll(\".has-danger > label, .has-danger > legend\")\n      ).map(el => {\n        const text = document.createTextNode(el.innerText.replace(\"*\", \"\"));\n        const li = document.createElement(\"li\");\n        li.appendChild(text);\n        return li;\n      });\n      if (errors.length) {\n        errors.forEach(err => {\n          errorList.appendChild(err);\n        });\n        errorDisplay.classList.remove(\"hidden\");\n      }\n      return;\n    }\n    errorDisplay.classList.add(\"hidden\");\n    deactivateSubmitButton($);\n    const formData = new FormData();\n    const filter = new Filter();\n    $(\"#support\")\n      .serializeArray()\n      .forEach(({ name: name, value: value }) => {\n        if (name === \"support[comments]\") {\n          value = filter.clean(value);\n        }\n        formData.append(name, value);\n      });\n\n    // overwrite subject value with the decoded content:\n    const encodedSubjectValue = formData.get(\"support[subject]\");\n    formData.set(\"support[subject]\", decodeURIComponent(encodedSubjectValue));\n\n    toUpload.forEach(photo => {\n      formData.append(\"support[photos][]\", photo, photo.name);\n    });\n    $.ajax({\n      url: $(\"#support\").attr(\"action\"),\n      method: \"POST\",\n      processData: false,\n      data: formData,\n      contentType: false,\n      success: () => {\n        $(\".support-confirmation--success\")\n          .removeClass(\"hidden-xs-up\")\n          .focus();\n        $(\".support-confirmation--error\").addClass(\"hidden-xs-up\");\n        reactivateSubmitButton($);\n        $(\"#support\").remove();\n      },\n      error: (xhr, errorString, errorObject) => {\n        console.error(errorString);\n        Sentry.captureException(errorObject, {\n          tags: { \"dotcom.application\": \"frontend\", \"support.form\": true },\n          extra: { errorStatus: errorString, formData: formData }\n        });\n        $(\".support-confirmation--error\")\n          .removeClass(\"hidden-xs-up\")\n          .focus();\n        reactivateSubmitButton($);\n      }\n    });\n  });\n}\n\nexport function handleSubjectChange($) {\n  $(\"#charlie-card-or-ticket-number\").hide();\n  const subjectEl = document.getElementById(\"support_subject\");\n  subjectEl.addEventListener(\"change\", ev => {\n    const optionText = ev.target.options[ev.target.selectedIndex].text;\n    if (ev.target.value === encodeURIComponent(\"CharlieCards & Tickets\")) {\n      $(\"#charlie-card-or-ticket-number\").show();\n    } else {\n      $(\"#charlie-card-or-ticket-number\").hide();\n    }\n  });\n}\n","export default function(\n  $ = window.jQuery,\n  doc = document,\n  navigator = window.navigator\n) {\n  if (\"geolocation\" in navigator) {\n    doc.addEventListener(\"turbolinks:before-visit\", beforeVisit($), {\n      passive: true\n    });\n    $(document).on(\n      \"click\",\n      \"[data-geolocation-target]\",\n      clickHandler($, navigator)\n    );\n  } else {\n    doc.documentElement.className += \" geolocation-disabled\";\n  }\n}\n\nfunction beforeVisit($) {\n  return () => {\n    $(\".loading-indicator, .location-error\").addClass(\"hidden-xs-up\");\n  };\n}\n\n// These functions are exported for testing\nexport function clickHandler($, navigator) {\n  return event => {\n    event.preventDefault();\n    const $btn = locationButton($(event.target));\n    const $errorEl = $(`#${$btn.data(\"id\")}-geolocation-error`);\n    toggleLoadingIndicator($, $btn);\n    $errorEl.addClass(\"hidden-xs-up\");\n    navigator.geolocation.getCurrentPosition(\n      locationHandler($, $btn, $errorEl),\n      locationError($, $btn, $errorEl)\n    );\n  };\n}\n\nexport function locationHandler($, $btn, $errorEl) {\n  return location => {\n    const id = $btn.data(\"id\");\n    const field = $btn.data(\"field\");\n    $(`#${id}`).trigger(\"geolocation:complete\", location);\n  };\n}\n\nexport function locationError($, $btn, $errorEl) {\n  return error => {\n    $btn.find(\".loading-indicator\").addClass(\"hidden-xs-up\");\n    if (\n      error.code == error.TIMEOUT ||\n      error.code == error.POSITION_UNAVAILABLE\n    ) {\n      $errorEl.removeClass(\"hidden-xs-up\");\n      $errorEl.html(\n        \"We couldn't fetch your location &mdash; please wait a minute and try again, or enter your address.\"\n      );\n    } else if (error.code == error.PERMISSION_DENIED) {\n      $errorEl.removeClass(\"hidden-xs-up\");\n      $errorEl.html(\n        \"It looks like you haven't granted permission to fetch your location &mdash; to use geolocation, update your browser's settings and try again.\"\n      );\n    }\n  };\n}\n\nfunction toggleLoadingIndicator($, $btn) {\n  const id = $btn.data(\"id\");\n  const $indicator = $btn.find(\".loading-indicator\");\n  $indicator.removeClass(\"hidden-xs-up\");\n  $(`#${id}`).on(\"geolocation:complete\", () => {\n    $indicator.addClass(\"hidden-xs-up\");\n  });\n}\n\nfunction locationButton($el) {\n  var target = $el;\n  while (!target.data().geolocationTarget) {\n    target = target.parent();\n  }\n  return target;\n}\n","export function getUrlParameter(sParam, search_string) {\n  const sPageURL = decodeURIComponent(search_string.substring(1));\n  const sURLVariables = sPageURL.split(\"&\");\n  let sParameterName;\n  let i;\n\n  // eslint-disable-next-line no-plusplus\n  for (i = 0; i < sURLVariables.length; i += 1) {\n    sParameterName = sURLVariables[i].split(\"=\");\n\n    if (sParameterName[0] === sParam) {\n      return sParameterName[1] === undefined ? true : sParameterName[1];\n    }\n  }\n  return null;\n}\n\n// Determines if form should be re-submitted. If place name has not changed\n// Do not resubmit the form\n// This is done to preserve the names of landmarks\nexport function validateLocationForm(event, location, input) {\n  const val = input.value;\n  const name = input.getAttribute(\"name\");\n  if (val === getUrlParameter(name, location.search)) {\n    event.preventDefault();\n    location.reload();\n    return false;\n  }\n  return true;\n}\n\nexport function constructUrl(place, input) {\n  const id = input.getAttribute(\"id\");\n  const name = input.getAttribute(\"name\");\n  var query_str;\n  const loc = window.location;\n  const location_url = loc.protocol + \"//\" + loc.host + loc.pathname;\n  const addr = input.value;\n\n  if (place.geometry) {\n    const lat = place.geometry.location.lat();\n    const lng = place.geometry.location.lng();\n    query_str = `?latitude=${lat}&longitude=${lng}&${name}=${addr}#${id}`;\n  } else {\n    query_str = `?${name}=${place.name}#${id}`;\n  }\n  return location_url + query_str;\n}\n\nfunction geolocationCallback(ev, location) {\n  const path = `${window.location.protocol}//${window.location.host}${window.location.pathname}`;\n  const qs = `?latitude=${location.coords.latitude}&longitude=${location.coords.longitude}`;\n  window.location.href = encodeURI(path + qs + \"#address-search-input\");\n}\n\nexport default function() {\n  function setupLocationInput() {\n    const transitNearMeInput = document.getElementById(\"address-search-input\");\n\n    // only load on pages that are using the location input\n    if (!transitNearMeInput) {\n      return;\n    }\n\n    transitNearMeInput.form.addEventListener(\"submit\", ev =>\n      // eslint-disable-next-line no-use-before-define\n      validateLocationForm(ev, window.location, transitNearMeInput)\n    );\n  }\n\n  document.addEventListener(\"turbolinks:load\", setupLocationInput, {\n    passive: true\n  });\n  $(document).on(\n    \"geolocation:complete\",\n    \"#address-search-input\",\n    // eslint-disable-next-line no-use-before-define\n    geolocationCallback\n  );\n}\n","import { setHeaderElementPositions } from \"../ts/app/global-navigation\";\n\n// maximum wait time to get a reference to Google Translate select DOM element\nconst domPollLimitMilliseconds = 10000;\n\n// default value for language\nlet currentLanguage = \"en\";\n\n// setTimeout callback for tracking mutations\n// this is used because the Google Translate component mutates the DOM\nlet domMutateCallback;\n\nconst languages = [\n  [\"ar\", \"Arabic\"],\n  [\"zh-CN\", \"Chinese (Simplified)\"],\n  [\"zh-TW\", \"Chinese (Traditional)\"],\n  [\"en\", \"English\"],\n  [\"fr\", \"French\"],\n  [\"ht\", \"Haitian Creole\"],\n  [\"it\", \"Italian\"],\n  [\"km\", \"Khmer\"],\n  [\"ko\", \"Korean\"],\n  [\"pl\", \"Polish\"],\n  [\"pt\", \"Portuguese\"],\n  [\"ru\", \"Russian\"],\n  [\"es\", \"Spanish\"],\n  [\"vi\", \"Vietnamese\"]\n];\n\nexport default () =>\n  document.addEventListener(\"turbolinks:load\", handleTranslation);\n\n// await reading the google translate component\nconst handleTranslation = () =>\n  getTranslateElement()\n    .then(translateEl => {\n      registerEvents(translateEl);\n      render();\n    })\n    .catch(_err => {\n      // catch, but ignore errors\n    });\n\nconst getTranslateElement = () =>\n  new Promise((resolve, reject) => {\n    pollDomForGoogleTranslateEl(200, resolve, reject);\n  });\n\n// if the dom element couldn't be found in 10 seconds (6 iterations), stop trying\nconst pollDomForGoogleTranslateEl = (delay, resolve, reject) =>\n  delay > domPollLimitMilliseconds\n    ? reject(\"taking too long to find element\")\n    : setTimeout(() => {\n        const translateEl = document.querySelector(\".goog-te-combo\");\n        if (translateEl) {\n          resolve(translateEl);\n        } else {\n          // double the delay and retry\n          pollDomForGoogleTranslateEl(delay * 2, resolve, reject);\n        }\n      }, delay);\n\nconst registerEvents = translateEl => {\n  // initialize current language\n  currentLanguage = getSelectedTranslation(translateEl);\n\n  // detect when the language has been changed from outside\n  // this works because Google's JS mutates the DOM\n  translateEl.addEventListener(\"DOMNodeInserted\", () => {\n    const header = document.querySelector(\".header--new\");\n    if (header) {\n      setHeaderElementPositions(header);\n    }\n\n    if (domMutateCallback) {\n      clearTimeout(domMutateCallback);\n    }\n    domMutateCallback = setTimeout(() => {\n      const updatedLanguage = getSelectedTranslation(translateEl);\n      if (currentLanguage !== updatedLanguage) {\n        currentLanguage = updatedLanguage;\n        render();\n      }\n    }, 500);\n  });\n};\n\n// read select DOM el, if possible\nconst getSelectedTranslation = el =>\n  el &&\n  el.options &&\n  el.options[el.selectedIndex] &&\n  el.options[el.selectedIndex].value\n    ? el.options[el.selectedIndex].value\n    : \"en\";\n\n// change the language in the component, trigger and event for it\nconst setTranslation = (translateEl, language) => {\n  currentLanguage = language;\n  translateEl.value = language;\n\n  let event;\n  if (typeof Event === \"function\") {\n    event = new Event(\"change\", { bubbles: true, cancelable: false });\n  } else {\n    event = document.createEvent(\"Event\");\n    event.initEvent(\"change\", true, false);\n  }\n  translateEl.dispatchEvent(event);\n};\n\nconst render = () => {\n  /* Render either new or old version depending on which navigation is bring shown. */\n  document\n    .querySelectorAll(\".m-menu__language\")\n    .forEach(el => (el.innerHTML = renderCustomSelect()));\n\n  // handle keyboard events on links\n  [...document.querySelectorAll(\".custom-language-selector\")].forEach(\n    linkEl => {\n      linkEl.addEventListener(\"keyup\", triggerClick(\"language-menu-toggle\"));\n    }\n  );\n\n  // add DOM event handling to rendered links in menu\n  registerLinkEvents();\n};\n\nconst renderCustomSelect = () => `\n  <i class=\"header-globe fa fa-globe fa-lg\" aria-hidden=\"true\"></i>\n  <i class=\"footer-globe fa fa-globe fa-xl\" aria-hidden=\"true\"></i>\n  <select class=\"custom-language-selector\" aria-label=\"Page language\">\n  ${languages.map(\n    ([code, name]) =>\n      `<option ${\n        code === currentLanguage ? \"selected\" : \"\"\n      } data-toggle=\"language\" data-lang=\"${code}\">${name}</option>`\n  )}\n  </select>\n`;\n\nconst registerLinkEvents = () => {\n  const translateEl = document.querySelector(\".goog-te-combo\");\n  [...document.querySelectorAll(\"a[data-toggle='language']\")].forEach(\n    linkEl => {\n      linkEl.addEventListener(\n        \"click\",\n        event => {\n          setTranslation(translateEl, event.target.getAttribute(\"data-lang\"));\n          render();\n        },\n        false\n      );\n      linkEl.addEventListener(\"keyup\", triggerClick());\n    }\n  );\n  // new selector\n  [...document.querySelectorAll(\".custom-language-selector\")].forEach(\n    linkEl => {\n      linkEl.addEventListener(\n        \"change\",\n        event => {\n          setTranslation(\n            translateEl,\n            event.target.selectedOptions[0].getAttribute(\"data-lang\")\n          );\n          render();\n        },\n        false\n      );\n    }\n  );\n};\n\nconst triggerClick = target => event => {\n  // pressing enter is a click\n  if ((event.keyCode || event.which) !== 13) {\n    return;\n  }\n  event.preventDefault();\n  event.stopPropagation();\n  target ? document.getElementById(target).click() : event.target.click();\n};\n","export default () => {\n  document.addEventListener(\"turbolinks:load\", scrollTo, { passive: true });\n};\n\nconst scrollTo = () => {\n  window.requestAnimationFrame(() => {\n    const initialElToScrollTo = document.querySelector(\"[data-scroll-to]\");\n    if (initialElToScrollTo) {\n      doScrollTo(initialElToScrollTo);\n    }\n  });\n};\n\nconst doScrollTo = el => {\n  const childLeft = el.offsetLeft;\n  const parentLeft = el.parentNode.offsetLeft;\n  const firstSiblingWidth = firstSibling(el).clientWidth;\n\n  // childLeft - parentLeft scrolls the first row to the start of the\n  // visible area.\n  const scrollLeft = childLeft - parentLeft - firstSiblingWidth;\n  let table = el.parentNode;\n  while (table.nodeName !== \"TABLE\") {\n    table = table.parentNode;\n  }\n  table.parentNode.scrollLeft = scrollLeft;\n};\n\nconst firstSibling = element => {\n  const sibling = element.parentNode.firstChild;\n  if (sibling.nodeType === 1) {\n    return sibling;\n  } else if (sibling) {\n    return sibling.nextElementSibling;\n  } else {\n    return null;\n  }\n};\n","let scrollCallback = false;\n\nexport default () => {\n  document.addEventListener(\"turbolinks:load\", adjustTimetableStyle, {\n    passive: true\n  });\n  window.addEventListener(\"resize\", resizeRows);\n};\n\nconst adjustTimetableStyle = () => {\n  // return if there is no timetable available\n  const timetableContainerEl = document.getElementById(\"timetable\");\n  if (!timetableContainerEl) {\n    return;\n  }\n\n  // remove border around container because timetable \"hat\" is visible\n  timetableContainerEl.style.borderTop = 0;\n\n  // make headers absolutely position so they stick when table is scrolled\n  [...document.querySelectorAll(\"th[data-absolute]\")].forEach(headerEl => {\n    headerEl.style.position = \"absolute\";\n  });\n\n  resizeRows();\n\n  // register an on-scroll event to enable / disable buttons\n  timetableContainerEl.addEventListener(\"scroll\", toggleScrollButtons);\n};\n\nconst resizeRow = rowEl => {\n  const height = rowEl.querySelector(\".js-tt-stop-name\").offsetHeight;\n  [...rowEl.querySelectorAll(\".js-tt-cell\")].forEach(\n    cell => (cell.style.height = `${height}px`)\n  );\n};\n\nconst resizeRows = () => {\n  // adjust heights of rows where text may be\n  // overflowing absolutely positioned container\n  [...document.querySelectorAll(\".js-tt-row\")].forEach(resizeRow);\n};\n\nconst toggleScrollButtons = event => {\n  if (scrollCallback !== false) {\n    clearTimeout(scrollCallback);\n  }\n  scrollCallback = setTimeout(() => {\n    const maxScrollLeft = event.target.scrollWidth - event.target.clientWidth;\n    const scrollLeft = event.target.scrollLeft;\n    const leftBtnEl = document.querySelector(\"button[data-scroll='earlier']\");\n    const rightBtnEl = document.querySelector(\"button[data-scroll='later']\");\n\n    if (leftBtnEl) {\n      scrollLeft === 0\n        ? leftBtnEl.setAttribute(\"disabled\", \"\")\n        : leftBtnEl.removeAttribute(\"disabled\");\n    }\n    if (rightBtnEl) {\n      scrollLeft === maxScrollLeft\n        ? rightBtnEl.setAttribute(\"disabled\", \"\")\n        : rightBtnEl.removeAttribute(\"disabled\");\n    }\n  }, 250);\n};\n","/**\n * When scrolling down the timetable,\n * ensure the train numbers are always visible on screen\n */\n\nconst trainLabelRow = document.querySelector(\".js-timetable-train-labels\");\nconst trainLabels = trainLabelRow ? Array.from(trainLabelRow.children) : [];\nconst tableEl = document.getElementById(\"timetable\");\nconst tableBodyEl = document.querySelector(\".m-timetable tbody\");\nconst stickyHeaderEl = document.createElement(\"div\");\nstickyHeaderEl.setAttribute(\n  \"style\",\n  \"border: 1px solid #b0b5c0; overflow: hidden; position: fixed; top: 0;\"\n);\nstickyHeaderEl.setAttribute(\"aria-hidden\", \"true\");\nlet removedLabels = null;\nlet isStuck = false;\n\nconst sideScrollStickyHeader = () => {\n  window.requestAnimationFrame(() => {\n    stickyHeaderEl.scrollLeft = tableEl.scrollLeft;\n  });\n};\n\nconst showStickyLabels = () => {\n  sideScrollStickyHeader();\n\n  if (removedLabels) {\n    document.body.appendChild(removedLabels);\n  } else {\n    const {\n      right: tableRight,\n      width: tableWidth\n    } = tableEl.getBoundingClientRect();\n\n    stickyHeaderEl.style.right = `${tableRight - tableWidth}px`;\n    stickyHeaderEl.style.width = `${tableWidth}px`;\n    trainLabels.forEach(labelEl => {\n      const { fontSize, width } = window.getComputedStyle(labelEl);\n      const stickyLabelEl = labelEl.cloneNode(true);\n      stickyLabelEl.className = \"m-timetable__header-cell\";\n      stickyLabelEl.style.fontSize = fontSize;\n      stickyLabelEl.style.minWidth = width;\n      stickyLabelEl.style.maxWidth = width;\n      stickyHeaderEl.appendChild(stickyLabelEl);\n    });\n\n    document.body.appendChild(stickyHeaderEl);\n  }\n\n  /**\n   *  listen to the table scroll event to handle sticky header positioning\n   */\n  tableEl.addEventListener(\"scroll\", sideScrollStickyHeader);\n  isStuck = true;\n};\n\nconst hideStickyLabels = () => {\n  if (removedLabels) {\n    stickyHeaderEl.parentNode.removeChild(stickyHeaderEl);\n  } else {\n    removedLabels = stickyHeaderEl.parentNode.removeChild(stickyHeaderEl);\n  }\n\n  tableEl.removeEventListener(\"scroll\", sideScrollStickyHeader);\n  isStuck = false;\n};\n\nconst resizeStickyHeader = () => {\n  const {\n    right: tableRight,\n    width: tableWidth\n  } = tableEl.getBoundingClientRect();\n  stickyHeaderEl.style.right = `${tableRight - tableWidth}px`;\n  stickyHeaderEl.style.width = `${tableWidth}px`;\n  const stickyLabels = stickyHeaderEl.childNodes;\n  if (stickyLabels.length > 0) {\n    trainLabels.forEach((trainLabel, index) => {\n      const { fontSize, width } = window.getComputedStyle(trainLabel);\n      stickyLabels[index].style.fontSize = fontSize;\n      stickyLabels[index].style.minWidth = width;\n      stickyLabels[index].style.maxWidth = width;\n    });\n  }\n};\n\nconst setUp = () => {\n  if (trainLabelRow && tableEl) {\n    /**\n     *  listen to the scroll event to check whether we need to pin the train\n     *  labels to the top of the screen\n     */\n    document.addEventListener(\"scroll\", () => {\n      window.requestAnimationFrame(() => {\n        const {\n          top: tableTop,\n          bottom: tableBottom\n        } = tableBodyEl.getBoundingClientRect();\n\n        if (!isStuck && tableTop < 0 && tableBottom > 20) {\n          showStickyLabels();\n        } else if (isStuck && (tableTop >= 0 || tableBottom < 20)) {\n          hideStickyLabels();\n        }\n      });\n    });\n\n    /**\n     * listen to the resize event in case we need to resize the sticky header\n     */\n    window.addEventListener(\"resize\", () => {\n      window.requestAnimationFrame(() => {\n        if (\n          stickyHeaderEl.getBoundingClientRect().right !==\n          tableBodyEl.getBoundingClientRect().right\n        ) {\n          resizeStickyHeader();\n        }\n      });\n    });\n  }\n};\n\nexport default () => {\n  document.addEventListener(\"turbolinks:load\", setUp, {\n    passive: true\n  });\n};\n","export default class DatePickerInput {\n  constructor(options) {\n    this.selectors = options.selectors;\n    this.onUpdateCallback = options.onUpdateCallback;\n    this.init();\n  }\n\n  init() {\n    this.dateInput = $(`#${this.selectors.dateEl.input}`); // Must use JQuery for the datepicker plugin\n    const dateLabel = document.getElementById(this.selectors.dateEl.label);\n    const actualMonth = parseInt(\n      document.getElementById(this.selectors.month).value,\n      10\n    );\n    const minAllowedDate = this.dateInput.data(\"min-date\");\n    const maxAllowedDate = this.dateInput.data(\"max-date\");\n    const date = new Date(\n      document.getElementById(this.selectors.year).value,\n      actualMonth - 1,\n      document.getElementById(this.selectors.day).value\n    );\n\n    dateLabel.setAttribute(\"data-date\", DatePickerInput.getShortDate(date));\n\n    this.updateDateFormatToShort = this.updateDateFormatToShort.bind(this);\n    this.updateDateFormatToLong = this.updateDateFormatToLong.bind(this);\n    this.dateInput.datepicker({\n      outputFormat: DatePickerInput.getDateFormatbyMediaQuery(),\n      onUpdate: this.updateDate.bind(this),\n      min: minAllowedDate,\n      max: maxAllowedDate,\n      gainFocusOnConstruction: false\n    });\n\n    // disable clicking on the month to change the grid type\n    $(\".datepicker-month\").off();\n\n    // remove fast-skip buttons\n    $(\".datepicker-month-fast-next\").remove();\n    $(\".datepicker-month-fast-prev\").remove();\n\n    // replace default datepicker arrow icons\n    $(\".datepicker-calendar\")\n      .find(\".glyphicon\")\n      .removeClass(\"glyphicon\")\n      .addClass(\"fa\");\n    $(\".datepicker-calendar\")\n      .find(\".glyphicon-triangle-right\")\n      .removeClass(\"glyphicon-triangle-right\")\n      .addClass(\"fa-caret-right\");\n    $(\".datepicker-calendar\")\n      .find(\".glyphicon-triangle-left\")\n      .removeClass(\"glyphicon-triangle-left\")\n      .addClass(\"fa-caret-left\");\n\n    $(document).on(\"click\", `#${this.selectors.dateEl.input}`, ev => {\n      ev.preventDefault();\n      ev.stopPropagation();\n      $(`#${this.selectors.dateEl.input}`).datepicker(\"show\"); // jQuery plugin that requires this syntax\n    });\n\n    window\n      .matchMedia(\"(min-width: 1344px)\")\n      .addListener(this.updateDateFormatToLong);\n\n    window\n      .matchMedia(\"(min-width: 1087px) and (max-width: 1344px)\")\n      .addListener(this.updateDateFormatToShort);\n\n    window\n      .matchMedia(\"(min-width: 800px) and (max-width: 1087px)\")\n      .addListener(this.updateDateFormatToShort);\n\n    window\n      .matchMedia(\"(min-width: 544px) and (max-width: 800px)\")\n      .addListener(this.updateDateFormatToLong);\n\n    window\n      .matchMedia(\"(max-width: 544px)\")\n      .addListener(this.updateDateFormatToShort);\n\n    this.dateInput.datepicker(\"setDate\", date);\n  }\n\n  static getDateFormatbyMediaQuery() {\n    if (window.matchMedia(\"(min-width: 1344px)\").matches) {\n      return \"EEEE, MMMM dd, yyyy\";\n    }\n    if (\n      window.matchMedia(\"(min-width: 544px) and (max-width: 800px)\").matches\n    ) {\n      return \"EEEE, MMMM dd, yyyy\";\n    }\n    return \"EE, MMMM dd, yyyy\";\n  }\n\n  updateDateFormatToShort(e) {\n    return e.matches ? this.setDatePickerFormat(\"EE, MMMM dd, yyyy\") : false;\n  }\n\n  updateDateFormatToLong(e) {\n    return e.matches ? this.setDatePickerFormat(\"EEEE, MMMM dd, yyyy\") : false;\n  }\n\n  setDatePickerFormat(format) {\n    this.dateInput.datepicker(\"outputFormat\", format);\n    this.dateInput.datepicker(\"update\");\n  }\n\n  updateDate(datepickerDate) {\n    const date = new Date(datepickerDate);\n    const dateLabel = document.getElementById(this.selectors.dateEl.label);\n    const ariaMessage = dateLabel.getAttribute(\"aria-label\").split(\", \")[3];\n    dateLabel.setAttribute(\"data-date\", DatePickerInput.getShortDate(date));\n    dateLabel.setAttribute(\"aria-label\", `${datepickerDate}, ${ariaMessage}`);\n    this.updateDateSelects(date);\n\n    this.dateInput.datepicker(\"hide\");\n    this.onUpdateCallback();\n  }\n\n  updateDateSelects(date) {\n    const year = date.getFullYear().toString();\n    const month = (date.getMonth() + 1).toString();\n    const day = date.getDate().toString();\n    this.updateSelect({ month });\n    this.updateSelect({ day });\n    this.updateSelect({ year });\n  }\n\n  updateSelect(select) {\n    const type = Object.keys(select)[0];\n    const options = document.getElementById(this.selectors[type]);\n    const currentOpt =\n      options.querySelector(\"option[selected='selected']\") ||\n      options.querySelector(\"option[selected]\");\n    const newOpt = options.querySelector(`option[value='${select[type]}']`);\n    if (currentOpt) currentOpt.removeAttribute(\"selected\");\n    if (!newOpt) {\n      const opt = document.createElement(\"option\");\n      opt.value = select[type];\n      opt.text = select[type];\n      opt.setAttribute(\"selected\", \"selected\");\n      options.append(opt);\n    } else {\n      newOpt.setAttribute(\"selected\", \"selected\");\n    }\n  }\n\n  static getShortDate(date) {\n    return `${date.getMonth() + 1}/${date.getDate()}/${date\n      .getFullYear()\n      .toString()\n      .substr(2)}`;\n  }\n}\n","import DatePickerInput from \"../datepicker-input\";\nimport * as QueryHelpers from \"../../ts/helpers/query\";\n\n/**\nHow to use this TimeControls module on the frontend to create date and time selectors:\n(needs to go together with `DateTimeSelector.custom_date_time_select` in the backend)\n\n- In your .eex template file, pass a (perhaps nested) map containing the specific fields of the date and time selector in a <script> tag with the following parameters.\n<script id=\"form-data\" type=\"text/plain\">\n  <%= raw(Poison.encode!(<map with the fields>)) %>\n</script>\nThese field names are created by the Elixir module DateTimeSelector in your form.\n\n- Then, use DateTimeSelector.custom_date_time_select passing the form and a date range, i.e.:\n<% date_ranges = %{min_date: ..., max_date: ...} %>\n<%= DateTimeSelector.custom_date_time_select(form, date_ranges) %>\n*/\n\nexport class TimeControls {\n  constructor() {\n    const { dateEl, month, day, year } = TimeControls.SELECTORS;\n    if (document.getElementById(dateEl.input)) {\n      this.resetPlanType();\n      this.DatePicker = new DatePickerInput({\n        selectors: { dateEl, month, day, year },\n        onUpdateCallback: this.updateControlTitleCallback.bind(this)\n      });\n      this.timeInput();\n      this.controlSetup();\n    }\n  }\n\n  resetPlanType() {\n    const title = document.getElementById(TimeControls.SELECTORS.title);\n    if (title) {\n      title.setAttribute(\"data-prefix\", \"\");\n    }\n  }\n\n  controlSetup() {\n    const depart = document.getElementById(TimeControls.SELECTORS.depart);\n    if (depart) {\n      depart.addEventListener(\"click\", () => {\n        this.updateControlTitle(\"Depart at\");\n      });\n    }\n\n    const arrive = document.getElementById(TimeControls.SELECTORS.arrive);\n    if (arrive) {\n      arrive.addEventListener(\"click\", () => {\n        this.updateControlTitle(\"Arrive by\");\n      });\n    }\n  }\n\n  timeInput() {\n    document\n      .getElementById(TimeControls.SELECTORS.hour)\n      .addEventListener(\"change\", this.updateTime.bind(this));\n    document\n      .getElementById(TimeControls.SELECTORS.minute)\n      .addEventListener(\"change\", this.updateTime.bind(this));\n    document\n      .getElementById(TimeControls.SELECTORS.amPm)\n      .addEventListener(\"change\", this.updateTime.bind(this));\n  }\n\n  // eslint-disable-next-line class-methods-use-this\n  getStateFromQuery() {\n    return QueryHelpers.parseQuery(\n      window.location.search,\n      window.decodeURIComponent\n    );\n  }\n\n  formatQueryPlanType() {\n    const planTime = this.getStateFromQuery()[\"plan[time]\"];\n    if (planTime === \"arrive\") {\n      return \"Arrive by\";\n    }\n    return \"Depart at\";\n  }\n\n  getPlanType() {\n    const title = document.getElementById(TimeControls.SELECTORS.title);\n    if (title) {\n      return title.getAttribute(\"data-prefix\") || this.formatQueryPlanType();\n    }\n    return \"\";\n  }\n\n  updateTime() {\n    const time = new Date();\n    const hour12 =\n      parseInt(document.getElementById(TimeControls.SELECTORS.hour).value, 10) %\n      12;\n    const amPm = document.getElementById(TimeControls.SELECTORS.amPm).value;\n    const hour = amPm === \"PM\" ? hour12 + 12 : hour12;\n    const timeLabel = document.getElementById(\n      TimeControls.SELECTORS.timeEl.label\n    );\n    const ariaMessage = timeLabel.getAttribute(\"aria-label\").split(\", \")[1];\n    time.setHours(hour);\n    time.setMinutes(\n      document.getElementById(TimeControls.SELECTORS.minute).value\n    );\n    const friendlyTime = TimeControls.getFriendlyTime(time);\n\n    timeLabel.setAttribute(\"data-time\", friendlyTime);\n    timeLabel.setAttribute(\"aria-label\", `${friendlyTime}, ${ariaMessage}`);\n    this.updateControlTitle(this.getPlanType());\n  }\n\n  updateControlTitle(text) {\n    const controlTitle = document.getElementById(TimeControls.SELECTORS.title);\n    if (controlTitle) {\n      const time = document\n        .getElementById(TimeControls.SELECTORS.timeEl.label)\n        .getAttribute(\"data-time\");\n      const date = document\n        .getElementById(TimeControls.SELECTORS.dateEl.label)\n        .getAttribute(\"data-date\");\n      const title = `${text} ${time}, ${date}`;\n      controlTitle.innerHTML = title;\n      controlTitle.setAttribute(\"data-prefix\", text);\n    }\n  }\n\n  updateControlTitleCallback() {\n    this.updateControlTitle(this.getPlanType());\n  }\n\n  static getFriendlyTime(datetime) {\n    let amPm = \"AM\";\n    let hour = datetime.getHours();\n    let minute = datetime.getMinutes();\n\n    if (hour > 11) {\n      amPm = \"PM\";\n    }\n    if (hour > 12) {\n      hour -= 12;\n    }\n    if (hour === 0) {\n      hour = 12;\n    }\n\n    if (minute < 10) {\n      minute = `0${minute}`;\n    }\n\n    return `${hour}:${minute} ${amPm}`;\n  }\n}\n\nexport function init() {\n  const $ = window.jQuery;\n  $(document).on(\"turbolinks:load\", () => {\n    const formDataEl = document.getElementById(\"form-data\");\n\n    if (!formDataEl) return;\n\n    TimeControls.SELECTORS = JSON.parse(formDataEl.innerHTML);\n    const timeControl = new TimeControls();\n  });\n}\n","export function autocomplete({ input, hitLimit }) {\n  if (input.length === 0) {\n    return Promise.resolve({});\n  }\n\n  return new Promise((resolve, reject) => {\n    window.jQuery\n      .getJSON(`/places/autocomplete/${encodeURIComponent(input)}/${hitLimit}`)\n      .done(processAutocompleteResults(resolve))\n      .fail(reject);\n  });\n}\n\nexport const lookupPlace = address =>\n  new Promise((resolve, reject) => {\n    window.jQuery\n      .getJSON(`/places/details/${encodeURIComponent(address)}`)\n      .done(processPlacesCallback(resolve))\n      .fail(reject);\n  });\n\nexport const reverseGeocode = (latitude, longitude) =>\n  new Promise((resolve, reject) => {\n    window.jQuery\n      .getJSON(`/places/reverse-geocode/${latitude}/${longitude}`)\n      .done(processGeocodeCallback(resolve, reject))\n      .fail(reject);\n  });\n\nconst processAutocompleteResults = resolve => ({ predictions }) =>\n  resolve(predictionResults(JSON.parse(predictions)));\n\nconst predictionResults = predictions => ({\n  locations: {\n    hits: predictions.map((p, i) => ({ ...p, id: `location-${i}` })),\n    nbHits: predictions.length\n  }\n});\n\nconst processPlacesCallback = resolve => ({ result }) =>\n  resolve(JSON.parse(result));\n\nconst processGeocodeCallback = (resolve, reject) => ({ results }) => {\n  const parsedResults = JSON.parse(results);\n  if (parsedResults[0]) {\n    resolve(parsedResults[0].formatted);\n  } else {\n    reject(\"No results\");\n  }\n};\n","class Algolia {\n  constructor(queries, defaultParams) {\n    this._queries = queries;\n    this._activeQueryIds = Object.keys(queries);\n    this._defaultParams = defaultParams;\n    this._viewMoreInc = 20;\n    this._lastQuery = \"\";\n    this._doBlankSearch = true;\n    this._widgets = [];\n    this.errorContainer = document.getElementById(\"algolia-error\");\n    this.reset();\n  }\n\n  get widgets() {\n    return this._widgets;\n  }\n\n  reset() {\n    Object.keys(this._queries).forEach(this.resetDefaultParams());\n    this._lastQuery = \"\";\n    this.resetWidgets();\n  }\n\n  resetDefaultParams() {\n    return queryId => {\n      if (this._defaultParams[queryId]) {\n        this._queries[queryId].params = JSON.parse(\n          JSON.stringify(this._defaultParams[queryId])\n        );\n      } else {\n        console.error(\n          \"default params not set for queryId\",\n          queryId,\n          this._defaultParams\n        );\n      }\n    };\n  }\n\n  addPage(group) {\n    if (this._queries[group]) {\n      this._queries[group].params.hitsPerPage += this._viewMoreInc;\n    }\n  }\n\n  search(opts = {}) {\n    this.toggleError(false);\n\n    if (!(typeof opts.query == \"string\")) {\n      opts.query = this._lastQuery;\n    }\n\n    if (opts.query.length > 0) {\n      const allQueries = this._buildAllQueries(opts);\n      this._lastQuery = opts.query;\n      return this._doSearch(allQueries);\n    } else {\n      this.updateWidgets({});\n\n      // This code handles the case where the user backspaces to an empty search string\n      if (this._lastQuery.length > 0) {\n        this.reset();\n      }\n      return Promise.resolve({});\n    }\n  }\n\n  _doSearch(allQueries) {\n    return this._sendQueries(allQueries)\n      .then(this._processAlgoliaResults())\n      .then(results => {\n        this.updateWidgets(results);\n        return results;\n      })\n      .catch(err => console.log(err));\n  }\n\n  _addAnalyticsData(result) {\n    result.hits.forEach((hit, i) => {\n      hit.analyticsData = {\n        queryID: result.queryID,\n        position: result.hitsPerPage * result.page + i + 1,\n        objectID: hit.objectID\n      };\n    });\n  }\n\n  _sendQueries(queries) {\n    const body = { requests: queries };\n    return new Promise((resolve, reject) => {\n      window.jQuery\n        .ajax({\n          type: \"POST\",\n          url: \"/search/query\",\n          data: JSON.stringify(body),\n          dataType: \"json\",\n          contentType: \"application/json\"\n        })\n        .done(resolve)\n        .fail(reject);\n    });\n  }\n\n  _buildAllQueries(opts) {\n    const requestedQueryIds =\n      this._activeQueryIds.length > 0\n        ? this._activeQueryIds\n        : Object.keys(this._queries);\n    const queries = [];\n    requestedQueryIds.forEach(queryId => {\n      queries.push(this._buildQuery(queryId, opts));\n    });\n\n    return queries;\n  }\n\n  _buildQuery(queryId, { query }) {\n    const currentQuery = this._queries[queryId];\n    currentQuery.query = query;\n    currentQuery.params = currentQuery.params || {};\n    currentQuery.params.clickAnalytics = true;\n    return currentQuery;\n  }\n\n  updateAllParams(key, value) {\n    Object.keys(this._queries).forEach(\n      key => (this._queries[key].params[key] = value)\n    );\n  }\n\n  updateActiveQueries(queryIds) {\n    this._activeQueryIds = queryIds;\n  }\n\n  removeActiveQuery(queryId) {\n    const i = this._activeQueryIds.indexOf(queryId);\n    if (i != -1) {\n      this._activeQueryIds.splice(i, 1);\n    }\n  }\n\n  addActiveQuery(queryId) {\n    if (this._activeQueryIds.indexOf(queryId) == -1) {\n      this._activeQueryIds.push(queryId);\n    }\n  }\n\n  updateFacetFilters(queryId, filters) {\n    this._queries[queryId].params[\"facetFilters\"][0] = filters;\n  }\n\n  addFacetFilter(queryId, filter) {\n    if (\n      this._queries[queryId].params[\"facetFilters\"][0].indexOf(filter) == -1\n    ) {\n      this._queries[queryId].params[\"facetFilters\"][0].push(filter);\n    }\n  }\n\n  removeFacetFilter(queryId, filter) {\n    const i = this._queries[queryId].params[\"facetFilters\"][0].indexOf(filter);\n    if (i != -1) {\n      this._queries[queryId].params[\"facetFilters\"][0].splice(i, 1);\n    }\n  }\n\n  updateParams(queryId, params) {\n    this._queries[queryId].params = params;\n  }\n\n  updateParamsByKey(queryId, key, value) {\n    this._queries[queryId].params[key] = value;\n  }\n\n  getParams(queryId) {\n    return this._queries[queryId].params;\n  }\n\n  addWidget(widget) {\n    widget.init(this);\n    this._widgets.push(widget);\n  }\n\n  updateWidgets(results) {\n    if (results[\"error\"]) {\n      this.toggleError(true);\n    } else {\n      this._widgets.forEach(function(widget) {\n        if (typeof widget.render === \"function\") {\n          widget.render(results);\n        }\n      });\n    }\n  }\n\n  resetWidgets() {\n    this._widgets.forEach(function(widget) {\n      if (typeof widget.reset === \"function\") {\n        widget.reset();\n      }\n    });\n  }\n\n  _processAlgoliaResults() {\n    return response => {\n      if (response[\"error\"]) {\n        return Promise.resolve(response);\n      } else {\n        let searchedQueries = this._activeQueryIds.slice(0);\n        if (this._activeQueryIds.length == 0) {\n          searchedQueries = Object.keys(this._queries);\n        }\n        const facetLength = Object.keys(this._queries).length;\n        const searchResults = response.results.slice(0, searchedQueries.length);\n        const facetResults = response.results.slice(\n          searchedQueries.length,\n          searchedQueries.length + facetLength\n        );\n        const results = {};\n        searchResults.forEach((result, i) => {\n          this._addAnalyticsData(result);\n          results[searchedQueries[i]] = result;\n        });\n        facetResults.forEach((result, i) => {\n          results[`facets-${Object.keys(this._queries)[i]}`] = result;\n        });\n        return Promise.resolve(results);\n      }\n    };\n  }\n\n  toggleError(hasError) {\n    if (hasError === true) {\n      this.errorContainer.style.display = \"block\";\n    } else {\n      this.errorContainer.style.display = \"none\";\n    }\n  }\n}\n\nexport default Algolia;\n","import * as AlgoliaResult from \"./algolia-result\";\n// eslint-disable-next-line import/no-unresolved, import/extensions\nimport * as QueryHelpers from \"../ts/helpers/query\";\n\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable class-methods-use-this */\n\nexport default class AlgoliaAutocomplete {\n  #templates;\n\n  constructor({\n    id,\n    selectors,\n    indices,\n    parent,\n    containerEl = null,\n    templates = AlgoliaResult.TEMPLATES\n  }) {\n    if (typeof id !== \"string\") {\n      throw new window.Error(\"autocomplete must have an id\");\n    }\n    this.id = id;\n    this.containerElement = containerEl;\n    this._parent = parent;\n    this.error = null;\n    this._selectors = Object.assign(selectors, {\n      resultsContainer: `${selectors.input}-autocomplete-results`\n    });\n    this._input = this.getById(this._selectors.input);\n    this._resultsContainer = this.getById(this._selectors.resultsContainer);\n    this._searchContainer = this.getById(this._selectors.container);\n    this._resetButton = this.getById(this._selectors.resetButton);\n    this.announcer = this.getById(this._selectors.announcer);\n    this._indices = indices;\n    this._datasets = [];\n    this._results = {};\n    this._highlightedHit = null;\n    this._autocomplete = null;\n\n    this.#templates = templates;\n\n    this.bind();\n  }\n\n  getById(id) {\n    return this.containerElement\n      ? this.containerElement.querySelector(`#${id}`)\n      : document.getElementById(id);\n  }\n\n  bind() {\n    this.onClickSuggestion = this.onClickSuggestion.bind(this);\n    this.onHitSelected = this.onHitSelected.bind(this);\n    this.onCursorChanged = this.onCursorChanged.bind(this);\n    this.onCursorRemoved = this.onCursorRemoved.bind(this);\n    this.onOpen = this.onOpen.bind(this);\n    this.onKeyup = this.onKeyup.bind(this);\n    this.clear = this.clear.bind(this);\n    this._toggleResetButton = this._toggleResetButton.bind(this);\n    this.getById = this.getById.bind(this);\n  }\n\n  clear() {\n    this._autocomplete.autocomplete.close();\n    this.setValue(\"\");\n    this._toggleResetButton(false);\n    this._client.reset();\n    this._input.focus();\n\n    //\n    //  To access the autocomplete object sent with this event, use:\n    //\n    //   $(document).on(\"autocomplete:reset\", (ev, { autocomplete }) => {})\n    //\n    // The extra data argument is not passed to\n    // listeners set by document.addEventListener.\n    //\n    window.$(document).trigger(\"autocomplete:reset\", { autocomplete: this });\n  }\n\n  init(client) {\n    this._client = client;\n\n    if (!this._input) return;\n\n    if (!this._resetButton) return;\n\n    this._addResultsContainer();\n\n    this._resultsContainer.innerHTML = \"\";\n\n    this._datasets = this._indices.reduce(\n      (acc, index) => this._buildDataset(index, acc),\n      []\n    );\n\n    this._autocomplete = window.autocomplete(\n      this._input,\n      {\n        appendTo: this._resultsContainer,\n        debug: true,\n        autoselectOnBlur: false,\n        openOnFocus: true,\n        detachedMediaQuery: false,\n        hint: false,\n        minLength: 0,\n        cssClasses: {\n          root: \"c-search-bar__autocomplete\",\n          prefix: \"c-search-bar__\"\n        }\n      },\n      this._datasets\n    );\n\n    this._addErrorMsg();\n    this._toggleResetButton(false);\n    this._addListeners();\n  }\n\n  resetResetButton() {\n    this._toggleResetButton(this._autocomplete.autocomplete.getVal() !== \"\");\n  }\n\n  setError(error) {\n    this.error = error;\n  }\n\n  _addListeners() {\n    window\n      .jQuery(document)\n      .on(\n        \"autocomplete:cursorchanged\",\n        `#${this._selectors.input}`,\n        this.onCursorChanged\n      );\n    window\n      .jQuery(document)\n      .on(\n        \"autocomplete:cursorremoved\",\n        `#${this._selectors.input}`,\n        this.onCursorRemoved\n      );\n    window\n      .jQuery(document)\n      .on(\n        \"autocomplete:selected\",\n        `#${this._selectors.input}`,\n        this.onHitSelected\n      );\n    window\n      .jQuery(document)\n      .on(\"autocomplete:shown\", `#${this._selectors.input}`, this.onOpen);\n\n    window.jQuery(document).on(\"keyup\", `#${this._input.id}`, this.onKeyup);\n\n    window.addEventListener(\"resize\", this.onOpen);\n\n    this._resetButton.removeEventListener(\"click\", this.clear);\n    this._resetButton.addEventListener(\"click\", this.clear);\n\n    // normally we would only use `.js-` prefixed classes for javascript selectors, but\n    // we make an exception here because this element and its class is generated entirely\n    // by the autocomplete widget.\n    window\n      .jQuery(document)\n      .on(\"click\", \".c-search-bar__-suggestion\", this.onClickSuggestion);\n\n    document.addEventListener(\"turbolink:before-render\", () => {\n      window\n        .jQuery(document)\n        .off(\n          \"autocomplete:cursorchanged\",\n          `#${this._selectors.input}`,\n          this.onCursorChanged\n        );\n      window\n        .jQuery(document)\n        .off(\n          \"autocomplete:cursorremoved\",\n          `#${this._selectors.input}`,\n          this.onCursorRemoved\n        );\n      window\n        .jQuery(document)\n        .off(\n          \"autocomplete:selected\",\n          `#${this._selectors.input}`,\n          this.onHitSelected\n        );\n      window\n        .jQuery(document)\n        .off(\"autocomplete:shown\", `#${this._selectors.input}`, this.onOpen);\n      window.removeEventListener(\"resize\", this.onOpen);\n      window.jQuery(document).off(\"keyup\", `#${this._input.id}`, this.onKeyup);\n      window\n        .jQuery(document)\n        .off(\"click\", \".c-search-bar__-suggestion\", this.onClickSuggestion);\n    });\n  }\n\n  _toggleResetButton(show) {\n    this._resetButton.style.display = show ? \"block\" : \"none\";\n  }\n\n  _addErrorMsg() {\n    if (this.getById(\"algolia-error\")) {\n      return;\n    }\n\n    const dropdown = document\n      .getElementsByClassName(\"c-search-bar__-dropdown-menu\")\n      .item(0);\n    const errorMsg = document.createElement(\"div\");\n\n    errorMsg.id = \"algolia-error\";\n    errorMsg.classList.add(\"c-search__error\");\n    errorMsg.innerHTML =\n      \"There was a problem performing your search; please try again in a few minutes.\";\n    dropdown.appendChild(errorMsg);\n    this._client.errorContainer = errorMsg;\n  }\n\n  onKeyup() {\n    this._toggleResetButton(this._autocomplete.autocomplete.getVal() !== \"\");\n  }\n\n  onOpen() {\n    const acDialog = window\n      .jQuery(this._resultsContainer)\n      .find(\".c-search-bar__-dropdown-menu\")[0];\n    if (acDialog && this._input) {\n      this.positionDropdown(acDialog);\n      this.announceResults(acDialog);\n    }\n  }\n\n  positionDropdown(acDialog) {\n    const borderWidth = parseInt(\n      $(`#${this._selectors.container}`).css(\"border-left-width\"),\n      10\n    );\n    const { offsetLeft, offsetTop } = this._input;\n\n    /* eslint-disable no-param-reassign */\n    acDialog.style.width = `${this._searchContainer.offsetWidth}px`;\n    acDialog.style.marginLeft = `${-borderWidth + -offsetLeft}px`;\n    acDialog.style.marginTop = `${borderWidth + offsetTop}px`;\n    /* eslint-enable no-param-reassign */\n  }\n\n  announceResults(dialog) {\n    const count = Array.from(dialog.querySelectorAll(\"a\")).reduce(\n      acc => acc + 1,\n      0\n    );\n    const s = count === 1 ? \"\" : \"s\";\n    this.announcer.innerHTML = `${count} result${s}`;\n  }\n\n  _addResultsContainer() {\n    if (!this._resultsContainer) {\n      this._resultsContainer = document.createElement(\"div\");\n      this._resultsContainer.id = this._selectors.resultsContainer;\n      this._input.parentNode.appendChild(this._resultsContainer);\n    }\n  }\n\n  onCursorChanged({\n    originalEvent: {\n      _args: [hit, index]\n    }\n  }) {\n    this._highlightedHit = {\n      hit,\n      index\n    };\n  }\n\n  onCursorRemoved() {\n    this._highlightedHit = null;\n  }\n\n  clickHighlightedOrFirstResult() {\n    if (this._highlightedHit) {\n      return this.onHitSelected({\n        originalEvent: {\n          _args: [this._highlightedHit.hit, this._highlightedHit.index]\n        }\n      });\n    }\n    return this.clickFirstResult();\n  }\n\n  clickFirstResult() {\n    const firstIndex = this._indices.find(\n      index => this._results[index] && this._results[index].hits.length > 0\n    );\n    if (firstIndex) {\n      return this.onHitSelected({\n        originalEvent: {\n          _args: [this._results[firstIndex].hits[0], firstIndex]\n        }\n      });\n    }\n    return false;\n  }\n\n  onClickSuggestion(ev) {\n    ev.preventDefault();\n  }\n\n  onHitSelected({\n    originalEvent: {\n      _args: [hit, type]\n    }\n  }) {\n    const params = this._parent.getParams();\n    if (this._input) {\n      this._input.value = \"\";\n    }\n\n    window.jQuery.post(\n      \"/search/click\",\n      hit.analyticsData,\n      this.onHitSelectedCallback(hit, type, params)\n    );\n  }\n\n  onHitSelectedCallback(hit, type, params) {\n    window.Turbolinks.visit(\n      AlgoliaResult.getUrl(hit, type) +\n        QueryHelpers.paramsToString(params, window.encodeURIComponent)\n    );\n  }\n\n  _buildDataset(indexName, acc) {\n    acc.push({\n      source: this._datasetSource(indexName),\n      displayKey: AlgoliaAutocomplete.DISPLAY_KEYS[indexName],\n      name: indexName,\n      hitsPerPage: 5,\n      minLength: this.minLength(indexName),\n      maxLength: this.maxLength(indexName),\n      templates: {\n        suggestion: this.renderResult(indexName),\n        footer: this.renderFooterTemplate(indexName)\n      },\n      debounce: 500\n    });\n    return acc;\n  }\n\n  minLength() {\n    return 1;\n  }\n\n  maxLength() {\n    return null;\n  }\n\n  renderFooterTemplate() {\n    // Does not render a footer template by default.\n    // To render a footer template, override this method.\n    return null;\n  }\n\n  _datasetSource(index) {\n    return (query, callback) => {\n      this._client.reset();\n      return this._client\n        .search({ query })\n        .then(results => this._onResults(callback, index, results));\n    };\n  }\n\n  _emptySearchSource() {\n    return (query, callback) => callback([{ data: \"\" }]);\n  }\n\n  _onResults(callback, index, results) {\n    if (!results || results.error) {\n      return;\n    }\n    if (results[index] && results[index].hits) {\n      this._results[index] = results[index];\n      callback(results[index].hits);\n    }\n  }\n\n  renderResult(index) {\n    return hit => AlgoliaResult.renderResult(hit, index, this.#templates);\n  }\n\n  setValue(value) {\n    this._autocomplete.autocomplete.setVal(value);\n    window.jQuery(this._input).change();\n    this._autocomplete.autocomplete.close();\n  }\n\n  getValue() {\n    return this._autocomplete.autocomplete.getVal();\n  }\n}\n\nAlgoliaAutocomplete.DISPLAY_KEYS = {\n  locations: \"hit.place_id\"\n};\n","import AlgoliaAutocomplete from \"./algolia-autocomplete\";\nimport { TEMPLATES } from \"./algolia-result\";\nimport { autocomplete, lookupPlace, reverseGeocode } from \"./maps-helpers\";\n// eslint-disable-next-line\nimport * as QueryHelpers from \"../ts/helpers/query\";\nimport geolocationPromise from \"./geolocation-promise\";\nimport debounce from \"../ts/helpers/debounce.ts\";\n\n/* eslint-disable no-underscore-dangle */\n\nexport const addFilterParam = (params, path) => {\n  switch (path) {\n    case \"/schedules/commuter-rail\":\n    case \"/schedules/commuter-rail/\":\n      return Object.assign(params, { filter: \"commuter_rail\" });\n\n    case \"/schedules/subway\":\n    case \"/schedules/subway/\":\n      return Object.assign(params, { filter: \"subway\" });\n\n    case \"/schedules/bus\":\n    case \"/schedules/bus/\":\n      return Object.assign(params, { filter: \"bus\" });\n\n    default:\n      return params;\n  }\n};\n\nclass AlgoliaAutocompleteWithGeo extends AlgoliaAutocomplete {\n  constructor({\n    id,\n    selectors,\n    indices,\n    locationParams,\n    popular,\n    parent,\n    containerEl = null,\n    templates = TEMPLATES\n  }) {\n    super({ id, selectors, indices, parent, containerEl, templates });\n    this.debounceInterval = 250;\n    if (!this._parent.getParams) {\n      this._parent.getParams = () => ({});\n    }\n    this._popular = popular;\n    this._loadingIndicator = this.getById(selectors.locationLoadingIndicator);\n    this.addUseMyLocationErrorEl();\n    this._locationParams = Object.assign(\n      AlgoliaAutocompleteWithGeo.DEFAULT_LOCATION_PARAMS,\n      locationParams\n    );\n    this._indices.splice(this._locationParams.position, 0, \"locations\");\n    this._indices.push(\"usemylocation\");\n    this._indices.push(\"popular\");\n  }\n\n  addUseMyLocationErrorEl() {\n    const container = this.getById(this._selectors.container);\n    this.useMyLocationErrorEl = document.createElement(\"div\");\n    this.useMyLocationErrorEl.classList.add(\"u-error\");\n    this.useMyLocationErrorEl.style.display = \"none\";\n    this.useMyLocationErrorEl.innerHTML = `${window.location.host} needs permission to use your location.\n      Please update your browser's settings or refresh the page and try again.`;\n    container.parentNode.appendChild(this.useMyLocationErrorEl);\n  }\n\n  _datasetSource(index) {\n    switch (index) {\n      case \"locations\":\n        return debounce(\n          this._locationSource(\"locations\"),\n          this.debounceInterval\n        );\n      case \"usemylocation\":\n        return this._useMyLocationSource();\n      case \"popular\":\n        return this._popularSource();\n      default:\n        return debounce(super._datasetSource(index), this.debounceInterval);\n    }\n  }\n\n  _locationSource(index) {\n    return (input, callback) =>\n      autocomplete({\n        input,\n        hitLimit: this._locationParams.hitLimit\n      }).then(results => this._onResults(callback, index, results));\n  }\n\n  _popularSource() {\n    return (query, callback) => {\n      const results = { popular: { hits: this._popular } };\n      return this._onResults(callback, \"popular\", results);\n    };\n  }\n\n  _useMyLocationSource() {\n    return (query, callback) => {\n      const results = { usemylocation: { hits: [{}] } };\n      return this._onResults(callback, \"usemylocation\", results);\n    };\n  }\n\n  // eslint-disable-next-line class-methods-use-this\n  minLength(index) {\n    switch (index) {\n      case \"usemylocation\":\n      case \"popular\":\n        return 0;\n      default:\n        return 1;\n    }\n  }\n\n  // eslint-disable-next-line class-methods-use-this\n  maxLength(index) {\n    switch (index) {\n      case \"usemylocation\":\n      case \"popular\":\n        return 0;\n      default:\n        return null;\n    }\n  }\n\n  onHitSelected(ev) {\n    // placesService can be injected in tests\n    const hit = ev.originalEvent;\n    const index = hit._args[1];\n    switch (index) {\n      case \"locations\":\n        this._input.value = hit._args[0].address;\n        this._doLocationSearch(hit._args[0].address);\n        break;\n      case \"usemylocation\":\n        this.useMyLocationSearch();\n        break;\n      default:\n        super.onHitSelected(ev);\n    }\n  }\n\n  useMyLocationSearch() {\n    this.useMyLocationErrorEl.style.display = \"none\";\n    this._input.disabled = true;\n    this.setValue(\"Getting your location...\");\n    this._loadingIndicator.style.visibility = \"visible\";\n    return geolocationPromise()\n      .then(pos => this.onUseMyLocationResults(pos))\n      .catch(err => this.onGeolocationError(err));\n  }\n\n  onGeolocationError(err) {\n    this._input.disabled = false;\n    this.setValue(\"\");\n    this._loadingIndicator.style.visibility = \"hidden\";\n    if (err.code && err.code === 1) {\n      this.useMyLocationErrorEl.style.display = \"block\";\n    }\n  }\n\n  _doLocationSearch(address) {\n    return lookupPlace(address).then(result =>\n      this._onLocationSearchResult(result)\n    );\n  }\n\n  _onLocationSearchResult(result) {\n    return this.showLocation(result.latitude, result.longitude);\n  }\n\n  onUseMyLocationResults({ coords: { latitude, longitude } }) {\n    return reverseGeocode(\n      parseFloat(latitude),\n      parseFloat(longitude)\n    ).then(result => this.onReverseGeocodeResults(result, latitude, longitude));\n  }\n\n  onReverseGeocodeResults(result, latitude, longitude) {\n    this._input.disabled = false;\n    this.setValue(result);\n    this._loadingIndicator.style.visibility = \"hidden\";\n    this._input.value = result;\n    this.showLocation(latitude, longitude);\n  }\n\n  showLocation(latitude, longitude) {\n    const params = this._parent.getParams();\n    params.latitude = latitude;\n    params.longitude = longitude;\n    params.address = this._input.value;\n    const qs = QueryHelpers.paramsToString(\n      addFilterParam(params, window.location.pathname),\n      window.encodeURIComponent\n    );\n    window.Turbolinks.visit(`/transit-near-me${qs}`);\n  }\n}\n\nAlgoliaAutocompleteWithGeo.DEFAULT_LOCATION_PARAMS = {\n  position: 0,\n  hitLimit: 5\n};\n\nexport default AlgoliaAutocompleteWithGeo;\n","/* eslint-disable */\nimport * as MapsHelpers from \"./maps-helpers\";\nimport Algolia from \"./algolia-search\";\nimport * as AlgoliaResult from \"./algolia-result\";\nimport AlgoliaAutocompleteWithGeo from \"./algolia-autocomplete-with-geo\";\n\nexport function init() {\n  document.addEventListener(\"turbolinks:load\", () => {\n    new TripPlannerLocControls();\n  });\n}\n\nexport class TripPlannerLocControls {\n  constructor({ containerEl } = {}) {\n    this.containerElement = containerEl;\n    this.toInput = this.getById(TripPlannerLocControls.SELECTORS.to.input);\n    this.fromInput = this.getById(TripPlannerLocControls.SELECTORS.from.input);\n    this.toLat = this.getById(TripPlannerLocControls.SELECTORS.to.lat);\n    this.toLng = this.getById(TripPlannerLocControls.SELECTORS.to.lng);\n    this.fromLat = this.getById(TripPlannerLocControls.SELECTORS.from.lat);\n    this.fromLng = this.getById(TripPlannerLocControls.SELECTORS.from.lng);\n    this.fromStopId = this.getById(\n      TripPlannerLocControls.SELECTORS.from.stop_id\n    );\n    this.toStopId = this.getById(TripPlannerLocControls.SELECTORS.to.stop_id);\n    this.controller = null;\n    this.toInputDirty = false;\n    this.fromInputDirty = false;\n\n    this.markers = {\n      from: null,\n      to: null\n    };\n\n    this.bind();\n    if (this.toInput && this.fromInput) {\n      this.init();\n    }\n  }\n\n  getById(id) {\n    return this.containerElement\n      ? this.containerElement.querySelector(`#${id}`)\n      : document.getElementById(id);\n  }\n\n  init() {\n    this.toController = new Algolia(\n      TripPlannerLocControls.INDICES.to,\n      TripPlannerLocControls.PARAMS\n    );\n    this.fromController = new Algolia(\n      TripPlannerLocControls.INDICES.from,\n      TripPlannerLocControls.PARAMS\n    );\n    this.toAutocomplete = new AlgoliaAutocompleteWithGeo({\n      id: \"trip-planner__autocomplete--to\",\n      selectors: TripPlannerLocControls.SELECTORS.to,\n      indices: Object.keys(TripPlannerLocControls.INDICES.to),\n      locationParams: { position: 1, hitLimit: 3 },\n      popular: TripPlannerLocControls.POPULAR,\n      parent: this,\n      containerEl: this.containerElement\n    });\n\n    this.fromAutocomplete = new AlgoliaAutocompleteWithGeo({\n      id: \"trip-planner__autocomplete--from\",\n      selectors: TripPlannerLocControls.SELECTORS.from,\n      indices: Object.keys(TripPlannerLocControls.INDICES.from),\n      locationParams: { position: 1, hitLimit: 3 },\n      popular: TripPlannerLocControls.POPULAR,\n      parent: this,\n      containerEl: this.containerElement\n    });\n    this.autocompletes = [this.toAutocomplete, this.fromAutocomplete];\n\n    this.autocompletes.forEach(ac => {\n      ac.setError(null);\n      ac.onHitSelected = this.onHitSelected(\n        ac,\n        this.getById(ac._selectors.lat),\n        this.getById(ac._selectors.lng)\n      );\n      ac._resetButton.addEventListener(\"click\", () => {\n        this.removeMarker(ac);\n      });\n      ac.showLocation = this.useMyLocation(ac);\n    });\n\n    this.toController.addWidget(this.toAutocomplete);\n    this.fromController.addWidget(this.fromAutocomplete);\n    this.getById(\"trip-plan-reverse-control\").addEventListener(\n      \"click\",\n      this.reverseTrip\n    );\n    this.setupFormValidation();\n  }\n\n  bind() {\n    this.removeMarker = this.removeMarker.bind(this);\n    this.reverseTrip = this.reverseTrip.bind(this);\n    this.swapMarkers = this.swapMarkers.bind(this);\n    this.resetResetButtons = this.resetResetButtons.bind(this);\n    this.useMyLocation = this.useMyLocation.bind(this);\n    this.onSubmit = this.onSubmit.bind(this);\n    this.onInvalidAddress = this.onInvalidAddress.bind(this);\n    this.onAutocompleteShown = this.onAutocompleteShown.bind(this);\n    this.onInputReset = this.onInputReset.bind(this);\n  }\n\n  setupFormValidation() {\n    this.getById(\"plan\").addEventListener(\"submit\", this.onSubmit);\n\n    this.autocompletes.forEach(ac => {\n      this.getById(ac._selectors.input).addEventListener(\n        \"change\",\n        this.onInputChange(ac)\n      );\n      this.getById(ac._selectors.input).addEventListener(\n        \"input\",\n        this.onInputChange(ac)\n      );\n      this.getById(ac._selectors.input).addEventListener(\n        \"blur\",\n        this.onInputChange(ac)\n      );\n    });\n\n    document.addEventListener(\"autocomplete:empty\", this.onInvalidAddress);\n    document.addEventListener(\"autocomplete:shown\", this.onAutocompleteShown);\n    window.$(document).on(\"autocomplete:reset\", this.onInputReset);\n  }\n\n  onSubmit(ev) {\n    const missingFrom = this.getById(\"from\").value === \"\";\n    const missingTo = this.getById(\"to\").value === \"\";\n    this.toInputDirty = true;\n    this.fromInputDirty = true;\n\n    if (\n      this.fromAutocomplete.error ||\n      this.toAutocomplete.error ||\n      missingFrom ||\n      missingTo\n    ) {\n      ev.preventDefault();\n\n      if (missingFrom) this.toggleError(this.fromAutocomplete, \"missing\");\n      if (missingTo) this.toggleError(this.toAutocomplete, \"missing\");\n\n      return false;\n    }\n    return true;\n  }\n\n  onAutocompleteShown({ srcElement }) {\n    if (srcElement && (srcElement.id === \"from\" || srcElement.id === \"to\")) {\n      const ac = this[`${srcElement.id}Autocomplete`];\n      this.toggleError(ac, null);\n    }\n  }\n\n  onInputReset(ev, { autocomplete }) {\n    if (\n      autocomplete.id === this.fromAutocomplete.id ||\n      autocomplete.id === this.toAutocomplete.id\n    ) {\n      this.toInputDirty = false;\n      this.fromInputDirty = false;\n      this.toggleError(autocomplete, null);\n    }\n  }\n\n  onInputChange(ac) {\n    return () => {\n      if (ac && ac._input.id === \"to\") {\n        this.toInputDirty = true;\n      } else if (ac && ac._input.id === \"from\") {\n        this.fromInputDirty = true;\n      }\n      if (ac.error === \"invalid\") {\n        return;\n      }\n      if (ac && ac._input.value.length === 0) {\n        this.toggleError(ac, \"missing\");\n        return;\n      }\n\n      this.toggleError(ac, null);\n    };\n  }\n\n  onInvalidAddress({ srcElement }) {\n    if (srcElement && (srcElement.id === \"from\" || srcElement.id === \"to\")) {\n      const ac = this[`${srcElement.id}Autocomplete`];\n      this.toggleError(ac, \"invalid\");\n    }\n  }\n\n  toggleError(ac, errorType) {\n    const required = this.getById(ac._selectors.required);\n    const container = this.getById(ac._selectors.container);\n    const input = this.getById(ac._selectors.input);\n    const inputDirty =\n      (input.id === \"from\" && this.fromInputDirty) ||\n      (input.id === \"to\" && this.toInputDirty);\n    if (required && container && input && inputDirty) {\n      if (errorType === \"missing\" || errorType === \"invalid\") {\n        container.classList.add(\"c-form__input-container--error\");\n        required.classList.remove(\"m-trip-plan__hidden\");\n        input.setAttribute(\"aria-invalid\", \"true\");\n      } else if (errorType === null) {\n        container.classList.remove(\"c-form__input-container--error\");\n        required.classList.add(\"m-trip-plan__hidden\");\n        input.setAttribute(\"aria-invalid\", \"false\");\n      } else {\n        throw new Error(`unrecognized error type: ${errorType}`);\n      }\n      ac.setError(errorType);\n      TripPlannerLocControls.updateErrorContent(ac);\n    }\n  }\n\n  static updateErrorContent(ac) {\n    const errorContainer = document.getElementById(ac._selectors.locationError);\n\n    if (errorContainer) {\n      errorContainer.innerHTML = \"\";\n\n      if (ac.error === \"invalid\") {\n        errorContainer.innerHTML =\n          \"We're sorry, but we couldn't find that address.\";\n      }\n    }\n  }\n\n  updateMarker(ac, lat, lng, title) {\n    const label = ac._input.getAttribute(\"data-label\");\n    const detail = {\n      latitude: lat,\n      longitude: lng,\n      label,\n      title\n    };\n    const event = new Event(\"trip-plan:update-marker\");\n    event.detail = detail;\n    document.dispatchEvent(event);\n  }\n\n  removeMarker(ac) {\n    const label = ac._input.getAttribute(\"data-label\");\n    const detail = { label };\n    const event = new Event(\"trip-plan:remove-marker\");\n    event.detail = detail;\n    document.dispatchEvent(event);\n  }\n\n  resetResetButtons() {\n    const from = this.fromAutocomplete;\n    const to = this.toAutocomplete;\n    from.resetResetButton();\n    to.resetResetButton();\n  }\n\n  swapMarkers() {\n    const from = this.fromAutocomplete;\n    const to = this.toAutocomplete;\n\n    const fromVal = from.getValue();\n    const toVal = to.getValue();\n\n    if (fromVal) {\n      this.updateMarker(\n        from,\n        this.getById(\"from_latitude\").value,\n        this.getById(\"from_longitude\").value,\n        fromVal\n      );\n    } else {\n      this.removeMarker(from);\n    }\n\n    if (toVal) {\n      this.updateMarker(\n        to,\n        this.getById(\"to_latitude\").value,\n        this.getById(\"to_longitude\").value,\n        to\n      );\n    } else {\n      this.removeMarker(to);\n    }\n  }\n\n  useMyLocation(ac) {\n    return (lat, lng) => {\n      this.getById(ac._selectors.lat).value = lat;\n      this.getById(ac._selectors.lng).value = lng;\n      const address = ac._input.value;\n      this.updateMarker(ac, lat, lng, address);\n    };\n  }\n\n  onHitSelected(ac, lat, lng) {\n    return ({\n      originalEvent: {\n        _args: [hit, type]\n      }\n    }) => {\n      switch (type) {\n        case \"stops\":\n          this.setStopValue(ac, hit);\n          this.setAutocompleteValue(\n            ac,\n            hit.stop.name,\n            lat,\n            lng,\n            hit._geoloc.lat,\n            hit._geoloc.lng\n          );\n          break;\n        case \"locations\":\n          MapsHelpers.lookupPlace(hit.address).then(res => {\n            const { latitude, longitude } = res;\n            this.setStopValue(ac, hit);\n            this.setAutocompleteValue(\n              ac,\n              hit.address,\n              lat,\n              lng,\n              latitude,\n              longitude\n            );\n            ac._input.blur();\n          });\n          break;\n        case \"usemylocation\":\n          ac.useMyLocationSearch();\n          break;\n        case \"popular\":\n          this.setStopValue(ac, hit);\n          this.setAutocompleteValue(\n            ac,\n            hit.name,\n            lat,\n            lng,\n            hit.latitude,\n            hit.longitude\n          );\n          break;\n        default:\n          console.error(`onHitSelected not implemented for ${type}.`);\n      }\n    };\n  }\n\n  setStopValue(ac, hit) {\n    const stopIdEl = this.getById(ac._selectors.stop_id);\n    if (hit.stop?.id) {\n      stopIdEl.value = hit.stop.id;\n    } else if (hit.stop_id) {\n      stopIdEl.value = hit.stop_id;\n    } else {\n      stopIdEl.value = null;\n    }\n  }\n\n  setAutocompleteValue(ac, name, latEl, lngEl, lat, lng) {\n    ac.setValue(name);\n    latEl.value = lat;\n    lngEl.value = lng;\n    this.updateMarker(ac, lat, lng, name);\n    this.resetResetButtons();\n  }\n\n  reverseTrip(e) {\n    // Prevent default click behavior bc the target area overlaps with the dropdown\n    e.preventDefault();\n    const fromAc = this.fromAutocomplete;\n    const toAc = this.toAutocomplete;\n    const fromError = fromAc.error;\n    const toError = toAc.error;\n    const from = fromAc.getValue();\n    const to = toAc.getValue();\n    const fromLat = this.fromLat.value;\n    const fromLng = this.fromLng.value;\n    const fromInput = this.fromInput.value;\n    const fromStopId = this.fromStopId.value;\n    const toLat = this.toLat.value;\n    const toLng = this.toLng.value;\n    const toInput = this.toInput.value;\n    const toStopId = this.toStopId.value;\n    this.fromLat.value = toLat;\n    this.fromLng.value = toLng;\n    this.fromInput.value = toInput;\n    this.fromStopId.value = toStopId;\n    this.toLat.value = fromLat;\n    this.toLng.value = fromLng;\n    this.toInput.value = fromInput;\n    this.toStopId.value = fromStopId;\n    fromAc.setValue(to);\n    toAc.setValue(from);\n    this.swapMarkers();\n    this.resetResetButtons();\n    this.toggleError(toAc, fromError);\n    this.toggleError(fromAc, toError);\n  }\n}\n\nTripPlannerLocControls.INDICES = {\n  to: {\n    stops: {\n      indexName: \"stops\",\n      query: \"\"\n    }\n  },\n  from: {\n    stops: {\n      indexName: \"stops\",\n      query: \"\"\n    }\n  }\n};\n\nTripPlannerLocControls.SELECTORS = {\n  to: {\n    input: \"to\",\n    lat: \"to_latitude\",\n    lng: \"to_longitude\",\n    resetButton: \"trip-plan__reset--to\",\n    container: \"trip-plan__container--to\",\n    locationLoadingIndicator: \"trip-plan__loading-indicator--to\",\n    required: \"trip-plan__required--to\",\n    locationError: \"trip-plan__location-error--to\",\n    announcer: \"trip-plan__announcer--to\",\n    stop_id: \"to_stop_id\"\n  },\n  from: {\n    input: \"from\",\n    lat: \"from_latitude\",\n    lng: \"from_longitude\",\n    resetButton: \"trip-plan__reset--from\",\n    container: \"trip-plan__container--from\",\n    locationLoadingIndicator: \"trip-plan__loading-indicator--from\",\n    required: \"trip-plan__required--from\",\n    locationError: \"trip-plan__location-error--from\",\n    announcer: \"trip-plan__announcer--from\",\n    stop_id: \"from_stop_id\"\n  },\n  map: \"trip-plan-map--initial\"\n};\n\nTripPlannerLocControls.PARAMS = {\n  stops: {\n    hitsPerPage: 3,\n    facets: [\"*\"],\n    facetFilters: [[]]\n  }\n};\n\nTripPlannerLocControls.POPULAR = [\n  {\n    icon: \"airplane\",\n    name: \"Boston Logan Airport\",\n    features: [],\n    latitude: 42.365396,\n    longitude: -71.017547,\n    url: \"#\"\n  },\n  {\n    icon: \"station\",\n    name: \"South Station\",\n    features: [\"red_line\", \"bus\", \"commuter_rail\", \"access\"],\n    latitude: 42.352271,\n    longitude: -71.055242,\n    stop_id: \"place-sstat\",\n    url: \"#\"\n  },\n  {\n    icon: \"station\",\n    name: \"North Station\",\n    features: [\n      \"orange_line\",\n      \"green_line_c\",\n      \"green_line_e\",\n      \"bus\",\n      \"commuter_rail\",\n      \"access\"\n    ],\n    latitude: 42.365577,\n    longitude: -71.06129,\n    stop_id: \"place-north\",\n    url: \"#\"\n  }\n];\n","// galleries is global to this function and keeps track of 1 or more galleries on a single page\nlet galleries = {};\nconst PAGE_SIZE = 10;\n\nexport default function photoGallery($) {\n  $ = $ || window.jQuery;\n  document.addEventListener(\"turbolinks:load\", () => handlePageLoad($), {\n    passive: true\n  });\n\n  // event handler for changing image\n  $(document).on(\"click\", '[data-image=\"gallery\"]', handleClickImage);\n\n  // event handler for previous / next page\n  $(document).on(\"click\", '[data-image=\"navigation\"]', handleClickNavigation);\n}\n\n/* DATA FUNCTIONS */\nfunction initializeData($) {\n  const output = {};\n  let $galleryEl;\n  let galleryId;\n  let images;\n\n  $('[data-component=\"photo-gallery\"]').each((_offset, el) => {\n    $galleryEl = $(el);\n\n    // create a unique id for each gallery on a page\n    galleryId = guid();\n    $galleryEl.attr(\"data-gallery-id\", galleryId);\n\n    // find all images/captions that belong to a gallery\n    images = $galleryEl.find(\"figure\").get();\n\n    // create an object to keep track of image gallery parameters\n    output[galleryId] = makeGallery($galleryEl, images);\n  });\n\n  return output;\n}\n\n// In IE11, images get overwritten with empty content, so as backup we also save the HTML content inside the <figure>'s in 'figures':\nconst makeGallery = ($el, images) => ({\n  el: $el,\n  images,\n  figures: images.map(img => img.innerHTML),\n  imageOffset: 0,\n  pageOffset: 0,\n  lastPage: calculateLastPage(images.length)\n});\n\nconst calculateLastPage = photoCount =>\n  Math.max(0, Math.ceil(photoCount / PAGE_SIZE) - 1);\n\nconst getGalleryImageByOffset = (id, offset) => {\n  const imageByOffset = galleries[id].images[offset];\n\n  // empty content will likely happen for IE11\n  if (!imageByOffset.innerHTML) {\n    imageByOffset.innerHTML = galleries[id].figures[offset];\n  }\n\n  return imageByOffset;\n};\n\nfunction setGalleryImageOffset(id, offset) {\n  const lastOffset = galleries[id].images.length - 1;\n  if (offset === -1) {\n    offset = lastOffset;\n  } else if (offset > lastOffset) {\n    offset = 0;\n  }\n  galleries[id].imageOffset = offset;\n  return offset;\n}\n\nfunction setGalleryPageOffset(id, increment) {\n  let page = galleries[id].pageOffset + increment;\n  if (page === -1) {\n    page = galleries[id].lastPage;\n  } else if (page > galleries[id].lastPage) {\n    page = 0;\n  }\n  galleries[id].pageOffset = page;\n  return page;\n}\n\n/* EVENT HANDLERS */\nexport function handlePageLoad($) {\n  galleries = initializeData($);\n  Object.keys(galleries).forEach(galleryId => render(galleryId));\n}\n\nfunction handleClickImage(ev) {\n  ev.preventDefault();\n  const id = ev.currentTarget.getAttribute(\"data-gallery\");\n  const offset = ev.currentTarget.getAttribute(\"data-offset\");\n  const actualOffset = setGalleryImageOffset(id, offset);\n  replaceActiveImage(id, getGalleryImageByOffset(id, actualOffset));\n}\n\nfunction handleClickNavigation(ev) {\n  ev.preventDefault();\n  const id = ev.currentTarget.getAttribute(\"data-gallery\");\n  const increment = parseInt(ev.currentTarget.getAttribute(\"data-increment\"));\n  const focusEl = increment === 1 ? \"next\" : \"prev\";\n  const isDesktop = isVisible(`${id}images`);\n\n  // when on desktop: navigate between sets of images\n  // when on mobile: navigate between images\n  if (isDesktop) {\n    // change the page and set the image to the first one on the page\n    const page = setGalleryPageOffset(id, increment);\n    setGalleryImageOffset(id, page * PAGE_SIZE);\n  } else {\n    // set the image to the next or previous\n    setGalleryImageOffset(id, galleries[id].imageOffset + increment);\n  }\n  render(id, id.concat(focusEl));\n}\n\n/* UTILITY FUNCTIONS */\nconst isVisible = id => document.getElementById(id).offsetLeft > 0;\nconst guid = () =>\n  new Date().getTime().toString() + Math.floor(Math.random() * 1000000);\n\n/* RENDERING FUNCTIONS */\nfunction render(id, focusId) {\n  // get main image\n  const main = galleries[id].images\n    .filter((_el, offset) => offset == galleries[id].imageOffset)\n    .pop();\n\n  const mainImage = main.querySelectorAll(\"img\").item(0);\n\n  const mainCaption = main.querySelectorAll(\"figcaption\").item(0);\n\n  // get pages of images\n  const totalImages = galleries[id].images.length;\n  const firstImage = galleries[id].pageOffset * PAGE_SIZE;\n  const lastImage = firstImage + PAGE_SIZE;\n  const pagination = galleries[id].images.length > PAGE_SIZE;\n  const images = galleries[id].images.filter(\n    (_el, offset) => offset >= firstImage && offset < lastImage\n  );\n\n  // IE returns null for getAttribute(...) whereas other browsers do return a value --> using .nodeValue as fallback for these specific cases\n  const imgSource =\n    mainImage.getAttribute(\"src\") || mainImage.attributes.src.nodeValue;\n  const imgAlt =\n    mainImage.getAttribute(\"alt\") || mainImage.attributes.alt.nodeValue;\n\n  // render group of images\n  const markUp = `\n    <div class=\"c-photo-gallery__main-container\">\n      <figure>\n        <div class=\"c-photo-gallery__main-window\">\n          <img class=\"c-photo-gallery__main-image\"\n            id=\"${`${id}primary`}\"\n            alt=\"${imgAlt}\"\n            src=\"${imgSource}\">\n        </div>\n        <figcaption id=\"${`${id}name`}\" class=\"c-photo-gallery__main-title\">${\n    mainCaption.innerHTML\n  }</figcaption>\n      </figure>\n    </div>\n    <div id=\"${`${id}images`}\" class=\"c-photo-gallery__thumbnails c-thumbnail-count--${\n    images.length\n  } c-thumbnail-total--${totalImages}\">\n      ${renderImages(images, firstImage, id)}\n    </div>\n    ${renderNavigation(id, pagination)}\n  `;\n\n  // replace HTML in the page\n  galleries[id].el.html(markUp);\n\n  // if an element was passed in to focus on, set focus\n  focusId ? document.getElementById(focusId).focus() : null;\n}\n\nfunction renderNavigation(id, pagination) {\n  const hideOnDesktop = pagination ? \"\" : \" hidden-md-up\";\n  return `<div class=\"c-photo-gallery__nav-btns${hideOnDesktop}\">\n      <a href=\"#gallery-previous\"\n        title=\"previous photos\"\n        role=\"navigation\"\n        id=\"${`${id}prev`}\"\n        data-gallery=\"${id}\"\n        data-image=\"navigation\"\n        data-increment=\"-1\"><i class=\"fa fa-caret-left\" aria-hidden=\"true\"></i> Previous</a>\n      <a href=\"#gallery-next\"\n        title=\"next photos\"\n        role=\"navigation\"\n        id=\"${`${id}next`}\"\n        data-gallery=\"${id}\"\n        data-image=\"navigation\"\n        data-increment=\"1\">Next <i class=\"fa fa-caret-right\" aria-hidden=\"true\"></i></a>\n    </div>`;\n}\n\nfunction renderImages(images, firstImage, id) {\n  return images\n    .map((image, offset) => {\n      const firstImg = image.querySelectorAll(\"img\").item(0);\n\n      // IE returns null for getAttribute(...) whereas other browsers do return a value --> using .nodeValue as fallback for these specific cases\n      const imgSource =\n        firstImg.getAttribute(\"src\") || firstImg.attributes.src.nodeValue;\n\n      const imgAlt =\n        firstImg.getAttribute(\"alt\") || firstImg.attributes.alt.nodeValue;\n\n      return `<a href=\"#gallery-image\"\n        data-image=\"gallery\"\n        data-gallery=\"${id}\"\n        id=\"${id + (firstImage + offset)}\"\n        role=\"navigation\"\n        title=\"change photo to '${imgAlt}'\"\n        data-offset=\"${firstImage + offset}\">\n          <img\n            class=\"c-photo-gallery__thumbnail\"\n            alt=\"${imgAlt}\"\n            src=\"${imgSource}\"></a>`;\n    })\n    .join(\"\");\n}\n\nfunction replaceActiveImage(id, image) {\n  const activeImage = document.getElementById(`${id}primary`);\n  const activeImageName = document.getElementById(`${id}name`);\n\n  const firstImage = image.querySelectorAll(\"img\").item(0);\n\n  activeImage.setAttribute(\"src\", firstImage.getAttribute(\"src\"));\n  activeImage.setAttribute(\"alt\", firstImage.getAttribute(\"alt\"));\n  activeImageName.innerHTML = image\n    .querySelectorAll(\"figcaption\")\n    .item(0).innerHTML;\n}\n","export const PAGE_IDS = [\n  \"search-stop\",\n  \"search-route\",\n  \"search-route--subway\",\n  \"search-route--commuter_rail\",\n  \"search-route--bus\",\n  \"search-route--ferry\"\n];\n\nexport const PAGE_IDS_WITHOUT_GOOGLE = [\"search-projects\"];\n\nexport const FACET_MAP = {\n  \"search-stop\": \"stations,stops,locations\",\n  \"search-route\": \"subway,commuter-rail,bus,ferry,locations\",\n  \"search-route--subway\": \"subway,stations,stops,locations\",\n  \"search-route--commuter_rail\": \"commuter-rail,stations,stops,locations\",\n  \"search-route--bus\": \"bus,stations,stops,locations\",\n  \"search-route--ferry\": \"ferry,stations,stops,locations\",\n  \"search-projects\": \"projects\"\n};\n\nconst FACET_FILTER_MAP = {\n  \"search-stop\": [],\n  \"search-route\": [0, 1, 2, 3, 4].map(type => `route.type:${type}`),\n  \"search-route--subway\": [\"route.type:0\", \"route.type:1\"],\n  \"search-route--commuter_rail\": [\"route.type:2\"],\n  \"search-route--bus\": [\"route.type:3\"],\n  \"search-route--ferry\": [\"route.type:4\"],\n  \"search-projects\": [\"_content_type:project\", \"_content_type:project_update\"]\n};\n\nconst determineIndex = (isStopSearch, isProjectsSearch) => {\n  if (isStopSearch) return \"stops\";\n  if (isProjectsSearch) return \"drupal\";\n  return \"routes\";\n};\n\nexport const buildOptions = pageId => {\n  const selectors = {\n    input: `${pageId}__input`,\n    container: `${pageId}__container`,\n    goBtn: `${pageId}__input-go-btn`,\n    locationLoadingIndicator: `${pageId}__loading-indicator`,\n    resetButton: `${pageId}__reset`,\n    announcer: `${pageId}__announcer`\n  };\n\n  const params = {};\n\n  const indices = {};\n\n  const isStopSearch = pageId === \"search-stop\";\n  const isProjectsSearch = pageId === \"search-projects\";\n\n  const index = determineIndex(isStopSearch, isProjectsSearch);\n\n  params[index] = {\n    hitsPerPage: 5,\n    facets: [FACET_MAP[pageId]],\n    facetFilters: [FACET_FILTER_MAP[pageId]]\n  };\n\n  indices[index] = {\n    indexName: index,\n    query: \"\"\n  };\n\n  return {\n    selectors,\n    params,\n    indices\n  };\n};\n","import Algolia from \"./algolia-search\";\nimport * as AlgoliaResult from \"./algolia-result\";\nimport AlgoliaAutocompleteWithGeo from \"./algolia-autocomplete-with-geo\";\n// eslint-disable-next-line import/no-unresolved\nimport * as QueryHelpers from \"../ts/helpers/query\";\n\nimport {\n  PAGE_IDS,\n  PAGE_IDS_WITHOUT_GOOGLE,\n  FACET_MAP,\n  buildOptions\n} from \"./algolia-embedded-search-options\";\n\nexport class AlgoliaEmbeddedSearch {\n  #templates;\n\n  constructor({\n    pageId,\n    selectors,\n    params,\n    indices,\n    locationParams,\n    templates = AlgoliaResult.TEMPLATES\n  }) {\n    this.pageId = pageId;\n    this.selectors = selectors;\n    this.params = params;\n    this.indices = indices;\n    this.locationParams = locationParams || {\n      position: Object.keys(indices).length,\n      hitLimit: 3\n    };\n    this.input = document.getElementById(selectors.input);\n    this.controller = null;\n    this.autocomplete = null;\n    this.goBtn = document.getElementById(selectors.goBtn);\n    this.#templates = templates;\n\n    this.bind();\n    if (this.input) {\n      this.init();\n    }\n  }\n\n  bind() {\n    this.onClickGoBtn = this.onClickGoBtn.bind(this);\n  }\n\n  init() {\n    this.input.value = \"\";\n    this.controller = new Algolia(this.indices, this.params);\n    this.autocomplete = new AlgoliaAutocompleteWithGeo({\n      id: this.pageId,\n      selectors: this.selectors,\n      indices: Object.keys(this.indices),\n      locationParams: this.locationParams,\n      popular: [],\n      templates: this.#templates,\n      parent: this\n    });\n    this.addEventListeners();\n    this.controller.addWidget(this.autocomplete);\n  }\n\n  addEventListeners() {\n    this.goBtn.removeEventListener(\"click\", this.onClickGoBtn);\n    this.goBtn.addEventListener(\"click\", this.onClickGoBtn);\n  }\n\n  buildSearchParams() {\n    return QueryHelpers.paramsToString(\n      {\n        query: this.input.value,\n        facets: this.facets(),\n        showmore: this.indexNames()\n      },\n      window.encodeURIComponent\n    );\n  }\n\n  onClickGoBtn() {\n    return window.Turbolinks.visit(`/search${this.buildSearchParams()}`);\n  }\n\n  indexNames() {\n    return Object.keys(this.indices).join(\",\");\n  }\n\n  facets() {\n    return FACET_MAP[this.pageId];\n  }\n\n  getParams() {\n    return {\n      from: this.pageId,\n      query: this.input.value\n    };\n  }\n}\n\nexport const initWithoutGoogle = () => {\n  PAGE_IDS_WITHOUT_GOOGLE.forEach(pageId => {\n    const { selectors, params, indices } = buildOptions(pageId);\n\n    /* eslint-disable no-new */\n    new AlgoliaEmbeddedSearch({\n      pageId,\n      selectors,\n      params,\n      indices\n    });\n  });\n};\n\nexport const init = () => {\n  PAGE_IDS.forEach(pageId => {\n    const { selectors, params, indices } = buildOptions(pageId);\n    document.addEventListener(\"turbolinks:load\", () => {\n      new AlgoliaEmbeddedSearch({\n        pageId,\n        selectors,\n        params,\n        indices,\n        templates: AlgoliaResult.TEMPLATES_ALT_USE_MY_LOCATION\n      });\n    });\n  });\n};\n","import { AlgoliaEmbeddedSearch } from \"./algolia-embedded-search\";\nimport { TEMPLATES_ALT_USE_MY_LOCATION } from \"./algolia-result\";\n// eslint-disable-next-line import/no-unresolved\nimport * as QueryHelpers from \"../ts/helpers/query\";\n\nconst INDICES = {\n  routes: {\n    indexName: \"routes\",\n    query: \"\"\n  },\n  stops: {\n    indexName: \"stops\",\n    query: \"\"\n  },\n  pages: {\n    indexName: \"drupal\",\n    query: \"\"\n  }\n};\n\n// exported for testing\nexport const buildSelectors = pageId => ({\n  input: `${pageId}__input`,\n  container: `${pageId}__container`,\n  goBtn: `${pageId}__input-go-btn`,\n  locationLoadingIndicator: `${pageId}__loading-indicator`,\n  resetButton: `${pageId}__reset`,\n  announcer: `${pageId}__announcer`\n});\n\nconst PARAMS = {\n  stops: {\n    hitsPerPage: 2,\n    facets: [\"*\"],\n    facetFilters: [[]]\n  },\n  routes: {\n    hitsPerPage: 5,\n    facets: [\"*\"],\n    facetFilters: [[]]\n  },\n  pages: {\n    hitsPerPage: 2,\n    facets: [\"*\"],\n    facetFilters: [\n      [\n        \"_content_type:page\",\n        \"_content_type:search_result\",\n        \"_content_type:diversion\",\n        \"_content_type:landing_page\",\n        \"_content_type:person\",\n        \"_content_type:project\",\n        \"_content_type:project_update\"\n      ]\n    ]\n  }\n};\n\nconst LOCATION_PARAMS = {\n  position: 3,\n  hitLimit: 2\n};\n\n// exported for testing\nexport const doInit = id => {\n  const selectors = buildSelectors(id);\n  const input = document.getElementById(selectors.input);\n  if (!input) return null;\n  // The global search page expects the query param to be ?query=foo, but\n  // the &Phoenix.HTML.Form.text_input/3 helper that builds this input\n  // requires the input's name to be a nested value (i.e. name=\"query[input]\"),\n  // Fixing this at the source would require more refactoring than we could\n  // justify; hence, this dirty hack. -kh\n  input.setAttribute(\"name\", \"query\");\n\n  const search = new AlgoliaEmbeddedSearch({\n    pageId: id,\n    indices: INDICES,\n    params: PARAMS,\n    selectors: selectors,\n    locationParams: LOCATION_PARAMS,\n    templates: TEMPLATES_ALT_USE_MY_LOCATION\n  });\n\n  search.buildSearchParams = () =>\n    QueryHelpers.paramsToString(\n      {\n        query: search.input.value\n      },\n      window.encodeURIComponent\n    );\n\n  return search;\n};\n\nexport function init() {\n  document.addEventListener(\"turbolinks:load\", () => {\n    [\n      \"search-homepage\",\n      \"search-header-desktop\",\n      \"search-header-mobile\",\n      \"search-error-page\"\n    ].forEach(id => doInit(id));\n  });\n}\n","import Algolia from \"./algolia-search\";\nimport * as MapsHelpers from \"./maps-helpers\";\n\nexport class AlgoliaWithGeo extends Algolia {\n  constructor(indices, defaultParams, bounds, hitLimit) {\n    super(indices, defaultParams);\n    this._locationEnabled = true;\n    this._hitLimit = hitLimit ? hitLimit : 5;\n  }\n\n  /*\n   * Writing a comment because this logic is confusing:\n   * Here is the table of when things should be disabled\n   * or enabled based on the state of things\n   *\n   * loc_enabled | activeQueryIds len > 0 | enableLocation | enableAlgolia\n   * true          true                    true             true\n   * true          false                   true             false\n   * false         false                   true             true\n   * false         true                    false            true\n   */\n  _doSearch(allQueries) {\n    let algoliaResults = {};\n    let locationResults = {};\n    if (!(this._locationEnabled && this._activeQueryIds.length == 0)) {\n      algoliaResults = this._sendQueries(allQueries)\n        .then(this._processAlgoliaResults())\n        .catch(err => console.error(err));\n    }\n\n    if (!(!this._locationEnabled && this._activeQueryIds.length > 0)) {\n      locationResults = MapsHelpers.autocomplete({\n        input: this._lastQuery,\n        hitLimit: this._hitLimit\n      }).catch(error =>\n        console.error(\"Error while contacting AWS Location Service:\", error)\n      );\n    }\n\n    return Promise.all([algoliaResults, locationResults])\n      .then(resultsList => {\n        this.updateWidgets(\n          resultsList.reduce((acc, res) => Object.assign(acc, res))\n        );\n      })\n      .catch(err => console.error(err));\n  }\n\n  reset() {\n    super.reset();\n    this._locationEnabled = false;\n  }\n\n  enableLocationSearch(enabled) {\n    this._locationEnabled = enabled;\n  }\n}\n","import hogan from \"hogan.js\";\n\nexport class FacetItem {\n  get selectors() {\n    return {\n      textDisplay: `facet-text-${this._id}`,\n      checkbox: `checkbox-item-${this._id}`,\n      counter: `facet-item-counter-${this._id}`,\n      childrenDiv: `facet-children-${this._id}`,\n      checkboxLabel: `facet-label-${this._id}`,\n      icon: `facet-icon-${this._id}`,\n      expansionContainer: `expansion-container-${this._id}`,\n      checkboxControlContainer: `checkbox-container-${this._id}`\n    };\n  }\n\n  get templates() {\n    const tabbable = this._children.length > 0;\n    const tabToExpand = tabbable\n      ? `role=\"button\" aria-expanded=\"false\" tabindex=\"0\"`\n      : \"\";\n    return {\n      facetItem: hogan.compile(`\n        <div class=\"{{class}}\">\n          <div id=\"${this.selectors.expansionContainer}\" class=\"c-facets__flex-container--normal\" ${tabToExpand}>\n            <div class=\"c-facets__icon\">\n              {{#iconClass}}\n                {{{iconClass}}}\n              {{/iconClass}}\n            </div>\n            <div id=\"${this.selectors.textDisplay}\" class=\"c-facets__title\">{{text}}</div>\n          </div>\n          <div id=\"${this.selectors.checkboxControlContainer}\" class=\"c-facets__flex-container--wide\">\n            <div class=\"c-facets__facet-item\" id=\"${this.selectors.counter}\"></div>\n            <div class=\"c-checkbox\">\n              <input id=\"${this.selectors.checkbox}\" class=\"c-checkbox__input\" type=\"checkbox\" name=\"{{text}}\" aria-labelledby=\"${this.selectors.textDisplay}\">\n              <label id=\"${this.selectors.checkboxLabel}\" class=\"c-checkbox__label\" for=\"${this.selectors.checkbox}\"></label>\n            </div>\n          </div>\n        </div>\n        <div id=\"${this.selectors.childrenDiv}\"></div>\n      `)\n    };\n  }\n\n  constructor(data, parent) {\n    this._id = data.id;\n    this._name = data.name;\n    this._parent = parent;\n    this._iconHTML = data.icon;\n    this._facets = data.facets || [];\n    this._prefix = data.prefix;\n    this._count = 0;\n    this._facets = this._facets.map(facet => {\n      return `${this._prefix}:${facet}`;\n    });\n    if (this._facets.length > 0) {\n      this.addToMap(this._facets, this);\n    }\n\n    this._checkbox = null;\n    this._counter = null;\n    this._textDisplay = null;\n    this._childrenDiv = null;\n    this._icon = null;\n    this._children = [];\n    if (data.items) {\n      this._iconHTML = this._triangleRightIcon(this._id);\n      this._children = data.items.map(item => {\n        if (!item.prefix) {\n          item.prefix = this._prefix;\n        }\n        return new FacetItem(item, this);\n      });\n    }\n  }\n\n  addToMap(facets, facetItem) {\n    this._parent.addToMap(facets, facetItem);\n  }\n\n  getActiveFacets() {\n    const children = [].concat.apply(\n      [],\n      this._children.map(child => child.getActiveFacets())\n    );\n    if (this.isChecked()) {\n      return this._facets.concat(children);\n    }\n    return children;\n  }\n\n  isChecked() {\n    return this._checkbox.checked;\n  }\n\n  _triangleRightIcon(id) {\n    return `<span id=\"${this.selectors.icon}\" class=\"c-facets__triangle--right\"></span>`;\n  }\n\n  toggleExpansion() {\n    if (this._childrenDiv.style.display == \"none\") {\n      document\n        .getElementById(this.selectors.expansionContainer)\n        .setAttribute(\"aria-expanded\", \"true\");\n      document\n        .getElementById(this.selectors.expansionContainer)\n        .setAttribute(\"aria-controls\", this._childrenDiv.id);\n      this._childrenDiv.style.display = \"block\";\n      this._icon.classList.remove(\"c-facets__triangle--right\");\n      this._icon.classList.add(\"c-facets__triangle--down\");\n    } else {\n      document\n        .getElementById(this.selectors.expansionContainer)\n        .setAttribute(\"aria-expanded\", \"false\");\n      document\n        .getElementById(this.selectors.expansionContainer)\n        .setAttribute(\"aria-controls\", this._childrenDiv.id);\n      this._childrenDiv.style.display = \"none\";\n      this._icon.classList.remove(\"c-facets__triangle--down\");\n      this._icon.classList.add(\"c-facets__triangle--right\");\n    }\n  }\n\n  gatherElements() {\n    this._textDisplay = document.getElementById(this.selectors.textDisplay);\n    this._checkbox = document.getElementById(this.selectors.checkbox);\n    this._counter = document.getElementById(this.selectors.counter);\n    this._childrenDiv = document.getElementById(this.selectors.childrenDiv);\n    this._checkboxLabel = document.getElementById(this.selectors.checkboxLabel);\n    this._icon = document.getElementById(this.selectors.icon);\n    this._checkbox.checked = false;\n    this.setupListeners();\n  }\n\n  check() {\n    this._checkbox.checked = true;\n    this._children.forEach(child => {\n      child.check();\n    });\n  }\n\n  uncheckUI() {\n    this._checkbox.checked = false;\n  }\n\n  reset() {\n    this.uncheck();\n    this._children.forEach(child => child.reset());\n    this.updateCount(0);\n  }\n\n  uncheck() {\n    this.uncheckUI();\n    this._children.forEach(child => {\n      child.uncheck();\n    });\n  }\n\n  isChecked() {\n    return this._checkbox.checked;\n  }\n\n  toggleCheck() {\n    if (this._checkbox.checked) {\n      this.uncheck();\n    } else {\n      this.check();\n    }\n    this._parent.update();\n  }\n\n  update() {\n    this.updateState();\n    this._parent.update();\n  }\n\n  updateState() {\n    if (this.allChildrenStatus(true)) {\n      this.check();\n    } else {\n      this.uncheckUI();\n    }\n    this._parent.updateState();\n  }\n\n  allChildrenStatus(status) {\n    if (this._children.length == 0) {\n      return this._checkbox.checked == status;\n    }\n    return this._children.every(child => {\n      return child.allChildrenStatus(status);\n    });\n  }\n\n  updateCount(count) {\n    if (count === undefined) {\n      count = 0;\n    }\n    this._count = count;\n    this._counter.innerHTML = count ? count : \"\";\n    this._parent.updateCount(this._parent.sumChildren());\n  }\n\n  sumChildren(count) {\n    if (this._children.length == 0) {\n      return this._count;\n    }\n    return this._children\n      .map(child => {\n        return child.sumChildren();\n      })\n      .reduce(function(total, num) {\n        return total + num;\n      }, 0);\n  }\n\n  render(container, itemStyle) {\n    const div = document.createElement(\"div\");\n    div.id = `facet-item-${this._id}`;\n    div.innerHTML = this.templates.facetItem.render({\n      class: itemStyle,\n      text: this._name,\n      iconClass: this._iconHTML\n    });\n    container.appendChild(div);\n    this.gatherElements();\n    this._childrenDiv.style.display = \"none\";\n    this._childrenDiv = document.getElementById(`facet-children-${this._id}`);\n    this._children.forEach(child => {\n      child.render(this._childrenDiv, \"c-facets__search-facet-child\");\n    });\n  }\n\n  setupListeners() {\n    const expansionContainer = document.getElementById(\n      this.selectors.expansionContainer\n    );\n    const checkboxControlContainer = document.getElementById(\n      this.selectors.checkboxControlContainer\n    );\n    const checkbox = document.getElementById(this.selectors.checkbox);\n    checkboxControlContainer.addEventListener(\"click\", e => {\n      this.toggleCheck();\n    });\n    checkbox.addEventListener(\"keydown\", e => {\n      const key = e.key || e.keyCode;\n      if (key === \" \" || key === \"Spacebar\" || key === 32) {\n        this.toggleCheck();\n      }\n    });\n    if (this._children.length > 0) {\n      expansionContainer.addEventListener(\"keydown\", e => {\n        const key = e.key || e.keyCode;\n        if (key === \" \" || key === \"Spacebar\" || key === 32) {\n          e.preventDefault(); // Don't scroll down page on spacebar, just expand\n          this.toggleExpansion();\n        }\n        if (key === \"Enter\" || key === \"Enter\" || key === 13) {\n          this.toggleExpansion();\n        }\n      });\n      expansionContainer.addEventListener(\"click\", () => {\n        this.toggleExpansion();\n      });\n    }\n  }\n\n  setupAllListeners() {\n    this.setupListeners();\n    this._children.forEach(function(child) {\n      child.setupAllListeners();\n    });\n  }\n\n  selectedFacetNames(acc) {\n    if (this.isChecked()) {\n      acc.push(this._id);\n    }\n    this._children.forEach(child => child.selectedFacetNames(acc));\n    return acc;\n  }\n\n  loadFacet(id) {\n    if (this._children.length > 0) {\n      this._children.forEach(child => child.loadFacet(id));\n    }\n    if (this._id == id) {\n      this.check();\n      this.updateState();\n    }\n  }\n}\n","import { FacetItem } from \"./facet-item\";\n\nexport class FacetGroup {\n  constructor(facetData, parent) {\n    this._facetMap = {};\n    this._parent = parent;\n    this._item = new FacetItem(facetData, this);\n  }\n\n  addToMap(facets, facetItem) {\n    this._facetMap[facets] = facetItem;\n  }\n\n  render(container, style) {\n    this._item.render(container, style);\n  }\n\n  sumChildren() {\n    return true;\n  }\n\n  updateCount() {\n    return true;\n  }\n\n  updateCounts(facetResults) {\n    Object.keys(this._facetMap).forEach(key => {\n      let count = 0;\n      key.split(\",\").forEach(facet => {\n        if (facetResults[facet]) {\n          count += facetResults[facet];\n        }\n      });\n      this._facetMap[key].updateCount(count);\n    });\n  }\n\n  update() {\n    this._parent.update();\n  }\n\n  updateState() {\n    this._parent.updateState();\n  }\n\n  getFacetsForQuery() {\n    return this._item.getActiveFacets();\n  }\n\n  shouldDisableQuery() {\n    return this._item.allChildrenStatus(false);\n  }\n\n  modifySearch(search, queryId) {\n    if (!this.shouldDisableQuery()) {\n      search.updateFacetFilters(queryId, this.getFacetsForQuery());\n      search.addActiveQuery(queryId);\n    }\n  }\n\n  reset() {\n    this._item.reset();\n  }\n\n  selectedFacetNames() {\n    return this._item.selectedFacetNames([]);\n  }\n\n  loadFacet(id) {\n    this._item.loadFacet(id);\n  }\n}\n","import hogan from \"hogan.js\";\nimport { FacetGroup } from \"./facet-group\";\nimport { FacetLocationGroup } from \"./facet-location-group\";\n\nconst facetGroupClasses = { FacetGroup, FacetLocationGroup };\n\nexport class FacetBar {\n  constructor(container, search, facets, parent) {\n    this._container = document.getElementById(container);\n    this._search = search;\n    this._parent = parent;\n    this._items = {};\n    this._facetPrefixes = [];\n    if (this._container) {\n      this._container.innerHTML = \"\";\n      this._parseFacets(facets);\n    }\n  }\n\n  updateCounts(facetResults) {\n    Object.keys(this._items).forEach(queryId => {\n      this._items[queryId].updateCounts(facetResults);\n    });\n  }\n\n  _parseFacets(facets) {\n    Object.keys(facets).forEach(queryId => {\n      const facetData = facets[queryId].item;\n      if (!facetData.prefix) {\n        facetData.prefix = facets[queryId].facetName;\n      }\n      const groupClass = facetGroupClasses[facetData.cls || \"FacetGroup\"];\n      this._items[queryId] = new groupClass(facetData, this);\n      this._items[queryId].render(this._container, \"c-facets__search-facet\");\n    });\n  }\n\n  reset() {\n    const items = this._items;\n\n    for (let item in items) {\n      items[item].reset();\n    }\n    this._resetQueries();\n  }\n\n  _resetQueries() {\n    this._search.updateActiveQueries([]);\n    for (const item in this._items) {\n      this._items[item].modifySearch(this._search, item);\n    }\n  }\n\n  update() {\n    this.updateState();\n    this._search.search();\n  }\n\n  updateState() {\n    this._resetQueries();\n    this._parent.updateState();\n  }\n\n  selectedFacetNames() {\n    return Object.keys(this._items).reduce(\n      (acc, key) => this._selectedFacetsReducer(key, acc),\n      []\n    );\n  }\n\n  _selectedFacetsReducer(key, acc) {\n    this._items[key].selectedFacetNames().forEach(name => acc.push(name));\n    return acc;\n  }\n\n  loadState(facets) {\n    facets.forEach(id => {\n      Object.values(this._items).forEach(item => item.loadFacet(id));\n    });\n  }\n}\n","import { FacetGroup } from \"./facet-group\";\n\nexport class FacetLocationGroup extends FacetGroup {\n  constructor(data, parent) {\n    super(data, parent);\n  }\n\n  modifySearch(search, queryId) {\n    search.enableLocationSearch(this._item.isChecked());\n  }\n\n  updateCounts(facetResults) {\n    this._item.updateCount(facetResults[\"locations\"]);\n  }\n}\n","import { FacetBar } from \"./facet-bar\";\nimport * as Icons from \"./icons\";\n\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable eqeqeq */\n/* eslint-disable import/prefer-default-export */\n\nexport class AlgoliaFacets {\n  constructor(selectors, search, parent) {\n    this.selectors = selectors;\n    this._closeModalBtn = null;\n    this._showFacetsBtn = null;\n    this._parent = parent;\n    this._facetsContainer = null;\n    this._bind();\n    const facets = {\n      routes: {\n        queryId: \"routes\",\n        facetName: \"route.type\",\n        item: {\n          id: \"lines-routes\",\n          name: \"Lines and Routes\",\n          items: [\n            {\n              id: \"subway\",\n              name: \"Subway\",\n              facets: [\"0\", \"1\"],\n              icon: Icons.getFeatureIcon(\"subway\")\n            },\n            {\n              id: \"bus\",\n              name: \"Bus\",\n              facets: [\"3\"],\n              icon: Icons.getFeatureIcon(\"bus\")\n            },\n            {\n              id: \"commuter-rail\",\n              name: \"Commuter Rail\",\n              facets: [\"2\"],\n              icon: Icons.getFeatureIcon(\"commuter_rail\")\n            },\n            {\n              id: \"ferry\",\n              name: \"Ferry\",\n              facets: [\"4\"],\n              icon: Icons.getFeatureIcon(\"ferry\")\n            }\n          ]\n        }\n      },\n      stops: {\n        queryId: \"stops\",\n        facetName: \"stop.station?\",\n        item: {\n          id: \"stops\",\n          name: \"Stations and Stops\",\n          items: [\n            {\n              id: \"facet-station\",\n              name: \"Stations\",\n              facets: [\"true\"],\n              icon: Icons.getFeatureIcon(\"station\")\n            },\n            {\n              id: \"facet-stop\",\n              name: \"Stops\",\n              facets: [\"false\"],\n              icon: Icons.getFeatureIcon(\"stop\")\n            }\n          ]\n        }\n      },\n      pages: {\n        queryId: \"pages\",\n        facetName: \"_content_type\",\n        item: {\n          id: \"page\",\n          name: \"Pages\",\n          facets: [\n            \"page\",\n            \"search_result\",\n            \"landing_page\",\n            \"person\",\n            \"diversion\"\n          ],\n          icon: this._faIcon(\"fa-info\")\n        }\n      },\n      projects: {\n        queryId: \"projects\",\n        facetName: \"_content_type\",\n        item: {\n          id: \"projects\",\n          name: \"Projects\",\n          facets: [\"project\", \"project_update\"],\n          icon: this._faIcon(\"fa-info\")\n        }\n      },\n\n      documents: {\n        queryId: \"documents\",\n        facetName: \"_content_type\",\n        item: {\n          id: \"document\",\n          name: \"Documents\",\n          prefix: \"search_api_datasource\",\n          facets: [\"entity:file\"],\n          icon: this._faIcon(\"fa-file-o\")\n        }\n      },\n      events: {\n        queryId: \"events\",\n        facetName: \"_content_type\",\n        item: {\n          id: \"event\",\n          name: \"Events\",\n          icon: this._faIcon(\"fa-calendar\"),\n          facets: [\"event\"]\n        }\n      },\n      news: {\n        queryId: \"news\",\n        facetName: \"_content_type\",\n        item: {\n          id: \"news\",\n          name: \"News\",\n          icon: this._faIcon(\"fa-newspaper-o\"),\n          facets: [\"news_entry\"]\n        }\n      },\n      locations: {\n        queryId: \"locations\",\n        item: {\n          id: \"locations\",\n          name: \"Locations\",\n          cls: \"FacetLocationGroup\",\n          icon: this._faIcon(\"fa-map-marker\")\n        }\n      }\n    };\n\n    this._facetBar = new FacetBar(\"search-facets\", search, facets, this);\n  }\n\n  _bind() {\n    this.onClickCloseModalBtn = this.onClickCloseModalBtn.bind(this);\n    this.onClickShowFacetsBtn = this.onClickShowFacetsBtn.bind(this);\n  }\n\n  onClickShowFacetsBtn(ev) {\n    this._facetsContainer.classList.add(\"c-search__facets-container--open\");\n    this._closeModalBtn.classList.add(\"c-search__close-modal-button--open\");\n    document.body.classList.add(\"c-search__open-modal\");\n  }\n\n  onClickCloseModalBtn(ev) {\n    this._facetsContainer.classList.remove(\"c-search__facets-container--open\");\n    this._closeModalBtn.classList.remove(\"c-search__close-modal-button--open\");\n    document.body.classList.remove(\"c-search__open-modal\");\n  }\n\n  _faIcon(icon) {\n    return `<span aria-hidden=\"true\" class=\"c-search-result__content-icon fa ${icon}\"></span>`;\n  }\n\n  init() {\n    this._closeModalBtn = document.getElementById(\n      this.selectors.closeModalButton\n    );\n    this._showFacetsBtn = document.getElementById(\n      this.selectors.showFacetsButton\n    );\n    this._facetsContainer = document.getElementById(\n      this.selectors.facetsContainer\n    );\n    if (this._closeModalBtn && this._showFacetsBtn && this._facetsContainer) {\n      this.addEventListeners();\n    }\n  }\n\n  addEventListeners() {\n    this._closeModalBtn.removeEventListener(\"click\", this.onClickCloseModalBtn);\n    this._closeModalBtn.addEventListener(\"click\", this.onClickCloseModalBtn);\n\n    this._showFacetsBtn.removeEventListener(\"click\", this.onClickShowFacetsBtn);\n    this._showFacetsBtn.addEventListener(\"click\", this.onClickShowFacetsBtn);\n  }\n\n  reset() {\n    this._facetBar.reset();\n  }\n\n  render(results) {\n    const facetResults = {};\n    Object.keys(results).forEach(key => {\n      if (key.startsWith(\"facets-\")) {\n        const { facets } = results[key];\n        Object.keys(facets).forEach(prefix => {\n          const values = facets[prefix];\n          Object.keys(values).forEach(facet => {\n            facetResults[`${prefix}:${facet}`] = values[facet];\n          });\n        });\n      } else if (key == \"locations\") {\n        facetResults.locations = results.locations.hits.length;\n      }\n    });\n\n    this._facetBar.updateCounts(facetResults);\n  }\n\n  selectedFacetNames() {\n    return this._facetBar.selectedFacetNames();\n  }\n\n  loadState(facets) {\n    this._facetBar.loadState(facets);\n  }\n\n  updateState() {\n    this._parent.updateHistory();\n  }\n}\n","import hogan from \"hogan.js\";\nimport * as AlgoliaResult from \"./algolia-result\";\nimport * as MapsHelpers from \"./maps-helpers\";\n// eslint-disable-next-line import/extensions\nimport * as QueryHelpers from \"../ts/helpers/query\";\n\n/* eslint-disable no-underscore-dangle */\n/* eslint-disable no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable eqeqeq */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-console */\n\nconst TEMPLATES = {\n  contentResults: hogan.compile(`\n    <div class=\"c-search-results__section\">\n      {{#hasHits}}\n        <div class=\"c-search-result__header\">\n          {{title}}\n          {{#isLocation}}\n          <div id=\"search-result__use-my-location\" class=\"c-search-result__header--location\">\n          <i aria-hidden=\"true\" class=\"fa fa-location-arrow \"></i>\n          Use my location\n          <i aria-hidden=\"true\" id=\"search-result__loading-indicator\" class=\"fa fa-cog fa-spin c-search-result__loading-indicator\"></i>\n          </div>\n          {{/isLocation}}\n        </div>\n        <div class=\"c-search-results__hits\">\n          {{#hits}}\n              {{{.}}}\n          {{/hits}}\n          {{#showMore}}\n            <div id=\"show-more--{{group}}\" class=\"c-search-results__show-more\" data-group=\"{{group}}\">\n              Show more\n            </div>\n          {{/showMore}}\n        </div>\n      {{/hasHits}}\n    </div>\n `)\n};\n\nexport class AlgoliaResults {\n  constructor(id, parent) {\n    this._parent = parent;\n    this._groups = [\n      \"routes\",\n      \"stops\",\n      \"pages\",\n      \"projects\",\n      \"documents\",\n      \"events\",\n      \"news\",\n      \"locations\"\n    ];\n    this._container = document.getElementById(id);\n    if (!this._container) {\n      console.error(`could not find results container with id: ${id}`);\n    }\n    this._container.innerHTML = \"\";\n    this._bind();\n  }\n\n  _bind() {\n    this.onClickShowMore = this.onClickShowMore.bind(this);\n    this.onClickResult = this.onClickResult.bind(this);\n    this.addResultClickHandler = this.addResultClickHandler.bind(this);\n    this._showLocation = this._showLocation.bind(this);\n  }\n\n  _addLocationListeners(results) {\n    if (results.locations) {\n      results.locations.hits.forEach((hit, idx) => {\n        const elem = document.getElementById(`hit-location-${idx}`);\n        if (elem) {\n          elem.addEventListener(\"click\", this._locationSearch(hit.address));\n        }\n      });\n      const useLocation = document.getElementById(\n        \"search-result__use-my-location\"\n      );\n      if (useLocation) {\n        useLocation.addEventListener(\"click\", () => {\n          this._useMyLocation()\n            .then(pos => {\n              this._locationSearchByGeo(\n                pos.coords.latitude,\n                pos.coords.longitude\n              );\n            })\n            .catch(err => {\n              console.error(err);\n            });\n        });\n      }\n    }\n  }\n\n  _addShowMoreListener(groupName) {\n    const el = document.getElementById(`show-more--${groupName}`);\n    if (el) {\n      el.removeEventListener(\"click\", this.onClickShowMore);\n      el.addEventListener(\"click\", this.onClickShowMore);\n    }\n  }\n\n  onClickResult(ev) {\n    if (ev.currentTarget.href) {\n      ev.preventDefault();\n\n      window.jQuery.post(\n        \"/search/click\",\n        {\n          queryID: ev.currentTarget.getAttribute(\"data-queryid\"),\n          position: ev.currentTarget.getAttribute(\"data-hit-position\"),\n          objectID: ev.currentTarget.getAttribute(\"data-objectid\")\n        },\n        this.onClickResultCallback(ev.currentTarget.href)\n      );\n    }\n  }\n\n  onClickResultCallback(href) {\n    return response => {\n      this.reset();\n      window.Turbolinks.visit(\n        href +\n          QueryHelpers.paramsToString(\n            this._parent.getParams(),\n            window.encodeURIComponent\n          )\n      );\n    };\n  }\n\n  onClickShowMore(ev) {\n    this._parent.onClickShowMore(ev.target.getAttribute(\"data-group\"));\n  }\n\n  _showLocation(latitude, longitude, address) {\n    const params = this._parent.getParams();\n    params.latitude = latitude;\n    params.longitude = longitude;\n    params.address = address;\n    const qs = QueryHelpers.paramsToString(params, window.encodeURIComponent);\n    window.Turbolinks.visit(`/transit-near-me${qs}`);\n  }\n\n  _locationSearchByGeo(latitude, longitude) {\n    MapsHelpers.reverseGeocode(parseFloat(latitude), parseFloat(longitude))\n      .then(result => {\n        document.getElementById(\n          \"search-result__loading-indicator\"\n        ).style.display = \"none\";\n        this._showLocation(latitude, longitude, result);\n      })\n      .catch(err => {\n        console.error(\n          \"Problem with retrieving location using the Google Maps API.\"\n        );\n      });\n  }\n\n  _locationSearch(address) {\n    return () => {\n      MapsHelpers.lookupPlace(address)\n        .then(result => {\n          this._showLocation(\n            result.latitude,\n            result.longitude,\n            result.formatted\n          );\n        })\n        .catch(err => {\n          console.error(err);\n        });\n    };\n  }\n\n  _useMyLocation() {\n    document.getElementById(\"search-result__loading-indicator\").style.display =\n      \"inline-block\";\n    return new Promise((resolve, reject) => {\n      navigator.geolocation.getCurrentPosition(\n        pos => {\n          return resolve(pos);\n        },\n        err => {\n          return reject(err);\n        }\n      );\n    });\n  }\n\n  init() {}\n\n  reset() {\n    this.render({});\n  }\n\n  render(results) {\n    if (this._container) {\n      this._container.innerHTML = this._groups\n        .map(group => this._renderGroup(results, group))\n        .join(\"\");\n\n      Array.from(\n        document.getElementsByClassName(AlgoliaResult.SELECTORS.result)\n      ).forEach(this.addResultClickHandler);\n\n      this._groups.forEach(group => this._addShowMoreListener(group));\n      this._addLocationListeners(results);\n    }\n  }\n\n  _renderGroup(results, group) {\n    if (!results[group]) {\n      return \"\";\n    }\n\n    return TEMPLATES.contentResults.render({\n      title: AlgoliaResults.indexTitles[group] || \"\",\n      isLocation: group == \"locations\" || null,\n      nbHits: results[group].nbHits,\n      hasHits: results[group].nbHits > 0,\n      showMore: results[group].hits.length < results[group].nbHits,\n      group,\n      googleLogo: null,\n      hits: results[group].hits.map(this.renderResult(group, results[group]))\n    });\n  }\n\n  renderResult(index, groupData) {\n    return (hit, idx) => {\n      return `\n        <div class=\"c-search-result__hit\">\n          ${AlgoliaResult.renderResult(hit, index)}\n        </div>\n      `;\n    };\n  }\n\n  addResultClickHandler(el) {\n    el.removeEventListener(\"click\", this.onClickResult);\n    el.addEventListener(\"click\", this.onClickResult);\n  }\n}\n\nAlgoliaResults.indexTitles = {\n  locations: \"Locations\",\n  stops: \"Stations and Stops\",\n  routes: \"Lines and Routes\",\n  projects: \"Projects\",\n  pages: \"Pages\",\n  documents: \"Documents\",\n  events: \"Events\",\n  news: \"News\"\n};\n","import { AlgoliaWithGeo } from \"./algolia-search-with-geo\";\nimport { AlgoliaFacets } from \"./algolia-facets\";\nimport { AlgoliaResults } from \"./algolia-results\";\nimport * as QueryHelpers from \"../ts/helpers/query\";\n\nexport function init() {\n  const search = new AlgoliaGlobalSearch();\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      search.init();\n    },\n    { passive: true }\n  );\n  return search;\n}\n\nexport class AlgoliaGlobalSearch {\n  constructor() {\n    this.container = null;\n    this.controller = null;\n    this._facetsWidget = null;\n    this._bind();\n    this._showMoreList = [];\n    this._queryParams = {};\n  }\n\n  _bind() {\n    this.reset = this.reset.bind(this);\n    this.onKeyup = this.onKeyup.bind(this);\n  }\n\n  init() {\n    this.container = document.getElementById(\n      AlgoliaGlobalSearch.SELECTORS.input\n    );\n    this._resetButton = document.getElementById(\n      AlgoliaGlobalSearch.SELECTORS.resetButton\n    );\n    if (!this.container) {\n      return false;\n    }\n    if (!this.controller) {\n      this.controller = new AlgoliaWithGeo(\n        AlgoliaGlobalSearch.INITIAL_QUERIES,\n        AlgoliaGlobalSearch.DEFAULT_PARAMS,\n        AlgoliaGlobalSearch.LATLNGBOUNDS\n      );\n    }\n\n    this._facetsWidget = new AlgoliaFacets(\n      AlgoliaGlobalSearch.SELECTORS,\n      this.controller,\n      this\n    );\n    this._facetsWidget.reset();\n    this.controller.addWidget(this._facetsWidget);\n\n    this._resultsWidget = new AlgoliaResults(\n      AlgoliaGlobalSearch.SELECTORS.resultsContainer,\n      this\n    );\n    this.controller.addWidget(this._resultsWidget);\n\n    this.addEventListeners();\n    this.loadState(window.location.search);\n    this.controller.search({ query: this.container.value });\n  }\n\n  addEventListeners() {\n    this._resetButton.removeEventListener(\"click\", this.reset);\n    this._resetButton.addEventListener(\"click\", this.reset);\n\n    const inputField = document.getElementById(\n      AlgoliaGlobalSearch.SELECTORS.input\n    );\n    window.jQuery(document).on(\"keyup\", `#${inputField.id}`, this.onKeyup);\n\n    document.addEventListener(\"turbolinks:before-render\", () => {\n      window.jQuery(document).off(\"keyup\", `#${inputField.id}`, this.onKeyup);\n    });\n  }\n\n  loadState(query) {\n    this._queryParams = QueryHelpers.parseQuery(\n      query,\n      window.decodeURIComponent\n    );\n    this.container.value = this._queryParams.query || \"\";\n\n    const showMoreState = this._queryParams.showmore || \"\";\n    if (showMoreState != \"\") {\n      showMoreState.split(\",\").forEach(group => {\n        this.addPage(group);\n      });\n    }\n\n    const facetState = this._queryParams.facets || \"\";\n    this._facetsWidget.loadState(facetState.split(\",\"));\n    if (facetState != \"\") {\n      this.controller.enableLocationSearch(facetState.includes(\"locations\"));\n    }\n  }\n\n  reset(ev) {\n    this.container.value = \"\";\n    this.controller.reset();\n    this._toggleResetButton(false);\n    this._queryParams = {};\n    this.updateHistory();\n    window.jQuery(this.container).focus();\n  }\n\n  _toggleResetButton(show) {\n    this._resetButton.style.display = show ? \"block\" : \"none\";\n  }\n\n  onKeyup(ev) {\n    const inputField = document.getElementById(\n      AlgoliaGlobalSearch.SELECTORS.input\n    );\n    this._toggleResetButton(inputField.value != \"\");\n    this.controller.search({ query: this.container.value });\n    this.updateHistory();\n  }\n\n  updateHistory() {\n    this._queryParams.query = this.container.value;\n    this._queryParams.facets = this._facetsWidget\n      .selectedFacetNames()\n      .join(\",\");\n    this._queryParams.showmore = this._showMoreList.join(\",\");\n    window.history.replaceState(\n      window.history.state,\n      \"\",\n      window.location.pathname +\n        QueryHelpers.paramsToString(\n          this._queryParams,\n          window.encodeURIComponent\n        )\n    );\n  }\n\n  onClickShowMore(group) {\n    this.addPage(group);\n    this.updateHistory();\n    this.controller.search({});\n  }\n\n  addPage(group) {\n    this.controller.addPage(group);\n    this._showMoreList.push(group);\n  }\n\n  getParams() {\n    return {\n      from: \"global-search\",\n      query: this.container.value,\n      facets: this._facetsWidget.selectedFacetNames().join(\",\")\n    };\n  }\n}\n\nAlgoliaGlobalSearch.INITIAL_QUERIES = {\n  routes: {\n    indexName: \"routes\",\n    query: \"\"\n  },\n  stops: {\n    indexName: \"stops\",\n    query: \"\"\n  },\n  projects: {\n    indexName: \"drupal\",\n    query: \"\"\n  },\n  pages: {\n    indexName: \"drupal\",\n    query: \"\"\n  },\n  documents: {\n    indexName: \"drupal\",\n    query: \"\"\n  },\n  events: {\n    indexName: \"drupal\",\n    query: \"\"\n  },\n  news: {\n    indexName: \"drupal\",\n    query: \"\"\n  }\n};\n\nAlgoliaGlobalSearch.DEFAULT_PARAMS = {\n  routes: {\n    hitsPerPage: 5,\n    facets: [\"*\"],\n    facetFilters: [[]]\n  },\n  stops: {\n    hitsPerPage: 5,\n    facets: [\"*\"],\n    facetFilters: [[]]\n  },\n  projects: {\n    hitsPerPage: 5,\n    facets: [\"*\"],\n    facetFilters: [[\"_content_type:project\", \"_content_type:project_update\"]]\n  },\n  pages: {\n    hitsPerPage: 5,\n    facets: [\"*\"],\n    facetFilters: [\n      [\n        \"_content_type:page\",\n        \"_content_type:diversion\",\n        \"_content_type:search_result\",\n        \"_content_type:landing_page\",\n        \"_content_type:person\"\n      ]\n    ]\n  },\n  documents: {\n    hitsPerPage: 5,\n    facets: [\"*\"],\n    facetFilters: [[\"search_api_datasource:entity:file\"]]\n  },\n  events: {\n    hitsPerPage: 5,\n    facets: [\"_content_type\"],\n    facetFilters: [[\"_content_type:event\"]]\n  },\n  news: {\n    hitsPerPage: 5,\n    facets: [\"_content_type\"],\n    facetFilters: [[\"_content_type:news_entry\"]]\n  }\n};\n\nAlgoliaGlobalSearch.SELECTORS = {\n  facetsContainer: \"search-facets-container\",\n  resultsContainer: \"search-results-container\",\n  closeModalButton: \"close-facets-modal\",\n  showFacetsButton: \"show-facets\",\n  resetButton: \"search-global__reset\",\n  input: \"search-global__input\"\n};\n\nAlgoliaGlobalSearch.LATLNGBOUNDS = {\n  west: 41.3193,\n  north: -71.938,\n  east: 42.8266,\n  south: -69.6189\n};\n","const tooltipDivider = \"<hr class='tooltip-divider'>\";\nconst vehicleTooltipId = vehicleContainerId => `${vehicleContainerId}-tooltip`;\n\nexport const addOrUpdateTooltip = (vehicleTooltip, vehicleContainerId) => {\n  const containerId = vehicleTooltipId(vehicleContainerId);\n  const container = document.getElementById(containerId);\n  const currentTooltip = container.getAttribute(\"data-original-title\");\n  const stopTooltip = container.getAttribute(\"data-stop\");\n  // If the tooltip is visible, it will have an aria-describedby attribute\n  const tooltipVisible = container.getAttribute(\"aria-describedby\");\n\n  if (stopTooltip) {\n    const tooltip = [vehicleTooltip, stopTooltip].join(tooltipDivider);\n    // Avoid unnecessary updates\n    if (tooltip === currentTooltip) {\n      return;\n    }\n    container.setAttribute(\"data-original-title\", tooltip);\n  } else {\n    // Avoid unnecessary updates\n    if (vehicleTooltip === currentTooltip) {\n      return;\n    }\n    container.setAttribute(\"data-original-title\", vehicleTooltip);\n  }\n\n  if (tooltipVisible) {\n    window.jQuery(container).tooltip(\"show\");\n  }\n};\n\nexport const removeTooltip = parentId => {\n  const tooltipId = `${parentId}-tooltip`;\n  const container = document.getElementById(tooltipId);\n  const stopTooltip = container.getAttribute(\"data-stop\");\n  window.jQuery(container).tooltip(\"hide\");\n  if (stopTooltip) {\n    container.setAttribute(\"data-original-title\", stopTooltip);\n  } else {\n    container.removeAttribute(\"data-original-title\");\n  }\n};\n","import { addOrUpdateTooltip, removeTooltip } from \"./cr-timetable-tooltips\";\n\nexport const trainIcon = id =>\n  `<div class=\"${id} js-train-icon\"><span class=\"notranslate c-svg__icon-commuter-rail-default\"><svg viewBox=\"0 0 48 48\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m36.54 11.28a1.8073 1.8073 0 0 1 -.81-1.54v-4.79a3.03356 3.03356 0 0 0 -2.38-2.89 75.79021 75.79021 0 0 0 -8.71-2 3.37685 3.37685 0 0 0 -1.38.01c-2.6.57-5.22 1.08-7.8 1.8-1.52.42-3.12 1.26-3.12 3.08v4.76a1.78965 1.78965 0 0 1 -.83 1.54 3.14612 3.14612 0 0 0 -1.5 2.69v20.22a3.14244 3.14244 0 0 0 1.18 2.43l5.12 3.75-4.13 7.66h3.37l.58-1.06h15.81l.59 1.06h3.34l-4.09-7.66h.01l5.01-3.71a3.17036 3.17036 0 0 0 1.19-2.47v-20.22a3.17047 3.17047 0 0 0 -1.45-2.66zm-10.08-7.48a.99881.99881 0 0 1 1.21-.98l4.94 1.04a.98623.98623 0 0 1 .79.97v2.94a.99652.99652 0 0 1 -1.19.98l-4.94-.96a.99672.99672 0 0 1 -.81-.98zm-2.46 11.28a2.69727 2.69727 0 1 1 -1.91.79 2.69913 2.69913 0 0 1 1.91-.79zm-9.1-10.25a.98522.98522 0 0 1 .8-.97l4.94-1.04a.99473.99473 0 0 1 1.2.98v3.01a.99775.99775 0 0 1 -.8.98l-4.95.96a1.00066 1.00066 0 0 1 -1.19-.98zm1.0938 29.67a1.955 1.955 0 1 1 1.95-1.96 1.96318 1.96318 0 0 1 -1.95 1.96zm3.7062 5.97h8.63l.88995 1.6h-10.39995zm-2.68 4.86.91-1.65h12.19l.92 1.65zm15.98-10.83a1.955 1.955 0 1 1 1.95-1.96 1.96319 1.96319 0 0 1 -1.95 1.96z\"></path></svg></span></div>`;\nconst emptySpaceForIcon = \"&nbsp;\";\n\nexport const removeTrain = id => {\n  const vehicleIcons = Array.from(document.getElementsByClassName(id));\n  vehicleIcons.forEach(i => {\n    // eslint-disable-next-line no-param-reassign\n    i.innerHTML = emptySpaceForIcon;\n    return removeTooltip(i.parentNode.id);\n  });\n};\n\nexport class CRTimetableTrainIcons {\n  constructor(props) {\n    this.priorStops = props.priorStops;\n    this.schedules = props.schedules;\n  }\n\n  addOrUpdateTrain(data) {\n    // Splat together vehicle struct and stop name data\n    const {\n      data: { vehicle: vehicleStruct, stop_name: stopName },\n      marker: { tooltip_text }\n    } = data;\n    const vehicle = { ...vehicleStruct, stop_name: stopName };\n\n    const vehicleContainerId = this.vehicleContainerId(vehicle);\n    const vehicleContainer = document.getElementById(vehicleContainerId);\n\n    if (!vehicleContainer) {\n      // This happens on \"Via Haverhill\" etc vehicles\n      return;\n    }\n\n    // If the train isn't currently in this container, remove the other instance\n    if (vehicleContainer.innerHTML.trim() === emptySpaceForIcon) {\n      removeTrain(vehicle.id);\n    }\n\n    this.addTrain(vehicle, vehicleContainer);\n    const text = \"<p class='prediction-tooltip'>\" + tooltip_text + \"</p>\";\n    addOrUpdateTooltip(text, vehicleContainerId);\n  }\n\n  addTrain(vehicle, vehicleContainer) {\n    // eslint-disable-next-line no-param-reassign\n    vehicleContainer.innerHTML = trainIcon(vehicle.id);\n  }\n\n  vehicleContainerId(vehicle) {\n    const stop = `${vehicle.stop_name}-${vehicle.trip_id}`;\n    if (vehicle.status !== \"in_transit\") {\n      return stop;\n    }\n    // For vehicles in transit with prior stop data, put the vehicle in the prior stop container\n    const stopSequence = this.schedules[stop]?.stop_sequence || 1;\n    return this.priorStops[`${vehicle.trip_id}-${stopSequence - 1}`];\n  }\n}\n","import { CRTimetableTrainIcons, removeTrain } from \"./cr-timetable-train-icons\";\n\n/* eslint-disable class-methods-use-this */\nexport const channelDataId = \"js-cr-vehicle-data\";\nconst vehicleScheduleDataId = \"js-cr-vehicle-schedules-data\";\nconst vehicleStopSequenceDataId = \"js-cr-vehicle-prior-stops-data\";\n\nexport class CRTimetableTrains {\n  constructor(dataEl) {\n    // Don't render trains on days that are not today\n    if (window.location.search.includes(\"date\")) {\n      return;\n    }\n    this.data = {};\n    try {\n      this.getData();\n    } catch (e) {\n      throw new Error(\n        \"Not able to parse initial data from Commuter Rail Timetable\",\n        e.message\n      );\n    }\n    this.bind();\n    this.channelId = dataEl.getAttribute(\"data-channel\");\n    this.addEventListeners();\n    this.icons = new CRTimetableTrainIcons({\n      schedules: this.schedules,\n      priorStops: this.priorStops\n    });\n  }\n\n  getData() {\n    const schedules = document.getElementById(vehicleScheduleDataId);\n    this.data.schedulesInfo = JSON.parse(schedules.textContent);\n    const priorStops = document.getElementById(vehicleStopSequenceDataId);\n    this.data.stopMap = JSON.parse(priorStops.textContent);\n  }\n\n  get schedules() {\n    return this.data.schedulesInfo;\n  }\n\n  set schedules(sched) {\n    this.data.schedulesInfo = sched;\n  }\n\n  get priorStops() {\n    return this.data.stopMap;\n  }\n\n  set priorStops(stops) {\n    this.data.stopMap = stops;\n  }\n\n  bind() {\n    this.onVehicles = this.onVehicles.bind(this);\n    this.onRemoveVehicles = this.onRemoveVehicles.bind(this);\n  }\n\n  addEventListeners() {\n    document.addEventListener(this.channelId, this.onVehicles);\n    document.addEventListener(\"vehicles:remove\", this.onRemoveVehicles);\n    document.addEventListener(\n      \"turbolinks:before-render\",\n      this.teardown.bind(this),\n      {\n        passive: true\n      }\n    );\n  }\n\n  removeEventListeners() {\n    document.removeEventListener(this.channelId, this.onVehicles);\n    document.removeEventListener(\"vehicles:remove\", this.onRemoveVehicles);\n  }\n\n  onVehicles(ev) {\n    ev.detail?.data?.forEach(vehicle => this.icons.addOrUpdateTrain(vehicle));\n  }\n\n  onRemoveVehicles(ev) {\n    ev.detail?.data?.forEach(d => removeTrain(d.toString().split(\"-\")[1]));\n  }\n\n  teardown() {\n    this.removeEventListeners();\n  }\n}\n\nexport default function CRTrains() {\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      const dataEls = document.getElementById(channelDataId);\n      if (dataEls) {\n        return new CRTimetableTrains(dataEls);\n      }\n      return {};\n    },\n    { passive: true }\n  );\n}\n","const ITEM_SELECTOR = \"js-toggle-alert\";\n\nexport const onload = () =>\n  document.addEventListener(\"turbolinks:load\", addAlertItemEventHandlers, {\n    passive: true\n  });\n\nexport const addAlertItemEventHandlers = () => {\n  if (typeof document !== \"undefined\") {\n    [...document.querySelectorAll(`.${ITEM_SELECTOR}`)].forEach(alertItem => {\n      alertItem.addEventListener(\"click\", handleAlertItemClick);\n      alertItem.addEventListener(\"keydown\", handleAlertItemKeyPress);\n    });\n  }\n};\n\nexport const removeAlertItemEventHandlers = () => {\n  if (typeof document !== \"undefined\") {\n    [...document.querySelectorAll(`.${ITEM_SELECTOR}`)].forEach(alertItem => {\n      alertItem.removeEventListener(\"click\", handleAlertItemClick);\n      alertItem.removeEventListener(\"keydown\", handleAlertItemKeyPress);\n    });\n  }\n};\n\nconst handleAlertItemKeyPress = e =>\n  isEnter(e.key || e.keyCode) ? handleAlertItemClick(e) : () => {};\n\nconst isEnter = key => key === \"Enter\" || key === 13;\n\nconst handleAlertItemClick = e =>\n  e.target.tagName !== \"A\" &&\n  doHandleAlertItemClick(getParentsUntil(e.target, ITEM_SELECTOR));\n\nconst doHandleAlertItemClick = el =>\n  batchDomMutations(el, el.getAttribute(\"aria-expanded\") === \"true\");\n\nconst batchDomMutations = (el, opened) => {\n  toggleOpenClass(el, opened);\n  toggleAriaAttribute(el, opened);\n};\n\nconst toggleOpenClass = (el, opened) =>\n  opened === true\n    ? el.classList.remove(\"c-alert-item--open\")\n    : el.classList.add(\"c-alert-item--open\");\n\nconst toggleAriaAttribute = (el, opened) =>\n  opened === true\n    ? el.setAttribute(\"aria-expanded\", \"false\")\n    : el.setAttribute(\"aria-expanded\", \"true\");\n\nconst getParentsUntil = (el, selector) =>\n  el.classList.contains(selector) === true\n    ? el\n    : getParentsUntil(el.parentNode, selector);\n","import A11yDialog from \"a11y-dialog\";\n\nfunction toggleAttributePolyfill() {\n  if (!Element.prototype.toggleAttribute) {\n    Element.prototype.toggleAttribute = function(name, force) {\n      if (force !== void 0) force = !!force;\n\n      if (this.hasAttribute(name)) {\n        if (force) return true;\n\n        this.removeAttribute(name);\n        return false;\n      }\n      if (force === false) return false;\n\n      this.setAttribute(name, \"\");\n      return true;\n    };\n  }\n}\n\nfunction composedPathPolyfill() {\n  // Taken from:\n  // https://gist.github.com/rockinghelvetica/00b9f7b5c97a16d3de75ba99192ff05c\n  (function(e, d, w) {\n    if (!e.composedPath) {\n      e.composedPath = function() {\n        if (this.path) {\n          return this.path;\n        }\n        let { target } = this;\n\n        this.path = [];\n        while (target.parentNode !== null) {\n          this.path.push(target);\n          target = target.parentNode;\n        }\n        this.path.push(d, w);\n        return this.path;\n      };\n    }\n  })(Event.prototype, document, window);\n}\n\nfunction stickyPolyfill() {\n  import(\"stickyfilljs\").then(stickyfilljs => {\n    const elements = document.querySelectorAll(\".sticky-month\");\n    stickyfilljs.add(elements);\n  });\n}\n\nfunction addInternetExplorerPolyfills() {\n  toggleAttributePolyfill();\n  stickyPolyfill();\n  composedPathPolyfill();\n}\n\nexport function setupEventPopups() {\n  /**\n   * Why not use Bootstrap's popover? It's not equipped to handle having lots of\n   * interactive content, doesn't support a close button, and as implemented the\n   * UX for assistive tech users probably isn't ideal. For more, see \"Making\n   * popovers work for keyboard and assistive technology users\" in\n   * https://getbootstrap.com/docs/4.6/components/popovers/\n   *\n   * This implementation uses ally-dialog (https://a11y-dialog.netlify.app) as a\n   * base to create accessible dialog windows for various use cases.\n   */\n  const calendarView = document.querySelector(\".m-events-hub\");\n\n  // find all the event popup HTML elements\n  const eventPopups = calendarView.querySelectorAll(\".m-event-overlay\");\n  for (let i = 0; i < eventPopups.length; i++) {\n    const el = eventPopups[i];\n    const dialog = new A11yDialog(el);\n\n    // Hide popup when user clicks outside popup, or on a different event\n    const hideDialogLogicListener = function(event) {\n      const path = event.composedPath();\n      const eventClicked = path.find(function(x) {\n        return x.className === \"m-event-calendar__event\";\n      });\n      const eventIdClicked =\n        eventClicked && eventClicked.dataset.a11yDialogShow;\n      if (eventIdClicked) {\n        if (dialog._id !== eventIdClicked) dialog.hide();\n      } else if (\n        !path.find(function(x) {\n          return x.className === \"m-event-overlay\";\n        })\n      ) {\n        dialog.hide();\n      }\n    };\n    document.addEventListener(\"click\", hideDialogLogicListener);\n    document.addEventListener(\"turbolinks:before-render\", () =>\n      document.removeEventListener(\"click\", hideDialogLogicListener)\n    );\n  }\n}\n\nfunction MakeCollapsedHeadersSticky(eventsListing) {\n  const sections = eventsListing.querySelectorAll(\".m-event-list__month\");\n  for (let i = 0; i < sections.length; i++) {\n    const section = sections[i];\n    const header = section.querySelectorAll(\".c-expandable-block__link\");\n    if (header[0].getAttribute(\"aria-expanded\") == \"false\") {\n      section.classList.add(\"sticky-top\");\n    } else {\n      section.classList.remove(\"sticky-top\");\n    }\n  }\n}\n\nexport function setupEventsListing() {\n  const eventsHubPage = document.querySelector(\".m-events-hub\");\n  // add event listener to navigate to page on dropdown select\n  const dateSelects = eventsHubPage.querySelectorAll(\".m-event-list__select\");\n\n  for (let i = 0; i < dateSelects.length; i++) {\n    const select = dateSelects[i];\n    select.addEventListener(\"change\", ({ target }) => {\n      window.location.assign(target.value);\n    });\n  }\n\n  const eventsListing = document.querySelector(\".m-events-hub\");\n  if (!eventsListing) return;\n  const control = eventsListing.querySelector(\n    \".m-event-list__nav--mobile-controls\"\n  );\n  let prevScroll = window.scrollY || document.documentElement.scrollTop;\n  let prevDirection = 0;\n  let direction = 0; // 0 - initial, 1 - up, 2 - down\n\n  // add event listeners on scroll (and wheel on mobile)\n  [\"scroll\", \"wheel\"].forEach(ev => {\n    document.addEventListener(\n      ev,\n      () => {\n        window.requestAnimationFrame(() => {\n          // 1. toggle a shadow on the month header depending on if it's sticky\n          const monthHeaders = eventsListing.querySelectorAll(\n            \".c-expandable-block__link\"\n          );\n          for (let i = 0; i < monthHeaders.length; i++) {\n            const el = monthHeaders[i];\n            const stickyStyleTop = parseInt(\n              window.getComputedStyle(el).top.replace(\"px\", \"\"),\n              10\n            ); // px defined in CSS\n            const isStuck = el.getBoundingClientRect().top === stickyStyleTop;\n            el.toggleAttribute(\"stuck\", isStuck);\n          }\n\n          // 2. show or hide the month/year dropdowns on mobile depending on\n          // whether the user scrolls up or down\n          const curScroll =\n            window.scrollY || document.documentElement.scrollTop;\n          direction =\n            // eslint-disable-next-line no-nested-ternary\n            curScroll > prevScroll ? 2 : curScroll < prevScroll ? 1 : 0;\n\n          const controlHeight = control.getBoundingClientRect().height;\n          if (direction !== prevDirection) {\n            // toggle the controls\n            if (direction === 2 && curScroll > controlHeight) {\n              // hide the controls\n              eventsListing.classList.add(\"js-nav-down\");\n              eventsListing.classList.remove(\"js-nav-up\");\n            } else if (direction === 1) {\n              // show the controls\n              eventsListing.classList.add(\"js-nav-up\");\n              eventsListing.classList.remove(\"js-nav-down\");\n            }\n            prevDirection = direction;\n          }\n\n          prevScroll = curScroll;\n\n          MakeCollapsedHeadersSticky(eventsListing);\n        });\n      },\n      { capture: false, passive: true }\n    );\n  });\n\n  // scroll to active heading if available\n  const activeMonthElement = eventsListing.querySelector(\n    \".m-event-list__month--active\"\n  );\n  if (activeMonthElement) activeMonthElement.scrollIntoView();\n}\n\nexport default function() {\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      const viewPreviousEventsLink = document.querySelector(\n        \".m-view-previous-events\"\n      );\n      if (viewPreviousEventsLink) {\n        viewPreviousEventsLink.classList.remove(\"hidden\");\n      }\n      if (document.querySelector(\".m-events-hub\")) {\n        const isIE = !!document.documentMode;\n        if (isIE) {\n          addInternetExplorerPolyfills();\n        }\n\n        setupEventsListing();\n        setupEventPopups();\n      }\n    },\n    { passive: true }\n  );\n}\n","function selectButton(button) {\n  const groupName = button.dataset.group;\n  button.classList.add(\"selected\");\n  togglePslFilter(groupName);\n}\n\nfunction togglePslFilter(pslType) {\n  const locationCards = [\n    ...document.querySelectorAll(\".c-sales-locations__card\")\n  ];\n\n  let cardCount = 0;\n  locationCards.forEach(card => {\n    const cardType = card.dataset.psltype;\n\n    if (!pslTypeMatch(cardType, pslType) || cardCount > 11) {\n      card.classList.add(\"hidden\");\n    } else {\n      card.classList.remove(\"hidden\");\n      cardCount++;\n    }\n  });\n}\n\nfunction pslTypeMatch(cardType, buttonType) {\n  return (\n    buttonType.toLowerCase().includes(\"all\") ||\n    cardType.toLowerCase() === buttonType.toLowerCase() ||\n    cardType.toLowerCase().includes(\"both\")\n  );\n}\n\nexport function setupPslFilterButtons() {\n  const pslButtons = [...document.querySelectorAll(\".psl-type-button\")];\n\n  pslButtons.forEach(button => {\n    button.addEventListener(\"click\", () => {\n      // deselect inactive buttons\n      pslButtons.forEach(b => {\n        if (b !== button) {\n          b.classList.remove(\"selected\");\n        }\n      });\n      selectButton(button);\n    });\n\n    // If the user navigates by keyboard, simulate click on enter-key press\n    button.addEventListener(\"keyup\", e => {\n      if (e.keyCode === 13) {\n        button.click();\n      }\n    });\n  });\n\n  selectButton(pslButtons[0]);\n}\n\nexport default function() {\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      const pslButtons = document.querySelector(\".psl-types-buttons\");\n      if (pslButtons) {\n        pslButtons.classList.remove(\"hidden\");\n        setupPslFilterButtons();\n      }\n    },\n    { passive: true }\n  );\n}\n","/* eslint-disable */\nimport \"../vendor/fixedsticky\";\nimport \"../vendor/accessible-date-picker\";\nimport \"bootstrap/dist/js/umd/collapse\";\nimport \"bootstrap/dist/js/umd/modal\";\nimport \"bootstrap/dist/js/umd/tooltip\";\nimport \"bootstrap/dist/js/umd/dropdown\";\nimport objectFitImages from \"object-fit-images\";\nimport googleAnalytics from \"./google-analytics\";\nimport submitOnEvents from \"./submit-on-events\";\nimport collapse from \"./collapse\";\nimport setupGlobalNavigation from \"../ts/app/global-navigation\";\nimport modal from \"./modal\";\nimport turbolinksMods from \"./turbolinks-mods\";\nimport supportForm from \"./support-form\";\nimport fixedsticky from \"./fixedsticky\";\nimport geoLocation from \"./geolocation\";\nimport addressSearch from \"./address-search\";\nimport googleTranslate from \"./google-translate\";\nimport scrollTo from \"./scroll-to\";\nimport stickyTooltip from \"./sticky-tooltip\";\nimport timetableScroll from \"./timetable-scroll\";\nimport timetableStyle from \"./timetable-style\";\nimport timetableStick from \"./timetable-stick\";\nimport datePicker from \"./date-picker\";\nimport toggleBtn from \"./toggle-on-click\";\nimport * as TimeControls from \"./time-controls/time-controls\";\nimport * as TripPlannerLocationControls from \"./trip-planner-location-controls\";\nimport stopBubbles from \"./stop-bubbles\";\nimport search from \"./search\";\nimport photoGallery from \"./photo-gallery\";\nimport { init as embeddedSearchInit } from \"./algolia-embedded-search\";\nimport * as homepageSearch from \"./algolia-homepage-search\";\nimport * as globalSearch from \"./algolia-global-search\";\nimport fullstory from \"./fullstory\";\nimport inputFocus from \"./input-focus\";\nimport setupChannels from \"../ts/app/channels\";\nimport CRTrains from \"./cr-timetable-trains\";\nimport { onload as alertItemLoad } from \"./alert-item\";\nimport dismissFullscreenError from \"../ts/app/dismiss-fullscreen-error\";\nimport tripPlannerWidget from \"./trip-planner-widget\";\nimport eventPageSetup from \"./event-page-setup\";\nimport previousEventsButton from \"./view-previous-events\";\nimport pslPageSetup from \"./psl-page-setup.js\";\nimport tabbedNav from \"./tabbed-nav.js\";\nimport { accordionInit } from \"../ts/ui/accordion\";\nimport initializeSentry from \"../ts/sentry\";\nimport setupAlgoliaAutocomplete from \"../ts/ui/autocomplete/index\";\n\n// Establish Phoenix Socket and LiveView configuration.\nimport { Socket } from \"phoenix\";\nimport { LiveSocket } from \"phoenix_live_view\";\n\nlet csrfToken = document\n  .querySelector(\"meta[name='csrf-token']\")\n  .getAttribute(\"content\");\nlet Hooks = {};\nHooks.AlgoliaAutocomplete = {\n  mounted() {\n    setupAlgoliaAutocomplete(this.el);\n  }\n};\nlet liveSocket = new LiveSocket(\"/live\", Socket, {\n  params: { _csrf_token: csrfToken },\n  hooks: Hooks\n});\n\n// connect if there are any LiveViews on the page\nliveSocket.connect();\n\n// expose liveSocket on window for web console debug logs and latency simulation:\n// >> liveSocket.enableDebug()\n// >> liveSocket.enableLatencySim(1000)  // enabled for duration of browser session\n// >> liveSocket.disableLatencySim()\nwindow.liveSocket = liveSocket;\n\ninitializeSentry();\n\ndocument.body.className = document.body.className.replace(\"no-js\", \"js\");\n\n// Extra steps for non-modular javascript\nTurbolinks.start();\n// Won't work as ProvidePlugin due to above\nwindow.Turbolinks = Turbolinks;\n\n// Doesn't work with ProvidePlugin due to window.zepto dep\nwindow.autocomplete = autocomplete;\n\n// Polyfills\nwindow.nextTick = function nextTick(f) {\n  window.setTimeout(f, 0);\n};\n\nwindow.requestAnimationFrame =\n  window.requestAnimationFrame ||\n  window.webkitRequestAnimationFrame ||\n  window.mozRequestAnimationFrame ||\n  function(f) {\n    window.setTimeout(f, 15);\n  };\n\n// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js\nif (!(\"previousElementSibling\" in document.documentElement)) {\n  Object.defineProperty(Element.prototype, \"previousElementSibling\", {\n    get() {\n      let e = this.previousSibling;\n      while (e && e.nodeType !== 1) {\n        e = e.previousSibling;\n      }\n      return e;\n    }\n  });\n}\n\nif (!(\"nextElementSibling\" in document.documentElement)) {\n  Object.defineProperty(Element.prototype, \"nextElementSibling\", {\n    get() {\n      let e = this.nextSibling;\n      while (e && e.nodeType !== 1) {\n        e = e.nextSibling;\n      }\n      return e;\n    }\n  });\n}\n\n// Production steps of ECMA-262, Edition 5, 15.4.4.19\n// Reference: http://es5.github.io/#x15.4.4.19\nif (!Array.prototype.map) {\n  Array.prototype.map = function(callback /* , thisArg */) {\n    let T;\n    let A;\n    let k;\n    if (this == null) {\n      throw new TypeError(\"this is null or not defined\");\n    }\n    const O = Object(this);\n    const len = O.length >>> 0;\n    if (typeof callback !== \"function\") {\n      throw new TypeError(`${callback} is not a function`);\n    }\n    if (arguments.length > 1) {\n      T = arguments[1];\n    }\n    A = new Array(len);\n    // 7. Let k be 0\n    while (k < len) {\n      var kValue;\n      var mappedValue;\n      if (k in O) {\n        kValue = O[k];\n        mappedValue = callback.call(T, kValue, k, O);\n        A[k] = mappedValue;\n      }\n      k++;\n    }\n    return A;\n  };\n}\n\n// Production steps of ECMA-262, Edition 6, 22.1.2.1\n// Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from\nif (!Array.from) {\n  Array.from = (function() {\n    const toStr = Object.prototype.toString;\n    const isCallable = function(fn) {\n      return typeof fn === \"function\" || toStr.call(fn) === \"[object Function]\";\n    };\n    const toInteger = function(value) {\n      const number = Number(value);\n      if (isNaN(number)) {\n        return 0;\n      }\n      if (number === 0 || !isFinite(number)) {\n        return number;\n      }\n      return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));\n    };\n    const maxSafeInteger = Math.pow(2, 53) - 1;\n    const toLength = function(value) {\n      const len = toInteger(value);\n      return Math.min(Math.max(len, 0), maxSafeInteger);\n    };\n\n    // The length property of the from method is 1.\n    return function from(arrayLike /* , mapFn, thisArg */) {\n      // 1. Let C be the this value.\n      const C = this;\n\n      // 2. Let items be ToObject(arrayLike).\n      const items = Object(arrayLike);\n\n      // 3. ReturnIfAbrupt(items).\n      if (arrayLike == null) {\n        throw new TypeError(\n          \"Array.from requires an array-like object - not null or undefined\"\n        );\n      }\n\n      // 4. If mapfn is undefined, then let mapping be false.\n      const mapFn = arguments.length > 1 ? arguments[1] : void undefined;\n      let T;\n      if (typeof mapFn !== \"undefined\") {\n        // 5. else\n        // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.\n        if (!isCallable(mapFn)) {\n          throw new TypeError(\n            \"Array.from: when provided, the second argument must be a function\"\n          );\n        }\n\n        // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.\n        if (arguments.length > 2) {\n          T = arguments[2];\n        }\n      }\n\n      // 10. Let lenValue be Get(items, \"length\").\n      // 11. Let len be ToLength(lenValue).\n      const len = toLength(items.length);\n\n      // 13. If IsConstructor(C) is true, then\n      // 13. a. Let A be the result of calling the [[Construct]] internal method\n      // of C with an argument list containing the single item len.\n      // 14. a. Else, Let A be ArrayCreate(len).\n      const A = isCallable(C) ? Object(new C(len)) : new Array(len);\n\n      // 16. Let k be 0.\n      let k = 0;\n      // 17. Repeat, while k < len… (also steps a - h)\n      let kValue;\n      while (k < len) {\n        kValue = items[k];\n        if (mapFn) {\n          A[k] =\n            typeof T === \"undefined\"\n              ? mapFn(kValue, k)\n              : mapFn.call(T, kValue, k);\n        } else {\n          A[k] = kValue;\n        }\n        k += 1;\n      }\n      // 18. Let putStatus be Put(A, \"length\", len, true).\n      A.length = len;\n      // 20. Return A.\n      return A;\n    };\n  })();\n}\n\n// https://tc39.github.io/ecma262/#sec-array.prototype.find\n// Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\nif (!Array.prototype.find) {\n  Object.defineProperty(Array.prototype, \"find\", {\n    value(predicate) {\n      // 1. Let O be ? ToObject(this value).\n      if (this == null) {\n        throw new TypeError('\"this\" is null or not defined');\n      }\n\n      const o = Object(this);\n\n      // 2. Let len be ? ToLength(? Get(O, \"length\")).\n      const len = o.length >>> 0;\n\n      // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n      if (typeof predicate !== \"function\") {\n        throw new TypeError(\"predicate must be a function\");\n      }\n\n      // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n      const thisArg = arguments[1];\n\n      // 5. Let k be 0.\n      let k = 0;\n\n      // 6. Repeat, while k < len\n      while (k < len) {\n        // a. Let Pk be ! ToString(k).\n        // b. Let kValue be ? Get(O, Pk).\n        // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n        // d. If testResult is true, return kValue.\n        const kValue = o[k];\n        if (predicate.call(thisArg, kValue, k, o)) {\n          return kValue;\n        }\n        // e. Increase k by 1.\n        k++;\n      }\n\n      // 7. Return undefined.\n      return undefined;\n    }\n  });\n}\n\n// Source: https://github.com/jserz/js_piece/blob/master/DOM/NonDocumentTypeChildNode/nextElementSibling/nextElementSibling.md\n(function(arr) {\n  arr.forEach(item => {\n    if (item.hasOwnProperty(\"nextElementSibling\")) {\n      return;\n    }\n    Object.defineProperty(item, \"nextElementSibling\", {\n      configurable: true,\n      enumerable: true,\n      get() {\n        let el = this;\n        while ((el = el.nextSibling)) {\n          if (el.nodeType === 1) {\n            return el;\n          }\n        }\n        return null;\n      },\n      set: undefined\n    });\n  });\n})([Element.prototype, CharacterData.prototype]);\n\nif (\"outerHTML\" in SVGElement.prototype) {\n  Object.defineProperty(SVGElement.prototype, \"outerHTML\", {\n    get() {\n      const container = document.createElement(\"div\");\n      container.appendChild(this.cloneNode(true));\n      return container.innerHTML;\n    },\n    enumerable: false,\n    configurable: true\n  });\n}\n\n// Element.closest() support for older browsers\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\nif (!Element.prototype.matches) {\n  Element.prototype.matches =\n    Element.prototype.msMatchesSelector ||\n    Element.prototype.webkitMatchesSelector;\n}\n\nif (!Element.prototype.closest) {\n  Element.prototype.closest = function(s) {\n    var el = this;\n\n    do {\n      if (el.matches(s)) return el;\n      el = el.parentElement || el.parentNode;\n    } while (el !== null && el.nodeType === 1);\n    return null;\n  };\n}\n\n// breakpoints defined in assets/css/_variables.scss\nconst breakpoints = { xs: 0, sm: 544, md: 800, lg: 1088, xxl: 1344 };\n\nsubmitOnEvents([\"blur\", \"change\"]);\ngoogleAnalytics();\nsetupGlobalNavigation();\ncollapse();\nalertItemLoad();\nmodal();\nturbolinksMods();\nsupportForm();\nfixedsticky();\nobjectFitImages(); // Polyfill for IE object-fit support\ninputFocus();\ngeoLocation();\naddressSearch();\ngoogleTranslate();\nscrollTo();\ntabbedNav();\ntimetableScroll();\ntimetableStyle();\ntimetableStick();\ndatePicker();\ntoggleBtn();\nstopBubbles();\nsearch(window.$, breakpoints);\nphotoGallery();\nstickyTooltip();\nglobalSearch.init();\nhomepageSearch.init();\nembeddedSearchInit();\nTripPlannerLocationControls.init();\nTimeControls.init();\nfullstory();\nsetupChannels();\nCRTrains();\ndismissFullscreenError();\ntripPlannerWidget();\neventPageSetup();\npreviousEventsButton();\npslPageSetup();\naccordionInit();\n","import * as Cookies from \"./cookies\";\n\nexport default function fullstory() {\n  const MODULO_SAMPLE = 50;\n  const id = getUniqueId();\n\n  // Only execute the FullStory code if the id is a multiple of the selected modulo\n  if (id % MODULO_SAMPLE == 0) {\n    fullStoryInit();\n  }\n}\n\n// This is the snippet that was generated by FullStory. No changes were made to\n// this auto-generated code.\nfunction fullStoryInit() {\n  window[\"_fs_debug\"] = false;\n  window[\"_fs_host\"] = \"fullstory.com\";\n  window[\"_fs_script\"] = \"edge.fullstory.com/s/fs.js\";\n  window[\"_fs_org\"] = \"AQKVD\";\n  window[\"_fs_namespace\"] = \"FS\";\n  (function(m, n, e, t, l, o, g, y) {\n    if (e in m) {\n      if (m.console && m.console.log) {\n        m.console.log(\n          'FullStory namespace conflict. Please set window[\"_fs_namespace\"].'\n        );\n      }\n      return;\n    }\n    g = m[e] = function(a, b, s) {\n      g.q ? g.q.push([a, b, s]) : g._api(a, b, s);\n    };\n    g.q = [];\n    o = n.createElement(t);\n    o.async = 1;\n    o.crossOrigin = \"anonymous\";\n    o.src = \"https://\" + _fs_script;\n    y = n.getElementsByTagName(t)[0];\n    y.parentNode.insertBefore(o, y);\n    g.identify = function(i, v, s) {\n      g(l, { uid: i }, s);\n      if (v) g(l, v, s);\n    };\n    g.setUserVars = function(v, s) {\n      g(l, v, s);\n    };\n    g.event = function(i, v, s) {\n      g(\"event\", { n: i, p: v }, s);\n    };\n    g.anonymize = function() {\n      g.identify(!!0);\n    };\n    g.shutdown = function() {\n      g(\"rec\", !1);\n    };\n    g.restart = function() {\n      g(\"rec\", !0);\n    };\n    g.log = function(a, b) {\n      g(\"log\", [a, b]);\n    };\n    g.consent = function(a) {\n      g(\"consent\", !arguments.length || a);\n    };\n    g.identifyAccount = function(i, v) {\n      o = \"account\";\n      v = v || {};\n      v.acctId = i;\n      g(o, v);\n    };\n    g.clearUserCookie = function() {};\n    g._w = {};\n    y = \"XMLHttpRequest\";\n    g._w[y] = m[y];\n    y = \"fetch\";\n    g._w[y] = m[y];\n    if (m[y])\n      m[y] = function() {\n        return g._w[y].apply(this, arguments);\n      };\n    g._v = \"1.2.0\";\n  })(window, document, window[\"_fs_namespace\"], \"script\", \"user\");\n}\n\nfunction getUniqueId() {\n  const mbtaIdCookie = Cookies.getCookie(\"mbta_id\");\n\n  let id = 1;\n  if (mbtaIdCookie) {\n    try {\n      id = parseInt(mbtaIdCookie);\n    } catch (err) {\n      console.error(\n        \"Cookies.getUniqueId: Unable to parse mbta_id cookie as integer.\"\n      );\n    }\n  }\n\n  return id;\n}\n","export default function(events, $) {\n  $ = $ || window.jQuery;\n  events.forEach(event => {\n    function onEvent(ev) {\n      $(ev.target)\n        .siblings(\"label\")\n        .find(\".loading-indicator\")\n        .removeClass(\"hidden-xs-up\");\n      const form = $(ev.target).parents(\"form\");\n      const action = form.attr(\"action\");\n      const serialized = form.serialize();\n\n      window.Turbolinks.visit(mergeAction(action, serialized));\n    }\n\n    function hideLoading(ev) {\n      $(`[data-submit-on-${event}] label .loading-indicator`).addClass(\n        \"hidden-xs-up\"\n      );\n    }\n\n    function hideSubmits() {\n      $(\n        '<style type=\"text/css\">[data-submit-on-' +\n          event +\n          \"] [type=submit] {display: none;}</style>\"\n      ).appendTo($(\"head\"));\n    }\n\n    $(document).on(event, \"[data-submit-on-\" + event + \"] select\", onEvent);\n    $(document).on(event, \"[data-submit-on-\" + event + \"] input\", onEvent);\n    document.addEventListener(\"turbolinks:before-cache\", hideLoading, {\n      passive: true\n    });\n    hideSubmits();\n  });\n}\n\nexport function mergeAction(action, params, pathname) {\n  if (!pathname) {\n    if (typeof window !== \"undefined\") {\n      // not set in tests\n      pathname = window.location.pathname;\n    }\n  }\n  if (typeof action === \"undefined\" || action === \"\" || action === \"#\") {\n    return pathname + \"?\" + params;\n  }\n  if (action.charAt(0) == \"#\") {\n    return pathname + \"?\" + params + action;\n  }\n  const replacedHash = action.replace(/#/, \"?\" + params + \"#\");\n  if (replacedHash === action) {\n    return action + \"?\" + params;\n  }\n  return replacedHash;\n}\n","export default function($) {\n  $ = $ || window.jQuery;\n\n  function handler(extraClass, collapseEvent) {\n    return function(ev) {\n      ev.preventDefault();\n      ev.stopPropagation();\n      const selector = $(ev.currentTarget).data(\"target\");\n      $(selector)\n        .addClass(\"collapse\")\n        .addClass(extraClass)\n        .collapse({ toggle: false })\n        .collapse(collapseEvent);\n    };\n  }\n  $(document).on(\"click\", \"[data-hide=collapse]\", handler(\"in\", \"hide\"));\n  $(document).on(\"click\", \"[data-show=collapse]\", handler(\"\", \"show\"));\n\n  // focus after expansion of collapsible elements that have the js-focus-on-expand class\n  $(document).on(\"shown.bs.collapse\", \".js-focus-on-expand\", ev => {\n    ev.target.focus();\n  });\n}\n","export default function($) {\n  $ = $ || window.jQuery;\n\n  function closeModals() {\n    $(\".modal.in\").modal(\"hide\");\n  }\n\n  document.addEventListener(\"turbolinks:before-cache\", closeModals, {\n    passive: true\n  });\n}\n","// Sets up event listeners that activate the fixedSticky plugin at ../vendor/fixedsticky.js\n\nexport default function($) {\n  $ = $ || window.jQuery;\n\n  function fixedsticky() {\n    $(\".fixedsticky\").fixedsticky(\"destroy\");\n    $(\".fixedsticky\").fixedsticky();\n  }\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => window.nextTick(fixedsticky),\n    { passive: true }\n  );\n  document.addEventListener(\n    \"shown.bs.collapse\",\n    () => window.nextTick(fixedsticky),\n    { passive: true }\n  );\n}\n","export default function init() {\n  const $ = window.jQuery;\n\n  function onFocus(ev) {\n    $(ev.target.parentNode).addClass(\"c-form__input-focused\");\n  }\n\n  function onBlur(ev) {\n    $(ev.target.parentNode).removeClass(\"c-form__input-focused\");\n  }\n\n  $(document).on(\"focus\", \".js-form__input\", onFocus);\n  $(document).on(\"blur\", \".js-form__input\", onBlur);\n}\n","const updateTabs = (tabType, navTabs, contentTabs) => e => {\n  e.preventDefault();\n\n  navTabs.forEach(tab => {\n    const clickedTab = tab.dataset.tabType === tabType;\n    tab.classList.toggle(\"active\", clickedTab);\n    tab.setAttribute(\"aria-selected\", clickedTab);\n  });\n\n  contentTabs.forEach(tab => {\n    const clickedTabContentType = tab.dataset.tabContentType === tabType;\n    tab.classList.toggle(\"active\", clickedTabContentType);\n  });\n};\n\nconst tabbedNavSetup = () => {\n  const navTabs = document.querySelectorAll(\".m-tabbed-nav__item\");\n  const contentTabs = document.querySelectorAll(\".m-tabbed-nav__content-item\");\n\n  navTabs.forEach(item => {\n    const { tabType } = item.dataset;\n    const callback = updateTabs(tabType, navTabs, contentTabs);\n\n    item.addEventListener(\"click\", callback);\n    item.addEventListener(\"keyup\", e => {\n      if (e.key === \"Enter\") {\n        callback(e);\n      }\n    });\n  });\n};\n\nexport default function init() {\n  document.addEventListener(\"turbolinks:load\", () => {\n    tabbedNavSetup();\n  });\n}\n","export default $ => {\n  $ = $ || window.jQuery;\n  const state = {\n    animating: false\n  };\n\n  const scroll = direction => {\n    if (state.animating === true) {\n      return;\n    }\n    // determine the scrolling increment based on the width of an existing column\n    // get the second column (the first is a header) and add 1 for the border\n    const offset =\n      ([...document.querySelectorAll(\".js-tt-cell\")].slice(1, 2)[0]\n        .clientWidth +\n        1) *\n      direction;\n\n    // find the container element that will be scrolled\n    const $el = $(\"[data-sticky-container]\");\n\n    // animate the scroll event\n    $el.animate(\n      { scrollLeft: $el.scrollLeft() + offset },\n      {\n        duration: 200,\n        step: () => {\n          state.animating = true;\n        },\n        done: () => {\n          state.animating = false;\n        }\n      }\n    );\n  };\n\n  $(document).on(\"click\", \"button[data-scroll='earlier']\", () => scroll(-1));\n  $(document).on(\"click\", \"button[data-scroll='later']\", () => scroll(1));\n};\n","export default function($) {\n  $ = $ || window.jQuery;\n\n  // hide the elements\n  const hide = firstLoad => {\n    if (firstLoad) {\n      $(\".direction-filter\").removeAttr(\"hidden\");\n      $(\".date-picker-container\").attr(\"hidden\", \"hidden\");\n    } else {\n      $(\".date-picker-container\").slideUp(\"slow\", () => {\n        $(\".date-picker-container\").attr(\"hidden\", \"hidden\");\n        $(\".direction-filter\")\n          .hide()\n          .removeAttr(\"hidden\")\n          .slideDown(\"fast\");\n      });\n    }\n    $(\".calendar-cover\").attr(\"hidden\", \"hidden\");\n  };\n\n  // show the elements\n  const show = () => {\n    $(\".direction-filter\").attr(\"hidden\", \"hidden\");\n    $(\".date-picker-container\")\n      .hide()\n      .removeAttr(\"hidden\")\n      .slideDown(\"slow\");\n    $(\".calendar-cover\").removeAttr(\"hidden\");\n  };\n\n  // event handler for toggling\n  const toggleDatePicker = ev => {\n    ev.preventDefault();\n    const expand = document\n      .querySelector(\".date-picker-container\")\n      .hasAttribute(\"hidden\");\n    const datePickerEl = document.getElementById(\"date-filter\");\n    if (expand) {\n      show();\n      document.getElementById(\"date-picker-calendar\").focus();\n    } else {\n      hide(false);\n      datePickerEl.focus();\n    }\n    datePickerEl.setAttribute(\"aria-expanded\", expand);\n  };\n\n  // setup toggle behavior\n  const setupDatePicker = () => {\n    hide(true);\n    $(document).on(\"click\", \".date-picker-toggle\", toggleDatePicker);\n  };\n\n  // when the month is shifted, the page will be reloaded, needs to be shown (or re-initialized)\n  const displayOnLoad = () => {\n    // don't do anything if the container is not available\n    if (!document.getElementById(\"date-filter\")) {\n      return;\n    }\n\n    // check if the shift variable is in the query string\n    if (window.location.search.indexOf(\"shift=\") === -1) {\n      // re-initialize the page\n      requestAnimationFrame(() => hide(true));\n    } else {\n      // show onload\n      requestAnimationFrame(show);\n    }\n  };\n\n  // events\n  setupDatePicker();\n  document.addEventListener(\"turbolinks:load\", displayOnLoad, {\n    passive: true\n  });\n}\n","export default function($) {\n  $ = $ || window.jQuery;\n\n  $(document).on(\"turbolinks:load\", function() {\n    $(\"[toggle-element-collapse]\").addClass(\"collapse\");\n  });\n  $(document).on(\"click\", \"[data-toggle-collapse]\", function() {\n    const route_id = $(this).attr(\"data-toggle-collapse\");\n    const toggle_elements = \"[data-toggle-route=\" + route_id + \"]\";\n    $(toggle_elements).toggle();\n  });\n\n  $(document).on(\"click\", \"[data-toggle-hide]\", function() {\n    $(\"[data-toggle-hide]\").hide();\n  });\n}\n","export default function stopBubbles($) {\n  $ = $ || window.jQuery;\n\n  function toggleStopList(e) {\n    const targetId = $(e.target).attr(\"id\");\n    const clickedLink = $(\"[data-target='#\" + targetId + \"']\");\n\n    toggleArrow(clickedLink);\n    toggleBranch(clickedLink);\n  }\n\n  function toggleArrow(link) {\n    link.find(\".fa\").toggleClass(\"fa-angle-down fa-angle-up\");\n  }\n\n  function toggleBranch(link) {\n    const branch = link.data(\"target-branch\");\n    $(\"[data-branch='\" + branch + \"']\").toggleClass(\"expanded\");\n    link.parents(\".route-branch-stop\").toggleClass(\"expanded\");\n  }\n\n  $(document).on(\n    \"hide.bs.collapse show.bs.collapse\",\n    \".collapse.stop-list\",\n    toggleStopList\n  );\n}\n","export default function search($, breakpoints) {\n  // focus the search input once the menu is fully expanded\n  $(document).on(\"shown.bs.collapse\", \"#search\", ev => {\n    $(\"[data-input=search]\")\n      .eq(0)\n      .focus();\n  });\n\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      setupFilterToggleOnMobile($, breakpoints);\n    },\n    { passive: true }\n  );\n}\n\nfunction setupFilterToggleOnMobile($, breakpoints) {\n  // submit form every time a checkbox value is changed\n  $(\"[data-facet=search] input[type='checkbox']\").change(() => {\n    $(\"[data-form='search-filter']\").submit();\n  });\n\n  // hide search filter options on mobile\n  $(\"[data-container='search-filter']\").addClass(\"hidden-sm-down\");\n\n  // toggle filter options when clicking the header on mobile\n  $(\"[data-heading='search-filter']\")\n    .addClass(\"closed\")\n    .click(ev => {\n      // this functionality is only relevent to our smallest breakpoint\n      if ($(window).width() > breakpoints.md) {\n        return;\n      }\n\n      const $header = $(ev.target);\n      const $listContainer = $header\n        .siblings(\"[data-container='search-filter']\")\n        .eq(0);\n      if ($listContainer.hasClass(\"hidden-sm-down\")) {\n        $listContainer\n          .hide()\n          .removeClass(\"hidden-sm-down\")\n          .slideDown(\"fast\");\n        $header.addClass(\"open\").removeClass(\"closed\");\n      } else {\n        $header.removeClass(\"open\").addClass(\"closed\");\n        $listContainer.slideUp(\"fast\", () => {\n          $listContainer.addClass(\"hidden-sm-down\").css({ display: \"block\" });\n        });\n      }\n    });\n}\n","// Sourced from https://gist.github.com/alekseyg/d2261e42a9b5335a8ce0774b4d92f129 with small\n// modifications. Fixes being unable to dismiss tooltips on iOS devices.\n\nexport default function($) {\n  $ = $ || window.jQuery;\n  const selector = '[data-toggle=\"tooltip\"]';\n\n  const wasTapped = element => {\n    const touchStart = element.data(\"lastTouchStart\");\n    const touchEnd = element.data(\"lastTouchEnd\");\n    return (\n      touchStart &&\n      touchEnd &&\n      touchEnd.timeStamp - touchStart.timeStamp <= 500 && // duration\n      Math.abs(touchEnd.pageX - touchStart.pageX) <= 10 && // deltaX\n      Math.abs(touchEnd.pageY - touchStart.pageY) <= 10 // deltaY\n    );\n  };\n\n  const wasTouchedRecently = element => {\n    const lastTouch =\n      element.data(\"lastTouchEnd\") || element.data(\"lastTouchStart\");\n    return lastTouch && new Date() - lastTouch.timeStamp <= 550;\n  };\n\n  const hideTooltip = element => {\n    window.setTimeout(() => {\n      element.tooltip(\"hide\");\n    }, 10);\n  };\n\n  const initTooltip = () => {\n    $(selector).each(function(i, el) {\n      $(el).tooltip({ container: $(el).parent() });\n    });\n\n    $(document).on(\"touchstart\", selector, function(e) {\n      $(this).data(\"lastTouchStart\", e.originalEvent);\n    });\n    $(document).on(\"touchend\", selector, function(e) {\n      e.stopPropagation();\n      const $this = $(this);\n      $this.data(\"lastTouchEnd\", e.originalEvent);\n\n      if (wasTapped($this)) {\n        $this.tooltip(\"toggle\");\n      }\n    });\n    $(document).on(\"mouseenter\", selector, function(e) {\n      const $this = $(this);\n      if (wasTouchedRecently($this)) {\n        return;\n      }\n      $this.tooltip(\"show\");\n    });\n    $(document).on(\"mouseleave\", selector, function(e) {\n      const $this = $(this);\n      if (wasTouchedRecently($this)) {\n        return;\n      }\n\n      hideTooltip($this);\n    });\n    $(document).on(\"focus\", selector, function(e) {\n      const $this = $(this);\n      if (wasTouchedRecently($this)) {\n        return;\n      }\n      $this.tooltip(\"show\");\n    });\n    $(document).on(\"focusout\", selector, function(e) {\n      const $this = $(this);\n      if (wasTouchedRecently($this)) {\n        return;\n      }\n\n      hideTooltip($this);\n    });\n\n    $(document).on(\"touchend\", \"body\", () => {\n      hideTooltip($('[data-toggle=\"tooltip\"]'));\n    });\n  };\n\n  function clearTooltips() {\n    $(selector).tooltip(\"dispose\");\n    $(\".tooltip\").remove();\n  }\n\n  document.addEventListener(\"turbolinks:before-cache\", clearTooltips, {\n    passive: true\n  });\n  document.addEventListener(\"turbolinks:load\", initTooltip, { passive: true });\n}\n","export function getCookie(name) {\n  return getCookieFromString(document.cookie, name);\n}\n\nexport function getCookieFromString(cookies, name) {\n  const cookieArray = cookies.split(\";\");\n\n  for (let cookie in cookieArray) {\n    let key;\n    let value;\n    [key, value] = cookieArray[cookie].split(\"=\");\n    if (key && key.trim() === name) {\n      return value.trim();\n    }\n  }\n\n  return null;\n}\n","/**\n * Enable Algolia-based autocomplete on location fields in Trip Planner-based\n * widgets that are outside the Trip Planner page. Because there may be more\n * than one widget on a page, this is done by invoking the\n * TripPlannerLocControls class once per widget\n */\nimport { TripPlannerLocControls } from \"./trip-planner-location-controls\";\n\nexport default function() {\n  document.addEventListener(\"turbolinks:load\", () => {\n    const widgets = document.getElementsByClassName(\n      \"c-paragraph--trip-plan-widget\"\n    );\n    Array.from(widgets).forEach(widget => {\n      const t = new TripPlannerLocControls({ containerEl: widget });\n    });\n  });\n}\n","export function setupViewPreviousEventsButton() {\n  const viewPreviousEventsButtons = [\n    ...document.querySelectorAll(\"a.m-previous-events-button\")\n  ];\n\n  viewPreviousEventsButtons.forEach(button => {\n    button.addEventListener(\"click\", () => {\n      // show hidden events for this button\n      const groupName = button.dataset.group;\n      const hiddenEventsForGroup = document.querySelectorAll(\n        `.m-event.hidden[data-group=\"${groupName}\"]`\n      );\n      [...hiddenEventsForGroup].forEach(event => {\n        event.classList.remove(\"hidden\");\n      });\n      button.parentElement.classList.add(\"hidden\");\n    });\n    // If the user navigates by keyboard, simulate click on enter-key press\n    button.addEventListener(\"keyup\", e => {\n      if (e.keyCode === 13) {\n        button.click();\n      }\n    });\n  });\n}\n\nexport default function() {\n  document.addEventListener(\n    \"turbolinks:load\",\n    () => {\n      setupViewPreviousEventsButton();\n    },\n    { passive: true }\n  );\n}\n","export default function() {\n  return new Promise(function(resolve, reject) {\n    if (window.navigator && window.navigator.geolocation) {\n      window.navigator.geolocation.getCurrentPosition(resolve, reject);\n    } else {\n      reject(\"window.navigator.geolocation not enabled\");\n    }\n  });\n}\n","export function getFeatureIcon(feature) {\n  const icon = document.getElementById(`icon-feature-${feature}`);\n  if (icon) {\n    return icon.innerHTML;\n  }\n  return \"\";\n}\n\nexport function getSvgIcon(feature) {\n  const icon = document.getElementById(`icon-feature-${feature}`);\n  if (icon) {\n    const svg = icon.getElementsByTagName(\"svg\").item(0);\n    if (svg) {\n      return svg.outerHTML;\n    }\n  }\n  return \"\";\n}\n","/* eslint-disable no-underscore-dangle */\n/**\n * Via https://github.com/toptal/keycodes/\n */\n\nconst exceptionsByType = [\n  {\n    type: \"TypeError\",\n    items: [\n      {\n        // Facebook crawlers bug\n        // https://github.com/aFarkas/lazysizes/issues/520\n        value: \"Illegal invocation\",\n        function: \"triggerEvent\",\n        module: \"lazysizes/lazysizes\"\n      },\n      {\n        // Some 3rd party Ad manager\n        value: \"Cannot read property '0' of undefined\",\n        function: \"setAdPageRatioLogicConfig\"\n      },\n      {\n        // Some 3rd party Video crawler manager\n        value: \"t.indexOf is not a function\",\n        function: \"check_swipe_element\"\n      },\n      {\n        // Injected code tries to get video element attributes\n        value: `undefined is not an object (evaluating 'document.getElementsByTagName(\"video\")[0].attributes')`,\n        function: \"global code\",\n        module: \"<unknown module>\"\n      }\n    ]\n  },\n  {\n    type: \"SyntaxError\",\n    items: [\n      {\n        // Parse-related on old Chrome Mobile WebView 43.0.2357,\n        // Android 5.1.1, Samsung SM-N7505\n        value: \"Unexpected end of input\",\n        function: \"Object.parse\",\n        filename: \"native\"\n      }\n    ]\n  },\n  {\n    type: \"SecurityError\",\n    items: [\n      {\n        // Injected code tries to access a cross-origin frame and Trustpilot widget\n        value:\n          'Blocked a frame with origin \"https://www.toptal.com\" from accessing a cross-origin frame.',\n        module: \"bootstrap/v5/tp.widget.bootstrap\"\n      },\n      {\n        value:\n          'Blocked a frame with origin \"https://www.toptal.com\" from accessing a cross-origin frame.',\n        function: \"global code\"\n      }\n    ]\n  },\n  {\n    type: \"RangeError\",\n    items: [\n      {\n        // Safari 13 smoothscroll bug\n        value: \"Maximum call stack size exceeded.\",\n        module: \"smoothscroll-polyfill/dist/smoothscroll\"\n      }\n    ]\n  }\n];\n\nconst exceptionsWithMechanism = [\n  {\n    type: \"CompileError\",\n    items: [\n      {\n        value:\n          \"WebAssembly.instantiate(): expected magic word 00 61 73 6d, found 7b 22 61 6c @+0\",\n        type: \"onunhandledrejection\"\n      }\n    ]\n  },\n  {\n    type: \"UnhandledRejection\",\n    items: [\n      {\n        value:\n          \"Non-Error promise rejection captured with value: Could not find Taboola in window\",\n        type: \"onunhandledrejection\"\n      },\n      {\n        value:\n          \"Non-Error promise rejection captured with value: Could not find Nativo script in window\",\n        type: \"onunhandledrejection\"\n      },\n      {\n        value:\n          \"Non-Error promise rejection captured with value: Could not find googletag in window\",\n        type: \"onunhandledrejection\"\n      }\n    ]\n  }\n];\n\n// eslint-disable-next-line consistent-return\nconst handleUnhandledRejection = (event, value, stacktrace) => {\n  // Google reCAPTCHA timeout exceptions\n  const recaptchaPattern = /^Non-Error promise rejection captured with value: Timeout( \\(\\w\\))?$/;\n\n  if (recaptchaPattern.test(value)) {\n    return true;\n  }\n\n  if (\n    !stacktrace &&\n    value ===\n      \"Non-Error promise rejection captured with keys: errors, message, name\"\n  ) {\n    const extra = event?.extra;\n\n    if (extra) {\n      const message = extra.__serialized__?.message;\n\n      // 3rd party code RxJS error, supposedly Grammarly extension\n      if (\n        message ===\n        \"1 errors occurred during unsubscription:\\n1) RangeError: Maximum call stack size exceeded.\"\n      ) {\n        return true;\n      }\n    }\n  }\n};\n\n/**\n * Issue:\n * Chrome browser after version 102 update reports user prompted errors to Sentry.\n * Chrome changelog: Errors during script evaluation in the Console now generate proper error events that trigger the window.onerror handler and are dispatched as \"error\" events on the window object.\n * Previous chrome versions (like v101) and browsers don’t report such issues.\n *\n * Temporary solution:\n * Filter out errors from the exact page (https://www.toptal.com/javascript/interview-questions is the most affected since it has javascript code examples, which user can test in the console) in Chrome v102 and above.\n */\nconst handleUserPromptedError = event => {\n  const { url, headers } = event.request || {};\n\n  if (!url || !headers) {\n    return false;\n  }\n\n  const urlRegExp = /^(javascript|react|nodejs)(\\/(interview-questions|tips-and-practices))?$/;\n  const versionRegExp = /Chrome\\/(\\d+)\\./;\n\n  const relativeUrl = url.split(\"/\", 4).pop();\n  const [, version] = headers[\"User-Agent\"].match(versionRegExp) || [];\n\n  return urlRegExp.test(relativeUrl) && version >= 102;\n};\n\nconst beforeSend = (event, hint) => {\n  const exactFetchMessages = [\n    \"Load failed\", // Safari fetch error\n    \"Failed to fetch\", // Chrome fetch error\n    \"NetworkError when attempting to fetch resource.\" // Firefox fetch error\n  ];\n\n  if (\n    event?.message === \"FetchJSONWithCache Error\" &&\n    exactFetchMessages.includes(event?.extra?.error?.message)\n  ) {\n    return null;\n  }\n\n  const error = hint.originalException;\n\n  if (error?.message) {\n    const exactMessages = [\n      \"twttr is not defined\", // Twitter GTM tag errors\n      \"Can't find variable: twttr\", // Twitter GTM tag errors\n      \"Can't find variable: article\",\n      \"Can't find variable: $\",\n      \"Can't find variable: WeixinJSBridge\", // 3rd party, Mobile Safari UI/WKWebView, iOS 13.6\n      \"Can't find variable: al_onPoststitialDismiss\", // 3rd party, Mobile Safari UI/WKWebView, iOS 15.3.1\n      \"Identifier 'boundExec' has already been declared\", // 3rd party, Windows 10\n      \"Identifier 'kImgMinWidth' has already been declared\", // Chrome Mobile WebView 87, Android 11\n      \"tm_x is not defined\", // Chrome Mobile WebView 99, Android 9;\n      \"Unexpected token 'var'\",\n      \"chrome is not defined\" // Firefox extension tries to use chrome object\n    ];\n\n    const partialMessages = [\n      \"Loading chunk\",\n      \"Loading CSS chunk\",\n      \"Object Not Found Matching Id:\", // Microsoft Outlook SafeLink crawlers\n      \"instantSearchSDKJSBridgeClearHighlight\", // Bing Instant Search issue with Edge on iOS\n      \"crazyegg\",\n      \"customDispatchEvent is not defined\", // Issue coming from crazyegg third-party script\n      \"Quora Pixel Error\",\n      \"mraid\", // Issues coming from Mobile ads (MRAID SDK)\n      \"MoatMAK\", // Issues coming from Mobile ads (MRAID SDK)\n      \"sendBeacon\", // Issues coming from Cloudflare beacon.min.js script\n      \"pktAnnotationHighlighter\", // Issues coming from Pocket on iOS\n      \"SecurityError: Blocked a frame with origin\", // CORS issues from users or third-party scripts/apps\n      \"SecurityError: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules\", // CORS issue, probably caused by an extension, when accessing cssRules on a stylesheet from another domain\n      \"NetworkError: Load failed\", // Fetch issue on user browser\n      \"NotAllowedError: Read permission denied\", // User browser issue originated from third-party scripts\n      \"Failed to read the 'cookie' property from 'Document'\", // User browser issue to fetch cookies\n      \"safari-extension\",\n      \"safari-web-extension\",\n      \"chrome-extension\",\n      \"moz-extension\", // Firefox\n      \"perfectbrowsr_nodecheck\", // browser extension\n      \"BetterJsPop\", // adblocker\n      \"redefine property: googletag\", // GTM\n      \"localStorage\", // mobile device settings\n      \"mobincube\", // third-party app\n      \"crypto.getRandomValues\", // third-party app\n      \"Zotero\", // third-party app\n      \"zaloJSV2\", // Zalo API\n      \"QK_middlewareReadModePage\", // noise from ads/campaigns\n      \"VUE_DEVTOOLS_IFRAME\", // Issue coming from Vue Devtools extension\n      \"UXCam\", // third-party app\n      \"keydownt\", // Coming from a chrome extension\n      \"onTabScrolled is not defined\", // Might be coming from browser extensions or third-party apps\n      \"window.appHotStart\", // Might be coming from browser extensions or third-party apps\n      \"window.bannerNight\", // Might be coming from browser extensions or third-party apps\n      \"window.showAngularStats\", // Might be coming from browser extensions or third-party apps\n      \"window.huawei\", // Coming from Huawei mobile devices\n      \"window.onunload is not a function\", // Third-party scripts\n      \"window.regainData is not a function\", // Third-party scripts\n      \"window.getPlayer is not a function\", // Third-party scripts\n      \"window.performance.getEntries is not a function\", // Trying to access from console in unsupported browser\n      \"getHiAnalysticsParam\", // Coming from Huawei mobile devices\n      \"vid_mate_check\", // third-party app\n      \"ucapi is not defined\", // Might be coming from browser extensions or third-party apps\n      \"fixedTimeID is not defined\", // Likely coming from a browser extension\n      \"UCShellJava\", // noise coming from UC Browser\n      \"__show__deepen\", // noise likely coming from browsers/extensions\n      \"Identifier 'VIDEO_PLAYING'\", // noise likely coming from browsers/extensions\n      \"C3 is not defined\", // coming from C3 maps script\n      \"safari.self.tab.setContext\", // Safari browser error\n      \"checkDomStatus\", // likely coming from ads/campaigns\n      \"privateSpecialRepair\", // likely coming from ads/campaigns\n      \"TypeError: WebKit\", // Safari (WebKit) internal issues\n      \"setIOSParameters\", // Mobile Safari browser issue on iOS\n      \"webkitExitFullScreen\", // Mobile Safari browser issue on iOS\n      \"getElementsByTagName('video')\", // Mobile Safari browser issue on iOS\n      \"NS_ERROR_\", // Firefox internal errors\n      \"__firefox__\", // Firefox internal errors\n      \"Java exception was raised\", // Android internal issues\n      \"onAPWebViewPause\", // Issue coming from Webviews on Mobile devices\n      \"DOMNodeInsertedByJs\", // Coming from an Android browser called Crosswalk\n      \"notifyCurrentVideoState is not defined\", // Coming from Mobile devices\n      \"prebidjs\", // Coming from a bidding external script (Prebid.js)\n      \"Taboola\", // Taboola third-party script\n      \"fb.js\", // Issues coming from Facebook pixel/third-party script on GTM\n      \"fbevents.js\", // Issues coming from Facebook pixel/third-party script on GTM\n      \"ats.js\", // ATS tracker script (probably coming from GTM)\n      \"Could not find Nativo\", // Nativo third-party script\n      \"Could not find googletag\", // Another possible GTM issue\n      \"grecaptcha is not defined\", // Coming from recaptcha\n      \"langDetector is not defined\", // Translation third-party script\n      \"DomNode has not been set for this SimpleScriptable\", // HTMLUnit issue coming from very old browsers\n      \"First argument to Readability constructor should be a document object\", // Readability app on Mobile devices\n      \"Can't find variable: al_\", // Appears only on Apple devices, related to tracking\n      \"tgetT is not defined\" // 3rd party\n    ];\n\n    const patterns = [\n      /window.cb\\d+ is not a function/ // 3rd party, Windows 10, Edge 98.0.1108\n    ];\n\n    const { message } = error;\n\n    if (\n      exactMessages.includes(message) ||\n      partialMessages.some(msg => message.includes(msg)) ||\n      patterns.some(pattern => pattern.test(message))\n    ) {\n      return null;\n    }\n\n    const parsedEvent = JSON.stringify(event);\n\n    const match = [\n      \"r.beacon\", // NewRelic\n      \"nrWrapper\", // NewRelic\n      \"gtm.js\", // GTM main script\n      \"uwt.js\", // Twitter Universal Tag\n      \"fb.js\", // Issues coming from Facebook pixel/third-party script on GTM\n      \"ads/pixel.js\", // Reddit Pixel\n      \"hstc.tracking\", // Hubspot tracking script\n      \"setupPops\", // Chrome issue coming from adblockers\n      \"translate_http\", // Issues coming from Google Translate API\n      \"translate_a\", // Issues coming from Google Translate API\n      \"common-scripts\", // Third-party scripts such as CrazyEgg\n      \"clarity.js\", // Microsoft Clarity analytics tool\n      \"srcIsLegacy\", // Drift third-party script\n      \"setupPops\", // Chrome issue coming from adblockers\n      \"safari-extension\",\n      \"safari-web-extension\",\n      \"chrome-extension\",\n      \"moz-extension\", // Firefox\n      \"beacon.min.js\", // Cloudflare script\n      \"recaptcha/releases\",\n      \"RILLONGPRESS\", // third-party script\n      \"bad-network-popup\", // third-party script\n      \"adblocker\", // Ad blockers\n      \"ats.js\", // ATS tracker script (probably coming from GTM)\n      \"processRandomSelector\", // noise from ads/campaigns\n      \"card-injection.js\", // coming from a netfree.link website, might be an extension or app\n      \"SnapTube\", // External app to download videos\n      \"Grammarly.js\", // Grammarly extension\n      \"beforeLoad_SafariV2.js\", // Coming from Safari extensions\n      \"MathJax.js\", // MathJax.js script\n      \"addons/pops/license\", // Coming from random addons\n      \"BVProxy.min.js\", // BVProxy external script\n      \"zteEnd\", // Coming from an external script related to ZTE phones\n      \"crypto.getRandomValues\", // third-party app\n      \"localStorage\", // Mobile device settings (usually coming from Android)\n      \"/Users/\", // MacOS localhost\n      \"C:\\\\Users\\\\\", // Windows localhost\n      \"insitez.blob.core.windows\" // informizely\n    ].some(predicate => parsedEvent.includes(predicate));\n\n    if (match) {\n      return null;\n    }\n  }\n\n  const values = event?.exception?.values;\n\n  if (values?.length) {\n    const [{ type, value, stacktrace, mechanism }] = values;\n\n    if (type.includes(\"NS_ERROR_\")) {\n      // Firefox internal errors\n      return null;\n    }\n\n    if (type === \"Event\") {\n      if (\n        value ===\n          \"Non-Error exception captured with keys: currentTarget, isTrusted, target, type\" &&\n        event.extra?.__serialized__?.target ===\n          \"body > main#page-root > div#cookie-banner-host\"\n      ) {\n        return null;\n      }\n    }\n\n    if (type === \"UnhandledRejection\") {\n      if (handleUnhandledRejection(event, value, stacktrace)) {\n        return null;\n      }\n    }\n\n    if (mechanism) {\n      const errorType = exceptionsWithMechanism.find(\n        ({ type: eventType }) => eventType === type\n      );\n\n      if (errorType) {\n        const match = errorType.items.some(\n          ({ value: itemValue, type: itemType }) =>\n            itemValue === value && itemType === mechanism?.type\n        );\n\n        if (match) {\n          return null;\n        }\n      }\n    }\n\n    if (stacktrace?.frames) {\n      const errorType = exceptionsByType.find(\n        ({ type: eventType }) => eventType === type\n      );\n\n      if (errorType) {\n        const match = stacktrace.frames.some(frame =>\n          errorType.items.some(\n            ({ value: itemValue, ...item }) =>\n              itemValue === value &&\n              Object.keys(item).every(key => item[key] === frame[key])\n          )\n        );\n\n        if (match) {\n          return null;\n        }\n      }\n\n      // Some 3rd-party syntax error\n      const errors = [\n        \"missing ] after element list\", // Android 11, FireFox Mobile 95\n        \"Unexpected identifier\", // Android 11, Chrome Mobile 97\n        \"Unexpected identifier 'Arguments'. Expected either a closing ']' or a ',' following an array element.\" // IOS 15.3, Safari 15.3\n      ];\n\n      if (\n        type === \"SyntaxError\" &&\n        errors.includes(value) &&\n        event?.extra?.arguments.length\n      ) {\n        const { frames } = stacktrace;\n        const [{ isTrusted }] = event.extra.arguments;\n\n        const culprits = [\n          \"get/<(<unknown module>)\",\n          \"Function([native code])\",\n          \"new Function(<anonymous>)\"\n        ];\n\n        const isCulpritUnknown = culprits.includes(event?.culprit);\n\n        const isThirdParty =\n          isTrusted &&\n          isCulpritUnknown &&\n          frames.some(frame => frame.module === \"<unknown module>\");\n\n        if (isThirdParty) {\n          return null;\n        }\n      }\n    }\n\n    if (handleUserPromptedError(event)) {\n      return null;\n    }\n  }\n\n  return event;\n};\n\nexport default beforeSend;\n",";(function(win, $) {\n\n/*\n * Accessible Datepicker v2.1.5\n * Copyright 2015 Eureka2, Jacques Archimède.\n * Based on the example of the Open AJAX Alliance Accessibility Tools Task Force : http://www.oaa-accessibility.org/examplep/datepicker1/\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Inspired by :\n * http://wet-boew.github.io/wet-boew/demos/datepicker/datepicker-fr.html\n * http://eternicode.github.io/bootstrap-datepicker\n */\n\n/**\n *\tDescription:\n *\t===========\n *\tThis DatePicker widget allows the user to select a date.\n *\tThe DatePicker shows one month at least.\n *\n *\tThe calendar portion of the date picker follows a table structure\n *\twhere days of the week and calendar day numbers are layed out in HTML table cells where WAI-ARIA semantics for a grid are applied.\n *\tThis provides context so an assistive technology can render the day of the week;\n *\tits corresponding numeric calendar day, and week number if necessary.\n *\n *\tThe calendar portion can be displayed in a numbers of ways, including as a popup associated with another widget,\n *\tor as a static region of a page.\n *\n * \tThis component complies with the recommendations of the guide http://www.w3.org/TR/wai-aria-practices/#datepicker of W3C, namely :\n *\n *\tKeyboard Interaction:\n *\t=====================\n *\n *\tKeyboard navigation on days that are not included the currently displayed month should move to the month automatically and lead to the day in the next or previous month.\n *\n *\t    - Tab - Like other widgets, the date picker widget receives focus by tabbing into it. Once focus is received, focus is repositioned on today's date in a grid of days and weeks. A second tab will take the user out of the date picker widget. Focus initially is placed on today's date.\n *\t    - Shift+Tab - reverses the direction of the tab order. Once in the widget, a Shift+Tab will take the user to the previous focusable element in the tab order.\n *\t    - Up Arrow and Down Arrow - goes to the same day of the week in the previous or next week respectively. If the user advances past the end of the month they continue into the next or previous month as appropriate.\n *\t    - Left Arrow and Right Arrow - advances one day to the next, also in a continuum. Visually focus is moved from day to day and wraps from row to row in a grid of days and weeks.\n *\t    - Control+Page Up - Moves to the same date in the previous year.\n *\t    - Control+Page Down - Moves to the same date in the next year.\n *\t    - Space -\n *\t        Singleton Mode: acts as a toggle either selecting or deselecting the date.\n *\t        Contiguous Mode: Similar to selecting a range of text. Space selects the first date. Shift+Arrows add to the selection. Pressing Space again deselects the previous selections and selects the current focused date.\n *\t    - Home - Moves to the first day of the current month.\n *\t    - End - Moves to the last day of the current month.\n *\t    - Page Up - Moves to the same date in the previous month.\n *\t    - Page Down - Moves to the same date in the next month.\n *\t    - Enter -\n *\t        If the the calendar is a popup attached to some other widget (e.g., a text field), then Enter dismisses the popup, and the selected date(s) are shown in the associated widget.\n *\t        If the calendar is a static region on the page, then Enter confirms the selected date(s).\n *\t    - Escape - in the case of a popup date picker, closes the widget without any action.\n *\n *\n *\tWAI-ARIA Roles, States, and Properties:\n *\t======================================\n *\n *\t    The current month has a label representing the month and year. It is advisable to use a role heading but is not essential. This \"label\" should have a unique ID.\n *\t    If the author would like to ensure that a label is announced by a screen reader, as the label changes, include live region properties with the label element: aria-live=\"assertive\" and aria-atomic=\"true\".\n *\t    The container for the day of week headers and numeric days of the week has a role of grid.\n *\t    The grid has an aria-labelledby property with a value equivalent to the id of the label for the grid.\n *\t    Each name for the day of the week has a role columnheader and is not navigable via the keyboard.\n *\t    Each numeric day of the week has the role gridcell.\n *\t    When a day is selected its aria-selected is set to true, otherwise it is set to false or removed.\n *\t    Changes in aria states, identified here, as well as focus, are clearly styled to show the user where their point of regard is and what days are selected.\n *\n *\tWhen the datepicker is active a calender day of the week always has focus.\n *\tThis can be achieved by setting the tabindex on that day as appropriate and then using script to give it focus.\n *\tThe grid container set aria-activedescendant to the id of the currently focused gridcell.\n *\n */\n\n\tDate.dp_locales = {\n\t    \"texts\": {\n\t        \"buttonTitle\": \"Select date ...\",\n\t        \"buttonLabel\": \"Click or press the Enter key or the spacebar to open the calendar\",\n\t        \"prevButtonLabel\": \"Go to previous month\",\n\t        \"prevMonthButtonLabel\": \"Go to the previous year\",\n\t        \"prevYearButtonLabel\": \"Go to the previous twenty years\",\n\t        \"nextButtonLabel\": \"Go to next month\",\n\t        \"nextMonthButtonLabel\": \"Go to the next year\",\n\t        \"nextYearButtonLabel\": \"Go to the next twenty years\",\n\t        \"changeMonthButtonLabel\": \"Click or press the Enter key or the spacebar to change the month\",\n\t        \"changeYearButtonLabel\": \"Click or press the Enter key or the spacebar to change the year\",\n\t        \"changeRangeButtonLabel\": \"Click or press the Enter key or the spacebar to go to the next twenty years\",\n\t        \"closeButtonTitle\": \"Close\",\n\t        \"closeButtonLabel\": \"Close the calendar\",\n\t        \"calendarHelp\": \"- Up Arrow and Down Arrow - goes to the same day of the week in the previous or next week respectively. If the end of the month is reached, continues into the next or previous month as appropriate.\\r\\n- Left Arrow and Right Arrow - advances one day to the next, also in a continuum. Visually focus is moved from day to day and wraps from row to row in the grid of days.\\r\\n- Control+Page Up - Moves to the same date in the previous year.\\r\\n- Control+Page Down - Moves to the same date in the next year.\\r\\n- Home - Moves to the first day of the current month.\\r\\n- End - Moves to the last day of the current month.\\r\\n- Page Up - Moves to the same date in the previous month.\\r\\n- Page Down - Moves to the same date in the next month.\\r\\n- Enter or Espace - closes the calendar, and the selected date is shown in the associated text box.\\r\\n- Escape - closes the calendar without any action.\"\n\t    },\n\t    \"directionality\": \"LTR\",\n\t    \"month_names\": [\n\t        \"January\",\n\t        \"February\",\n\t        \"March\",\n\t        \"April\",\n\t        \"May\",\n\t        \"June\",\n\t        \"July\",\n\t        \"August\",\n\t        \"September\",\n\t        \"October\",\n\t        \"November\",\n\t        \"December\"\n\t    ],\n\t    \"month_names_abbreviated\": [\n\t        \"Jan\",\n\t        \"Feb\",\n\t        \"Mar\",\n\t        \"Apr\",\n\t        \"May\",\n\t        \"Jun\",\n\t        \"Jul\",\n\t        \"Aug\",\n\t        \"Sep\",\n\t        \"Oct\",\n\t        \"Nov\",\n\t        \"Dec\"\n\t    ],\n\t    \"month_names_narrow\": [\n\t        \"J\",\n\t        \"F\",\n\t        \"M\",\n\t        \"A\",\n\t        \"M\",\n\t        \"J\",\n\t        \"J\",\n\t        \"A\",\n\t        \"S\",\n\t        \"O\",\n\t        \"N\",\n\t        \"D\"\n\t    ],\n\t    \"day_names\": [\n\t        \"Sunday\",\n\t        \"Monday\",\n\t        \"Tuesday\",\n\t        \"Wednesday\",\n\t        \"Thursday\",\n\t        \"Friday\",\n\t        \"Saturday\"\n\t    ],\n\t    \"day_names_abbreviated\": [\n\t        \"Sun\",\n\t        \"Mon\",\n\t        \"Tue\",\n\t        \"Wed\",\n\t        \"Thu\",\n\t        \"Fri\",\n\t        \"Sat\"\n\t    ],\n\t    \"day_names_short\": [\n\t        \"Su\",\n\t        \"Mo\",\n\t        \"Tu\",\n\t        \"We\",\n\t        \"Th\",\n\t        \"Fr\",\n\t        \"Sa\"\n\t    ],\n\t    \"day_names_narrow\": [\n\t        \"S\",\n\t        \"M\",\n\t        \"T\",\n\t        \"W\",\n\t        \"T\",\n\t        \"F\",\n\t        \"S\"\n\t    ],\n\t    \"day_periods\": {\n\t        \"am\": \"AM\",\n\t        \"noon\": \"noon\",\n\t        \"pm\": \"PM\"\n\t    },\n\t    \"day_periods_abbreviated\": {\n\t        \"am\": \"AM\",\n\t        \"noon\": \"noon\",\n\t        \"pm\": \"PM\"\n\t    },\n\t    \"day_periods_narrow\": {\n\t        \"am\": \"a\",\n\t        \"noon\": \"n\",\n\t        \"pm\": \"p\"\n\t    },\n\t    \"quarter_names\": [\n\t        \"1st quarter\",\n\t        \"2nd quarter\",\n\t        \"3rd quarter\",\n\t        \"4th quarter\"\n\t    ],\n\t    \"quarter_names_abbreviated\": [\n\t        \"Q1\",\n\t        \"Q2\",\n\t        \"Q3\",\n\t        \"Q4\"\n\t    ],\n\t    \"quarter_names_narrow\": [\n\t        \"1\",\n\t        \"2\",\n\t        \"3\",\n\t        \"4\"\n\t    ],\n\t    \"era_names\": [\n\t        \"Before Christ\",\n\t        \"Anno Domini\"\n\t    ],\n\t    \"era_names_abbreviated\": [\n\t        \"BC\",\n\t        \"AD\"\n\t    ],\n\t    \"era_names_narrow\": [\n\t        \"B\",\n\t        \"A\"\n\t    ],\n\t    \"full_format\": \"EEEE, MMMM d, y\",\n\t    \"long_format\": \"MMMM d, y\",\n\t    \"medium_format\": \"MMM d, y\",\n\t    \"short_format\": \"M/d/yy\",\n\t    \"firstday_of_week\": 0\n\t};\n\n\tvar datepickerButton = [\n\t\t'<a class=\"datepicker-button input-group-addon\" role=\"button\" aria-haspopup=\"true\" tabindex=\"0\" aria-labelledby=\"datepicker-bn-open-label-CALENDARID\">',\n\t\t'<span id=\"datepicker-button\"></span>',\n\t\t'</a>'\n\t];\n\tvar datepickerCalendar = [\n\t\t'<div class=\"datepicker-calendar\" id=\"datepicker-calendar-CALENDARID\" aria-hidden=\"false\">',\n\t\t'\t<div class=\"datepicker-month-wrap\">',\n\t\t'\t\t<div class=\"datepicker-month-fast-next pull-right\" role=\"button\" aria-labelledby=\"datepicker-bn-fast-next-label-CALENDARID\" tabindex=\"0\"><span class=\"glyphicon glyphicon-forward\"></span></div>',\n\t\t'\t\t<div class=\"datepicker-month-next pull-right\" role=\"button\" aria-labelledby=\"datepicker-bn-next-label-CALENDARID\" tabindex=\"0\"><span class=\"glyphicon glyphicon-triangle-right\"></span></div>',\n\t\t'\t\t<div class=\"datepicker-month-fast-prev pull-left\" role=\"button\" aria-labelledby=\"datepicker-bn-fast-prev-label-CALENDARID\" tabindex=\"0\"><span class=\"glyphicon glyphicon-backward\"></span></div>',\n\t\t'\t\t<div class=\"datepicker-month-prev pull-left\" role=\"button\" aria-labelledby=\"datepicker-bn-prev-label-CALENDARID\" tabindex=\"0\"><span class=\"glyphicon glyphicon-triangle-left\"></span></div>',\n\t\t'\t\t<div id=\"datepicker-month-CALENDARID\" class=\"datepicker-month\" tabindex=\"0\" role=\"heading\" aria-live=\"assertive\" aria-atomic=\"true\" title=\"Click or press the Enter key or the spacebar to change the month\">July 2015</div>',\n\t\t'\t</div>',\n\t\t'\t<table class=\"datepicker-grid\" role=\"grid\" aria-readonly=\"true\" aria-activedescendant=\"datepicker-err-msg-CALENDARID\" aria-labelledby=\"datepicker-month-CALENDARID\" tabindex=\"0\">',\n\t\t'\t\t<thead role=\"presentation\">',\n\t\t'\t\t\t<tr class=\"datepicker-weekdays\" role=\"row\">',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day0-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Sunday\"><abbr title=\"Sunday\">Su</abbr></th>',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day1-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Monday\"><abbr title=\"Monday\">Mo</abbr></th>',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day2-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Tuesday\"><abbr title=\"Tuesday\">Tu</abbr></th>',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day3-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Wednesday\"><abbr title=\"Wednesday\">We</abbr></th>',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day4-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Thursday\"><abbr title=\"Thursday\">Th</abbr></th>',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day5-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Friday\"><abbr title=\"Friday\">Fr</abbr></th>',\n\t\t'\t\t\t\t<th scope=\"col\" id=\"day6-header-CALENDARID\" class=\"datepicker-day\" role=\"columnheader\" aria-label=\"Saturday\"><abbr title=\"Saturday\">Sa</abbr></th>',\n\t\t'\t\t\t</tr>',\n\t\t'\t\t</thead>',\n\t\t'\t\t<tbody role=\"presentation\">',\n\t\t'\t\t\t<tr>',\n\t\t'\t\t\t\t<td id=\"datepicker-err-msg-CALENDARID\" colspan=\"7\">Javascript must be enabled</td>',\n\t\t'\t\t\t</tr>',\n\t\t'\t\t</tbody>',\n\t\t'\t</table>',\n\t\t'\t<div class=\"datepicker-close-wrap\">',\n\t\t'\t\t<button class=\"datepicker-close\" id=\"datepicker-close-CALENDARID\" aria-labelledby=\"datepicker-bn-close-label-CALENDARID\">Close</button>',\n\t\t'\t</div>',\n\t\t'\t<div id=\"datepicker-bn-open-label-CALENDARID\" class=\"datepicker-bn-open-label offscreen\">Click or press the Enter key or the spacebar to open the calendar</div>',\n\t\t'\t<div id=\"datepicker-bn-prev-label-CALENDARID\" class=\"datepicker-bn-prev-label offscreen\">Go to previous month</div>',\n\t\t'\t<div id=\"datepicker-bn-next-label-CALENDARID\" class=\"datepicker-bn-next-label offscreen\">Go to next month</div>',\n\t\t'\t<div id=\"datepicker-bn-fast-prev-label-CALENDARID\" class=\"datepicker-bn-fast-prev-label offscreen\">Go to previous year</div>',\n\t\t'\t<div id=\"datepicker-bn-fast-next-label-CALENDARID\" class=\"datepicker-bn-fast-next-label offscreen\">Go to next year</div>',\n\t\t'\t<div id=\"datepicker-bn-close-label-CALENDARID\" class=\"datepicker-bn-close-label offscreen\">Close the date picker</div>',\n\t\t'</div>'\n\t];\n\n\tvar Datepicker = function (target, options) {\n\t\tvar self = this;\n\t\tthis.$target = $(target); // textbox that will receive the selected date string and focus (if modal)\n\t\tthis.options = $.extend({}, Datepicker.DEFAULTS, options)\n\t\tthis.locales = Date.dp_locales;\n\t\tswitch (this.options.startView) {\n\t\t\tcase 1:\n\t\t\tcase 'months':\n\t\t\t\tthis.options.startView = 1;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tcase 'years':\n\t\t\t\tthis.options.startView = 2;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.options.startView = 0;\n\t\t}\n\t\tif (typeof this.options.inputFormat === 'string') {\n\t\t\tthis.options.inputFormat = [this.options.inputFormat];\n\t\t}\n\t\tif (this.options.min != null) {\n\t\t\tthis.options.min = this.parseDate(this.options.min);\n\t\t} else if (this.$target.attr('min')) {\n\t\t\tthis.options.min = this.parseDate(this.$target.attr('min'));\n\t\t}\n\t\tif (this.options.max != null) {\n\t\t\tthis.options.max = this.parseDate(this.options.max);\n\t\t} else if (this.$target.attr('max')) {\n\t\t\tthis.options.max = this.parseDate(this.$target.attr('max'));\n\t\t}\n\t\tthis.id = this.$target.attr('id') || 'datepicker-' + Math.floor(Math.random() * 100000);\n\t\tvar calendar = datepickerCalendar.join(\"\");\n\t\tcalendar = calendar.replace(/CALENDARID/g, this.id + '');\n\n\t\t// complete the target textbox if any\n\t\tif (this.$target.parent('.input-group').length == 0) {\n\t\t\tthis.$target.wrap( '<div class=\"input-group\"></div>' );\n\t\t}\n\t\tthis.$label = this.$target.parents().find(\"label[for=\" + this.id + \"]\");\n\t\tthis.$group = this.$target.parent('.input-group');\n\t\tthis.$target.attr('aria-autocomplete', 'none')\n\t\tthis.$target.css('min-width', '7em')\n\t\tthis.$target.addClass('form-control');\n\n\t\tif (! this.$target.attr('placeholder')) {\n\t\t\tthis.$target.attr('placeholder', this.options.inputFormat[0]);\n\t\t}\n\n\t\tvar button = datepickerButton.join(\"\");\n\t\tbutton = button.replace(/CALENDARID/g, this.id + '');\n\t\tthis.$button = $(button);\n\t\tthis.$button.addClass(this.options.theme);\n\t\tthis.$calendar = $(calendar);\n\t\tthis.$calendar.addClass(this.options.theme);\n\t\tthis.$target.after(this.$button);\n\n\t\tif (this.options.inline != false) {\n\t\t\tthis.hideObject(this.$button);\n\t\t\tvar $container = typeof this.options.inline === 'string' ? $('#' + this.options.inline) : this.options.inline;\n\t\t\t$container.append(this.$calendar);\n\t\t\tthis.$calendar.css({position: 'relative', left: '0px'});\n\t\t\tthis.initializeDate();\n\t\t} else {\n\t\t\tthis.$target.parent().after(this.$calendar);\n\t\t\tthis.hide(!this.options.gainFocusOnConstruction);\n\t\t}\n\n\t\t// be sure parent of the calendar is positionned  to calculate the position of the calendar\n\t\tif (this.$calendar.parent().css('position') === 'static') {\n\t\t\tthis.$calendar.parent().css('position', 'relative');\n\t\t}\n\t\tthis.$calendar.find('.datepicker-bn-open-label').html(this.options.buttonLabel);\n\t\tif (this.$target.attr('id')) {\n\t\t\tthis.$calendar.attr('aria-controls', this.$target.attr('id'));\n\t\t}\n\t\tthis.$button.find('span').attr('title', this.options.buttonTitle);\n\t\tthis.$calendar.css('left', this.$target.parent().position().left + 'px');\n\t\tthis.$monthObj = this.$calendar.find('.datepicker-month');\n\t\tthis.$prev = this.$calendar.find('.datepicker-month-prev');\n\t\tthis.$next = this.$calendar.find('.datepicker-month-next');\n\t\tthis.$fastprev = this.$calendar.find('.datepicker-month-fast-prev');\n\t\tthis.$fastnext = this.$calendar.find('.datepicker-month-fast-next');\n\t\tthis.$grid = this.$calendar.find('.datepicker-grid');\n\t\tif (this.locales.directionality === 'RTL') {\n\t\t\tthis.$grid.addClass('rtl');\n\t\t}\n\t\tvar $days = this.$grid.find('th.datepicker-day abbr');\n\t\tthis.drawCalendarHeader();\n\t\tif (this.options.inline == false && this.options.modal == true) {\n\t\t\tthis.$close = this.$calendar.find('.datepicker-close');\n\t\t\tthis.$close.html(this.options.closeButtonTitle).attr('title', this.options.closeButtonLabel);\n\t\t\tthis.$calendar.find('.datepicker-bn-close-label').html(this.options.closeButtonLabel);\n\t\t} else {\n\t\t\tthis.hideObject(this.$calendar.find('.datepicker-close-wrap'));\n\t\t\tthis.hideObject(this.$calendar.find('.datepicker-bn-close-label'));\n\t\t}\n\n\t\tthis.keys = {\n\t\t\ttab: 9,\n\t\t\tenter: 13,\n\t\t\tesc: 27,\n\t\t\tspace: 32,\n\t\t\tpageup: 33,\n\t\t\tpagedown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\n\t\tthis.bindHandlers();\n\t\tthis.$button.click(function(e) {\n\t\t\tif (self.$calendar.attr('aria-hidden') === 'true') {\n\t\t\t\tself.initializeDate();\n\t\t\t\tself.show();\n\t\t\t} else {\n\t\t\t\tself.hide();\n\t\t\t}\n\t\t\tself.selectGridCell(self.$grid.attr('aria-activedescendant'));\n\t\t\te.stopPropagation();\n\t\t\treturn false;\n\t\t});\n\t\tthis.$button.keydown(function(e) {\n\t\t\tvar ev = e || event;\n\t\t\tif(ev.keyCode == self.keys.enter || ev.keyCode == self.keys.space) {\n\t\t\t\t$(this).trigger('click');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tthis.$calendar.on('blur', function(e) {\n\t\t\tif (self.$calendar.attr('aria-hidden') === 'false') {\n\t\t\t\tself.hide();\n\t\t\t}\n\n\t\t});\n\t}\n\n\tDatepicker.VERSION  = '2.1.1'\n\n\tDatepicker.DEFAULTS = {\n\t\tfirstDayOfWeek: Date.dp_locales.firstday_of_week, // Determines the first column of the calendar grid\n\t\tweekDayFormat: 'short', // Display format of the weekday names - values are 'short' or 'narrow'\n\t\tstartView: 0, // Initial calendar - values are 0 or 'days', 1 or 'months', 2 or 'years'\n\t\tdaysOfWeekDisabled: [],\n\t\tinputFormat: [Date.dp_locales.short_format],\n\t\toutputFormat: Date.dp_locales.short_format,\n\t\ttitleFormat: Date.dp_locales.full_format,\n\t\tbuttonTitle: Date.dp_locales.texts.buttonTitle,\n\t\tbuttonLabel: Date.dp_locales.texts.buttonLabel,\n\t\tprevButtonLabel: Date.dp_locales.texts.prevButtonLabel,\n\t\tprevMonthButtonLabel: Date.dp_locales.texts.prevMonthButtonLabel,\n\t\tprevYearButtonLabel: Date.dp_locales.texts.prevYearButtonLabel,\n\t\tnextButtonLabel: Date.dp_locales.texts.nextButtonLabel,\n\t\tnextMonthButtonLabel: Date.dp_locales.texts.nextMonthButtonLabel,\n\t\tnextYearButtonLabel: Date.dp_locales.texts.nextYearButtonLabel,\n\t\tchangeMonthButtonLabel: Date.dp_locales.texts.changeMonthButtonLabel,\n\t\tchangeYearButtonLabel: Date.dp_locales.texts.changeYearButtonLabel,\n\t\tchangeRangeButtonLabel: Date.dp_locales.texts.changeRangeButtonLabel,\n\t\tcloseButtonTitle: Date.dp_locales.texts.closeButtonTitle,\n\t\tcloseButtonLabel: Date.dp_locales.texts.closeButtonLabel,\n\t\tonUpdate: function (value) {},\n\t\ttheme: 'default',\n\t\tmodal: false,\n\t\tinline: false,\n\t\tgainFocusOnConstruction: true,\n\t\tmin: null,\n\t\tmax: null\n\t}\n\n\t/**\n\t *\tinitializeDate() is a member function to initialize the Datepicker date with the content of the target textbox\n\t *\n\t *\t@return N/A\n\t *\n\t */\n\tDatepicker.prototype.initializeDate = function() {\n\t\tvar val = this.$target.val();\n\t\tvar date = val === '' ? new Date() :  this.parseDate(val);\n\t\tthis.setDate(date);\n\t} // end initializeDate()\n\n\t/**\n\t * getDate() is a member function to retrieve the current Datepicker date.\n\t * @return the Date object\n\t */\n\tDatepicker.prototype.getDate = function () {\n\t\tvar val = this.$target.val();\n\t\tvar date = val === '' ? new Date() :  this.parseDate(val);\n\t\treturn date;\n\t} // end getDate()\n\n\t/**\n\t *\tsetDate() is a member function to set the Datepicker date with the content of newDate\n\t *\n\t *\t@param\t(newDate Date) the new value of the Datepicker date.\n\t *\t@return N/A\n\t *\n\t */\n\tDatepicker.prototype.setDate = function(newDate) {\n\t\tthis.dateObj = newDate;\n\t\tif (this.dateObj == null) {\n\t\t\tthis.$target.attr('aria-invalid', true);\n\t\t\tthis.$target.parents('.form-group').addClass('has-error');\n\t\t\tthis.dateObj = new Date();\n\t\t\tthis.dateObj.setHours(0, 0, 0, 0);\n\t\t}\n\t\tif (this.options.min != null && this.dateObj < this.options.min) {\n\t\t\tthis.$target.attr('aria-invalid', true);\n\t\t\tthis.$target.parents('.form-group').addClass('has-error');\n\t\t\tthis.dateObj = this.options.min;\n\t\t} else if (this.options.max != null && this.dateObj > this.options.max) {\n\t\t\tthis.$target.attr('aria-invalid', true);\n\t\t\tthis.$target.parents('.form-group').addClass('has-error');\n\t\t\tthis.dateObj = this.options.max;\n\t\t}\n\t\tthis.$target.val(this.format(this.dateObj));\n\t\tthis.curYear = this.dateObj.getFullYear();\n\t\tthis.year = this.curYear;\n\t\tthis.curMonth = this.dateObj.getMonth();\n\t\tthis.month = this.curMonth;\n\t\tthis.date = this.dateObj.getDate();\n\t\t// populate the calendar grid\n\t\tswitch (this.options.startView) {\n\t\t\tcase 1: // months\n\t\t\t\tthis.populateMonthsCalendar();\n\t\t\t\t// update the table's activedescdendant to point to the current month\n\t\t\t\tthis.$grid.attr('aria-activedescendant', this.$grid.find('.curMonth').attr('id'));\n\t\t\t\tbreak;\n\t\t\tcase 2: // years\n\t\t\t\tthis.populateYearsCalendar();\n\t\t\t\t// update the table's activedescdendant to point to the current year\n\t\t\t\tthis.$grid.attr('aria-activedescendant', this.$grid.find('.curYear').attr('id'));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.populateDaysCalendar();\n\t\t\t\t// update the table's activedescdendant to point to the current day\n\t\t\t\tthis.$grid.attr('aria-activedescendant', this.$grid.find('.curDay').attr('id'));\n\t\t}\n\t} // end setDate()\n\n\t/**\n\t *\tdrawCalendarHeader() is a member function to populate the calendar header with the days name.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.drawCalendarHeader = function() {\n\t\tvar $days = this.$grid.find('th.datepicker-day');\n\t\tvar weekday = this.options.firstDayOfWeek;\n\t\tfor (var i = 0; i < 7; i++) {\n\t\t\t$days.eq(i).attr('aria-label', this.locales.day_names[weekday])\n\t\t\t$days.children('abbr').eq(i).attr('title', this.locales.day_names[weekday]).text(\n\t\t\t\tthis.options.weekDayFormat === 'short' ?\n\t\t\t\t\tthis.locales.day_names_short[weekday] :\n\t\t\t\t\tthis.locales.day_names_narrow[weekday]\n\t\t\t);\n\t\t\tweekday = (weekday + 1) % 7;\n\t\t}\n\t} // end drawCalendarHeader()\n\n\t/**\n\t *\tpopulateDaysCalendar() is a member function to populate the datepicker grid with calendar days\n\t *\trepresenting the current month\n\t *\n\t *\t@return N/A\n\t *\n\t */\n\tDatepicker.prototype.populateDaysCalendar = function() {\n\t\tthis.$calendar.find('.datepicker-bn-prev-label').html(this.options.prevButtonLabel);\n\t\tthis.$calendar.find('.datepicker-bn-next-label').html(this.options.nextButtonLabel);\n\t\tthis.$calendar.find('.datepicker-bn-fast-prev-label').html(this.options.prevMonthButtonLabel);\n\t\tthis.$calendar.find('.datepicker-bn-fast-next-label').html(this.options.nextMonthButtonLabel);\n\t\tif (this.options.min != null &&\n\t\t\t(\tthis.year - 1 < this.options.min.getFullYear() ||\n\t\t\t\t(this.year - 1 == this.options.min.getFullYear() && this.month < this.options.min.getMonth()))) {\n\t\t\tthis.$fastprev.attr('title', '');\n\t\t\tthis.$fastprev.addClass('disabled');\n\t\t\tthis.$fastprev.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$fastprev.attr('title', this.options.prevMonthButtonLabel);\n\t\t\tthis.$fastprev.addClass('enabled');\n\t\t\tthis.$fastprev.removeClass('disabled');\n\t\t}\n\t\tvar previousMonth = this.previousMonth(this.year, this.month);\n\t\tif (this.options.min != null &&\n\t\t\t(\tpreviousMonth.year < this.options.min.getFullYear() ||\n\t\t\t\t(previousMonth.year == this.options.min.getFullYear() && previousMonth.month < this.options.min.getMonth()))) {\n\t\t\tthis.$prev.attr('title', '');\n\t\t\tthis.$prev.addClass('disabled');\n\t\t\tthis.$prev.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$prev.attr('title', this.options.prevButtonLabel);\n\t\t\tthis.$prev.addClass('enabled');\n\t\t\tthis.$prev.removeClass('disabled');\n\t\t}\n\t\tthis.$monthObj.attr('title', this.options.changeMonthButtonLabel);\n\t\tvar nextMonth = this.nextMonth(this.year, this.month);\n\t\tif (this.options.max != null &&\n\t\t\t(\tnextMonth.year > this.options.max.getFullYear() ||\n\t\t\t\t(nextMonth.year == this.options.max.getFullYear() && nextMonth.month > this.options.max.getMonth()))) {\n\t\t\tthis.$next.attr('title', '');\n\t\t\tthis.$next.addClass('disabled');\n\t\t\tthis.$next.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$next.attr('title', this.options.nextButtonLabel);\n\t\t\tthis.$next.addClass('enabled');\n\t\t\tthis.$next.removeClass('disabled');\n\t\t}\n\t\tif (this.options.max != null &&\n\t\t\t(\tthis.year + 1 > this.options.max.getFullYear() ||\n\t\t\t\t(this.year + 1 == this.options.max.getFullYear() && this.month > this.options.max.getMonth()))) {\n\t\t\tthis.$fastnext.attr('title', '');\n\t\t\tthis.$fastnext.addClass('disabled');\n\t\t\tthis.$fastnext.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$fastnext.attr('title', this.options.nextMonthButtonLabel);\n\t\t\tthis.$fastnext.addClass('enabled');\n\t\t\tthis.$fastnext.removeClass('disabled');\n\t\t}\n\t\tthis.showObject(this.$fastprev);\n\t\tthis.showObject(this.$fastnext);\n\t\tvar numDays = this.getDaysInMonth(this.year, this.month);\n\t\tvar numPrevDays = this.getDaysInMonth(previousMonth.year, previousMonth.month);\n\t\tvar startWeekday = new Date(this.year, this.month, 1).getDay();\n\t\tvar lastDayOfWeek = (this.options.firstDayOfWeek + 6) % 7;\n\t\tvar curDay = 1;\n\t\tvar rowCount = 1;\n\t\tthis.$monthObj.html(this.locales.month_names[this.month] + ' ' + this.year);\n\t\tthis.showObject(this.$grid.find('thead'));\n\t\t// clear the grid\n\t\tvar gridCells = '\\t<tr id=\"row0-'+this.id+'\" role=\"row\">\\n';\n\t\t// Insert the leading empty cells\n\t\tvar numEmpties = 0;\n\t\tvar weekday = this.options.firstDayOfWeek;\n\t\twhile (weekday != startWeekday) {\n\t\t\tnumEmpties++;\n\t\t\tweekday = (weekday + 1) % 7;\n\t\t}\n\t\tfor ( ; numEmpties > 0; numEmpties--) {\n\t\t\tgridCells += '\\t\\t<td class=\"empty\">' + (numPrevDays - numEmpties + 1) + '</td>\\n';\n\t\t}\n\t\t// insert the days of the month.\n\t\tfor (curDay = 1; curDay <= numDays; curDay++) {\n\t\t\tvar date = new Date(this.year, this.month, curDay, 0, 0, 0, 0);\n\t\t\tvar longdate = this.formatDate(date, this.options.titleFormat);\n\t\t\tvar curDayClass = curDay == this.date && this.month == this.curMonth && this.year == this.curYear ? ' curDay' : '';\n\t\t\tif ($.inArray(weekday, this.options.daysOfWeekDisabled) > -1) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + curDay + '-' + this.id + '\" class=\"day unselectable' + curDayClass + '\"';\n\t\t\t} else if (this.options.min != null && date < this.options.min) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + curDay + '-' + this.id + '\" class=\"day unselectable' + curDayClass + '\"';\n\t\t\t} else if (this.options.max != null && date > this.options.max) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + curDay + '-' + this.id + '\" class=\"day unselectable' + curDayClass + '\"';\n\t\t\t} else {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + curDay + '-' + this.id + '\" class=\"day selectable' + curDayClass + '\"';\n\t\t\t}\n\t\t\tgridCells += ' data-value=\"' + curDay + '\"';\n\t\t\tgridCells += ' title=\"' + longdate + '\"';\n\t\t\tgridCells += ' aria-label=\"' + longdate + '\"';\n\t\t\tgridCells += ' headers=\"day' + weekday + '-header-' + this.id + '\" role=\"gridcell\" tabindex=\"-1\" aria-selected=\"false\">' + curDay;\n\t\t\tgridCells +=  '</td>';\n\t\t\tif (weekday == lastDayOfWeek && curDay < numDays) {\n\t\t\t\t// This was the last day of the week, close it out\n\t\t\t\t// and begin a new one\n\t\t\t\tgridCells += '\\t</tr>\\n\\t<tr id=\"row' + rowCount + '-' + this.id + '\" role=\"row\">\\n';\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t\tif (curDay < numDays) {\n\t\t\t\tweekday = (weekday + 1) % 7;\n\t\t\t}\n\t\t}\n\t\t// Insert any trailing empty cells\n\t\twhile (weekday != lastDayOfWeek) {\n\t\t\tgridCells += '\\t\\t<td class=\"empty\">' + (++numEmpties) + '</td>\\n';\n\t\t\tweekday = (weekday + 1) % 7;\n\t\t}\n\t\tgridCells += '\\t</tr>';\n\t\tvar $tbody = this.$grid.find('tbody');\n\t\t$tbody.empty();\n\t\t$tbody.append(gridCells);\n\t\tthis.gridType = 0; // 0 = days grid, 1 = months grid, 2 = years Grid\n\t} // end populateDaysCalendar()\n\n\t/**\n\t *\tpopulateMonthsCalendar() is a member function to populate the datepicker grid with calendar months\n\t *\trepresenting the current year\n\t *\n\t *\t@return N/A\n\t *\n\t */\n\tDatepicker.prototype.populateMonthsCalendar = function() {\n\t\tthis.$calendar.find('.datepicker-bn-prev-label').html(this.options.prevMonthButtonLabel);\n\t\tthis.$calendar.find('.datepicker-bn-next-label').html(this.options.nextMonthButtonLabel);\n\t\tthis.hideObject(this.$fastprev);\n\t\tthis.hideObject(this.$fastnext);\n\t\tif (this.options.min != null && this.year - 1 < this.options.min.getFullYear()) {\n\t\t\tthis.$prev.attr('title', '');\n\t\t\tthis.$prev.addClass('disabled');\n\t\t\tthis.$prev.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$prev.attr('title', this.options.prevMonthButtonLabel);\n\t\t\tthis.$prev.addClass('enabled');\n\t\t\tthis.$prev.removeClass('disabled');\n\t\t}\n\t\tthis.$monthObj.attr('title', this.options.changeYearButtonLabel);\n\t\tif (this.options.max != null && this.year + 1 > this.options.max.getFullYear()) {\n\t\t\tthis.$next.attr('title', '');\n\t\t\tthis.$next.addClass('disabled');\n\t\t\tthis.$next.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$next.attr('title', this.options.nextMonthButtonLabel);\n\t\t\tthis.$next.addClass('enabled');\n\t\t\tthis.$next.removeClass('disabled');\n\t\t}\n\t\tvar curMonth = 0;\n\t\tvar rowCount = 1;\n\t\tvar $tbody = this.$grid.find('tbody');\n\t\tthis.$monthObj.html(this.year);\n\t\t// clear the grid\n\t\tthis.hideObject(this.$grid.find('thead'));\n\t\t$tbody.empty();\n\t\t$('#datepicker-err-msg-' + this.id).empty();\n\t\tvar gridCells = '\\t<tr id=\"row0-'+this.id+'\" role=\"row\">\\n';\n\t\t// insert the months of the year.\n\t\tfor (curMonth = 0; curMonth < 12; curMonth++) {\n\t\t\tif (curMonth == this.month && this.year == this.curYear) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curMonth + 1) + '-' + this.id + '\" class=\"month curMonth selectable\"';\n\t\t\t} else if (this.options.min != null && (this.year < this.options.min.getFullYear() || (this.year == this.options.min.getFullYear() && curMonth < this.options.min.getMonth()))) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curMonth + 1) + '-' + this.id + '\" class=\"month unselectable\"';\n\t\t\t} else if (this.options.max != null && (this.year > this.options.max.getFullYear() || (this.year == this.options.max.getFullYear() && curMonth > this.options.max.getMonth()))) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curMonth + 1) + '-' + this.id + '\" class=\"month unselectable\"';\n\t\t\t} else {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curMonth + 1) + '-' + this.id + '\" class=\"month selectable\"';\n\t\t\t}\n\t\t\tgridCells += ' data-value=\"' + curMonth + '\"';\n\t\t\tgridCells += ' title=\"' + this.locales.month_names[curMonth] + ' ' + this.year + '\"';\n\t\t\tgridCells += ' aria-label=\"' + this.locales.month_names[curMonth] + ' ' + this.year + '\"';\n\t\t\tgridCells += ' role=\"gridcell\" tabindex=\"-1\" aria-selected=\"false\">' + this.locales.month_names_abbreviated[curMonth];\n\t\t\tgridCells +=  '</td>';\n\t\t\tif (curMonth == 3 || curMonth == 7) {\n\t\t\t\tgridCells += '\\t</tr>\\n\\t<tr id=\"row' + rowCount + '-' + this.id + '\" role=\"row\">\\n';\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t}\n\t\tgridCells += '\\t</tr>';\n\t\t$tbody.append(gridCells);\n\t\tthis.gridType = 1; // 0 = days grid, 1 = months grid, 2 = years Grid\n\t} // end populateMonthsCalendar()\n\n\t/**\n\t *\tpopulateYearsCalendar() is a member function to populate the datepicker grid with 20 calendar years\n\t *\taround the current year\n\t *\n\t *\t@return N/A\n\t *\n\t */\n\tDatepicker.prototype.populateYearsCalendar = function() {\n\t\tthis.$calendar.find('.datepicker-bn-prev-label').html(this.options.prevYearButtonLabel);\n\t\tthis.$calendar.find('.datepicker-bn-next-label').html(this.options.nextYearButtonLabel);\n\t\tthis.hideObject(this.$fastprev);\n\t\tthis.hideObject(this.$fastnext);\n\t\tif (this.options.min != null && this.year - 20 < this.options.min.getFullYear()) {\n\t\t\tthis.$prev.attr('title', '');\n\t\t\tthis.$prev.addClass('disabled');\n\t\t\tthis.$prev.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$prev.attr('title', this.options.prevYearButtonLabel);\n\t\t\tthis.$prev.addClass('enabled');\n\t\t\tthis.$prev.removeClass('disabled');\n\t\t}\n\t\tthis.$monthObj.attr('title', this.options.changeRangeButtonLabel);\n\t\tif (this.options.max != null && this.year + 20 > this.options.max.getFullYear()) {\n\t\t\tthis.$next.attr('title', '');\n\t\t\tthis.$next.addClass('disabled');\n\t\t\tthis.$next.removeClass('enabled');\n\t\t} else {\n\t\t\tthis.$next.attr('title', this.options.nextYearButtonLabel);\n\t\t\tthis.$next.addClass('enabled');\n\t\t\tthis.$next.removeClass('disabled');\n\t\t}\n\t\tvar startYear = Math.floor(this.year / 10) * 10;\n\t\tvar endYear = startYear + 19;\n\t\tvar rowCount = 1;\n\t\tvar $tbody = this.$grid.find('tbody');\n\t\tthis.$monthObj.html(startYear + '-' + endYear);\n\t\t// clear the grid\n\t\tthis.hideObject(this.$grid.find('thead'));\n\t\t$tbody.empty();\n\t\t$('#datepicker-err-msg-' + this.id).empty();\n\t\tvar gridCells = '\\t<tr id=\"row0-'+this.id+'\" role=\"row\">\\n';\n\t\t// insert the months of the year.\n\t\tfor (var curYear = startYear; curYear <= endYear; curYear++) {\n\t\t\tif (curYear == this.year) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curYear - startYear + 1) + '-' + this.id + '\" class=\"year curYear selectable\"';\n\t\t\t} else if (this.options.min != null && (curYear < this.options.min.getFullYear())) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curYear - startYear + 1) + '-' + this.id + '\" class=\"year unselectable\"';\n\t\t\t} else if (this.options.max != null && (curYear > this.options.max.getFullYear())) {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curYear - startYear + 1) + '-' + this.id + '\" class=\"year unselectable\"';\n\t\t\t} else {\n\t\t\t\tgridCells += '\\t\\t<td id=\"cell' + (curYear - startYear + 1) + '-' + this.id + '\" class=\"year selectable\"';\n\t\t\t}\n\t\t\tgridCells += ' data-value=\"' + curYear + '\"';\n\t\t\tgridCells += ' title=\"' + curYear + '\"';\n\t\t\tgridCells += ' role=\"gridcell\" tabindex=\"-1\" aria-selected=\"false\">' + curYear;\n\t\t\tgridCells +=  '</td>';\n\t\t\tvar curPos = curYear - startYear;\n\t\t\tif (curPos == 4 || curPos == 9 || curPos == 14) {\n\t\t\t\tgridCells += '\\t</tr>\\n\\t<tr id=\"row' + rowCount + '-' + this.id + '\" role=\"row\">\\n';\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t}\n\t\tgridCells += '\\t</tr>';\n\t\t$tbody.append(gridCells);\n\t\tthis.gridType = 2; // 0 = days grid, 1 = months grid, 2 = years Grid\n\t} // end populateYearsCalendar()\n\n\t/**\n\t *\tshowDaysOfPrevMonth() is a member function to show the days of the previous month\n\t *\n\t *\t@param\t(offset int) offset may be used to specify an offset for setting\n\t *\t\t\tfocus on a day the specified number of days from the end of the month.\n\t *\t@return true if the previous month is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showDaysOfPrevMonth = function(offset) {\n\t\t// show the previous month\n\t\tvar previousMonth = this.previousMonth(this.year, this.month);\n\t\tif (this.options.min != null &&\n\t\t\t(\tpreviousMonth.year < this.options.min.getFullYear() ||\n\t\t\t\t(previousMonth.year == this.options.min.getFullYear() && previousMonth.month < this.options.min.getMonth()))) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.month = previousMonth.month;\n\t\tthis.year = previousMonth.year;\n\t\t// populate the calendar grid\n\t\tthis.populateDaysCalendar();\n\n\t\t// if offset was specified, set focus on the last day - specified offset\n\t\tif (offset != null) {\n\t\t\tvar numDays = this.getDaysInMonth(this.year, this.month);\n\t\t\tvar day = 'cell' + (numDays - offset)  + '-' + this.id;\n\t\t\tthis.$grid.attr('aria-activedescendant', day);\n\t\t\tthis.selectGridCell(day);\n\t\t}\n\t\treturn true;\n\t} // end showDaysOfPrevMonth()\n\n\t/**\n\t *\tshowDaysOfMonth() is a member function to show the days of the specified month\n\t *\n\t *\t@param\t(month int) the month to show.\n\t *\t@return true if the  month is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showDaysOfMonth = function(month) {\n\t\tif (this.options.min != null &&\n\t\t\t(\tthis.year < this.options.min.getFullYear() ||\n\t\t\t\t(this.year == this.options.min.getFullYear() && month < this.options.min.getMonth()))) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.options.max != null &&\n\t\t\t(\tthis.year > this.options.max.getFullYear() ||\n\t\t\t\t(this.year == this.options.max.getFullYear() && month > this.options.max.getMonth()))) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.month = month;\n\t\tthis.date = Math.min(this.date, this.getDaysInMonth(this.year, this.month));\n\t\tthis.populateDaysCalendar();\n\t\t// update the table's activedescendant to point to the active day\n\t\tvar $active = this.$grid.find(\"tbody td[data-value='\" + this.date + \"']\");\n\t\tthis.selectGridCell($active.attr('id'));\n\t\treturn true;\n\t} // end showDaysOfMonth()\n\n\n\t/**\n\t *\tshowMonthsOfPrevYear() is a member function to show the months of the previous year\n\t *\n\t *\t@param\t(offset int) offset may be used to specify an offset for setting\n\t *\t\t\tfocus on a month the specified number of months from the end of the year.\n\t *\t@return true if the previous year is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showMonthsOfPrevYear = function(offset) {\n\t\tif (this.options.min != null && this.year - 1 < this.options.min.getFullYear()) {\n\t\t\treturn false;\n\t\t}\n\t\t// show the previous year\n\t\tthis.year--;\n\t\t// populate the calendar grid\n\t\tthis.populateMonthsCalendar();\n\n\t\t// if offset was specified, set focus on the last month - specified offset\n\t\tif (offset != null) {\n\t\t\tvar month = 'cell' + (12 - offset)  + '-' + this.id;\n\t\t\tthis.$grid.attr('aria-activedescendant', month);\n\t\t\tthis.selectGridCell(month);\n\t\t}\n\t\treturn true;\n\t} // end showMonthsOfPrevYear()\n\n\t/**\n\t *\tshowMonthsOfYear() is a member function to show the months of the specified year\n\t *\n\t *\t@param\t(year int) the year to show.\n\t *\t@return true if the year is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showMonthsOfYear = function(year) {\n\t\tif (this.options.min != null && year < this.options.min.getFullYear()) {\n\t\t\treturn false;\n\t\t}\n\t\tif (this.options.max != null && year > this.options.max.getFullYear()) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.year = year;\n\t\tthis.populateMonthsCalendar();\n\t\t// update the table's activedescendant to point to the active month\n\t\tvar $active = this.$grid.find(\"tbody td[data-value='\" + this.month + \"']\");\n\t\tthis.$grid.attr('aria-activedescendant', $active.attr('id'));\n\t\tthis.selectGridCell($active.attr('id'));\n\t\treturn true;\n\t} // end showMonthsOfYear()\n\n\n\t/**\n\t *\tshowYearsOfPrevRange() is a member function to show the years of the previous range of twenty years\n\t *\n\t *\t@param\t(offset int) offset may be used to specify an offset for setting\n\t *\t\t\tfocus on a year the specified number of years from the end of the range.\n\t *\t@return true if the year - 20 is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showYearsOfPrevRange = function(offset) {\n\t\tif (this.options.min != null && this.year - 20 < this.options.min.getFullYear()) {\n\t\t\treturn false;\n\t\t}\n\t\t// show the previous range\n\t\tthis.year -= 20;\n\t\t// populate the calendar grid\n\t\tthis.populateYearsCalendar();\n\n\t\t// if offset was specified, set focus on the last month - specified offset\n\t\tif (offset != null) {\n\t\t\tvar year = 'cell' + (20 - offset)  + '-' + this.id;\n\t\t\tthis.$grid.attr('aria-activedescendant', year);\n\t\t\tthis.selectGridCell(year);\n\t\t}\n\t\treturn true;\n\t} // end showYearsOfPrevRange()\n\n\t/**\n\t * showDaysOfNextMonth() is a member function to show the next month\n\t *\n\t *\t@param\t(offset int) offset may be used to specify an offset for setting\n\t *\t\t\tfocus on a day the specified number of days from\n\t *\t\t\tthe beginning of the month.\n\t *\t@return true if the nextmMonth is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showDaysOfNextMonth = function(offset) {\n\t\t// show the next month\n\t\tvar nextMonth = this.nextMonth(this.year, this.month);\n\t\tif (this.options.max != null &&\n\t\t\t(\tnextMonth.year > this.options.max.getFullYear() ||\n\t\t\t\t(nextMonth.year == this.options.max.getFullYear() && nextMonth.month > this.options.max.getMonth()))) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.month = nextMonth.month;\n\t\tthis.year = nextMonth.year;\n\t\t// populate the calendar grid\n\t\tthis.populateDaysCalendar();\n\n\t\t// if offset was specified, set focus on the first day + specified offset\n\t\tif (offset != null) {\n\t\t\tvar day = 'cell' + offset + '-' + this.id;\n\t\t\tthis.$grid.attr('aria-activedescendant', day);\n\t\t\tthis.selectGridCell(day);\n\t\t}\n\t\treturn true;\n\t} // end showDaysOfNextMonth()\n\n\t/**\n\t * showMonthsOfNextYear() is a member function to show the months of next year\n\t *\n\t *\t@param\t(offset int) offset may be used to specify an offset for setting\n\t *\t\t\tfocus on a month the specified number of month from\n\t *\t\t\tthe beginning of the year.\n\t *\t@return true if the next year is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showMonthsOfNextYear = function(offset) {\n\t\tif (this.options.max != null && this.year + 1 > this.options.max.getFullYear()) {\n\t\t\treturn false;\n\t\t}\n\t\t// show the next year\n\t\tthis.year++;\n\t\t// populate the calendar grid\n\t\tthis.populateMonthsCalendar();\n\n\t\t// if offset was specified, set focus on the first day + specified offset\n\t\tif (offset != null) {\n\t\t\tvar month = 'cell' + offset + '-' + this.id;\n\t\t\tthis.$grid.attr('aria-activedescendant', month);\n\t\t\tthis.selectGridCell(month);\n\t\t}\n\t\treturn true;\n\t} // end showMonthsOfNextYear()\n\n\t/**\n\t * showYearsOfNextRange() is a member function to show the years of next range of years\n\t *\n\t *\t@param\t(offset int) offset may be used to specify an offset for setting\n\t *\t\t\tfocus on a year the specified number of years from\n\t *\t\t\tthe beginning of the range.\n\t *\t@return true if the year + 20 is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showYearsOfNextRange = function(offset) {\n\t\tif (this.options.max != null && this.year + 20 > this.options.max.getFullYear()) {\n\t\t\treturn false;\n\t\t}\n\t\t// show the next year\n\t\tthis.year += 20;\n\t\t// populate the calendar grid\n\t\tthis.populateYearsCalendar();\n\n\t\t// if offset was specified, set focus on the first day + specified offset\n\t\tif (offset != null) {\n\t\t\tvar year = 'cell' + offset + '-' + this.id;\n\t\t\tthis.$grid.attr('aria-activedescendant', year);\n\t\t\tthis.selectGridCell(year);\n\t\t}\n\t\treturn true;\n\t} // end showYearsOfNextRange()\n\n\t/**\n\t *\tshowDaysOfPrevYear() is a member function to show the previous year\n\t *\n\t *\t@return true if the previous year is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showDaysOfPrevYear = function() {\n\t\tif (this.options.min != null &&\n\t\t\t(\tthis.year - 1 < this.options.min.getFullYear() ||\n\t\t\t\t(this.year - 1 == this.options.min.getFullYear() && this.month < this.options.min.getMonth()))) {\n\t\t\treturn false;\n\t\t}\n\t\t// decrement the year\n\t\tthis.year--;\n\n\t\t// populate the calendar grid\n\t\tthis.populateDaysCalendar();\n\t\treturn true;\n\t} // end showDaysOfPrevYear()\n\n\t/**\n\t *\tshowDaysOfNextYear() is a member function to show the next year\n\t *\n\t *\t@return true if the next year is between the minimum and the maximum date otherwise return false\n\t */\n\tDatepicker.prototype.showDaysOfNextYear = function() {\n\t\tif (this.options.max != null &&\n\t\t\t(\tthis.year + 1 > this.options.max.getFullYear() ||\n\t\t\t\t(this.year + 1 == this.options.max.getFullYear() && this.month > this.options.max.getMonth()))) {\n\t\t\treturn false;\n\t\t}\n\t\t// increment the year\n\t\tthis.year++;\n\n\t\t// populate the calendar grid\n\t\tthis.populateDaysCalendar();\n\t\treturn true;\n\t} // end showDaysOfNextYear()\n\n\t/**\n\t *\tbindHandlers() is a member function to bind event handlers for the widget\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.bindHandlers = function() {\n\t\tvar self = this;\n\n\t\t// bind button handlers\n\t\tthis.$fastprev.click(function(e) {\n\t\t\treturn self.handleFastPrevClick(e);\n\t\t});\n\t\tthis.$prev.click(function(e) {\n\t\t\treturn self.handlePrevClick(e);\n\t\t});\n\t\tthis.$next.click(function(e) {\n\t\t\treturn self.handleNextClick(e);\n\t\t});\n\t\tthis.$fastnext.click(function(e) {\n\t\t\treturn self.handleFastNextClick(e);\n\t\t});\n\t\tthis.$monthObj.click(function(e) {\n\t\t\treturn self.handleMonthClick(e);\n\t\t});\n\t\tthis.$monthObj.keydown(function(e) {\n\t\t\treturn self.handleMonthKeyDown(e);\n\t\t});\n\t\tthis.$fastprev.keydown(function(e) {\n\t\t\treturn self.handleFastPrevKeyDown(e);\n\t\t});\n\t\tthis.$prev.keydown(function(e) {\n\t\t\treturn self.handlePrevKeyDown(e);\n\t\t});\n\t\tthis.$next.keydown(function(e) {\n\t\t\treturn self.handleNextKeyDown(e);\n\t\t});\n\t\tthis.$fastnext.keydown(function(e) {\n\t\t\treturn self.handleFastNextKeyDown(e);\n\t\t});\n\t\tif (this.options.modal == true) {\n\t\t\tthis.$close.click(function(e) {\n\t\t\t\treturn self.handleCloseClick(e);\n\t\t\t});\n\t\t\tthis.$close.keydown(function(e) {\n\t\t\t\treturn self.handleCloseKeyDown(e);\n\t\t\t});\n\t\t}\n\n\t\t// bind grid handlers\n\t\tthis.$grid.keydown(function(e) {\n\t\t\treturn self.handleGridKeyDown(e);\n\t\t});\n\t\tthis.$grid.keypress(function(e) {\n\t\t\treturn self.handleGridKeyPress(e);\n\t\t});\n\t\tthis.$grid.focus(function(e) {\n\t\t\treturn self.handleGridFocus(e);\n\t\t});\n\t\tthis.$grid.blur(function(e) {\n\t\t\treturn self.handleGridBlur(e);\n\t\t});\n\t\tthis.$grid.delegate('td', 'click', function(e) {\n\t\t\treturn self.handleGridClick(this, e);\n\t\t});\n\t} // end bindHandlers();\n\n\t/**\n\t *\thandleFastPrevClick() is a member function to process click events for the fast prev month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleFastPrevClick = function(e) {\n\t\tif (this.showDaysOfPrevYear()) {\n\t\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\t\tif (this.month != this.curMonth || this.year != this.curYear) {\n\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t} else {\n\t\t\t\tthis.$grid.attr('aria-activedescendant', active);\n\t\t\t\tthis.selectGridCell(active);\n\t\t\t}\n\t\t}\n\t\te.stopPropagation();\n\t\treturn false;\n\t} // end handleFastPrevClick()\n\n\t/**\n\t *\thandlePrevClick() is a member function to process click events for the prev month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handlePrevClick = function(e) {\n\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\tswitch (this.gridType) {\n\t\t\tcase 0: // days grid\n\t\t\t\tvar ok;\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tok = this.showDaysOfPrevYear();\n\t\t\t\t} else {\n\t\t\t\t\tok = this.showDaysOfPrevMonth();\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tif (this.month != this.curMonth || this.year != this.curYear) {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', active);\n\t\t\t\t\t\tthis.selectGridCell(active);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1: // months grid\n\t\t\t\tif (this.showMonthsOfPrevYear()) {\n\t\t\t\t\tif (this.year != this.curYear) {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', active);\n\t\t\t\t\t\tthis.selectGridCell(active);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2: // years grid\n\t\t\t\tif (this.showYearsOfPrevRange()) {\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\te.stopPropagation();\n\t\treturn false;\n\t} // end handlePrevClick()\n\n\t/**\n\t *\thandleMonthClick() is a member function to process click events for the month header\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleMonthClick = function(e) {\n\t\tthis.changeGrid(e);\n\t\te.stopPropagation();\n\t\treturn false;\n\t} // end handleMonthClick()\n\n\t/**\n\t *\thandleNextClick() is a member function to process click events for the next month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleNextClick = function(e) {\n\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\tswitch (this.gridType) {\n\t\t\tcase 0: // days grid\n\t\t\t\tvar ok;\n\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\tok = this.showDaysOfNextYear();\n\t\t\t\t} else {\n\t\t\t\t\tok = this.showDaysOfNextMonth();\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tif (this.month != this.curMonth || this.year != this.curYear) {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', active);\n\t\t\t\t\t\tthis.selectGridCell(active);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1: // months grid\n\t\t\t\tif (this.showMonthsOfNextYear()) {\n\t\t\t\t\tif (this.year != this.curYear) {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', active);\n\t\t\t\t\t\tthis.selectGridCell(active);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2: // years grid\n\t\t\t\tif (this.showYearsOfNextRange()) {\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\te.stopPropagation();\n\t\treturn false;\n\n\t} // end handleNextClick()\n\n\t/**\n\t *\thandleFastNextClick() is a member function to process click events for the fast next month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleFastNextClick = function(e) {\n\t\tif (this.showDaysOfNextYear()) {\n\t\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\t\tif (this.month != this.curMonth || this.year != this.curYear) {\n\t\t\t\tthis.$grid.attr('aria-activedescendant', 'cell1' + '-' + this.id);\n\t\t\t\tthis.selectGridCell('cell1' + '-' + this.id);\n\t\t\t} else {\n\t\t\t\tthis.$grid.attr('aria-activedescendant', active);\n\t\t\t\tthis.selectGridCell(active);\n\t\t\t}\n\t\t}\n\t\te.stopPropagation();\n\t\treturn false;\n\n\t} // end handleFastNextClick()\n\n\t/**\n\t *\thandleCloseClick() is a member function to process click events for the close button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleCloseClick = function(e) {\n\t\t// dismiss the dialog box\n\t\tthis.hide();\n\t\te.stopPropagation();\n\t\treturn false;\n\t} // end handleCloseClick()\n\n\t/**\n\t *\thandleFastPrevKeyDown() is a member function to process keydown events for the fast prev month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleFastPrevKeyDown = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (this.options.modal == false || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tthis.$close.focus();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$prev.focus();\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tif (e.shiftKey || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tthis.showDaysOfPrevYear();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\t\t\tcase this.keys.esc:\n\t\t\t\t{\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handleFastPrevKeyDown()\n\n\t/**\n\t *\thandlePrevKeyDown() is a member function to process keydown events for the prev month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handlePrevKeyDown = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (this.options.modal == false || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tif (this.gridType == 0) {\n\t\t\t\t\t\t\tthis.$fastprev.focus();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$close.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// @TODO : do not work with FF, Chrome, Safari but work with IE, why ?\n\t\t\t\t\t\tthis.$monthObj.focus();\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\t\t\t\tthis.showDaysOfPrevYear();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.showDaysOfPrevMonth();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\tthis.showMonthsOfPrevYear();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\tthis.showYearsOfPrevRange();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\t\t\tcase this.keys.esc:\n\t\t\t\t{\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handlePrevKeyDown()\n\n\t/**\n\t *\thandleMonthKeyDown() is a member function to process keydown events for the month title\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleMonthKeyDown = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (this.options.modal == false || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tthis.$prev.focus();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$next.focus();\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tthis.changeGrid(e);\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\t\t\tcase this.keys.esc:\n\t\t\t\t{\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handleMonthKeyDown()\n\n\t/**\n\t *\thandleNextKeyDown() is a member function to process keydown events for the next month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleNextKeyDown = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (this.options.modal == false || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tthis.$monthObj.focus();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (this.gridType == 0) {\n\t\t\t\t\t\t\tthis.$fastnext.focus();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$grid.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\t\t\t\tthis.showDaysOfNextYear();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.showDaysOfNextMonth();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\tthis.showMonthsOfNextYear();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\tthis.showYearsOfNextRange();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.esc:\n\t\t\t\t{\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handleNextKeyDown()\n\n\t/**\n\t *\thandleFastNextKeyDown() is a member function to process keydown events for the fast next month button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleFastNextKeyDown = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (this.options.modal == false || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tthis.$next.focus();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.$grid.focus();\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tthis.showDaysOfNextYear();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.esc:\n\t\t\t\t{\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handleFastNextKeyDown()\n\n\t/**\n\t *\thandleCloseKeyDown() is a member function to process keydown events for the close button\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleCloseKeyDown = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\tthis.$grid.focus();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (this.gridType == 0) {\n\t\t\t\t\t\t\tthis.$fastprev.focus();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$prev.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.esc:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tif (e.shiftKey || e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handlePrevKeyDown()\n\n\t/**\n\t *\thandleGridKeyDown() is a member function to process keydown events for the Datepicker grid\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleGridKeyDown = function(e) {\n\t\tvar $curCell = $('#' + this.$grid.attr('aria-activedescendant'));\n\t\tvar $cells = this.$grid.find('td.selectable');\n\t\tvar colCount = this.$grid.find('tbody tr').eq(0).find('td').length;\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\t\t{\n\t\t\t\t\tif (this.options.modal == true) {\n\t\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\t\tif (this.gridType == 0) {\n\t\t\t\t\t\t\t\tthis.$fastnext.focus();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.$next.focus();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.$close.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\t\tthis.hide();\n\t\t\t\t\t\tthis.handleTabOut(e);\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\t\t{\n\t\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\t// update the target box\n\t\t\t\t\t\t\tthis.update();\n\t\t\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\t\t\tthis.hide();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\tthis.showDaysOfMonth(parseInt($curCell.attr('data-value'), 10));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\tthis.showMonthsOfYear(parseInt($curCell.attr('data-value'), 10));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.esc:\n\t\t\t\t{\n\t\t\t\t\t// dismiss the dialog box\n\t\t\t\t\tthis.hide();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.left:\n\t\t\tcase this.keys.right:\n\t\t\t\t{\n\t\t\t\t\tif ((e.keyCode == this.keys.left && this.locales.directionality === 'LTR')  || (e.keyCode == this.keys.right && this.locales.directionality === 'RTL')) {\n\t\t\t\t\t\tif (e.ctrlKey || e.shiftKey) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar cellIndex = $cells.index($curCell) - 1;\n\t\t\t\t\t\tvar $prevCell = null;\n\t\t\t\t\t\tif (cellIndex >= 0) {\n\t\t\t\t\t\t\t$prevCell = $cells.eq(cellIndex);\n\t\t\t\t\t\t\tthis.unSelectGridCell($curCell.attr('id'));\n\t\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $prevCell.attr('id'));\n\t\t\t\t\t\t\tthis.selectGridCell($prevCell.attr('id'));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\t\t\tthis.showDaysOfPrevMonth(0);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\t\t\tthis.showMonthsOfPrevYear(0);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\t\t\tthis.showYearsOfPrevRange(0);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (e.ctrlKey || e.shiftKey) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar cellIndex = $cells.index($curCell) + 1;\n\t\t\t\t\t\tvar $nextCell = null;\n\t\t\t\t\t\tif (cellIndex < $cells.length) {\n\t\t\t\t\t\t\t$nextCell = $cells.eq(cellIndex);\n\t\t\t\t\t\t\tthis.unSelectGridCell($curCell.attr('id'));\n\t\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $nextCell.attr('id'));\n\t\t\t\t\t\t\tthis.selectGridCell($nextCell.attr('id'));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\t\t\t// move to the next month\n\t\t\t\t\t\t\t\t\tthis.showDaysOfNextMonth(1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\t\t\tthis.showMonthsOfNextYear(1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\t\t\tthis.showYearsOfNextRange(1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcase this.keys.up:\n\t\t\t\t{\n\t\t\t\t\tif (e.ctrlKey || e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tvar cellIndex = $cells.index($curCell) - colCount;\n\t\t\t\t\tvar $prevCell = null;\n\t\t\t\t\tif (cellIndex >= 0) {\n\t\t\t\t\t\t$prevCell = $cells.eq(cellIndex);\n\t\t\t\t\t\tthis.unSelectGridCell($curCell.attr('id'));\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $prevCell.attr('id'));\n\t\t\t\t\t\tthis.selectGridCell($prevCell.attr('id'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// move to appropriate day in previous month\n\t\t\t\t\t\tcellIndex = colCount - 1 - $cells.index($curCell);\n\t\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\t\tthis.showDaysOfPrevMonth(cellIndex);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\t\tthis.showMonthsOfPrevYear(cellIndex);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\t\tthis.showYearsOfPrevRange(cellIndex);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.down:\n\t\t\t\t{\n\t\t\t\t\tif (e.ctrlKey || e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tvar cellIndex = $cells.index($curCell) + colCount;\n\t\t\t\t\tvar $nextCell = null;\n\t\t\t\t\tif (cellIndex < $cells.length) {\n\t\t\t\t\t\t$nextCell = $cells.eq(cellIndex);\n\t\t\t\t\t\tthis.unSelectGridCell($curCell.attr('id'));\n\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $nextCell.attr('id'));\n\t\t\t\t\t\tthis.selectGridCell($nextCell.attr('id'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// move to appropriate day in next month\n\t\t\t\t\t\tcellIndex = colCount + 1 - ($cells.length - $cells.index($curCell));\n\t\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\t\tthis.showDaysOfNextMonth(cellIndex);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\t\tthis.showMonthsOfNextYear(cellIndex);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\t\tthis.showYearsOfNextRange(cellIndex);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.pageup:\n\t\t\t\t{\n\t\t\t\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar ok = false;\n\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\tok = this.showDaysOfPrevYear();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tok = this.showDaysOfPrevMonth();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\tok = this.showMonthsOfPrevYear();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\tok = this.showYearsOfPrevRange();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (ok) {\n\t\t\t\t\t\tif ($('#' + active).attr('id') == undefined) {\n\t\t\t\t\t\t\tvar $lastCell = $cells.eq($cells.length - 1);\n\t\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $lastCell.attr('id'));\n\t\t\t\t\t\t\tthis.selectGridCell($lastCell.attr('id'));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.selectGridCell(active);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.pagedown:\n\t\t\t\t{\n\t\t\t\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tvar ok = false;\n\t\t\t\t\tswitch (this.gridType) {\n\t\t\t\t\t\tcase 0: // days grid\n\t\t\t\t\t\t\tif (e.ctrlKey) {\n\t\t\t\t\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t\t\t\t\tok = this.showDaysOfNextYear();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tok = this.showDaysOfNextMonth();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1: // months grid\n\t\t\t\t\t\t\tok = this.showMonthsOfNextYear();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2: // years grid\n\t\t\t\t\t\t\tok = this.showYearsOfNextRange();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (ok) {\n\t\t\t\t\t\tif ($('#' + active).attr('id') == undefined) {\n\t\t\t\t\t\t\tvar $lastCell = $cells.eq($cells.length - 1);\n\t\t\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $lastCell.attr('id'));\n\t\t\t\t\t\t\tthis.selectGridCell($lastCell.attr('id'));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.selectGridCell(active);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.home:\n\t\t\t\t{\n\t\t\t\t\tif (e.ctrlKey || e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tvar $firstCell = $cells.eq(0);\n\t\t\t\t\tthis.unSelectGridCell($curCell.attr('id'));\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $firstCell.attr('id'));\n\t\t\t\t\tthis.selectGridCell($firstCell.attr('id'));\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\tcase this.keys.end:\n\t\t\t\t{\n\t\t\t\t\tif (e.ctrlKey || e.shiftKey) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tvar $lastCell = $cells.eq($cells.length - 1);\n\t\t\t\t\tthis.unSelectGridCell($curCell.attr('id'));\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $lastCell.attr('id'));\n\t\t\t\t\tthis.selectGridCell($lastCell.attr('id'));\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handleGridKeyDown()\n\n\t/**\n\t *\thandleGridKeyPress() is a member function to consume keypress events for browsers that\n\t *\tuse keypress to scroll the screen and manipulate tabs\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t * \t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleGridKeyPress = function(e) {\n\t\tif (e.altKey) {\n\t\t\treturn true;\n\t\t}\n\t\tswitch (e.keyCode) {\n\t\t\tcase this.keys.tab:\n\t\t\tcase this.keys.enter:\n\t\t\tcase this.keys.space:\n\t\t\tcase this.keys.esc:\n\t\t\tcase this.keys.left:\n\t\t\tcase this.keys.right:\n\t\t\tcase this.keys.up:\n\t\t\tcase this.keys.down:\n\t\t\tcase this.keys.pageup:\n\t\t\tcase this.keys.pagedown:\n\t\t\tcase this.keys.home:\n\t\t\tcase this.keys.end:\n\t\t\t\t{\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t\treturn true;\n\t} // end handleGridKeyPress()\n\n\t/**\n\t *\thandleGridClick() is a member function to process mouse click events for the Datepicker grid\n\t *\n\t *\t@param (id string) id is the id of the object triggering the event\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\tDatepicker.prototype.handleGridClick = function(id, e) {\n\t\tvar $cell = $(id);\n\t\tif ($cell.is('.empty') || $cell.is('.unselectable')) {\n\t\t\treturn true;\n\t\t}\n\t\tthis.$grid.find('.focus').removeClass('focus').attr('aria-selected', 'false').attr('tabindex', -1);\n\t\tswitch (this.gridType) {\n\t\t\tcase 0: // days grid\n\t\t\t\tthis.$grid.attr('aria-activedescendant', $cell.attr('id'));\n\t\t\t\tthis.selectGridCell($cell.attr('id'));\n\t\t\t\t// update the target box\n\t\t\t\tthis.update();\n\t\t\t\t// dismiss the dialog box\n\t\t\t\tthis.hide();\n\t\t\t\tbreak;\n\t\t\tcase 1: // months grid\n\t\t\t\tthis.showDaysOfMonth(parseInt($cell.attr('data-value'), 10));\n\t\t\t\tbreak;\n\t\t\tcase 2: // years grid\n\t\t\t\tthis.showMonthsOfYear(parseInt($cell.attr('data-value'), 10));\n\t\t\t\tbreak;\n\t\t}\n\t\te.stopPropagation();\n\t\treturn false;\n\t} // end handleGridClick()\n\n\t/**\n\t *\thandleGridFocus() is a member function to process focus events for the Datepicker grid\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) true\n\t */\n\tDatepicker.prototype.handleGridFocus = function(e) {\n\t\tvar active = this.$grid.attr('aria-activedescendant');\n\t\tif ($('#' + active).attr('id') == undefined) {\n\t\t\tvar $cells = this.$grid.find('td.selectable');\n\t\t\tvar $lastCell = $cells.eq($cells.length - 1);\n\t\t\tthis.$grid.attr('aria-activedescendant', $lastCell.attr('id'));\n\t\t\tthis.selectGridCell($lastCell.attr('id'));\n\t\t} else {\n\t\t\tthis.selectGridCell(active);\n\t\t}\n\t\treturn true;\n\t} // end handleGridFocus()\n\n\t/**\n\t *\thandleGridBlur() is a member function to process blur events for the Datepicker grid\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) true\n\t */\n\tDatepicker.prototype.handleGridBlur = function(e) {\n\t\tthis.unSelectGridCell(this.$grid.attr('aria-activedescendant'));\n\t\treturn true;\n\t} // end handleGridBlur()\n\n\t/**\n\t *\thandleTabOut() is a member function to process tab key in Datepicker grid\n\t *\n\t * @param (e obj) e is the event object associated with the event\n\t * @return (boolean) true\n\t */\n\tDatepicker.prototype.handleTabOut = function(e) {\n\t\tvar fields = $('body').find('input:visible,textarea:visible,select:visible');\n        var index = fields.index( this.$target );\n        if ( index > -1 && index < fields.length ) {\n\t\t\tif (e.shiftKey) {\n\t\t\t\tif (index > 0) {\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (index + 1 < fields.length) {\n\t\t\t\t\tindex++;\n\t\t\t\t}\n\t\t\t}\n            fields.eq( index ).focus();\n        }\n\t\treturn true;\n\t} // end handleTabOut()\n\n\t/**\n\t *\tchangeGrid() is a member function to change the calendar after click or enter into the calendar title\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\t@return true\n\t */\n\tDatepicker.prototype.changeGrid = function(e) {\n\t\tswitch (this.gridType) {\n\t\t\tcase 0: // days grid\n\t\t\t\tthis.populateMonthsCalendar();\n\t\t\t\tif (this.year != this.curYear) {\n\t\t\t\t\tvar $cells = this.$grid.find('td.selectable');\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $cells.eq(0).attr('id'));\n\t\t\t\t} else {\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', this.$grid.find('.curMonth').attr('id'));\n\t\t\t\t}\n\t\t\t\tthis.selectGridCell(this.$grid.attr('aria-activedescendant'));\n\t\t\t\tbreak;\n\t\t\tcase 2: // years grid\n\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\t// goto previous twenty years\n\t\t\t\t\tthis.year -= 20;\n\t\t\t\t} else {\n\t\t\t\t\t// goto next twenty years\n\t\t\t\t\tthis.year += 20;\n\t\t\t\t}\n\t\t\tcase 1: // months grid\n\t\t\t\tthis.populateYearsCalendar();\n\t\t\t\tif (this.year != this.curYear) {\n\t\t\t\t\tvar $cells = this.$grid.find('td.selectable');\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', $cells.eq(0).attr('id'));\n\t\t\t\t} else {\n\t\t\t\t\tthis.$grid.attr('aria-activedescendant', this.$grid.find('.curYear').attr('id'));\n\t\t\t\t}\n\t\t\t\tthis.selectGridCell(this.$grid.attr('aria-activedescendant'));\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t} // end changeGrid()\n\n\t/**\n\t *\tselectGridCell() is a member function to put focus on the current cell of the grid.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.selectGridCell = function(cellId) {\n\t\t$('#' + cellId).addClass('focus').attr('aria-selected', 'true').attr('tabindex', 0).focus();\n\t} // end focusCurrentDay()\n\n\t/**\n\t *\tselectGridCell() is a member function to put focus on the current cell of the grid.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.unSelectGridCell = function(cellId) {\n\t\t$('#' + cellId).removeClass('focus').attr('aria-selected', 'false').attr('tabindex', -1);\n\t} // end focusCurrentDay()\n\n\t/**\n\t *\tupdate() is a member function to update the target textbox.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.update = function() {\n\t\tvar $curDay = $('#' + this.$grid.attr('aria-activedescendant'));\n\t\tvar date = new Date(this.year, this.month, parseInt($curDay.attr('data-value'), 10));\n\t\tvar val = this.formatDate(date, this.options.outputFormat);\n\t\tthis.$target.val(val);\n\t\tthis.$target.removeAttr('aria-invalid');\n\t\tthis.$target.parents('.form-group').removeClass('has-error');\n\t\tthis.$target.trigger('change');\n\t\tif (this.options.onUpdate) {\n\t\t\tthis.options.onUpdate(val);\n\t\t}\n\t} // end update()\n\n\t/**\n\t *\thideObject() is a member function to hide an element of the datepicker.\n\t *\n\t *\t@param ($element jQuery object) the element to hide\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.hideObject = function($element) {\n\t\t$element.attr('aria-hidden', true);\n\t\t$element.hide();\n\t} // end hideObject()\n\n\t/**\n\t *\tshowObject() is a member function to show an element of the datepicker.\n\t *\n\t *\t@param ($element jQuery object) the element to show\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.showObject = function($element) {\n\t\t$element.attr('aria-hidden', false);\n\t\t$element.show();\n\t} // end showObject()\n\n\t/**\n\t *\tshow() is a member function to show the Datepicker and give it focus.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.show = function() {\n\t\tvar self = this;\n\t\t$('.datepicker-calendar').trigger('ab.datepicker.opening', [self.id]);\n\t\tif (this.options.modal == true) {\n\t\t\t// Bind an event listener to the document to capture all mouse events to make dialog modal\n\t\t\t$(document).bind('click mousedown mouseup', function(e) {\n\t\t\t\t//ensure focus remains on the dialog\n\t\t\t\tself.$grid.focus();\n\t\t\t\t// Consume all mouse events and do nothing\n\t\t\t\te.stopPropagation;\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tthis.greyOut(true);\n\t\t\tvar zIndex = parseInt($('#datepicker-overlay').css('z-index'), 10) || 40;\n\t\t\tthis.$calendar.css('z-index', zIndex + 1);\n\t\t} else {\n\t\t\t// Bind an event listener to the document to capture only the mouse click event\n\t\t\t$(document).bind('click',  $.proxy(this.handleDocumentClick, this));\n\t\t\tthis.$calendar.bind('ab.datepicker.opening', function(e, id) {\n\t\t\t\tif (id != self.id) {\n\t\t\t\t\tself.hide();\n\t\t\t\t} else {\n\t\t\t\t\t//ensure focus remains on the dialog\n\t\t\t\t\tself.$grid.focus();\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t\tthis.$calendar.bind('ab.datepicker.opened', function(e, id) {\n\t\t\tif (id == self.id) {\n\t\t\t\tself.$grid.focus();\n\t\t\t}\n\t\t});\n\n\t\t// adjust position of the calendar\n\t\tvar groupOffsetTop = Math.max(0, Math.floor(this.$group.offset().top - this.$label.offset().top));\n\t\tvar groupOffsetLeft = Math.max(0, Math.floor(this.$group.offset().left - this.$label.offset().left));\n\t\tvar parentPaddingLeft = parseInt(this.$calendar.parent().css('padding-left'), 10);\n\t\tvar calendarHeight = this.$calendar.outerHeight();\n\t\tvar groupTop = this.$group.offset().top;\n\t\tvar groupLeft = this.$group.offset().left;\n\t\tvar groupHeight = this.$group.outerHeight(true);\n\t\tvar roomBefore = Math.floor(groupTop - $(win).scrollTop());\n\t\tvar roomAfter = Math.floor($(win).height() - (groupTop + groupHeight - $(win).scrollTop()));\n\t\tif (roomAfter < calendarHeight && roomAfter < roomBefore) {\n\t\t\t// show calendar above group\n\t\t\tthis.$calendar.addClass('above');\n\t\t\tthis.$calendar.css({\n\t\t\t\ttop: (groupOffsetTop - calendarHeight) + 'px',\n\t\t\t\tleft: (groupOffsetLeft + parentPaddingLeft) + 'px'\n\t\t\t});\n\t\t} else {\n\t\t\t  // show calendar below group\n\t\t\tthis.$calendar.addClass('below');\n\t\t\tthis.$calendar.css({\n\t\t\t\ttop: (groupHeight + groupOffsetTop) + 'px',\n\t\t\t\tleft: (groupOffsetLeft + parentPaddingLeft) + 'px'\n\t\t\t});\n\t\t}\n\n\t\t// show the dialog\n\t\tthis.$calendar.attr('aria-hidden', 'false');\n\t\tthis.$calendar.fadeIn();\n\t\t$('.datepicker-calendar').trigger('ab.datepicker.opened', [self.id]);\n\t} // end show()\n\n\t/**\n\t *\trefresh() is a member function to refesh the datepicker content when an option change.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.refresh = function() {\n\t\tthis.drawCalendarHeader();\n\t\tswitch\t(this.gridType) {\n\t\t\tcase 0:\n\t\t\t\tthis.populateDaysCalendar();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tthis.populateMonthsCalendar();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tthis.populateYearsCalendar();\n\t\t\t\tbreak;\n\t\t}\n\t} // end refresh()\n\n\t/**\n\t *\thandleDocumentClick() is a member function to handle click on document.\n\t *\n\t *\t@param (e obj) e is the event object associated with the event\n\t *\n\t *\t@return (boolean) false if consuming event, true if propagating\n\t */\n\t Datepicker.prototype.handleDocumentClick = function(e) {\n\t\tif ($(e.target).parents('#datepicker-calendar-' + this.id).length == 0) {\n\t\t\tthis.hide();\n\t\t\treturn true;\n\t\t} else {\n\t\t\t//ensure focus remains on the dialog\n\t\t\tthis.$grid.focus();\n\t\t\t// Consume all mouse events and do nothing\n\t\t\te.stopPropagation;\n\t\t\treturn false;\n\t\t}\n\t} // end handleDocumentClick()\n\n\t/**\n\t *\thide() is a member function to hide the Datepicker and remove focus.\n\t *\n\t *\t@return N/A\n\t */\n\t Datepicker.prototype.hide = function(omitSettingFocus) {\n\t\tif (this.options.inline == false) {\n\t\t\tvar self = this;\n\t\t\t// unbind the modal event sinks\n\t\t\tif (this.options.modal == true) {\n\t\t\t\t$(document).unbind('click mousedown mouseup');\n\t\t\t\tthis.greyOut(false);\n\t\t\t} else {\n\t\t\t\t$(document).unbind('click', self.handleDocumentClick);\n\t\t\t\tthis.$calendar.unbind('ab.datepicker.opening');\n\t\t\t}\n\t\t\t// hide the dialog\n\t\t\tthis.$calendar.removeClass('above below');\n\t\t\tthis.$calendar.attr('aria-hidden', 'true');\n\t\t\tthis.$calendar.fadeOut();\n\t\t\t$('.datepicker-calendar').trigger('ab.datepicker.closed', [self.id]);\n\t\t\t// set focus on the focus target\n\t\t\tif (!omitSettingFocus) {\n\t\t\t\tthis.$target.focus();\n\t\t\t}\n\t\t}\n\t} // end hide()\n\n\t/**\n\t *\tgreyOut() is a member function to grey out the document background.\n\t *\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.greyOut = function(on) {\n\t\tvar $overlay = $('#datepicker-overlay');\n\t\tif ($overlay.length == 0 && on) {\n\t\t\t$('body').append('<div id=\"datepicker-overlay\" class=\"datepicker-overlay\"></div>');\n\t\t\t$overlay = $('#datepicker-overlay');\n\n \t\t\t// compute z-index for overlay\n\t\t\tvar zmax = 0;\n\t\t\t$('*').each(function() {\n\t\t\t\tvar cur = parseInt($(this).css('z-index'), 10);\n\t\t\t\tif (! isNaN(cur)) zmax = Math.max(zmax, cur);\n\t\t\t});\n\t\t\t$overlay.attr('z-index', zmax + 10);\n\t\t}\n\t\tif (on) {\n\t\t\t$overlay.fadeIn(500);\n\t\t} else {\n\t\t\t$overlay.fadeOut(500);\n\t\t}\n\t} // end greyOut()\n\n\t/**\n\t *\tabsolutePosition() is a member function that compute the absolute position\n\t *\tof some element within document.\n\t *\n\t *\t@param (element obj) the element of the document\n\t *\t@return an object containing the properties top and left.\n\t */\n\tDatepicker.prototype.absolutePosition = function (element) {\n\t\tvar top = 0, left = 0;\n\t    if (element.getBoundingClientRect) {\n\t\t    var box = element.getBoundingClientRect();\n\t\t    var body = document.body;\n\t\t    var docElem = document.documentElement;\n\t\t    var scrollTop = win.pageYOffset || docElem.scrollTop || body.scrollTop;\n\t\t    var scrollLeft = win.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n\t\t    var clientTop = docElem.clientTop || body.clientTop || 0;\n\t\t    var clientLeft = docElem.clientLeft || body.clientLeft || 0;\n\t\t    top  = Math.round(box.top +  scrollTop - clientTop);\n\t\t    left = Math.round(box.left + scrollLeft - clientLeft);\n\t    } else {\n\t\t\twhile(element) {\n\t\t\t\ttop = top + parseInt(element.offsetTop, 10);\n\t\t\t\tleft = left + parseInt(element.offsetLeft, 10);\n\t\t\t\telement = element.offsetParent;\n\t\t\t}\n\t    }\n\t\treturn {top: top, left: left};\n\t} // end absolutePosition()\n\n\t/**\n\t *\tgetDaysInMonth() is a member function to calculate the number of days in a given month\n\t *\n\t *\t@param (year int) the year\n\t *\t@param (month int) the given month\n\t *\n\t *\t@return (integer) number of days\n\t */\n\tDatepicker.prototype.getDaysInMonth = function(year, month) {\n\t\treturn 32 - new Date(year, month, 32).getDate();\n\t} // end getDaysInMonth()\n\n\t/**\n\t *\tpreviousMonth() is a member function that compute the month\n\t *\tpreceding a given month.\n\t *\n\t *\t@param (year int) the given year\n\t *\t@param (month int) the given month\n\t *\t@return an object containing the properties year and month.\n\t */\n\tDatepicker.prototype.previousMonth = function (year, month) {\n\t\tif (month == 0) {\n\t\t\tmonth = 11;\n\t\t\tyear--;\n\t\t} else {\n\t\t\tmonth--;\n\t\t}\n\t\treturn {year: year, month: month};\n\t} // end previousMonth()\n\n\t/**\n\t *\tnextMonth() is a member function that compute the month\n\t *\tfollowing a given month.\n\t *\n\t *\t@param (year int) the given year\n\t *\t@param (month int) the given month\n\t *\t@return an object containing the properties year and month.\n\t */\n\tDatepicker.prototype.nextMonth = function (year, month) {\n\t\tif (month == 11) {\n\t\t\tmonth = 0;\n\t\t\tyear++;\n\t\t} else {\n\t\t\tmonth++;\n\t\t}\n\t\treturn {year: year, month: month};\n\t} // end nextMonth()\n\n\t/**\n\t *\tformatDate (date_object, format)\n\t *\tThe format string uses the same abbreviations as in createDateFromFormat()\n\t *\n\t *\t@param (date date object) the given date\n\t *\t@param (format string) the given output format\n\t *\t@returns a date in the output format specified.\n\t */\n\tDatepicker.prototype.formatDate = function (date, format) {\n\t\tvar zeroPad = function (x) {\n\t\t\treturn(x < 0 || x > 9 ? \"\" : \"0\" ) + x;\n\t\t};\n\t\tvar getWeekOfMonth = function(date) {\n\t\t\treturn Math.ceil((date.getDate() - 1 - date.getDay()) / 7);\n\t\t};\n\t\tvar getWeekOfYear = function(date) {\n\t\t\tvar onejan = new Date(date.getFullYear(),0,1);\n\t\t\treturn Math.ceil((((date - onejan) / 86400000) + onejan.getDay()+1)/7);\n\t\t};\n\t\tvar getDayOfYear = function(date) {\n\t\t\tvar start = new Date(date.getFullYear(), 0, 0);\n\t\t\treturn Math.floor((date - start) / 86400000);\n\t\t};\n\t\tvar getMillisecondsInDay = function(date) {\n\t\t\tvar date1 = new Date(date.getTime());\n\t\t\tdate1.setHours( 0 );\n\t\t\treturn date - date1;\n\t\t};\n\t\tvar y = date.getFullYear() + \"\";\n\t\tvar M = date.getMonth() + 1;\n\t\tvar d = date.getDate();\n\t\tvar D = getDayOfYear(date);\n\t\tvar E = date.getDay();\n\t\tvar H = date.getHours();\n\t\tvar m = date.getMinutes();\n\t\tvar s = date.getSeconds();\n\t\tvar w = getWeekOfYear(date);\n\t\tvar W = getWeekOfMonth(date);\n\t\tvar F = Math.floor( date.getDate() / 7 ) + 1;\n\t\tvar Q = Math.ceil( ( date.getMonth() + 1 ) / 3 );\n\t\tvar era = date.getFullYear() < 1 ? 0 : 1;\n\t\tvar values = {\n\t\t\t\"y\": \"\" + y,\n\t\t\t\"yyyy\": y,\n\t\t\t\"yy\": y.substring(2,4),\n\t\t\t\"L\": M,\n\t\t\t\"LL\": zeroPad(M),\n\t\t\t\"LLL\": this.locales.month_names_abbreviated[M - 1],\n\t\t\t\"LLLL\": this.locales.month_names[M - 1],\n\t\t\t\"LLLLL\": this.locales.month_names_narrow[M - 1],\n\t\t\t\"M\": M,\n\t\t\t\"MM\": zeroPad(M),\n\t\t\t\"MMM\": this.locales.month_names_abbreviated[M - 1],\n\t\t\t\"MMMM\": this.locales.month_names[M - 1],\n\t\t\t\"MMMMM\": this.locales.month_names_narrow[M - 1],\n\t\t\t\"d\": d,\n\t\t\t\"dd\": zeroPad(d),\n\t\t\t\"D\": D,\n\t\t\t\"DD\": D,\n\t\t\t\"DDD\": D,\n\t\t\t\"A\": Math.round( getMillisecondsInDay(date) * Math.pow( 10, -2 ) ),\n\t\t\t\"AA\": Math.round( getMillisecondsInDay(date) * Math.pow( 10, -1 ) ),\n\t\t\t\"AAA\": Math.round( getMillisecondsInDay(date) * Math.pow( 10, 0 ) ),\n\t\t\t\"AAAA\": Math.round( getMillisecondsInDay(date) * Math.pow( 10, 1 ) ),\n\t\t\t\"AAAAA\": Math.round( getMillisecondsInDay(date) * Math.pow( 10, 2 ) ),\n\t\t\t\"AAAAAA\": Math.round( getMillisecondsInDay(date) * Math.pow( 10, 3 ) ),\n\t\t\t\"E\": this.locales.day_names_abbreviated[E],\n\t\t\t\"EE\": this.locales.day_names_abbreviated[E],\n\t\t\t\"EEE\": this.locales.day_names_abbreviated[E],\n\t\t\t\"EEEE\": this.locales.day_names[E],\n\t\t\t\"EEEEE\": this.locales.day_names_narrow[E],\n\t\t\t\"EEEEEE\": this.locales.day_names_short[E],\n\t\t\t\"e\": E,\n\t\t\t\"ee\": E,\n\t\t\t\"eee\": this.locales.day_names_abbreviated[E],\n\t\t\t\"eeee\": this.locales.day_names[E],\n\t\t\t\"eeeee\": this.locales.day_names_narrow[E],\n\t\t\t\"eeeeee\": this.locales.day_names_short[E],\n\t\t\t\"c\": E,\n\t\t\t\"cc\": E,\n\t\t\t\"ccc\": this.locales.day_names_abbreviated[E],\n\t\t\t\"cccc\": this.locales.day_names[E],\n\t\t\t\"ccccc\": this.locales.day_names_narrow[E],\n\t\t\t\"cccccc\": this.locales.day_names_short[E],\n\t\t\t\"F\": F,\n\t\t\t\"G\": this.locales.era_names_abbreviated[era],\n\t\t\t\"GG\": this.locales.era_names_abbreviated[era],\n\t\t\t\"GGG\": this.locales.era_names_abbreviated[era],\n\t\t\t\"GGGG\": this.locales.era_names[era],\n\t\t\t\"GGGGG\": this.locales.era_names_narrow[era],\n\t\t\t\"Q\": Q,\n\t\t\t\"QQ\": zeroPad(Q),\n\t\t\t\"QQQ\": this.locales.quarter_names_abbreviated[Q - 1],\n\t\t\t\"QQQQ\": this.locales.quarter_names[Q - 1],\n\t\t\t\"QQQQQ\": this.locales.quarter_names_narrow[Q - 1],\n\t\t\t\"q\": Q,\n\t\t\t\"qq\": zeroPad(Q),\n\t\t\t\"qqq\": this.locales.quarter_names_abbreviated[Q - 1],\n\t\t\t\"qqqq\": this.locales.quarter_names[Q - 1],\n\t\t\t\"qqqqq\": this.locales.quarter_names_narrow[Q - 1],\n\t\t\t\"H\": H,\n\t\t\t\"HH\": zeroPad(H),\n\t\t\t\"h\": H == 0 ? 12 : H > 12 ? H - 12 : H,\n\t\t\t\"hh\": zeroPad(H == 0 ? 12 : H > 12 ? H - 12 : H),\n\t\t\t\"K\": H > 11 ? H - 12 : H,\n\t\t\t\"k\": H + 1,\n\t\t\t\"KK\": zeroPad(H > 11 ? H - 12 : H),\n\t\t\t\"kk\": zeroPad(H + 1),\n\t\t\t\"a\": H > 11 ? this.locales.day_periods.pm : this.locales.day_periods.am,\n\t\t\t\"m\": m,\n\t\t\t\"mm\": zeroPad(m),\n\t\t\t\"s\": s,\n\t\t\t\"ss\": zeroPad(s),\n\t\t\t\"w\": w,\n\t\t\t\"ww\": zeroPad(w),\n\t\t\t\"W\": W,\n\t\t};\n\t\treturn format.replace(\n\t\t\t/('[^']+'|y{1,4}|L{1,5}|M{1,5}|c{1,6}|d{1,2}|D{1,3}|E{1,6}|e{1,6}|F{1,1}|G{1,5}|Q{1,5}|q{1,5}|H{1,2}|h{1,2}|K{1,2}|k{1,2}|m{1,2}|s{1,2}|w{1,2}|W{1,1}|A{1,6})/g,\n\t\t\tfunction (mask) {\n\t\t\t\treturn mask.charAt(0) === \"'\" ? mask.substr(1, mask.length - 2) : values[mask] || mask;\n\t\t\t}\n\t\t);\n\t} // end formatDate()\n\n\t/**\n\t *\tcreateDateFromFormat( format_string, date_string )\n\t *\n\t *\tThis function takes a date string and a format string. It matches\n\t *\tIf the date string matches the format string, it returns the\n\t *\tthe date object. If it does not match, it returns null.\n\t */\n\tDatepicker.prototype.createDateFromFormat = function(format, value) {\n\t\tvar extractInteger = function(str, pos, minlength, maxlength) {\n\t\t\tfor (var x = maxlength; x >= minlength; x--) {\n\t\t\t\tvar integer = str.substring(pos, pos + x);\n\t\t\t\tif (integer.length < minlength) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (/^\\d+$/.test(integer)) {\n\t\t\t\t\treturn integer;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t};\n\t\tvar skipName = function(names, pos) {\n\t\t\tfor (var i = 0; i < names.length; i++) {\n\t\t\t\tvar name = names[i];\n\t\t\t\tif (value.substring(pos, pos + name.length).toLowerCase() == name.toLowerCase()) {\n\t\t\t\t\treturn name.length;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0;\n\t\t};\n\t\tvar pos = 0;\n\t\tvar now = new Date();\n\t\tvar year = now.getYear();\n\t\tvar month = now.getMonth() + 1;\n\t\tvar date = 1;\n\t\tvar hh = 0;\n\t\tvar mm = 0;\n\t\tvar ss = 0;\n\t\tvar ampm = \"\";\n\t\tvar self = this;\n\n\t\t$.each(format.match(/(.).*?\\1*/g), function(k, token) {\n\t\t\t// Extract contents of value based on format token\n\t\t\tswitch (token) {\n\t\t\t\tcase 'yyyy':\n\t\t\t\t\tyear = extractInteger(value, pos, 4, 4);\n\t\t\t\t\tif (year != null) {\n\t\t\t\t\t\tpos += year.length;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'yy':\n\t\t\t\t\tyear = extractInteger(value, pos, 2, 2);\n\t\t\t\t\tif (year != null) {\n\t\t\t\t\t\tpos += year.length;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\tyear = extractInteger(value, pos, 2, 4);\n\t\t\t\t\tif (year != null) {\n\t\t\t\t\t\tpos += year.length;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MMM':\n\t\t\t\tcase 'LLL':\n\t\t\t\t\tmonth = 0;\n\t\t\t\t\tfor (var i = 0; i < self.locales.month_names_abbreviated.length; i++) {\n\t\t\t\t\t\tvar month_name = self.locales.month_names_abbreviated[i];\n\t\t\t\t\t\tif (value.substring(pos, pos + month_name.length).toLowerCase() == month_name.toLowerCase()) {\n\t\t\t\t\t\t\tmonth = i + 1;\n\t\t\t\t\t\t\tpos += month_name.length;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MMMM':\n\t\t\t\tcase 'LLLL':\n\t\t\t\t\tmonth = 0;\n\t\t\t\t\tfor (var i = 0; i < self.locales.month_names.length; i++) {\n\t\t\t\t\t\tvar month_name = self.locales.month_names[i];\n\t\t\t\t\t\tif (value.substring(pos, pos + month_name.length).toLowerCase() == month_name.toLowerCase()) {\n\t\t\t\t\t\t\tmonth = i + 1;\n\t\t\t\t\t\t\tpos += month_name.length;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'EEE':\n\t\t\t\tcase 'EE':\n\t\t\t\tcase 'E':\n\t\t\t\tcase 'eee':\n\t\t\t\t\tpos += skipName(self.locales.day_names_abbreviated, pos);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'EEEE':\n\t\t\t\tcase 'eeee':\n\t\t\t\tcase 'cccc':\n\t\t\t\t\tpos += skipName(self.locales.day_names, pos);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'EEEEEE':\n\t\t\t\tcase 'eeeeee':\n\t\t\t\tcase 'cccccc':\n\t\t\t\t\tpos += skipName(self.locales.day_names_short, pos);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'MM':\n\t\t\t\tcase 'M':\n\t\t\t\tcase 'LL':\n\t\t\t\tcase 'L':\n\t\t\t\t\tmonth = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (month == null || (month < 1) || (month > 12)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += month.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dd':\n\t\t\t\tcase 'd':\n\t\t\t\t\tdate = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (date == null || (date < 1) || (date > 31)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += date.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'hh':\n\t\t\t\tcase 'h':\n\t\t\t\t\thh = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (hh == null || (hh < 1) || (hh > 12)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += hh.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'HH':\n\t\t\t\tcase 'H':\n\t\t\t\t\thh = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (hh == null || (hh < 0) || (hh > 23)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += hh.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'KK':\n\t\t\t\tcase 'K':\n\t\t\t\t\thh = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (hh == null || (hh < 0) || (hh > 11)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += hh.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'kk':\n\t\t\t\tcase 'k':\n\t\t\t\t\thh = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (hh == null || (hh < 1) || (hh > 24)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += hh.length;\n\t\t\t\t\thh--;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'mm':\n\t\t\t\tcase 'm':\n\t\t\t\t\tmm = extractInteger(value,pos,token.length,2);\n\t\t\t\t\tif (mm == null || (mm < 0) || (mm > 59)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += mm.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ss':\n\t\t\t\tcase 's':\n\t\t\t\t\tss = extractInteger(value, pos, token.length, 2);\n\t\t\t\t\tif (ss == null || (ss < 0) || (ss > 59)){\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tpos += ss.length;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'a':\n\t\t\t\t\tvar amlength = self.locales.day_periods.am.length;\n\t\t\t\t\tvar pmlength = self.locales.day_periods.pm.length;\n\t\t\t\t\tif (value.substring(pos, pos + amlength) == self.locales.day_periods.am) {\n\t\t\t\t\t\tampm = \"AM\";\n\t\t\t\t\t\tpos += amlength;\n\t\t\t\t\t} else if (value.substring(pos, pos + pmlength) == self.locales.day_periods.pm) {\n\t\t\t\t\t\tampm = \"PM\";\n\t\t\t\t\t\tpos += pmlength;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (value.substring(pos, pos + token.length) != token) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpos += token.length;\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// If there are any trailing characters left in the value, it doesn't match\n\t\tif (pos != value.length) {\n\t\t\treturn null;\n\t\t}\n\t\tif (year == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (year.length == 2) {\n\t\t\tif (year > 50) {\n\t\t\t\tyear = 1900 + (year - 0);\n\t\t\t} else {\n\t\t\t\tyear = 2000 + (year - 0);\n\t\t\t}\n\t\t}\n\t\t// Is date valid for month?\n\t\tif ((month < 1) || (month > 12)) {\n\t\t\treturn null;\n\t\t}\n\t\tif (month == 2) {\n\t\t\t// Check for leap year\n\t\t\tif ( ( (year % 4 == 0) && (year % 100 != 0) ) || (year % 400 == 0) ) { // leap year\n\t\t\t\tif (date > 29) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (date > 28) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ((month == 4) || (month == 6) || (month == 9) || (month==11)) {\n\t\t\tif (date > 30) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t// Correct hours value\n\t\tif (hh < 12 && ampm == \"PM\") {\n\t\t\thh = hh - 0 + 12;\n\t\t} else if (hh > 11 && ampm == \"AM\") {\n\t\t\thh -= 12;\n\t\t}\n\t\treturn new Date(year, month - 1, date, hh, mm, ss);\n\t} // end createDateFromFormat()\n\n\t/**\n\t *\tparseDate() is a member function which parse a date string.\n\t *\n\t *\tThis function takes a date string and try to parse it with the input formats.\n\t *\tIf the date string matches one of the format string, it returns the\n\t *\tthe date object. Otherwise, it returns null.\n\t *\n\t *\t@param (value string) the date string\n\t *\t@return a date objet or null\n\t */\n\tDatepicker.prototype.parseDate = function(value) {\n\t\tvar date = null;\n\t\tvar self = this;\n\t\t$.each(this.options.inputFormat, function (i, format) {\n\t\t\tdate = self.createDateFromFormat(format, value);\n\t\t\tif (date != null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif (date == null) { // last try with the output format\n\t\t\tdate = self.createDateFromFormat(this.options.outputFormat, value);\n\t\t}\n\t\treturn date;\n\t} // end parseDate()\n\n\t/**\n\t *\tmin() is a public member function which allow change the smallest selectable date.\n\t *\n\t *\t@param (value string) the new date\n\t *\t@return the smallest selectable date\n\t */\n\tDatepicker.prototype.min = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.min = value instanceof Date ? value : this.parseDate(value);\n\t\t\tif (this.options.min != null && this.dateObj < this.options.min) {\n\t\t\t\tthis.$target.attr('aria-invalid', true);\n\t\t\t\tthis.$target.parents('.form-group').addClass('has-error');\n\t\t\t\tthis.dateObj = this.options.min;\n\t\t\t}\n\t\t\tif (this.options.inline != false) {\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t}\n\t\treturn this.options.min;\n\t} // end min()\n\n\t/**\n\t *\tmax() is a public member function which allow change the biggest selectable date.\n\t *\n\t *\t@param (value string) the new date\n\t *\t@return the biggest selectable date\n\t */\n\tDatepicker.prototype.max = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.max = value instanceof Date ? value : this.parseDate(value);\n\t\t\tif (this.options.max != null && this.dateObj > this.options.max) {\n\t\t\t\tthis.$target.attr('aria-invalid', true);\n\t\t\t\tthis.$target.parents('.form-group').addClass('has-error');\n\t\t\t\tthis.dateObj = this.options.max;\n\t\t\t}\n\t\t\tif (this.options.inline != false) {\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t}\n\t\treturn this.options.max;\n\t} // end max()\n\n\t/**\n\t *\ttheme() is a public member function which allow change the datepicker theme.\n\t *\n\t *\t@param (value string) the new theme\n\t *\t@return the datepicker theme\n\t */\n\tDatepicker.prototype.theme = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.$button.removeClass(this.options.theme);\n\t\t\tthis.$calendar.removeClass(this.options.theme);\n\t\t\tthis.options.theme = value;\n\t\t\tthis.$button.addClass(this.options.theme);\n\t\t\tthis.$calendar.addClass(this.options.theme);\n\t\t}\n\t\treturn this.options.theme;\n\t} // end theme()\n\n\t/**\n\t *\tfirstDayOfWeek() is a public member function which allow change the first Day Of Week.\n\t *\n\t *\t@param (value integer) the new first Day Of Week\n\t *\t@return the first Day Of Week\n\t */\n\tDatepicker.prototype.firstDayOfWeek = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.firstDayOfWeek = parseInt(value, 10);\n\t\t\tif (this.options.inline == false) {\n\t\t\t\tthis.drawCalendarHeader();\n\t\t\t} else {\n\t\t\t\tthis.refresh();\n\t\t\t}\n\t\t}\n\t\treturn this.options.firstDayOfWeek;\n\t} // end firstDayOfWeek()\n\n\t/**\n\t *\tdaysOfWeekDisabled() is a public member function which allow disabling of some weekdays.\n\t *\n\t *\t@param (value string) the new disabled week days\n\t *\t@return the disabled week days\n\t */\n\tDatepicker.prototype.daysOfWeekDisabled = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.daysOfWeekDisabled = [];\n\t\t\tif (! $.isArray(value)) {\n\t\t\t\tvalue = [value];\n\t\t\t}\n\t\t\tvar self = this;\n\t\t\t$.each(value, function(i, val) {\n\t\t\t\tif (typeof val === 'number') {\n\t\t\t\t\tself.options.daysOfWeekDisabled.push(val);\n\t\t\t\t} else if (typeof val === 'string') {\n\t\t\t\t\tself.options.daysOfWeekDisabled.push(parseInt(val, 10));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn this.options.daysOfWeekDisabled;\n\t} // end daysOfWeekDisabled()\n\n\t/**\n\t *\tweekDayFormat() is a public member function which allow change the format of weekdays name.\n\t *\n\t *\t@param (value string) the new format. Allowed : 'short' or 'narrow'\n\t *\t@return the format of weekdays name\n\t */\n\tDatepicker.prototype.weekDayFormat = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.weekDayFormat = value;\n\t\t\tthis.drawCalendarHeader();\n\t\t}\n\t\treturn this.options.weekDayFormat;\n\t} // end weekDayFormat()\n\n\t/**\n\t *\tinputFormat() is a public member function which allow change the input format.\n\t *\n\t *\t@param (value string) the new format\n\t *\t@return the input format\n\t */\n\tDatepicker.prototype.inputFormat = function(value) {\n\t\tif (value != null) {\n\t\t\tif (! $.isArray(value)) {\n\t\t\t\tvalue = [value];\n\t\t\t}\n\t\t\tif (this.$target.attr('placeholder') == this.options.inputFormat[0]) {\n\t\t\t\tthis.$target.attr('placeholder', value[0]);\n\t\t\t}\n\t\t\tthis.options.inputFormat = value;\n\t\t}\n\t\treturn this.options.inputFormat;\n\t} // end inputFormat()\n\n\t/**\n\t *\toutputFormat() is a public member function which allow change the output format.\n\t *\n\t *\t@param (value string) the new format\n\t *\t@return the output format\n\t */\n\tDatepicker.prototype.outputFormat = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.outputFormat = value;\n\t\t}\n\t\treturn this.options.outputFormat;\n\t} // end outputFormat()\n\n\t/**\n\t *\tmodal() is a public member function which allow to set or unset the modal mode.\n\t *\n\t *\t@param (value boolean) the new modal mode\n\t *\t@return the modal mode\n\t */\n\tDatepicker.prototype.modal = function(value) {\n\t\tif (value != null) {\n\t\t\tthis.options.modal = value;\n\t\t\tif (this.options.modal == true) {\n\t\t\t\tif (this.options.inline == false) {\n\t\t\t\t\tthis.showObject(this.$calendar.find('.datepicker-close-wrap'));\n\t\t\t\t\tthis.showObject(this.$calendar.find('.datepicker-bn-close-label'));\n\t\t\t\t}\n\t\t\t\tthis.$close = this.$calendar.find('.datepicker-close');\n\t\t\t\tthis.$close.html(this.options.closeButtonTitle).attr('title', this.options.closeButtonLabel);\n\t\t\t\tthis.$calendar.find('.datepicker-bn-close-label').html(this.options.closeButtonLabel);\n\t\t\t\tvar self = this;\n\t\t\t\tthis.$close.click(function(e) {\n\t\t\t\t\treturn self.handleCloseClick(e);\n\t\t\t\t});\n\t\t\t\tthis.$close.keydown(function(e) {\n\t\t\t\t\treturn self.handleCloseKeyDown(e);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.hideObject(this.$calendar.find('.datepicker-close-wrap'));\n\t\t\t\tthis.hideObject(this.$calendar.find('.datepicker-bn-close-label'));\n\t\t\t}\n\t\t}\n\t\treturn this.options.modal;\n\t} // end modal()\n\n\t/**\n\t *\tinline() is a public member function which allow to set or unset the inline mode.\n\t *\n\t *\t@param (value string or false) the id or jquery object of the datepicker container, false otherwise (not inline)\n\t *\t@return the given value\n\t */\n\tDatepicker.prototype.inline = function(value) {\n\t\tif (value != null) {\n\t\t\tif (value != false) {\n\t\t\t\tthis.hideObject(this.$button);\n\t\t\t\tthis.hideObject(this.$calendar.find('.datepicker-close-wrap'));\n\t\t\t\tthis.hideObject(this.$calendar.find('.datepicker-bn-close-label'));\n\t\t\t\tvar $container = typeof value === 'string' ? $('#' + value) : value;\n\t\t\t\t$container.append(this.$calendar);\n\t\t\t\tthis.$calendar.css({position: 'relative', left: '0px', top: '0px'});\n\t\t\t\tthis.options.inline = value;\n\t\t\t\tthis.initializeDate();\n\t\t\t\tthis.showObject(this.$calendar);\n\t\t\t} else {\n\t\t\t\tthis.$target.parent().after(this.$calendar);\n\t\t\t\tthis.showObject(this.$button);\n\t\t\t\tif (this.options.modal == true) {\n\t\t\t\t\tthis.showObject(this.$calendar.find('.datepicker-close-wrap'));\n\t\t\t\t\tthis.showObject(this.$calendar.find('.datepicker-bn-close-label'));\n\t\t\t\t}\n\t\t\t\tif (this.$calendar.parent().css('position') === 'static') {\n\t\t\t\t\tthis.$calendar.parent().css('position', 'relative');\n\t\t\t\t}\n\t\t\t\tthis.$calendar.css({position: 'absolute'});\n\t\t\t\tthis.options.inline = value;\n\t\t\t\tthis.hide();\n\t\t\t}\n\t\t}\n\t\treturn this.options.inline;\n\t} // end inline()\n\n\n\t/**\n\t *\tformat() is a public member function to format a date according the output format.\n\t *\n\t *\t@param (value date object) the date\n\t *\t@return formatted date string\n\t */\n\tDatepicker.prototype.format = function(date) {\n\t\treturn this.formatDate(date, this.options.outputFormat);\n\t} // end format()\n\n\t/**\n\t *\tsetLocales() is a public member function which allow change the locales.\n\t *\n\t *\t@param (value obj) the new locales\n\t *\t@return N/A\n\t */\n\tDatepicker.prototype.setLocales = function(value) {\n\t\tthis.locales = value;\n\t\tthis.options.inputFormat = [this.locales.short_format];\n\t\tthis.options.outputFormat = this.locales.short_format;\n\t\tthis.options.titleFormat = this.locales.full_format,\n\t\tthis.options.firstDayOfWeek = this.locales.firstday_of_week;\n\t\tthis.options.buttonTitle = this.locales.texts.buttonTitle;\n\t\tthis.$button.find('span').attr('title', this.options.buttonTitle);\n\t\tthis.options.buttonLabel = this.locales.texts.buttonLabel;\n\t\tthis.options.prevButtonLabel = this.locales.texts.prevButtonLabel;\n\t\tthis.options.prevMonthButtonLabel = this.locales.texts.prevMonthButtonLabel;\n\t\tthis.options.prevYearButtonLabel = this.locales.texts.prevYearButtonLabel;\n\t\tthis.options.nextButtonLabel = this.locales.texts.nextButtonLabel;\n\t\tthis.options.nextMonthButtonLabel = this.locales.texts.nextMonthButtonLabel;\n\t\tthis.options.nextYearButtonLabel = this.locales.texts.nextYearButtonLabel;\n\t\tthis.options.changeMonthButtonLabel = this.locales.texts.changeMonthButtonLabel;\n\t\tthis.options.changeYearButtonLabel = this.locales.texts.changeYearButtonLabel;\n\t\tthis.options.changeRangeButtonLabel = this.locales.texts.changeRangeButtonLabel;\n\t\tthis.options.closeButtonTitle = this.locales.texts.closeButtonTitle;\n\t\tthis.options.closeButtonLabel = this.locales.texts.closeButtonLabel;\n\t\tthis.options.calendarHelp = this.locales.texts.calendarHelp;\n\t\tthis.drawCalendarHeader();\n\t\tif (this.locales.directionality === 'RTL') {\n\t\t\tthis.$grid.addClass('rtl');\n\t\t} else {\n\t\t\tthis.$grid.removeClass('rtl');\n\t\t}\n\t} // end outputFormat()\n\n\t// DATEPICKER PLUGIN DEFINITION\n\t// ==========================\n\n\tvar old = $.fn.datepicker\n\n\t$.fn.datepicker = function (option, value) {\n\t\tif (typeof option == 'string' && $(this).length == 1) {\n\t\t\tvar data = $(this).eq(0).data('ab.datepicker');\n\t\t\tif (data) return data[option](value);\n\t\t} else {\n\t\t\treturn this.each(function () {\n\t\t\t\tvar $this   = $(this);\n\t\t\t\tvar data    = $this.data('ab.datepicker');\n\t\t\t\tvar options = $.extend({}, Datepicker.DEFAULTS, $this.data(), typeof option == 'object' && option);\n\t\t\t\tif (!data) $this.data('ab.datepicker', (data = new Datepicker(this, options)));\n\t\t\t\tif (typeof option == 'string') data[option](value);\n\t\t\t});\n\t\t}\n\t}\n\n\t$.fn.datepicker.Constructor = Datepicker\n\n\t// DATEPICKER NO CONFLICT\n\t// ====================\n\n\t$.fn.datepicker.noConflict = function () {\n\t\t$.fn.datepicker = old\n\t\treturn this\n\t}\n})(window, jQuery);\n","// Plugin to handle adding fixedsticky for browsers in which 'position: sticky' is not supported (IE11)\n// To see the plugin at work, see the accordion dropdowns on this page in IE:  https://www.mbta.com/fares/bus-fares\n\n;(function( win, $ ) {\n\n\tfunction featureTest( property, value, noPrefixes ) {\n\t\t// Thanks Modernizr! https://github.com/phistuck/Modernizr/commit/3fb7217f5f8274e2f11fe6cfeda7cfaf9948a1f5\n\t\tvar prop = property + ':',\n\t\t\tel = document.createElement( 'test' ),\n\t\t\tmStyle = el.style;\n\n\t\tif( !noPrefixes ) {\n\t\t\tmStyle.cssText = prop + [ '-webkit-', '-moz-', '-ms-', '-o-', '' ].join( value + ';' + prop ) + value + ';';\n\t\t} else {\n\t\t\tmStyle.cssText = prop + value;\n\t\t}\n\t\treturn mStyle[ property ].indexOf( value ) !== -1;\n\t}\n\n\tfunction getPx( unit ) {\n\t\treturn parseInt( unit, 10 ) || 0;\n\t}\n\n\tvar uniqueIdCounter = 0;\n\n\tvar S = {\n\t\tclasses: {\n\t\t\tplugin: 'fixedsticky',\n\t\t\tactive: 'fixedsticky-on',\n\t\t\tinactive: 'fixedsticky-off',\n\t\t\tclone: 'fixedsticky-dummy',\n\t\t\twithoutFixedFixed: 'fixedsticky-withoutfixedfixed'\n\t\t},\n\t\tkeys: {\n\t\t\toffset: 'fixedStickyOffset',\n\t\t\tposition: 'fixedStickyPosition',\n\t\t\tid: 'fixedStickyId'\n\t\t},\n\t\ttests: {\n\t\t\tsticky: featureTest( 'position', 'sticky' ),\n\t\t\tfixed: featureTest( 'position', 'fixed', true )\n\t\t},\n\t\t// Thanks jQuery!\n\t\tgetScrollTop: function() {\n\t\t\tvar prop = 'pageYOffset',\n\t\t\t\tmethod = 'scrollTop';\n\t\t\treturn win ? (prop in win) ? win[ prop ] :\n\t\t\t\twin.document.documentElement[ method ] :\n\t\t\t\twin.document.body[ method ];\n\t\t},\n\t\tbypass: function() {\n\t\t\t// Check native sticky, check fixed and if fixed-fixed is also included on the page and is supported\n\t\t\treturn ( S.tests.sticky && !S.optOut ) ||\n\t\t\t\t!S.tests.fixed ||\n\t\t\t\twin.FixedFixed && !$( win.document.documentElement ).hasClass( 'fixed-supported' );\n\t\t},\n\t\tupdate: function( el ) {\n\t\t\tif( !el.offsetWidth ) { return; }\n\n\t\t\tvar $el = $( el ),\n\t\t\t\theight = $el.outerHeight(),\n\t\t\t\tinitialOffset = $el.data( S.keys.offset ),\n\t\t\t\tscroll = S.getScrollTop(),\n\t\t\t\tisAlreadyOn = $el.is( '.' + S.classes.active ),\n\t\t\t\ttoggle = function( turnOn ) {\n\t\t\t\t\t$el[ turnOn ? 'addClass' : 'removeClass' ]( S.classes.active )\n\t\t\t\t\t\t[ !turnOn ? 'addClass' : 'removeClass' ]( S.classes.inactive );\n\t\t\t\t},\n\t\t\t\tviewportHeight = $( window ).height(),\n\t\t\t\tposition = $el.data( S.keys.position ),\n\t\t\t\tskipSettingToFixed,\n\t\t\t\telTop,\n\t\t\t\telBottom,\n\t\t\t\t$parent = $el.parent(),\n\t\t\t\tparentOffset = $parent.offset().top,\n\t\t\t\tparentHeight = $parent.outerHeight();\n\n\t\t\tif( initialOffset === undefined ) {\n\t\t\t\tinitialOffset = $el.offset().top;\n\t\t\t\t$el.data( S.keys.offset, initialOffset );\n\t\t\t\t$el.after( $( '<div>' ).addClass( S.classes.clone ).height( height ) );\n\t\t\t} else {\n\t\t\t\t$el.next( '.' + S.classes.clone ).height( height );\n\t\t\t}\n\n\t\t\tif( !position ) {\n\t\t\t\t// Some browsers require fixed/absolute to report accurate top/left values.\n\t\t\t\tskipSettingToFixed = $el.css( 'top' ) !== 'auto' || $el.css( 'bottom' ) !== 'auto';\n\n\t\t\t\tif( !skipSettingToFixed ) {\n\t\t\t\t\t$el.css( 'position', 'fixed' );\n\t\t\t\t}\n\n\t\t\t\tposition = {\n\t\t\t\t\ttop: $el.css( 'top' ) !== 'auto',\n\t\t\t\t\tbottom: $el.css( 'bottom' ) !== 'auto'\n\t\t\t\t};\n\n\t\t\t\tif( !skipSettingToFixed ) {\n\t\t\t\t\t$el.css( 'position', '' );\n\t\t\t\t}\n\n\t\t\t\t$el.data( S.keys.position, position );\n\t\t\t}\n\n\t\t\tfunction isFixedToTop() {\n\t\t\t\tvar offsetTop = scroll + elTop;\n\n\t\t\t\t// Initial Offset Top\n\t\t\t\treturn initialOffset < offsetTop &&\n\t\t\t\t\t// Container Bottom\n\t\t\t\t\toffsetTop + height <= parentOffset + parentHeight;\n\t\t\t}\n\n\t\t\tfunction isFixedToBottom() {\n\t\t\t\t// Initial Offset Top + Height\n\t\t\t\treturn initialOffset + ( height || 0 ) > scroll + viewportHeight - elBottom &&\n\t\t\t\t\t// Container Top\n\t\t\t\t\tscroll + viewportHeight - elBottom >= parentOffset + ( height || 0 );\n\t\t\t}\n\n\t\t\telTop = getPx( $el.css( 'top' ) );\n\t\t\telBottom = getPx( $el.css( 'bottom' ) );\n\n\t\t\tif( position.top && isFixedToTop() || position.bottom && isFixedToBottom() ) {\n\t\t\t\tif( !isAlreadyOn ) {\n\t\t\t\t\ttoggle( true );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif( isAlreadyOn ) {\n\t\t\t\t\ttoggle( false );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdestroy: function( el ) {\n\t\t\tvar $el = $( el );\n\t\t\tif (S.bypass()) {\n\t\t\t\treturn $el;\n\t\t\t}\n\n\t\t\treturn $el.each(function() {\n\t\t\t\tvar $this = $( this );\n\t\t\t\tvar id = $this.data( S.keys.id );\n\t\t\t\t$( win ).unbind( '.fixedsticky' + id );\n\n\t\t\t\t$this\n\t\t\t\t\t.removeData( [ S.keys.offset, S.keys.position, S.keys.id ] )\n\t\t\t\t\t.removeClass( S.classes.active )\n\t\t\t\t\t.removeClass( S.classes.inactive )\n\t\t\t\t\t.next( '.' + S.classes.clone ).remove();\n\t\t\t});\n\t\t},\n\t\tinit: function( el ) {\n\t\t\tvar $el = $( el );\n\n\t\t\tif( S.bypass() ) {\n\t\t\t\treturn $el;\n\t\t\t}\n\n\t\t\treturn $el.each(function() {\n\t\t\t\tvar _this = this;\n\t\t\t\tvar id = uniqueIdCounter++;\n\t\t\t\t$( this ).data( S.keys.id, id );\n\n\t\t\t\t$( win ).bind( 'scroll.fixedsticky' + id, function() {\n\t\t\t\t\tS.update( _this );\n\t\t\t\t}).trigger( 'scroll.fixedsticky' + id );\n\n\t\t\t\t$( win ).bind( 'resize.fixedsticky' + id , function() {\n\t\t\t\t\tif( $el.is( '.' + S.classes.active ) ) {\n\t\t\t\t\t\tS.update( _this );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t};\n\n\twin.FixedSticky = S;\n\n\t// Plugin\n\t$.fn.fixedsticky = function( method ) {\n\t\tif ( typeof S[ method ] === 'function') {\n\t\t\treturn S[ method ].call( S, this);\n\t\t} else if ( typeof method === 'object' || ! method ) {\n\t\t\treturn S.init.call( S, this );\n\t\t} else {\n\t\t\tthrow new Error( 'Method `' +  method + '` does not exist on jQuery.fixedsticky' );\n\t\t}\n\t};\n\n\t// Add fallback when fixed-fixed is not available.\n\tif( !win.FixedFixed ) {\n\t\t$( win.document.documentElement ).addClass( S.classes.withoutFixedFixed );\n\t}\n\n})( window, jQuery );\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","__webpack_require__.amdD = function () {\n\tthrow new Error('define cannot be used indirect');\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 143;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkdotcom\"] = globalThis[\"webpackChunkdotcom\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [216,514], () => (__webpack_require__(49164)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","leafPrototypes","getProto","exports","channelId","includes","joinChannel","handleJoin","window","socket","channels","channel","state","join","receive","_a","reason","console","error","errorEvent","CustomEvent","detail","document","dispatchEvent","event","log","isVehicleChannel","split","route_id","direction_id","push","on","data","onError","baseChannel","leaveChannel","id","off","leave","phoenix_1","onClose","type","wasClean","location","reload","connect","addEventListener","querySelectorAll","forEach","el","getAttribute","Object","keys","hideAlert","containerEl","setAttribute","dismissEl","querySelector","e","handleNativeEnterKeyPress","undoOutline","this","style","outline","toggleAriaExpanded","toggleMenu","TOGGLE_NAMES","mobile","search","desktop","TOGGLE_SELECTORS","fromEntries","entries","map","key","name","allTogglesSelector","values","setHeaderElementPositions","header","rootElement","getBoundingClientRect","bottom","height","bottomPx","heightPx","top","content","cover","setup","clearAllBodyScrollLocks","toggle","preventDefault","currentTarget","openAccordion","toggledMobileMenuObserver","MutationObserver","mobileMenuToggle","dataset","scrollTop","innerHTML","focus","expandedMenuObserver","mutations","observedDataAttributes","m","target","nav","aMenuIsBeingExpanded","undefined","find","oldValue","navOpen","disableBodyScroll","searchOpen","Array","from","reserveScrollBarGap","paddingRight","body","width","thisMenu_1","filter","observe","attributes","attributeFilter","attributeOldValue","menuContent","matchMedia","matches","expandedDrawerId","expandedDrawer","targetBB","yOffset","bb","y","targetY","offsetTop","scrollTo","behavior","left","menu_links","i","length","resetPage","handleNativeEscapeKeyPress","closeAllMenus","documentElement","passive","callback","delay","timerId","_i","args","clearTimeout","Promise","resolve","setTimeout","timer","r","result","isFetchFailed","Error","fetch","resp","ok","json","fetchJson","then","cb","isEnter","keyCode","isEscape","mediaBreakpoints","params","encoder","query","decoder","substring","reduce","kvString","val","replace","queryReducer","str","text","spans","parts","cursor","span","offset","slice","sentry","Sentry","init","dsn","environment","beforeSend","autoSessionTracking","sampleRate","initialScope","tags","beforeBreadcrumb","breadcrumb","url","contains","ignoreErrors","denyUrls","tagName","captureMessage","src","href","setupAccordion","accordion","accordionHeaders","toggleItem","isOpen","btn","_this","toString","btnIndex","btnList","code","call","newValue","wrapperEl","parentElement","addAccordionToggleObserver","isStopItem","x","isRouteItem","item","_highlightResult","isLGDown","to_search_page","Turbolinks","visit","initialItem","urlType","omit","urls","reactRenderer","createElement","Fragment","render","wrapper","container","panelContainer","searchParams","autocompleteApi","options","detachedMediaQuery","classNames","input","initialState","parseQuery","decodeURIComponent","address","openOnFocus","onStateChange","helpers_1","stateChangeListener","onSubmit","submitHandler","placeholder","plugins","renderer","autocomplete","setIsOpen","debouncePromise","items","geolocation","popularLocations","locationsCount","locationsUrlType","algolia","numberOfLocations","parseInt","algoliaIndexes","unshift","getSources","sourceId","templates","algolia_1","getItems","debounced","method","headers","JSON","stringify","algoliaQuery","res","results","flatMap","hits","index","hit","__assign","numResults","location_1","fetchJsonOrThrow","encodeURIComponent","itemWithUrl","popular_1","LinkForItem","props","children","isContentItem","_content_url","highlightedResult","get","getTitleAttribute","matchedWords","urlToQuery","react_1","className","components","attribute","featureIcons","getFeatureIcons","iconHtml","contentIcon","getIcon","dangerouslySetInnerHTML","__html","feature","uniqueId","Highlight","route","GeolocationComponent","useState","loading","setLoading","hasError","setHasError","textAlign","host","onClick","stopPropagation","position","latlon","pick","coords","URLSearchParams","goToPositionURL","catch","highlighted_spans","highlightText","getPopularIcon","icon","SELECTORS","TEMPLATES","fontAwesomeIcon","hogan","formattedDate","locations","usemylocation","threePlusIcons","default","TEMPLATES_ALT_USE_MY_LOCATION","iconsFromGTFSAncestries","ancestries","anc","toLowerCase","Icons","_subwayRouteIcon","routeId","Green","Red","Orange","Blue","Mattapan","iconFromGTFSId","toSubway","iconFromGTFS","ancestry","icons","isArray","iconsFromGTFSIds","concat","iconsFromGTFSAncestry","search_api_datasource","_file_type","_fileIcon","search_result","news_entry","project","project_update","page","landing_page","person","_content_type","stop","_getStopOrStationIcon","startsWith","_iconFromRoute","related_transit_gtfs_id","related_transit_gtfs_ancestry","_","getTransitIcons","getUrl","_file_uri","_search_result_url","_contentUrl","getTitle","value","long_name","getRouteTitle","search_result_title","file_name_raw","content_title","_contentTitle","_getAlertIcon","hasAlert","stopsWithAlertsDiv","getElementById","stopsWithAlerts","_stopsWithAlerts","routesWithAlertsDiv","routesWithAlerts","_routesWithAlerts","_featuresToIcons","features","_standardizeFeatureName","_formatDate","date","toLocaleDateString","year","month","day","alertFeature","filteredFeatures","allIcons","featuresWithoutBranches","branches","greenLinePosition","findIndex","splice","_sortFeatures","zoneIcon","zone","_getCommuterRailZone","_stopIcons","_content_posted_on","Date","projectsDate","_file_created","pagesdocumentsDate","dateString","dateStringWithTime","err","_contentDate","parseResult","assign","hitIcon","hitUrl","hitTitle","hasDate","hitFeatureIcons","renderResult","arguments","parsedResult","track","dataLayer","samePathWithQueryString","first","second","samePath","path","suffix_char","withAnchor","urlString","getCurrentUrl","protocol","pathname","focusAndExpand","$","nodeName","a","hash","collapse","w","doc","lastScrollPosition","scrollBehavior","redirectTimeout","navigationEventType","currentUrl","ev","match","scrollX","scrollY","srcElement","activeElement","scroll","apply","refreshHeader","xhr","getResponseHeader","refreshUrl","indexOf","refreshDelay","handleModeChangeSelection","modeOptionsEl","modeOptions","parse","vehicleLabels","bus","commuter_rail","subway","ferry","hide","empty","routeSelect","selectedOptions","selectedIndex","innerText","opts","show","option","appendChild","element","opt","clearFallbacks","$photoLink","$photoInput","removeAttr","click","setupPhotoPreviews","toUpload","$container","change","file","files","resizeAndHandleUploadedFile","test","resizeImage","newFile","hideOrShowPreviews","preview","PhotoPreview","addClickHandler","div","append","handleUploadedPhoto","addClass","displayError","html","reject","fr","FileReader","onerror","abort","DOMException","onload","img","Image","dim","maxDim","ratio","rescale","canvas","getContext","drawImage","msToBlob","toBlob","blob","readAsDataURL","removeClass","require","$div","reader","onloadend","remove","setupTextArea","commentsNode","formTextNode","node","nextElementSibling","findSiblingWithClass","commentLength","parentNode","setupSubject","support_service_opts","selectedCategory","nextAll","setupRequestResponse","is","validators","comments","support_subject","subject","service","first_name","responseRequested","last_name","email","trim","privacy","prop","recaptcha","vehicle","checked","setupValidation","selector","displaySuccess","parent","reactivateSubmitButton","attr","trigger","handleSubmitClick","FormData","valid","errors","focusError","validateForm","errorDisplay","errorList","createTextNode","li","classList","add","deactivateSubmitButton","formData","Filter","serializeArray","_ref","clean","encodedSubjectValue","set","photo","ajax","processData","contentType","success","errorString","errorObject","extra","errorStatus","handleSubjectChange","beforeVisit","clickHandler","navigator","$btn","$el","geolocationTarget","locationButton","$errorEl","$indicator","toggleLoadingIndicator","getCurrentPosition","locationHandler","TIMEOUT","POSITION_UNAVAILABLE","PERMISSION_DENIED","locationError","validateLocationForm","sParam","search_string","sURLVariables","sParameterName","getUrlParameter","geolocationCallback","qs","latitude","longitude","encodeURI","domMutateCallback","currentLanguage","languages","handleTranslation","getTranslateElement","translateEl","registerEvents","_err","pollDomForGoogleTranslateEl","getSelectedTranslation","updatedLanguage","setTranslation","language","Event","bubbles","cancelable","createEvent","initEvent","renderCustomSelect","linkEl","triggerClick","registerLinkEvents","which","requestAnimationFrame","initialElToScrollTo","doScrollTo","scrollLeft","offsetLeft","firstSibling","clientWidth","table","sibling","firstChild","nodeType","scrollCallback","adjustTimetableStyle","timetableContainerEl","borderTop","headerEl","resizeRows","toggleScrollButtons","resizeRow","rowEl","offsetHeight","cell","maxScrollLeft","scrollWidth","leftBtnEl","rightBtnEl","removeAttribute","trainLabelRow","trainLabels","tableEl","tableBodyEl","stickyHeaderEl","removedLabels","isStuck","sideScrollStickyHeader","setUp","tableTop","tableBottom","showStickyLabels","right","tableRight","tableWidth","labelEl","fontSize","getComputedStyle","stickyLabelEl","cloneNode","minWidth","maxWidth","removeChild","removeEventListener","resizeStickyHeader","stickyLabels","childNodes","trainLabel","DatePickerInput","constructor","selectors","onUpdateCallback","dateInput","dateEl","dateLabel","label","actualMonth","minAllowedDate","maxAllowedDate","getShortDate","updateDateFormatToShort","bind","updateDateFormatToLong","datepicker","outputFormat","getDateFormatbyMediaQuery","onUpdate","updateDate","min","max","gainFocusOnConstruction","addListener","static","setDatePickerFormat","format","datepickerDate","ariaMessage","updateDateSelects","getFullYear","getMonth","getDate","updateSelect","select","currentOpt","newOpt","substr","TimeControls","resetPlanType","DatePicker","updateControlTitleCallback","timeInput","controlSetup","title","depart","updateControlTitle","arrive","hour","updateTime","minute","amPm","getStateFromQuery","QueryHelpers","formatQueryPlanType","getPlanType","time","hour12","timeLabel","timeEl","setHours","setMinutes","friendlyTime","getFriendlyTime","controlTitle","datetime","getHours","getMinutes","hitLimit","getJSON","done","processAutocompleteResults","fail","lookupPlace","processPlacesCallback","reverseGeocode","processGeocodeCallback","_ref2","predictions","predictionResults","p","nbHits","_ref3","_ref4","parsedResults","formatted","queries","defaultParams","_queries","_activeQueryIds","_defaultParams","_viewMoreInc","_lastQuery","_doBlankSearch","_widgets","errorContainer","reset","widgets","resetDefaultParams","resetWidgets","queryId","addPage","group","hitsPerPage","toggleError","allQueries","_buildAllQueries","_doSearch","updateWidgets","_sendQueries","_processAlgoliaResults","_addAnalyticsData","analyticsData","queryID","objectID","requests","dataType","requestedQueryIds","_buildQuery","currentQuery","clickAnalytics","updateAllParams","updateActiveQueries","queryIds","removeActiveQuery","addActiveQuery","updateFacetFilters","filters","addFacetFilter","removeFacetFilter","updateParams","updateParamsByKey","getParams","addWidget","widget","response","searchedQueries","facetLength","searchResults","facetResults","display","_templates","WeakMap","AlgoliaAutocomplete","indices","AlgoliaResult","_classPrivateFieldInitSpec","writable","containerElement","_parent","_selectors","resultsContainer","_input","getById","_resultsContainer","_searchContainer","_resetButton","resetButton","announcer","_indices","_datasets","_results","_highlightedHit","_autocomplete","_classPrivateFieldSet","onClickSuggestion","onHitSelected","onCursorChanged","onCursorRemoved","onOpen","onKeyup","clear","_toggleResetButton","close","setValue","_client","client","_addResultsContainer","acc","_buildDataset","appendTo","debug","autoselectOnBlur","hint","minLength","cssClasses","root","prefix","_addErrorMsg","_addListeners","resetResetButton","getVal","setError","dropdown","getElementsByClassName","errorMsg","acDialog","positionDropdown","announceResults","borderWidth","css","offsetWidth","marginLeft","marginTop","dialog","count","s","originalEvent","_args","clickHighlightedOrFirstResult","clickFirstResult","firstIndex","post","onHitSelectedCallback","indexName","source","_datasetSource","displayKey","DISPLAY_KEYS","maxLength","suggestion","footer","renderFooterTemplate","debounce","_onResults","_emptySearchSource","setVal","getValue","AlgoliaAutocompleteWithGeo","locationParams","popular","super","debounceInterval","_popular","_loadingIndicator","locationLoadingIndicator","addUseMyLocationErrorEl","_locationParams","DEFAULT_LOCATION_PARAMS","useMyLocationErrorEl","_locationSource","_useMyLocationSource","_popularSource","_doLocationSearch","useMyLocationSearch","disabled","visibility","geolocationPromise","pos","onUseMyLocationResults","onGeolocationError","_onLocationSearchResult","showLocation","parseFloat","onReverseGeocodeResults","addFilterParam","TripPlannerLocControls","toInput","to","fromInput","toLat","lat","toLng","lng","fromLat","fromLng","fromStopId","stop_id","toStopId","controller","toInputDirty","fromInputDirty","markers","toController","Algolia","INDICES","PARAMS","fromController","toAutocomplete","POPULAR","fromAutocomplete","autocompletes","ac","removeMarker","useMyLocation","reverseTrip","setupFormValidation","swapMarkers","resetResetButtons","onInvalidAddress","onAutocompleteShown","onInputReset","onInputChange","missingFrom","missingTo","errorType","required","inputDirty","updateErrorContent","updateMarker","fromVal","toVal","setStopValue","setAutocompleteValue","_geoloc","MapsHelpers","blur","stopIdEl","latEl","lngEl","fromAc","toAc","fromError","toError","stops","facets","facetFilters","galleries","makeGallery","images","figures","imageOffset","pageOffset","lastPage","calculateLastPage","photoCount","Math","ceil","setGalleryImageOffset","lastOffset","handleClickImage","image","activeImage","activeImageName","firstImage","replaceActiveImage","getGalleryImageByOffset","imageByOffset","handleClickNavigation","increment","focusEl","isVisible","setGalleryPageOffset","guid","getTime","floor","random","focusId","main","_el","pop","mainImage","mainCaption","totalImages","lastImage","pagination","imgSource","nodeValue","imgAlt","alt","markUp","firstImg","renderImages","renderNavigation","PAGE_IDS","FACET_MAP","FACET_FILTER_MAP","AlgoliaEmbeddedSearch","pageId","goBtn","onClickGoBtn","addEventListeners","buildSearchParams","showmore","indexNames","routes","pages","LOCATION_PARAMS","AlgoliaWithGeo","bounds","_locationEnabled","_hitLimit","algoliaResults","locationResults","all","resultsList","enableLocationSearch","enabled","FacetItem","textDisplay","_id","checkbox","counter","childrenDiv","checkboxLabel","expansionContainer","checkboxControlContainer","tabToExpand","_children","facetItem","_name","_iconHTML","_facets","_prefix","_count","facet","addToMap","_checkbox","_counter","_textDisplay","_childrenDiv","_icon","_triangleRightIcon","getActiveFacets","child","isChecked","toggleExpansion","gatherElements","_checkboxLabel","setupListeners","check","uncheckUI","uncheck","updateCount","toggleCheck","update","updateState","allChildrenStatus","status","every","sumChildren","total","num","itemStyle","class","iconClass","setupAllListeners","selectedFacetNames","loadFacet","FacetGroup","facetData","_facetMap","_item","updateCounts","getFacetsForQuery","shouldDisableQuery","modifySearch","facetGroupClasses","FacetLocationGroup","FacetBar","_container","_search","_items","_facetPrefixes","_parseFacets","facetName","groupClass","cls","_resetQueries","_selectedFacetsReducer","loadState","AlgoliaFacets","_closeModalBtn","_showFacetsBtn","_facetsContainer","_bind","_faIcon","projects","documents","events","news","_facetBar","onClickCloseModalBtn","onClickShowFacetsBtn","closeModalButton","showFacetsButton","facetsContainer","updateHistory","contentResults","AlgoliaResults","_groups","onClickShowMore","onClickResult","addResultClickHandler","_showLocation","_addLocationListeners","idx","elem","_locationSearch","useLocation","_useMyLocation","_locationSearchByGeo","_addShowMoreListener","groupName","onClickResultCallback","_renderGroup","indexTitles","isLocation","hasHits","showMore","googleLogo","groupData","AlgoliaGlobalSearch","_facetsWidget","_showMoreList","_queryParams","INITIAL_QUERIES","DEFAULT_PARAMS","LATLNGBOUNDS","_resultsWidget","inputField","showMoreState","facetState","history","replaceState","west","north","east","south","emptySpaceForIcon","removeTrain","parentId","tooltipId","stopTooltip","tooltip","removeTooltip","CRTimetableTrainIcons","priorStops","schedules","addOrUpdateTrain","vehicleStruct","stop_name","stopName","marker","tooltip_text","vehicleContainerId","vehicleContainer","addTrain","addOrUpdateTooltip","vehicleTooltip","containerId","vehicleTooltipId","currentTooltip","tooltipVisible","trip_id","stopSequence","stop_sequence","CRTimetableTrains","dataEl","getData","message","schedulesInfo","textContent","stopMap","sched","onVehicles","onRemoveVehicles","teardown","removeEventListeners","d","ITEM_SELECTOR","addAlertItemEventHandlers","alertItem","handleAlertItemClick","handleAlertItemKeyPress","doHandleAlertItemClick","getParentsUntil","batchDomMutations","opened","toggleOpenClass","toggleAriaAttribute","addInternetExplorerPolyfills","Element","prototype","toggleAttribute","force","hasAttribute","stickyfilljs","elements","composedPath","selectButton","button","pslType","locationCards","cardCount","card","cardType","buttonType","pslTypeMatch","psltype","togglePslFilter","csrfToken","Hooks","mounted","setupAlgoliaAutocomplete","liveSocket","LiveSocket","Socket","_csrf_token","hooks","initializeSentry","start","nextTick","f","webkitRequestAnimationFrame","mozRequestAnimationFrame","defineProperty","previousSibling","nextSibling","T","A","k","TypeError","O","len","kValue","mappedValue","toStr","isCallable","fn","maxSafeInteger","pow","toLength","number","Number","isNaN","isFinite","abs","toInteger","arrayLike","C","mapFn","predicate","o","thisArg","CharacterData","hasOwnProperty","configurable","enumerable","SVGElement","msMatchesSelector","webkitMatchesSelector","closest","n","t","l","g","onEvent","siblings","form","parents","action","serialized","serialize","charAt","replacedHash","mergeAction","submitOnEvents","setupGlobalNavigation","handler","extraClass","collapseEvent","modal","turbolinksMods","supportForm","fixedsticky","objectFitImages","inputFocus","geoLocation","transitNearMeInput","tabbedNavSetup","navTabs","contentTabs","tabType","updateTabs","tab","clickedTab","clickedTabContentType","tabContentType","animating","direction","animate","duration","step","timetableScroll","firstLoad","slideUp","slideDown","toggleDatePicker","expand","datePickerEl","displayOnLoad","datePicker","toggleBtn","targetId","clickedLink","toggleClass","link","branch","toggleBranch","stopBubbles","breakpoints","eq","submit","md","$header","$listContainer","hasClass","setupFilterToggleOnMobile","xs","sm","lg","xxl","output","$galleryEl","galleryId","each","_offset","initializeData","handlePageLoad","photoGallery","wasTouchedRecently","lastTouch","timeStamp","hideTooltip","initTooltip","$this","touchStart","touchEnd","pageX","pageY","wasTapped","stickyTooltip","globalSearch","doInit","isProjectsSearch","determineIndex","buildOptions","formDataEl","mbtaIdCookie","cookies","cookieArray","cookie","getCookieFromString","getUniqueId","b","q","_api","async","crossOrigin","_fs_script","getElementsByTagName","insertBefore","identify","v","uid","setUserVars","anonymize","shutdown","restart","consent","identifyAccount","acctId","clearUserCookie","_w","_v","setupChannels","dataEls","dismissFullscreenError","viewPreviousEventsLink","documentMode","dateSelects","eventsListing","control","prevScroll","prevDirection","monthHeaders","stickyStyleTop","curScroll","controlHeight","sections","section","MakeCollapsedHeadersSticky","capture","activeMonthElement","scrollIntoView","setupEventsListing","eventPopups","A11yDialog","hideDialogLogicListener","eventClicked","eventIdClicked","a11yDialogShow","setupEventPopups","pslButtons","setupPslFilterButtons","accordionInit","getFeatureIcon","exceptionsByType","function","module","filename","exceptionsWithMechanism","originalException","exactMessages","partialMessages","patterns","some","msg","pattern","parsedEvent","exception","stacktrace","mechanism","__serialized__","handleUnhandledRejection","eventType","itemValue","itemType","frames","frame","isTrusted","isCulpritUnknown","culprit","request","relativeUrl","version","handleUserPromptedError","win","dp_locales","datepickerButton","datepickerCalendar","Datepicker","self","$target","extend","DEFAULTS","locales","startView","inputFormat","parseDate","calendar","wrap","$label","$group","$button","theme","$calendar","after","inline","hideObject","initializeDate","buttonLabel","buttonTitle","$monthObj","$prev","$next","$fastprev","$fastnext","$grid","directionality","drawCalendarHeader","$close","closeButtonTitle","closeButtonLabel","enter","esc","space","pageup","pagedown","end","home","up","down","bindHandlers","selectGridCell","keydown","VERSION","firstDayOfWeek","firstday_of_week","weekDayFormat","daysOfWeekDisabled","short_format","titleFormat","full_format","texts","prevButtonLabel","prevMonthButtonLabel","prevYearButtonLabel","nextButtonLabel","nextMonthButtonLabel","nextYearButtonLabel","changeMonthButtonLabel","changeYearButtonLabel","changeRangeButtonLabel","setDate","newDate","dateObj","curYear","curMonth","populateMonthsCalendar","populateYearsCalendar","populateDaysCalendar","$days","weekday","day_names","day_names_short","day_names_narrow","previousMonth","nextMonth","showObject","numDays","getDaysInMonth","numPrevDays","startWeekday","getDay","lastDayOfWeek","curDay","rowCount","month_names","gridCells","numEmpties","longdate","formatDate","curDayClass","inArray","$tbody","gridType","month_names_abbreviated","startYear","endYear","curPos","showDaysOfPrevMonth","showDaysOfMonth","$active","showMonthsOfPrevYear","showMonthsOfYear","showYearsOfPrevRange","showDaysOfNextMonth","showMonthsOfNextYear","showYearsOfNextRange","showDaysOfPrevYear","showDaysOfNextYear","handleFastPrevClick","handlePrevClick","handleNextClick","handleFastNextClick","handleMonthClick","handleMonthKeyDown","handleFastPrevKeyDown","handlePrevKeyDown","handleNextKeyDown","handleFastNextKeyDown","handleCloseClick","handleCloseKeyDown","handleGridKeyDown","keypress","handleGridKeyPress","handleGridFocus","handleGridBlur","delegate","handleGridClick","active","ctrlKey","changeGrid","altKey","shiftKey","$curCell","$cells","colCount","handleTabOut","$prevCell","cellIndex","unSelectGridCell","$nextCell","stopImmediatePropagation","$lastCell","$firstCell","$cell","fields","cellId","$curDay","$element","greyOut","zIndex","proxy","handleDocumentClick","groupOffsetTop","groupOffsetLeft","parentPaddingLeft","calendarHeight","outerHeight","groupTop","groupHeight","roomBefore","roomAfter","fadeIn","refresh","omitSettingFocus","unbind","fadeOut","$overlay","zmax","cur","absolutePosition","box","docElem","pageYOffset","pageXOffset","clientTop","clientLeft","round","offsetParent","zeroPad","getMillisecondsInDay","date1","M","D","getDayOfYear","E","H","getSeconds","onejan","getWeekOfYear","W","getWeekOfMonth","F","Q","era","month_names_narrow","day_names_abbreviated","era_names_abbreviated","era_names","era_names_narrow","quarter_names_abbreviated","quarter_names","quarter_names_narrow","day_periods","pm","am","mask","createDateFromFormat","extractInteger","minlength","maxlength","integer","skipName","names","now","getYear","hh","mm","ss","ampm","token","month_name","amlength","pmlength","setLocales","calendarHelp","old","Constructor","noConflict","jQuery","featureTest","property","noPrefixes","mStyle","cssText","getPx","unit","uniqueIdCounter","S","classes","plugin","inactive","clone","withoutFixedFixed","tests","sticky","fixed","getScrollTop","bypass","optOut","FixedFixed","skipSettingToFixed","elTop","elBottom","initialOffset","isAlreadyOn","turnOn","viewportHeight","$parent","parentOffset","parentHeight","next","destroy","removeData","FixedSticky","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","amdD","chunkIds","priority","notFulfilled","Infinity","fulfilled","j","getter","__esModule","getPrototypeOf","obj","mode","ns","create","def","current","getOwnPropertyNames","definition","globalThis","Function","hmd","Symbol","toStringTag","nmd","paths","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""}