transit-departures-widget 2.7.3 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/transit-departures-widget.ts","../../src/lib/file-utils.ts","../../src/lib/logging/log.ts","../../src/lib/transit-departures-widget.ts","../../src/lib/config/defaults.ts","../../src/lib/utils.ts","../../src/lib/logging/messages.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from 'yargs'\nimport { hideBin } from 'yargs/helpers'\nimport PrettyError from 'pretty-error'\n\nimport { getConfig } from '../lib/file-utils.ts'\nimport { formatError } from '../lib/logging/log.ts'\nimport transitDeparturesWidget from '../index.ts'\n\nconst pe = new PrettyError()\n\nconst argv = yargs(hideBin(process.argv))\n .usage('Usage: $0 --config ./config.json')\n .help()\n .option('c', {\n alias: 'configPath',\n describe: 'Path to config file',\n default: './config.json',\n type: 'string',\n })\n .option('s', {\n alias: 'skipImport',\n describe: 'Don’t import GTFS file.',\n type: 'boolean',\n })\n .default('skipImport', undefined)\n .parseSync()\n\nconst handleError = (error: any) => {\n const text = error || 'Unknown Error'\n process.stdout.write(`\\n${formatError(text)}\\n`)\n console.error(pe.render(error))\n process.exit(1)\n}\n\nconst setupImport = async () => {\n const config = await getConfig(argv)\n await transitDeparturesWidget(config)\n process.exit()\n}\n\nsetupImport().catch(handleError)\n","import { dirname, join, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport {\n access,\n cp,\n copyFile,\n mkdir,\n readdir,\n readFile,\n rm,\n} from 'node:fs/promises'\nimport beautify from 'js-beautify'\nimport pug from 'pug'\nimport untildify from 'untildify'\n\nimport { Config } from '../types/global_interfaces.ts'\n\n/*\n * Attempt to parse the specified config JSON file.\n */\nexport async function getConfig(argv) {\n try {\n const data = await readFile(\n resolve(untildify(argv.configPath)),\n 'utf8',\n ).catch((error) => {\n console.error(\n new Error(\n `Cannot find configuration file at \\`${argv.configPath}\\`. Use config-sample.json as a starting point, pass --configPath option`,\n ),\n )\n throw error\n })\n const config = JSON.parse(data)\n\n if (argv.skipImport === true) {\n config.skipImport = argv.skipImport\n }\n\n return config\n } catch (error) {\n console.error(\n new Error(\n `Cannot parse configuration file at \\`${argv.configPath}\\`. Check to ensure that it is valid JSON.`,\n ),\n )\n throw error\n }\n}\n\n/*\n * Get the full path to this module's folder.\n */\nexport function getPathToThisModuleFolder() {\n const __dirname = dirname(fileURLToPath(import.meta.url))\n\n // Dynamically calculate the path to this module's folder\n let distFolderPath\n if (__dirname.endsWith('/dist/bin') || __dirname.endsWith('/dist/app')) {\n // When the file is in 'dist/bin' or 'dist/app'\n distFolderPath = resolve(__dirname, '../../')\n } else if (__dirname.endsWith('/dist')) {\n // When the file is in 'dist'\n distFolderPath = resolve(__dirname, '../')\n } else {\n // In case it's neither, fallback to project root\n distFolderPath = resolve(__dirname, '../../')\n }\n\n return distFolderPath\n}\n\n/*\n * Get the full path to the views folder.\n */\nexport function getPathToViewsFolder(config: Config) {\n if (config.templatePath) {\n return untildify(config.templatePath)\n }\n\n return join(getPathToThisModuleFolder(), 'views/widget')\n}\n\n/*\n * Get the full path of a template file.\n */\nfunction getPathToTemplateFile(templateFileName: string, config: Config) {\n const fullTemplateFileName =\n config.noHead !== true\n ? `${templateFileName}_full.pug`\n : `${templateFileName}.pug`\n\n return join(getPathToViewsFolder(config), fullTemplateFileName)\n}\n\n/*\n * Prepare the outputPath directory for writing timetable files.\n */\nexport async function prepDirectory(outputPath: string, config: Config) {\n // Check if outputPath exists\n try {\n await access(outputPath)\n } catch (error: any) {\n try {\n await mkdir(outputPath, { recursive: true })\n await mkdir(join(outputPath, 'data'))\n } catch (error: any) {\n if (error?.code === 'ENOENT') {\n throw new Error(\n `Unable to write to ${outputPath}. Try running this command from a writable directory.`,\n )\n }\n\n throw error\n }\n }\n\n // Check if outputPath is empty\n const files = await readdir(outputPath)\n if (config.overwriteExistingFiles === false && files.length > 0) {\n throw new Error(\n `Output directory ${outputPath} is not empty. Please specify an empty directory.`,\n )\n }\n\n // Delete all files in outputPath if `overwriteExistingFiles` is true\n if (config.overwriteExistingFiles === true) {\n await rm(join(outputPath, '*'), { recursive: true, force: true })\n }\n}\n\n/*\n * Copy needed CSS and JS to export path.\n */\nexport async function copyStaticAssets(config: Config, outputPath: string) {\n const viewsFolderPath = getPathToViewsFolder(config)\n const thisModuleFolderPath = getPathToThisModuleFolder()\n\n const foldersToCopy = ['css', 'js']\n\n for (const folder of foldersToCopy) {\n if (\n await access(join(viewsFolderPath, folder))\n .then(() => true)\n .catch(() => false)\n ) {\n await cp(join(viewsFolderPath, folder), join(outputPath, folder), {\n recursive: true,\n })\n }\n }\n\n // Copy js and css libraries from node_modules\n await copyFile(\n join(thisModuleFolderPath, 'dist/frontend_libraries/pbf.js'),\n join(outputPath, 'js/pbf.js'),\n )\n\n await copyFile(\n join(\n thisModuleFolderPath,\n 'dist/frontend_libraries/gtfs-realtime.browser.proto.js',\n ),\n join(outputPath, 'js/gtfs-realtime.browser.proto.js'),\n )\n\n await copyFile(\n join(\n thisModuleFolderPath,\n 'dist/frontend_libraries/accessible-autocomplete.min.js',\n ),\n join(outputPath, 'js/accessible-autocomplete.min.js'),\n )\n\n await copyFile(\n join(\n thisModuleFolderPath,\n 'dist/frontend_libraries/accessible-autocomplete.min.css',\n ),\n join(outputPath, 'css/accessible-autocomplete.min.css'),\n )\n}\n\n/*\n * Render the HTML based on the config.\n */\nexport async function renderFile(\n templateFileName: string,\n templateVars: any,\n config: Config,\n) {\n const templatePath = getPathToTemplateFile(templateFileName, config)\n const html = await pug.renderFile(templatePath, templateVars)\n\n // Beautify HTML if setting is set\n if (config.beautify === true) {\n return beautify.html_beautify(html, { indent_size: 2 })\n }\n\n return html\n}\n","import { clearLine, cursorTo } from 'node:readline'\nimport { noop } from 'lodash-es'\nimport * as colors from 'yoctocolors'\n\nimport { Config } from '../../types/global_interfaces.ts'\n\nexport type Logger = {\n info: (text: string, overwrite?: boolean) => void\n warn: (text: string) => void\n error: (text: string) => void\n}\n\nconst formatWarning = (text: string) => {\n const warningMessage = `${colors.underline('Warning')}: ${text}`\n return colors.yellow(warningMessage)\n}\n\nexport const formatError = (error: any) => {\n const messageText = error instanceof Error ? error.message : error\n const errorMessage = `${colors.underline('Error')}: ${messageText.replace(\n 'Error: ',\n '',\n )}`\n return colors.red(errorMessage)\n}\n\nconst logInfo = (config: Config) => {\n if (config.verbose === false) {\n return noop\n }\n\n if (config.logFunction) {\n return config.logFunction\n }\n\n return (text: string, overwrite?: boolean) => {\n if (overwrite === true && process.stdout.isTTY) {\n clearLine(process.stdout, 0)\n cursorTo(process.stdout, 0)\n } else {\n process.stdout.write('\\n')\n }\n\n process.stdout.write(text)\n }\n}\n\nconst logWarn = (config: Config) => {\n if (config.logFunction) {\n return config.logFunction\n }\n\n return (text: string) => {\n process.stdout.write(`\\n${formatWarning(text)}\\n`)\n }\n}\n\nconst logError = (config: Config) => {\n if (config.logFunction) {\n return config.logFunction\n }\n\n return (text: string) => {\n process.stdout.write(`\\n${formatError(text)}\\n`)\n }\n}\n\n/*\n * Create a structured logger with consistent methods.\n */\nexport function createLogger(config: Config): Logger {\n return {\n info: logInfo(config),\n warn: logWarn(config),\n error: logError(config),\n }\n}\n","import path from 'path'\nimport { clone, omit } from 'lodash-es'\nimport { writeFile } from 'node:fs/promises'\nimport { importGtfs, openDb, type ConfigAgency, type TableNames } from 'gtfs'\nimport sanitize from 'sanitize-filename'\nimport Timer from 'timer-machine'\nimport untildify from 'untildify'\n\nimport { copyStaticAssets, prepDirectory } from './file-utils.ts'\nimport { createLogger } from './logging/log.ts'\nimport { setDefaultConfig } from './config/defaults.ts'\nimport {\n generateTransitDeparturesWidgetHtml,\n generateTransitDeparturesWidgetJson,\n} from './utils.ts'\nimport { Config } from '../types/global_interfaces.ts'\n\n/*\n * Generate transit departures widget HTML from GTFS.\n */\nasync function transitDeparturesWidget(initialConfig: Config) {\n const config = setDefaultConfig(initialConfig)\n const logger = createLogger(config)\n\n try {\n openDb(config)\n } catch (error: any) {\n if (error?.code === 'SQLITE_CANTOPEN') {\n logger.error(\n `Unable to open sqlite database \"${config.sqlitePath}\" defined as \\`sqlitePath\\` config.json. Ensure the parent directory exists or remove \\`sqlitePath\\` from config.json.`,\n )\n }\n\n throw error\n }\n\n if (!config.agency) {\n throw new Error('No agency defined in `config.json`')\n }\n\n const timer = new Timer()\n const agencyKey = config.agency.agency_key ?? 'unknown'\n\n const outputPath = config.outputPath\n ? untildify(config.outputPath)\n : path.join(process.cwd(), 'html', sanitize(agencyKey))\n\n timer.start()\n\n if (!config.skipImport) {\n // Import GTFS\n const gtfsPath = config.agency.gtfs_static_path\n const gtfsUrl = config.agency.gtfs_static_url\n\n if (!gtfsPath && !gtfsUrl) {\n throw new Error(\n 'Missing GTFS source. Set `agency.gtfs_static_path` or `agency.gtfs_static_url` in config.json.',\n )\n }\n\n const agencyImportConfig: ConfigAgency = {\n exclude: config.agency.exclude as TableNames[] | undefined,\n ...(gtfsPath ? { path: gtfsPath } : { url: gtfsUrl as string }),\n }\n\n const gtfsImportConfig = {\n ...clone(omit(config, 'agency')),\n agencies: [agencyImportConfig],\n }\n\n await importGtfs(gtfsImportConfig)\n }\n\n await prepDirectory(outputPath, config)\n\n if (config.noHead !== true) {\n await copyStaticAssets(config, outputPath)\n }\n\n logger.info(`${agencyKey}: Generating Transit Departures Widget HTML`)\n\n config.assetPath = ''\n\n // Generate JSON of routes and stops\n const { routes, stops } = generateTransitDeparturesWidgetJson(config)\n await writeFile(\n path.join(outputPath, 'data', 'routes.json'),\n JSON.stringify(routes),\n )\n await writeFile(\n path.join(outputPath, 'data', 'stops.json'),\n JSON.stringify(stops),\n )\n\n const html = await generateTransitDeparturesWidgetHtml(config)\n await writeFile(path.join(outputPath, 'index.html'), html)\n\n timer.stop()\n\n // Print stats\n logger.info(\n `${agencyKey}: Transit Departures Widget HTML created at ${outputPath}`,\n )\n\n const seconds = Math.round(timer.time() / 1000)\n logger.info(`${agencyKey}: HTML generation required ${seconds} seconds`)\n}\n\nexport default transitDeparturesWidget\n","import { join } from 'path'\nimport { I18n } from 'i18n'\n\nimport { Config } from '../../types/global_interfaces.ts'\nimport { getPathToViewsFolder } from '../file-utils.ts'\n\n/*\n * Initialize configuration with defaults.\n */\nexport function setDefaultConfig(initialConfig: Config) {\n const defaults = {\n beautify: false,\n noHead: false,\n refreshIntervalSeconds: 20,\n skipImport: false,\n timeFormat: '12hour',\n includeCoordinates: false,\n overwriteExistingFiles: true,\n verbose: true,\n }\n\n const config = Object.assign(defaults, initialConfig)\n const viewsFolderPath = getPathToViewsFolder(config)\n const i18n = new I18n({\n directory: join(viewsFolderPath, 'locales'),\n defaultLocale: config.locale,\n updateFiles: false,\n })\n const configWithI18n = Object.assign(config, {\n __: i18n.__,\n })\n return configWithI18n\n}\n","import { openDb, getDirections, getRoutes, getStops, getTrips } from 'gtfs'\nimport { groupBy, last, maxBy, size, sortBy, uniqBy } from 'lodash-es'\nimport { renderFile } from './file-utils.ts'\nimport sqlString from 'sqlstring-sqlite'\nimport toposort from 'toposort'\n\nimport { Config, SqlWhere, SqlValue } from '../types/global_interfaces.ts'\nimport {\n ConfigWithI18n,\n GTFSCalendar,\n GTFSRoute,\n GTFSRouteDirection,\n GTFSStop,\n} from '../types/gtfs.ts'\nimport { createLogger } from './logging/log.ts'\nimport { messages } from './logging/messages.ts'\nexport { setDefaultConfig } from './config/defaults.ts'\n\n/*\n * Get calendars for a specified date range\n */\nconst getCalendarsForDateRange = (config: Config): GTFSCalendar[] => {\n const db = openDb(config)\n let whereClause = ''\n const whereClauses = []\n\n if (config.endDate) {\n whereClauses.push(`start_date <= ${sqlString.escape(config.endDate)}`)\n }\n\n if (config.startDate) {\n whereClauses.push(`end_date >= ${sqlString.escape(config.startDate)}`)\n }\n\n if (whereClauses.length > 0) {\n whereClause = `WHERE ${whereClauses.join(' AND ')}`\n }\n\n return db.prepare(`SELECT * FROM calendar ${whereClause}`).all()\n}\n\n/*\n * Format a route name.\n */\nfunction formatRouteName(route: GTFSRoute) {\n let routeName = ''\n\n if (route.route_short_name !== null) {\n routeName += route.route_short_name\n }\n\n if (route.route_short_name !== null && route.route_long_name !== null) {\n routeName += ' - '\n }\n\n if (route.route_long_name !== null) {\n routeName += route.route_long_name\n }\n\n return routeName\n}\n\n/*\n * Get directions for a route\n */\nfunction getDirectionsForRoute(route: GTFSRoute, config: ConfigWithI18n) {\n const logger = createLogger(config)\n const db = openDb(config)\n\n // Lookup direction names from non-standard directions.txt file\n const directions = getDirections({ route_id: route.route_id }, [\n 'direction_id',\n 'direction',\n ])\n .filter((direction) => direction.direction_id !== undefined)\n .map((direction) => ({\n direction_id: direction.direction_id as number | string,\n direction: direction.direction,\n }))\n\n const calendars = getCalendarsForDateRange(config)\n if (calendars.length === 0) {\n logger.warn(messages.noActiveCalendarsForRoute(route.route_id))\n return []\n }\n\n // Else use the most common headsigns as directions from trips.txt file\n if (directions.length === 0) {\n const headsigns = db\n .prepare(\n `SELECT direction_id, trip_headsign, count(*) AS count FROM trips WHERE route_id = ? AND service_id IN (${calendars\n .map((calendar: GTFSCalendar) => `'${calendar.service_id}'`)\n .join(', ')}) GROUP BY direction_id, trip_headsign`,\n )\n .all(route.route_id)\n\n for (const group of Object.values(groupBy(headsigns, 'direction_id'))) {\n const mostCommonHeadsign = maxBy(group, 'count')\n directions.push({\n direction_id: mostCommonHeadsign.direction_id,\n direction: config.__('To {{{headsign}}}', {\n headsign: mostCommonHeadsign.trip_headsign,\n }),\n })\n }\n }\n\n return directions\n}\n\n/*\n * Sort an array of stoptimes by stop_sequence using a directed graph\n */\nfunction sortStopIdsBySequence(stoptimes: Record<string, string>[]) {\n const stoptimesGroupedByTrip = groupBy(stoptimes, 'trip_id')\n\n // First, try using a directed graph to determine stop order.\n try {\n const stopGraph = []\n\n for (const tripStoptimes of Object.values(stoptimesGroupedByTrip)) {\n const sortedStopIds = sortBy(tripStoptimes, 'stop_sequence').map(\n (stoptime) => stoptime.stop_id,\n )\n\n for (const [index, stopId] of sortedStopIds.entries()) {\n if (index === sortedStopIds.length - 1) {\n continue\n }\n\n stopGraph.push([stopId, sortedStopIds[index + 1]])\n }\n }\n\n return toposort(\n stopGraph as unknown as readonly [string, string | undefined][],\n )\n } catch {\n // Ignore errors and move to next strategy.\n }\n\n // Finally, fall back to using the stop order from the trip with the most stoptimes.\n const longestTripStoptimes = maxBy(\n Object.values(stoptimesGroupedByTrip),\n (stoptimes) => size(stoptimes),\n )\n\n if (!longestTripStoptimes) {\n return []\n }\n\n return longestTripStoptimes.map((stoptime) => stoptime.stop_id)\n}\n\nfunction getStopsForDirection(\n route: GTFSRoute,\n direction: GTFSRouteDirection,\n config: Config,\n stopCache?: Map<string, GTFSStop>,\n) {\n const logger = createLogger(config)\n const db = openDb(config)\n const calendars = getCalendarsForDateRange(config)\n if (calendars.length === 0) {\n logger.warn(\n messages.noActiveCalendarsForDirection(\n route.route_id,\n direction.direction_id,\n ),\n )\n return []\n }\n const whereClause = formatWhereClauses({\n direction_id: direction.direction_id,\n route_id: route.route_id,\n service_id: calendars.map((calendar: GTFSCalendar) => calendar.service_id),\n })\n const stoptimes = db\n .prepare(\n `SELECT stop_id, stop_sequence, trip_id FROM stop_times WHERE trip_id IN (SELECT trip_id FROM trips ${whereClause}) ORDER BY stop_sequence ASC`,\n )\n .all()\n\n const sortedStopIds = sortStopIdsBySequence(stoptimes)\n\n const deduplicatedStopIds = sortedStopIds.reduce(\n (memo: string[], stopId: string) => {\n // Remove duplicated stop_ids in a row\n if (last(memo) !== stopId) {\n memo.push(stopId)\n }\n\n return memo\n },\n [],\n )\n\n // Remove last stop of route since boarding is not allowed\n deduplicatedStopIds.pop()\n\n // Fetch stop details\n const stopFields: (keyof GTFSStop)[] = [\n 'stop_id',\n 'stop_name',\n 'stop_code',\n 'parent_station',\n ]\n\n if (config.includeCoordinates) {\n stopFields.push('stop_lat', 'stop_lon')\n }\n\n const missingStopIds = stopCache\n ? deduplicatedStopIds.filter((stopId) => !stopCache.has(stopId))\n : deduplicatedStopIds\n\n const fetchedStops = missingStopIds.length\n ? (getStops as unknown as (query: any, fields?: any) => GTFSStop[])(\n { stop_id: missingStopIds },\n stopFields,\n )\n : []\n\n if (stopCache) {\n for (const stop of fetchedStops) {\n stopCache.set(stop.stop_id, stop)\n }\n }\n\n return deduplicatedStopIds\n .map((stopId: string) => {\n const stop =\n stopCache?.get(stopId) ??\n fetchedStops.find((candidate) => candidate.stop_id === stopId)\n\n if (!stop) {\n logger.warn(\n messages.stopNotFound(route.route_id, direction.direction_id, stopId),\n )\n }\n\n return stop\n })\n .filter(Boolean) as GTFSStop[]\n}\n\n/*\n * Generate HTML for transit departures widget.\n */\nexport function generateTransitDeparturesWidgetHtml(config: ConfigWithI18n) {\n const templateVars = {\n config,\n __: config.__,\n }\n return renderFile('widget', templateVars, config)\n}\n\n/*\n * Generate JSON of routes and stops for transit departures widget.\n */\nexport function generateTransitDeparturesWidgetJson(config: ConfigWithI18n) {\n const logger = createLogger(config)\n const calendars = getCalendarsForDateRange(config)\n if (calendars.length === 0) {\n logger.warn(messages.noActiveCalendarsGlobal)\n return { routes: [], stops: [] }\n }\n\n const routes = getRoutes() as GTFSRoute[]\n const stops: GTFSStop[] = []\n const filteredRoutes: GTFSRoute[] = []\n const stopCache = new Map<string, GTFSStop>()\n\n for (const route of routes) {\n const routeWithFullName: GTFSRoute = {\n ...route,\n route_full_name: formatRouteName(route),\n }\n\n const directions = getDirectionsForRoute(routeWithFullName, config)\n\n // Filter out routes with no directions\n if (directions.length === 0) {\n logger.warn(messages.routeHasNoDirections(route.route_id))\n continue\n }\n\n const directionsWithData = directions\n .map((direction) => {\n const directionStops = getStopsForDirection(\n routeWithFullName,\n direction,\n config,\n stopCache,\n )\n\n if (directionStops.length === 0) {\n return null\n }\n\n stops.push(...directionStops)\n\n const trips = getTrips(\n {\n route_id: route.route_id,\n direction_id: direction.direction_id,\n service_id: calendars.map(\n (calendar: GTFSCalendar) => calendar.service_id,\n ),\n },\n ['trip_id'],\n )\n\n return {\n ...direction,\n stopIds: directionStops.map((stop) => stop.stop_id),\n tripIds: trips.map((trip) => trip.trip_id),\n }\n })\n .filter(Boolean) as GTFSRouteDirection[]\n\n if (directionsWithData.length === 0) {\n continue\n }\n\n filteredRoutes.push({\n ...routeWithFullName,\n directions: directionsWithData,\n })\n }\n\n // Sort routes deterministically, handling mixed numeric/alphanumeric IDs\n const sortedRoutes = [...filteredRoutes].sort((a, b) => {\n const aShort = a.route_short_name ?? ''\n const bShort = b.route_short_name ?? ''\n const aNum = Number.parseInt(aShort, 10)\n const bNum = Number.parseInt(bShort, 10)\n\n if (!Number.isNaN(aNum) && !Number.isNaN(bNum) && aNum !== bNum) {\n return aNum - bNum\n }\n\n if (Number.isNaN(aNum) && !Number.isNaN(bNum)) {\n return 1\n }\n\n if (!Number.isNaN(aNum) && Number.isNaN(bNum)) {\n return -1\n }\n\n return aShort.localeCompare(bShort, undefined, {\n numeric: true,\n sensitivity: 'base',\n })\n })\n\n // Get Parent Station Stops\n const parentStationIds = new Set(stops.map((stop) => stop.parent_station))\n\n const parentStationStops = getStops(\n { stop_id: Array.from(parentStationIds) },\n ['stop_id', 'stop_name', 'stop_code', 'parent_station'],\n )\n\n stops.push(\n ...parentStationStops.map((stop) => ({\n ...stop,\n is_parent_station: true,\n })),\n )\n\n // Sort unique list of stops\n const sortedStops = sortBy(uniqBy(stops, 'stop_id'), 'stop_name')\n\n return {\n routes: arrayOfArrays(removeNulls(sortedRoutes)),\n stops: arrayOfArrays(removeNulls(sortedStops)),\n }\n}\n\n/*\n * Remove null values from array or object\n */\nfunction removeNulls(data: any): any {\n if (Array.isArray(data)) {\n return data\n .map(removeNulls)\n .filter((item) => item !== null && item !== undefined)\n } else if (\n data !== null &&\n typeof data === 'object' &&\n Object.getPrototypeOf(data) === Object.prototype\n ) {\n return Object.entries(data).reduce<Record<string, unknown>>(\n (acc, [key, value]) => {\n const cleanedValue = removeNulls(value)\n if (cleanedValue !== null && cleanedValue !== undefined) {\n acc[key] = cleanedValue\n }\n return acc\n },\n {},\n )\n } else {\n return data\n }\n}\n\n/*\n * Convert an array of objects into an Array-of-arrays JSON: { \"fields\": [...], \"rows\": [[...], ...] }\n */\nfunction arrayOfArrays(array: any[]): { fields: string[]; rows: any[][] } {\n if (array.length === 0) {\n return { fields: [], rows: [] }\n }\n\n const fields: string[] = Array.from(\n array.reduce<Set<string>>((fieldSet, item) => {\n Object.keys(item ?? {}).forEach((key) => fieldSet.add(key))\n return fieldSet\n }, new Set<string>()),\n )\n\n return {\n fields,\n rows: array.map((item) => fields.map((field) => item?.[field] ?? null)),\n }\n}\n\nexport function formatWhereClause(\n key: string,\n value: null | SqlValue | SqlValue[],\n) {\n if (Array.isArray(value)) {\n let whereClause = `${sqlString.escapeId(key)} IN (${value\n .filter((v) => v !== null)\n .map((v) => sqlString.escape(v))\n .join(', ')})`\n\n if (value.includes(null)) {\n whereClause = `(${whereClause} OR ${sqlString.escapeId(key)} IS NULL)`\n }\n\n return whereClause\n }\n\n if (value === null) {\n return `${sqlString.escapeId(key)} IS NULL`\n }\n\n return `${sqlString.escapeId(key)} = ${sqlString.escape(value)}`\n}\n\nexport function formatWhereClauses(query: SqlWhere) {\n if (Object.keys(query).length === 0) {\n return ''\n }\n\n const whereClauses = Object.entries(query).map(([key, value]) =>\n formatWhereClause(key, value),\n )\n return `WHERE ${whereClauses.join(' AND ')}`\n}\n","export const messages = {\n noActiveCalendarsGlobal:\n 'No active calendars found for the configured date range - returning empty routes and stops',\n noActiveCalendarsForRoute: (routeId: string) =>\n `route_id ${routeId} has no active calendars in range - skipping directions`,\n noActiveCalendarsForDirection: (\n routeId: string,\n directionId: string | number,\n ) =>\n `route_id ${routeId} direction ${directionId} has no active calendars in range - skipping stops`,\n routeHasNoDirections: (routeId: string) =>\n `route_id ${routeId} has no directions - skipping`,\n stopNotFound: (\n routeId: string,\n directionId: string | number,\n stopId: string,\n ) =>\n `stop_id ${stopId} for route ${routeId} direction ${directionId} not found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,MAAM,UAAU,IAAI;AACnC,QAAM,kCAAwB,MAAM;AACpC,UAAQ,KAAK;AACf;AAEA,YAAY,EAAE,MAAM,WAAW;","names":["argv","error","openDb","untildify","join","join","stoptimes","openDb","untildify"]}
1
+ {"version":3,"file":"transit-departures-widget.js","names":[],"sources":["../../src/bin/transit-departures-widget.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from 'yargs'\nimport { hideBin } from 'yargs/helpers'\nimport PrettyError from 'pretty-error'\n\nimport { getConfig } from '../lib/file-utils.ts'\nimport { formatError } from '../lib/logging/log.ts'\nimport transitDeparturesWidget from '../index.ts'\n\nconst pe = new PrettyError()\n\nconst argv = yargs(hideBin(process.argv))\n .usage('Usage: $0 --config ./config.json')\n .help()\n .option('c', {\n alias: 'configPath',\n describe: 'Path to config file',\n default: './config.json',\n type: 'string',\n })\n .option('s', {\n alias: 'skipImport',\n describe: 'Don’t import GTFS file.',\n type: 'boolean',\n })\n .default('skipImport', undefined)\n .parseSync()\n\nconst handleError = (error: any) => {\n const text = error || 'Unknown Error'\n process.stdout.write(`\\n${formatError(text)}\\n`)\n console.error(pe.render(error))\n process.exit(1)\n}\n\nconst setupImport = async () => {\n const config = await getConfig(argv)\n await transitDeparturesWidget(config)\n process.exit()\n}\n\nsetupImport().catch(handleError)\n"],"mappings":";;;;;;;;AAUA,MAAM,KAAK,IAAI,YAAY;AAE3B,MAAM,OAAO,MAAM,QAAQ,QAAQ,IAAI,CAAC,CAAC,CACtC,MAAM,kCAAkC,CAAC,CACzC,KAAK,CAAC,CACN,OAAO,KAAK;CACX,OAAO;CACP,UAAU;CACV,SAAS;CACT,MAAM;AACR,CAAC,CAAC,CACD,OAAO,KAAK;CACX,OAAO;CACP,UAAU;CACV,MAAM;AACR,CAAC,CAAC,CACD,QAAQ,cAAc,MAAS,CAAC,CAChC,UAAU;AAEb,MAAM,eAAe,UAAe;CAClC,MAAM,OAAO,SAAS;CACtB,QAAQ,OAAO,MAAM,KAAK,YAAY,IAAI,EAAE,GAAG;CAC/C,QAAQ,MAAM,GAAG,OAAO,KAAK,CAAC;CAC9B,QAAQ,KAAK,CAAC;AAChB;AAEA,MAAM,cAAc,YAAY;CAE9B,MAAM,wBAAwB,MADT,UAAU,IAAI,CACC;CACpC,QAAQ,KAAK;AACf;AAEA,YAAY,CAAC,CAAC,MAAM,WAAW"}
@@ -0,0 +1,87 @@
1
+ Third-Party Licenses
2
+ ════════════════════════════════════════
3
+ This file contains license notices for open-source libraries vendored
4
+ in dist/browser by transit-departures-widget (https://github.com/BlinkTagInc/transit-departures-widget).
5
+
6
+ pbf 5.1.0
7
+ ────────────────────────────────────────
8
+ License: BSD-3-Clause
9
+
10
+ Copyright (c) 2026, Mapbox
11
+ All rights reserved.
12
+
13
+ Redistribution and use in source and binary forms, with or without
14
+ modification, are permitted provided that the following conditions are met:
15
+
16
+ * Redistributions of source code must retain the above copyright notice, this
17
+ list of conditions and the following disclaimer.
18
+
19
+ * Redistributions in binary form must reproduce the above copyright notice,
20
+ this list of conditions and the following disclaimer in the documentation
21
+ and/or other materials provided with the distribution.
22
+
23
+ * Neither the name of pbf nor the names of its
24
+ contributors may be used to endorse or promote products derived from
25
+ this software without specific prior written permission.
26
+
27
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+
38
+ gtfs-realtime-pbf-js-module 1.0.0
39
+ ────────────────────────────────────────
40
+ License: MIT
41
+
42
+ MIT License
43
+
44
+ Copyright (c) 2020 Gavin Rehkemper
45
+
46
+ Permission is hereby granted, free of charge, to any person obtaining a copy
47
+ of this software and associated documentation files (the "Software"), to deal
48
+ in the Software without restriction, including without limitation the rights
49
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
50
+ copies of the Software, and to permit persons to whom the Software is
51
+ furnished to do so, subject to the following conditions:
52
+
53
+ The above copyright notice and this permission notice shall be included in all
54
+ copies or substantial portions of the Software.
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
57
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
58
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
59
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
60
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
61
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
62
+ SOFTWARE.
63
+
64
+ accessible-autocomplete 3.0.1
65
+ ────────────────────────────────────────
66
+ License: MIT
67
+
68
+ The MIT License (MIT)
69
+
70
+ Copyright (c) 2017 Crown Copyright (Government Digital Service)
71
+
72
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
73
+ this software and associated documentation files (the "Software"), to deal in
74
+ the Software without restriction, including without limitation the rights to
75
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
76
+ the Software, and to permit persons to whom the Software is furnished to do so,
77
+ subject to the following conditions:
78
+
79
+ The above copyright notice and this permission notice shall be included in all
80
+ copies or substantial portions of the Software.
81
+
82
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
83
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
84
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
85
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
86
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
87
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ .autocomplete__wrapper{position:relative}.autocomplete__hint,.autocomplete__input{-webkit-appearance:none;appearance:none;border:2px solid #0b0c0c;border-radius:0;box-sizing:border-box;height:2.5rem;line-height:1.25;margin-bottom:0;width:100%}.autocomplete__input{background-color:transparent;position:relative}.autocomplete__hint{color:#505a5f;position:absolute}.autocomplete__input--default{padding:5px}.autocomplete__input--focused{box-shadow:inset 0 0 0 2px;outline:3px solid #fd0;outline-offset:0}.autocomplete__input--show-all-values{cursor:pointer;padding:5px 35px 5px 5px}.autocomplete__dropdown-arrow-down{display:inline-block;height:24px;position:absolute;right:8px;top:10px;width:24px;z-index:-1}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:0 2px 6px rgba(0,0,0,.257);left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:1px solid #b1b4b6;border-left-width:0;border-right-width:0;border-top-width:1px;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#f3f2f1}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:none}@media (-ms-high-contrast:active),(forced-colors:active){.autocomplete__menu{border-color:FieldText}.autocomplete__option{background-color:Field;color:FieldText}.autocomplete__option--focused,.autocomplete__option:hover{background-color:Highlight;background-color:SelectedItem;border-color:SelectedItem;color:HighlightText;color:SelectedItemText;forced-color-adjust:none;outline-color:SelectedItemText}}.autocomplete__option--no-results{background-color:#f3f2f1;color:#505a5f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:1rem;font-weight:400}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width:641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:1.1875rem;line-height:1.3157894737}}
2
+
3
+ /*# sourceMappingURL=accessible-autocomplete.min.css.map*/
@@ -0,0 +1,2 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.accessibleAutocomplete=e():t.accessibleAutocomplete=e()}(self,(function(){return function(){"use strict";var t={8952:function(t,e,n){var r=n(4328),o=n(36),i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not a function")}},2096:function(t,e,n){var r=n(2424),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},4764:function(t,e,n){var r=n(9764).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},6100:function(t,e,n){var r=n(7e3),o=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw new o("Incorrect invocation")}},3951:function(t,e,n){var r=n(1632),o=String,i=TypeError;t.exports=function(t){if(r(t))return t;throw new i(o(t)+" is not an object")}},2504:function(t,e,n){var r=n(4096),o=n(2495),i=n(3556),u=function(t){return function(e,n,u){var a=r(e),c=i(a);if(0===c)return!t&&-1;var s,l=o(u,c);if(t&&n!=n){for(;c>l;)if((s=a[l++])!=s)return!0}else for(;c>l;l++)if((t||l in a)&&a[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},3364:function(t,e,n){var r=n(8992),o=n(1664),i=n(5712),u=n(4356),a=n(3556),c=n(2568),s=o([].push),l=function(t){var e=1===t,n=2===t,o=3===t,l=4===t,f=6===t,p=7===t,d=5===t||f;return function(h,v,m,y){for(var g,b,x=u(h),w=i(x),O=a(w),_=r(v,m),S=0,C=y||c,E=e?C(h,O):n||p?C(h,0):void 0;O>S;S++)if((d||S in w)&&(b=_(g=w[S],S,x),t))if(e)E[S]=b;else if(b)switch(t){case 3:return!0;case 5:return g;case 6:return S;case 2:s(E,g)}else switch(t){case 4:return!1;case 7:s(E,g)}return f?-1:o||l?l:E}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},953:function(t,e,n){var r=n(9957),o=n(9972),i=n(8504),u=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[];return(e.constructor={})[u]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},1496:function(t,e,n){var r=n(9957);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},6728:function(t,e,n){var r=n(3476),o=n(1432),i=TypeError,u=Object.getOwnPropertyDescriptor,a=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=a?function(t,e){if(o(t)&&!u(t,"length").writable)throw new i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},6736:function(t,e,n){var r=n(1432),o=n(6072),i=n(1632),u=n(9972)("species"),a=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,(o(e)&&(e===a||r(e.prototype))||i(e)&&null===(e=e[u]))&&(e=void 0)),void 0===e?a:e}},2568:function(t,e,n){var r=n(6736);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},8696:function(t,e,n){var r=n(3951),o=n(3112);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(u){o(t,"throw",u)}}},1888:function(t,e,n){var r=n(1664),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},4427:function(t,e,n){var r=n(16),o=n(4328),i=n(1888),u=n(9972)("toStringTag"),a=Object,c="Arguments"===i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=a(t),u))?n:c?i(e):"Object"===(r=i(e))&&o(e.callee)?"Arguments":r}},9968:function(t,e,n){var r=n(5152),o=n(9252),i=n(9444),u=n(8352);t.exports=function(t,e,n){for(var a=o(e),c=u.f,s=i.f,l=0;l<a.length;l++){var f=a[l];r(t,f)||n&&r(n,f)||c(t,f,s(e,f))}}},2272:function(t,e,n){var r=n(9957);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},3336:function(t){t.exports=function(t,e){return{value:t,done:e}}},3440:function(t,e,n){var r=n(3476),o=n(8352),i=n(9728);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9728:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},92:function(t,e,n){var r=n(3476),o=n(8352),i=n(9728);t.exports=function(t,e,n){r?o.f(t,e,i(0,n)):t[e]=n}},2544:function(t,e,n){var r=n(5312),o=n(8352);t.exports=function(t,e,n){return n.get&&r(n.get,e,{getter:!0}),n.set&&r(n.set,e,{setter:!0}),o.f(t,e,n)}},6076:function(t,e,n){var r=n(4328),o=n(8352),i=n(5312),u=n(4636);t.exports=function(t,e,n,a){a||(a={});var c=a.enumerable,s=void 0!==a.name?a.name:e;if(r(n)&&i(n,s,a),a.global)c?t[e]=n:u(e,n);else{try{a.unsafe?t[e]&&(c=!0):delete t[e]}catch(l){}c?t[e]=n:o.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},4036:function(t,e,n){var r=n(6076);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},4636:function(t,e,n){var r=n(6420),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},3476:function(t,e,n){var r=n(9957);t.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8168:function(t,e,n){var r=n(6420),o=n(1632),i=r.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},4316:function(t){var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},6064:function(t){t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},8504:function(t,e,n){var r,o,i=n(6420),u=n(6064),a=i.process,c=i.Deno,s=a&&a.versions||c&&c.version,l=s&&s.v8;l&&(o=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&u&&(!(r=u.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=u.match(/Chrome\/(\d+)/))&&(o=+r[1]),t.exports=o},8256:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6520:function(t,e,n){var r=n(1664),o=Error,i=r("".replace),u=String(new o("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,c=a.test(u);t.exports=function(t,e){if(c&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,a,"");return t}},3696:function(t,e,n){var r=n(3440),o=n(6520),i=n(9184),u=Error.captureStackTrace;t.exports=function(t,e,n,a){i&&(u?u(t,e):r(t,"stack",o(n,a)))}},9184:function(t,e,n){var r=n(9957),o=n(9728);t.exports=!r((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},9160:function(t,e,n){var r=n(6420),o=n(9444).f,i=n(3440),u=n(6076),a=n(4636),c=n(9968),s=n(6704);t.exports=function(t,e){var n,l,f,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||a(h,{}):r[h]&&r[h].prototype)for(l in e){if(p=e[l],f=t.dontCallGetSet?(d=o(n,l))&&d.value:n[l],!s(v?l:h+(m?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;c(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),u(n,l,p,t)}}},9957:function(t){t.exports=function(t){try{return!!t()}catch(e){return!0}}},7176:function(t,e,n){n(880);var r=n(8448),o=n(6076),i=n(7680),u=n(9957),a=n(9972),c=n(3440),s=a("species"),l=RegExp.prototype;t.exports=function(t,e,n,f){var p=a(t),d=!u((function(){var e={};return e[p]=function(){return 7},7!==""[t](e)})),h=d&&!u((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return e=!0,null},n[p](""),!e}));if(!d||!h||n){var v=/./[p],m=e(p,""[t],(function(t,e,n,o,u){var a=e.exec;return a===i||a===l.exec?d&&!u?{done:!0,value:r(v,e,n,o)}:{done:!0,value:r(t,n,e,o)}:{done:!1}}));o(String.prototype,t,m[0]),o(l,p,m[1])}f&&c(l[p],"sham",!0)}},908:function(t,e,n){var r=n(7332),o=Function.prototype,i=o.apply,u=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?u.bind(i):function(){return u.apply(i,arguments)})},8992:function(t,e,n){var r=n(3180),o=n(8952),i=n(7332),u=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?u(t,e):function(){return t.apply(e,arguments)}}},7332:function(t,e,n){var r=n(9957);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},8448:function(t,e,n){var r=n(7332),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},6208:function(t,e,n){var r=n(3476),o=n(5152),i=Function.prototype,u=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),c=a&&"something"===function(){}.name,s=a&&(!r||r&&u(i,"name").configurable);t.exports={EXISTS:a,PROPER:c,CONFIGURABLE:s}},5288:function(t,e,n){var r=n(1664),o=n(8952);t.exports=function(t,e,n){try{return r(o(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(i){}}},3180:function(t,e,n){var r=n(1888),o=n(1664);t.exports=function(t){if("Function"===r(t))return o(t)}},1664:function(t,e,n){var r=n(7332),o=Function.prototype,i=o.call,u=r&&o.bind.bind(i,i);t.exports=r?u:function(t){return function(){return i.apply(t,arguments)}}},5232:function(t,e,n){var r=n(6420),o=n(4328);t.exports=function(t,e){return arguments.length<2?(n=r[t],o(n)?n:void 0):r[t]&&r[t][e];var n}},6752:function(t){t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},4504:function(t,e,n){var r=n(8952),o=n(9760);t.exports=function(t,e){var n=t[e];return o(n)?void 0:r(n)}},6420:function(t,e,n){var r=function(t){return t&&t.Math===Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},5152:function(t,e,n){var r=n(1664),o=n(4356),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},2560:function(t){t.exports={}},4168:function(t,e,n){var r=n(5232);t.exports=r("document","documentElement")},9888:function(t,e,n){var r=n(3476),o=n(9957),i=n(8168);t.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},5712:function(t,e,n){var r=n(1664),o=n(9957),i=n(1888),u=Object,a=r("".split);t.exports=o((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"===i(t)?a(t,""):u(t)}:u},7512:function(t,e,n){var r=n(4328),o=n(1632),i=n(4024);t.exports=function(t,e,n){var u,a;return i&&r(u=e.constructor)&&u!==n&&o(a=u.prototype)&&a!==n.prototype&&i(t,a),t}},9112:function(t,e,n){var r=n(1664),o=n(4328),i=n(3976),u=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return u(t)}),t.exports=i.inspectSource},3480:function(t,e,n){var r=n(1632),o=n(3440);t.exports=function(t,e){r(e)&&"cause"in e&&o(t,"cause",e.cause)}},9104:function(t,e,n){var r,o,i,u=n(4288),a=n(6420),c=n(1632),s=n(3440),l=n(5152),f=n(3976),p=n(6504),d=n(2560),h="Object already initialized",v=a.TypeError,m=a.WeakMap;if(u||f.state){var y=f.state||(f.state=new m);y.get=y.get,y.has=y.has,y.set=y.set,r=function(t,e){if(y.has(t))throw new v(h);return e.facade=t,y.set(t,e),e},o=function(t){return y.get(t)||{}},i=function(t){return y.has(t)}}else{var g=p("state");d[g]=!0,r=function(t,e){if(l(t,g))throw new v(h);return e.facade=t,s(t,g,e),e},o=function(t){return l(t,g)?t[g]:{}},i=function(t){return l(t,g)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw new v("Incompatible receiver, "+t+" required");return n}}}},1432:function(t,e,n){var r=n(1888);t.exports=Array.isArray||function(t){return"Array"===r(t)}},4328:function(t){var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},6072:function(t,e,n){var r=n(1664),o=n(9957),i=n(4328),u=n(4427),a=n(5232),c=n(9112),s=function(){},l=a("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=r(f.exec),d=!f.test(s),h=function(t){if(!i(t))return!1;try{return l(s,[],t),!0}catch(e){return!1}},v=function(t){if(!i(t))return!1;switch(u(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(f,c(t))}catch(e){return!0}};v.sham=!0,t.exports=!l||o((function(){var t;return h(h.call)||!h(Object)||!h((function(){t=!0}))||t}))?v:h},6704:function(t,e,n){var r=n(9957),o=n(4328),i=/#|\.prototype\./,u=function(t,e){var n=c[a(t)];return n===l||n!==s&&(o(e)?r(e):!!e)},a=u.normalize=function(t){return String(t).replace(i,".").toLowerCase()},c=u.data={},s=u.NATIVE="N",l=u.POLYFILL="P";t.exports=u},9760:function(t){t.exports=function(t){return null==t}},1632:function(t,e,n){var r=n(4328);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},2424:function(t,e,n){var r=n(1632);t.exports=function(t){return r(t)||null===t}},7048:function(t){t.exports=!1},7728:function(t,e,n){var r=n(5232),o=n(4328),i=n(7e3),u=n(6536),a=Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return o(e)&&i(e.prototype,a(t))}},3112:function(t,e,n){var r=n(8448),o=n(3951),i=n(4504);t.exports=function(t,e,n){var u,a;o(t);try{if(!(u=i(t,"return"))){if("throw"===e)throw n;return n}u=r(u,t)}catch(c){a=!0,u=c}if("throw"===e)throw n;if(a)throw u;return o(u),n}},9724:function(t,e,n){var r=n(8448),o=n(9368),i=n(3440),u=n(4036),a=n(9972),c=n(9104),s=n(4504),l=n(336).IteratorPrototype,f=n(3336),p=n(3112),d=a("toStringTag"),h="IteratorHelper",v="WrapForValidIterator",m=c.set,y=function(t){var e=c.getterFor(t?v:h);return u(o(l),{next:function(){var n=e(this);if(t)return n.nextHandler();try{var r=n.done?void 0:n.nextHandler();return f(r,n.done)}catch(o){throw n.done=!0,o}},return:function(){var n=e(this),o=n.iterator;if(n.done=!0,t){var i=s(o,"return");return i?r(i,o):f(void 0,!0)}if(n.inner)try{p(n.inner.iterator,"normal")}catch(u){return p(o,"throw",u)}return p(o,"normal"),f(void 0,!0)}})},g=y(!0),b=y(!1);i(b,d,"Iterator Helper"),t.exports=function(t,e){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=e?v:h,r.nextHandler=t,r.counter=0,r.done=!1,m(this,r)};return n.prototype=e?g:b,n}},5792:function(t,e,n){var r=n(8448),o=n(8952),i=n(3951),u=n(6752),a=n(9724),c=n(8696),s=a((function(){var t=this.iterator,e=i(r(this.next,t));if(!(this.done=!!e.done))return c(t,this.mapper,[e.value,this.counter++],!0)}));t.exports=function(t){return i(this),o(t),new s(u(this),{mapper:t})}},336:function(t,e,n){var r,o,i,u=n(9957),a=n(4328),c=n(1632),s=n(9368),l=n(7796),f=n(6076),p=n(9972),d=n(7048),h=p("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(r=o):v=!0),!c(r)||u((function(){var t={};return r[h].call(t)!==t}))?r={}:d&&(r=s(r)),a(r[h])||f(r,h,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},3556:function(t,e,n){var r=n(7584);t.exports=function(t){return r(t.length)}},5312:function(t,e,n){var r=n(1664),o=n(9957),i=n(4328),u=n(5152),a=n(3476),c=n(6208).CONFIGURABLE,s=n(9112),l=n(9104),f=l.enforce,p=l.get,d=String,h=Object.defineProperty,v=r("".slice),m=r("".replace),y=r([].join),g=a&&!o((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===v(d(e),0,7)&&(e="["+m(d(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!u(t,"name")||c&&t.name!==e)&&(a?h(t,"name",{value:e,configurable:!0}):t.name=e),g&&n&&u(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&u(n,"constructor")&&n.constructor?a&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(o){}var r=f(t);return u(r,"source")||(r.source=y(b,"string"==typeof e?e:"")),t};Function.prototype.toString=x((function(){return i(this)&&p(this).source||s(this)}),"toString")},1748:function(t){var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?n:e)(r)}},8948:function(t,e,n){var r=n(5016);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},9292:function(t,e,n){var r=n(3476),o=n(1664),i=n(8448),u=n(9957),a=n(1531),c=n(9392),s=n(8912),l=n(4356),f=n(5712),p=Object.assign,d=Object.defineProperty,h=o([].concat);t.exports=!p||u((function(){if(r&&1!==p({b:1},p(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!==p({},t)[n]||a(p({},e)).join("")!==o}))?function(t,e){for(var n=l(t),o=arguments.length,u=1,p=c.f,d=s.f;o>u;)for(var v,m=f(arguments[u++]),y=p?h(a(m),p(m)):a(m),g=y.length,b=0;g>b;)v=y[b++],r&&!i(d,m,v)||(n[v]=m[v]);return n}:p},9368:function(t,e,n){var r,o=n(3951),i=n(2056),u=n(8256),a=n(2560),c=n(4168),s=n(8168),l=n(6504),f="prototype",p="script",d=l("IE_PROTO"),h=function(){},v=function(t){return"<"+p+">"+t+"</"+p+">"},m=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},y=function(){try{r=new ActiveXObject("htmlfile")}catch(i){}var t,e,n;y="undefined"!=typeof document?document.domain&&r?m(r):(e=s("iframe"),n="java"+p+":",e.style.display="none",c.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F):m(r);for(var o=u.length;o--;)delete y[f][u[o]];return y()};a[d]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h[f]=o(t),n=new h,h[f]=null,n[d]=t):n=y(),void 0===e?n:i.f(n,e)}},2056:function(t,e,n){var r=n(3476),o=n(1576),i=n(8352),u=n(3951),a=n(4096),c=n(1531);e.f=r&&!o?Object.defineProperties:function(t,e){u(t);for(var n,r=a(e),o=c(e),s=o.length,l=0;s>l;)i.f(t,n=o[l++],r[n]);return t}},8352:function(t,e,n){var r=n(3476),o=n(9888),i=n(1576),u=n(3951),a=n(88),c=TypeError,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",d="writable";e.f=r?i?function(t,e,n){if(u(t),e=a(e),u(n),"function"==typeof t&&"prototype"===e&&"value"in n&&d in n&&!n[d]){var r=l(t,e);r&&r[d]&&(t[e]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:f in n?n[f]:r[f],writable:!1})}return s(t,e,n)}:s:function(t,e,n){if(u(t),e=a(e),u(n),o)try{return s(t,e,n)}catch(r){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},9444:function(t,e,n){var r=n(3476),o=n(8448),i=n(8912),u=n(9728),a=n(4096),c=n(88),s=n(5152),l=n(9888),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=c(e),l)try{return f(t,e)}catch(n){}if(s(t,e))return u(!o(i.f,t,e),t[e])}},5048:function(t,e,n){var r=n(9008),o=n(8256).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},9392:function(t,e){e.f=Object.getOwnPropertySymbols},7796:function(t,e,n){var r=n(5152),o=n(4328),i=n(4356),u=n(6504),a=n(2272),c=u("IE_PROTO"),s=Object,l=s.prototype;t.exports=a?s.getPrototypeOf:function(t){var e=i(t);if(r(e,c))return e[c];var n=e.constructor;return o(n)&&e instanceof n?n.prototype:e instanceof s?l:null}},7e3:function(t,e,n){var r=n(1664);t.exports=r({}.isPrototypeOf)},9008:function(t,e,n){var r=n(1664),o=n(5152),i=n(4096),u=n(2504).indexOf,a=n(2560),c=r([].push);t.exports=function(t,e){var n,r=i(t),s=0,l=[];for(n in r)!o(a,n)&&o(r,n)&&c(l,n);for(;e.length>s;)o(r,n=e[s++])&&(~u(l,n)||c(l,n));return l}},1531:function(t,e,n){var r=n(9008),o=n(8256);t.exports=Object.keys||function(t){return r(t,o)}},8912:function(t,e){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},4024:function(t,e,n){var r=n(5288),o=n(3951),i=n(2096);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(u){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},7032:function(t,e,n){var r=n(16),o=n(4427);t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},2104:function(t,e,n){var r=n(8448),o=n(4328),i=n(1632),u=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&o(n=t.toString)&&!i(a=r(n,t)))return a;if(o(n=t.valueOf)&&!i(a=r(n,t)))return a;if("string"!==e&&o(n=t.toString)&&!i(a=r(n,t)))return a;throw new u("Can't convert object to primitive value")}},9252:function(t,e,n){var r=n(5232),o=n(1664),i=n(5048),u=n(9392),a=n(3951),c=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=u.f;return n?c(e,n(t)):e}},584:function(t,e,n){var r=n(8352).f;t.exports=function(t,e,n){n in t||r(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},9092:function(t,e,n){var r=n(8448),o=n(3951),i=n(4328),u=n(1888),a=n(7680),c=TypeError;t.exports=function(t,e){var n=t.exec;if(i(n)){var s=r(n,t,e);return null!==s&&o(s),s}if("RegExp"===u(t))return r(a,t,e);throw new c("RegExp#exec called on incompatible receiver")}},7680:function(t,e,n){var r,o,i=n(8448),u=n(1664),a=n(5016),c=n(8872),s=n(3548),l=n(4696),f=n(9368),p=n(9104).get,d=n(8e3),h=n(9124),v=l("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,y=m,g=u("".charAt),b=u("".indexOf),x=u("".replace),w=u("".slice),O=(o=/b*/g,i(m,r=/a/,"a"),i(m,o,"a"),0!==r.lastIndex||0!==o.lastIndex),_=s.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];(O||S||_||d||h)&&(y=function(t){var e,n,r,o,u,s,l,d=this,h=p(d),C=a(t),E=h.raw;if(E)return E.lastIndex=d.lastIndex,e=i(y,E,C),d.lastIndex=E.lastIndex,e;var I=h.groups,j=_&&d.sticky,A=i(c,d),P=d.source,N=0,k=C;if(j&&(A=x(A,"y",""),-1===b(A,"g")&&(A+="g"),k=w(C,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==g(C,d.lastIndex-1))&&(P="(?: "+P+")",k=" "+k,N++),n=new RegExp("^(?:"+P+")",A)),S&&(n=new RegExp("^"+P+"$(?!\\s)",A)),O&&(r=d.lastIndex),o=i(m,j?n:d,k),j?o?(o.input=w(o.input,N),o[0]=w(o[0],N),o.index=d.lastIndex,d.lastIndex+=o[0].length):d.lastIndex=0:O&&o&&(d.lastIndex=d.global?o.index+o[0].length:r),S&&o&&o.length>1&&i(v,o[0],n,(function(){for(u=1;u<arguments.length-2;u++)void 0===arguments[u]&&(o[u]=void 0)})),o&&I)for(o.groups=s=f(null),u=0;u<I.length;u++)s[(l=I[u])[0]]=o[l[1]];return o}),t.exports=y},8872:function(t,e,n){var r=n(3951);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},3548:function(t,e,n){var r=n(9957),o=n(6420).RegExp,i=r((function(){var t=o("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),u=i||r((function(){return!o("a","y").sticky})),a=i||r((function(){var t=o("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:a,MISSED_STICKY:u,UNSUPPORTED_Y:i}},8e3:function(t,e,n){var r=n(9957),o=n(6420).RegExp;t.exports=r((function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},9124:function(t,e,n){var r=n(9957),o=n(6420).RegExp;t.exports=r((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},5436:function(t,e,n){var r=n(9760),o=TypeError;t.exports=function(t){if(r(t))throw new o("Can't call method on "+t);return t}},6504:function(t,e,n){var r=n(4696),o=n(7776),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},3976:function(t,e,n){var r=n(7048),o=n(6420),i=n(4636),u="__core-js_shared__",a=t.exports=o[u]||i(u,{});(a.versions||(a.versions=[])).push({version:"3.36.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},4696:function(t,e,n){var r=n(3976);t.exports=function(t,e){return r[t]||(r[t]=e||{})}},9764:function(t,e,n){var r=n(1664),o=n(6180),i=n(5016),u=n(5436),a=r("".charAt),c=r("".charCodeAt),s=r("".slice),l=function(t){return function(e,n){var r,l,f=i(u(e)),p=o(n),d=f.length;return p<0||p>=d?t?"":void 0:(r=c(f,p))<55296||r>56319||p+1===d||(l=c(f,p+1))<56320||l>57343?t?a(f,p):r:t?s(f,p,p+2):l-56320+(r-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},772:function(t,e,n){var r=n(8504),o=n(9957),i=n(6420).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},2495:function(t,e,n){var r=n(6180),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},4096:function(t,e,n){var r=n(5712),o=n(5436);t.exports=function(t){return r(o(t))}},6180:function(t,e,n){var r=n(1748);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},7584:function(t,e,n){var r=n(6180),o=Math.min;t.exports=function(t){var e=r(t);return e>0?o(e,9007199254740991):0}},4356:function(t,e,n){var r=n(5436),o=Object;t.exports=function(t){return o(r(t))}},7024:function(t,e,n){var r=n(8448),o=n(1632),i=n(7728),u=n(4504),a=n(2104),c=n(9972),s=TypeError,l=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var n,c=u(t,l);if(c){if(void 0===e&&(e="default"),n=r(c,t,e),!o(n)||i(n))return n;throw new s("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},88:function(t,e,n){var r=n(7024),o=n(7728);t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},16:function(t,e,n){var r={};r[n(9972)("toStringTag")]="z",t.exports="[object z]"===String(r)},5016:function(t,e,n){var r=n(4427),o=String;t.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},36:function(t){var e=String;t.exports=function(t){try{return e(t)}catch(n){return"Object"}}},7776:function(t,e,n){var r=n(1664),o=0,i=Math.random(),u=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+u(++o+i,36)}},6536:function(t,e,n){var r=n(772);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},1576:function(t,e,n){var r=n(3476),o=n(9957);t.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4288:function(t,e,n){var r=n(6420),o=n(4328),i=r.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},9972:function(t,e,n){var r=n(6420),o=n(4696),i=n(5152),u=n(7776),a=n(772),c=n(6536),s=r.Symbol,l=o("wks"),f=c?s.for||s:s&&s.withoutSetter||u;t.exports=function(t){return i(l,t)||(l[t]=a&&i(s,t)?s[t]:f("Symbol."+t)),l[t]}},6488:function(t,e,n){var r=n(5232),o=n(5152),i=n(3440),u=n(7e3),a=n(4024),c=n(9968),s=n(584),l=n(7512),f=n(8948),p=n(3480),d=n(3696),h=n(3476),v=n(7048);t.exports=function(t,e,n,m){var y="stackTraceLimit",g=m?2:1,b=t.split("."),x=b[b.length-1],w=r.apply(null,b);if(w){var O=w.prototype;if(!v&&o(O,"cause")&&delete O.cause,!n)return w;var _=r("Error"),S=e((function(t,e){var n=f(m?e:t,void 0),r=m?new w(t):new w;return void 0!==n&&i(r,"message",n),d(r,S,r.stack,2),this&&u(O,this)&&l(r,this,S),arguments.length>g&&p(r,arguments[g]),r}));if(S.prototype=O,"Error"!==x?a?a(S,_):c(S,_,{name:!0}):h&&y in w&&(s(S,w,y),s(S,w,"prepareStackTrace")),c(S,w),!v)try{O.name!==x&&i(O,"name",x),O.constructor=S}catch(C){}return S}}},7476:function(t,e,n){var r=n(9160),o=n(9957),i=n(1432),u=n(1632),a=n(4356),c=n(3556),s=n(4316),l=n(92),f=n(2568),p=n(953),d=n(9972),h=n(8504),v=d("isConcatSpreadable"),m=h>=51||!o((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),y=function(t){if(!u(t))return!1;var e=t[v];return void 0!==e?!!e:i(t)};r({target:"Array",proto:!0,arity:1,forced:!m||!p("concat")},{concat:function(t){var e,n,r,o,i,u=a(this),p=f(u,0),d=0;for(e=-1,r=arguments.length;e<r;e++)if(y(i=-1===e?u:arguments[e]))for(o=c(i),s(d+o),n=0;n<o;n++,d++)n in i&&l(p,d,i[n]);else s(d+1),l(p,d++,i);return p.length=d,p}})},6932:function(t,e,n){var r=n(9160),o=n(3364).filter;r({target:"Array",proto:!0,forced:!n(953)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},700:function(t,e,n){var r=n(9160),o=n(1664),i=n(5712),u=n(4096),a=n(1496),c=o([].join);r({target:"Array",proto:!0,forced:i!==Object||!a("join",",")},{join:function(t){return c(u(this),void 0===t?",":t)}})},4456:function(t,e,n){var r=n(9160),o=n(3364).map;r({target:"Array",proto:!0,forced:!n(953)("map")},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},4728:function(t,e,n){var r=n(9160),o=n(4356),i=n(3556),u=n(6728),a=n(4316);r({target:"Array",proto:!0,arity:1,forced:n(9957)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=o(this),n=i(e),r=arguments.length;a(n+r);for(var c=0;c<r;c++)e[n]=arguments[c],n++;return u(e,n),n}})},8752:function(t,e,n){var r=n(9160),o=n(6420),i=n(908),u=n(6488),a="WebAssembly",c=o[a],s=7!==new Error("e",{cause:7}).cause,l=function(t,e){var n={};n[t]=u(t,e,s),r({global:!0,constructor:!0,arity:1,forced:s},n)},f=function(t,e){if(c&&c[t]){var n={};n[t]=u(a+"."+t,e,s),r({target:a,stat:!0,constructor:!0,arity:1,forced:s},n)}};l("Error",(function(t){return function(e){return i(t,this,arguments)}})),l("EvalError",(function(t){return function(e){return i(t,this,arguments)}})),l("RangeError",(function(t){return function(e){return i(t,this,arguments)}})),l("ReferenceError",(function(t){return function(e){return i(t,this,arguments)}})),l("SyntaxError",(function(t){return function(e){return i(t,this,arguments)}})),l("TypeError",(function(t){return function(e){return i(t,this,arguments)}})),l("URIError",(function(t){return function(e){return i(t,this,arguments)}})),f("CompileError",(function(t){return function(e){return i(t,this,arguments)}})),f("LinkError",(function(t){return function(e){return i(t,this,arguments)}})),f("RuntimeError",(function(t){return function(e){return i(t,this,arguments)}}))},508:function(t,e,n){var r=n(3476),o=n(6208).EXISTS,i=n(1664),u=n(2544),a=Function.prototype,c=i(a.toString),s=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=i(s.exec);r&&!o&&u(a,"name",{configurable:!0,get:function(){try{return l(s,c(this))[1]}catch(t){return""}}})},232:function(t,e,n){var r=n(9160),o=n(9292);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},5443:function(t,e,n){var r=n(16),o=n(6076),i=n(7032);r||o(Object.prototype,"toString",i,{unsafe:!0})},880:function(t,e,n){var r=n(9160),o=n(7680);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},9836:function(t,e,n){var r=n(8448),o=n(7176),i=n(3951),u=n(9760),a=n(7584),c=n(5016),s=n(5436),l=n(4504),f=n(4764),p=n(9092);o("match",(function(t,e,n){return[function(e){var n=s(this),o=u(e)?void 0:l(e,t);return o?r(o,e,n):new RegExp(e)[t](c(n))},function(t){var r=i(this),o=c(t),u=n(e,r,o);if(u.done)return u.value;if(!r.global)return p(r,o);var s=r.unicode;r.lastIndex=0;for(var l,d=[],h=0;null!==(l=p(r,o));){var v=c(l[0]);d[h]=v,""===v&&(r.lastIndex=f(o,a(r.lastIndex),s)),h++}return 0===h?null:d}]}))},3536:function(t,e,n){var r=n(9160),o=n(6420),i=n(6100),u=n(3951),a=n(4328),c=n(7796),s=n(2544),l=n(92),f=n(9957),p=n(5152),d=n(9972),h=n(336).IteratorPrototype,v=n(3476),m=n(7048),y="constructor",g="Iterator",b=d("toStringTag"),x=TypeError,w=o[g],O=m||!a(w)||w.prototype!==h||!f((function(){w({})})),_=function(){if(i(this,h),c(this)===h)throw new x("Abstract class Iterator not directly constructable")},S=function(t,e){v?s(h,t,{configurable:!0,get:function(){return e},set:function(e){if(u(this),this===h)throw new x("You can't redefine this property");p(this,t)?this[t]=e:l(this,t,e)}}):h[t]=e};p(h,b)||S(b,g),!O&&p(h,y)&&h[y]!==Object||S(y,_),_.prototype=h,r({global:!0,constructor:!0,forced:O},{Iterator:_})},2144:function(t,e,n){var r=n(9160),o=n(8448),i=n(8952),u=n(3951),a=n(6752),c=n(9724),s=n(8696),l=n(7048),f=c((function(){for(var t,e,n=this.iterator,r=this.predicate,i=this.next;;){if(t=u(o(i,n)),this.done=!!t.done)return;if(e=t.value,s(n,r,[e,this.counter++],!0))return e}}));r({target:"Iterator",proto:!0,real:!0,forced:l},{filter:function(t){return u(this),i(t),new f(a(this),{predicate:t})}})},9080:function(t,e,n){var r=n(9160),o=n(5792);r({target:"Iterator",proto:!0,real:!0,forced:n(7048)},{map:o})}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){n.d(r,{default:function(){return Q}});n(8752),n(6932),n(4456),n(508),n(232),n(5443),n(3536),n(2144),n(9080);var t=function(){},e={},o=[],i=[];function u(n,r){var u,a,c,s,l=i;for(s=arguments.length;s-- >2;)o.push(arguments[s]);for(r&&null!=r.children&&(o.length||o.push(r.children),delete r.children);o.length;)if((a=o.pop())&&void 0!==a.pop)for(s=a.length;s--;)o.push(a[s]);else"boolean"==typeof a&&(a=null),(c="function"!=typeof n)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(c=!1)),c&&u?l[l.length-1]+=a:l===i?l=[a]:l.push(a),u=c;var f=new t;return f.nodeName=n,f.children=l,f.attributes=null==r?void 0:r,f.key=null==r?void 0:r.key,void 0!==e.vnode&&e.vnode(f),f}function a(t,e){for(var n in e)t[n]=e[n];return t}function c(t,e){t&&("function"==typeof t?t(e):t.current=e)}var s="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;var l=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function p(t){!t._dirty&&(t._dirty=!0)&&1==f.push(t)&&(e.debounceRendering||s)(d)}function d(){for(var t;t=f.pop();)t._dirty&&T(t)}function h(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&v(t,e.nodeName):n||t._componentConstructor===e.nodeName}function v(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=a({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===e[r]&&(e[r]=n[r]);return e}function y(t){var e=t.parentNode;e&&e.removeChild(t)}function g(t,e,n,r,o){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)c(n,null),c(r,t);else if("class"!==e||o)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(t.style[i]="");for(var i in r)t.style[i]="number"==typeof r[i]&&!1===l.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var u=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||t.addEventListener(e,b,u):t.removeEventListener(e,b,u),(t._listeners||(t._listeners={}))[e]=r}else if("list"!==e&&"type"!==e&&!o&&e in t){try{t[e]=null==r?"":r}catch(s){}null!=r&&!1!==r||"spellcheck"==e||t.removeAttribute(e)}else{var a=o&&e!==(e=e.replace(/^xlink:?/,""));null==r||!1===r?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof r&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function b(t){return this._listeners[t.type](e.event&&e.event(t)||t)}var x=[],w=0,O=!1,_=!1;function S(){for(var t;t=x.shift();)e.afterMount&&e.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,n,r,o,i){w++||(O=null!=o&&void 0!==o.ownerSVGElement,_=null!=t&&!("__preactattr_"in t));var u=E(t,e,n,r,i);return o&&u.parentNode!==o&&o.appendChild(u),--w||(_=!1,i||S()),u}function E(t,e,n,r,o){var i=t,u=O;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),I(t,!0))),i.__preactattr_=!0,i;var a,c,s=e.nodeName;if("function"==typeof s)return function(t,e,n,r){var o=t&&t._component,i=o,u=t,a=o&&t._componentConstructor===e.nodeName,c=a,s=m(e);for(;o&&!c&&(o=o._parentComponent);)c=o.constructor===e.nodeName;o&&c&&(!r||o._component)?(k(o,s,3,n,r),t=o.base):(i&&!a&&(R(i),t=u=null),o=P(e.nodeName,s,n),t&&!o.nextBase&&(o.nextBase=t,u=null),k(o,s,1,n,r),t=o.base,u&&t!==u&&(u._component=null,I(u,!1)));return t}(t,e,n,r);if(O="svg"===s||"foreignObject"!==s&&O,s=String(s),(!t||!v(t,s))&&(a=s,(c=O?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,i=c,t)){for(;t.firstChild;)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),I(t,!0)}var l=i.firstChild,f=i.__preactattr_,p=e.children;if(null==f){f=i.__preactattr_={};for(var d=i.attributes,b=d.length;b--;)f[d[b].name]=d[b].value}return!_&&p&&1===p.length&&"string"==typeof p[0]&&null!=l&&void 0!==l.splitText&&null==l.nextSibling?l.nodeValue!=p[0]&&(l.nodeValue=p[0]):(p&&p.length||null!=l)&&function(t,e,n,r,o){var i,u,a,c,s,l=t.childNodes,f=[],p={},d=0,v=0,m=l.length,g=0,b=e?e.length:0;if(0!==m)for(var x=0;x<m;x++){var w=l[x],O=w.__preactattr_;null!=(_=b&&O?w._component?w._component.__key:O.key:null)?(d++,p[_]=w):(O||(void 0!==w.splitText?!o||w.nodeValue.trim():o))&&(f[g++]=w)}if(0!==b)for(x=0;x<b;x++){var _;if(s=null,null!=(_=(c=e[x]).key))d&&void 0!==p[_]&&(s=p[_],p[_]=void 0,d--);else if(v<g)for(i=v;i<g;i++)if(void 0!==f[i]&&h(u=f[i],c,o)){s=u,f[i]=void 0,i===g-1&&g--,i===v&&v++;break}s=E(s,c,n,r),a=l[x],s&&s!==t&&s!==a&&(null==a?t.appendChild(s):s===a.nextSibling?y(a):t.insertBefore(s,a))}if(d)for(var x in p)void 0!==p[x]&&I(p[x],!1);for(;v<=g;)void 0!==(s=f[g--])&&I(s,!1)}(i,p,n,r,_||null!=f.dangerouslySetInnerHTML),function(t,e,n){var r;for(r in n)e&&null!=e[r]||null==n[r]||g(t,r,n[r],n[r]=void 0,O);for(r in e)"children"===r||"innerHTML"===r||r in n&&e[r]===("value"===r||"checked"===r?t[r]:n[r])||g(t,r,n[r],n[r]=e[r],O)}(i,e.attributes,f),O=u,i}function I(t,e){var n=t._component;n?R(n):(null!=t.__preactattr_&&c(t.__preactattr_.ref,null),!1!==e&&null!=t.__preactattr_||y(t),j(t))}function j(t){for(t=t.lastChild;t;){var e=t.previousSibling;I(t,!0),t=e}}var A=[];function P(t,e,n){var r,o=A.length;for(t.prototype&&t.prototype.render?(r=new t(e,n),M.call(r,e,n)):((r=new M(e,n)).constructor=t,r.render=N);o--;)if(A[o].constructor===t)return r.nextBase=A[o].nextBase,A.splice(o,1),r;return r}function N(t,e,n){return this.constructor(t,n)}function k(t,n,r,o,i){t._disable||(t._disable=!0,t.__ref=n.ref,t.__key=n.key,delete n.ref,delete n.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||i?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(n,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=n,t._disable=!1,0!==r&&(1!==r&&!1===e.syncComponentUpdates&&t.base?p(t):T(t,1,i)),c(t.__ref,t))}function T(t,n,r,o){if(!t._disable){var i,u,c,s=t.props,l=t.state,f=t.context,p=t.prevProps||s,d=t.prevState||l,h=t.prevContext||f,v=t.base,y=t.nextBase,g=v||y,b=t._component,O=!1,_=h;if(t.constructor.getDerivedStateFromProps&&(l=a(a({},l),t.constructor.getDerivedStateFromProps(s,l)),t.state=l),v&&(t.props=p,t.state=d,t.context=h,2!==n&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(s,l,f)?O=!0:t.componentWillUpdate&&t.componentWillUpdate(s,l,f),t.props=s,t.state=l,t.context=f),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!O){i=t.render(s,l,f),t.getChildContext&&(f=a(a({},f),t.getChildContext())),v&&t.getSnapshotBeforeUpdate&&(_=t.getSnapshotBeforeUpdate(p,d));var E,j,A=i&&i.nodeName;if("function"==typeof A){var N=m(i);(u=b)&&u.constructor===A&&N.key==u.__key?k(u,N,1,f,!1):(E=u,t._component=u=P(A,N,f),u.nextBase=u.nextBase||y,u._parentComponent=t,k(u,N,0,f,!1),T(u,1,r,!0)),j=u.base}else c=g,(E=b)&&(c=t._component=null),(g||1===n)&&(c&&(c._component=null),j=C(c,i,f,r||!v,g&&g.parentNode,!0));if(g&&j!==g&&u!==b){var M=g.parentNode;M&&j!==M&&(M.replaceChild(j,g),E||(g._component=null,I(g,!1)))}if(E&&R(E),t.base=j,j&&!o){for(var L=t,D=t;D=D._parentComponent;)(L=D).base=j;j._component=L,j._componentConstructor=L.constructor}}for(!v||r?x.push(t):O||(t.componentDidUpdate&&t.componentDidUpdate(p,d,_),e.afterUpdate&&e.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);w||o||S()}}function R(t){e.beforeUnmount&&e.beforeUnmount(t);var n=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var r=t._component;r?R(r):n&&(null!=n.__preactattr_&&c(n.__preactattr_.ref,null),t.nextBase=n,y(n),A.push(t),j(n)),c(t.__ref,null)}function M(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function L(t,e,n){return C(n,t,{},!1,e,!1)}a(M.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=a(a({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),p(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),T(this,2)},render:function(){}});n(700),n(4728),n(880),n(9836),n(7476);function D(t,e){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},D(t,e)}var B=function(t){var e,n;function r(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))||this).state={bump:!1,debounced:!1},e}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,D(e,n);var o=r.prototype;return o.componentWillMount=function(){var t,e,n,r,o=this;this.debounceStatusUpdate=(t=function(){if(!o.state.debounced){var t=!o.props.isInFocus||o.props.validChoiceMade;o.setState((function(e){return{bump:!e.bump,debounced:!0,silenced:t}}))}},e=1400,function(){var o=this,i=arguments,u=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(o,i)}),e),u&&t.apply(o,i)})},o.componentWillReceiveProps=function(t){t.queryLength;this.setState({debounced:!1})},o.render=function(){var t=this.props,e=t.id,n=t.length,r=t.queryLength,o=t.minQueryLength,i=t.selectedOption,a=t.selectedOptionIndex,c=t.tQueryTooShort,s=t.tNoResults,l=t.tSelectedOption,f=t.tResults,p=t.className,d=this.state,h=d.bump,v=d.debounced,m=d.silenced,y=r<o,g=0===n,b=i?l(i,n,a):"",x=null;return x=y?c(o):g?s():f(n,b),this.debounceStatusUpdate(),u("div",{className:p,style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},u("div",{id:e+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&v&&h?x:""),u("div",{id:e+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!v||h?"":x))},r}(M);B.defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,n){return t+" "+(n+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}};var F=function(t){return u("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:t.className,focusable:"false"},u("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},u("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))};function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},U.apply(this,arguments)}function V(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function q(t,e){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},q(t,e)}var W={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function H(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var K=function(t){var e,n;function r(e){var n;return(n=t.call(this,e)||this).elementReferences={},n.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},n.handleComponentBlur=n.handleComponentBlur.bind(V(n)),n.handleKeyDown=n.handleKeyDown.bind(V(n)),n.handleUpArrow=n.handleUpArrow.bind(V(n)),n.handleDownArrow=n.handleDownArrow.bind(V(n)),n.handleEnter=n.handleEnter.bind(V(n)),n.handlePrintableKey=n.handlePrintableKey.bind(V(n)),n.handleListMouseLeave=n.handleListMouseLeave.bind(V(n)),n.handleOptionBlur=n.handleOptionBlur.bind(V(n)),n.handleOptionClick=n.handleOptionClick.bind(V(n)),n.handleOptionFocus=n.handleOptionFocus.bind(V(n)),n.handleOptionMouseDown=n.handleOptionMouseDown.bind(V(n)),n.handleOptionMouseEnter=n.handleOptionMouseEnter.bind(V(n)),n.handleInputBlur=n.handleInputBlur.bind(V(n)),n.handleInputChange=n.handleInputChange.bind(V(n)),n.handleInputClick=n.handleInputClick.bind(V(n)),n.handleInputFocus=n.handleInputFocus.bind(V(n)),n.pollInputElement=n.pollInputElement.bind(V(n)),n.getDirectInputChanges=n.getDirectInputChanges.bind(V(n)),n}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,q(e,n);var o=r.prototype;return o.isQueryAnOption=function(t,e){var n=this;return-1!==e.map((function(t){return n.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},o.componentDidMount=function(){this.pollInputElement()},o.componentWillUnmount=function(){clearTimeout(this.$pollInput)},o.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},o.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},o.componentDidUpdate=function(t,e){var n=this.state.focused,r=null===n,o=e.focused!==n;o&&!r&&this.elementReferences[n].focus();var i=-1===n,u=o&&null===e.focused;if(i&&u){var a=this.elementReferences[n];a.setSelectionRange(0,a.value.length)}},o.hasAutoselect=function(){return!H()&&this.props.autoselect},o.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},o.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},o.handleComponentBlur=function(t){var e,n=this.state,r=n.options,o=n.query,i=n.selected;this.props.confirmOnBlur?(e=t.query||o,this.props.onConfirm(r[i])):e=o,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,r)})},o.handleListMouseLeave=function(t){this.setState({hovered:null})},o.handleOptionBlur=function(t,e){var n=this.state,r=n.focused,o=n.menuOpen,i=n.options,u=n.selected,a=null===t.relatedTarget,c=t.relatedTarget===this.elementReferences[-1],s=r!==e&&-1!==r;if(!s&&a||!(s||c)){var l=o&&H();this.handleComponentBlur({menuOpen:l,query:this.templateInputValue(i[u])})}},o.handleInputBlur=function(t){var e=this.state,n=e.focused,r=e.menuOpen,o=e.options,i=e.query,u=e.selected;if(!(-1!==n)){var a=r&&H(),c=H()?i:this.templateInputValue(o[u]);this.handleComponentBlur({menuOpen:a,query:c})}},o.handleInputChange=function(t){var e=this,n=this.props,r=n.minLength,o=n.source,i=n.showAllValues,u=this.hasAutoselect(),a=t.target.value,c=0===a.length,s=this.state.query!==a,l=a.length>=r;this.setState({query:a,ariaHint:c}),i||!c&&s&&l?o(a,(function(t){var n=t.length>0;e.setState({menuOpen:n,options:t,selected:u&&n?0:-1,validChoiceMade:!1})})):!c&&l||this.setState({menuOpen:!1,options:[]})},o.handleInputClick=function(t){this.handleInputChange(t)},o.handleInputFocus=function(t){var e=this.state,n=e.query,r=e.validChoiceMade,o=e.options,i=this.props.minLength,u=!r&&n.length>=i&&o.length>0;u?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:u||e,selected:-1}})):this.setState({focused:-1})},o.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},o.handleOptionMouseEnter=function(t,e){H()||this.setState({hovered:e})},o.handleOptionClick=function(t,e){var n=this.state.options[e],r=this.templateInputValue(n);this.props.onConfirm(n),this.setState({focused:-1,hovered:null,menuOpen:!1,query:r,selected:-1,validChoiceMade:!0}),this.forceUpdate()},o.handleOptionMouseDown=function(t){t.preventDefault()},o.handleUpArrow=function(t){t.preventDefault();var e=this.state,n=e.menuOpen,r=e.selected;-1!==r&&n&&this.handleOptionFocus(r-1)},o.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var n=this.state,r=n.menuOpen,o=n.options,i=n.selected;i!==o.length-1&&r&&this.handleOptionFocus(i+1)}},o.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},o.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),this.state.selected>=0&&this.handleOptionClick(t,this.state.selected))},o.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},o.handleKeyDown=function(t){switch(W[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:((e=t.keyCode)>47&&e<58||32===e||8===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223)&&this.handlePrintableKey(t)}var e},o.render=function(){var t,e=this,n=this.props,r=n.cssNamespace,o=n.displayMenu,i=n.id,a=n.minLength,c=n.name,s=n.placeholder,l=n.required,f=n.showAllValues,p=n.tNoResults,d=n.tStatusQueryTooShort,h=n.tStatusNoResults,v=n.tStatusSelectedOption,m=n.tStatusResults,y=n.tAssistiveHint,g=n.dropdownArrow,b=n.menuAttributes,x=n.inputClasses,w=n.hintClasses,O=n.menuClasses,_=this.state,S=_.focused,C=_.hovered,E=_.menuOpen,I=_.options,j=_.query,A=_.selected,P=_.ariaHint,N=_.validChoiceMade,k=this.hasAutoselect(),T=-1===S,R=0===I.length,M=0!==j.length,L=j.length>=a,D=this.props.showNoOptionsFound&&T&&R&&M&&L,F=r+"__wrapper",V=r+"__status",q=r+"__dropdown-arrow-down",W=-1!==S&&null!==S,K=r+"__option",z=r+"__hint",G=this.templateInputValue(I[A]),Q=G&&0===G.toLowerCase().indexOf(j.toLowerCase())&&k?j+G.substr(j.length):"",$=i+"__assistiveHint",Y={"aria-describedby":P?$:null,"aria-expanded":E?"true":"false","aria-activedescendant":W?i+"__option--"+S:null,"aria-controls":i+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"};f&&"string"==typeof(t=g({className:q}))&&(t=u("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}}));var X=r+"__input",J=[X,this.props.showAllValues?X+"--show-all-values":X+"--default"];null!==S&&J.push(X+"--focused"),x&&J.push(x);var Z=r+"__menu",tt=[Z,Z+"--"+o,Z+"--"+(E||D?"visible":"hidden")];O&&tt.push(O),(null!=b&&b.class||null!=b&&b.className)&&tt.push((null==b?void 0:b.class)||(null==b?void 0:b.className));var et=Object.assign({"aria-labelledby":i},b,{id:i+"__listbox",role:"listbox",className:tt.join(" "),onMouseLeave:this.handleListMouseLeave});return delete et.class,u("div",{className:F,onKeyDown:this.handleKeyDown},u(B,{id:i,length:I.length,queryLength:j.length,minQueryLength:a,selectedOption:this.templateInputValue(I[A]),selectedOptionIndex:A,validChoiceMade:N,isInFocus:null!==this.state.focused,tQueryTooShort:d,tNoResults:h,tSelectedOption:v,tResults:m,className:V}),Q&&u("span",null,u("input",{className:[z,null===w?x:w].filter(Boolean).join(" "),readonly:!0,tabIndex:"-1",value:Q})),u("input",U({},Y,{autoComplete:"off",className:J.join(" "),id:i,onClick:this.handleInputClick,onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:c,placeholder:s,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:l,value:j})),t,u("ul",et,I.map((function(t,n){var r=(-1===S?A===n:S===n)&&null===C?" "+K+"--focused":"",o=n%2?" "+K+"--odd":"",a=H()?"<span id="+i+"__option-suffix--"+n+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(n+1)+" of "+I.length+"</span>":"";return u("li",{"aria-selected":S===n?"true":"false",className:""+K+r+o,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:i+"__option--"+n,key:n,onBlur:function(t){return e.handleOptionBlur(t,n)},onClick:function(t){return e.handleOptionClick(t,n)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,n)},ref:function(t){e.elementReferences[n]=t},role:"option",tabIndex:"-1","aria-posinset":n+1,"aria-setsize":I.length})})),D&&u("li",{className:K+" "+K+"--no-results",role:"option","aria-disabled":"true"},p())),u("span",{id:$,style:{display:"none"}},y()))},r}(M);function z(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=G(t.source)),L(u(K,t),t.element)}K.defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:F,menuAttributes:{},inputClasses:null,hintClasses:null,menuClasses:null};var G=function(t){return function(e,n){n(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};z.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var n=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];n&&(n.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var n=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=n.textContent||n.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var r=document.createElement("div");t.selectElement.parentNode.insertBefore(r,t.selectElement),z(Object.assign({},t,{element:r})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var Q=z}(),r=r.default}()}));
2
+ //# sourceMappingURL=accessible-autocomplete.min.js.map
@@ -0,0 +1 @@
1
+ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).Pbf={})}(this,function(t){"use strict";const i=4294967296,e=1/i,s="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function r(t,i,e){return e?4294967296*i+(t>>>0):4294967296*(i>>>0)+(t>>>0)}function h(t,i,e){const s=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.floor(Math.log(i)/(7*Math.LN2));e.realloc(s),e.buf.copyWithin(t+s,t,e.pos)}function o(t,i){for(let e=0;e<t.length;e++)i.writeVarint(t[e])}function n(t,i){for(let e=0;e<t.length;e++)i.writeSVarint(t[e])}function a(t,i){for(let e=0;e<t.length;e++)i.writeFloat(t[e])}function d(t,i){for(let e=0;e<t.length;e++)i.writeDouble(t[e])}function l(t,i){for(let e=0;e<t.length;e++)i.writeBoolean(t[e])}function u(t,i){for(let e=0;e<t.length;e++)i.writeFixed32(t[e])}function f(t,i){for(let e=0;e<t.length;e++)i.writeSFixed32(t[e])}function p(t,i){for(let e=0;e<t.length;e++)i.writeFixed64(t[e])}function w(t,i){for(let e=0;e<t.length;e++)i.writeSFixed64(t[e])}t.PbfReader=class{constructor(t){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(t,i,e=this.length){let s;for(;s=this.nextField(e);)t(s,i,this);return i}readMessage(t,i){return this.readFields(t,i,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*i;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*i;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const i=this.buf,e=i[this.pos++];if(e<128)return e;let s,h=127&e;return s=i[this.pos++],h|=(127&s)<<7,s<128?h:(s=i[this.pos++],h|=(127&s)<<14,s<128?h:(s=i[this.pos++],h|=(127&s)<<21,s<128?h:(s=i[this.pos],h|=(15&s)<<28,function(t,i,e){const s=e.buf;let h,o;if(o=s[e.pos++],h=(112&o)>>4,o<128)return r(t,h,i);if(o=s[e.pos++],h|=(127&o)<<3,o<128)return r(t,h,i);if(o=s[e.pos++],h|=(127&o)<<10,o<128)return r(t,h,i);if(o=s[e.pos++],h|=(127&o)<<17,o<128)return r(t,h,i);if(o=s[e.pos++],h|=(127&o)<<24,o<128)return r(t,h,i);if(o=s[e.pos++],h|=(1&o)<<31,o<128)return r(t,h,i);throw new Error("Expected varint not more than 10 bytes")}(h,t,this))))}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,i=this.pos;return this.pos=t,t-i>=12&&s?s.decode(this.buf.subarray(i,t)):function(t,i,e){let s="",r=i;for(;r<e;){const i=t[r];let h,o,n,a=null,d=i>239?4:i>223?3:i>191?2:1;if(r+d>e)break;1===d?i<128&&(a=i):2===d?(h=t[r+1],128==(192&h)&&(a=(31&i)<<6|63&h,a<=127&&(a=null))):3===d?(h=t[r+1],o=t[r+2],128==(192&h)&&128==(192&o)&&(a=(15&i)<<12|(63&h)<<6|63&o,(a<=2047||a>=55296&&a<=57343)&&(a=null))):4===d&&(h=t[r+1],o=t[r+2],n=t[r+3],128==(192&h)&&128==(192&o)&&128==(192&n)&&(a=(15&i)<<18|(63&h)<<12|(63&o)<<6|63&n,(a<=65535||a>=1114112)&&(a=null))),null===a?(a=65533,d=1):a>65535&&(a-=65536,s+=String.fromCharCode(a>>>10&1023|55296),a=56320|1023&a),s+=String.fromCharCode(a),r+=d}return s}(this.buf,i,t)}readBytes(){const t=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,t);return this.pos=t,i}readPackedVarint(t=[],i){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readVarint(i));return t}readPackedSVarint(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readSFixed64());return t}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(t=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=t)return 0;const i=this.readVarint();return this.type=7&i,this._valueStart=this.pos,i>>>3}skip(t){const i=7&t;if(0===i)for(;this.buf[this.pos++]>127;);else if(2===i)this.pos=this.readVarint()+this.pos;else if(5===i)this.pos+=4;else{if(1!==i)throw new Error(`Unimplemented type: ${i}`);this.pos+=8}}},t.PbfWriter=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.length=this.buf.length}writeTag(t,i){this.writeVarint(t<<3|i)}realloc(t){let i=this.length||16;for(;i<this.pos+t;)i*=2;if(i!==this.length){const t=new Uint8Array(i);t.set(this.buf),this.buf=t,this.dataView=new DataView(t.buffer),this.length=i}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*e),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*e),!0),this.pos+=8}writeVarint(t){if((t=+t||0)>=0&&t<128)return this.pos>=this.length&&this.realloc(1),void(this.buf[this.pos++]=t);t>268435455||t<0?function(t,i){let e,s;t>=0?(e=t%4294967296|0,s=t/4294967296|0):(e=~(-t%4294967296),s=~(-t/4294967296),4294967295^e?e=e+1|0:(e=0,s=s+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),function(t,i,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}(e,0,i),function(t,i){const e=(7&t)<<4;if(i.buf[i.pos++]|=e|((t>>>=3)?128:0),!t)return;if(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),!t)return;i.buf[i.pos++]=127&t}(s,i)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const i=this.pos;this.pos=function(t,i,e){for(let s,r,h=0;h<i.length;h++){if(s=i.charCodeAt(h),s>55295&&s<57344){if(!r){s>56319||h+1===i.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=s;continue}if(s<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=s;continue}s=r-55296<<10|s-56320|65536,r=null}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);s<128?t[e++]=s:(s<2048?t[e++]=s>>6|192:(s<65536?t[e++]=s>>12|224:(t[e++]=s>>18|240,t[e++]=s>>12&63|128),t[e++]=s>>6&63|128),t[e++]=63&s|128)}return e}(this.buf,t,this.pos);const e=this.pos-i;e>=128&&h(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const i=t.length;this.writeVarint(i),this.realloc(i),this.buf.set(t,this.pos),this.pos+=i}writeRawMessage(t,i){this.pos++;const e=this.pos;t(i,this);const s=this.pos-e;s>=128&&h(e,s,this),this.pos=e-1,this.writeVarint(s),this.pos+=s}writeMessage(t,i,e){this.writeTag(t,2),this.writeRawMessage(i,e)}writePackedVarint(t,i){i.length&&this.writeMessage(t,o,i)}writePackedSVarint(t,i){i.length&&this.writeMessage(t,n,i)}writePackedBoolean(t,i){i.length&&this.writeMessage(t,l,i)}writePackedFloat(t,i){i.length&&this.writeMessage(t,a,i)}writePackedDouble(t,i){i.length&&this.writeMessage(t,d,i)}writePackedFixed32(t,i){i.length&&this.writeMessage(t,u,i)}writePackedSFixed32(t,i){i.length&&this.writeMessage(t,f,i)}writePackedFixed64(t,i){i.length&&this.writeMessage(t,p,i)}writePackedSFixed64(t,i){i.length&&this.writeMessage(t,w,i)}writeBytesField(t,i){this.writeTag(t,2),this.writeBytes(i)}writeFixed32Field(t,i){this.writeTag(t,5),this.writeFixed32(i)}writeSFixed32Field(t,i){this.writeTag(t,5),this.writeSFixed32(i)}writeFixed64Field(t,i){this.writeTag(t,1),this.writeFixed64(i)}writeSFixed64Field(t,i){this.writeTag(t,1),this.writeSFixed64(i)}writeVarintField(t,i){this.writeTag(t,0),this.writeVarint(i)}writeSVarintField(t,i){this.writeTag(t,0),this.writeSVarint(i)}writeStringField(t,i){this.writeTag(t,2),this.writeString(i)}writeFloatField(t,i){this.writeTag(t,5),this.writeFloat(i)}writeDoubleField(t,i){this.writeTag(t,1),this.writeDouble(i)}writeBooleanField(t,i){this.writeVarintField(t,+i)}}});
package/dist/index.d.ts CHANGED
@@ -1,30 +1,33 @@
1
+ //#region src/types/global_interfaces.d.ts
1
2
  interface Config {
2
- agency: {
3
- agency_key: string;
4
- gtfs_static_path?: string;
5
- gtfs_static_url?: string;
6
- gtfs_rt_tripupdates_url: string;
7
- gtfs_rt_tripupdates_headers?: Record<string, string>;
8
- exclude?: string[];
9
- };
10
- assetPath?: string;
11
- beautify?: boolean;
12
- startDate?: string;
13
- endDate?: string;
14
- locale?: string;
15
- includeCoordinates?: boolean;
16
- noHead?: boolean;
17
- outputPath?: string;
18
- overwriteExistingFiles?: boolean;
19
- refreshIntervalSeconds?: number;
20
- skipImport?: boolean;
21
- sqlitePath?: string;
22
- templatePath?: string;
23
- timeFormat?: string;
24
- verbose?: boolean;
25
- logFunction?: (text: string) => void;
3
+ agency: {
4
+ agency_key: string;
5
+ gtfs_static_path?: string;
6
+ gtfs_static_url?: string;
7
+ gtfs_rt_tripupdates_url: string;
8
+ gtfs_rt_tripupdates_headers?: Record<string, string>;
9
+ exclude?: string[];
10
+ };
11
+ assetPath?: string;
12
+ beautify?: boolean;
13
+ startDate?: string;
14
+ endDate?: string;
15
+ locale?: string;
16
+ includeCoordinates?: boolean;
17
+ noHead?: boolean;
18
+ outputPath?: string;
19
+ overwriteExistingFiles?: boolean;
20
+ refreshIntervalSeconds?: number;
21
+ skipImport?: boolean;
22
+ sqlitePath?: string;
23
+ templatePath?: string;
24
+ timeFormat?: string;
25
+ verbose?: boolean;
26
+ logFunction?: (text: string) => void;
26
27
  }
27
-
28
+ //#endregion
29
+ //#region src/lib/transit-departures-widget.d.ts
28
30
  declare function transitDeparturesWidget(initialConfig: Config): Promise<void>;
29
-
31
+ //#endregion
30
32
  export { transitDeparturesWidget as default };
33
+ //# sourceMappingURL=index.d.ts.map