{"version":3,"file":"character-count.mjs","sources":["../../../../src/govuk/components/character-count/character-count.mjs"],"sourcesContent":["/* eslint-disable es-x/no-date-now -- Polyfill imported */\n/* eslint-disable es-x/no-function-prototype-bind -- Polyfill imported */\n\nimport { closestAttributeValue } from '../../common/closest-attribute-value.mjs'\nimport { extractConfigByNamespace, mergeConfigs } from '../../common/index.mjs'\nimport { normaliseDataset } from '../../common/normalise-dataset.mjs'\nimport { I18n } from '../../i18n.mjs'\nimport '../../vendor/polyfills/Date/now.mjs'\nimport '../../vendor/polyfills/Element/prototype/classList.mjs'\nimport '../../vendor/polyfills/Event.mjs' // addEventListener, event.target normalization and DOMContentLoaded\nimport '../../vendor/polyfills/Function/prototype/bind.mjs'\n\n/**\n * @constant\n * @type {CharacterCountTranslations}\n * @see Default value for {@link CharacterCountConfig.i18n}\n * @default\n */\nvar CHARACTER_COUNT_TRANSLATIONS = {\n // Characters\n charactersUnderLimit: {\n one: 'You have %{count} character remaining',\n other: 'You have %{count} characters remaining'\n },\n charactersAtLimit: 'You have 0 characters remaining',\n charactersOverLimit: {\n one: 'You have %{count} character too many',\n other: 'You have %{count} characters too many'\n },\n // Words\n wordsUnderLimit: {\n one: 'You have %{count} word remaining',\n other: 'You have %{count} words remaining'\n },\n wordsAtLimit: 'You have 0 words remaining',\n wordsOverLimit: {\n one: 'You have %{count} word too many',\n other: 'You have %{count} words too many'\n },\n textareaDescription: {\n other: ''\n }\n}\n\n/**\n * JavaScript enhancements for the CharacterCount component\n *\n * Tracks the number of characters or words in the `.govuk-js-character-count`\n * `